Featured link on new listings page - phpld

Discussion in 'Directories' started by MeetHere, Jul 29, 2007.

  1. #1
    Can anybody guide on How to show Featured and Regular link difference on "New Listings" page ?

    Similar to http://www.mingleon.com/new-links.html ( I would have contacted him but dont know his DP username )

    Any body knows that ?
     
    MeetHere, Jul 29, 2007 IP
  2. mikey1090

    mikey1090 Moderator Staff

    Messages:
    15,869
    Likes Received:
    1,055
    Best Answers:
    0
    Trophy Points:
    445
    Digital Goods:
    2
    #2
    well i dunno the html of the layout, but a simple if statement to check if featured, and if so, show different background color.
     
    mikey1090, Jul 29, 2007 IP
  3. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #3
    If some one can post the code which needs to be changed/added on the latest links php page - much appreciated.
     
    MeetHere, Jul 29, 2007 IP
  4. YIAM

    YIAM Notable Member

    Messages:
    2,480
    Likes Received:
    240
    Best Answers:
    0
    Trophy Points:
    280
    #4
    The simplest way to do is:

    Edit your link.tpl file

    after {strip}
    add :
    <div {if $link.FEATURED eq 1} style="background:#aaaaaa;" {/if}>
    before {/strip}
    add : </div>

    This is just an example. It can be customized as you wish.
     
    YIAM, Jul 29, 2007 IP
  5. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #5
    I want to show the difference in featured/regular links in :latest links page..
    Will this do it ?
     
    MeetHere, Jul 30, 2007 IP
  6. humm

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

    Messages:
    4,346
    Likes Received:
    850
    Best Answers:
    0
    Trophy Points:
    310
    #6
    I would also like to know this... Will the above code work? :-|
     
    humm, Jul 30, 2007 IP
  7. SilkySmooth

    SilkySmooth Well-Known Member

    Messages:
    1,583
    Likes Received:
    269
    Best Answers:
    0
    Trophy Points:
    180
    #7
    Yes and No, the aforementioned code would apply the change to EVERY featured listing on the site. So it would affect the latest listings page but would also affect all your category pages too.

    I don't have the solution off the top of my head and have to rush out now, but if no one has provided the solution when I get back I will take a look at it.
     
    SilkySmooth, Jul 30, 2007 IP
  8. MeetHere

    MeetHere Prominent Member

    Messages:
    15,399
    Likes Received:
    994
    Best Answers:
    0
    Trophy Points:
    330
    #8
    I want featured links style on "new listings" page similar to what it shows on category pages.

    So i think YIAM code will work. But needs more description :eek:
     
    MeetHere, Jul 30, 2007 IP
  9. paidhosting

    paidhosting Peon

    Messages:
    4,822
    Likes Received:
    483
    Best Answers:
    0
    Trophy Points:
    0
    #9
    It will affect every listing also, but adding conditions might fix it, will post soon if silky has not posted already possible solution.

    @meethere check http://www.h-log.com/index.php?list=top and http://www.h-log.com/Hosting/Hosting/ this is what his modification does.

    Anyways here is the fix, works good.

    open
    link.tpl
    Located
    
    {strip}
    
    Code (markup):
    Replace with
    
    {strip}
    <div {if $link.FEATURED eq 1  and !empty($links)} id = "specialfeatured" {/if}>
    
    Code (markup):
    Locate
    
    {/strip}
    
    Code (markup):
    Replace with :
    
    </div>
    {/strip}
    
    Code (markup):
    open your style.css file and paste this code at top bottom or anywhere:
    #specialfeatured {
    background:#99FF33;
    font-weight:bold;
    }

    You can play with above according to your tastes.
    Enjoy
     
    paidhosting, Jul 30, 2007 IP
  10. smub

    smub Notable Member

    Messages:
    3,443
    Likes Received:
    375
    Best Answers:
    0
    Trophy Points:
    230
    #10
    umm here is another way

    {foreach from=$links item=link name=links}
          {if $link.FEATURED eq 1}<div style="border: 1px dashed #555555; background: #ffffff;">{include file="link.tpl" link=$link}</div><br />{else}{include 
    
    file="link.tpl" link=$link}{/if}
       {/foreach}
    HTML:

    place this in your main.tpl after the sorting option area where you see the link.tpl codes

    this will do it for both pages ... Top Hits and New listings...


    demo is here http://www.idk.in/index.php?list=top

    http://www.idk.in/index.php?list=latest



    i dont see it doing this on category pages .... so this must be it :)
     
    smub, Jul 30, 2007 IP
  11. humm

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

    Messages:
    4,346
    Likes Received:
    850
    Best Answers:
    0
    Trophy Points:
    310
    #11
    Thanks a lot for the code n the fix paidhosting n smub.

    I will try this soon. :)
     
    humm, Jul 30, 2007 IP