Tag Archives: Improvements

Improvements for Stattraq plugin.

April 29, 2007 by aaron
Ever since I originally started using Stattraq a few things bothered me about the way it worked. Here are the fixes to a few of them. Include pages with posts in your stats. Open stattraq.php Find: global $doing_rss, $p Replace With: global $doing_rss, $p, $page_id, $pagename, Find: if (($p != &#039;&#039;)){ $p = intval($p); $article_id = $p; } Replace with: if (($p != &#039;&#039;)){ $p = intval($p); $article_id = $p; }elseif (($page_id != &#039;&#039;)){ $page_id = intval($page_id); $article_id = $page_id; }elseif (($pagename != &#039;&#039;)){ $reqpage = get_page_by_path($pagename); if ( !empty($reqpage) ) $article_id = $reqpage->ID; } To add a list of all Pages that link to your site grouped by Website (excluding Google): Open “wp-stattraq/reporter/summary.php” Find: <?php echo PrintTimestamp();?> </div> <div id="queryTerms"> Before Add: <table id="referrersTable"> <thead> <tr> <th>#</th> <th>Referrer</th> <th>Pages</th> </tr> </thead> <tfoot> <tr> <th>#</th> <th>Referrer</th> <th>Pages</th> </tr> </tfoot> <tbody> <?php if($results){ $i=0; foreach($results as $row){ preg_match(&#039;/(http.*?\:\/\/.*?)(\/.*)/&#039;, htmlentities($row->ref), $matches); $ref_array[$matches[1]][] = $matches[2]; } while( list($site, $pages) = @each($ref_array) ){ if(strpos($site,&#039;google&#039;) ==false && $site != &#039;&#039;){?> <tr class="<?php echo ($i % 2 == 0 ?
Read More ⟶

Improvements for Stattraq plugin.

April 29, 2007 by aaron
Ever since I originally started using Stattraq a few things bothered me about the way it worked. Here are the fixes to a few of them. Include pages with posts in your stats. Open stattraq.php Find: global $doing_rss, $p Replace With: global $doing_rss, $p, $page_id, $pagename, Find: if (($p != &#039;&#039;)){ $p = intval($p); $article_id = $p; } Replace with: if (($p != &#039;&#039;)){ $p = intval($p); $article_id = $p; }elseif (($page_id != &#039;&#039;)){ $page_id = intval($page_id); $article_id = $page_id; }elseif (($pagename != &#039;&#039;)){ $reqpage = get_page_by_path($pagename); if ( !empty($reqpage) ) $article_id = $reqpage->ID; } To add a list of all Pages that link to your site grouped by Website (excluding Google): Open “wp-stattraq/reporter/summary.php” Find: <?php echo PrintTimestamp();?> </div> <div id="queryTerms"> Before Add: <table id="referrersTable"> <thead> <tr> <th>#</th> <th>Referrer</th> <th>Pages</th> </tr> </thead> <tfoot> <tr> <th>#</th> <th>Referrer</th> <th>Pages</th> </tr> </tfoot> <tbody> <?php if($results){ $i=0; foreach($results as $row){ preg_match(&#039;/(http.*?\:\/\/.*?)(\/.*)/&#039;, htmlentities($row->ref), $matches); $ref_array[$matches[1]][] = $matches[2]; } while( list($site, $pages) = @each($ref_array) ){ if(strpos($site,&#039;google&#039;) ==false && $site != &#039;&#039;){?> <tr class="<?php echo ($i % 2 == 0 ?
Read More ⟶