Tonny Kluften
Administrator
Ok, prøvde litt til, slik ser koden til Helter ut nå:
Det jeg trenger å fikse nå er at de mest besøkte kommer øverst, nå kommer de nederst på lista.
<?php
///Most viewed recipes
$res_view = mysql_query("select * from ".TABLE_PREFIX."recipes where published = '1' order by views limit 0,5");
while($row_view = mysql_fetch_array($res_view))
{
echo '<tr><td valign="top" style="padding-left:4px">';
if ( $row_view['picture'] != '' && file_exists("admin/uploads/".$row_view["picture"]))
{
///Make thumbnail
if ( makethumb($row_view["picture"], "admin/uploads", "90" , "S_", "admin/uploads"))
{
$pathtopicnew = $NewThumbFileName;
}
else
{
$pathtopicnew = "admin/uploads/".$row_view["picture"];
}
}
else
{
// set inn url til default bildet ditt her
$pathtopicnew = 'images/ikkebilde.gif';
}
$uri = urlencode( str_replace( array(' ', '_'), array('_', '~'), $row_view['name']));
printf('<a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a>
<a href="helt.php?id=%1$d&recipe_title=%2$s"><b>%4$s</b><br /></a>', $row_view['id'], $uri, $pathtopicnew, $row_view['name']);
?>
Det jeg trenger å fikse nå er at de mest besøkte kommer øverst, nå kommer de nederst på lista.
<?php
///Most viewed recipes
$res_view = mysql_query("select * from ".TABLE_PREFIX."recipes where published = '1' order by views limit 0,5");
while($row_view = mysql_fetch_array($res_view))
{
echo '<tr><td valign="top" style="padding-left:4px">';
if ( $row_view['picture'] != '' && file_exists("admin/uploads/".$row_view["picture"]))
{
///Make thumbnail
if ( makethumb($row_view["picture"], "admin/uploads", "90" , "S_", "admin/uploads"))
{
$pathtopicnew = $NewThumbFileName;
}
else
{
$pathtopicnew = "admin/uploads/".$row_view["picture"];
}
}
else
{
// set inn url til default bildet ditt her
$pathtopicnew = 'images/ikkebilde.gif';
}
$uri = urlencode( str_replace( array(' ', '_'), array('_', '~'), $row_view['name']));
printf('<a href="helt.php?id=%d&recipe_title=%s"><img src="%s" alt="%s" class="imageborder" width="70" border="0" align="left" /> </a>
<a href="helt.php?id=%1$d&recipe_title=%2$s"><b>%4$s</b><br /></a>', $row_view['id'], $uri, $pathtopicnew, $row_view['name']);
?>