Mortgage Loans - MPAA - Credit Counseling - Myspace Comments - Adverse Credit Remortgage

PDA

View Full Version : Featured link on new listings page - phpld


MeetHere
Jul 29th 2007, 3:20 pm
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 ?

mikey1090
Jul 29th 2007, 3:25 pm
well i dunno the html of the layout, but a simple if statement to check if featured, and if so, show different background color.

MeetHere
Jul 29th 2007, 3:28 pm
If some one can post the code which needs to be changed/added on the latest links php page - much appreciated.

YIAM
Jul 29th 2007, 3:51 pm
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.

MeetHere
Jul 30th 2007, 2:35 pm
I want to show the difference in featured/regular links in :latest links page..
Will this do it ?

humm
Jul 30th 2007, 2:42 pm
I would also like to know this... Will the above code work? :-|

SilkySmooth
Jul 30th 2007, 3:05 pm
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.

MeetHere
Jul 30th 2007, 3:11 pm
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 :o

paidhosting
Jul 30th 2007, 3:17 pm
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}


Replace with

{strip}
<div {if $link.FEATURED eq 1 and !empty($links)} id = "specialfeatured" {/if}>


Locate

{/strip}


Replace with :

</div>
{/strip}


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

smub
Jul 30th 2007, 3:40 pm
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}


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 :)

humm
Jul 30th 2007, 3:47 pm
Thanks a lot for the code n the fix paidhosting n smub.

I will try this soon. :)