header and logo
function yourls_html_logo() {
?>
tag
function yourls_html_head( $context = 'index' ) {
// All components to false, except when specified true
$share = $insert = $tablesorter = $tabs = $cal = false;
// Load components as needed
switch ( $context ) {
case 'infos':
$share = $tabs = true;
break;
case 'bookmark':
$share = $insert = $tablesorter = true;
break;
case 'index':
$insert = $tablesorter = $cal = true;
break;
case 'install':
case 'login':
case 'new':
case 'tools':
case 'upgrade':
break;
}
// Force no cache for all admin pages
if( yourls_is_admin() && !headers_sent() ) {
header( 'Expires: Thu, 23 Mar 1972 07:00:00 GMT' );
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
header( 'Pragma: no-cache' );
}
?>
YOURLS » Your Own URL Shortener |
num_queries > 1 ? $ydb->num_queries.' queries' : $ydb->num_queries.' query';
?>
'. $ydb->all_queries .'';
} ?>
|
Pages ():
= 4) {
echo '« First ... ';
}
if($page > 1) {
echo ' « ';
}
for($i = $page - 2 ; $i <= $page +2; $i++) {
if ($i >= 1 && $i <= $total_pages) {
if($i == $page) {
echo "[$i] ";
} else {
echo ''.$i.' ';
}
}
}
if($page < $total_pages) {
echo ' » ';
}
if (($page+2) < $total_pages) {
echo ' ... Last »';
}
?>
|
Your short link', $share_title = 'Quick Share
' ) {
$text = ( $text ? '"'.$text.'" ' : '' );
$title = ( $title ? "$title " : '' );
$share = htmlspecialchars_decode( $title.$text.$shorturl );
$_share = rawurlencode( $share );
$_url = rawurlencode( $shorturl );
$count = 140 - strlen( $share );
?>
$title";
echo "$message
";
yourls_html_footer();
die();
}
// Echo HTML tag for a link
function yourls_html_link( $href, $title = '', $element = '' ) {
if( !$title )
$title = $href;
if( $element )
$element = "id='$element'";
echo "$title";
}
// Display the login screen. Nothing past this point.
function yourls_login_screen( $error_msg = '' ) {
yourls_html_head( 'login' );
$action = ( isset($_GET['mode']) && $_GET['mode'] == 'logout' ? '?' : '' );
yourls_html_logo();
?>