/** * Display HTML head and <body> tag * * @param string $context Context of the page (stats, index, infos, ...) * @param string $title HTML title of the page */ function yourls_html_head($context = 'index', $title = '') { yourls_do_action('pre_html_head', $context, $title); // All components to false, except when specified true $share = $insert = $tablesorter = $tabs = $cal = $charts = false; // Load components as needed switch ($context) { case 'infos': $share = $tabs = $charts = 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_content_type_header(yourls_apply_filter('html_head_content-type', 'text/html')); yourls_do_action('admin_headers', $context, $title); } // Store page context in global object global $ydb; $ydb->context = $context; // Body class $bodyclass = yourls_apply_filter('bodyclass', ''); $bodyclass .= yourls_is_mobile_device() ? 'mobile' : 'desktop'; // Page title $_title = 'YOURLS — Your Own URL Shortener | ' . yourls_link(); $title = $title ? $title . " « " . $_title : $_title; $title = yourls_apply_filter('html_title', $title, $context); ?> <!DOCTYPE html> <html <?php yourls_html_language_attributes(); ?> > <head> <title><?php echo $title; ?> </title> <link rel="shortcut icon" href="<?php yourls_favicon(); ?> " /> <meta http-equiv="Content-Type" content="<?php echo yourls_apply_filter('html_head_meta_content-type', 'text/html; charset=utf-8'); ?> " /> <meta name="generator" content="YOURLS <?php echo YOURLS_VERSION; ?> " /> <meta name="description" content="YOURLS » Your Own URL Shortener' | <?php yourls_site_url(); ?> " /> <meta name="referrer" content="always" /> <script src="<?php yourls_site_url(); ?> /js/jquery-1.9.1.min.js?v=<?php echo YOURLS_VERSION; ?> " type="text/javascript"></script> <script src="<?php yourls_site_url(); ?> /js/common.js?v=<?php echo YOURLS_VERSION; ?> " type="text/javascript"></script> <script src="<?php yourls_site_url(); ?> /js/jquery.notifybar.js?v=<?php echo YOURLS_VERSION; ?> " type="text/javascript"></script> <link rel="stylesheet" href="<?php yourls_site_url(); ?> /css/style.css?v=<?php echo YOURLS_VERSION; ?> " type="text/css" media="screen" /> <?php if ($tabs) { ?> <link rel="stylesheet" href="<?php yourls_site_url(); ?> /css/infos.css?v=<?php echo YOURLS_VERSION; ?> " type="text/css" media="screen" /> <script src="<?php yourls_site_url(); ?> /js/infos.js?v=<?php echo YOURLS_VERSION; ?> " type="text/javascript"></script> <?php } ?> <?php if ($tablesorter) { ?> <link rel="stylesheet" href="<?php yourls_site_url(); ?> /css/tablesorter.css?v=<?php echo YOURLS_VERSION; ?> " type="text/css" media="screen" /> <script src="<?php yourls_site_url(); ?> /js/jquery.tablesorter.min.js?v=<?php echo YOURLS_VERSION; ?> " type="text/javascript"></script> <?php } ?> <?php if ($insert) { ?> <script src="<?php yourls_site_url(); ?> /js/insert.js?v=<?php echo YOURLS_VERSION; ?> " type="text/javascript"></script> <?php } ?> <?php if ($share) { ?> <link rel="stylesheet" href="<?php yourls_site_url(); ?> /css/share.css?v=<?php echo YOURLS_VERSION; ?> " type="text/css" media="screen" /> <script src="<?php yourls_site_url(); ?> /js/share.js?v=<?php echo YOURLS_VERSION; ?> " type="text/javascript"></script> <script src="<?php yourls_site_url(); ?> /js/clipboard.min.js?v=<?php echo YOURLS_VERSION; ?> " type="text/javascript"></script> <?php } ?> <?php if ($cal) { ?> <link rel="stylesheet" href="<?php yourls_site_url(); ?> /css/cal.css?v=<?php echo YOURLS_VERSION; ?> " type="text/css" media="screen" /> <?php yourls_l10n_calendar_strings(); ?> <script src="<?php yourls_site_url(); ?> /js/jquery.cal.js?v=<?php echo YOURLS_VERSION; ?> " type="text/javascript"></script> <?php } ?> <?php if ($charts) { ?> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1.0', {'packages':['corechart', 'geochart']}); </script> <?php } ?> <script type="text/javascript"> //<![CDATA[ var ajaxurl = '<?php echo yourls_admin_url('admin-ajax.php'); ?> '; //]]> </script> <?php yourls_do_action('html_head', $context); ?> </head> <body class="<?php echo $context; ?> <?php echo $bodyclass; ?> "> <div id="wrap"> <?php }
?> <div class="panel panel-teaser"> <div class="panel-header"> <h2 id="informations"><?php echo yourls_esc_html($title); ?> </h2> </div> <div class="panel-body"> <h3><span class="label"><?php yourls_e('Short URL'); ?> :</span> <img src="<?php print yourls_favicon(); ?> "/> <?php if ($aggregate) { $i = 0; foreach ($keyword_list as $k) { $i++; if ($i == 1) { yourls_html_link(yourls_link($k)); } else { yourls_html_link(yourls_link($k), "/{$k}"); } if ($i < count($keyword_list)) { echo ' + '; }
} yourls_html_head('infos', yourls_s('Statistics for %s', YOURLS_SITE . '/' . $keyword)); yourls_html_logo(); yourls_html_menu(); ?> <h2 id="informations"><?php echo yourls_esc_html($title); ?> </h2> <h3><span class="label"><?php yourls_e('Short URL'); ?> :</span> <img src="<?php yourls_favicon(); ?> "/> <?php if ($aggregate) { $i = 0; foreach ($keyword_list as $k) { $i++; if ($i == 1) { yourls_html_link(yourls_link($k)); } else { yourls_html_link(yourls_link($k), "/{$k}"); } if ($i < count($keyword_list)) { echo ' + '; }