diff options
author | ozhozh <ozhozh@12232710-3e20-11de-b438-597f59cd7555> | 2010-06-25 20:13:25 +0400 |
---|---|---|
committer | ozhozh <ozhozh@12232710-3e20-11de-b438-597f59cd7555> | 2010-06-25 20:13:25 +0400 |
commit | 260516aea2dc2bec4cfa0fd1296d82e556c1aece (patch) | |
tree | 332906319cb86734b38745304db0e34b0ff59569 /yourls-infos.php | |
parent | 2edeb615cb043d7c219e610dab651e3478afde49 (diff) |
Store URL titles in DB when displaying stats page
git-svn-id: http://yourls.googlecode.com/svn/trunk@417 12232710-3e20-11de-b438-597f59cd7555
Diffstat (limited to 'yourls-infos.php')
-rw-r--r-- | yourls-infos.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/yourls-infos.php b/yourls-infos.php index 13305d00..f99c8e0d 100644 --- a/yourls-infos.php +++ b/yourls-infos.php @@ -21,6 +21,13 @@ $keyword = yourls_sanitize_string( $keyword ); $longurl = yourls_get_keyword_longurl( $keyword );
$clicks = yourls_get_keyword_clicks( $keyword );
$timestamp = yourls_get_keyword_timestamp( $keyword );
+$title = yourls_get_keyword_title( $keyword );
+
+// Update title if it hasn't been stored yet
+if( $title == '' ) {
+ $title = yourls_get_remote_title( $longurl );
+ yourls_edit_link_title( $keyword, $title );
+}
if ( $longurl === false ) {
yourls_do_action( 'infos_keyword_not_found' );
@@ -167,7 +174,7 @@ yourls_html_logo(); yourls_html_menu();
?>
-<h2 id="informations">Information</h2>
+<h2 id="informations"><?php echo $title; ?></h2>
<h3>Short URL: <img src="<?php echo YOURLS_SITE; ?>/images/favicon.gif"/>
<?php if( $aggregate ) {
@@ -187,7 +194,7 @@ yourls_html_menu(); if( count( $keyword_list ) > 1 )
echo ' <a href="'. yourls_link($keyword).'+all" title="Aggregate stats for duplicate short URLs"><img src="' . YOURLS_SITE . '/images/chart_bar_add.png" border="0" /></a>';
} ?></h3>
-<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>
+<h3 id="longurl">Long URL: <img class="fix_images" src="<?php echo yourls_get_domain( $longurl, true );?>/favicon.ico"/> <?php yourls_html_link( $longurl, yourls_trim_long_string( $longurl ), 'longurl' ); ?></h3>
<div id="tabs">
<div class="wrap_unfloat">
|