Changeset 95
- Timestamp:
- 02/20/08 10:28:06 (9 months ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
lib/action.php (modified) (1 diff)
-
lib/main.php (modified) (2 diffs)
-
wassup.php (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/action.php
r94 r95 65 65 // ACTION: RUN TOP TEN 66 66 } elseif ($_GET['action'] == "topten") { 67 $siteurl = parse_url($siteurl); 68 $siteurl = $siteurl['host']; 67 69 //#get top 10 searches... 68 $ch_search = $wpdb->get_results("SELECT count(search) as top_search, search, referrer FROM $table_name WHERE search!='' AND spam= '0'AND timestamp BETWEEN $from_date AND $to_date GROUP BY search ORDER BY top_search DESC LIMIT 10");70 $ch_search = $wpdb->get_results("SELECT count(search) as top_search, search, referrer FROM $table_name WHERE search!='' AND spam=0 AND timestamp BETWEEN $from_date AND $to_date GROUP BY search ORDER BY top_search DESC LIMIT 10"); 69 71 //#get top 10 requests... 70 $ch_urlreq = $wpdb->get_results("SELECT count(urlrequested) as top_urlrequested, urlrequested FROM $table_name WHERE urlrequested!='' AND spam= '0'AND timestamp BETWEEN $from_date AND $to_date GROUP BY urlrequested ORDER BY top_urlrequested DESC LIMIT 10");72 $ch_urlreq = $wpdb->get_results("SELECT count(urlrequested) as top_urlrequested, urlrequested FROM $table_name WHERE urlrequested!='' AND spam=0 AND timestamp BETWEEN $from_date AND $to_date GROUP BY urlrequested ORDER BY top_urlrequested DESC LIMIT 10"); 71 73 //#get top 50 referrers...will be narrowed down to 10 72 74 //# with exclusion of wpurl referrals... 73 $ch_referer = $wpdb->get_results("SELECT count(referrer) as top_referrer, referrer FROM $table_name WHERE referrer!='' AND spam= '0'AND referrer NOT LIKE '%".$siteurl."%' AND searchengine='' AND timestamp BETWEEN $from_date AND $to_date GROUP BY referrer ORDER BY top_referrer DESC LIMIT 50");75 $ch_referer = $wpdb->get_results("SELECT count(referrer) as top_referrer, referrer FROM $table_name WHERE referrer!='' AND spam=0 AND referrer NOT LIKE '%".$siteurl."%' AND searchengine='' AND timestamp BETWEEN $from_date AND $to_date GROUP BY referrer ORDER BY top_referrer DESC LIMIT 50"); 74 76 //#get top 10 browsers... 75 $ch_browser = $wpdb->get_results("SELECT count(browser) as top_browser, browser FROM $table_name WHERE browser!='' AND spam= '0'AND browser NOT LIKE '%N/A%' AND timestamp BETWEEN $from_date AND $to_date GROUP BY browser ORDER BY top_browser DESC LIMIT 10");77 $ch_browser = $wpdb->get_results("SELECT count(browser) as top_browser, browser FROM $table_name WHERE browser!='' AND spam=0 AND browser NOT LIKE '%N/A%' AND timestamp BETWEEN $from_date AND $to_date GROUP BY browser ORDER BY top_browser DESC LIMIT 10"); 76 78 //#get top 10 operating systems... 77 $ch_os = $wpdb->get_results("SELECT count(os) as top_os, os FROM $table_name WHERE os!='' AND os NOT LIKE '%N/A%' AND spam= '0'AND timestamp BETWEEN $from_date AND $to_date GROUP BY os ORDER BY top_os DESC LIMIT 10");79 $ch_os = $wpdb->get_results("SELECT count(os) as top_os, os FROM $table_name WHERE os!='' AND os NOT LIKE '%N/A%' AND spam=0 AND timestamp BETWEEN $from_date AND $to_date GROUP BY os ORDER BY top_os DESC LIMIT 10"); 78 80 ?> 79 81 <div> -
trunk/lib/main.php
r86 r95 306 306 } elseif (preg_match("/(?:Windows95|Windows 95|Win95|Win 95)/",$useragent,$match)) { 307 307 $os = "Windows"; $version = "95"; 308 } elseif (preg_match("/(?:Windows98|Windows 98|Win98|Win 98 )/",$useragent,$match)) {308 } elseif (preg_match("/(?:Windows98|Windows 98|Win98|Win 98|Win 9x)/",$useragent,$match)) { 309 309 $os = "Windows"; $version = "98"; 310 310 } elseif (preg_match("/(?:WindowsCE|Windows CE|WinCE|Win CE)/",$useragent,$match)) { … … 354 354 } elseif (preg_match("/^Mozilla(?:.*)compatible;\sMSIE\s([0-9\.]+)/",$useragent,$match)) { 355 355 $browser = "MSIE"; 356 } elseif (preg_match("/^Mozilla(?:.*)\(Macintosh(?:.*)Safari\/([0-9\.]+)/",$useragent,$match)) { 356 } elseif (preg_match("/^(?:.*)compatible;\sMSIE\s([0-9\.]+)/",$useragent,$match)) { 357 $browser = "MSIE"; 358 } elseif (preg_match("/^Mozilla(?:.*)(?:.*)Safari/",$useragent,$match)) { 357 359 $browser = "Safari"; 360 //} elseif (preg_match("/^Mozilla(?:.*)\(Windows(?:.*)Safari\/([0-9\.]+)/",$useragent,$match)) { 361 // $browser = "Safari"; 358 362 } elseif (preg_match("/^Mozilla(?:.*)\(Macintosh(?:.*)OmniWeb\/v([0-9\.]+)/",$useragent,$match)) { 359 363 $browser = "Omniweb"; -
trunk/wassup.php
r94 r95 1059 1059 1060 1060 if (isset($_SERVER['REQUEST_URI']) && !ereg("^/$", $_SERVER['REQUEST_URI'])) { 1061 $urlRequested = eregi_replace("/$", "", $_SERVER['REQUEST_URI']);1061 $urlRequested = eregi_replace("/$", "", clean_url($_SERVER['REQUEST_URI'])); 1062 1062 } else { 1063 $urlRequested = $_SERVER['REQUEST_URI'];1063 $urlRequested = clean_url($_SERVER['REQUEST_URI']); 1064 1064 } 1065 1065 $referrer = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''); … … 1482 1482 function wGetSE($referrer = null){ 1483 1483 $key = null; 1484 $lines = array("Alice|search.alice.it|qs|","Google|www.google.|q|","Google Groups|groups.google.|q|", "Google Images|images.google.|prev|", "Yahoo|search.yahoo.com|p|", 1484 $lines = array("Alice|search.alice.it|qs|", "Google|www.google.|as_q|", "Google|www.google.|q|", "Google Groups|groups.google.|q|", 1485 "Google Images|images.google.|prev|", "Yahoo|search.yahoo.com|p|", "Google Blog|blogsearch.google.|as_q|", "Google Blog|blogsearch.google.|q|", 1485 1486 "Virgilio|search.virgilio.it|qs|","Arianna|arianna.libero.it|query|","Altavista|.altavista.com|q|","Kataweb|kataweb.it|q|", 1486 1487 "Il Trovatore|categorie.iltrovatore.it|query|","Il Trovatore|search.iltrovatore.it|q|","2020Search|2020search.c|us|st|pn|1|", … … 1493 1494 "Web|web.de|su|","Clarence|search.clarence.com|q|","Gazzetta|search.gazzetta.it|q|","PagineGialle|paginegialle.it|qs|", 1494 1495 "Jumpy|servizi.mediaset.it|searchWord|","ItaliaPuntoNet|italiapuntonet.net|search|","StartNow|search.startnow.|q|","Search|search.it|srctxt|", 1495 "Search|search.com|q|" );1496 "Search|search.com|q|", "Good Search|goodsearch.com|Keywords|"); 1496 1497 foreach($lines as $line_num => $se) { 1497 1498 list($nome,$url,$key,$lang)=explode("|",$se); … … 1526 1527 "ichiro|ichiro|", "shelob|shelob|", "Google AdSense|Mediapartners-Google|", "Seekbot|HTTPFetcher|", "CommentTracker|CommentTracker|", 1527 1528 "Bloglines|bloglines|", "Italian Blog Rankings|blogbabel", "Ask Jeeves/Teoma|ask|", "Akregator|Akregator|", "NewsGatorOnline|NewsGatorOnline|", "Rojo|rojo|", "FeedTools|feedtools|", 1528 "Feedfetcher-Google|Feedfetcher-google|", "AideRSS|AideRSS|", "psbot|psbot|", "Ruby|Rfeedfinder|", "everyfeed-spider|everyfeed-spider", "Attentio/Nutch|Attentio ",1529 "Feedfetcher-Google|Feedfetcher-google|", "AideRSS|AideRSS|", "psbot|psbot|", "Ruby|Rfeedfinder|", "everyfeed-spider|everyfeed-spider", "Attentio/Nutch|Attention", 1529 1530 "Megite2.0|Megite.com|", "radianrss|RadianRSS|", "Sitemap Generator|Sitemap Generator|", "Feedshow|Feedshow|", "ABCdatos|ABCdatos|", "Acme.Spider|Due|", "Ahoy!|Ahoy!|", 1530 1531 "Alkaline|AlkalineBOT|", "appie|Appie|", "Arachnophilia|Arachnophilia|", "Araneo|Araneo/0.7|", "AraybOt|AraybOt/1.0|", "ArchitextSpider|ArchitextSpider|", … … 1573 1574 "WikioFeedBot|WikioFeedBot|", "Strategic Board Bot |Strategic Board Bot |", "Mail.ru|Mail.ru|", "OpiDig|OpiDig|", "webcollage|webcollage|", 1574 1575 "R6_FeedFetcher|R6_FeedFetcher|", "UniversalFeedParser|UniversalFeedParser|", "Syndic8|Syndic8|", "BlogBot|BlogBot|", "W3C_Validator|W3C_Validator|", 1575 "Runnk RSS aggregator|Runnk|", "RssBandit|RssBandit|"); 1576 "Runnk RSS aggregator|Runnk|", "RssBandit|RssBandit|", "Sphere Scout|Sphere Scout|", "BlogPulseLive|BlogPulseLive|", "AMZNKAssocBot|AMZNKAssocBot|", 1577 "Yandex|Yandex|", "heritrix|heritrix|", "gsinfobot|gsinfobot|", "FeedHub FeedFetcher|FeedHub FeedFetcher|", "WikioPxyFeedBo|WikioPxyFeedBo|", 1578 "KindOpener|KindOpener|", "AlbertBot|AlbertBot|", "Nutch/Nutch|Nutch/Nutch|", "Lsearch/sondeur|Lsearch/sondeur|", "OWPBot|OWPBot|", 1579 "Feed::Find|Feed::Find|", "eZ publish Link Validator|eZ publish Link Validator|", "R6_CommentReade|R6_CommentReade|", 1580 "Strategic Board Bot|Strategic Board Bot|", "OSSE Scanner|OSSE Scanner|", "PECL::HTTP|PECL::HTTP|", "GetRight|GetRight|", "yacybot|yacybot|", 1581 "GurujiBot|GurujiBot|", "Missigua Locator|Missigua Locator|", "ISC Systems iRc Search|ISC Systems iRc Search|", "whiteiexpres/Nutch|whiteiexpres/Nutch|", 1582 "kalooga/kalooga|kalooga/kalooga|", "Bookdog|Bookdog|"); 1576 1583 foreach($lines as $line_num => $spider) { 1577 1584 list($nome,$key)=explode("|",$spider); … … 1808 1815 } // end backup_table() 1809 1816 1817 // START initializing Widget 1810 1818 function wassup_widget_init() { 1811 1819 … … 1839 1847 print "<ul class='$ulclass'>"; 1840 1848 foreach ($query_det as $sref) { 1841 print "<li>- <a href='". htmlentities($sref->referrer)."' target='_BLANK'>".stringShortener($sref->search, $chars)."</a></li>";1849 print "<li>- <a href='".attribute_escape($sref->referrer)."' target='_BLANK'>".stringShortener($sref->search, $chars)."</a></li>"; 1842 1850 } 1843 1851 print "</ul>"; … … 1852 1860 print "<ul class='$ulclass'>"; 1853 1861 foreach ($query_ref as $eref) { 1854 print "<li>- <a href='". htmlentities($eref->referrer)."' target='_BLANK'>".stringShortener(eregi_replace("http://", "", htmlentities($eref->referrer)), $chars)."</a></li>";1862 print "<li>- <a href='".attribute_escape($eref->referrer)."' target='_BLANK'>".stringShortener(eregi_replace("http://", "", attribute_escape($eref->referrer)), $chars)."</a></li>"; 1855 1863 } 1856 1864 print "</ul>"; … … 1995 2003 print "<ul class='$ulclass'>"; 1996 2004 foreach ($query_det as $sref) { 1997 print "<li>- <a href='". $sref->referrer."' target='_BLANK'>".stringShortener($sref->search, $chars)."</a></li>";2005 print "<li>- <a href='".attribute_escape($sref->referrer)."' target='_BLANK'>".stringShortener(attribute_escape($sref->search), $chars)."</a></li>"; 1998 2006 } 1999 2007 print "</ul>"; … … 2007 2015 print "<ul class='$ulclass'>"; 2008 2016 foreach ($query_ref as $eref) { 2009 print "<li>- <a href='". $eref->referrer."' target='_BLANK'>".stringShortener(eregi_replace("http://", "", $eref->referrer), $chars)."</a></li>";2017 print "<li>- <a href='".attribute_escape($eref->referrer)."' target='_BLANK'>".stringShortener(eregi_replace("http://", "", attribute_escape($eref->referrer)), $chars)."</a></li>"; 2010 2018 } 2011 2019 print "</ul>"; … … 2019 2027 print "<ul class='$ulclass'>"; 2020 2028 foreach ($query_topbr as $etopbr) { 2021 print "<li>- ".stringShortener( $etopbr->browser, $chars)."</li>";2029 print "<li>- ".stringShortener(attribute_escape($etopbr->browser), $chars)."</li>"; 2022 2030 } 2023 2031 print "</ul>"; … … 2031 2039 print "<ul class='$ulclass'>"; 2032 2040 foreach ($query_topos as $etopos) { 2033 print "<li>- ".stringShortener( $etopos->os, $chars)."</li>";2041 print "<li>- ".stringShortener(attribute_escape($etopos->os), $chars)."</li>"; 2034 2042 } 2035 2043 print "</ul>";
