How to "homepage only" PHPLD ?

Discussion in 'Directories' started by MeetHere, Feb 3, 2008.

  1. #1
    Can anybody give me a code to make an article or banner or link to appear only on homepage ?

    - only homepage
    - not on top links, not on submit page, not on "latest" pages and not on listings individual "details" pages
    - not in any category pages

    Anybody ? Thanks.:)
     
    MeetHere, Feb 3, 2008 IP
  2. mikey1090

    mikey1090 Moderator Staff

    Messages:
    15,869
    Likes Received:
    1,055
    Best Answers:
    0
    Trophy Points:
    445
    Digital Goods:
    2
    #2
    In your tpl file (where ever you want the code to appear)

    
    
         {if $category.ID eq 0 and not $list and not $search and not $pge}
    your banner here
    {/if}
    
    PHP:
    Im not a phpLD guru (yet :p) so perhaps the experts will come and correct me. Its what I'm using to show the directory description on the homepage of zorg-directory.
     
    mikey1090, Feb 3, 2008 IP
  3. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #3
    will it not display on details pages ?

    Yeh, let some coding brainers approve it. :D
     
    MeetHere, Feb 3, 2008 IP
  4. mikey1090

    mikey1090 Moderator Staff

    Messages:
    15,869
    Likes Received:
    1,055
    Best Answers:
    0
    Trophy Points:
    445
    Digital Goods:
    2
    #4
    Yeah it will actually...sorry about that. Will fire an email off to Zeb to tell him hes sacked for never sorting that on mine :p:D
     
    mikey1090, Feb 3, 2008 IP
  5. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #5
    {if isset($category.ID) and $category.ID eq 0 and !$list and !$search and !$pg}

    ...banner here...

    {/if}

    should only show on homepage.
    If you have something like dargre's pr listing stuff, you will need to add something after the !$pg:

    it would then go like this: !$pg and !$pr

    this is so you dont get the banner on the pr page stuff as well.
     
    an0n, Feb 3, 2008 IP
  6. dargre

    dargre Peon

    Messages:
    1,007
    Likes Received:
    161
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Yeah, and one more tag from my mods is: "and !$letter"
    That's for AZ links.
     
    dargre, Feb 3, 2008 IP
  7. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #7
    haha too funny! I use that same variable as a part of one my MODs as well. :p

    I guess it's just a matter of good scripting and descriptive MOD'ing ;)
     
    an0n, Feb 3, 2008 IP
  8. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #8
    Thanks very much an0n and dargre...
    I will be trying them.. :)
     
    MeetHere, Feb 4, 2008 IP
  9. aspidov

    aspidov Well-Known Member

    Messages:
    2,875
    Likes Received:
    272
    Best Answers:
    0
    Trophy Points:
    175
    #9
    as long as that code is entered in main.tpl, it wont display on details page.
     
    aspidov, Feb 4, 2008 IP
  10. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #10
    but I OR others add such code in footer/header/sidebar etc.. and so it displays.

    Can i create a new .tpl file and call it in main.tpl ? Will that work ? How ? :confused:
     
    MeetHere, Feb 4, 2008 IP
  11. aspidov

    aspidov Well-Known Member

    Messages:
    2,875
    Likes Received:
    272
    Best Answers:
    0
    Trophy Points:
    175
    #11
    you can always create two different footer/header/sidebar tpl files, one with your "homepage only stuff" code and the other identical one without... (especially for details page) Then go to detail.tpl and edit the code at the top which says something like:

    {include file="header.tpl"}
    Code (markup):
    to

    {include file="[B]header-no-homepageonly[/B].tpl"}
    Code (markup):
     
    aspidov, Feb 4, 2008 IP
  12. humm

    humm बहादुर बच्चा

    Messages:
    4,346
    Likes Received:
    850
    Best Answers:
    0
    Trophy Points:
    310
    #12
    Thanks guys for the codes and explanation, I also needed the same. :D
     
    humm, Feb 4, 2008 IP
  13. MOG

    MOG Well-Known Member

    Messages:
    2,219
    Likes Received:
    163
    Best Answers:
    0
    Trophy Points:
    180
    #13
    yep, a great big thanks to all you coder guys, that has much improved a few of my directories where I wanted to advertise my other sites on the main page,

    cheers!

    MOG
     
    MOG, Feb 4, 2008 IP