chery Posted May 25, 2006 Share Posted May 25, 2006 [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 https://forums.phpfreaks.com/topic/10430-featured-images/ Share on other sites More sharing options...
gerkintrigg Posted May 25, 2006 Share Posted May 25, 2006 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 https://forums.phpfreaks.com/topic/10430-featured-images/#findComment-38914 Share on other sites More sharing options...
chery Posted May 25, 2006 Author Share Posted May 25, 2006 [!--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 https://forums.phpfreaks.com/topic/10430-featured-images/#findComment-38920 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.