[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/includes/ -> functions-html.php (source)

   1  <?php
   2  
   3  /**
   4   * Display <h1> header and logo
   5   *
   6   * @return void
   7   */
   8  function yourls_html_logo() {
   9      yourls_do_action( 'pre_html_logo' );
  10      ?>
  11      <header role="banner">
  12      <h1>
  13          <a href="<?php echo yourls_admin_url( 'index.php' ) ?>" title="YOURLS"><span>YOURLS</span>: <span>Y</span>our <span>O</span>wn <span>URL</span> <span>S</span>hortener<br/>
  14          <img src="<?php yourls_site_url(); ?>/images/yourls-logo.svg?v=<?php echo YOURLS_VERSION; ?>" id="yourls-logo" alt="YOURLS" title="YOURLS" /></a>
  15      </h1>
  16      </header>
  17      <?php
  18      yourls_do_action( 'html_logo' );
  19  }
  20  
  21  /**
  22   * Display HTML head and <body> tag
  23   *
  24   * @param string $context Context of the page (stats, index, infos, ...)
  25   * @param string $title HTML title of the page
  26   * @return void
  27   */
  28  function yourls_html_head( $context = 'index', $title = '' ) {
  29  
  30      yourls_do_action( 'pre_html_head', $context, $title );
  31  
  32      // All components to false, except when specified true
  33      $share = $insert = $tablesorter = $tabs = $cal = $charts = false;
  34  
  35      // Load components as needed
  36      switch ( $context ) {
  37          case 'infos':
  38              $share = $tabs = $charts = true;
  39              break;
  40  
  41          case 'bookmark':
  42              $share = $insert = $tablesorter = true;
  43              break;
  44  
  45          case 'index':
  46              $insert = $tablesorter = $cal = $share = true;
  47              break;
  48  
  49          case 'plugins':
  50          case 'tools':
  51              $tablesorter = true;
  52              break;
  53  
  54          case 'install':
  55          case 'login':
  56          case 'new':
  57          case 'upgrade':
  58              break;
  59      }
  60  
  61      // Force no cache for all admin pages
  62      if( yourls_is_admin() && !headers_sent() ) {
  63          yourls_no_cache_headers();
  64          yourls_no_frame_header();
  65          yourls_content_type_header( yourls_apply_filter( 'html_head_content-type', 'text/html' ) );
  66          yourls_do_action( 'admin_headers', $context, $title );
  67      }
  68  
  69      // Store page context
  70      yourls_set_html_context($context);
  71  
  72      // Body class
  73      $bodyclass = yourls_apply_filter( 'bodyclass', '' );
  74      $bodyclass .= ( yourls_is_mobile_device() ? 'mobile' : 'desktop' );
  75  
  76      // Page title
  77      $_title = 'YOURLS &mdash; Your Own URL Shortener | ' . yourls_link();
  78      $title = $title ? $title . " &laquo; " . $_title : $_title;
  79      $title = yourls_apply_filter( 'html_title', $title, $context );
  80  
  81      ?>
  82  <!DOCTYPE html>
  83  <html <?php yourls_html_language_attributes(); ?>>
  84  <head>
  85      <title><?php echo $title ?></title>
  86      <meta http-equiv="Content-Type" content="<?php echo yourls_apply_filter( 'html_head_meta_content-type', 'text/html; charset=utf-8' ); ?>" />
  87      <meta name="generator" content="YOURLS <?php echo YOURLS_VERSION ?>" />
  88      <meta name="description" content="YOURLS &raquo; Your Own URL Shortener' | <?php yourls_site_url(); ?>" />
  89      <?php yourls_do_action('html_head_meta', $context); ?>
  90      <?php yourls_html_favicon(); ?>
  91      <script src="<?php yourls_site_url(); ?>/js/jquery-3.5.1.min.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
  92      <script src="<?php yourls_site_url(); ?>/js/common.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
  93      <script src="<?php yourls_site_url(); ?>/js/jquery.notifybar.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
  94      <link rel="stylesheet" href="<?php yourls_site_url(); ?>/css/style.css?v=<?php echo YOURLS_VERSION; ?>" type="text/css" media="screen" />
  95      <?php if ( $tabs ) { ?>
  96          <link rel="stylesheet" href="<?php yourls_site_url(); ?>/css/infos.css?v=<?php echo YOURLS_VERSION; ?>" type="text/css" media="screen" />
  97          <script src="<?php yourls_site_url(); ?>/js/infos.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
  98      <?php } ?>
  99      <?php if ( $tablesorter ) { ?>
 100          <link rel="stylesheet" href="<?php yourls_site_url(); ?>/css/tablesorter.css?v=<?php echo YOURLS_VERSION; ?>" type="text/css" media="screen" />
 101          <script src="<?php yourls_site_url(); ?>/js/jquery-3.tablesorter.min.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
 102          <script src="<?php yourls_site_url(); ?>/js/tablesorte.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
 103      <?php } ?>
 104      <?php if ( $insert ) { ?>
 105          <script src="<?php yourls_site_url(); ?>/js/insert.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
 106      <?php } ?>
 107      <?php if ( $share ) { ?>
 108          <link rel="stylesheet" href="<?php yourls_site_url(); ?>/css/share.css?v=<?php echo YOURLS_VERSION; ?>" type="text/css" media="screen" />
 109          <script src="<?php yourls_site_url(); ?>/js/share.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
 110          <script src="<?php yourls_site_url(); ?>/js/clipboard.min.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
 111      <?php } ?>
 112      <?php if ( $cal ) { ?>
 113          <link rel="stylesheet" href="<?php yourls_site_url(); ?>/css/cal.css?v=<?php echo YOURLS_VERSION; ?>" type="text/css" media="screen" />
 114          <?php yourls_l10n_calendar_strings(); ?>
 115          <script src="<?php yourls_site_url(); ?>/js/jquery.cal.js?v=<?php echo YOURLS_VERSION; ?>" type="text/javascript"></script>
 116      <?php } ?>
 117      <?php if ( $charts ) { ?>
 118              <script type="text/javascript" src="https://www.google.com/jsapi"></script>
 119              <script type="text/javascript">
 120                       google.load('visualization', '1.0', {'packages':['corechart', 'geochart']});
 121              </script>
 122      <?php } ?>
 123      <script type="text/javascript">
 124      //<![CDATA[
 125          var ajaxurl  = '<?php echo yourls_admin_url( 'admin-ajax.php' ); ?>';
 126      //]]>
 127      </script>
 128      <?php yourls_do_action( 'html_head', $context ); ?>
 129  </head>
 130  <body class="<?php echo $context; ?> <?php echo $bodyclass; ?>">
 131  <div id="wrap">
 132      <?php
 133  }
 134  
 135  /**
 136   * Display HTML footer (including closing body & html tags)
 137   *
 138   * Function yourls_die() will call this function with the optional param set to false: most likely, if we're using yourls_die(),
 139   * there's a problem, so don't maybe add to it by sending another SQL query
 140   *
 141   * @param  bool $can_query  If set to false, will not try to send another query to DB server
 142   * @return void
 143   */
 144  function yourls_html_footer($can_query = true) {
 145      if($can_query & yourls_get_debug_mode()) {
 146          $num_queries = yourls_get_num_queries();
 147          $num_queries = ' &ndash; '. sprintf( yourls_n( '1 query', '%s queries', $num_queries ), $num_queries );
 148      } else {
 149          $num_queries = '';
 150      }
 151  
 152      ?>
 153      </div><?php // wrap ?>
 154      <footer id="footer" role="contentinfo"><p>
 155          <?php
 156          $footer  = yourls_s( 'Powered by %s', '<a href="http://yourls.org/" title="YOURLS">YOURLS</a> v ' . YOURLS_VERSION );
 157          $footer .= $num_queries;
 158          echo yourls_apply_filter( 'html_footer_text', $footer );
 159          ?>
 160      </p></footer>
 161      <?php if( yourls_get_debug_mode() ) {
 162          echo '<div style="text-align:left"><pre>';
 163          echo join( "\n", yourls_get_debug_log() );
 164          echo '</pre></div>';
 165      } ?>
 166      <?php yourls_do_action( 'html_footer', yourls_get_html_context() ); ?>
 167      </body>
 168      </html>
 169      <?php
 170  }
 171  
 172  /**
 173   * Display "Add new URL" box
 174   *
 175   * @param string $url URL to prefill the input with
 176   * @param string $keyword Keyword to prefill the input with
 177   * @return void
 178   */
 179  function yourls_html_addnew( $url = '', $keyword = '' ) {
 180      $pre = yourls_apply_filter( 'shunt_html_addnew', false, $url, $keyword );
 181      if ( false !== $pre ) {
 182          return $pre;
 183      }
 184      ?>
 185      <main role="main">
 186      <div id="new_url">
 187          <div>
 188              <form id="new_url_form" action="" method="get">
 189                  <div>
 190                      <label for="add-url"><strong><?php yourls_e( 'Enter the URL' ); ?></strong></label>:
 191                      <input type="text" id="add-url" name="url" value="<?php echo $url; ?>" class="text" size="80" placeholder="https://" />
 192                      <label for="add-keyword"><?php yourls_e( 'Optional '); ?> : <strong><?php yourls_e('Custom short URL'); ?></strong></label>:
 193                      <input type="text" id="add-keyword" name="keyword" value="<?php echo $keyword; ?>" class="text" size="8" />
 194                      <?php yourls_nonce_field( 'add_url', 'nonce-add' ); ?>
 195                      <input type="button" id="add-button" name="add-button" value="<?php yourls_e( 'Shorten The URL' ); ?>" class="button" onclick="add_link();" />
 196                  </div>
 197              </form>
 198              <div id="feedback" style="display:none"></div>
 199          </div>
 200          <?php yourls_do_action( 'html_addnew' ); ?>
 201      </div>
 202      <?php
 203  }
 204  
 205  /**
 206   * Display main table's footer
 207   *
 208   * The $param array is defined in /admin/index.php, check the yourls_html_tfooter() call
 209   *
 210   * @param array $params Array of all required parameters
 211   * @return void
 212   */
 213  function yourls_html_tfooter( $params = array() ) {
 214      // Manually extract all parameters from the array. We prefer doing it this way, over using extract(),
 215      // to make things clearer and more explicit about what var is used.
 216      $search       = $params['search'];
 217      $search_text  = $params['search_text'];
 218      $search_in    = $params['search_in'];
 219      $sort_by      = $params['sort_by'];
 220      $sort_order   = $params['sort_order'];
 221      $page         = $params['page'];
 222      $perpage      = $params['perpage'];
 223      $click_filter = $params['click_filter'];
 224      $click_limit  = $params['click_limit'];
 225      $total_pages  = $params['total_pages'];
 226      $date_filter  = $params['date_filter'];
 227      $date_first   = $params['date_first'];
 228      $date_second  = $params['date_second'];
 229  
 230      ?>
 231      <tfoot>
 232          <tr>
 233              <th colspan="6">
 234              <div id="filter_form">
 235                  <form action="" method="get">
 236                      <div id="filter_options">
 237                          <?php
 238  
 239                          // First search control: text to search
 240                          $_input = '<input aria-label="' .yourls__( 'Search for' ). '" type="text" name="search" class="text" size="12" value="' . yourls_esc_attr( $search_text ) . '" />';
 241                          $_options = array(
 242                              'all'     => yourls__( 'All fields' ),
 243                              'keyword' => yourls__( 'Short URL' ),
 244                              'url'     => yourls__( 'URL' ),
 245                              'title'   => yourls__( 'Title' ),
 246                              'ip'      => yourls__( 'IP' ),
 247                          );
 248                          $_select = yourls_html_select( 'search_in', $_options, $search_in, false, yourls__( 'Search in' ) );
 249                          /* //translators: "Search for <input field with text to search> in <select dropdown with URL, title...>" */
 250                          yourls_se( 'Search for %1$s in %2$s', $_input , $_select );
 251                          echo "&ndash;\n";
 252  
 253                          // Second search control: order by
 254                          $_options = array(
 255                              'keyword'      => yourls__( 'Short URL' ),
 256                              'url'          => yourls__( 'URL' ),
 257                              'title'        => yourls__( 'Title' ),
 258                              'timestamp'    => yourls__( 'Date' ),
 259                              'ip'           => yourls__( 'IP' ),
 260                              'clicks'       => yourls__( 'Clicks' ),
 261                          );
 262                          $_select = yourls_html_select( 'sort_by', $_options, $sort_by, false,  yourls__( 'Sort by' ) );
 263                          $sort_order = isset( $sort_order ) ? $sort_order : 'desc' ;
 264                          $_options = array(
 265                              'asc'  => yourls__( 'Ascending' ),
 266                              'desc' => yourls__( 'Descending' ),
 267                          );
 268                          $_select2 = yourls_html_select( 'sort_order', $_options, $sort_order, false,  yourls__( 'Sort order' ) );
 269                          /* //translators: "Order by <criteria dropdown (date, clicks...)> in <order dropdown (Descending or Ascending)>" */
 270                          yourls_se( 'Order by %1$s %2$s', $_select , $_select2 );
 271                          echo "&ndash;\n";
 272  
 273                          // Third search control: Show XX rows
 274                          /* //translators: "Show <text field> rows" */
 275                          $_input = '<input aria-label="' .yourls__( 'Number of rows to show' ). '" type="text" name="perpage" class="text" size="2" value="' . $perpage . '" />';
 276                          yourls_se( 'Show %s rows',  $_input );
 277                          echo "<br/>\n";
 278  
 279                          // Fourth search control: Show links with more than XX clicks
 280                          $_options = array(
 281                              'more' => yourls__( 'more' ),
 282                              'less' => yourls__( 'less' ),
 283                          );
 284                          $_select = yourls_html_select( 'click_filter', $_options, $click_filter, false, yourls__( 'Show links with' ) );
 285                          $_input  = '<input aria-label="' .yourls__( 'Number of clicks' ). '" type="text" name="click_limit" class="text" size="4" value="' . $click_limit . '" /> ';
 286                          /* //translators: "Show links with <more/less> than <text field> clicks" */
 287                          yourls_se( 'Show links with %1$s than %2$s clicks', $_select, $_input );
 288                          echo "<br/>\n";
 289  
 290                          // Fifth search control: Show links created before/after/between ...
 291                          $_options = array(
 292                              'before'  => yourls__('before'),
 293                              'after'   => yourls__('after'),
 294                              'between' => yourls__('between'),
 295                          );
 296                          $_select = yourls_html_select( 'date_filter', $_options, $date_filter, false, yourls__('Show links created') );
 297                          $_input  = '<input aria-label="' .yourls__('Select a date') . '" type="text" name="date_first" id="date_first" class="text" size="12" value="' . $date_first . '" />';
 298                          $_and    = '<span id="date_and"' . ( $date_filter === 'between' ? ' style="display:inline"' : '' ) . '> &amp; </span>';
 299                          $_input2 = '<input aria-label="' .yourls__('Select an end date') . '" type="text" name="date_second" id="date_second" class="text" size="12" value="' . $date_second . '"' . ( $date_filter === 'between' ? ' style="display:inline"' : '' ) . '/>';
 300                          /* //translators: "Show links created <before/after/between> <date input> <"and" if applicable> <date input if applicable>" */
 301                          yourls_se( 'Show links created %1$s %2$s %3$s %4$s', $_select, $_input, $_and, $_input2 );
 302                          ?>
 303  
 304                          <div id="filter_buttons">
 305                              <input type="submit" id="submit-sort" value="<?php yourls_e('Search'); ?>" class="button primary" />
 306                              &nbsp;
 307                              <input type="button" id="submit-clear-filter" value="<?php yourls_e('Clear'); ?>" class="button" onclick="window.parent.location.href = 'index.php'" />
 308                          </div>
 309  
 310                      </div>
 311                  </form>
 312              </div>
 313  
 314              <?php
 315              // Remove empty keys from the $params array so it doesn't clutter the pagination links
 316              $params = array_filter( $params, function($val){ return $val !== '';} ); // remove keys with empty values
 317  
 318              if( isset( $search_text ) ) {
 319                  $params['search'] = $search_text;
 320                  unset( $params['search_text'] );
 321              }
 322              ?>
 323  
 324              <div id="pagination">
 325                  <span class="navigation">
 326                  <?php if( $total_pages > 1 ) { ?>
 327                      <span class="nav_total"><?php echo sprintf( yourls_n( '1 page', '%s pages', $total_pages ), $total_pages ); ?></span>
 328                      <?php
 329                      $base_page = yourls_admin_url( 'index.php' );
 330                      // Pagination offsets: min( max ( zomg! ) );
 331                      $p_start = max(  min( $total_pages - 4, $page - 2 ), 1 );
 332                      $p_end = min( max( 5, $page + 2 ), $total_pages );
 333                      if( $p_start >= 2 ) {
 334                          $link = yourls_add_query_arg( array_merge( $params, array( 'page' => 1 ) ), $base_page );
 335                          echo '<span class="nav_link nav_first"><a href="' . $link . '" title="' . yourls_esc_attr__('Go to First Page') . '">' . yourls__( '&laquo; First' ) . '</a></span>';
 336                          echo '<span class="nav_link nav_prev"></span>';
 337                      }
 338                      for( $i = $p_start ; $i <= $p_end; $i++ ) {
 339                          if( $i == $page ) {
 340                              echo "<span class='nav_link nav_current'>$i</span>";
 341                          } else {
 342                              $link = yourls_add_query_arg( array_merge( $params, array( 'page' => $i ) ), $base_page );
 343                              echo '<span class="nav_link nav_goto"><a href="' . $link . '" title="' . sprintf( yourls_esc_attr( 'Page %s' ), $i ) .'">'.$i.'</a></span>';
 344                          }
 345                      }
 346                      if( ( $p_end ) < $total_pages ) {
 347                          $link = yourls_add_query_arg( array_merge( $params, array( 'page' => $total_pages ) ), $base_page );
 348                          echo '<span class="nav_link nav_next"></span>';
 349                          echo '<span class="nav_link nav_last"><a href="' . $link . '" title="' . yourls_esc_attr__('Go to Last Page') . '">' . yourls__( 'Last &raquo;' ) . '</a></span>';
 350                      }
 351                      ?>
 352                  <?php } ?>
 353                  </span>
 354              </div>
 355              </th>
 356          </tr>
 357          <?php yourls_do_action( 'html_tfooter' ); ?>
 358      </tfoot>
 359      <?php
 360  }
 361  
 362  /**
 363   * Return or display a select dropdown field
 364   *
 365   * @since 1.6
 366   *
 367   * @param  string  $name      HTML 'name' (also use as the HTML 'id')
 368   * @param  array   $options   array of 'value' => 'Text displayed'
 369   * @param  string  $selected  optional 'value' from the $options array that will be highlighted
 370   * @param  boolean $display   false (default) to return, true to echo
 371   * @param  string  $label     ARIA label of the element
 372   * @return string HTML content of the select element
 373   */
 374  function yourls_html_select( $name, $options, $selected = '', $display = false, $label = '' ) {
 375      // Allow plugins to filter the options -- see #3262
 376      $options = yourls_apply_filter( 'html_select_options', $options, $name, $selected, $display, $label );
 377      $html = "<select aria-label='$label' name='$name' id='$name' size='1'>\n";
 378      foreach( $options as $value => $text ) {
 379          $html .= "<option value='$value' ";
 380          $html .= $selected == $value ? ' selected="selected"' : '';
 381          $html .= ">$text</option>\n";
 382      }
 383      $html .= "</select>\n";
 384      $html  = yourls_apply_filter( 'html_select', $html, $name, $options, $selected, $display );
 385      if( $display )
 386          echo $html;
 387      return $html;
 388  }
 389  
 390  
 391  /**
 392   * Display the Quick Share box
 393   *
 394   * @param string $longurl          Long URL
 395   * @param string $shorturl         Short URL
 396   * @param string $title            Title
 397   * @param string $text             Text to display
 398   * @param string $shortlink_title  Optional replacement for 'Your short link'
 399   * @param string $share_title      Optional replacement for 'Quick Share'
 400   * @param bool   $hidden           Optional. Hide the box by default (with css "display:none")
 401   * @return void
 402   */
 403  function yourls_share_box( $longurl, $shorturl, $title = '', $text='', $shortlink_title = '', $share_title = '', $hidden = false ) {
 404      if ( $shortlink_title == '' )
 405          $shortlink_title = '<h2>' . yourls__( 'Your short link' ) . '</h2>';
 406      if ( $share_title == '' )
 407          $share_title = '<h2>' . yourls__( 'Quick Share' ) . '</h2>';
 408  
 409      // Allow plugins to short-circuit the whole function
 410      $pre = yourls_apply_filter( 'shunt_share_box', false );
 411      if ( false !== $pre )
 412          return $pre;
 413  
 414      // Make sure IDN domains are in their UTF8 form
 415      $shorturl = yourls_normalize_uri($shorturl);
 416  
 417      $text   = ( $text ? '"'.$text.'" ' : '' );
 418      $title  = ( $title ? "$title " : '' );
 419      $share  = yourls_esc_textarea( $title.$text.$shorturl );
 420      $count  = 280 - strlen( $share );
 421      $hidden = ( $hidden ? 'style="display:none;"' : '' );
 422  
 423      // Allow plugins to filter all data
 424      $data = compact( 'longurl', 'shorturl', 'title', 'text', 'shortlink_title', 'share_title', 'share', 'count', 'hidden' );
 425      $data = yourls_apply_filter( 'share_box_data', $data );
 426      extract( $data );
 427  
 428      $_share = rawurlencode( $share );
 429      $_url   = rawurlencode( $shorturl );
 430      ?>
 431  
 432      <div id="shareboxes" <?php echo $hidden; ?>>
 433  
 434          <?php yourls_do_action( 'shareboxes_before', $longurl, $shorturl, $title, $text ); ?>
 435  
 436          <div id="copybox" class="share">
 437          <?php echo $shortlink_title; ?>
 438              <p><input id="copylink" class="text" size="32" value="<?php echo yourls_esc_url( $shorturl ); ?>" /></p>
 439              <p><small><?php yourls_e( 'Long link' ); ?>: <a id="origlink" href="<?php echo yourls_esc_url( $longurl ); ?>"><?php echo yourls_esc_url( $longurl ); ?></a></small>
 440              <?php if( yourls_do_log_redirect() ) { ?>
 441              <br/><small><?php yourls_e( 'Stats' ); ?>: <a id="statlink" href="<?php echo yourls_esc_url( $shorturl ); ?>+"><?php echo yourls_esc_url( $shorturl ); ?>+</a></small>
 442              <input type="hidden" id="titlelink" value="<?php echo yourls_esc_attr( $title ); ?>" />
 443              <?php } ?>
 444              </p>
 445          </div>
 446  
 447          <?php yourls_do_action( 'shareboxes_middle', $longurl, $shorturl, $title, $text ); ?>
 448  
 449          <div id="sharebox" class="share">
 450              <?php echo $share_title; ?>
 451              <div id="tweet">
 452                  <span id="charcount" class="hide-if-no-js"><?php echo $count; ?></span>
 453                  <textarea id="tweet_body"><?php echo $share; ?></textarea>
 454              </div>
 455              <p id="share_links"><?php yourls_e( 'Share with' ); ?>
 456                  <a id="share_tw" href="https://twitter.com/intent/tweet?text=<?php echo $_share; ?>" title="<?php yourls_e( 'Tweet this!' ); ?>" onclick="share('tw');return false">Twitter</a>
 457                  <a id="share_fb" href="https://www.facebook.com/share.php?u=<?php echo $_url; ?>" title="<?php yourls_e( 'Share on Facebook' ); ?>" onclick="share('fb');return false;">Facebook</a>
 458                  <?php
 459                  yourls_do_action( 'share_links', $longurl, $shorturl, $title, $text );
 460                  // Note: on the main admin page, there are no parameters passed to the sharebox when it's drawn.
 461                  ?>
 462              </p>
 463          </div>
 464  
 465          <?php yourls_do_action( 'shareboxes_after', $longurl, $shorturl, $title, $text ); ?>
 466  
 467      </div>
 468  
 469      <?php
 470  }
 471  
 472  /**
 473   * Die die die
 474   *
 475   * @see https://www.youtube.com/watch?v=zSiKETBjARk
 476   * @param string $message
 477   * @param string $title
 478   * @param int $header_code
 479   * @return void
 480   */
 481  function yourls_die( $message = '', $title = '', $header_code = 200 ) {
 482      yourls_do_action( 'pre_yourls_die', $message, $title, $header_code );
 483  
 484      yourls_status_header( $header_code );
 485  
 486      if( !yourls_did_action( 'html_head' ) ) {
 487          yourls_html_head();
 488          yourls_html_logo();
 489      }
 490      echo yourls_apply_filter( 'die_title', "<h2>$title</h2>" );
 491      echo yourls_apply_filter( 'die_message', "<p>$message</p>" );
 492      // Hook into 'yourls_die' to add more elements or messages to that page
 493      yourls_do_action( 'yourls_die' );
 494      if( !yourls_did_action( 'html_footer' ) ) {
 495          yourls_html_footer(false);
 496      }
 497  
 498      // die with a value in case we're running tests, so PHPUnit doesn't exit with 0 as if success
 499      die(1);
 500  }
 501  
 502  /**
 503   * Return an "Edit" row for the main table
 504   *
 505   * @param string $keyword Keyword to edit
 506   * @return string HTML of the edit row
 507   */
 508  function yourls_table_edit_row( $keyword ) {
 509      $keyword = yourls_sanitize_keyword($keyword);
 510      $id = yourls_unique_element_id();
 511      $url = yourls_get_keyword_longurl( $keyword );
 512      $title = htmlspecialchars( yourls_get_keyword_title( $keyword ) );
 513      $safe_url = yourls_esc_attr( $url );
 514      $safe_title = yourls_esc_attr( $title );
 515      $safe_keyword = yourls_esc_attr( $keyword );
 516  
 517      // Make strings sprintf() safe: '%' -> '%%'
 518      $safe_url = str_replace( '%', '%%', $safe_url );
 519      $safe_title = str_replace( '%', '%%', $safe_title );
 520  
 521      $www = yourls_link();
 522  
 523      $nonce = yourls_create_nonce( 'edit-save_'.$id );
 524  
 525      if( $url ) {
 526          $return = <<<RETURN
 527  <tr id="edit-$id" class="edit-row"><td colspan="5" class="edit-row"><strong>%s</strong>:<input type="text" id="edit-url-$id" name="edit-url-$id" value="$safe_url" class="text" size="70" /><br/><strong>%s</strong>: $www<input type="text" id="edit-keyword-$id" name="edit-keyword-$id" value="$safe_keyword" class="text" size="10" /><br/><strong>%s</strong>: <input type="text" id="edit-title-$id" name="edit-title-$id" value="$safe_title" class="text" size="60" /></td><td colspan="1"><input type="button" id="edit-submit-$id" name="edit-submit-$id" value="%s" title="%s" class="button" onclick="edit_link_save('$id');" />&nbsp;<input type="button" id="edit-close-$id" name="edit-close-$id" value="%s" title="%s" class="button" onclick="edit_link_hide('$id');" /><input type="hidden" id="old_keyword_$id" value="$safe_keyword"/><input type="hidden" id="nonce_$id" value="$nonce"/></td></tr>
 528  RETURN;
 529          $return = sprintf( $return, yourls__( 'Long URL' ), yourls__( 'Short URL' ), yourls__( 'Title' ), yourls__( 'Save' ), yourls__( 'Save new values' ), yourls__( 'Cancel' ), yourls__( 'Cancel editing' ) );
 530      } else {
 531          $return = '<tr class="edit-row notfound"><td colspan="6" class="edit-row notfound">' . yourls__( 'Error, URL not found' ) . '</td></tr>';
 532      }
 533  
 534      $return = yourls_apply_filter( 'table_edit_row', $return, $keyword, $url, $title );
 535  
 536      return $return;
 537  }
 538  
 539  /**
 540   * Return an "Add" row for the main table
 541   *
 542   * @param string $keyword     Keyword (short URL)
 543   * @param string $url         URL (long URL)
 544   * @param string $title       Title
 545   * @param string $ip          IP
 546   * @param string|int $clicks  Number of clicks
 547   * @param string $timestamp   Timestamp
 548   * @return string             HTML of the row
 549   */
 550  function yourls_table_add_row( $keyword, $url, $title, $ip, $clicks, $timestamp ) {
 551      $keyword  = yourls_sanitize_keyword($keyword);
 552      $id       = yourls_unique_element_id();
 553      $shorturl = yourls_link( $keyword );
 554  
 555      $statlink = yourls_statlink( $keyword );
 556  
 557      $delete_link = yourls_nonce_url( 'delete-link_'.$id,
 558          yourls_add_query_arg( array( 'id' => $id, 'action' => 'delete', 'keyword' => $keyword ), yourls_admin_url( 'admin-ajax.php' ) )
 559      );
 560  
 561      $edit_link = yourls_nonce_url( 'edit-link_'.$id,
 562          yourls_add_query_arg( array( 'id' => $id, 'action' => 'edit', 'keyword' => $keyword ), yourls_admin_url( 'admin-ajax.php' ) )
 563      );
 564  
 565      // Action link buttons: the array
 566      $actions = array(
 567          'stats' => array(
 568              'href'    => $statlink,
 569              'id'      => "statlink-$id",
 570              'title'   => yourls_esc_attr__( 'Stats' ),
 571              'anchor'  => yourls__( 'Stats' ),
 572          ),
 573          'share' => array(
 574              'href'    => '',
 575              'id'      => "share-button-$id",
 576              'title'   => yourls_esc_attr__( 'Share' ),
 577              'anchor'  => yourls__( 'Share' ),
 578              'onclick' => "toggle_share('$id');return false;",
 579          ),
 580          'edit' => array(
 581              'href'    => $edit_link,
 582              'id'      => "edit-button-$id",
 583              'title'   => yourls_esc_attr__( 'Edit' ),
 584              'anchor'  => yourls__( 'Edit' ),
 585              'onclick' => "edit_link_display('$id');return false;",
 586          ),
 587          'delete' => array(
 588              'href'    => $delete_link,
 589              'id'      => "delete-button-$id",
 590              'title'   => yourls_esc_attr__( 'Delete' ),
 591              'anchor'  => yourls__( 'Delete' ),
 592              'onclick' => "remove_link('$id');return false;",
 593          )
 594      );
 595      $actions = yourls_apply_filter( 'table_add_row_action_array', $actions, $keyword );
 596  
 597      // Action link buttons: the HTML
 598      $action_links = '';
 599      foreach( $actions as $key => $action ) {
 600          $onclick = isset( $action['onclick'] ) ? 'onclick="' . $action['onclick'] . '"' : '' ;
 601          $action_links .= sprintf( '<a href="%s" id="%s" title="%s" class="%s" %s>%s</a>',
 602              $action['href'], $action['id'], $action['title'], 'button button_'.$key, $onclick, $action['anchor']
 603          );
 604      }
 605      $action_links = yourls_apply_filter( 'action_links', $action_links, $keyword, $url, $ip, $clicks, $timestamp );
 606  
 607      if( ! $title )
 608          $title = $url;
 609  
 610      $protocol_warning = '';
 611      if( ! in_array( yourls_get_protocol( $url ) , array( 'http://', 'https://' ) ) )
 612          $protocol_warning = yourls_apply_filter( 'add_row_protocol_warning', '<span class="warning" title="' . yourls__( 'Not a common link' ) . '">&#9733;</span>' );
 613  
 614      // Row cells: the array
 615      $cells = array(
 616          'keyword' => array(
 617              'template'      => '<a href="%shorturl%">%keyword_html%</a>',
 618              'shorturl'      => yourls_esc_url( $shorturl ),
 619              'keyword_html'  => yourls_esc_html( $keyword ),
 620          ),
 621          'url' => array(
 622              'template'      => '<a href="%long_url%" title="%title_attr%">%title_html%</a><br/><small>%warning%<a href="%long_url%">%long_url_html%</a></small>',
 623              'long_url'      => yourls_esc_url( $url ),
 624              'title_attr'    => yourls_esc_attr( $title ),
 625              'title_html'    => yourls_esc_html( yourls_trim_long_string( $title ) ),
 626              'long_url_html' => yourls_esc_html( yourls_trim_long_string( urldecode( $url ) ) ),
 627              'warning'       => $protocol_warning,
 628          ),
 629          'timestamp' => array(
 630              'template' => '<span class="timestamp" aria-hidden="true">%timestamp%</span> %date%',
 631              'timestamp' => $timestamp,
 632              'date'     => yourls_date_i18n( yourls_get_datetime_format('M d, Y H:i'), yourls_get_timestamp( $timestamp )),
 633          ),
 634          'ip' => array(
 635              'template' => '%ip%',
 636              'ip'       => $ip,
 637          ),
 638          'clicks' => array(
 639              'template' => '%clicks%',
 640              'clicks'   => yourls_number_format_i18n( $clicks, 0 ),
 641          ),
 642          'actions' => array(
 643              'template' => '%actions% <input type="hidden" id="keyword_%id%" value="%keyword%"/>',
 644              'actions'  => $action_links,
 645              'id'       => $id,
 646              'keyword'  => $keyword,
 647          ),
 648      );
 649      $cells = yourls_apply_filter( 'table_add_row_cell_array', $cells, $keyword, $url, $title, $ip, $clicks, $timestamp );
 650  
 651      // Row cells: the HTML. Replace every %stuff% in 'template' with 'stuff' value.
 652      $row = "<tr id=\"id-$id\">";
 653      foreach( $cells as $cell_id => $elements ) {
 654          $row .= sprintf( '<td class="%s" id="%s">', $cell_id, $cell_id . '-' . $id );
 655          $row .= preg_replace_callback( '/%([^%]+)?%/', function( $match ) use ( $elements ) { return $elements[ $match[1] ]; }, $elements['template'] );
 656          $row .= '</td>';
 657      }
 658      $row .= "</tr>";
 659      $row  = yourls_apply_filter( 'table_add_row', $row, $keyword, $url, $title, $ip, $clicks, $timestamp );
 660  
 661      return $row;
 662  }
 663  
 664  /**
 665   * Echo the main table head
 666   *
 667   * @return void
 668   */
 669  function yourls_table_head() {
 670      $start = '<table id="main_table" class="tblSorter" cellpadding="0" cellspacing="1"><thead><tr>'."\n";
 671      echo yourls_apply_filter( 'table_head_start', $start );
 672  
 673      $cells = yourls_apply_filter( 'table_head_cells', array(
 674          'shorturl' => yourls__( 'Short URL' ),
 675          'longurl'  => yourls__( 'Original URL' ),
 676          'date'     => yourls__( 'Date' ),
 677          'ip'       => yourls__( 'IP' ),
 678          'clicks'   => yourls__( 'Clicks' ),
 679          'actions'  => yourls__( 'Actions' )
 680      ) );
 681      foreach( $cells as $k => $v ) {
 682          echo "<th id='main_table_head_$k'><span>$v</span></th>\n";
 683      }
 684  
 685      $end = "</tr></thead>\n";
 686      echo yourls_apply_filter( 'table_head_end', $end );
 687  }
 688  
 689  /**
 690   * Echo the tbody start tag
 691   *
 692   * @return void
 693   */
 694  function yourls_table_tbody_start() {
 695      echo yourls_apply_filter( 'table_tbody_start', '<tbody>' );
 696  }
 697  
 698  /**
 699   * Echo the tbody end tag
 700   *
 701   * @return void
 702   */
 703  function yourls_table_tbody_end() {
 704      echo yourls_apply_filter( 'table_tbody_end', '</tbody>' );
 705  }
 706  
 707  /**
 708   * Echo the table start tag
 709   *
 710   * @return void
 711   */
 712  function yourls_table_end() {
 713      echo yourls_apply_filter( 'table_end', '</table></main>' );
 714  }
 715  
 716  
 717  
 718  /**
 719   * Echo HTML tag for a link
 720   *
 721   * @param string $href     URL to link to
 722   * @param string $anchor   Anchor text
 723   * @param string $element  Element id
 724   * @return void
 725  */
 726  function yourls_html_link( $href, $anchor = '', $element = '' ) {
 727      if( !$anchor )
 728          $anchor = $href;
 729      if( $element )
 730          $element = sprintf( 'id="%s"', yourls_esc_attr( $element ) );
 731      $link = sprintf( '<a href="%s" %s>%s</a>', yourls_esc_url( $href ), $element, yourls_esc_html( $anchor ) );
 732      echo yourls_apply_filter( 'html_link', $link );
 733  }
 734  
 735  /**
 736   * Display the login screen. Nothing past this point.
 737   *
 738   * @param string $error_msg  Optional error message to display
 739   * @return void
 740   */
 741  function yourls_login_screen( $error_msg = '' ) {
 742      yourls_html_head( 'login' );
 743  
 744      $action = ( isset( $_GET['action'] ) && $_GET['action'] == 'logout' ? '?' : '' );
 745  
 746      yourls_html_logo();
 747      ?>
 748      <div id="login">
 749          <form method="post" action="<?php echo $action; ?>"> <?php // reset any QUERY parameters ?>
 750              <?php
 751                  if( !empty( $error_msg ) ) {
 752                      echo '<p class="error">'.$error_msg.'</p>';
 753                  }
 754                  yourls_do_action( 'login_form_top' );
 755              ?>
 756              <p>
 757                  <label for="username"><?php yourls_e( 'Username' ); ?></label><br />
 758                  <input type="text" id="username" name="username" size="30" class="text" />
 759              </p>
 760              <p>
 761                  <label for="password"><?php yourls_e( 'Password' ); ?></label><br />
 762                  <input type="password" id="password" name="password" size="30" class="text" />
 763              </p>
 764              <?php
 765                  yourls_do_action( 'login_form_bottom' );
 766              ?>
 767              <p style="text-align: right;">
 768                  <?php yourls_nonce_field('admin_login'); ?>
 769                  <input type="submit" id="submit" name="submit" value="<?php yourls_e( 'Login' ); ?>" class="button" />
 770              </p>
 771              <?php
 772                  yourls_do_action( 'login_form_end' );
 773              ?>
 774          </form>
 775          <script type="text/javascript">$('#username').focus();</script>
 776      </div>
 777      <?php
 778      yourls_html_footer();
 779      die();
 780  }
 781  
 782  
 783  /**
 784   * Display the admin menu
 785   *
 786   * @return void
 787   */
 788  function yourls_html_menu() {
 789      // Build menu links
 790      if( defined( 'YOURLS_USER' ) ) {
 791          // Create a logout link with a nonce associated to fake user 'logout' : the user is not yet defined
 792          // when the logout check is done -- see yourls_is_valid_user()
 793          $logout_url = yourls_nonce_url( 'admin_logout',
 794          yourls_add_query_arg(['action' => 'logout'], yourls_admin_url('index.php')), 'nonce', 'logout');
 795          $logout_link = yourls_apply_filter('logout_link', sprintf( yourls__('Hello <strong>%s</strong>'), YOURLS_USER ) . ' (<a href="' . $logout_url . '" title="' . yourls_esc_attr__( 'Logout' ) . '">' . yourls__( 'Logout' ) . '</a>)' );
 796      } else {
 797          $logout_link = yourls_apply_filter( 'logout_link', '' );
 798      }
 799      $help_link   = yourls_apply_filter( 'help_link',   '<a href="' . yourls_site_url( false ) .'/readme.html">' . yourls__( 'Help' ) . '</a>' );
 800  
 801      $admin_links    = array();
 802      $admin_sublinks = array();
 803  
 804      $admin_links['admin'] = array(
 805          'url'    => yourls_admin_url( 'index.php' ),
 806          'title'  => yourls__( 'Go to the admin interface' ),
 807          'anchor' => yourls__( 'Admin interface' )
 808      );
 809  
 810      if( yourls_is_admin() ) {
 811          $admin_links['tools'] = array(
 812              'url'    => yourls_admin_url( 'tools.php' ),
 813              'anchor' => yourls__( 'Tools' )
 814          );
 815          $admin_links['plugins'] = array(
 816              'url'    => yourls_admin_url( 'plugins.php' ),
 817              'anchor' => yourls__( 'Manage Plugins' )
 818          );
 819          $admin_sublinks['plugins'] = yourls_list_plugin_admin_pages();
 820      }
 821  
 822      $admin_links    = yourls_apply_filter( 'admin_links',    $admin_links );
 823      $admin_sublinks = yourls_apply_filter( 'admin_sublinks', $admin_sublinks );
 824  
 825      // Now output menu
 826      echo '<nav role="navigation"><ul id="admin_menu">'."\n";
 827      if ( yourls_is_private() && !empty( $logout_link ) )
 828          echo '<li id="admin_menu_logout_link">' . $logout_link .'</li>';
 829  
 830      foreach( (array)$admin_links as $link => $ar ) {
 831          if( isset( $ar['url'] ) ) {
 832              $anchor = isset( $ar['anchor'] ) ? $ar['anchor'] : $link;
 833              $title  = isset( $ar['title'] ) ? 'title="' . $ar['title'] . '"' : '';
 834              printf( '<li id="admin_menu_%s_link" class="admin_menu_toplevel"><a href="%s" %s>%s</a>', $link, $ar['url'], $title, $anchor );
 835          }
 836          // Output submenu if any. TODO: clean up, too many code duplicated here
 837          if( isset( $admin_sublinks[$link] ) ) {
 838              echo "<ul>\n";
 839              foreach( $admin_sublinks[$link] as $link => $ar ) {
 840                  if( isset( $ar['url'] ) ) {
 841                      $anchor = isset( $ar['anchor'] ) ? $ar['anchor'] : $link;
 842                      $title  = isset( $ar['title'] ) ? 'title="' . $ar['title'] . '"' : '';
 843                      printf( '<li id="admin_menu_%s_link" class="admin_menu_sublevel admin_menu_sublevel_%s"><a href="%s" %s>%s</a>', $link, $link, $ar['url'], $title, $anchor );
 844                  }
 845              }
 846              echo "</ul>\n";
 847          }
 848      }
 849  
 850      if ( isset( $help_link ) )
 851          echo '<li id="admin_menu_help_link">' . $help_link .'</li>';
 852  
 853      yourls_do_action( 'admin_menu' );
 854      echo "</ul></nav>\n";
 855      yourls_do_action( 'admin_notices' );
 856      yourls_do_action( 'admin_notice' ); // because I never remember if it's 'notices' or 'notice'
 857      /*
 858      To display a notice:
 859      $message = "<div>OMG, dude, I mean!</div>" );
 860      yourls_add_action( 'admin_notices', function() use ( $message ) { echo (string) $message; } );
 861      */
 862  }
 863  
 864  /**
 865   * Wrapper function to display admin notices
 866   *
 867   * @param string $message Message to display
 868   * @param string $style    Message style (default: 'notice')
 869   * @return void
 870   */
 871  function yourls_add_notice( $message, $style = 'notice' ) {
 872      // Escape single quotes in $message to avoid breaking the anonymous function
 873      $message = yourls_notice_box( strtr( $message, array( "'" => "\'" ) ), $style );
 874      yourls_add_action( 'admin_notices', function() use ( $message ) { echo (string) $message; } );
 875  }
 876  
 877  /**
 878   * Return a formatted notice
 879   *
 880   * @param string $message  Message to display
 881   * @param string $style    CSS class to use for the notice
 882   * @return string          HTML of the notice
 883   */
 884  function yourls_notice_box( $message, $style = 'notice' ) {
 885      return <<<HTML
 886      <div class="$style">
 887      <p>$message</p>
 888      </div>
 889  HTML;
 890  }
 891  
 892  /**
 893   * Display a page
 894   *
 895   * Includes content of a PHP file from the YOURLS_PAGEDIR directory, as if it
 896   * were a standard short URL (ie http://sho.rt/$page)
 897   *
 898   * @since 1.0
 899   * @param string $page  PHP file to display
 900   * @return void
 901   */
 902  function yourls_page( $page ) {
 903      if( !yourls_is_page($page)) {
 904          yourls_die( yourls_s('Page "%1$s" not found', $page), yourls__('Not found'), 404 );
 905      }
 906  
 907      yourls_do_action( 'pre_page', $page );
 908      include_once( YOURLS_PAGEDIR . "/$page.php" );
 909      yourls_do_action( 'post_page', $page );
 910  }
 911  
 912  /**
 913   * Display the language attributes for the HTML tag.
 914   *
 915   * Builds up a set of html attributes containing the text direction and language
 916   * information for the page. Stolen from WP.
 917   *
 918   * @since 1.6
 919   * @return void
 920   */
 921  function yourls_html_language_attributes() {
 922      $attributes = array();
 923      $output = '';
 924  
 925      $attributes[] = ( yourls_is_rtl() ? 'dir="rtl"' : 'dir="ltr"' );
 926  
 927      $doctype = yourls_apply_filter( 'html_language_attributes_doctype', 'html' );
 928      // Experimental: get HTML lang from locale. Should work. Convert fr_FR -> fr-FR
 929      if ( $lang = str_replace( '_', '-', yourls_get_locale() ) ) {
 930          if( $doctype == 'xhtml' ) {
 931              $attributes[] = "xml:lang=\"$lang\"";
 932          } else {
 933              $attributes[] = "lang=\"$lang\"";
 934          }
 935      }
 936  
 937      $output = implode( ' ', $attributes );
 938      $output = yourls_apply_filter( 'html_language_attributes', $output );
 939      echo $output;
 940  }
 941  
 942  /**
 943   * Output translated strings used by the Javascript calendar
 944   *
 945   * @since 1.6
 946   * @return void
 947   */
 948  function yourls_l10n_calendar_strings() {
 949      echo "\n<script>\n";
 950      echo "var l10n_cal_month = " . json_encode( array_values( yourls_l10n_months() ) ) . ";\n";
 951      echo "var l10n_cal_days = " . json_encode( array_values( yourls_l10n_weekday_initial() ) ) . ";\n";
 952      echo "var l10n_cal_today = \"" . yourls_esc_js( yourls__( 'Today' ) ) . "\";\n";
 953      echo "var l10n_cal_close = \"" . yourls_esc_js( yourls__( 'Close' ) ) . "\";\n";
 954      echo "</script>\n";
 955  
 956      // Dummy returns, to initialize l10n strings used in the calendar
 957      yourls__( 'Today' );
 958      yourls__( 'Close' );
 959  }
 960  
 961  
 962  /**
 963   * Display a notice if there is a newer version of YOURLS available
 964   *
 965   * @since 1.7
 966   * @param string $compare_with Optional, YOURLS version to compare to
 967   * @return void
 968   */
 969  function yourls_new_core_version_notice($compare_with = null) {
 970      $compare_with = $compare_with ?: YOURLS_VERSION;
 971  
 972      $checks = yourls_get_option( 'core_version_checks' );
 973      $latest = isset($checks->last_result->latest) ? yourls_sanitize_version($checks->last_result->latest) : false;
 974  
 975      if( $latest AND version_compare( $latest, $compare_with, '>' ) ) {
 976          yourls_do_action('new_core_version_notice', $latest);
 977          $msg = yourls_s( '<a href="%s">YOURLS version %s</a> is available. Please update!', 'http://yourls.org/download', $latest );
 978          yourls_add_notice( $msg );
 979      }
 980  }
 981  
 982  /**
 983   * Display or return HTML for a bookmarklet link
 984   *
 985   * @since 1.7.1
 986   * @param string $href    bookmarklet link (presumably minified code with "javascript:" scheme)
 987   * @param string $anchor  link anchor
 988   * @param bool   $echo    true to display, false to return the HTML
 989   * @return string         the HTML for a bookmarklet link
 990   */
 991  function yourls_bookmarklet_link( $href, $anchor, $echo = true ) {
 992      $alert = yourls_esc_attr__( 'Drag to your toolbar!' );
 993      $link = <<<LINK
 994      <a href="$href" class="bookmarklet" onclick="alert('$alert');return false;">$anchor</a>
 995  LINK;
 996  
 997      if( $echo )
 998          echo $link;
 999      return $link;
1000  }
1001  
1002  /**
1003   * Set HTML context (stats, index, infos, ...)
1004   *
1005   * @since  1.7.3
1006   * @param  string  $context
1007   * @return void
1008   */
1009  function yourls_set_html_context($context) {
1010      yourls_get_db()->set_html_context($context);
1011  }
1012  
1013  /**
1014   * Get HTML context (stats, index, infos, ...)
1015   *
1016   * @since  1.7.3
1017   * @return string
1018   */
1019  function yourls_get_html_context() {
1020      return yourls_get_db()->get_html_context();
1021  }
1022  
1023  /**
1024   * Print HTML link for favicon
1025   *
1026   * @since 1.7.10
1027   * @return mixed|void
1028   */
1029  function yourls_html_favicon() {
1030      // Allow plugins to short-circuit the whole function
1031      $pre = yourls_apply_filter( 'shunt_html_favicon', false );
1032      if ( false !== $pre ) {
1033          return $pre;
1034      }
1035  
1036      printf( '<link rel="shortcut icon" href="%s" />', yourls_get_yourls_favicon_url(false) );
1037  }


Generated: Wed Sep 28 05:10:02 2022 Cross-referenced by PHPXref 0.7.1