function putSidebarUpdates()
{
    global $_auth;
    $result = false;
    ?>
	<div id="updates">
		<?php 
    // This is just a macro so to not write the same code 5 times
    // in a row (see below).
    function __updIcon($count, $hint, $icon)
    {
        global $_auth;
        if ($count > 0) {
            return getIMG(url() . "images/emoticons/" . $icon, 'alt="' . substr($hint, 0, 1) . '" title="' . $hint . '"') . ($_auth["useFuzzyNumbers"] ? " " : "") . ($hint == _COMMENTS ? '<span id="_globCmtCnt">' : "") . ($hint == _JOURNALS ? '<span id="_globJouCnt">' : "") . fuzzy_number($count) . ($hint == _COMMENTS || $hint == _JOURNALS ? '</span>' : "") . ($_auth["useFuzzyNumbers"] ? "<br />" : " ");
        } else {
            return "";
        }
    }
    $updates = __updIcon($_auth["useUpdWat"], _MESSAGES, "watch.png") . __updIcon($_auth["useUpdFav"], _FAVOURITES, "fav1.png") . __updIcon($_auth["useUpdCom"], _COMMENTS, "comment.png") . __updIcon($_auth["useUpdJou"], _JOURNALS, "journal.png") . __updIcon($_auth["useUpdObj"], _SUBMISSIONS, "submission.png");
    if (isExtras()) {
        $updates .= __updIcon($_auth["useUpdExt"], _SUBMIT_TYPE_EXTRA, "star4.png");
    }
    if ($updates != "") {
        ?>
			<a href="<?php 
        echo url("updates");
        ?>
"><?php 
        echo $updates;
        ?>
</a>
			<?php 
        $result = true;
    }
    ?>
	</div>
	<?php 
    return $result;
}
Example #2
0
if (isLoggedIn()) {
    ?>
				<div class="sep">
					<?php 
    // This is just a macro so to not write the same code 5 times
    // in a row (see below).
    function __updIcon($count, $hint, $icon, $insertCmtId = false)
    {
        global $_auth, $_commentCountId;
        if ($count > 0) {
            return getIMG(url() . "images/emoticons/" . $icon, 'alt="' . substr($hint, 0, 1) . '" title="' . $hint . '"') . ($_auth["useFuzzyNumbers"] ? " " : "") . '<span' . ($insertCmtId ? ' id="' . $_commentCountId . '"' : '') . ' class="v_middle">' . fuzzy_number($count) . '</span>' . ($_auth["useFuzzyNumbers"] ? "<br />" : " ");
        } else {
            return "";
        }
    }
    $updates = __updIcon($_auth["useUpdWat"], _MESSAGES, "watch.png") . __updIcon($_auth["useUpdFav"], _FAVOURITES, "fav1.png") . __updIcon($_auth["useUpdCom"], _COMMENTS, "comment.png", true) . __updIcon($_auth["useUpdJou"], _JOURNALS, "journal.png") . __updIcon($_auth["useUpdObj"], _SUBMISSIONS, "submission.png") . __updIcon($_auth["useUpdExt"], _SUBMIT_TYPE_EXTRA, "star4.png");
    if ($updates != "") {
        ?>
						<a href="<?php 
        echo url("updates");
        ?>
"><b><?php 
        echo _UPDATES;
        ?>
</b><br />
							<?php 
        echo $updates;
        ?>
</a>
						<?php 
    }