View Full Version : How to show Top10, Last 10 links on main page?
Romario
09-13-2005, 02:01 PM
How to show Top10, Last 10 links on main page?
ndemi
09-15-2005, 03:02 PM
Yeah - good question.
:-)
WebDesignPoint
09-15-2005, 06:55 PM
Open index.php and find: echo $tpl->fetch('main.tpl', $id);
BEFORE that add this code:
Content visible to registered users only.
Open main.tpl
Where you want the top10 list to appear add:
Content visible to registered users only.
Where you want the last10 list to appear add:
Content visible to registered users only.
I think should do it :)
Romario
09-15-2005, 07:28 PM
Good. :)
David
09-15-2005, 07:43 PM
Thanks, WebDesignPoint!
Great to have another person who understands PHP around! :)
WebDesignPoint
09-15-2005, 07:58 PM
Np :)
I'm just glad I got it right!
Jim_Westergren
09-25-2005, 01:43 PM
I don't get this to work.
I want to show the last 5 links and changed the numbers from 10 to 5.
Or can I not do that?
In main.tpl I have:
Content visible to registered users only.
In index.php before "echo $tpl->fetch('main.tpl', $id);" I put:
Content visible to registered users only.
Thanks.
yktan
09-26-2005, 03:22 AM
Hi Jim_Westergren,
Maybe you can try this:
Content visible to registered users only.
Jim_Westergren
09-26-2005, 04:15 PM
That works!
Thank you VERY much.
/ Jim
suzkaw
09-29-2005, 04:43 AM
Also you can use this:
Content visible to registered users only.
Just above:
Content visible to registered users only.
Then it will use the links.tpl on the home page. ;) Instead of having to rewrite it.
Nobody
10-01-2005, 11:09 AM
How to show this in the directory home only, e.g. not on the sumbit page?
suzkaw
10-01-2005, 01:13 PM
That code I posted will only display on the home page.
Nobody
10-01-2005, 07:56 PM
Content visible to registered users only.
does that code work in main.tpl? looks more like a index.php code...
Timeless
10-18-2005, 10:09 AM
HI guys,
does anyone know, how to make it possible, that the last 5 comes not up on the search page?
i have set that it is only displayed on the startsite..and its working good. but maybe the search page have the same id then the main page?
ideas? tx
Hi,
It works for me using the following in main.tpl...
Content visible to registered users only.
Hope that helps.
:)
Timeless
10-18-2005, 04:01 PM
ahhh, i had only
{if $category.ID eq 0 and not $p} and not the $qu set :)
goooooood.. thats it m8..tx for your fast help...n1
aryob
01-21-2006, 05:08 AM
Nope that didnt work for me. I added the code in footer.tpl instead of main.tpl. but it didnt work for me. It just shows some blank spaces thats it.
aryob
01-24-2006, 04:54 AM
hello??
I didnt get any feedback!!
This mod didnt work for me.
css59
05-02-2006, 02:25 AM
work with 3.04?
jeeplaw
05-03-2006, 03:42 PM
I'll echo that..anyone get this working for 3.0.4?
Optimit
05-03-2006, 03:45 PM
I could do this pretty easy. they way I would do it would be to use an RSS feed from the top links or latest links.
Place the feed where you want it, and wrap it in this.
Content visible to registered users only.
You can see it working here. http://www.generalwebdirectory.com/
Dudley
05-13-2006, 01:57 PM
This still displays on the Latest Links and the Search Results pages in 3.04.
Content visible to registered users only.
This appears to work in 3.04
Content visible to registered users only.
deepimpact71
05-28-2006, 03:53 AM
Hi
I need to show latest 10 or lets say 15 links on my homepage. I tried the codes listed above but it doesn't work. The only code that worked was this:
if($id == 0)
{
$featuredhome = $db->GetALL("SELECT * FROM {$tables['link']['name']} WHERE STATUS = 2 AND FEATURED=1 ORDER BY HITS DESC LIMIT 0,10");
$tpl->assign('feat_links', $featuredhome);
}
it shows featured links on my home page.
BUT I am more interested in showing last 10-15 links on my home page. I am using version 2 of phplinkdirectory on my site.
Pls help me out with this as it is very important for me to have PHPLD work this way.
Many thanks in advance!!
Deepimpact
shzor
06-28-2006, 01:54 AM
its not working for 3.05
shzor
06-30-2006, 11:59 PM
plz someone guide me
renfrompenn
07-30-2006, 09:19 PM
I tried this with 2.0 and it isn't showing anything.
piotrek
08-10-2006, 10:56 AM
Try this:
{if $category.ID==0} ..... {/if}
how to display only the thumbnail,page rank and Link title only?
vegabond
10-07-2006, 11:38 PM
Content visible to registered users only.
I think u r looking for this one:
http://www.phplinkdirectory.com/forum/showpost.php?p=31356&postcount=6
Whatever you can show in main page only :)
searchpurple
11-01-2006, 08:34 AM
Yeah its definately not working for me either
http://www.searchpurple.com <-- here
Hi guys
Does any of all this work in 3.0.6?
Not that I understand anything of all these snippets of code
but anyhow
regards
Gunnar
Tobab
11-27-2006, 06:31 PM
Content visible to registered users only.
It doesnt work for me in 3.0.6 :(
solidghost
11-28-2006, 12:28 PM
Don't seem to work for me too.
I am using 3.0.6
somegamer
12-02-2006, 07:00 AM
Not working for me either. I'm using version 2.1 of PHPLD.
tmeyer45458
12-03-2006, 05:56 AM
The following worked for 3.0.6
Change:
Content visible to registered users only.
To:
Content visible to registered users only.
I'm a long way from an expert but it worked for me!:rolleyes:
proprod
12-03-2006, 06:56 AM
Content visible to registered users only.
I'm surprised the GetOne worked for anyone... should have read GetAll from the beginning.
Tobab
12-03-2006, 06:59 AM
Content visible to registered users only.
Thanks a lot! Now it works in 3.0.6
Extreme89
12-04-2006, 04:53 PM
what do i put in the if so that it doesn't show on the detail page of each link?
Extreme89
12-04-2006, 05:55 PM
how do I make it so that it only appears on homepage, cause as I had to add it to the footer (can't be added to main.tpl for template reasons) and it is also showing in submit, detail pages, etc.
solidghost
12-06-2006, 11:27 PM
Anyone able to help?
turifungia
06-27-2007, 08:02 PM
No one work for me but i have find this and work:
Put this in sidebar.tpl
<h3>Latest Links</h3>
{foreach from=$last5 item=link name=links}
<a href=”{if $smarty.const.ENABLE_REWRITE}{$link.URL|escape}/{else}index.php?c={$link.ID}{/if}”><strong>{$link.TITLE|escape}</a>
<br /><br />{/foreach}
and this in index
$last5 = $db->GetAll(”SELECT * FROM {$tables[’link’][’name’]} WHERE STATUS = 2 ORDER BY ID DESC LIMIT 0,5″);
$tpl->assign(’last5′, $last5);
echo $tpl->fetch(’main.tpl’, $id);
only 1 problem, i have double // for site with this url :www.site.com/
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.