public static function mention($markup, $matches)
 {
     $mention = $matches[0];
     $thread_id = self::$mention_thread_id;
     $username = stripslashes(substr($mention, 1));
     if ($username[0] !== '"') {
         $user_id = get_userid($username);
     } else {
         $name = substr($username, 1, strlen($username) - 2);
         $db = DBManager::get();
         $user_id = $db->query("SELECT user_id FROM auth_user_md5 WHERE CONCAT(Vorname, ' ', Nachname) = " . $db->quote($name) . " " . "")->fetch(PDO::FETCH_COLUMN, 0);
     }
     $thread = new ForumPosting($thread_id);
     if (!$thread->isNew() && $user_id && $user_id !== $GLOBALS['user']->id) {
         $user = new User($user_id);
         $messaging = new messaging();
         $url = $GLOBALS['ABSOLUTE_URI_STUDIP'] . "plugins.php/blubber/forum/thread/" . $thread_id . ($thread['context_type'] === "course" ? '?cid=' . $thread['Seminar_id'] : "");
         $messaging->insert_message(sprintf(_("%s hat Sie in einem Blubber erwähnt. Zum Beantworten klicken auf Sie auf folgenen Link:\n\n%s\n"), get_fullname(), $url), get_username($user_id), $GLOBALS['user']->id, null, null, null, null, _("Sie wurden erwähnt."));
         DBManager::get()->exec("INSERT IGNORE INTO blubber_mentions " . "SET user_id = " . DBManager::get()->quote($user_id) . ", " . "topic_id = " . DBManager::get()->quote($thread_id) . ", " . "mkdate = UNIX_TIMESTAMP() " . "");
         return '[' . $user['Vorname'] . " " . $user['Nachname'] . ']' . $GLOBALS['ABSOLUTE_URI_STUDIP'] . "about.php?username=" . $user['username'] . ' ';
     } else {
         return stripslashes($mention);
     }
 }
                        <label>
                            <?php 
echo Assets::img("icons/16/black/seminar", array('class' => "text-bottom"));
?>
                            <br>
                            <?php 
echo _("Veranstaltung");
?>
                        </label>
                    </td>
                    <td>
                        <?php 
echo _("Im Kurs");
?>
                        <select name="context">
                            <? foreach (ForumPosting::getMyBlubberCourses() as $course_id) : ?>
                            <? $seminar = new Seminar($course_id) ?>
                            <option value="<?php 
echo htmlReady($course_id);
?>
"><?php 
echo htmlReady($seminar->getName());
?>
</option>
                            <? endforeach ?>
                        </select>
                    </td>
                </tr>
            </tbody>
        </table>
        <div>
