View Full Version : Show total number of links and categories
ilushkin
08-09-2005, 07:49 PM
Show total number of links and categories in the footer.
David
08-09-2005, 08:25 PM
I think this could be done using the code we have in admin:
Content visible to registered users only.
Then somewhere in the footer.tpl (or whereever you want) put:
Content visible to registered users only.
I haven't tested this, but I believe it will work.
Mike77
08-10-2005, 08:49 AM
David,I placed both codes into main.tpl (one after another) and I got this:
Fatal error: Smarty error: [in main.tpl line 81]: syntax error: unrecognized tag: $tables['link']['name'] (Smarty_Compiler.class.php, line 436) in /***********/libs/smarty/Smarty.class.php on line 1088
I replaced my server info with *********.
If I put only the second code then I get only text displayed. $stats variable display nothing.
yktan
08-10-2005, 09:23 AM
Hi Mike77, what David posted is almost right. Here's what you should do:
Open index.php
Find:
Content visible to registered users only.
Add BEFORE:
Content visible to registered users only.
Open main.tpl
Add this whereever you want:
Content visible to registered users only.
Regards,
York Kie
Mike77
08-10-2005, 11:22 AM
Thank you David and yktan,it is working now! Why do we need to insert this at that exact place? How did you know this? I really like to tweak with my website but this just looks so complicated (by this I mean inserting thigns at exactly correct location).
yktan
08-10-2005, 12:57 PM
Hi Mike77, it is not necessary to insert the code at the exact place in the php file but it does have to be after the templating engine is initialised. So the easiest way is for me to tell you a place where it will definitely work.
PHP Link Directory is developed using PHP and Smarty Templates, so if you are interested, you can learn both of them and you will understand even more :)
Regards,
York Kie
ilushkin
08-10-2005, 04:04 PM
Content visible to registered users only.
works good. great job. thanks.
Jim_Westergren
08-10-2005, 06:11 PM
I have also implemented this and it is actually very nice.
Thanks.
superlinks
08-11-2005, 01:54 PM
Is there a possibility to show the total nummer (count) of all hits of the links in de directory?
yktan
08-12-2005, 05:02 AM
Hi superlinks, you sure can.
You will need something like the following in index.php
Content visible to registered users only.
And to display it in main.tpl:
Content visible to registered users only.
superlinks
08-14-2005, 08:06 PM
thanx, that's it!
vkaryl
08-21-2005, 12:15 AM
This is really nifty! Thanks, David and yktan....
Now, anyone have any idea how I would go about making the numbers change depending on the page accessed?
In other words, the main index shows, say, Active Links 128 and Categories 56; then I click on the first category, go to that page, and I'd like to see the numbers refer to specifically THAT category: Active Links 12 and SubCategories 3.... something like that....
Romario
09-06-2005, 09:47 PM
Content visible to registered users only.
Mod "Total Hits for Links" dosn't work, why? Script version: RC5.2.
Romario
09-06-2005, 10:04 PM
Sorry... It's work... Big Thanks...
pragent
03-15-2006, 08:34 AM
where I find:
Content visible to registered users only.
in my index.php
With me there is not that! :(
neurosis4u
03-15-2006, 11:10 AM
open index.php in windows text editor, and try the search funktion of your editor.
in most editors you have a search/replace funktion. but after changing this line dont forget to save it as a .php file
pragent
03-15-2006, 12:41 PM
Content visible to registered users only.
I do not find the code! :shock:
Content visible to registered users only.
I do not find the code! :shock:[/quote]
Look near the bottom of the page and replace my red comment with the code
Content visible to registered users only.
do a search for it.
hit CTRL+F to bring up fid in whatever editor you're using.
type in: $tpl->fetch('main.tpl', $id);
and ok to search.
it's near the bottom of the index.php file.
ewwharhar
05-07-2006, 11:29 PM
How do you show how much pending links there are?
Like Links, Catergories, Pending
neurosis4u
05-08-2006, 09:29 AM
for pending links i use the following:
in index.php ht above put this code:find:
echo $tpl->fetch('main.tpl', $id); right above put this code:
Content visible to registered users only.
then in main tpl put this code where you want the pending links to appear:
Content visible to registered users only.
Steven Myers
05-13-2006, 06:27 PM
Excellent mod, worked like a charm!
ewwharhar
05-14-2006, 04:55 AM
Thanks, works perfectly! :D
devilishqueen
07-21-2006, 02:05 PM
HELP!!!!!!!!!!
Fatal error: Smarty error: unable to write to $compile_dir '/home/httpd/vhosts/808.com/httpdocs/ld/temp/templates'. Be sure $compile_dir is writable by the web server user. in /home/httpd/vhosts/808.com/httpdocs/ld/libs/smarty/Smarty.class.php on line 1088
Why Did I Get That? I Changed The Codes Like What's Instructed.. FOR TOTAL LISTINGS OF CATS.. AND PENDING LINKS.. :(
lauren4521
08-20-2006, 02:05 AM
Thanks a bunch!!! Great simple mod.
BUT for me, it's not working on a few pages. The words come up but the stats/numbers are missing on the login, submit, register pages (as well as all of VSDan's mods; suggest, details, refer, review, rate, etc).
Is this working properly for others or is it just me and something I did?
Thanks,
Lauren
PS....working with version 3.06 and still have a LONG way to go and lots of cleaning up to do before being "live"
http://www.holisticwahmdirectory.com
VSDan
08-21-2006, 07:43 PM
Content visible to registered users only.
You would need to do the same thing for the other PHP files as you did for index.php. For example, to show on the submit page, you would have to edit submit.php similarily as index.php - do not have to edit submit.tpl (or other template files).
lauren4521
08-21-2006, 08:30 PM
Content visible to registered users only.
THANK YOU!!! lol...I swear, if its simple, I miss it. :D It worked perfectly.
Lauren
Why not add the PHP code to init.php to be loaded in all files, this way you save editing all other files.
And if it is possible (depending where you want to make the output), you can add the code to header.tpl or footer.tpl and it will be loaded in all files. If not you still have to edit main.tpl and submit.tpl etc.
VSDan
08-21-2006, 09:09 PM
Forgot all about init.php - a much better solution =)
Some excellent mods, we have added them to the top_bar of our template and it looks really cool, it will even better when the directory takes off though.:)
shadav
12-30-2006, 03:57 AM
any chance on getting one to display how many subcategories there are?
Content visible to registered users only.
just download 3.06 or 3.1 and use the code in the template: Singe mods-readme.txt
shadav
12-30-2006, 07:17 PM
nevermind...the category one yktan posted counts the total of categories and subcategories because the DB only has them all listed under category
thanks anon, i'm waiting to see how well the directory does before I update to the newest version...
Content visible to registered users only.
np. no version was specified so no way to know what you were using.
the template is free though and can be grabbed here: http://www.phplinkdirectory.com/forum/showthread.php?t=7369
the code comes with it. ;)
shadav
01-29-2007, 01:22 AM
ok question...I currently have version 2.1
all the codes work on all pages except for the submit and contact us pages....any ideas why or how to fix it?
shadav
02-05-2007, 03:17 AM
ok, i can't figure it out lol...i did try at least :p
ok anyway to have it display how many active featured links there are?
excellent! Thanks so much everyone.Content visible to registered users only.
mopacfan
07-31-2007, 08:26 PM
This was incredibly helpful. I have it displaying the totals on my directory site (http://www.itlent.com).
crawlr
09-10-2007, 05:34 AM
How would one go about putting this on the index page only?
floppy
09-11-2007, 05:42 AM
Content visible to registered users only.
Hope that helps.
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.