From 227f66448bddfcf1221aba3c40f38cf47e238342 Mon Sep 17 00:00:00 2001 From: ozhozh Date: Sat, 12 Sep 2009 22:37:06 +0000 Subject: [PATCH] Misc cosmetic tweaks git-svn-id: http://yourls.googlecode.com/svn/trunk@137 12232710-3e20-11de-b438-597f59cd7555 --- css/style.css | 19 ++++++------ includes/functions-auth.php | 56 +++++++++++++++++++----------------- includes/functions-infos.php | 28 ++++++++++++++++++ includes/functions.php | 6 ++-- js/infos.js | 2 +- yourls-infos.php | 25 +++++++++------- 6 files changed, 87 insertions(+), 49 deletions(-) diff --git a/css/style.css b/css/style.css index 2cd7434..af2e262 100644 --- a/css/style.css +++ b/css/style.css @@ -2,7 +2,7 @@ body { font-family: Verdana, Arial; font-size: 12px; color: #595441; - background:#E6EEEE; + background:#F0F0F6; text-align:center; margin-top:0px; padding-top:0px; @@ -10,11 +10,12 @@ body { #wrap { width:980px; margin:0 auto; - border-left:2px solid #E6FFEE; - border-right:2px solid #E6eeff; background:white; text-align:justify; - padding:0 20px; + padding:0 20px 10px 20px; + border-left:3px solid #D5E3E3; + border-right:3px solid #D5E3E3; + border-bottom:2px solid #D5E3E3; -moz-border-radius-bottomleft:20px; -moz-border-radius-bottomright:20px; -webkit-border-bottom-left-radius:20px; @@ -142,9 +143,6 @@ td.actions .button_stats:hover { width: 300px; margin: 200px auto 0px auto; } -#login img { - margin-left:50px; -} #login p{ font-weight: bold; } @@ -189,7 +187,7 @@ td.actions .button_stats:hover { } #footer { text-align:center; - margin-top:10px; + margin-top:20px; } #footer p { padding:10px; @@ -198,6 +196,11 @@ td.actions .button_stats:hover { width:980px; -moz-border-radius:10px; -webkit-border-radius:10px; + border:2px solid #D5E3E3; + -moz-border-radius-bottomleft:30px; + -moz-border-radius-bottomright:30px; + -webkit-border-bottom-left-radius:25px; + -webkit-border-bottom-right-radius:25px; } #footer p a { background:#fff url(../images/favicon.gif) 2px center no-repeat; diff --git a/includes/functions-auth.php b/includes/functions-auth.php index 70c8d97..9ee8ce7 100644 --- a/includes/functions-auth.php +++ b/includes/functions-auth.php @@ -56,31 +56,33 @@ function yourls_salt( $string ) { function yourls_login_screen( $error_msg = '' ) { yourls_html_head( 'login' ); ?> -
-
-

- YOURLS -

- '.$error_msg.'

'; - } - ?> -

-
- -

-

-
- -

-

- -

-
- -
- + YOURLS: Your Own URL Shortener
+ YOURLS
+ + +
+
+ '.$error_msg.'

'; + } + ?> +

+
+ +

+

+
+ +

+

+ +

+
+ +
+ $bday, 'max' => $max ); +} + +// Fetch remote page title +function yourls_get_page_title( $url, $default = '' ) { + if ( !class_exists('DOMDocument') ) + return $default; + + $dom = new DOMDocument(); + if( @$dom->loadHTMLFile('http://planetozh.com/') ) { + $list = $dom->getElementsByTagName("title"); + if ($list->length > 0) { + return( $list->item(0)->textContent ); + } + } + + return $default; +} + +// Return domain of a URL +function yourls_get_domain( $url, $include_scheme = false ) { + $parse = parse_url( $url ); + $host = $parse['host']; + $scheme = $parse['scheme']; + + if ( $include_scheme ) + $host = $scheme.'://'.$host; + + return $host; } diff --git a/includes/functions.php b/includes/functions.php index b3abd53..07574b2 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1150,10 +1150,12 @@ function yourls_maybe_require_auth() { } // Echo HTML tag for a link -function yourls_html_link( $href, $title = '' ) { +function yourls_html_link( $href, $title = '', $element = '' ) { if( !$title ) $title = $href; - echo "$title"; + if( $element ) + $element = "id='$element'"; + echo "$title"; } // Return word or words if more than one diff --git a/js/infos.js b/js/infos.js index d229bd6..a2b40ea 100644 --- a/js/infos.js +++ b/js/infos.js @@ -27,4 +27,4 @@ $(document).ready(function(){ return false; }); -}); \ No newline at end of file +}); diff --git a/yourls-infos.php b/yourls-infos.php index 5082e9c..43bb806 100644 --- a/yourls-infos.php +++ b/yourls-infos.php @@ -38,9 +38,7 @@ if ( $referrer == 'direct' ) { $direct++; } else { - $parse = parse_url( $referrer ); - $host = $parse['host']; - unset( $parse ); + $host = yourls_get_domain( $referrer ); if( !array_key_exists( $host, $referrers ) ) $referrers[$host] = array( ); if( !array_key_exists( $referrer, $referrers[$host] ) ) @@ -79,8 +77,9 @@ // Sort referrers. $referrer_sort is a array of most frequent domains arsort( $referrers ); $referrer_sort = array(); +$number_of_sites = count( array_keys( $referrers ) ); foreach( $referrers as $site => $urls ) { - if( count($urls) > 1 ) + if( count($urls) > 1 || $number_of_sites == 1 ) $referrer_sort[$site] = array_sum( $urls ); } arsort($referrer_sort); @@ -109,7 +108,7 @@

Informations

Short URL:

-

Long URL:

+

Long URL:

Number of hits since : hit 1 ? 's' : ''); ?>

@@ -196,7 +195,8 @@

Referrer shares

1 ) + $referrer_sort['Others'] = count( $referrers ); yourls_stats_pie( $referrer_sort, 5, '440x220', '902020,FF6060' ); unset( $referrer_sort['Others'] ); ?> @@ -214,12 +214,15 @@ echo "\n"; unset( $referrers[$site] ); } - echo "
  • Various: ". count( $referrers ). " (details)
  • \n"; - echo "\n" ?> -- 2.45.0