header and logo
function yourls_html_logo() {
yourls_do_action( 'pre_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 = $share = true;
break;
case 'plugins':
case 'tools':
$tablesorter = true;
break;
case 'install':
case 'login':
case 'new':
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_do_action( 'admin_headers' );
}
// Page title
$title = yourls_apply_filter( 'html_title', 'YOURLS » Your Own URL Shortener | ' . YOURLS_SITE );
?>
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
', $hidden = false ) {
$text = ( $text ? '"'.$text.'" ' : '' );
$title = ( $title ? "$title " : '' );
$share = htmlspecialchars_decode( $title.$text.$shorturl );
$_share = rawurlencode( $share );
$_url = rawurlencode( $shorturl );
$count = 140 - strlen( $share );
$hidden = ( $hidden ? 'style="display:none;"' : '' );
?>
$title" );
echo yourls_apply_filter( 'die_message', "$message
" );
yourls_do_action( 'yourls_die' );
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();
?>
OMG, dude, I mean!" );
yourls_add_action('admin_notices', create_function( '', "echo '$message';" ) );
*/
}
// Wrapper to admin notices
function yourls_add_notice( $message ) {
$message = yourls_notice_box( $message );
yourls_add_action('admin_notices', create_function( '', "echo '$message';" ) );
}
// Return a formatted notice
function yourls_notice_box( $message ) {
return <<
$message
HTML;
}