| Cypher_489 Wrote: : |
| The preview and live versions of the review are two seperate pieces of code. So it could be something as simple as forgetting to change a variable (Thats what the $things are called by the way |
| Code: : |
| function showcontent($id, $page, $cdonurl) { global $admin, $uimages, $prefix, $db, $module_name; $id = intval($id); $page = intval($page); include ('header.php'); OpenTable(); if (($page == 1) OR (empty($page))) { $db->sql_query("UPDATE ".$prefix."_reviews SET hits=hits+1 WHERE id='$id'"); } $result = $db->sql_query("SELECT * FROM ".$prefix."_reviews WHERE id='$id'"); $myrow = $db->sql_fetchrow($result); $id = intval($myrow['id']); $date = $myrow['date']; $year = substr($date,0,4); $month = substr($date,5,2); $day = substr($date,8,2); $fdate = date("F jS Y",mktime (0,0,0,$month,$day,$year)); $title = $myrow['title']; $title = stripslashes(FixQuotes(check_html($title, "nohtml"))); $text = $myrow['text']; $cover = $myrow['cover']; $reviewer = $myrow['reviewer']; $email = $myrow['email']; $hits = intval($myrow['hits']); $url = $myrow['url']; $url_title = $myrow['url_title']; $cdonurl = $myrow['cdonurl']; $score = intval($myrow['score']); $contentpages = explode( "<!--pagebreak-->", $text ); $pageno = count($contentpages); if ( $page=="" || $page < 1 ) $page = 1; if ( $page > $pageno ) $page = $pageno; $arrayelement = (int)$page; $arrayelement --; echo "<p><i><b><font class=\"title\">$title</b></i></font><br>"; echo "<BLOCKQUOTE><p align=justify>"; if (!empty($cover)) echo "<table align=right border=0 cellspacing=5 cellpadding=0><tr><td bgcolor=#000000><table border=0 cellspacing=0 cellpadding=0><tr><td bgcolor=#FFFFFF align=center><img src=images/reviews/$cover></td></tr><tr> <td bgcolor=#FFFFFF align=center><table align=center border=0 cellspacing=5 cellpadding=0><tr><td bgcolor=#000000><table border=0 cellspacing=1 cellpadding=1 width=240><tr><td bgcolor=#FFFFFF align=center><font size=1>Köp skivan på:<br><a href=\"$cdonurl\"><img STYLE=\"border: 0px none\" src=http://test.swegeeks.com/images/cdon2.gif></a> <img src=http://test.swegeeks.com/images/cdon2.gif> <img src=http://test.swegeeks.com/images/cdon2.gif> <img src=http://test.swegeeks.com/images/cdon2.gif></font></td></tr></table></td></tr></table></td></tr></table></td></tr></table>"; echo "<br>$contentpages[$arrayelement] </BLOCKQUOTE><p>"; if (is_admin($admin)) echo "<b>"._ADMIN."</b> [ <a href=\"modules.php?name=$module_name&rop=mod_review&id=$id\">"._EDIT."</a> | <a href=modules.php?name=$module_name&rop=del_review&id_del=$id>"._DELETE."</a> ]<br>"; echo "<b>"._ADDED."</b> $fdate<br>"; if (!empty($reviewer)) echo "<b>"._REVIEWER."</b> <a href=mailto:$email>$reviewer</a><br>"; if (!empty($score)) echo "<b>"._SCORE."</b> "; display_score($score); if (!empty($url)) echo "<br><b>"._RELATEDLINK.":</b> <a href=\"$url\" target=new>$url_title</a>"; echo "<br><b>"._HITS.":</b> $hits"; if ($pageno > 1) { echo "<br><b>"._PAGE.":</b> $page/$pageno<br>"; } echo "</font>"; echo "</CENTER>"; $title = urlencode($title); if($page >= $pageno) { $next_page = ""; } else { $next_pagenumber = $page + 1; if ($page != 1) { $next_page .= "<img src=\"images/blackpixel.gif\" width=\"10\" height=\"2\" border=\"0\" alt=\"\"> "; } $next_page .= "<a href=\"modules.php?name=$module_name&rop=showcontent&id=$id&page=$next_pagenumber\">"._NEXT." ($next_pagenumber/$pageno)</a> <a href=\"modules.php?name=$module_name&rop=showcontent&id=$id&page=$next_pagenumber\"><img src=\"images/right.gif\" border=\"0\" alt=\""._NEXT."\"></a>"; } if($page <= 1) { $previous_page = ""; } else { $previous_pagenumber = $page - 1; $previous_page = "<a href=\"modules.php?name=$module_name&rop=showcontent&id=$id&page=$previous_pagenumber\"><img src=\"images/left.gif\" border=\"0\" alt=\""._PREVIOUS."\"></a> <a href=\"modules.php?name=$module_name&rop=showcontent&id=$id&page=$previous_pagenumber\">"._PREVIOUS." ($previous_pagenumber/$pageno)</a>"; } echo "<center>" ."$previous_page $next_page<br><br>" ."[ <a href=\"modules.php?name=$module_name\">"._RBACK."</a> | " ."<a href=\"modules.php?name=$module_name&rop=postcomment&id=$id&title=$title\">"._REPLYMAIN."</a> ]"; CloseTable(); if (($page == 1) OR (empty($page))) { echo "<br>"; r_comments($id, $title); } include ("footer.php"); } |
| Cypher_489 Wrote: : |
| I haven't had a proper look at the code you gave but "if (!empty($url))" actually means if it is NOT empty, do this... An ! sign before something means "not". What I think you might have done is placed the code you wanted in the section that is if it IS empty. Try moving it to the if is not empty part. |
| Code: : |
| if (!empty($cover)) echo "<a href=\"$cdonurl\"><img STYLE=\"border: 0px none\" src=http://test.swegeeks.com/images/cdon2.gif></a>"; |