예제 #1
0
 /**
  * @httpMethod post
  *
  * @check_client_id
  */
 public function update()
 {
     $user = $this->aclUser;
     $result = $this->getLogic("status")->post($user->id, $this->comment);
     if ($this->isAjaxRequest()) {
         if ($result->isSuccess()) {
             $this->ajax->values = array("id" => $result->aStatus->id, "name" => $user->name, "comment" => showComment($result->aStatus->comment), "updated" => showUpdatedAt($result->aStatus->created_at), "user_home" => uri("n: users, c: {$user->name}, a: "), "image_uri" => user_avatarize($user->id), "status_uri" => uri("c: index, a: status, param: {$result->aStatus->id}"), "trash_gif" => linkto("images/trash.gif"), "reply_gif" => linkto("images/reply.gif"));
         } else {
             $this->ajax->failure();
         }
     } else {
         $this->redirect->to("n: default, c: user, a: home");
     }
 }
예제 #2
0
}
function addComment($storyCreator, $replyTo)
{
    echo "<form action=\"submit_comment.php\" method=\"POST\">";
    echo "<input type=\"hidden\" name=\"token\" value=" . htmlspecialchars($_SESSION['token']) . ">";
    echo "<p> Reply to:" . htmlspecialchars($replyTo) . "</p>";
    echo "<p> <textarea name=\"commentContent\" rows = 10 ></textarea> </p>";
    echo "<input  type=\"hidden\" name=\"replyCommentTo\" value = " . htmlspecialchars($replyTo) . ">";
    echo "<p> <input type=\"submit\" name=\"submitComment_button\" value=\"Submit\"> </p>";
    echo "</form>";
}
session_start();
$storyCreator = showStory();
showLink();
echo "<br><br><br><br>";
showComment();
if (isset($_SESSION['user_name'])) {
    if (isset($_POST["replyCommentButton"])) {
        $replyTo = htmlspecialchars($_POST["replyCommentTo"]);
    } elseif (isset($_POST["replyStoryButton"])) {
        $replyTo = htmlspecialchars($_POST["replyStory"]);
    } else {
        $replyTo = $storyCreator;
    }
    addComment($storyCreator, $replyTo);
} else {
    echo "<br>log in to reply<br><br>";
}
?>
			
			<form action="storyBoard.php" >
예제 #3
0
						<div class="mar_bottom" id="<?php 
    echo $markAsReadId;
    ?>
_">
							<div style="padding: 2px" class="commentHeader">
								<?php 
    echo getIMG(url() . "images/emoticons/" . $icon);
    ?>
								<?php 
    echo sprintf(_UPD_COMMENT_ON, $parentType . ' <a href="' . $parentURL . '">' . strip_tags(formatText($title)) . '</a>');
    ?>
:
							</div>
							<div style="margin-top: -8px">
								<?php 
    showComment($comData, 0, true, $markAsReadId);
    ?>
							</div>
						</div>
					</div>
					<?php 
}
?>
			</div>
		</div>
		<?php 
iefixEnd();
$_currentPageURL = $saveCurrentPageURL;
?>
	</div>
	<?php 
예제 #4
0
if (isset($_POST["sendReply"])) {
    $noEmoticons = isset($_POST["commentNoEmoticons"]) ? 1 : 0;
    $noSig = isset($_POST["commentNoSig"]) ? 1 : 0;
    $noBBCode = isset($_POST["commentNoBBCode"]) ? 1 : 0;
    $comment = addslashes(substr($_POST["comment"], 0, 40000));
    $title = addslashes($_POST["title"]);
    if ($title == "") {
        $title = _PM_UNTITLED;
    }
    $userIp = getHexIp($_SERVER["REMOTE_ADDR"]);
    sql_query("UPDATE `pms` " . "SET `pmsTotalEdits` = `pmsTotalEdits` + 1, " . "`pmsLastEdit` = NOW(), " . "`pmsEditIp` = '{$userIp}', " . "`pmsTitle` = '{$title}', " . "`pmsComment` = '{$comment}', " . "`pmsNoEmoticons` = '{$noEmoticons}', " . "`pmsNoSig` = '{$noSig}', " . "`pmsNoBBCode` = '{$noBBCode}' " . "WHERE `pmsid` = '{$pmsid}' LIMIT 1");
    redirect($_POST["referer"]);
}
$commentDefault = $comData["pmsComment"];
$comTitle = $comData["pmsTitle"];
showComment($comData, 0, true);
echo '<div class="sep header">' . _EDIT_PM . '</div>';
?>
	<div class="mar_bottom">
		<input class="<?php 
