Inheritance: extends SimpleExtension
 /**
  * Creates a new ViewableCommentList object.
  */
 public function __construct()
 {
     parent::__construct();
     // get avatars
     if (!empty($this->sqlSelects)) {
         $this->sqlSelects .= ',';
     }
     $this->sqlSelects .= "user_avatar.*, user_table.*";
     $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user user_table ON (user_table.userID = comment.userID)";
     $this->sqlJoins .= " LEFT JOIN wcf" . WCF_N . "_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)";
 }
 public function ShowById($id, $list = 1)
 {
     $mode_txt = 'Отдельный образ';
     $gender_txt = lng('NOT_SET');
     $skins = '';
     $skins_count = 1;
     $skin = new SPItem($id, $this->st_subdir);
     if (!$skin->Exist()) {
         $html_skin_list = 'Скин удален';
     } else {
         $skins = $skin->Show(false, $full_info = true);
         ob_start();
         include $this->GetView('skin_container.html');
         $html_skin_list = ob_get_clean();
         if ($this->discus) {
             loadTool('comment.class.php');
             $comments = new CommentList($skin, $this->base_url . '&cid=' . $id, 'news/comments/');
             $html_skin_list .= $comments->Show($list);
             $html_skin_list .= $comments->ShowAddForm();
         }
     }
     ob_start();
     include $this->GetView('main.html');
     return ob_get_clean();
 }
Beispiel #3
0
    /**
     * @param int $image_id
     * @return string
     */
    protected function build_postbox($image_id)
    {
        global $config;
        $i_image_id = int_escape($image_id);
        $hash = CommentList::get_hash();
        $h_captcha = $config->get_bool("comment_captcha") ? captcha_get_html() : "";
        return '
		<div class="comment">
			' . make_form(make_link("comment/add")) . '
				<input type="hidden" name="image_id" value="' . $i_image_id . '" />
				<input type="hidden" name="hash" value="' . $hash . '" />
				<textarea id="comment_on_' . $i_image_id . '" name="comment" rows="5" cols="50"></textarea>
				' . $h_captcha . '
				<br><input type="submit" value="Post Comment" />
			</form>
		</div>
		';
    }
Beispiel #4
0
 protected function build_postbox($image_id)
 {
     global $config;
     $i_image_id = int_escape($image_id);
     $hash = CommentList::get_hash();
     $captcha = $config->get_bool("comment_captcha") ? captcha_get_html() : "";
     return "\n\t\t\t" . make_form(make_link("comment/add")) . "\n\t\t\t\t<input type='hidden' name='image_id' value='{$i_image_id}' />\n\t\t\t\t<input type='hidden' name='hash' value='{$hash}' />\n\t\t\t\t<textarea name='comment' rows='5' cols='50'></textarea>\n\t\t\t\t{$captcha}\n\t\t\t\t<br><input type='submit' value='Post Comment' />\n\t\t\t</form>\n\t\t";
 }
Beispiel #5
0
        global $edited_Item;
        $edited_Item = $Item;
        // COPY or it will be out of scope for display funcs
        require dirname(__FILE__) . '/inc/_item_links.inc.php';
        echo '</div>';
        // ---------- comments ----------
        ?>
			<div class="bFeedback">
			<a id="comments"></a>
			<h4><?php 
        echo T_('Comments'), ', ', T_('Trackbacks'), ', ', T_('Pingbacks');
        ?>
