Jump to content

featured images


chery

Recommended Posts

[code]}

  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;[/code]

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'].

[b]Any ideas please?[/b]

[code]}

  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;[/code]
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

[!--quoteo(post=377025:date=May 25 2006, 09:58 AM:name=gerkintrigg)--][div class=\'quotetop\']QUOTE(gerkintrigg @ May 25 2006, 09:58 AM) [snapback]377025[/snapback][/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.
Link to comment
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.