View Full Version : [Mod] Add Statistics to Homepage
Jappi
03-01-2006, 08:40 AM
Hi,
I don't know, if anybody use tis small Mod.
{image broken and removed}
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:
Content visible to registered users only.
next open index.php and search for:
// Paging 4
$tpl->assign('list_total', count($count));
// End Paging 4
and insert Code below.
Content visible to registered users only.
Now you can use the 5 variables in your templates whereever you want.
For example in my left.tpl:
<p id="statistic">
<span class="statistic">
{$categorys}
{$subcategorys}
{$total_links}
{$pending_links}
{$today_links}
</span>
{l}Categorys:{/l}
{l}Subcategorys:{/l}
{l}Entries{/l}
{l}Total:{/l}
{l}Pending:{/l}
{l}Today:{/l}
</p>
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
Jappi
03-17-2006, 09:56 AM
Sorry, that I announce myself only today
At first create a new File like "statistic.php", insert following Code:
Content visible to registered users only.
next open index.php and search for:
// Paging 4
$tpl->assign('list_total', count($count));
// End Paging 4
and insert Code below.
Content visible to registered users only.
Now you can use the 5 variables in your templates whereever you want.
For example in my left.tpl:
<p id="statistic">
<span class="statistic">
{$categorys}
{$subcategorys}
{$total_links}
{$pending_links}
{$today_links}
</span>
{l}Categorys:{/l}
{l}Subcategorys:{/l}
{l}Entries{/l}
{l}Total:{/l}
{l}Pending:{/l}
{l}Today:{/l}
</p>
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
kentuckyslone
06-23-2006, 03:00 AM
I am using 3.0.4 I could not locate
// 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!
neurosis4u
06-24-2006, 09:16 AM
i have it working with a little change...
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);
mrbadgolf
06-29-2006, 05:33 AM
I cannot find that in 3.04 either
neurosis4u
06-29-2006, 09:44 AM
look at the end of the file
//Make output
echo $tpl->fetch ('main.tpl', $id);
mrbadgolf
06-29-2006, 06:12 PM
Im sorry, didnt make myself clear, I cannot locate
// Paging 4
$tpl->assign('list_total', count($count));
// End Paging 4
in the index.php file of 3.0.4
CyberGrenade
07-06-2006, 06:50 PM
Thanks for the MOD. This opens up lots of doors. You can use this to get lots of data and display it on the main pages.
Thanks for the ideas.
devilishqueen
07-21-2006, 12:35 PM
which folder should create that statistic.php file? root?
devilishqueen
07-21-2006, 01:14 PM
thanks.. but still.. i get the server error message.. :(
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?
kentuckyslone
07-23-2006, 08:18 AM
Is there a way to do this with 3.0.4?
blogmaster2003
07-29-2006, 01:20 AM
Can someone explain what we have to do in the last phpld version so this mod can work?
Thank you
urlstand
07-29-2006, 04:31 AM
how it works in latest version?
weblaunch
07-31-2006, 06:18 AM
Hello,
How do modify the code to show number of links added in the "Last 7 days" rather than "Today"?
Thanks in advance!
Content visible to registered users only.
Mmm any luck?
Does anyone know if this works in 3.06 or has a solution.
I can now confirm this works for 3.06, but this
Content visible to registered users only.
...does not exist. Simply add:
Content visible to registered users only.
Underneath:
Content visible to registered users only.
And its all fine.
LittleEarner
09-08-2006, 10:53 AM
I have released a mod for phpLinkDirectory 2.0 and 3.0.5+. that allows you to show statistics on the front of your directory relating to the links and categories in the database. You can see what it looks like at http://www.moondirectory.co.uk (http://www.moondirectory.co.uk/).
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
Andy1961
09-08-2006, 11:30 AM
Content visible to registered users only.
Hey bobby, I saw your site http://www.text-link-ads.com/ , unfortunately doesn't have a category "Photography".
MikeK
10-28-2006, 09:18 PM
Thanks for this mod. It use it with v2.1! :)
jojomart
10-29-2006, 03:02 PM
The statistics weren't showing up on the details page, so I added the code to details.php as well:
require_once 'statistics.php';
right under:
require_once 'init.php';
So now the stats show up on the details page as well.
Joanne
niravdave
10-31-2006, 10:36 PM
gr8 mod
live at www.webdirectory.cn (http://www.webdirectory.cn)
Dave
KoverPL
11-11-2006, 02:40 PM
Works with 3.0.6 ?
Great mod :)
Content visible to registered users only.
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 :)
JohnnyLink
02-01-2007, 10:26 PM
I like the idea of this one but all I am getting on my main index is this code:
"Categorys:Subcategorys:EntriesTotal:Pending:Today:"
Any ideas please?
JohnnyLink
02-01-2007, 11:39 PM
I didn't want to wait long so I replaced all my .bak files with the ones I altered for this mod.... now all I get is:
"public_html/search/libs/smarty/Smarty.class.php on line 1095"
Any ideas please?.....
JohnnyLink
02-01-2007, 11:48 PM
ok, all files are replaced now and all is good:apart from:
"Categorys:Subcategorys:EntriesTotal:Pending:Today:" on my left side?
JohnnyLink
02-02-2007, 08:48 PM
ummm... no help?
System32
02-02-2007, 08:52 PM
In index.php is ok. But the others there isnt any numbers???
JohnnyLink
02-02-2007, 08:55 PM
I have no clue system32, I made copies of all the files that I had to alter, when it didn't work I just put the backups back into place... should have gone back to default I would have thought?
JohnnyLink
02-02-2007, 08:56 PM
but yes, lol... there are no numbers
mortgages
02-04-2007, 03:42 AM
just checking...
Does "stats" work with V3.1 ?
thanks in adv...
James.
contactusa
02-04-2007, 05:34 AM
Does anyone know how to display: Approved Today?
JohnnyLink
02-04-2007, 08:03 PM
Does anyone know what I can do?
gangavalli
02-12-2007, 10:11 AM
how do we show "Sumbitted Yesterday: "?
DKR201
02-12-2007, 10:45 AM
In php file where you get stats:
---------------------------------------------
$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
slashpix
02-17-2007, 09:03 PM
The bug is that mod is not displayed on other pages then index.php
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.
shadav
02-18-2007, 12:50 AM
i am not able to get the today links to work....can anyone help, i have version 2.1.1
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
Content visible to registered users only.add before
Content visible to registered users only.then in whatever .tpl file you want it to display
Content visible to registered users only.
to Display how many Regular Listings
as as before in the index.php put in
Content visible to registered users only.then in whatever .tpl you want it in
Content visible to registered users only.
shadav
02-19-2007, 01:36 AM
i got the today's added links to work
in index.php
Content visible to registered users only.
in whatever.tpl
Content visible to registered users only.
Muneeb2Good
02-22-2007, 07:31 AM
Hey i want to use that MOD in bar !
Like as shadav have in his General web directory
Thanks
shadav
02-22-2007, 01:06 PM
lol her's but no prob :D
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
Content visible to registered users only.
then in the header.tpl file
Content visible to registered users only.
lol and yeah don't forget to make an image called banner.bottom.gif or whatever you wanna end up naming it :)
using some of the codes here and some from this thread
http://www.phplinkdirectory.com/forum/showthread.php?t=452
be sure to read entire thread there are a lot of different things posted in there
and then well as I stated before I played around with the codes going by both examples and was able to get some to work :)
top100
03-16-2007, 01:02 PM
I have not found where hear, will work in versions 2.1? or only from 3 and senior?
thanks
Nikola
shadav
03-16-2007, 09:50 PM
I'm not entirely sure...I have 2.1.1 and i have them working but don't remember which ones I used from here or from this thread
http://www.phplinkdirectory.com/forum/showthread.php?t=452
jl255
04-09-2007, 05:33 AM
does this work on 3.6.5?
James
04-09-2007, 05:35 AM
anything can be made to work but what version is it 3.06
?
we dont have 3.6.5
jl255
04-09-2007, 05:44 AM
apologies, mixed it up with my forums :p
hudabi
04-10-2007, 09:19 AM
nice project... congrulations.
Brandon Sheley
04-11-2007, 06:22 AM
has anyone updated the steps for 3.1 ?
bilzone
04-11-2007, 05:28 PM
Thx for this mod...is great ....
Brandon Sheley
04-16-2007, 01:32 AM
Content visible to registered users only.
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
shadav
04-30-2007, 06:36 PM
just a note...i've gotten these to work on 3.2
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 :)
jminscoe
04-30-2007, 08:39 PM
do we put the whole code or just the require_once 'statistic.php';Content visible to registered users only.
James
04-30-2007, 08:42 PM
I would place the code itself in the init.php
thanks guys, I just used the mod on my directory: http://directory.mrgoodfox.com/
mybusiness
05-17-2007, 08:35 AM
Just taking the most important information on the site like links and pending.
Thanks for the mod
ronnyb
05-17-2007, 10:20 PM
I cant get this to work on 3.2, anyone have a guide "for dummies" on how to make this mod work on 3.2?
bruleo
05-19-2007, 08:53 AM
Ok, just for reference and to make it easier for people to adapt to their sites, this is what I did. I made a few small changes and put everything together from various posts in this thread and I have got this. (Formatted for my site).
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>".
Content visible to registered users only.
On the template you want to add your stats add the following:-
Content visible to registered users only.
These are the styles I used in my style sheet:-
Content visible to registered users only.
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.
ronnyb
05-19-2007, 10:48 PM
Thanks, worked great on my 3.2
bruleo
05-20-2007, 06:39 PM
Added a few more to my previous post. These I worked out for myself, so I thought I'd share with everyone.
Show Total members.
Add this to init.php
Content visible to registered users only.
Add to template where you want it to show:-
Content visible to registered users only.
Show total articles:-
Add this to init.php:-
Content visible to registered users only.
Add to template where you want it to show:-
Content visible to registered users only.
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.
BIGARNI
05-30-2007, 01:31 PM
... its great :D!!!
FusionHosting
06-04-2007, 08:06 PM
Any reason why the stats mod doesn't work on the Submit.php page? But works on all the others?
shadav
06-04-2007, 11:24 PM
did you put all of the codes into the init.php instead of the index.php?
placing the codes into the init.php file will allow it to be displayed on all pages of your directory.
menj1980
07-05-2007, 01:15 PM
Will anyone install this mod for me for a fee?
- MENJ
jminscoe
07-05-2007, 03:43 PM
Content visible to registered users only.
If Dawzz or Shadav don't I will try as I have it on all my sites
KoverPL
07-05-2007, 05:07 PM
Hello I can also install it for a small fee :P
shadav so its beter to add it into index.php ?
James
07-05-2007, 05:14 PM
Here is the deal.
I will do it for a small fee or donation
If you know where you want it it takes all of 5 minutes
KoverPL
07-05-2007, 06:01 PM
Guys how to apply this stats in vertival position:
http://img442.imageshack.us/img442/1821/verticalif3.jpg
can someone place code for vertical ? :)
jminscoe
07-05-2007, 06:08 PM
I think something like this
Content visible to registered users only.
KoverPL
07-05-2007, 06:55 PM
Hmmm, it still displays vertical :/
http://www.seodir.net
msolution
07-05-2007, 07:18 PM
remove the <dl> <dt>...
jminscoe
07-05-2007, 07:21 PM
I know I have a template somewhere on my pc that has it in the footer just can't find it
like this maybe Content visible to registered users only.
KoverPL
07-05-2007, 09:34 PM
Ok added without dt and dl but it seems that my stats arent displayed, is that so because I have added the code to init.php , I mean the code for functions in php.
jminscoe
07-06-2007, 01:24 AM
I have mine in index on some and init on others both work for me but init makes it display on all pages
sfod_d223
07-10-2007, 04:09 AM
Thanks alot for the "Mod for dummies" working like a charm now.
KoverPL
07-13-2007, 11:02 AM
Can someone help me ?
The stats arent displayedon my directory:
http://www.seodir.net :(
KoverPL
07-13-2007, 01:06 PM
Stats displaying I have added in main.tpl:
Content visible to registered users only.
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 ? :)
bruleo
07-13-2007, 01:12 PM
Do you have the other code that's required inside your index.php or init.php pages??
KoverPL
07-13-2007, 01:18 PM
Yes, I added that in my index.php:
Content visible to registered users only.
I am using version 3.2 on private dedicated server, maybe I have some disabled options in php ?
bruleo
07-13-2007, 04:24 PM
Well it should be pretty obvious if you compare! Take a look your variable names... they do not match! That's why they are not displaying!
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.
KoverPL
07-13-2007, 05:10 PM
I did it now, but still nothing happends.
jminscoe
07-13-2007, 05:23 PM
Content visible to registered users only.
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
KoverPL
07-13-2007, 05:32 PM
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:
/index.txt
/main.tpl.txt
jminscoe
07-13-2007, 05:34 PM
ok thank you as I have mod on all my 3.2 sites so I can't figure out why its not working on yours
bruleo
07-13-2007, 05:52 PM
I just looked at the two files you posted and the names still do not match!
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!
Content visible to registered users only.
jminscoe
07-13-2007, 06:21 PM
just after where I have it bold add that code I have there in dex.php
Content visible to registered users only.
jminscoe
07-13-2007, 06:26 PM
Content visible to registered users only.
KoverPL
07-13-2007, 06:36 PM
Edited the files but still dont shown... hmm you told something about stats.tpl etc, I do not have these files :/
jminscoe
07-13-2007, 06:44 PM
ok I will show you how to do that make a php file (call it statistic.php or what ever) with the following code
Content visible to registered users only.
now make a stats.tpl with this in it
Content visible to registered users only.
then where ever you want your stats to show put
{include file='stats.tpl'} put it in your template folder the php file goes in the root
KoverPL
07-13-2007, 07:14 PM
Nothing helped.
Thx for trying to help me guys... :)
bruleo
07-13-2007, 08:13 PM
That won't work either.... the variable names are still mis-matched! (re... categorys and categories). Sheeesh. :rolleyes:
Content visible to registered users only.
jminscoe
07-13-2007, 08:17 PM
Content visible to registered users only.
that was my fault did a copy and paste from wrong post:o
bruleo
07-13-2007, 08:19 PM
Ok... give me a few minutes and I'll paste Exactly what I have on mysite........
bruleo
07-13-2007, 08:44 PM
Ok... here goes.... if you can't get it working after this, then there must be something else wrong somewhere. Just edit out the stats you do not want...
In 'init.php', right before the '?>' at the very end....
Content visible to registered users only.
In your template file put each of these anywhere you want the stats to show:-
Content visible to registered users only.
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.
shadav
07-13-2007, 10:29 PM
if you are having problems, i've put together a "mod" from mods in this forum some are as is from posts others I put together and some I had to alter to make them work for my site...
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
KoverPL
07-13-2007, 10:32 PM
Ok I chnaged it to:
Content visible to registered users only.
Still dont work :(
bruleo
07-13-2007, 11:23 PM
Then I cannot help any further. The code I posted is exactly what I use on my site and it works perfectly. Maybe it's your version: I'm running on 3.2, but i can't really see why it won't work on any version that uses the named database fields. Try cutting and pasting the code EXACTLY as I put it but direct into your pages. If that doesn't work, then you have another problem somewhere. If it does work, then you can cut it out and put it into seperate template files.
Content visible to registered users only.
jbrock
07-22-2007, 03:36 AM
Content visible to registered users only.
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
James
07-22-2007, 03:45 AM
Traffic is the total of hits you have sent out to sites.
khoking
07-27-2007, 04:21 AM
Is there a today's hit and total hits counter statistics?
Content visible to registered users only.
Thanks So much Bruce, this works great for me, I am using it on ZetaUrl.com
:D
webpowerlink
08-27-2007, 06:07 PM
I saw your site also have "site by pagerank" do you have the code as well or point me somewhere I can find it? Thanks.
=========================
http://www.webpowerlink.com
http://www.twinbees.com
Mr_Bill
09-04-2007, 04:21 PM
Not sure if its the mod or the site but I have noticed one small issue I would like to know if anyone has seen and know of a fix.
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?
contactusa
09-04-2007, 05:28 PM
Content visible to registered users only.
Try phpLD Owners Mod List. Most mods are listed here. Some are paid. :eek:
.
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.