网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > Web Directory
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 218.2.67.5
Old 2007-07-10, 09:25 PM
smiling smiling is offline
高级会员
 
Join Date: 2006-02-12
Posts: 502
smiling 正向着好的方向发展
Default Last 10 listings on the main page only (phpld v2)

Hi

I know there is a similar thread in this forum but it's getting confusing and most importantly it didn't get me anywhere so I need to ask again if anyone can help me with this one...

I am using the latest free version of PHPLD (2) on my site and I need to display the last 10 listings on my main page.

It would be great if the mod is coded in a way that if I wanted to.. I could change the number of listing from let's say 10 to 15 and it would still work the same way.

Can anyone help me with this one pls?? I would really appreciate it someone could. I don't really wanna switch to any other script because I like everything about PHPLD..
Reply With Quote
  #2   IP: 218.2.67.5
Old 2007-07-10, 09:26 PM
smiling smiling is offline
高级会员
 
Join Date: 2006-02-12
Posts: 502
smiling 正向着好的方向发展
Default

Place in main.tpl below {/strip}
Code:
<table width=894" height="300" align="center" cellspacing="0" cellpadding="0" border="0">
<td width="50%" rowspan="0" border="0" valign="top">
{if count($top_ten) gt 0} 
<h3>{l}Top Ten Links{/l}</h3>
{foreach from=$top_ten item=link name=links} 
{include file="link.tpl" link=$link}
{/foreach} 
{/if}</td> 

<td width="50%" rowspan="0" border="0" valign="top"> 
{if count($last_ten) gt 0} 
<h3>{l}Latest Ten Links{/l}</h3>
{foreach from=$last_ten item=link name=links}
{include file="link.tpl" link=$link}
{/foreach}
{/if}
</td>
</table>
Place in index.php above echo $tpl->fetch('main.tpl', $id);

Code:
$top_ten = $db->GetAll("SELECT * FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' ORDER BY `HITS` DESC LIMIT 0, 10");
$last_ten = $db->GetAll("SELECT * FROM `{$tables['link']['name']}` WHERE `STATUS` = '2' ORDER BY `ID` DESC LIMIT 0, 10");
$tpl->assign('top_ten' , $top_ten );
$tpl->assign('last_ten', $last_ten);
Reply With Quote
  #3   IP: 218.2.67.5
Old 2007-07-10, 09:28 PM
smiling smiling is offline
高级会员
 
Join Date: 2006-02-12
Posts: 502
smiling 正向着好的方向发展
Default

Code:
Is there a way to get this on the main page ONLY?

phpld 2.0
{if $category.ID eq 0 and !$q and !$p}

your code here

{/if}

phpld 3.06
{if $category.ID eq 0 and !$list and !$search}

your code here

{/if}
Reply With Quote
  #4   IP: 218.2.67.5
Old 2007-07-10, 09:30 PM
smiling smiling is offline
高级会员
 
Join Date: 2006-02-12
Posts: 502
smiling 正向着好的方向发展
Default

use
Code:
<a href="{$link.URL}" target="_blank">{$link.TITLE}</a>
<br />
instead of
Code:
{include file="link.tpl" link=$link}
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
<<<网赚每个月给我带来1000元补助>>推荐给大家 005yl 网络赚钱技术交流 0 2006-10-31 12:45 AM
Successful Site in 12 Months with Google Alone sunshine 搜索引擎市场营销研究 0 2006-02-27 09:27 PM
Building for the user and the bot. admin 建站交流 0 2006-01-17 03:54 PM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 10:44 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.