Beispiel #3
0
 public function feed_action($user_id)
 {
     $this->layout = null;
     $this->set_content_type("application/xml+atom");
     $this->postings = ForumPosting::getThreads(array('user_id' => $user_id));
 }
 public function __construct()
 {
     global $perm;
     parent::__construct();
     if (UpdateInformation::isCollecting()) {
         $data = Request::getArray("page_info");
         if (stripos(Request::get("page"), "plugins.php/blubber") !== false) {
             $output = array();
             $context_id = $data['Blubber']['context_id'];
             $stream = $data['Blubber']['stream'];
             $last_check = $data['Blubber']['last_check'] ? $data['Blubber']['last_check'] : time() - 5 * 60;
             $parameter = array('since' => $last_check);
             if ($stream === "thread") {
                 $parameter['thread'] = $context_id;
             }
             if ($stream === "course") {
                 $parameter['seminar_id'] = $context_id;
             }
             if ($stream === "profile") {
                 $parameter['user_id'] = $context_id;
             }
             if ($data['Blubber']['search']) {
                 $parameter['search'] = $data['Blubber']['search'];
             }
             $new_postings = ForumPosting::getPostings($parameter);
             $factory = new Flexi_TemplateFactory($this->getPluginPath() . "/views");
             foreach ($new_postings as $new_posting) {
                 if ($new_posting['root_id'] === $new_posting['topic_id']) {
                     $thread = $new_posting;
                     $template = $factory->open("forum/thread.php");
                     $template->set_attribute('thread', $new_posting);
                 } else {
                     $thread = new ForumPosting($new_posting['root_id']);
                     $template = $factory->open("forum/comment.php");
                     $template->set_attribute('posting', $new_posting);
                 }
                 ForumPosting::$course_hashes = $thread['user_id'] !== $thread['Seminar_id'] ? $thread['Seminar_id'] : false;
                 $template->set_attribute("course_id", $data['Blubber']['seminar_id']);
                 $output['postings'][] = array('posting_id' => $new_posting['topic_id'], 'mkdate' => $new_posting['mkdate'], 'root_id' => $new_posting['root_id'], 'content' => $template->render());
             }
             UpdateInformation::setInformation("Blubber.getNewPosts", $output);
             //Events-Queue:
             $db = DBManager::get();
             $events = $db->query("SELECT event_type, item_id " . "FROM blubber_events_queue " . "WHERE mkdate >= " . $db->quote($last_check) . " " . "ORDER BY mkdate ASC " . "")->fetchAll(PDO::FETCH_ASSOC);
             UpdateInformation::setInformation("Blubber.blubberEvents", $events);
             $db->exec("DELETE FROM blubber_events_queue " . "WHERE mkdate < UNIX_TIMESTAMP() - 60 * 60 * 6 " . "");
         }
     }
     if (Navigation::hasItem("/course") && $this->isActivated() && version_compare($GLOBALS['SOFTWARE_VERSION'], "2.4") <= 0) {
         $tab = new AutoNavigation($this->getDisplayTitle(), PluginEngine::getLink($this, array(), "forum/forum"));
         $tab->setImage($this->getPluginURL() . "/assets/images/blubber_white.png");
         Navigation::addItem("/course/blubberforum", $tab);
     }
     if (Navigation::hasItem("/community")) {
         $nav = new AutoNavigation($this->getDisplayTitle(), PluginEngine::getURL($this, array(), "forum/globalstream"));
         Navigation::insertItem("/community/blubber", $nav, "online");
         Navigation::getItem("/community")->setURL(PluginEngine::getURL($this, array(), "forum/globalstream"));
     }
     if (Navigation::hasItem("/profile")) {
         $nav = new AutoNavigation(_("Blubber"), PluginEngine::getURL($this, array('user_id' => get_userid(Request::get("username"))), "forum/profile"));
         Navigation::addItem("/profile/blubber", $nav);
     }
 }
Beispiel #5
0
            <? if ($GLOBALS['perm']->have_studip_perm("tutor", $posting['Seminar_id']) or ($posting['user_id'] === $GLOBALS['user']->id)) : ?>
            <a href="#" class="edit" onClick="return false;" title="<?php 
echo _("Bearbeiten");
?>
" style="vertical-align: middle; opacity: 0.6; width: 14px; height:14px; display: inline-block; background: url('<?php 
echo Assets::image_path("icons/16/grey/tools.png");
?>
') center center; background-position: center center;"></a>
            <? endif ?>
        </div>
        <div class="name">
            <? if (!$author->isNew()) : ?>
            <a href="<?php 
echo URLHelper::getLink($author->getURL(), array(), true);
?>
">
            <? endif ?>
                <?php 
echo htmlReady($author_name);
?>
            <? if (!$author->isNew()) : ?>
            </a>
            <? endif ?>
        </div>
        <div class="content">
            <?php 
echo ForumPosting::format($posting['description']);
?>
        </div>
    </div>
</li>
Beispiel #6
0
                <?php 
echo htmlReady($author_name);
?>
            <? if (!$author->isNew()) : ?>
            </a>
            <? endif ?>
        </div>
        <div class="content">
            <? 
            $content = $thread['description'];
            if ($thread['name'] && strpos($thread['description'], $thread['name']) === false) {
                $content = $thread['name']."\n".$content;
            }
            ?>
            <?php 
echo ForumPosting::format($content);
?>
        </div>
    </div>

    <ul class="comments">
    <? $postings = $thread->getChildren() ?>
    <? if ($postings) : ?>
        <? if (count($postings) > 3) : ?>
        <li class="more">
            <?php 
echo sprintf(ngettext('%u weiterer Kommentar', '%u weitere Kommentare', count($postings) - 3), count($postings) - 3);
?>
            ...
        </li>
        <? endif; ?>