I don't know, if anybody use tis small Mod.
http://www.w-lansecure.biz/images/stat.gif
By this way, thanks to all people who develop mods and send tips.
Jappi
Sorry, that I announce myself only today
At first create a new File like "statistic.php", insert following Code:
//Statistik
$total_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2");
$tpl->assign('total_links', $total_links);
$pending_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 1");
$tpl->assign('pending_links', $pending_links);
$today_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= CURRENT_DATE");
$tpl->assign('today_links', $today_links);
$categorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` = 0 ");
$tpl->assign('categorys', $categorys);
$subcategorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` > 0 ");
$tpl->assign('subcategorys', $subcategorys);
//Ende Statistik
?>
next open index.php and search for:
// Paging 4
$tpl->assign('list_total', count($count));
// End Paging 4
and insert Code below.
require_once 'statistic.php';
Now you can use the 5 variables in your templates whereever you want.
For example in my left.tpl:
{$categorys}
{$subcategorys}
{$total_links}
{$pending_links}
{$today_links}
{l}Categorys:{/l}
{l}Subcategorys:{/l}
{l}Entries{/l}
{l}Total:{/l}
{l}Pending:{/l}
{l}Today:{/l}
If you want use this Layout, insert in your main.css:
#statistic {
margin: 0px;
padding: 13px;
border: 1px solid #8B008B;
font-size: 7pt;
line-height: 12px;
}
.statistic {
float: right;
font-weight: bold;
padding-right: 5px;
text-align: right;
}
Ok, have fun
I hope phpLD 3.0 use the same tablefields as 2.0
Jappi
I will do it for a small fee or donation
If you know where you want it it takes all of 5 minutes
- MENJ
"Categorys:Subcategorys:EntriesTotal:Pending:Today:"
Any ideas please?
// Paging 4
$tpl->assign('list_total', count($count));
// End Paging 4
in the index.php file of 3.0.4
In 'init.php', right before the '?>' at the very end....
//ADDED CODE TO SHOW STATISTICS
// Featured Link Counter
$stat_featured = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2 AND `FEATURED` = 1 ");
$tpl->assign('stat_featured', $stat_featured);
// End
// Total Links Counter
$total_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2");
$tpl->assign('total_links', $total_links);
//End
//Links NOT active Counter
$unverified = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 0");
$tpl->assign('unverified', $unverified);
//End
// Awaiting Admin Review Counter
$pending_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 1");
$tpl->assign('pending_links', $pending_links);
//End
// Links submitted today counter
$today_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= CURRENT_DATE");
$tpl->assign('today_links', $today_links);
//End
//Total categories counter
$categorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` = 0 ");
$tpl->assign('categorys', $categorys);
//End
//Sub categories Counter
$subcategorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` > 0 ");
$tpl->assign('subcategorys', $subcategorys);
//End
//Total Articles Counter
$articlecount = $db->GetOne("SELECT COUNT(*) FROM `{$tables['article']['name']}` WHERE `STATUS` = 2");
$tpl->assign('articlecount', $articlecount);
//End
//Total Members counter
$members = $db->GetOne("SELECT COUNT(*) FROM `{$tables['user']['name']}` WHERE `ACTIVE` = 1");
$tpl->assign('members', $members);
//End
//Total Images counter (for those with image mod)
$imagecount = $db->GetOne("SELECT COUNT(*) FROM `{$tables['image']['name']}` WHERE `STATUS` = 2");
$tpl->assign('imagecount', $imagecount);
//End
//Links yesterday counter
$yes = time()-86400;
$yesterday = date("Ymd",$yes);
$yesterday_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` < CURRENT_DATE AND `DATE_ADDED` >= ".$yesterday);
$tpl->assign('yesterday_links', $yesterday_links);
//End
//Last 7 days counter
$week = time()-604800;
$this_week = date("Ymd",$week);
$this_weeks_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= ".$this_week);
$tpl->assign('this_weeks_links', $this_weeks_links);
//End
//Referred Traffic counter (traffic out)
$traffic = $db->GetOne("SELECT SUM(HITS) FROM {$tables['link']['name']} WHERE STATUS = 2");
$tpl->assign('traffic', $traffic);
//End
In your template file put each of these anywhere you want the stats to show:-
{$stat_featured}
{$total_links}
{$unverified}
{$pending_links}
{$today_links}
{$categorys}
{$subcategorys}
{$articlecount}
{$members}
{$imagecount}
{$yesterday_links}
{$this_weeks_links}
{$traffic}
You can see my working stats at www.u-hits.com (http://www.u-hits.com) in the left panel at the bottom. You can also use the same method to show the stats for page-ranks totals as I've done, but I'm sure that if you can get the above to work, you should be able to work that one out yourself!!
Bruce.
this worked great thank you very much. I have one question, what does traffic mean? is that the traffic online? or total traffic to the site? Mine currently says 5
I didn't see the info in the index.php :confused:
it's already setup for the template
http://directory.vbulletinsetup.com
thanks for the help
-Bs
Ok I chnaged it to:
{strip}
Main Categories - {$categorys} Sub Categories - {$subcategorys} Active Links {$total_links} Pending Links - {$pending_links} Today's Links - {$today_links}
ok I will show you how to do that make a php file (call it statistic.php or what ever) with the following code
//Stats
$total_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2");
$tpl->assign('total_links', $total_links);
$pending_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 1");
$tpl->assign('pending_links', $pending_links);
$today_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= CURRENT_DATE");
$tpl->assign('today_links', $today_links);
$categorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` = 0 ");
$tpl->assign('categorys', $categorys);
$subcategorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` > 0 ");
$tpl->assign('subcategorys', $subcategorys);
//End Stats
?>
now make a stats.tpl with this in it
{strip}
Main Categories - {$total_categories} Sub Categories - {$total_subcategories} Active Links {$total_active_links} Pending Links - {$total_pending_links} Today's Links - {$total_todays_links}
"public_html/search/libs/smarty/Smarty.class.php on line 1095"
Any ideas please?.....
in index.php
$stats[2] = $db->GetOne("SELECT COUNT(*) FROM {$tables['link']['name']} WHERE STATUS = 2 AND `DATE_ADDED` >= CURRENT_DATE ");
$tpl->assign('stats', $stats);
in whatever.tpl
{$stats[2]} {l}Approved Links Today{/l}
feel free to check it out on my mods page
http://www.shadav.info/mods.php
demo of them running are in the top bar
placing the codes into the init.php file will allow it to be displayed on all pages of your directory.
also between this and the other thread (which i can't find at the moment) I was able to change things up a bit...
To display how many Featured listings you have
in the index.php
find
echo $tpl->fetch('main.tpl', $id);
?>add before
$stat_featured = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2 AND `FEATURED` = 1 ");
$tpl->assign('stat_featured', $stat_featured);then in whatever .tpl file you want it to display
{$stat_featured} {l}Featured Links{/l}
to Display how many Regular Listings
as as before in the index.php put in
$stats[0] = $db->GetOne("SELECT COUNT(*) FROM {$tables['link']['name']} WHERE STATUS = 2 AND `FEATURED` = 0 ");
$tpl->assign('stats', $stats);then in whatever .tpl you want it in
{$stats[0]} {l}Regular Links{/l}
Thank you
http://www.seodir.net
//Make output
echo $tpl->fetch ('main.tpl', $id);
http://img442.imageshack.us/img442/1821/verticalif3.jpg
can someone place code for vertical ? :)
=========================
http://www.webpowerlink.com
http://www.twinbees.com
http://www.phplinkdirectory.com/forum/showthread.php?t=452
Thank you
Mmm any luck?
Does anyone know if this works in 3.06 or has a solution.
$stat_featured = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2 AND `FEATURED` = 1 ");
$tpl->assign('stat_featured', $stat_featured);
$total_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2");
$tpl->assign('total_links', $total_links);
$pending_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 1");
$tpl->assign('pending_links', $pending_links);
$today_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= CURRENT_DATE");
$tpl->assign('today_links', $today_links);
$categorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` = 0 ");
$tpl->assign('categorys', $categorys);
$subcategorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` > 0 ");
$tpl->assign('subcategorys', $subcategorys);
$yes = time()-86400;
$yesterday = date("Ymd",$yes);
$yesterday_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` < CURRENT_DATE AND `DATE_ADDED` >= ".$yesterday);
$tpl->assign('yesterday_links', $yesterday_links);
?>
I am using version 3.2 on private dedicated server, maybe I have some disabled options in php ?
P.S. I cant attach files, so here are they:
http://www.seodir.net/index.txt
http://www.seodir.net/main.tpl.txt
require_once 'statistics.php';
right under:
require_once 'init.php';
So now the stats show up on the details page as well.
Joanne
I have to add to these files too:
submit.php
payment.php
So now the statistics show in the submit page and the payment page.
By the way, great mod :)
{* Javascript for tracking link clicks *}
{if $StopLinkHits eq 0}
{/if}
Main Categories - {$total_categories} Sub Categories - {$total_subcategories} Active Links {$total_active_links} Pending Links - {$total_pending_links} Today's Links - {$total_todays_links}
{include file="footer.tpl"}
{/strip}
Is this ok ? Its not beign displayed :(
Please can someone post now the full mod ? what need to be added, where etc...
I want all things that can be displayed, featured listings etc... all stats and the codes for. Please ? :)
thanks
Nikola
if you get
20 submissions saturday
23 on sunday
44 on monday
and you didnt approve any links over the weekend then on monday you play catch up or start reviewing and approving the links. However the links for saturday and sunday do no not count towards the "approved links" only the links submitted on monday are counting. SO its only counting the links that are approved on the same day of submission.
Is it possible to fix this or is there a fix I missed so it counts all of them no matter when they were submitted?
In your main page you have....
Main Categories - {$total_categories} Sub Categories - {$total_subcategories} Active Links {$total_active_links} Pending Links - {$total_pending_links} Today's Links - {$total_todays_links}
Change it to...
Main Categories - {$categories} Sub Categories - {$subcategories} Active Links {$total_links} Pending Links - {$pending_links} Today's Links - {$today_links}
Bruce.
and instead of putting the codes in index.php place them in init.php before the ?> and the statistics will show on every page of your directory :)
---------------------------------------------
$yes = time()-86400;
$yesterday = date("Ymd",$yes);
$yesterday_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` < CURRENT_DATE AND `DATE_ADDED` >= ".$yesterday);
$tpl->assign('yesterday_links', $yesterday_links);
in .tpl file where you display stats:
--------------------------------------------------
{l}Yesterday links: {/l}{$yesterday_links){/l}
I hope I could you help
Christian
{strip}
Main Categories - {$categorys} Sub Categories - {$subcategorys} Active Links {$total_links} Pending Links - {$pending_links} Today's Links - {$today_links}
instead of building a new php file called statistics.php i put the code for this file directly in index php, right above
echo $tpl->fetch('main.tpl', $id);
// Paging 4
$tpl->assign('list_total', count($count));
// End Paging 4
anywhere in index.php
Am I missing something or is this for a different version?
I would like to use this if I can make it work.
Thanks!
shadav so its beter to add it into index.php ?
Thanks for the mod
and instead of putting the codes in index.php place them in init.php before the ?> and the statistics will show on every page of your directory :)
but hey i am coming along :)
- ...
// Paging 4
$tpl->assign('list_total', count($count));
// End Paging 4
...does not exist. Simply add:
require_once 'statistic.php';
Underneath:
require_once 'init.php';
And its all fine.
{capture name="title"}
{if count($path) > 1} - {/if}
{foreach from=$path item=category name=path}
{if $smarty.foreach.path.iteration gt 2}
>
{/if}
{if not $smarty.foreach.path.first}
{$category.TITLE}
{/if}
{/foreach}
{/capture}
{strip}
{if $title_prefix}
{assign var="in_page_title" value=$title_prefixcat:$category.TITLE}
{else}
{assign var="in_page_title" value=$category.TITLE}
{/if}
{assign var="description" value=$category.DESCRIPTION}
{include file="header.tpl"}
{include file="top_bar.tpl"}
{* Calculate the number of categories per row *}
{php}
$this->assign('cats_per_col', ceil(count($this->get_template_vars('categs')) / CATS_PER_ROW));
{/php}
{if $cats_per_col > 15}
{php}
$this->assign('cats_per_col', ceil(count($this->get_template_vars('categs')) / (CATS_PER_ROW + 1)));
{/php}
{/if}
{* Show category search results *}
{if $search_category}
{$search_category}
{/if}
{* Show article search results *}
{if $search_article}
{$search_article}
{/if}
{if isset($have_search_results) and $have_search_results == 0}
{l}Sorry, no records found that match your keyword(s){/l}: "{$searchescapewordwrap:200:"n":true}"
{l}Suggestions{/l}:
- {l}Make sure all words are spelled correctly{/l}.
- {l}Try different keywords{/l}.
- {l}Try more general keywords{/l}.
In 'init.php', right before the '?>' at the very end....
//ADDED CODE TO SHOW STATISTICS
// Featured Link Counter
$stat_featured = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2 AND `FEATURED` = 1 ");
$tpl->assign('stat_featured', $stat_featured);
// End
// Total Links Counter
$total_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2");
$tpl->assign('total_links', $total_links);
//End
//Links NOT active Counter
$unverified = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 0");
$tpl->assign('unverified', $unverified);
//End
// Awaiting Admin Review Counter
$pending_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 1");
$tpl->assign('pending_links', $pending_links);
//End
// Links submitted today counter
$today_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= CURRENT_DATE");
$tpl->assign('today_links', $today_links);
//End
//Total categories counter
$categorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` = 0 ");
$tpl->assign('categorys', $categorys);
//End
//Sub categories Counter
$subcategorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` > 0 ");
$tpl->assign('subcategorys', $subcategorys);
//End
//Total Articles Counter
$articlecount = $db->GetOne("SELECT COUNT(*) FROM `{$tables['article']['name']}` WHERE `STATUS` = 2");
$tpl->assign('articlecount', $articlecount);
//End
//Total Members counter
$members = $db->GetOne("SELECT COUNT(*) FROM `{$tables['user']['name']}` WHERE `ACTIVE` = 1");
$tpl->assign('members', $members);
//End
//Total Images counter (for those with image mod)
$imagecount = $db->GetOne("SELECT COUNT(*) FROM `{$tables['image']['name']}` WHERE `STATUS` = 2");
$tpl->assign('imagecount', $imagecount);
//End
//Links yesterday counter
$yes = time()-86400;
$yesterday = date("Ymd",$yes);
$yesterday_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` < CURRENT_DATE AND `DATE_ADDED` >= ".$yesterday);
$tpl->assign('yesterday_links', $yesterday_links);
//End
//Last 7 days counter
$week = time()-604800;
$this_week = date("Ymd",$week);
$this_weeks_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= ".$this_week);
$tpl->assign('this_weeks_links', $this_weeks_links);
//End
//Referred Traffic counter (traffic out)
$traffic = $db->GetOne("SELECT SUM(HITS) FROM {$tables['link']['name']} WHERE STATUS = 2");
$tpl->assign('traffic', $traffic);
//End
In your template file put each of these anywhere you want the stats to show:-
{$stat_featured}
{$total_links}
{$unverified}
{$pending_links}
{$today_links}
{$categorys}
{$subcategorys}
{$articlecount}
{$members}
{$imagecount}
{$yesterday_links}
{$this_weeks_links}
{$traffic}
You can see my working stats at www.u-hits.com (http://www.u-hits.com) in the left panel at the bottom. You can also use the same method to show the stats for page-ranks totals as I've done, but I'm sure that if you can get the above to work, you should be able to work that one out yourself!!
Bruce.
Thanks So much Bruce, this works great for me, I am using it on ZetaUrl.com
:D
Thx for trying to help me guys... :)
require_once 'statistics.php';
right under:
require_once 'init.php';
So now the stats show up on the details page as well.
Joanne
In 'init.php', right before the '?>' at the very end....
//ADDED CODE TO SHOW STATISTICS
// Featured Link Counter
$stat_featured = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2 AND `FEATURED` = 1 ");
$tpl->assign('stat_featured', $stat_featured);
// End
// Total Links Counter
$total_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2");
$tpl->assign('total_links', $total_links);
//End
//Links NOT active Counter
$unverified = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 0");
$tpl->assign('unverified', $unverified);
//End
// Awaiting Admin Review Counter
$pending_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 1");
$tpl->assign('pending_links', $pending_links);
//End
// Links submitted today counter
$today_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= CURRENT_DATE");
$tpl->assign('today_links', $today_links);
//End
//Total categories counter
$categorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` = 0 ");
$tpl->assign('categorys', $categorys);
//End
//Sub categories Counter
$subcategorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` > 0 ");
$tpl->assign('subcategorys', $subcategorys);
//End
//Total Articles Counter
$articlecount = $db->GetOne("SELECT COUNT(*) FROM `{$tables['article']['name']}` WHERE `STATUS` = 2");
$tpl->assign('articlecount', $articlecount);
//End
//Total Members counter
$members = $db->GetOne("SELECT COUNT(*) FROM `{$tables['user']['name']}` WHERE `ACTIVE` = 1");
$tpl->assign('members', $members);
//End
//Total Images counter (for those with image mod)
$imagecount = $db->GetOne("SELECT COUNT(*) FROM `{$tables['image']['name']}` WHERE `STATUS` = 2");
$tpl->assign('imagecount', $imagecount);
//End
//Links yesterday counter
$yes = time()-86400;
$yesterday = date("Ymd",$yes);
$yesterday_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` < CURRENT_DATE AND `DATE_ADDED` >= ".$yesterday);
$tpl->assign('yesterday_links', $yesterday_links);
//End
//Last 7 days counter
$week = time()-604800;
$this_week = date("Ymd",$week);
$this_weeks_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= ".$this_week);
$tpl->assign('this_weeks_links', $this_weeks_links);
//End
//Referred Traffic counter (traffic out)
$traffic = $db->GetOne("SELECT SUM(HITS) FROM {$tables['link']['name']} WHERE STATUS = 2");
$tpl->assign('traffic', $traffic);
//End
In your template file put each of these anywhere you want the stats to show:-
{$stat_featured}
{$total_links}
{$unverified}
{$pending_links}
{$today_links}
{$categorys}
{$subcategorys}
{$articlecount}
{$members}
{$imagecount}
{$yesterday_links}
{$this_weeks_links}
{$traffic}
You can see my working stats at www.u-hits.com (http://www.u-hits.com) in the left panel at the bottom. You can also use the same method to show the stats for page-ranks totals as I've done, but I'm sure that if you can get the above to work, you should be able to work that one out yourself!!
Bruce.
The idea was originally by Jappi at phpLinkDirectory Forums. I have made a few changes in this version.
Added Featured Link Count.
Replaced Categories and Subcategories with a total category count.
Updated HTML to use DIV tags with stylesheets.You can download the code and source needed to implement in the phpLD Statistics Mod (http://www.directoryspy.com/downloads/phpld-statistics-mod/) section at DirectorySpy.com
Show Total members.
Add this to init.php
$members = $db->GetOne("SELECT COUNT(*) FROM `{$tables['user']['name']}` WHERE `ACTIVE` = 1");
$tpl->assign('members', $members);
Add to template where you want it to show:-
{$members}
Show total articles:-
Add this to init.php:-
$articlecount = $db->GetOne("SELECT COUNT(*) FROM `{$tables['article']['name']}` WHERE `STATUS` = 2");
$tpl->assign('articlecount', $articlecount);
Add to template where you want it to show:-
{$articlecount}
Again, only tested with version 3.2. Enjoy....
Bruce.
http://www.u-hits.com - Free website submission.
http://www.awayaway.com - Your online source for travel related products, services and information.
http://www.u-pixx.com - Effective Pixel Advertising.
- MENJ
If Dawzz or Shadav don't I will try as I have it on all my sites
The stats arent displayedon my directory:
http://www.seodir.net :(
like this maybe Main Categories - {$total_categories} Sub Categories - {$total_subcategories} Active Links {$total_active_links} Pending Links - {$total_pending_links} Today's Links - {$total_todays_links}
To display statistics for, Categories, Sub-categories, Total Sites, Today, Yesterday, Featured Sites and Pending sites on ALL pages, add the following to the end of the init.php file right before '"php>".
$stat_featured = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2 AND `FEATURED` = 1 ");
$tpl->assign('stat_featured', $stat_featured);
$total_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2");
$tpl->assign('total_links', $total_links);
$pending_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 1");
$tpl->assign('pending_links', $pending_links);
$today_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= CURRENT_DATE");
$tpl->assign('today_links', $today_links);
$categorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` = 0 ");
$tpl->assign('categorys', $categorys);
$subcategorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` > 0 ");
$tpl->assign('subcategorys', $subcategorys);
$yes = time()-86400;
$yesterday = date("Ymd",$yes);
$yesterday_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` < CURRENT_DATE AND `DATE_ADDED` >= ".$yesterday);
$tpl->assign('yesterday_links', $yesterday_links);
On the template you want to add your stats add the following:-
| Statistics | |
| {l}Categories:{/l} | {$categorys} |
| {l}Sub Categories:{/l} | {$subcategorys} |
| {l}Total Sites:{/l} | {$total_links} |
| {l}Featured Sites:{/l} | {$stat_featured} |
| {l}Pending Sites:{/l} | {$pending_links} |
| {l}Today:{/l} | {$today_links} |
| {l}Yesterday:{/l} | {$yesterday_links} |
These are the styles I used in my style sheet:-
.stats1 {
font-weight: bold;
color: gray;
text-align: left;
font-size: 10px;
background: #0f0f0f;
}
.stats2 {
font-weight: bold;
color: white;
text-align: right;
font-size: 11px;
background: #0f0f0f;
}
There may be better ways to achieve this, but I am not a PHP coder, so this way suits me. For reference, I am using version 3.2 of PHPLD and it seems to work fine on my site.
See www.u-hits.com (http://www.u-hits.com) and scroll down and look in the left panel to see what all the above looks like.
Bruce.
Does "stats" work with V3.1 ?
thanks in adv...
James.
can you pm me your index.php and the tpl where you have your stats loaded and I will check it out as I know I gave you the correct code so it should display also your stats.tpl and statistic.php if you have one
For example you have "$categorys" in your php file, but have "$categories" in your template!
If you just copy the code that I pasted earlier in this thread it will work.
Bruce.
NB. 'categories' isthe correct spelling!
I dont have this two files but I will PM you my index.php and main.tpl.
P.S. I cant attach files, so here are they:
http://www.seodir.net/index.txt
http://www.seodir.net/main.tpl.txt
that was my fault did a copy and paste from wrong post:o
Hey bobby, I saw your site http://www.text-link-ads.com/ , unfortunately doesn't have a category "Photography".
How do modify the code to show number of links added in the "Last 7 days" rather than "Today"?
Thanks in advance!
Thanks for the ideas.
"Categorys:Subcategorys:EntriesTotal:Pending:Today:" on my left side?
Great mod :)
bah! don't be so hard on yourself. Just think of it as not being versed enough(yet) ;)
- Main Categories - {$total_categories}
- Sub Categories - {$total_subcategories}
- Active Links {$total_active_links}
- Pending Links - {$total_pending_links}
- Today's Links - {$total_todays_links}
?
we dont have 3.6.5
Simply Integration.
Sorry for my bad english, look at my sign :roll:
Jappi
//Make output
echo $tpl->fetch('main.tpl', $id);
$total_categories = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` = 0 ");
$tpl->assign('total_categories', $total_categories);
$total_subcategories = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` > 0 ");
$tpl->assign('total_subcategories', $total_subcategories);
$total_active_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2");
$tpl->assign('total_active_links', $total_active_links);
$total_pending_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 1");
$tpl->assign('total_pending_links', $total_pending_links);
$total_todays_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= CURRENT_DATE");
$tpl->assign('total_todays_links', $total_todays_links);
$total_article = $db->GetOne("SELECT COUNT(*) FROM `{$tables['article']['name']}` WHERE `STATUS` = 2");
$tpl->assign('total_article', $total_article);
?>
Submit for example, see it yourself http://www.phplddirectory.com/submit.php
Or at least tell me how to display the mod only on main page.
Like as shadav have in his General web directory
Thanks
i tried to undo the changes i made.. and uploaded the file back.. but still.. the same error.. hpow can i get back from my directory without those smarty errors?
live at www.webdirectory.cn (http://www.webdirectory.cn)
Dave
At first create a new File like "statistic.php", insert following Code:
//Statistik
$total_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2");
$tpl->assign('total_links', $total_links);
$pending_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 1");
$tpl->assign('pending_links', $pending_links);
$today_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= CURRENT_DATE");
$tpl->assign('today_links', $today_links);
$categorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` = 0 ");
$tpl->assign('categorys', $categorys);
$subcategorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` > 0 ");
$tpl->assign('subcategorys', $subcategorys);
//Ende Statistik
?>
next open index.php and search for:
// Paging 4
$tpl->assign('list_total', count($count));
// End Paging 4
and insert Code below.
require_once 'statistic.php';
Now you can use the 5 variables in your templates whereever you want.
For example in my left.tpl:
{$categorys}
{$subcategorys}
{$total_links}
{$pending_links}
{$today_links}
{l}Categorys:{/l}
{l}Subcategorys:{/l}
{l}Entries{/l}
{l}Total:{/l}
{l}Pending:{/l}
{l}Today:{/l}
If you want use this Layout, insert in your main.css:
#statistic {
margin: 0px;
padding: 13px;
border: 1px solid #8B008B;
font-size: 7pt;
line-height: 12px;
}
.statistic {
float: right;
font-weight: bold;
padding-right: 5px;
text-align: right;
}
Ok, have fun
I hope phpLD 3.0 use the same tablefields as 2.0
Jappi
//Stats
$total_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 2");
$tpl->assign('total_links', $total_links);
$pending_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `STATUS` = 1");
$tpl->assign('pending_links', $pending_links);
$today_links = $db->GetOne("SELECT COUNT(*) FROM `{$tables['link']['name']}` WHERE `DATE_ADDED` >= CURRENT_DATE");
$tpl->assign('today_links', $today_links);
$categorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` = 0 ");
$tpl->assign('categorys', $categorys);
$subcategorys = $db->GetOne("SELECT COUNT(*) FROM `{$tables['category']['name']}` WHERE `PARENT_ID` > 0 ");
$tpl->assign('subcategorys', $subcategorys);
//End Stats
?>
now make a stats.tpl with this in it
{strip}
Main Categories - {$total_categories} Sub Categories - {$total_subcategories} Active Links {$total_active_links} Pending Links - {$total_pending_links} Today's Links - {$total_todays_links}
=========================
http://www.webpowerlink.com
http://www.twinbees.com
Try phpLD Owners Mod List. Most mods are listed here. Some are paid. :eek:
.
I changed html code and css also to make better control of it. You can see work in progres here: http://img63.imageshack.us/img63/5756/screen0tr.gif
Also tell me your homepage url so I can credit you on my site when I release this one.
you can place them anywhere you'd like them to be displayed
I just added the codes to my header.tpl file
the bar is part of my template however you should be able to basically do the same thing
using the stye.css in the images folder created the bar
style.css
#banner_bottom {height: 24px; background: url('banner.bottom.gif');}
then in the header.tpl file
YOUR CODES
#If you have any other info about this subject , Please add it free.# |