echo $_isIE ? "wide" : "notsowide";
?>
 largetext" name="title" type="text"
			value="<?php 
echo htmlspecialchars($comTitle);
?>
" />
	</div>
	<?php 
include INCLUDES . "mod_comment.php";
?>
예제 #5
0
    echo __('File Attachment');
    ?>
</h3>
  <div itemprop="associatedMedia">
    <div class="s-download">
      <?php 
    echo $file_att;
    ?>
    </div> 
  </div>
  <?php 
}
?>

  <!-- Comment
  ============================================= -->  
  <?php 
if (isset($_SESSION['mid'])) {
    ?>
  <h3><i class="fa fa-comments-o"></i> <?php 
    echo __('Comments');
    ?>
</h3>
  <?php 
    echo showComment($biblio_id);
    ?>
  <?php 
}
?>

</div>
예제 #6
0
    }
    return showComment($comment, $tpl);
} else {
    if ($Module->isCurrentAction('Cancel')) {
        $redirectionURI = $http->postVariable('ezcomments_comment_redirect_uri');
        return $Module->redirectTo($redirectionURI);
    } else {
        $redirectURI = null;
        if ($http->hasSessionVariable("LastAccessesURI")) {
            $redirectURI = $http->sessionVariable('LastAccessesURI');
        } else {
            $redirectURI = '/comment/view/' . $comment->attribute('contentobject_id');
            $redirectURI = eZURI::transformURI($redirectURI);
        }
        $tpl->setVariable('redirect_uri', $redirectURI);
        return showComment($comment, $tpl);
    }
}
/**
 *
 * @param $comment
 * @param $tpl
 * @return array
 */
function showComment($comment, $tpl)
{
    $tpl->setVariable('comment', $comment);
    $Result = array();
    $Result['path'] = array(array('url' => false, 'text' => ezpI18n::tr('ezcomments/comment/edit', 'Edit comment')));
    $Result['content'] = $tpl->fetch('design:comment/edit.tpl');
    return $Result;
예제 #7
0
      <div class="control-group">
        <label class="control-label key"><?php 
print __('Specific Detail Info');
?>
</label>
        <div class="controls">{spec_detail_info}</div>
      </div>
      <div class="control-group">
        <label class="control-label key"><?php 
print __('File Attachment');
?>
</label>
        <div class="controls" itemprop="associatedMedia">{file_att}</div>
      </div>
      <div class="control-group">
        <label class="control-label key"><?php 
print __('Availability');
?>
</label>
        <div class="controls">{availability}</div>
      </div>
    </div>
  </div>
  <div class="clearfix"></div>
  <?php 
echo showComment($detail_id);
?>
</div>
<?php 
// put the buffer to template var
$detail_template = ob_get_clean();
예제 #8
0
$result = sql_query("SELECT COUNT(*) FROM `news`");
$totalCount = mysql_result($result, 0);
$result = sql_query("SELECT * FROM `news` ORDER BY `newSubmitDate` DESC LIMIT {$offset}," . ($_newsPerPage + 1));
$newsToGo = $_newsPerPage;
while ($rowData = mysql_fetch_assoc($result)) {
    $comData = array();
    $comData["comid"] = 0;
    $comData["comCreator"] = $rowData["newCreator"];
    $comData["comComment"] = $rowData["newComment"];
    $comData["comSubject"] = $rowData["newSubject"];
    $comData["comSubmitDate"] = $rowData["newSubmitDate"];
    $comData["comNoEmoticons"] = $rowData["newNoEmoticons"];
    $comData["comNoSig"] = $rowData["newNoSig"];
    $comData["comNoBBCode"] = $rowData["newNoBBCode"];
    $comData["newid"] = $rowData["newid"];
    showComment($comData, 0);
    $newsToGo--;
    if (!$newsToGo) {
        break;
    }
}
?>
		</div>
		<div class="padded a_center">
		<?php 
navControls($offset, $_newsPerPage, $totalCount, "", "", "", "", "newsOffset");
?>
		</div>
	</div>
	<div class="clear">&nbsp;</div>
	<?php 
예제 #9
0
</div>
			<div class="container2"><?php 
    echo _COLLAB_CONFIRM_WAIT;
    ?>
</div>
			<?php 
}
?>
		<div class="sep caption"><?php 
