Register | Log in | RSS channel for codegravity.com homepage Bookmark!

284/2NEW projects | 71 services | 215 websites | 834/3NEW freelancers | 2126 topics | advertise



Login:



Forgot your password?
Forgot your username?
Create an account
JoomlaWatch Agent

Users

Most active users today from total of 108:
garikello, Peerke, jakkrit, dayanand, andrew_saber, giakhanh, mohalb, carmachhh, fguyon, dfireablaze, boho, phoeker, ozedfr, ashish_php, amoluca, blackie, JDev, tinytim007, Pascale, besoil


19.9%United States United States
17.9%India India
9.3%Germany Germany
5.5%Russian Federation Russian Federation
4.4%United Kingdom United Kingdom
4.3%France France
4%Australia Australia
3.8%Netherlands Netherlands
3.8%Poland Poland
3.7%Italy Italy

Today: 947
Yesterday: 1402
This Week: 5237
Last Week: 8869
This Month: 2349
Last Month: 37593
Total: 117029


Partners:

HTML5, CSS3, SVG, tutorials

Freelance ColdFusion, Flex, PHP

Olejomalby, abstraktne obrazy

Camping Europe

WinAsm Studio

Vyšné Ružbachy

Sochy, Reštaurovanie

R.E.M.

Valid XHTML 1.0 Transitional

RSS feed:

Statistics:
Search Engine Genie Promotion Widget
Home
Welcome, Guest
Please Login or Register.    Lost Password?

Keywords per visit
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: Keywords per visit
#2364
Keywords per visit 7 Months ago Karma: 0
(this is a repost of my previous topic, disappear after forum update)

Hi,
I like to see keywords per visit near the "came from", ok you can pass your mouse on url and try to read it but i'm lazy.
I'm not a good programmer but I have done some mod and it's working fine so others can use it, and I hope you will improve and put in next version.

I also notice a problem with URL containing htmlspecialchars, it's happen sometimes

Here is the code (for v1.2.9) :
The idea is to detect keyword and put it at the start of the line, we use Google url rules as general : q=keywords

1) in components/com_joomlawatch/class.joomlawatch.helper.php
Find line 146
Code:

function truncate($str, $len = ""«») {

Add before
Code:


function truncateUrl($str, $len) {
if (strlen($str)+$len < 120)
return $str;
else
return substr($str, 0, 120-$len) . "...";
}



(120 is line lenght, good for 1024x800 window, adapt it to your needs)


2) in components/com_joomlawatch/class.joomlawatch.html.php
Find line 443 to 446
Code:


if (@ $row->referer) {
$refererTruncated = $this->joomlaWatch->helper->truncate($row->referer);
$output .= "<i style='color: gray;'> " . _JW_VISITS_CAME_FROM . ": <a href='$row->referer' target='_blank' style='color: gray;' title='$row->referer'>$refererTruncated</a></i>";
}



Replace by
Code:


if (@ $row->referer) {
$output .= "</td><tr><td colspan=8>"; // use all columns

$refererTruncated = str_replace('?', '&', $row->referer); // to prevent url starting with search?q= because we use '&q=' to detect keywords

// Some others search engines don't use 'q=' so we convert it (add yours)
$refererTruncated = str_replace('_nkw=', 'q=', $refererTruncated); // Ebay
$refererTruncated = str_replace('rdata=', 'q=', $refererTruncated); // Voila
$refererTruncated = str_replace('keyword=', 'q=', $refererTruncated);

// We write in blue an engine short name (add yours) with a code for later split
$refererTruncated = str_replace('http://www.google.com/search', '<font color=blue>GoogleCOM</font> {sp}', $refererTruncated);
$refererTruncated = str_replace('http://www.google.fr/search', '<font color=blue>GoogleFR</font> {sp}', $refererTruncated);
$refererTruncated = str_replace('http://shop.ebay.fr/', '<font color=blue>EbayFR</font> {sp}', $refererTruncated);

// No we are ready to separate keywords
$refererTruncated = explode('&', $refererTruncated);
foreach ($refererTruncated as $rtvalue) {
if (substr($rtvalue, 0, 2) == 'q=')
$rtq = str_replace('q=', '', $rtvalue);
else
$rtr .= $rtvalue.'&';
}
if ($rtq=='') $rtq='---'; // if no keyword
if (strpos($rtr, '{sp}')===false) $rtr='{sp}'.$rtr; // if no engine short name
$refererTruncated = "<b>".rawurldecode($rtq)."</b> " . _JW_VISITS_CAME_FROM . ": " . $rtr; // we construct the line
list ($rtq, $rtr) = split ('{sp}',$refererTruncated); // keep formatting things away (as blue engine name)
$rtr = htmlspecialchars_decode($rtr); // don't count specials char in strlen
$rtr = $this->joomlaWatch->helper->truncateUrl($rtr, strlen($rtq)); // reduce to line length
$refererTruncated = $rtq . htmlspecialchars($rtr); // rebuild the line
unset($rtq,$rtr); // empty var for next row

$output .= "<i style='color: gray;'><a href='$row->referer' target='_blank' style='color: gray;' title='$row->referer'>refererTruncated</a></i>";
}




Done ! Enjoy

expected result :
Pax24 (User)
Fresh Boarder
Posts: 4
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#2368
Re:Keywords per visit 6 Months, 4 Weeks ago Karma: 0
I can't find this:

function truncate($str, $len = ""«») {

At line 146 I have:

function truncate($str, $len = "") {
if (@ !$len)
$len = $this->config->getConfigValue('JOOMLAWATCH_TRUNCATE_VISITS');

if (strlen($str) < $len)
return $str;
else
return substr($str, 0, $len) . "...";


I too have 1.2.9
ElimGarak (User)
Fresh Boarder
Posts: 11
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
No Tweets

Add URL of a programming website
register as a freelancer
submit your project
open freelance projects you can work on
webmaster resources
write paid blog posts about programming - tips and articles
bugs and features

Recommended: (advertise)
Download Joomlawatch 1.2.12



Outsource your project
-
Submit your project description with all the requirements to more than 600 freelancers from around the world for FREE.

Register as a Freelancer -
Submit your project experiences, programming languages and your other skills


Freelancers, create paid articles
-
Looking for freelancers with experiences in Java to write paid articles on their experiences

Green Geeks Hosting -
World's best selling green web hosting


Advertise Here
-
Promote your services and get the new customers from the community of webmasters / programmers visiting CodeGravity.com

FastDomain.com -
Fast Domain hosting. Hostmonster alternative. Also for $6.95/month.

HostMonster.com -
best cheap Joomla Web hosting. Website joomlawatchdemo.com is hosted by them with domain for $6,95/mo.



News from Twitter:
No Tweets
RSS Feeds:new

rss Freelance
rss Projects
rss Forum
rss Resources

Popular:
MathGuard
download mathguard
Random screenshot:

linoopz15.jpg


Poll

At what price would you purchase JoomlaWatch ad-free license?
 
Privacy policy | Advertise | Donate | Doucovanie Nemcina
Joomla Visitors Google Map
Loading map...
Joomla Visitors Google Map
Visitors Google Map Agent

Locations of visitors to this page


©2003-2010 Codegravity.com