View Full Version : categories in footer
thompson
03-29-2006, 09:54 PM
hi,
i would like to have the main categories in footer. but not on main page.
anyone an idea ? (vers. 2.0)
thanks.
bobby9101
03-30-2006, 02:33 AM
i think i can do this for you, do you want me to test itand then post the code, or do you want me to do it on your site for you? either way it is just as easy
thompson
03-30-2006, 06:46 AM
i wanna do it by myself. if you like, please post the code.
thompson
04-03-2006, 07:51 AM
*push*
VSDan
04-13-2006, 08:43 PM
You can try this:
1. Edit main.php by adding the following code towards the end just before the $tpl->assign('category', $path[count($path) - 1]); line:
Content visible to registered users only.
2. Edit main.php by adding the following code towards the end just after the $tpl->assign('categs', $categs); line:
Content visible to registered users only.
3. Edit footer.tpl by adding the following wherever you want the categories to appear:
Content visible to registered users only.
Worked when I tested on our server.
thompson
04-13-2006, 11:06 PM
i did the changes in index.php an then i get an error:
Fatal error: Call to a member function on a non-object in /www/htdocs/w005f2ae/index.php on line 155
$row['TSUBCATS'] = $rs2->GetRows();
i this an error for an older version i had (RC 5.2)
i think i have the version before Rev. 76
how can i update to version 2.0 ? (i modded a lot of files.)
thanks for that work and thanks for helping me.
VSDan
04-15-2006, 07:55 PM
Can you send me your index.php file.
thompson
04-17-2006, 12:54 PM
you got pm.
Neticus
04-19-2006, 02:11 AM
Hi, I've just attempted this mod to see how it would look.
One problem I am having is that the categories display in a single column even though I have set for 3 coulmn
display. I have tried it on an unaffected phpld install with no template edits and still the same. Any suggestions on
why this could be? Perhaps it's missing the 'column display' code. I also took out the <center> tags just to check.
Any thoughts appreciated.
p.s. I have tried this in v2 but it also works in v303 which is my main install.
Thanks
VSDan
04-19-2006, 02:21 AM
I revised the footer.tpl code to match what was finally done - this was handled in large part via PM.
Neticus
04-19-2006, 02:59 AM
I see the design has changed for practicality of post subject. Is there anyway to keep the previous footer code yet have it follow the column structure like on index.php? What I'm really trying to do is call the top categories to a totally new page I've created.
thanks
VSDan
04-19-2006, 04:09 AM
In the original code, try removing the <h3>/</h3> tags.
Neticus
04-19-2006, 04:58 PM
Hi VSDan
I managed to find resolution :) The 'Calculate the number of categories per row' was the missing culprit.
I also had to follow your example and place 't' before 'categs'. This also had to be done for the 'categs' codes
in the very last {if...} statement line.
Content visible to registered users only.
Much thanks for your initial post guide. :)
For anyone finding this in future and for whatever purposes you wish to use this discussion for, the above
code is taken from main.tpl.
Cheers
Net.
shzor
06-24-2006, 07:55 PM
Hi did any one use this ..if yes then plz show me
Tim_Myth
06-29-2006, 01:09 PM
I am getting this same error. How was it finally corrected? I simply copied and pasted the code from VSDan's post, excepting the part where the forum automatically created the hyperlink. BTW, I am using the latest release of phpLD2.
Anyone get this code working for 3.06. Im not getting any errors, but rather than having all the categories listed in the footer. I just want the top level categories listed, from left to right. I have 18 top level cats in all.
Steven Myers
08-10-2006, 04:19 AM
No luck here on 3.06 Final, I get this error when implimenting to the footer.tpl
Fatal error: Smarty error: [in footer.tpl line 39]: syntax error: mismatched tag {/if}. expected {/foreach} (opened line 38). (Smarty_Compiler.class.php, line 2289) in /home/fastline/public_html/libs/smarty/Smarty.class.php on line 1095
mikedippel
08-10-2006, 05:52 AM
If I understand correctly, you can do what I do. Create a file called footer2.tpl and assign it to any php file you do not want to show the normal categories for. Just replace the last line of those files with footer2.tpl instead of footer.tpl
Mmm what im really after is just the top level categories in the footer in all pages, APART from the frontpage (cause there already there)..so the code above just needs to be modified to only show top level cats, but im lost on coding.
Content visible to registered users only.
change this line:
$rs = $db->Execute("SELECT * FROM `{$tables['category']['name']}` WHERE `STATUS` = 2 AND PARENT_ID = ".$db->qstr($id)." ORDER BY `TITLE`");
to this:
$rs = $db->Execute("SELECT * FROM `{$tables['category']['name']}` WHERE `STATUS` = 2 AND PARENT_ID = 0 ORDER BY `TITLE`");
Content visible to registered users only.
That's not a php code. Thats a smarty code, and it means that you do not have your {if}{/if} clause formatted correctly. you are/were missing a closed {/if} somewhere before the {foreach} started, but did not have it in place.
still seems to show all the cats
Neticus
08-10-2006, 01:14 PM
Content visible to registered users only.
Encountered the same problem wayback, try one of the following calls with the {if} statements re-adjusted. This has not been tested with 3.06.
Horizontal alignment, suitable for placing call in footer:
Content visible to registered users only.
OR
Vertical alignment, suitable for placing call in column:
Content visible to registered users only.
Steven Myers
08-10-2006, 02:46 PM
Thanks for the help Neticus and rob. There is no error this time, but it doesn't display any cats under any of the main cats or sub cats pages.
I'll wait until this becomes stable wih 3.06 :)
Colleen
02-18-2007, 06:00 AM
Very nice, works with 3.1.0! Useful! :)
Thanks guys!
can someone share the demo..how the mod looks like.
bresso
03-10-2007, 06:13 AM
There's a lot pf code snippets in this thread. May a moderator or somebody who successfully installed it post easy to follow steps?
Thank you
bresso
03-12-2007, 12:04 PM
please ???
MUSKUR
04-02-2007, 04:06 PM
I agree. Can someone put the whole process in order and re-post the code.
Much appreciated.
Thanks.
risrik
04-23-2007, 09:56 PM
Hi,
We've used the code to include a top level category listing in a right hand column. It works fine on all pages except the main page. On the main page, the output line {foreach from=$tcategs item=cat name=tcategs} does not output the categories. The $tcategs[] array gets filled with the top level categories on the index.php page and they're output on every page but the main/home. What's up with the main page? What would be preventing the output? This is V3 by the way!
Thanks.
genious
06-08-2007, 08:42 PM
Hi,
can any one post the MOD to show the categories in the footer in phpLD. i am using version 2.1.2.
I will really appriciate that.
Thanks,
Mahmood
SEO Resourses (http://www.coolseller.co.uk)
SEO & WeB Hosting Tips (http://blog.whiztechnologies.co.uk/)
genious
06-17-2007, 08:27 PM
Hi,
Would some one please post full code to show categories in the footer .
i need it to show on my directory.
i would happy to back link to you. if you want
Waiting.... Waiting.... Waiting... for some one to come out of clouds
Come on
SEO, Vista WEB Directory (http://www.coolseller.co.uk)
SEO and Web hosting Tips Blog (http://blog.whiztechnologies.co.uk/)
http://www.whiztechnologies.co.uk/ (http://blog.whiztechnologies.co.uk/)
coolmanphp
07-29-2007, 07:44 PM
can someone post the url if this works for ver 2.2.
thanks
mgrohan
10-21-2007, 11:28 AM
Any have this working in 3.2?
{if count($path) != 1}
<center>
{foreach from=$tcategs item=cat name=tcategs}
http ://%7bif%20$smarty.const.enable_rewrite%7d%7b$cat.tit le_url%7d/%7Belse%7Dindex.php?c=%7B$cat.ID%7D%7B/if%7D"]{$cat.TITLE}{/if}
{if ($smarty.foreach.tcategs.iteration mod 10 eq 0) or $smarty.foreach.tcategs.last}
{/if}
{/foreach}
</center>
{/if}
Have tried the above and it works, but it displays the whole breadcrumbs. i.e. directory name > category > subcategory.
I only want to display the end category name in the footer, and not the whole chain. (Although i don't want to mess with index.php as i still want the whole chain to display as it is in the header)
Any ideas?
sidneyrill
10-25-2007, 09:27 PM
is this what you are looking for?
see footer at http://wesece.com
if so it is available here
http://wesece.com/forum/index.php/topic,34.0.html
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.