![]() |
| |||||||
| Mod Requests Have a suggestion for a mod? Post it here. You may not always receive an answer, but phpLD devs and mod developers do regularly visit this forum. If you MUST get something done, you may need to opt for paid help. |
![]() |
| | Thread Tools | Display Modes |
| | #1 |
| Supporter Join Date: Aug 2005 Location: Brooklyn, USA Posts: 100 | Show total number of links and categories in the footer. |
| |
| | #2 |
| Administrator phpLD Administrator Supporter Join Date: Jan 2005 Posts: 11,667 | I think this could be done using the code we have in admin: Code: $stats[0] = $db->GetOne("SELECT COUNT(*) FROM {$tables['link']['name']} WHERE STATUS > 1");
$stats[3] = $db->GetOne("SELECT COUNT(*) FROM {$tables['category']['name']}"); Code: <div align="center">
{l}Active Links{/l} - {$stats[0]}
{l}Categories{/l} - {$stats[3]}
</div> |
| |
| | #3 |
| Join Date: Jul 2005 Posts: 46 | 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. |
| |
| | #4 |
| Join Date: Jun 2005 Posts: 353 | Hi Mike77, what David posted is almost right. Here's what you should do: Open index.php Find: Code: echo $tpl->fetch('main.tpl', $id); Code: $stats[0] = $db->GetOne("SELECT COUNT(*) FROM {$tables['link']['name']} WHERE STATUS = 2");
$stats[3] = $db->GetOne("SELECT COUNT(*) FROM {$tables['category']['name']} WHERE STATUS = 2");
$tpl->assign('stats', $stats); Add this whereever you want: Code: <div align="center">
{l}Active Links{/l} - {$stats[0]}
{l}Categories{/l} - {$stats[3]}
</div> York Kie __________________ Greatest fear in a coder\'s world: A minute bug with correct syntax. {link removed from sig as the account seemed to be suspended} |
| |
| | #5 |
| Join Date: Jul 2005 Posts: 46 | 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). |
| |
| | #6 |
| Join Date: Jun 2005 Posts: 353 | 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 __________________ Greatest fear in a coder\'s world: A minute bug with correct syntax. {link removed from sig as the account seemed to be suspended} |
| |
| | #7 | |
| Supporter Join Date: Aug 2005 Location: Brooklyn, USA Posts: 100 | Quote:
| |
| |
| | #8 |
| Join Date: Jul 2005 Posts: 243 | I have also implemented this and it is actually very nice. Thanks. |
| |
| | #9 |
| Join Date: Aug 2005 Posts: 18 | Is there a possibility to show the total nummer (count) of all hits of the links in de directory? |
| |
| | #10 |
| Join Date: Jun 2005 Posts: 353 | Hi superlinks, you sure can. You will need something like the following in index.php Code: $stats[4] = $db->GetOne("SELECT SUM(HITS) FROM {$tables['link']['name']} WHERE STATUS = 2");
$tpl->assign('stats', $stats); Code: <div align="center">
{l}Total Hits for Links{/l} - {$stats[4]}</div> __________________ Greatest fear in a coder\'s world: A minute bug with correct syntax. {link removed from sig as the account seemed to be suspended} |
| |
| | #11 |
| Join Date: Aug 2005 Posts: 18 | thanx, that's it! |
| |
| | #12 |
| Join Date: Aug 2005 Posts: 263 | 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.... __________________ {Signature Edited - Old non-working links removed} |
| |
| | #13 | |
| Join Date: Sep 2005 Location: Russia Posts: 56 | Quote:
| |
| |
| | #14 |
| Join Date: Sep 2005 Location: Russia Posts: 56 | Sorry... It's work... Big Thanks... |
| |
| | #15 |
| Supporter Moderator | where I find: Code: echo $tpl->fetch('main.tpl', $id); With me there is not that! :( __________________ Deutscher Support seit 2005 (Deutschland,Österreich,Schweiz) UDL Intermedia Group www.UDL-Intermedia.com Meine phpLD4 Projekte: www.phpLD.com www.Anbieterverzeichnis.info www.RSS-Bookmark-Service.com Kein Support verfügbar! Urlaub vom 6.2.-14.2.2010! |
| |
| | #16 |
| Moderator | 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 __________________ If you want to make me happy, send much money with PayPAl to: admin(@)ohneschufaweb.de Mein Spendenkonto ist bei PayPal zu erreichen: admin(@)ohneschufaweb.de http://www.ohneschufaweb.de |
| |
| | #17 | |
| Supporter Moderator | Quote:
__________________ Deutscher Support seit 2005 (Deutschland,Österreich,Schweiz) UDL Intermedia Group www.UDL-Intermedia.com Meine phpLD4 Projekte: www.phpLD.com www.Anbieterverzeichnis.info www.RSS-Bookmark-Service.com Kein Support verfügbar! Urlaub vom 6.2.-14.2.2010! | |
| |
| | #18 | ||
| Supporter | Quote:
Look near the bottom of the page and replace my red comment with the code | ||
| |
| | #19 | |
| Supporter | Quote:
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. __________________ DirectoryDump Web Directory | Link Directory | Full of Search Web Directory | Free phpLD Templates | |
| |
| | #20 |
| Join Date: Apr 2006 Posts: 139 | How do you show how much pending links there are? Like Links, Catergories, Pending |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|