echo _ARTIST_COMMENT;
?>
:</div>
		<div style="margin-top: -8px" id="artist-comment">
			<?php 
include_once INCLUDES . "comments.php";
showComment(array("comid" => 0, "comCreator" => $objData["objCreator"], "comComment" => $objData["objComment"]), 0);
?>
		</div>
		<?php 
function putClubData($objData, $num)
{
    $numStr = $num == 1 ? "" : $num;
    // Show which club it is submitted to (if any).
    $result = sql_query("SELECT `cluIsProject` FROM `clubs` " . "WHERE `cluid` = '" . intval($objData["objForClub" . $numStr]) . "' LIMIT 1");
    if (mysql_num_rows($result) > 0) {
        $isProject = mysql_result($result, 0);
        ?>
				<div class="sep caption">
					<?php 
        echo $isProject ? _PROJECT : _CLUB1;
        ?>
예제 #10
0
파일: adm.php 프로젝트: AshMorrow/homework
        <div class="tab-content">
            <div role="tabpanel" class="tab-pane fade in active" id="massages">
                <div class="checkBoxBlock">
                    <div class="col-sm-6" style="border-right: 1px solid rgb(188, 188, 188);">
                        <label for="showCencored">Проказать матерные коменты</label>
                        <input type="checkbox" id="showCencored">
                    </div>
                    <div class="col-sm-6">
                        <label for="showNoCencored">Проказать коменты без мата</label>
                        <input type="checkbox" id="showNoCencored">
                    </div>
                </div>
                <div class="clearfix"></div>
                <?php 
    $massage = getContent();
    showComment($massage, true);
    ?>
            </div>
            <div role="tabpanel" class="tab-pane fade" id="addBadWords">
                <div id="addBadWordInfo">
                    <div class="col-sm-6" id="badWordCount"><p>В словаре <?php 
    echo count(getBadWord());
    ?>
 слов(а)</p></div>
                    <div class="col-sm-6"><a href="cencored/cen.db" download>Скачать список слов</a></div>
                </div>
                <div class="clearfix"></div>
                <form action="<?php 
    echo $_SERVER['REQUEST_URI'];
    ?>
" method="post" class="form-group">
예제 #11
0
<body>
<div class="page-wrap">
    <div class="container">
        <header>
            <div class="pull-right">
                <a href="./login.php" class="loginBtn">Войти</a>
            </div>
            <div class="clearfix"></div>
        </header>
        <div class="col-md-12" style="float: none; margin: 0px auto;">
            <h1 class="headH1">Гостевая книга</h1>
            <?php 
include ROOT . DS . "libs.php";
$message = getContent();
$message = addComment($message);
showComment($message);
?>
        </div>
        <div class="clearfix"></div>
        <div class="col-md-12" style="float: none; margin: 0px auto;">
        <h2 class="headH2">Добывить сообщение</h2>
        <form action="<?php 
echo $_SERVER['REQUEST_URI'];
?>
" method="post" class="form-group">
            <input type="userName" type="text" name="userName" placeholder="Введите свое имя" class="form-control"
                   required>
            <br>
            <textarea name="userMassage" cols="36" rows="10" placeholder="Оставте свой комент" class="form-control" required></textarea><br>
            <input type="submit" name="submit" class="addBtn button">
        </form>
예제 #12
0
function showChildComments($comid, $comObjType, $level, $showChilds = true, $first = false, $oldestFirst = true)
{
    global $_cmd, $_commentsPerPage, $_config;
    if ($comObjType == "com") {
        $sql = "SELECT `comCreator` FROM `comments`" . dbWhere(array("comid" => $comid));
        $comResult = sql_query($sql);
        if (!($comData = mysql_fetch_assoc($comResult))) {
            return false;
        }
        if (isTwit($comData["comCreator"])) {
            return false;
        }
        if (!isLoggedIn()) {
            $result = sql_query("SELECT `useGuestAccess` FROM `useExtData`" . dbWhere(array("useEid" => $comData["comCreator"])));
            if (!mysql_result($result, 0)) {
                return false;
            }
        }
    }
    if ($level > 0) {
        $offset = 0;
    } else {
        $offset = isset($_GET["offset"]) ? intval($_GET["offset"]) : 0;
    }
    $isLastOffset = isset($_GET["offset"]) && $_GET["offset"] == "last";
    if ($_cmd[0] != "user" || $isLastOffset) {
        $result = sql_query("SELECT COUNT(*) FROM `comments` " . "WHERE `comObjType` = '{$comObjType}' AND `comObj` = '{$comid}'" . getTwitWhere("comCreator"));
        $totalcount = mysql_result($result, 0);
        if ($isLastOffset && $_cmd[0] == "user") {
            $lastOffset = floor($totalcount / $_commentsPerPage) * $_commentsPerPage;
            redirect(url(".", array("last" => $lastOffset, "offset" => $lastOffset)));
        }
    } else {
        $totalcount = $offset + $_commentsPerPage + 1;
    }
    $result = sql_query("SELECT * FROM `comments` " . "WHERE `comObjType` = '{$comObjType}' " . "AND `comObj` = '{$comid}' " . getTwitWhere("comCreator") . "ORDER BY `comSubmitDate`" . ($oldestFirst ? "" : " DESC") . " LIMIT " . $offset . "," . ($_commentsPerPage + 1));
    if (!mysql_num_rows($result)) {
        return false;
    }
    $minLevel = 2;
    //$_cmd[0] == "view" ? 2 : 3;
    if ($level >= $minLevel && $_cmd[0] != "comment") {
        for ($i = 0; $i <= $level - 1; $i++) {
            ?>
			<div class="<?php 
            echo $level > 0 && $i < $level - 1 ? "cmt_border_left" : "";
            ?>
">
			<?php 
        }
        $result1 = sql_query("SELECT `comSubmitDate` FROM `comments` WHERE `comid` = '{$comid}' LIMIT 1");
        $comSubmitDate = mysql_result($result1, 0);
        $readURL = url("comment/" . $comid . ($_config["checkSubmitDate"] ? "/" . preg_replace('/[^0-9]/', "", $comSubmitDate) : ''));
        ?>
		<div class="a_left smalltext" style="padding-top: 4px; padding-left: 20px">
			<a href="<?php 
        echo $readURL;
        ?>
#replies"><?php 
        echo _READ_MORE_REPLIES;
        ?>
			<?php 
        echo getIMG(url() . "images/emoticons/nav-next.png");
        ?>
</a>
		</div>
		<?php 
        for ($i = 0; $i <= $level - 1; $i++) {
            echo "</div>";
        }
        return true;
    }
    $commentsToGo = $_commentsPerPage;
    $useids = array();
    $comments = array();
    while ($comData = mysql_fetch_assoc($result)) {
        $useids[] = $comData["comCreator"];
        $comments[] = $comData;
    }
    prefetchUserData(array_unique($useids));
    foreach ($comments as $comData) {
        $first = false;
        showComment($comData, $level);
        if ($showChilds) {
            showChildComments($comData["comid"], "com", $level + 1, true, false, $oldestFirst);
        }
        $commentsToGo--;
        if (!$commentsToGo) {
            break;
        }
        // do not display more than $_commentsPerPage comments
    }
    if ($level == 0) {
        ?>
		<div class="padded">
			<?php 
        navControls($offset, $_commentsPerPage, $totalcount);
        ?>
		</div>
		<?php 
    }
    return true;
}