PDA

View Full Version : How do i show the hit people get's?


Haohui
07-26-2007, 02:47 PM
How do i show the hit people get's? i got the idea form the admin link script at the admin panal How do i show the hit people get's?

$columns = array_merge ($columns, array('CATEGORY' => _L('Category'), 'STATUS' => _L('Status'), 'HITS' => _L('Hits'), 'DATE_ADDED' => _L('Date Added')));

But how do i make it work in index.php??

// Paging 1
$page = (!empty ($_REQUEST['p']) && preg_match ('`^[\d]+$`', $_REQUEST['p']) ? intval ($_REQUEST['p']) : 1);;

Help!

James
07-26-2007, 04:54 PM
I dont understand? you want to show total of outgong hits?

If so then in init.php right before the ?> :

$outgoing = $db->GetOne("SELECT SUM(HITS) FROM {$tables['link']['name']} WHERE STATUS = 2");
$tpl->assign('outgoing', $outgoing);

then in your tpl files use {$outgoing}

Haohui
07-28-2007, 03:58 PM
Thx i'll try that

Haohui
07-28-2007, 04:02 PM
Where do i put the code u show me, I know which file but where in the file codes??!!!

James
07-28-2007, 05:50 PM
well the init is explained and as far as tpl file which template are you using and where do you want it to show?

shadav
07-28-2007, 10:27 PM
that doesn't exactly work, i tried it on my directory and it's showing all links having 246 out going hits lolol

James
07-29-2007, 01:00 AM
("SELECT SUM(HITS)


it works just fine that is the total of hits you have sent out notice the sum ..
if you want to show the hits per link then $link.HITS should get it done for you ...