Example #1
0
            $tplVars['error'] = sprintf(T_('User with username %s was not found'), $user);
            $templateservice->loadTemplate('error.404.tpl', $tplVars);
            exit;
        } else {
            $userid =& $userinfo['uId'];
        }
    }
}
// Header variables
$tplVars['loadjs'] = true;
if ($user) {
    $tplVars['user'] = $user;
    $tplVars['userid'] = $userid;
    $tplVars['userinfo'] =& $userinfo;
    // Pagination
    $perpage = getPerPageCount();
    if (isset($_GET['page']) && intval($_GET['page']) > 1) {
        $page = $_GET['page'];
        $start = ($page - 1) * $perpage;
    } else {
        $page = 0;
        $start = 0;
    }
    // Set template vars
    $tplVars['page'] = $page;
    $tplVars['start'] = $start;
    $tplVars['bookmarkCount'] = $start + 1;
    $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, $userid, NULL, NULL, getSortOrder(), true);
    $tplVars['sidebar_blocks'] = array('watchlist');
    $tplVars['watched'] = true;
    $tplVars['total'] = $bookmarks['total'];
            $bkDescription = preg_replace('|\\[\\/.*?\\]|', '', filter($row['bDescription']));
            // remove final anchor
            $bkDescription = preg_replace('|\\[(.*?)\\]|', ' <span class="anchorBookmark">$1</span> ยป ', $bkDescription);
            // highlight starting anchor
            $bkDescription = preg_replace('@((http|https|ftp)://.*?)( |\\r|$)@', '<a href="$1" rel="nofollow">$1</a>$3', $bkDescription);
            // make url clickable
        }
        echo '   <div class="description">' . nl2br($bkDescription) . "</div>\n";
        echo '   <div class="address">' . htmlspecialchars(shortenString($oaddress)) . "</div>\n";
        echo '   <div class="meta">' . $cats . "\n" . $copy . "\n" . $edit . "\n" . $update . "\n" . "  </div>\n";
        echo $privateNoteField != '' ? '    <div class="privateNote" title="' . T_('Private Note on this bookmark') . '">' . $privateNoteField . "</div>\n" : '';
        echo '  ';
        include 'bookmarks-vote-horizontal.inc.tpl.php';
        echo " </div>\n";
        echo " </li>\n";
    }
    ?>

</ol>

	<?php 
    if (getPerPageCount($currentUser) > 7) {
        echo '<p class="backToTop"><a href="#header" title="' . T_('Come back to the top of this page.') . '">' . T_('Top of the page') . '</a></p>';
    }
    echo $pagesBanner;
    // display previous and next links pages + RSS link
} else {
    echo '<p class="error">' . T_('No bookmarks available') . '</p>';
}
$this->includeTemplate('sidebar.tpl');
$this->includeTemplate($GLOBALS['bottom_include']);
Example #3
0
/* 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', '');
@(list($url, $hash) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL);
if ($usecache) {
    // Generate hash for caching on
    $hashtext = $_SERVER['REQUEST_URI'];
    if ($userservice->isLoggedOn()) {
        $hashtext .= $currentUser->getUsername();
    }
    $cachehash = md5($hashtext);
    // Cache for 30 minutes
    $cacheservice->Start($cachehash, 1800);
}
// Pagination
$perpage = getPerPageCount($currentUser);
if (intval(GET_PAGE) > 1) {
    $page = intval(GET_PAGE);
    $start = ($page - 1) * $perpage;
} else {
    $page = 0;
    $start = 0;
}
if ($bookmark = $bookmarkservice->getBookmarkByHash($hash)) {
    // Template variables
    $bookmarks = $bookmarkservice->getBookmarks($start, $perpage, NULL, NULL, NULL, getSortOrder(), NULL, NULL, NULL, $hash);
    $tplVars['pagetitle'] = T_('History') . ': ' . $bookmark['bAddress'];
    $tplVars['subtitle'] = sprintf(T_('History for %s'), $bookmark['bAddress']);
    $tplVars['loadjs'] = true;
    $tplVars['page'] = $page;
    $tplVars['start'] = $start;
            ?>
						<form class="form-inline" method="POST" action="<?php 
            echo $current_url;
            ?>
">
							<div class="form-group">
							<label for="number_of_buildings"><?php 
            _e('Show', 'idp-theme');
            ?>
:</label>
							<select name="number_of_buildings" class="form-control input-sm" onchange="this.form.submit()">
								<?php 
            for ($i = 1; $i <= 5; $i++) {
                ?>
									<option <?php 
                $i * 12 == getPerPageCount($pagination_count) ? print 'selected="selected"' : (print '');
                ?>
>
									<?php 
                echo $i * 12;
                ?>
	
									</option>
								<?php 
            }
            ?>
							</select>
							</div>
						</form>
						<?php 
        }