:</h4>
			<?php 
        global $CommentList;
        $CommentList = new CommentList(NULL, "'comment','trackback','pingback'", array(), $Item->ID, '', 'ASC');
        $CommentList->display_if_empty(array('before' => '<div class="bComment"><p>', 'after' => '</p></div>', 'msg_empty' => T_('No feedback for this post yet...')));
        // Display list of comments:
        require $inc_path . 'comments/views/_comment_list.inc.php';
        if ($Item->can_comment()) {
            // User can leave a comment
            ?>
			<!-- ========== FORM to add a comment ========== -->
			<h4><?php 
            echo T_('Leave a comment');
            ?>
:</h4>

			<?php 
            $Form =& new Form($htsrv_url . 'comment_post.php', 'comment_checkchanges');
            $Form->begin_form('bComment');
Beispiel #6
0
<?php

/*
 * Speichert Änderungen am Projekt und leitet auf die Projektseite zurück
 *
 * @author Cédric Neukom
 */
if ($template instanceof Template) {
    // Projektinstanz erzeuten, um Änderungen zu speichern
    $project = new project($_GET['pid']);
    print_r($_POST);
    // Kommentare entfernen
    if (!empty($_POST['removeComment']) && is_array($_POST['removeComment'])) {
        $comments = new CommentList(CommentList::TYPE_PROJECT, $_GET['pid']);
        $comments->removeComments($_POST['removeComment']);
    }
    //Beschreibung ändern
    if (!empty($_POST['description']) && strlen($_POST['description']) <= 2048) {
        $_POST['description'] = strip_tags($_POST['description']);
        $_POST['description'] = str_replace("\n", '!newline!', $_POST['description']);
        $project->description = $_POST['description'];
    }
    //Projekt Name ändern ändern
    if (!empty($_POST['name']) && strlen($_POST['name']) <= 64) {
        $_POST['name'] = strip_tags($_POST['name']);
        $project->name = $_POST['name'];
    }
    //Version hinzufügen
    if (!empty($_POST['version']) && preg_match('/[0-9]+\\.[0-9]+\\.[0-9]+/', $_POST['version'])) {
        if (!empty($_POST['versionfile']) && is_file(SYS_TEMP_FOLDER . $_POST['versionfile'])) {
            $project->setVersion($_POST['version'], $_POST['versionfile']);
Beispiel #7
0
        echo '
          ' . $a->getSummary() . ($is_admin || $login == $a->getLogin() || user_is_assistant($login, $a->getLogin()) || $login == $create_by || user_is_assistant($login, $create_by) ? ' [<a href="docdel.php?blid=' . $a->getId() . '" onclick="return confirm( \'' . $areYouSureStr . '\' );">' . translate('Delete') . '</a>]' : '') . '<br />';
    }
    $num_app = $num_rej = $num_wait = 0;
    $num_attach = $attList->getSize();
    echo ($num_attach == 0 ? '
          ' . translate('None') . '<br />' : '') . '
        </td>
      </tr>';
}
if (Doc::commentsEnabled()) {
    echo '
      <tr>
        <td class="aligntop bold">' . translate('Comments') . ':</td>
        <td>';
    $comList = new CommentList($id);
    $num_comment = $comList->getSize();
    $comment_text = '';
    for ($i = 0; $i < $num_comment; $i++) {
        $cmt = $comList->getDoc($i);
        user_load_variables($cmt->getLogin(), 'cmt_');
        $comment_text .= '
          <strong>' . htmlspecialchars($cmt->getDescription()) . '</strong> - ' . $cmt_fullname . ' ' . translate('at') . ' ' . date_to_str($cmt->getModDate(), '', false, true) . ' ' . display_time($cmt->getModTime(), 2) . ($is_admin || $login == $cmt->getLogin() || user_is_assistant($login, $cmt->getLogin()) || $login == $create_by || user_is_assistant($login, $create_by) ? ' [<a href="docdel.php?blid=' . $cmt->getId() . '" onclick="return confirm( \'' . $areYouSureStr . '\' );">' . translate('Delete') . '</a>]' : '') . '<br />
          <blockquote id="eventcomment">' . nl2br(activate_urls(htmlspecialchars($cmt->getData()))) . '
        </blockquote><div style="clear:both"></div>';
    }
    if ($num_comment == 0) {
        echo translate('None') . '<br />';
    } else {
        echo '
          ' . $num_comment . ' ' . translate('comments') . '
Beispiel #8
0
 public function ShowFull($comment_list = false)
 {
     global $config, $bd_names;
     $link = Rewrite::GetURL(array('news', $this->id), array('', 'id'));
     $item_exist = $this->Exist();
     $title = $item_exist ? $this->title() : 'Новость не найдена';
     $category_id = $item_exist ? $this->categoryID() : 0;
     $category = $item_exist ? CategoryManager::GetNameByID($category_id) : 'Без категории';
     $category_link = Rewrite::GetURL(array('category', $category_id), array('', 'cid'));
     ob_start();
     include $this->GetView('news_full_header.html');
     $html = ob_get_clean();
     $html .= $this->Show(true);
     if (!$item_exist) {
         return $html;
     }
     loadTool('comment.class.php');
     $comments = new CommentList($this, $this->link_work, $this->st_subdir . 'comments/');
     $html .= $comments->Show($comment_list);
     if ($this->discus) {
         $html .= $comments->ShowAddForm();
     }
     return $html;
 }
 /**
  * Returns the RelationList of all comments against this object. Can be used as a data source
  * for a gridfield with write access.
  *
  * @return CommentList
  */
 public function AllComments()
 {
     $order = $this->owner->getCommentsOption('order_comments_by');
     $comments = CommentList::create($this->ownerBaseClass)->forForeignID($this->owner->ID)->sort($order);
     $this->owner->extend('updateAllComments', $comments);
     return $comments;
 }