PDA


View Full Version : Add Links Directory Stats to CMPS Stats Module


Rob Locke
02-02-2006, 08:30 PM
1) Open your cmps_index.php (or whatever you've renamed it).

Find:$phrasegroups = array();
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array();Replace it with:$phrasegroups = array('adv_links');
$globaltemplates = array();
$actiontemplates = array();
$specialtemplates = array('links_d_cache');NOTE: If you already have entries in array(); just add...'adv_links',...and...'links_d_cache',...immediately after the first parentheses of $phrasegroups and $specialtemplates respectively.

2) In your forum directory open modules/stats.php.

Find:eval('$home["$mods[modid]"][\'content\'] = "' . fetch_template('adv_portal_stats') . '";');
Above it add:$getlinkcats = $db->query("SELECT linkcount, postcount FROM " . TABLE_PREFIX . "links_categories");
while ($linkcats = $db->fetch_array($getlinkcats))
{
$stats['linkcategories']++;
$stats['links'] += $linkcats['linkcount'];
$stats['linkposts'] += $linkcats['postcount'];
}

$stats['linkcategories'] = number_format($stats['linkcategories']);
$stats['links'] = number_format($stats['links']);
$stats['linkposts'] = number_format($stats['linkposts']);

$getlinkstats = $db->query_first("SELECT SUM(views) AS views FROM " . TABLE_PREFIX . "links WHERE valid = 1");
$stats['linkviews'] = number_format($getlinkstats['views']);Save and upload the file to the server.

3) In your admin control panel go to Styles & Templates > Template Manager and click the «» button to show the templates. In vBadvanced CMPS Templates open adv_portal_stats. At the very end (or wherever you prefer to place it) add:<tr>
<td class="thead"><a href="http://yoursite.com/linksdirectory/$session[sessionurl_q]">$vbphrase[links]</a></td>
</tr>
<tr>
<td class="$bgclass">
<span class="smallfont">$vbphrase[directories]: $stats[linkcategories]<br />
$vbphrase[links]: $stats[links]<br />
$vbphrase[posts]: $stats[linkposts]<br />
$vbphrase[total_views]: $stats[linkviews]<br /></span>
</td>
</tr>Make sure you replace yoursite.com and linksdirectory with your information.

That's it. Enjoy!

Ramses
02-03-2006, 12:07 PM
Excellent work, thank you very much Rob. :)

Rob Locke
02-03-2006, 04:01 PM
You are very welcome. I hope it works for you.

xerohack
09-05-2007, 05:19 PM
esta muy bueno este manual quizas te sirva de algo esto www.zonagamerz.comantes de todo esto seria mejor que creemos un punto de restauracion para no perder nuestros estilos amigos graciaz