]> CyberLeo.Net >> Repos - Github/YOURLS.git/blob - yourls-infos.php
Fix incorrect direct/indirect traffic numbering
[Github/YOURLS.git] / yourls-infos.php
1 <?php\r
2 // Require Files\r
3 require_once( dirname(__FILE__).'/includes/load-yourls.php' );\r
4 require_once( dirname(__FILE__).'/includes/functions-infos.php' );\r
5 yourls_maybe_require_auth();\r
6 \r
7 if ( !isset( $_GET['id'] ) )\r
8         yourls_redirect( YOURLS_SITE, 307 );\r
9         \r
10 $aggregate = false;\r
11 if ( isset( $_GET['all'] ) && $_GET['all'] == 1 && yourls_allow_duplicate_longurls() )\r
12         $aggregate = true;\r
13 \r
14 // Get basic infos for this shortened URL\r
15 $keyword = yourls_sanitize_string( $_GET['id'] );\r
16 $longurl = yourls_get_keyword_longurl( $keyword );\r
17 $clicks = yourls_get_keyword_clicks( $keyword );\r
18 $timestamp = yourls_get_keyword_timestamp( $keyword );\r
19 \r
20 if ( $longurl === false )\r
21         yourls_redirect( YOURLS_SITE, 307 );\r
22 \r
23 // Duplicate keywords, if applicable\r
24 $keyword_list = yourls_get_duplicate_keywords( $longurl );\r
25         \r
26 // Fetch all information from the table log\r
27 $table = YOURLS_DB_TABLE_LOG;\r
28 \r
29 \r
30 if( $aggregate ) {\r
31         $keywords = join( "', '", $keyword_list );\r
32         // Fetch information for all keywords pointing to $longurl\r
33         $hits = $ydb->get_results( "SELECT `shorturl`, `click_time`, `referrer`, `user_agent`, `country_code` FROM `$table` WHERE `shorturl` IN ( '$keywords' );" );\r
34 } else {\r
35         // Fetch information for current keyword only\r
36         $hits = $ydb->get_results( "SELECT `click_time`, `referrer`, `user_agent`, `country_code` FROM `$table` WHERE `shorturl` = '$keyword';" );\r
37 }\r
38 \r
39 $referrers = array();\r
40 $direct = $notdirect = 0;\r
41 $countries = array();\r
42 $dates = array();\r
43 $list_of_days = array();\r
44 $list_of_months = array();\r
45 $list_of_years = array();\r
46 $last_24h = array();\r
47 \r
48 // Loop through all results and build list of referrers, countries and hits per day\r
49 foreach( (array)$hits as $hit ) {\r
50         extract( (array)$hit );\r
51 \r
52         if ( isset( $country_code ) && $country_code ) {\r
53                 if( !array_key_exists( $country_code, $countries ) )\r
54                         $countries[$country_code] = 0;\r
55                 $countries[$country_code]++;\r
56         }\r
57         \r
58         if( isset( $referrer ) ) {\r
59                 if ( $referrer == 'direct' ) {\r
60                         $direct++;\r
61                 } else {\r
62                         $notdirect++;\r
63                         $host = yourls_get_domain( $referrer );\r
64                         if( !array_key_exists( $host, $referrers ) )\r
65                                 $referrers[$host] = array( );\r
66                         if( !array_key_exists( $referrer, $referrers[$host] ) )\r
67                                 $referrers[$host][$referrer] = 0;\r
68                         $referrers[$host][$referrer]++;\r
69                 }\r
70         }\r
71         \r
72         if( isset( $click_time ) ) {\r
73                 $now = intval( date('U') );\r
74 \r
75                 preg_match('/(\d+)-(\d+)-(\d+)\s(\d+):(\d+):(\d+)/', $click_time, $matches);\r
76                 list( $temp, $year, $month, $day, $hour, $min, $sec ) = $matches;\r
77                 unset( $matches );\r
78                 \r
79                 // Build array of $dates[$year][$month][$day] = number of clicks\r
80                 if( !array_key_exists( $year, $dates ) )\r
81                         $dates[$year] = array();\r
82                 if( !array_key_exists( $month, $dates[$year] ) )\r
83                         $dates[$year][$month] = array();\r
84                 if( !array_key_exists( $day, $dates[$year][$month] ) )\r
85                         $dates[$year][$month][$day] = 0;\r
86                 $dates[$year][$month][$day]++;\r
87                 \r
88                 // Build array of last 24 hours $last_24h[$hour] = number of click\r
89                 $then = strtotime( $click_time);\r
90                 if( ( $now >= $then ) && ( ( $now - $then ) < ( 24 * 60 * 60 ) ) ) {\r
91                         $year = sprintf( "%02d", substr( $year, -1, 2 ) ); // 2009 -> 09\r
92                         $diff = $now - strtotime( $click_time);\r
93                         if( !array_key_exists( "$year-$month-$day-$hour", $last_24h ) )\r
94                                 $last_24h["$year-$month-$day-$hour"] = 0;\r
95                         $last_24h["$year-$month-$day-$hour"]++;\r
96                 }\r
97         }\r
98 }\r
99 \r
100 \r
101 // Sort dates, chronologically from [2007][12][24] to [2009][02][19]\r
102 ksort( $dates );\r
103 foreach( $dates as $year=>$months ) {\r
104         ksort( $dates[$year] );\r
105         foreach( $months as $month=>$day ) {\r
106                 ksort( $dates[$year][$month] );\r
107         }\r
108 }\r
109 \r
110 // Get $list_of_days, $list_of_months, $list_of_years\r
111 if( $dates ) {\r
112         extract( yourls_build_list_of_days( $dates ) );\r
113 \r
114         // If the $last_24h doesn't have all the hours, insert missing hours with value 0\r
115         for ($i = 23; $i >= 0; $i--) {\r
116                 $h = date('y-m-d-H', $now - ($i * 60 * 60) );\r
117                 if( !array_key_exists( $h, $last_24h ) ) {\r
118                         $last_24h[$h] = 0;\r
119                 }\r
120         }\r
121         ksort( $last_24h );\r
122 }\r
123 \r
124 // Sort countries, most frequent first\r
125 if ( $countries )\r
126         arsort( $countries );\r
127 \r
128 // Sort referrers. $referrer_sort is a array of most frequent domains\r
129 arsort( $referrers );\r
130 $referrer_sort = array();\r
131 $number_of_sites = count( array_keys( $referrers ) );\r
132 foreach( $referrers as $site => $urls ) {\r
133         if( count($urls) > 1 || $number_of_sites == 1 )\r
134                 $referrer_sort[$site] = array_sum( $urls );\r
135 }\r
136 arsort($referrer_sort);\r
137 \r
138 \r
139 /**\r
140 echo "<pre>";\r
141 echo "referrers: "; print_r( $referrers );\r
142 echo "referrer sort: "; print_r( $referrer_sort );\r
143 echo "direct: $direct\n";\r
144 echo "notdirect: $notdirect\n";\r
145 echo "dates: "; print_r( $dates );\r
146 echo "list of days: "; print_r( $list_of_days );\r
147 echo "list_of_months: "; print_r( $list_of_months );\r
148 echo "list_of_years: "; print_r( $list_of_years );\r
149 echo "last_24h: "; print_r( $last_24h );\r
150 //echo "countries: "; print_r( $countries );\r
151 \r
152 die();\r
153 /**/\r
154 \r
155 \r
156 yourls_html_head( 'infos' );\r
157 ?>\r
158 \r
159 <h1>\r
160         <a href="<?php echo YOURLS_SITE; ?>/admin/index.php" title="YOURLS"><span>YOURLS</span>: <span>Y</span>our <span>O</span>wn <span>URL</span> <span>S</span>hortener<br/>\r
161         <img src="<?php echo YOURLS_SITE; ?>/images/yourls-logo.png" alt="YOURLS" title="YOURLS" style="border: 0px;" /></a>\r
162 </h1>\r
163 <?php if ( yourls_is_private() ) { ?>\r
164 <p>Your are logged in as: <strong><?php echo YOURLS_USER; ?></strong>. <a href="?mode=logout" title="Logout">Logout</a></p>\r
165 <?php } ?>\r
166 \r
167 <h2 id="informations">Informations</h2>\r
168 \r
169 <h3>Short URL: <img src="<?php echo YOURLS_SITE; ?>/images/favicon.gif"/>\r
170 <?php if( $aggregate ) {\r
171         $i = 0;\r
172         foreach( $keyword_list as $k ) {\r
173                 $i++;\r
174                 if ( $i == 1 ) {\r
175                         yourls_html_link( YOURLS_SITE."/$k" );\r
176                 } else {\r
177                         yourls_html_link( YOURLS_SITE."/$k", "/$k" );\r
178                 }\r
179                 if ( $i < count( $keyword_list ) )\r
180                         echo ' + ';\r
181         }\r
182 } else {\r
183         yourls_html_link( YOURLS_SITE."/$keyword" );\r
184         if( count( $keyword_list ) > 1 )\r
185                 echo ' <a href="'. YOURLS_SITE .'/'.$keyword.'+all" title="Aggregate stats for duplicate short URLs"><img src="' . YOURLS_SITE . '/images/chart_bar_add.png" border="0" /></a>';\r
186 } ?></h3>\r
187 <h3 id="longurl">Long URL: <img class="fix_images" src="<?php echo yourls_get_domain( $longurl, true );?>/favicon.ico"/> <?php yourls_html_link( $longurl, '', 'longurl' ); ?></h3>\r
188 \r
189 <div id="tabs">\r
190         <div class="wrap_unfloat">\r
191         <ul id="headers" class="toggle_display stat_tab">\r
192                 <li class="selected"><a href="#stat_tab_stats"><h2>Traffic statistics</h2></a></li>\r
193                 <li><a href="#stat_tab_location"><h2>Traffic location</h2></a></li>\r
194                 <li><a href="#stat_tab_sources"><h2>Traffic sources</h2></a></li>\r
195                 <li><a href="#stat_tab_share"><h2>Share</h2></a></li>\r
196         </ul>\r
197         </div>\r
198 \r
199                         \r
200         <div id="stat_tab_stats" class="tab">\r
201                 <h2>Traffic statistics</h2>\r
202                 \r
203                 <?php if ( $list_of_days ) { ?>\r
204                 \r
205                         <?php\r
206                         $graphs = array(\r
207                                 '24' => 'Last 24 hours',\r
208                                 '7'  => 'Last 7 days',\r
209                                 '30' => 'Last 30 days',\r
210                                 'all'=> 'All time'\r
211                         );\r
212                         \r
213                         // Which graph to generate ?\r
214                         $do_all = $do_30 = $do_7 = $do_24 = false;\r
215                         $hits_all = array_sum( $list_of_days );\r
216                         $hits_30  = array_sum( array_slice( $list_of_days, -30 ) );\r
217                         $hits_7   = array_sum( array_slice( $list_of_days, -7 ) );\r
218                         $hits_24  = array_sum( $last_24h );\r
219                         if( $hits_all > 0 )\r
220                                 $do_all = true; // graph for all days range\r
221                         if( $hits_30 > 0 && count( array_slice( $list_of_days, -30 ) ) == 30 )\r
222                                 $do_30 = true; // graph for last 30 days\r
223                         if( $hits_7 > 0 && count( array_slice( $list_of_days, -7 ) ) == 7 )\r
224                                 $do_7 = true; // graph for last 7 days\r
225                         if( $hits_24 > 0 )\r
226                                 $do_24 = true; // graph for last 24 hours\r
227                         \r
228                         // Which graph to display ?\r
229                         $display_all = $display_30 = $display_7 = $display_24 = false;\r
230                         if( $do_24 ) {\r
231                                 $display_24 = true;\r
232                         } elseif ( $do_7 ) {\r
233                                 $display_7 = true;\r
234                         } elseif ( $do_30 ) {\r
235                                 $display_30 = true;\r
236                         } elseif ( $do_all ) {\r
237                                 $display_all = true;\r
238                         }                               \r
239                         ?>\r
240 \r
241                         <table border="0" cellspacing="2">\r
242                         <tr>\r
243                                 <td valign="top">\r
244                                 <ul id="stats_lines" class="toggle_display stat_line">\r
245                                 <?php\r
246                                 if( $do_24 == true )\r
247                                         echo "<li><a href='#stat_line_24'>Last 24 hours</a>";\r
248                                 if( $do_7 == true )\r
249                                         echo "<li><a href='#stat_line_7'>Last 7 days</a>";\r
250                                 if( $do_30 == true )\r
251                                         echo "<li><a href='#stat_line_30'>Last 30 days</a>";\r
252                                 if( $do_all == true )\r
253                                         echo "<li><a href='#stat_line_all'>All time</a>";\r
254                                 ?>                              \r
255                                 </ul>\r
256                                 <?php\r
257                                 // Generate, and display if applicable, each needed graph\r
258                                 foreach( $graphs as $graph => $title ) {\r
259                                         if( ${'do_'.$graph} == true ) {\r
260                                                 $display = ( ${'display_'.$graph} === true ? 'display:block' : 'display:none' );\r
261                                                 echo "<div id='stat_line_$graph' class='stats_line line' style='$display'>";\r
262                                                 $labels_1 = $labels_2 = array();\r
263                                                 switch( $graph ) {\r
264                                                         case '24':\r
265                                                                 // each key of $last_24h is of type "yy-mm-dd-hh"\r
266                                                                 $first_key = current( array_keys( $last_24h ) );\r
267                                                                 $last_key = end( array_keys( $last_24h ) );\r
268                                                                 // Get "dd/mm" of first and last key\r
269                                                                 $first_label = preg_replace( '/\d\d-(\d\d)-(\d\d)-\d\d/', '$2/$1', $first_key );\r
270                                                                 $last_label = preg_replace( '/\d\d-(\d\d)-(\d\d)-\d\d/', '$2/$1', $last_key );\r
271                                                                 $labels_2 = array( $first_label, $last_label);\r
272                                                                 // Get hh of each key\r
273                                                                 foreach( $last_24h as $k=>$v ) {\r
274                                                                         $labels_1[] = end( explode( '-', $k ) ); // 'hh'\r
275                                                                 }\r
276                                                                 \r
277                                                                 echo "<h3>Number of hits : $title</h3>";\r
278                                                                 yourls_stats_line( $last_24h, $labels_1, $labels_2 );\r
279                                                                 break;\r
280 \r
281                                                         case '7':\r
282                                                         case '30':\r
283                                                                 // each key of $list_of_days is of type "yyyy-mm-dd"\r
284                                                                 $slice = array_slice( $list_of_days, intval( $graph ) * -1 );\r
285                                                                 foreach( $slice as $k=>$v ) {\r
286                                                                         // get "dd"\r
287                                                                         $labels_1[] = preg_replace( '/\d\d\d\d-\d\d-(\d\d)/', '$1', $k );\r
288                                                                 }\r
289                                                                 $first_key = current( array_keys( $slice ) );\r
290                                                                 $last_key = end( array_keys( $slice ) );\r
291                                                                 // Get "dd/mm" of first and last key\r
292                                                                 $first_label = preg_replace( '/\d\d\d\d-(\d\d)-(\d\d)/', '$2/$1', $first_key );\r
293                                                                 $last_label = preg_replace( '/\d\d\d\d-(\d\d)-(\d\d)/', '$2/$1', $last_key );\r
294                                                                 $labels_2 = array( $first_label, $last_label);\r
295                                                                 \r
296                                                                 echo "<h3>Number of hits : $title</h3>";\r
297                                                                 yourls_stats_line( $slice, $labels_1, $labels_2 );\r
298                                                                 unset( $slice );\r
299                                                                 break;\r
300 \r
301                                                         case 'all':\r
302                                                                 // get "yy-mm"\r
303                                                                 foreach( $list_of_days as $k=>$v ) {\r
304                                                                         $labels_1[] = preg_replace( '/\d\d(\d\d)-(\d\d)-\d\d/', '$1-$2', $k );\r
305                                                                 }\r
306                                                                 // take out duplicates\r
307                                                                 $labels_1 = array_unique( $labels_1 );\r
308                                                                 // now get "mm" only so we have all different month\r
309                                                                 foreach( $labels_1 as $k=>$v ) {\r
310                                                                         $labels_1[$k] = preg_replace( '/\d\d-(\d\d)/', '$1', $v );\r
311                                                                 }\r
312                                                                 \r
313                                                                 echo "<h3>Number of hits : $title</h3>";\r
314                                                                 $labels_1 = yourls_array_granularity( $labels_1, 30, false );\r
315                                                                 $labels_2 = yourls_array_granularity( $list_of_years, 30, false );\r
316                                                                 yourls_stats_line( $list_of_days, $labels_1, $labels_2 );\r
317                                                                 break;\r
318                                                 }\r
319                                                 echo "</div>\n";\r
320                                         }                       \r
321                                 } ?>\r
322                                 \r
323                                 </td>\r
324                                 <td valign="top">\r
325                                 <h3>Historical click count</h3>\r
326                                 <?php\r
327                                 $ago = round( (date('U') - strtotime($timestamp)) / (24* 60 * 60 ) );\r
328                                 if( $ago <= 1 ) {\r
329                                         $ago = '';\r
330                                 } else {\r
331                                         $ago = '(about '.$ago .' '.yourls_plural( ' day', $ago ).' ago)';\r
332                                 }\r
333                                 ?>\r
334                                 <p>Short URL created on <?php echo date("F j, Y @ g:i a", strtotime($timestamp)); ?> <?php echo $ago; ?></p>\r
335                                 <div class="wrap_unfloat">\r
336                                         <ul class="no_bullet toggle_display stat_line" id="historical_clicks">\r
337                                         <?php\r
338                                         foreach( $graphs as $graph => $title ) {\r
339                                                 if ( ${'do_'.$graph} ) {\r
340                                                         $link = "<a href='#stat_line_$graph'>$title</a>";\r
341                                                 } else {\r
342                                                         $link = $title;\r
343                                                 }\r
344                                                 $hits = yourls_plural( 'hit', ${'hits_'.$graph} );\r
345                                                 echo "<li><span class='historical_link'>$link</span> ${'hits_'.$graph} $hits</li>\n";\r
346                                         }\r
347                                         ?>\r
348                                         </ul>\r
349                                 </div>\r
350                 \r
351                                 <h3>Best day</h3>\r
352                                 <?php $best = yourls_stats_get_best_day( $list_of_days ); ?>\r
353                                 <p><strong><?php echo $best['max'];?></strong> <?php echo yourls_plural( 'hit', $best['max'] ); ?> on <?php echo date("F j, Y", strtotime($best['day'])); ?>. \r
354                                 <a href="" class='details' id="more_clicks">Click for more details</a></p>\r
355                                 <ul id="details_clicks" style="display:none">\r
356                                         <?php\r
357                                         foreach( $dates as $year=>$months ) {\r
358                                                 if( count( $list_of_years ) > 1 ) {\r
359                                                         $li = "<a href='' class='details' id='more_year$year'>Year $year</a>";\r
360                                                         $display = 'none';\r
361                                                 } else {\r
362                                                         $li = "Year $year";\r
363                                                         $display = 'block';\r
364                                                 }\r
365                                                 echo "<li>$li";\r
366                                                 echo "<ul style='display:$display' id='details_year$year'>";\r
367                                                 foreach( $months as $month=>$days ) {\r
368                                                         $monthname = date("F", mktime(0, 0, 0, $month,1));\r
369                                                         if( count( $list_of_months ) > 1 ) {\r
370                                                                 $li = "<a href='' class='details' id='more_month$year$month'>$monthname</a>";\r
371                                                                 $display = 'none';\r
372                                                         } else {\r
373                                                                 $li = "$monthname";\r
374                                                                 $display = 'block';\r
375                                                         }\r
376                                                         echo "<li>$li";\r
377                                                         echo "<ul style='display:$display' id='details_month$year$month'>";\r
378                                                                 foreach( $days as $day=>$hits ) {\r
379                                                                         $class = ( $hits == $best['max'] ? 'class="bestday"' : '' );\r
380                                                                         echo "<li $class>$day: $hits". yourls_plural( ' hit', $hits) ."</li>\n";\r
381                                                                 }\r
382                                                         echo "</ul>\n";\r
383                                                 }\r
384                                                 echo "</ul>\n";\r
385                                         }\r
386                                         ?>\r
387                                 </ul>\r
388                                 \r
389                                 </td>\r
390                                 \r
391                         </tr>\r
392                         </table>\r
393 \r
394 \r
395                 \r
396                 <?php } else {\r
397                         echo "<p>No traffic yet. Get some clicks first!</p>";\r
398                 } ?>\r
399         </div>\r
400 \r
401 \r
402         <div id="stat_tab_location" class="tab">\r
403                 <h2>Traffic location</h2>\r
404                 \r
405                 <?php if ( $countries ) { ?>\r
406                         \r
407                         <table border="0" cellspacing="2">\r
408                         <tr>\r
409                                 <td valign="top">\r
410                                         <h3>Top 5 countries</h3>\r
411                                         <?php yourls_stats_pie( $countries, 5 ); ?>\r
412                                         <p><a href="" class='details' id="more_countries">Click for more details</a></p>\r
413                                         <ul id="details_countries" style="display:none" class="no_bullet">\r
414                                         <?php\r
415                                         foreach( $countries as $code=>$count ) {\r
416                                                 echo "<li><img src='".yourls_geo_get_flag( $code )."' /> $code (".yourls_geo_countrycode_to_countryname( $code ).") : $count ".yourls_plural('hit', $count)."</li>\n";\r
417                                         }               \r
418                                         ?>\r
419                                         </ul>\r
420 \r
421                                 </td>\r
422                                 <td valign="top">\r
423                                         <h3>Overall traffic</h3>\r
424                                         <?php yourls_stats_countries_map( $countries ); ?>\r
425                                 </td>\r
426                         </tr>\r
427                         </table>\r
428                 \r
429                 <?php } else {\r
430                         echo "<p>No country data.</p>";\r
431                 } ?>\r
432         </div>\r
433                                 \r
434                                 \r
435         <div id="stat_tab_sources" class="tab">\r
436                 <h2>Traffic Sources</h2>\r
437                 \r
438                 <?php if ( $referrers ) { ?>\r
439                         \r
440                         <table border="0" cellspacing="2">\r
441                         <tr>\r
442                                 <td valign="top">\r
443                                         <h3>Referrer shares</h3>\r
444                                         <?php\r
445                                         if ( $number_of_sites > 1 )\r
446                                                 $referrer_sort['Others'] = count( $referrers );\r
447                                         yourls_stats_pie( $referrer_sort, 5, '440x220', '902020,FF6060' );\r
448                                         unset( $referrer_sort['Others'] );\r
449                                         ?>\r
450                                         <h3>Referrers</h3>\r
451                                         <ul class="no_bullet">\r
452                                                 <?php\r
453                                                 $i = 0;\r
454                                                 foreach( $referrer_sort as $site => $count ) {\r
455                                                         $i++;\r
456                                                         echo "<li class='sites_list'><img src='http://$site/favicon.ico' class='fix_images'/> $site: <strong>$count</strong> <a href='' class='details' id='more_url$i'>(details)</a></li>\n";\r
457                                                         echo "<ul id='details_url$i' style='display:none'>";\r
458                                                         foreach( $referrers[$site] as $url => $count ) {\r
459                                                                 echo "<li>"; yourls_html_link($url); echo ": <strong>$count</strong></li>\n";\r
460                                                         }\r
461                                                         echo "</ul>\n";\r
462                                                         unset( $referrers[$site] );\r
463                                                 }\r
464                                                 // Any referrer left? Group in "various"\r
465                                                 if ( $referrers ) {\r
466                                                         echo "<li id='sites_various'>Various: <strong>". count( $referrers ). "</strong> <a href='' class='details' id='more_various'>(details)</a></li>\n";\r
467                                                         echo "<ul id='details_various' style='display:none'>";\r
468                                                         foreach( $referrers as $url ) {\r
469                                                                 echo "<li>"; yourls_html_link(key($url)); echo ": 1</li>\n";    \r
470                                                         }\r
471                                                         echo "</ul>\n";\r
472                                                 }\r
473                                                 ?>\r
474                                                 \r
475                                         </ul>\r
476                                 \r
477                                 </td>\r
478                                 \r
479                                 <td valign="top">\r
480                                         <h3>Direct vs Referrer Traffic</h3>\r
481                                         <?php\r
482                                         yourls_stats_pie( array('Direct'=>$direct, 'Referrers'=> $notdirect), 5, '440x220', '902020,FF6060' );\r
483                                         ?>\r
484                                         <p>Direct traffic: <strong><?php echo $direct; ?></strong> <?php echo yourls_plural( 'hit', $direct ); ?> </p>\r
485                                         <p>Referrer traffic: <strong><?php echo $notdirect; ?></strong> <?php echo yourls_plural( 'hit', $notdirect ); ?> </p>\r
486 \r
487                                 </td>\r
488                         </tr>\r
489                         </table>\r
490 \r
491                 <?php } else {\r
492                         echo "<p>No referrer data.</p>";\r
493                 } ?>\r
494                         \r
495         </div>\r
496 \r
497         <div id="stat_tab_share" class="tab">\r
498                 <h2>Share</h2>\r
499                 \r
500                 <?php yourls_share_box( $longurl, YOURLS_SITE.'/'.$keyword, '', '', '<h3>Short link</h3>', '<h3>Quick Share</h3>'); ?>\r
501 \r
502         </div>\r
503         \r
504 </div>\r
505 \r
506 \r
507 <?php yourls_html_footer(); ?>