Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.