Jump to content


Photo

featured images


  • Please log in to reply
2 replies to this topic

#1 chery

chery
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts
  • Locationaustralia

Posted 25 May 2006 - 12:03 PM

}

  function Featured() {
      $query = mysql_query("select * from ".$GLOBALS['db_items']." where status = 1 order by rand()") or die(mysql_error());
    $result = mysql_fetch_array($query);
    $screenshot = $result['screenshot'];
    $title = $result['title'];
    $category = $result['category'];
    $description = wordlimit($result['description'],50);
    $vname = $result['vname'];
    $id = $result['id'];
    if($GLOBALS['seo'] == "1") { 
    $link = "<A href=".$GLOBALS['FURL']."/cat-$category-".ParentCat($category)."/".safename($title)."-$id.html><font color=\"#3366CC\" size=\"3\" face=\"Georgia, Times New Roman, Times, serif\"><strong>$title</strong></font></a>";
    }
    else { 
    $link = "<A href='".$GLOBALS['FURL']."/detail.php?id=$id'><font color=\"#3366CC\" size=\"3\" face=\"Georgia, Times New Roman, Times, serif\"><strong>$title</strong></font></a>";
    }
    $output = "
    <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr> 
    <td width=\"86%\" height=\"20\">$link</td>
  </tr>
  <tr> 
    <td><font color=\"#666666\" size=\"1\" face=\"Verdana, Arial, Helvetica, sans-serif\">By 
      $vname</font><font size=\"2\" face=\"Verdana\"><br>
      $description</font></td>
  </tr>
</table>
";
    return $output;

This actually works with the text info but I want it not to randomise (instead show 5 results) and display the ['screenshot'] and ['title'] instead of the ['description'].

Any ideas please?

}

  function Screenshot($id) {
      $query = mysql_query("select screenshot,title from ".$GLOBALS['db_items']." where id = $id") or die(mysql_error());
    $result = mysql_fetch_array($query);
    $screenshot = $result['screenshot'];
    $title = $result['title'];

    if(!empty($screenshot)) {
    $screen = "<img src=\"$screenshot\" alt=\"$title\">";
    }
    else
    {
    $screen = "<img src=\"".$GLOBALS['FURL']."/images/na.gif\" alt=\"$title\">";
    }
    return $screen;

chery
WWD GAMES - the BIGGEST little GAME site on the NET

#2 gerkintrigg

gerkintrigg
  • Members
  • PipPipPip
  • Magician
  • 828 posts
  • LocationBristol, UK
  • Age:37

Posted 25 May 2006 - 01:58 PM

krikey... i know you're a noobie, but posting tonnes of code without explaining the problem doesn't help much. I have a few great scripts... one is a pagination script, one is a randomisation one... I'm slightly unsure which one you're after...

Can you explain what you want a bit better please?
Neil Trigger - http://www.ghostlypublishing.co.uk - Ghostly Publishing - Children's Fantasy Books

#3 chery

chery
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts
  • Locationaustralia

Posted 25 May 2006 - 02:08 PM

[!--quoteo(post=377025:date=May 25 2006, 09:58 AM:name=gerkintrigg)--][div class=\'quotetop\']QUOTE(gerkintrigg @ May 25 2006, 09:58 AM) View Post[/div][div class=\'quotemain\'][!--quotec--]
krikey... i know you're a noobie, but posting tonnes of code without explaining the problem doesn't help much. I have a few great scripts... one is a pagination script, one is a randomisation one... I'm slightly unsure which one you're after...

Can you explain what you want a bit better please?
[/quote]

Sorry I thought I did explain:
The first code is what I have in place - This actually works and displays the text info but I want it not to randomise (instead show 5 results) and display the ['screenshot'] and ['title'] instead of the ['description'].
I included the screenshot code to see if someone had a way of using that to do what I want by replacing or adding some of it to the orifinal code.

chery
WWD GAMES - the BIGGEST little GAME site on the NET




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users