PDA

View Full Version : Showing Random Links only on the Homepage


shzor
06-23-2006, 06:45 PM
Hi i just want to show Random link only on index there4 i used this code but it still showing Random links on other page

http://www.phplinkdirectory.com/kb/Making_Template_Changes_to_the_Front_Page_Only.htm l

...............take a look................

http://www.fun4you.offlife-hosting.com/phpld1/index.php?list=top

David
06-23-2006, 07:01 PM
This should help you:
http://www.phplinkdirectory.com/kb/Making_Template_Changes_to_the_Front_Page_Only.htm l

shzor
06-23-2006, 07:12 PM
i said i used it but its not working

David
06-23-2006, 07:25 PM
Darn, I missed that. Sorry.
Can you post the code you are using now?
Also, tell us where the code is located (which files).
Thanks,
David

shzor
06-23-2006, 07:43 PM
Its located in main.tpl
here is code
Content visible to registered users only.

bobby9101
06-23-2006, 09:18 PM
change
{if $category.ID eq 0 and not $p and not $q}
to
{if $category.ID eq 0 and not $list and not $q}

shzor
06-23-2006, 10:14 PM
thx man its working

David
06-23-2006, 10:40 PM
Thanks for helping him, Bobby.

max
07-06-2006, 04:43 PM
Thanks for such helpful info.
I have a little problem though. Links that I would like to show only on my home page I can see on Submit page too. Is there a fix for that?

max
07-09-2006, 01:17 AM
Hi,

I still have this problem. The links are not only on the homepage but on Submit page also. Please help.

arindra
07-09-2006, 02:18 AM
easiest thing to do would be post your code like shzor did , above :)

Redmatrix
07-17-2006, 12:33 PM
This is a great feature. (not mod?)

Thanks dave.

max
07-23-2006, 02:11 AM
Content visible to registered users only.

Yes, it's working when I put the code

{if $category.ID eq 0 and not $p and not $q and not $list}
some HTML code here
{/if}

in ___ main.tpl ___. However if I put this code in ___ footer.tpl ___ then I see it on the Submit page. What should I do in to do not show the HTML code on the Submit page?

Thanks

anon
07-23-2006, 02:25 AM
Content visible to registered users only.
simplest method:

create a footer2.tpl and take the code out.
in your submit.tpl include footer2.tpl instead of footer.tpl

max
07-23-2006, 02:38 AM
Content visible to registered users only.

Maybe it is a simplest way but this way has some disadvantages. I'm looking for programming solution for this problem. Perhaps it is possible to check if submit.php is running and not index.php.

max
07-23-2006, 09:13 PM
Content visible to registered users only.

Finally I decided to think a bit and I came up with this:
{if $category.ID eq 0 and $category.ID ne '' and not $p and not $q and not $list}
here is some HTML that supposed to be only on the home page
{/if}

It should work in main.tpl as well in header.tpl and footer.tpl. However I did not test it. As far as I see it works in footer.tpl.

anon
07-23-2006, 10:43 PM
Content visible to registered users only.
enlighten me on the disadvantages, please. you surely aren't going to say something about cached tpls, are you? lol

max
07-24-2006, 03:02 PM
Content visible to registered users only.

I'm going to edit footer on my site the second footer will be one more place to look at.

SyncMaster
08-15-2006, 10:15 PM
Sorry if I am late but i have a good solution for this problem. Here is what you need to do.

In main.tpl file find

Content visible to registered users only. and replace it with
Content visible to registered users only.

Now use the code below to show your content only on home page

Content visible to registered users only.

Hope this helps :)

Steven Myers
08-15-2006, 10:17 PM
Do you have a demo for this solution?

I have another solution in which is stable for both version of PHPLD, but I need to see yours incase you offer a better impliment.

SyncMaster
08-15-2006, 10:22 PM
I don't have any demo but I am about to release a new template in which I've got this trick working. The template is for the latest version (3.0.6).

Edit: If you have a solution too, how about posting it here :)

anon
08-15-2006, 10:42 PM
Post #6 (vegabond)

http://www.phplinkdirectory.com/forum/showthread.php?p=31356#post31356

SyncMaster
08-15-2006, 11:01 PM
That is even more cool & easier way. Thanks anon :)

anon
08-15-2006, 11:13 PM
Thank vegabond ;)

glad i was able to point it out to you. :D

SymbioticDesign
08-17-2006, 04:09 AM
Content visible to registered users only.

AWESOME!

I used it to:

Content visible to registered users only.
It works perfectly with your variable and the Cat/Link totals found in the knowledge base at:
http://www.phplinkdirectory.com/kb/Displaying_Total_Number_of_Links_and_Categories.ht ml

Thanks a bunch! ;) -Doug

SymbioticDesign
08-18-2006, 01:44 AM
I really have to stop assuming I know what I'm doing...

;)

Content visible to registered users only.

Somethings wrong with this and it's showing up when there is a listing.

Perhaps I need the code you provided in the other thread...

{if $category.ID==0 and count($categs) gt 0}
{include file="main_page_ads.tpl"}
{/if}
Argh...

I'm in a hurry, I guess I'll have to sort it out later. Kids are wonderful, aren't they? Everything is so nice and serene.... NOT.

SymbioticDesign
08-20-2006, 02:37 AM
Nevermind...

False alarm, I was looking a pages with feature links. So I changed the wording to say No Regular Links...

Well, I know I've looked like an idiot in this thread. No matter, someone will benefit from my idiocy. ;)

anon
08-20-2006, 02:56 AM
Dont worry about it. i've seen worse, and from the more experienced phpld'rs.

we just tend to laugh it off. ;)