示例#1
0
function renderedContent($item)
{
    $renderedContent = stripslashes($item['content']);
    $renderedContent = parseLatexBBCode($renderedContent);
    $icount = count($item['images']);
    for ($i = 0; $i < $icount; $i++) {
        //print_r($item['sections'][$s]['images'][$i]);
        $html = '<img src="' . getMidsizeUrl($item['images'][$i]['url']) . '">';
        $code = '[image_' . $item['images'][$i]['id'] . ']';
        $renderedContent = str_replace($code, $html, $renderedContent);
    }
    $renderedContent = parseBBCode2HTML($renderedContent);
    return $renderedContent;
}
示例#2
0
function renderItemComments($item, $user, $location)
{
    $email = $user['email'];
    $str = '';
    $ccount = count($item['comments']);
    $item['comments'] = sortItemsAsc($item['comments'], 'dateCreated');
    for ($c = 0; $c < $ccount; $c++) {
        $str .= '<div class="post_comment"><img src="http://www.gravatar.com/avatar/' . hash('md5', $item['comments'][$c]['user']) . '.gif?s=32&default=identicon&r=PG" class="commentavatar">';
        if ($email == $item['comments'][$c]['user']) {
            $str .= '<a href="javascript:queryDeleteComment(\'' . $_REQUEST['w'] . '\',\'' . $_REQUEST['u'] . '\',\'' . $item['id'] . '\',\'' . $item['comments'][$c]['id'] . '\')">';
            $str .= '<img src="img/Actions-edit-delete-icon.png" style="float:right;">';
            $str .= '</a>';
        }
        $str .= '<div class="post_comment_content"><small><span class="time" utctime="' . convert_datetime($item['comments'][$c]['dateCreated']) . '">' . $item['comments'][$c]['dateCreated'] . ' (UTC)</span> ' . $item['comments'][$c]['user'] . ': </small><p>' . parseBBCode2HTML(parseLatexBBCode(htmlspecialchars(stripslashes($item['comments'][$c]['content'])))) . '</div></div>';
        $str .= '<div style="clear: both;"></div>';
    }
    $str .= '<div class="post_comment_adder"><img src="http://www.gravatar.com/avatar/' . hash('md5', $email) . '.gif?s=32&default=identicon&r=PG" class="commentavatar">';
    $str .= '<div class="post_comment_form"><form action="query.php" method="post" name="editpost" class="comment_add_form" autocomplete="off">
			<input type="hidden" name="w" value="' . $_REQUEST['w'] . '">
			<input type="hidden" name="u" value="' . $_REQUEST['u'] . '">
			<input type="hidden" name="id" value="' . $item['id'] . '">
			<input type="hidden" name="action" value="comment_add">';
    $str .= '<small>' . $email . ': </small>';
    $str .= '<p><textarea name="content" style="width:500px; height:40px;"></textarea></p>';
    $str .= '<p><input type="submit" value="comment"></p>';
    $str .= '</form></div></div>';
    return $str;
}