Jump to content

require help on script


alwaysme

Recommended Posts

hi ppl

 

i have script that is in mysite.com/script/index.php. someone so nice on the net made a craetion for me to display most viewed little pic (thumb) on that index page.

 

it works well and everything is function great. The code he added for me is told me to place the code below into the script directory with rest of the php code



$query_mv = "SELECT * FROM pp_files WHERE approved='1' AND reject='0' ORDER BY views DESC";
$result_mv = mysql_query($query_mv);
while ($row_mv = mysql_fetch_assoc($result_mv)){
$videos_mv[] = $row_mv;
}
$smarty->assign('videos_mv', $videos_mv);

 

the other part is


{section name=videos_mv loop=$videos_mv max=3}
<a href="videos.php?id={$videos_mv[videos_mv].id}"><img height='89' width='120' src="{$videos_mv[videos_mv].picture}" class="thumbnail" alt="thumbnail" /></a>
{/section}


{include file="footer.tpl"}

 

to place in the index.tpl file of the script directory

 

it works very great. But i want that display the latest one added not the views....how can i become to that?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/85242-require-help-on-script/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.