Пример #1
0
$cacheservice = SemanticScuttle_Service_Factory::get('Cache');
/* Managing all possible inputs */
isset($_GET['page']) ? define('GET_PAGE', $_GET['page']) : define('GET_PAGE', 0);
isset($_GET['sort']) ? define('GET_SORT', $_GET['sort']) : define('GET_SORT', '');
/* Managing current logged user */
$currentUser = $userservice->getCurrentObjectUser();
/* Managing path info */
list($url, $cat) = explode('/', $_SERVER['PATH_INFO']);
if (!$cat) {
    header('Location: ' . createURL('populartags'));
    exit;
}
$titleTags = explode('+', filter($cat));
$pagetitle = T_('Tags') . ': ';
for ($i = 0; $i < count($titleTags); $i++) {
    $pagetitle .= $titleTags[$i] . '<a href="' . createUrl('tags', aggregateTags($titleTags, '+', $titleTags[$i])) . '" title="' . T_('Remove the tag from the selection') . '">*</a> + ';
}
$pagetitle = substr($pagetitle, 0, strlen($pagetitle) - strlen(' + '));
//$cattitle = str_replace('+', ' + ', $cat);
if ($usecache) {
    // Generate hash for caching on
    if ($userservice->isLoggedOn()) {
        $hash = md5($_SERVER['REQUEST_URI'] . $currentUser->getId());
    } else {
        $hash = md5($_SERVER['REQUEST_URI']);
    }
    // Cache for 30 minutes
    $cacheservice->Start($hash, 1800);
}
// Header variables
$tplVars['pagetitle'] = T_('Tags') . ': ' . $cat;
Пример #2
0
        if (!($userinfo = $userservice->getUserByUsername($user))) {
            $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user);
            $templateservice->loadTemplate('error.404.tpl', $tplVars);
            exit;
        } else {
            $userid =& $userinfo['uId'];
        }
    }
    $pagetitle .= ': ' . $user;
}
if ($cat) {
    $catTitle = ': ' . str_replace('+', ' + ', $cat);
    $catTitleWithUrls = ': ';
    $titleTags = explode('+', filter($cat));
    for ($i = 0; $i < count($titleTags); $i++) {
        $catTitleWithUrls .= $titleTags[$i] . '<a href="' . createUrl('bookmarks', $user . '/' . aggregateTags($titleTags, '+', $titleTags[$i])) . '" title="' . T_('Remove the tag from the selection') . '">*</a> + ';
    }
    $catTitleWithUrls = substr($catTitleWithUrls, 0, strlen($catTitleWithUrls) - strlen(' + '));
    $pagetitle .= $catTitleWithUrls;
} else {
    $catTitleWithUrls = '';
}
$pagetitle = substr($pagetitle, 2);
// Header variables
$tplVars['loadjs'] = true;
// ADD A BOOKMARK
$saved = false;
$templatename = 'bookmarks.tpl';
if ($userservice->isLoggedOn() && POST_SUBMITTED != '') {
    if (!POST_TITLE || !POST_ADDRESS) {
        $tplVars['error'] = T_('Your bookmark must have a title and an address');