Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
nuevonuke
Hangin' Around



Joined: Sep 22, 2005
Posts: 32
Location: Spain

PostPosted: Wed Sep 21, 2005 11:36 pm Reply with quote

Hello!
Please, can anything help me?:
[ Only registered users can see links on this board! Get registered or login! ]


Last edited by nuevonuke on Mon Sep 26, 2005 3:09 pm; edited 1 time in total 
View user's profile Send private message
kguske
Site Admin



Joined: Jun 04, 2004
Posts: 6432

PostPosted: Thu Sep 22, 2005 11:13 am Reply with quote

It looks like TinyMCE is expecting or forcing double quotes for images. Try using this html:

Code:
<img src="http://www.clubpeugeot307.com/images/powered/powered8.jpg">


Use double quote instead of single quote.

_________________
I search, therefore I exist...
nukeSEO - nukeFEED - nukePIE - nukeSPAM - nukeWYSIWYG
 
View user's profile Send private message
nuevonuke







PostPosted: Thu Sep 22, 2005 12:47 pm Reply with quote

Hi kguske;
I proved your recomendation and the result is the same.
 
kguske







PostPosted: Thu Sep 22, 2005 12:55 pm Reply with quote

Very strange. Is it still generating
Code:
http://www.clubpeugeot307.com/"images/powered/powered8.jpg"

?

My only other suggestion would be to try:
Code:
<img src=images/powered/powered8.jpg>
 
nuevonuke







PostPosted: Thu Sep 22, 2005 1:02 pm Reply with quote

Yes, is really strange.

With your second suggestion the result is the same too.

Do you need the code for help me?
 
kguske







PostPosted: Thu Sep 22, 2005 1:27 pm Reply with quote

I guess so... Let's start with the modules/MReviews/index.php. Email it to kguske at bellsouth dot net.
 
nuevonuke







PostPosted: Thu Sep 22, 2005 4:17 pm Reply with quote

This is the code modules /MReviews/index.php

Code:


<?php
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);

if(!$rid && !$cid) $pagetitle = "- Reviews";
elseif($cid) {
       $sql = "SELECT title FROM ".$prefix."_MReviews_cats WHERE cid='$cid'";
       $result = $db->sql_query($sql);
       $row = $db->sql_fetchrow($result);
       $pagetitle = "| $row[title]";
}
elseif($rid) {
       $sql = "SELECT cid, pagename FROM ".$prefix."_MReviews WHERE rid='$rid'";
       $result = $db->sql_query($sql);
       $row = $db->sql_fetchrow($result);
       $sql = "SELECT title FROM ".$prefix."_MReviews_cats WHERE cid='$row[cid]'";
       $result2 = $db->sql_query($sql);
       $row2 = $db->sql_fetchrow($result2);
    $pagetitle = "| $row2[title] | $row[pagename]";
}
include("header.php");

// Customization Area Starts

$border_color = "#000000";
// Change this according to your theme

$PictureList     = "no";
// no OR yes (If No Then there will be Simple Text based Category linking, If yes then there will Picture Based Category linking)

$AllowGuestsToPost = "no";
// no OR yes (If No Then only Registered Members will be able to Submit Review)

$EmailNotification = "on";
// Email Notification For Every Review, Switches : (on OR off)

$ReviewsImagesUrl  ="/";
//You can have any site you wish to use here :) usefull for those who dont have enough space left in There Nuke Hosting :)

$max_results       = "15";
// Max Results For List All Page

// Customization finishes

function alpha($cid) {
    global $module_name;
    $alphabet = array ("A","B","C","D","E","F","G","H","I","J","K","L","M",
                       "N","O","P","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0");
    $num = count($alphabet) - 1;
    echo "<center>[ ";
    $counter = 0;
    while (list(, $ltr) = each($alphabet)) {
        echo "<a href=\"modules.php?name=$module_name&op=$ltr&cid=$cid\">$ltr</a>";
        if ( $counter == round($num/2) ) {
            echo " ]\n<br>\n[ ";
        } elseif ( $counter != $num ) {
            echo "&nbsp;|&nbsp;\n";
        }
        $counter++;
    }
    echo " ]</center><br><br>\n\n\n";
}

function display_score($score) {
    $image = "<img src=\"images/blue.gif\" alt=\"\">";
    $halfimage = "<img src=\"images/bluehalf.gif\" alt=\"\">";
    $full = "<img src=\"images/star.gif\" alt=\"\">";
    $notrated = "<img src=\"images/NotRated.gif\" alt=\"\">";

    if ($score == 10) {
   echo "<img src=\"images/10stars.gif\" alt=\"Top of All\" title=\"Excellent\">";
    } else if ($score == 9) {
   echo "<img src=\"images/9stars.gif\" alt=\"Excellent\" title=\"Excellent\">";
   } else if ($score == 8) {
   echo "<img src=\"images/8stars.gif\" alt=\"Best\" title=\"Best\">";
   } else if ($score == 7) {
   echo "<img src=\"images/7stars.gif\" alt=\"Very Good\" title=\"Very Good\">";
   } else if ($score == 6) {
   echo "<img src=\"images/6stars.gif\" alt=\"Good\" title=\"Good\">";
   } else if ($score == 5) {
   echo "<img src=\"images/5stars.gif\" alt=\"Fair\" title=\"Fair\">";
   } else if ($score == 4) {
   echo "<img src=\"images/4stars.gif\" alt=\"Not Bad\" title=\"Not Bad\">";
   } else if ($score == 3) {
   echo "<img src=\"images/3stars.gif\" alt=\"Bad\" title=\"Bad\">";
   } else if ($score == 2) {
   echo "<img src=\"images/2stars.gif\" alt=\"Worst\" title=\"Worst\">";
   } else if ($score == 1) {
   echo "<img src=\"images/1stars.gif\" alt=\"Worst Of All\" title=\"Worst Of All\">";
   } else {
   echo "<img src=\"images/NotRated.gif\" alt=\"No Score\" title=\"No Score\">";
   }
}

function preview_review($date, $pagename, $MReview_content, $author, $author_email, $score, $cover, $r_link, $r_link_title, $counter, $rid, $cid) {
    global $prefix, $admin, $db, $sitename, $user, $cookie, $user_prefix, $module_name, $ReviewsImagesUrl;
    OpenTable();
if (eregi("<!--pagebreak-->", $MReview_content)) {
   $MReview_content = ereg_replace("<!--pagebreak-->","&lt;!--pagebreak--&gt;",$MReview_content);
    }

    if (eregi("\"", $pagename)) {
      $pagename = ereg_replace("\"","&quot;",$pagename);
    }
    if (eregi("\"", $author)) {
      $author = ereg_replace("\"","&quot;",$author);
    }
    if (eregi("\"", $r_link_title)) {
      $r_link_title = ereg_replace("\"","&quot;",$r_link_title);
    }
        if (eregi("\"", $MReview_content)) {
         $MReview_content = ereg_replace("\"","&quot;",$MReview_content);
    }

    $pagename = stripslashes(check_html($pagename, "nohtml"));
    $MReview_content = stripslashes($MReview_content);
    $author = stripslashes(check_html($author, "nohtml"));
    $r_link_title = stripslashes(check_html($r_link_title, "nohtml"));

    echo "<form method=\"post\" action=\"modules.php?name=$module_name\">";

    if ($pagename == "") {
       $error = 1;
   echo ""._INVALIDTITLE."<br>";
    }
    if ($MReview_content == "") {
       $error = 1;
   echo ""._INVALIDTEXT."<br>";
    }
    if (($counter < 0) && ($rid != 0)) {
   $error = 1;
   echo ""._INVALIDHITS."<br>";
    }
    if ($author == "" || $author_email == "") {
   $error = 1;
   echo ""._CHECKNAME."<br>";
    } else if ($author != "" && $author_email != "")
   if (!(eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$",$author_email))) {
       $error = 1;
       /* eregi checks for a valid email! works nicely for me! */
       echo ""._INVALIDEMAIL."<br>";
   }
   if (($r_link_title != "" && $r_link =="") || ($r_link_title == "" && $r_link != "")) {
       $error = 1;
       echo ""._INVALIDLINK."<br>";
   } else if (($r_link != "") && (!(eregi('(^http[s]*:[/]+)(.*)', $r_link))))
       $r_link = "http://" . $r_link;
       /* If the user ommited the http, this nifty eregi will add it */
   if ($error == 1)
       echo "<br>[ "._GOBACK." ]";
   else
   {
   if ($date == "")
       $date = date("Y-m-d", time());
       $year2 = 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,$year2));


           echo "<table border=\"0\" width=\"100%\"><tr><td colspan=\"2\">";
       echo "<p><font class=\"title\"><i><b>$pagename</b></i></font><br>";
       echo "<blockquote><p>";
       if ($cover != "")
          echo "<img src=\"$ReviewsImagesUrl/$cover\" align=\"right\" border=\"1\" vspace=\"2\" alt=\"\">";
          $PReview_content = nl2br($MReview_content);
       echo "$PReview_content<p>";
       echo "<b>"._ADDED.":</b> $fdate<br>";
       echo "<b>"._AUTHOR.":</b> <a href=\"mailto:$author_email\">$author</a><br>";
       echo "<b>"._SCORE.":</b> ";
       display_score($score);
       if ($r_link != "")
      echo "<br><b>"._RLINK.":</b> <a href=\"$r_link\" target=\"new\">$r_link_title</a>";
       if ($rid != 0) {
      echo "<br><b>"._REVIEWID.":</b> $rid<br>";
      echo "<b>"._HITS.":</b> $counter<br>";
       }
       echo "</font></blockquote>";
       echo "</td></tr></table>";
       echo "<p><i>"._LOOKSRIGHT."</i><br>";
       echo "<input type=\"hidden\" name=\"rid\" value=$rid>
       <input type=\"hidden\" name=\"cid\" value=$cid>
       <input type=\"hidden\" name=\"scid\" value=$scid>
        <input type=\"hidden\" name=\"counter\" value=\"$counter\">
        <input type=\"hidden\" name=\"op\" value=\"send_MReview\">
        <input type=\"hidden\" name=\"date\" value=\"$date\">
        <input type=\"hidden\" name=\"pagename\" value=\"$pagename\">";
        echo "<input type=\"hidden\" name=\"MReview_content\" value=\"$PReview_content\">
        <input type=\"hidden\" name=\"author\" value=\"$author\">
        <input type=\"hidden\" name=\"author_email\" value=\"$author_email\">
        <input type=\"hidden\" name=\"score\" value=\"$score\">
        <input type=\"hidden\" name=\"r_link\" value=\"$r_link\">
        <input type=\"hidden\" name=\"r_link_title\" value=\"$r_link_title\">";
            if (is_admin($admin)) {
        echo "<input type=\"hidden\" name=\"cover\" value=\"$cover\">";
        }
              echo "<input type=\"submit\" value=\""._YES."\"> <a href=\"#No\">[ "._NO." ]</a></form>";
       if($rid != 0)
          $word = ""._RMODIFIED."";
       else
          $word = ""._RADDED."";
       if(is_admin($admin))
          echo "<br><br><b>"._NOTE.":</b> "._ADMINLOGGED." $word.";


    CloseTable();
    echo "<br><br><br><br><br>";

    OpenTable();
    echo "<a name=No></a><center><h1>Modification</h1></centeR>";
echo "<form action=\"modules.php?name=MReviews\" method=POST>";
echo "<input type=\"hidden\" name=\"op\" value=\"preview_review\">";
echo "<b>"._REVIEWNAME.":</b><br> <input type=\"text\" name=\"pagename\" value=\"$pagename\"><br><i>"._NAMEPRODUCT."</i><br><br>";
echo "<b>"._CATEGORY.":</b><br> <select name=\"cid\">";

$sql = "SELECT * FROM ".$prefix."_MReviews_cats";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) {

echo "<option value=\"$row[cid]\">$row[title]</option>";
}
echo "</select><br><i>"._PRODUCTCAT."<Br><br>";
echo "<b>"._SUBCATEGORY.":</b><br> <select name=\"scid\">";

$sql = "SELECT * FROM ".$prefix."_MReviews_sub_cats";
$result2 = $db->sql_query($sql);
while($row2 = $db->sql_fetchrow($result2)) {

echo "<option value=\"$row2[cid]\">$row2[sub_title]</option>";
}
echo "</select><br><i>"._PRODUCTSUBCAT."<Br><br>";
echo "    <b>"._YOURNAME.":</b><br>";

    if (is_user($user)) {
$sql = "select name, user_email from ".$user_prefix."_users where username='$cookie[1]'";
$result2 = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result2);
  }
    echo "<input value=\"$author\" type=\"text\" name=\"author\" size=\"41\" maxlength=\"40\" value=\"$row2[name]\"><br>
    <i>"._FULLNAMEREQ."</i><br><br>
    <b>"._REMAIL.":</b><br>
    <input type=\"text\" value=\"$author_email\" name=\"author_email\" size=\"40\" maxlength=\"80\" value=\"$row2[user_email]\"><br>
    <i>"._REMAILREQ."</i><br><br>";
echo "<b>"._REVIEW.":</b><br> <textarea name=\"MReview_content\" rows=\"15\" cols=\"60\" class=\"post\">$MReview_content</textarea><br><i>"._CHECKREVIEW."</i><br><br>";
echo"<b>"._SCORE.":</b>
    <select name=\"score\">
    <option name=\"score\" value=\"10\">10</option>
    <option name=\"score\" value=\"9\">9</option>
    <option name=\"score\" value=\"8\">8</option>
    <option name=\"score\" value=\"7\">7</option>
    <option name=\"score\" value=\"6\">6</option>
    <option name=\"score\" value=\"5\">5</option>
    <option name=\"score\" value=\"4\">4</option>
    <option name=\"score\" value=\"3\">3</option>
    <option name=\"score\" value=\"2\">2</option>
    <option name=\"score\" value=\"1\">1</option>
    </select><br>
    <i>"._SELECTSCORE."</i><br><br>";
    if (is_admin($admin)) {
echo "<b>"._COVERIMAGE.":</b><br> <input value=\"$cover\" type=\"text\" name=\"cover\"><br>";
echo "<i>"._RIMAGEFILEREQ."</i><br><br>";
}
echo "<b>"._RLINK.":</b><br> <input type=\"text\" value=\"$r_link\" name=\"r_link\"><br>";
echo "<i>"._PRODUCTSITE."</i><br><br>";
echo "<b>"._RLINKTITLE."</b>:<br> <input type=\"text\" value=\"$r_link_title\" name=\"r_link_title\"><br>";
echo "<i>"._LINKTITLEREQ."</i><br><br>";
echo "<input type=\"submit\" value=\""._PREMODS."\">";
echo "</form>";
CloseTable();
}
}

function show_cats() {
 global $prefix, $db, $PictureList, $prefix, $bgcolor3;

OpenTable();
echo "<center><font class=\"title\">"._RWELCOME." <br></font><font class=small>"._VCATEGORIES."</font></center>";


if ($PictureList == "yes") {
echo "<br><table width=100% border=0 cellspacing=1 bgcolor=$border_color>";
$sql = "SELECT * FROM ".$prefix."_MReviews_cats";
$result = $db->sql_query($sql);

    $count = 0;
while($row=mysql_fetch_array($result))
{
       if ($count==2) {
        echo "<tr>";
        $count = 0;
        }
        echo "<td width=50% align=center><a href=\"modules.php?name=MReviews&op=list_revs&cid=$row[cid]\"><img src=\"$row[image]\" border=0 alt=\"$row[title]\"></a>";
        $count++;
        if ($count==2) {
        echo "</tr>";
        }
        echo "</td>";
    }
    echo "</table>";
} else {
$sql = "SELECT * FROM ".$prefix."_MReviews_cats";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) {
echo "<a href=\"modules.php?name=MReviews&op=list_revs&cid=$row[cid]\">$row[title]</a><br>\n";
echo "$row[description]<br>";
$sql = "SELECT * FROM ".$prefix."_MReviews where cid='$row[cid]' order by date DESC";
$result2 = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result2);
$numrows = $db->sql_numrows($result2);
if ($numrows == 0) {
echo ""._NOREVIEWS."<hr>";
} else {
echo ""._LATESTREVIEW."<B><a href=\"modules.php?name=MReviews&op=show&rid=$row2[rid]\">$row2[pagename]</a></b><br>";
echo "<b>$numrows</b> "._REVIEWSFOUND."<hr>";
}


}
echo "\n";
}
CloseTable();
}


function list_revs($cid, $orderby, $page) {
global $prefix, $db, $admin, $sitename, $bgcolor4, $bgcolor2, $bgcolor3, $bgcolor1, $border_color, $max_results;
$sql = "SELECT * FROM ".$prefix."_MReviews_cats where cid='$cid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

if(!$page){
    $page = "1";
}

OpenTable();
echo "<centeR>"
   ."<font class=\"title\">"._WELCOMETO." $sitename <i>$row[title]</i> "._REVIEWS."</font><br>"
   ."<font class=\"content\">$row[description]</font><br><br>";

alpha($cid);

echo "[ <a href=\"modules.php?name=MReviews&op=write_MReview\">"._WRITEREVIEW."</a> ] "
   ."[ <a href=\"#AllReviews\">"._ALLREVIEWS."</a> ] "
   ."</center>";

echo "<br><br>";
echo "<table name=Table1 width=\"100%\" name=MainTable cellspacing=1 cellpadding=2>\n";
echo "<tr><td width=50% name=TopReviewsColoumn>";

echo "<table bgcolor=\"$border_color\" name=TopReviews width=\"100%\" cellpadding=2 cellspacing=1>";
echo "<tr><td bgcolor=\"$bgcolor2\" valign=top width=100%><b>"._10MOSTPOP."</b></td></tr>";
    $sql = "select * from ".$prefix."_MReviews where cid='$cid' ORDER BY counter DESC LIMIT 10";
    $result = $db->sql_query($sql);
    while($row = $db->sql_fetchrow($result)) {

echo "<tr>\n<td width=100% bgcolor=\"$bgcolor1\"><a href=\"modules.php?name=MReviews&op=show&rid=$row[rid]\">$row[pagename]</A></td></tr>";
}
echo "</table name=TopReviews>\n\n";

echo "</td><td width=50% name=LatestReviewsColoumn>\n";

echo "<table bgcolor=\"$border_color\" name=LatestReviews width=\"100%\" cellpadding=2 cellspacing=1>\n";
echo "<tr><td bgcolor=\"$bgcolor2\" valign=top width=100%><b>"._10MOSTREC."</b></td></tr>\n";
   $sql = "select * from ".$prefix."_MReviews where cid='$cid' ORDER BY date DESC LIMIT 10";
   $result2 = $db->sql_query($sql);
   while($row2 = $db->sql_fetchrow($result2)) {
echo "<tr>\n<td width=100% bgcolor=\"$bgcolor1\"><a href=\"modules.php?name=MReviews&op=show&rid=$row2[rid]\">$row2[pagename]</A></td></tr>";
}
echo "</table name=LatestReviews>\n";
echo "</td></tr>";
   $sql = "select * from ".$prefix."_MReviews where cid='$cid'";
   $result3 = $db->sql_query($sql);
   $numresults = sql_num_rows($result3);
   echo "<tr><td colspan=\"2\"><center>"._THEREARE." $numresults "._REVIEWSINDB."</center></td></tr>";
   echo "<form action=\"search.html\" method=\"post\"><input type=\"hidden\" name=\"type\" value=\"reviews\">";
echo "<tr><td colspan=\"2\"><center>Query: <input type=\"text\" name=\"query\" size=\"15\"> <input type=\"submit\" value=\"Search\"></form></center></td></tr>";
   echo "<tr><td colspan=\"2\"><center><a href=\"modules.php?name=MReviews\">"._RBACK."</a></center></td></tr>";
echo "</table name=MainTable>\n";
CloseTable();
echo "<br>";
echo "<br>";
OpenTable();
$sql = "SELECT * FROM ".$prefix."_MReviews_cats where cid='$cid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
echo "<center><font class=\"title\"><a name=\"#AllReviews\"></a>"._LISTINGALLREVIEWSIN." <i>$row[title]</i> "._CATEGORY."</font><br>";

if ($orderby == "sub_catA")         $orderbyText = ""._SUBCATA2Z."";
if ($orderby == "sub_catD")         $orderbyText = ""._SUBCATZ2A."";
if ($orderby == "titleA")         $orderbyText = ""._TITLEA2Z."";
if ($orderby == "titleD")         $orderbyText = ""._TITLEZ2A."";
if ($orderby == "HitsA")         $orderbyText = ""._POPULARITY1."";
if ($orderby == "HitsD")         $orderbyText = ""._POPULARITY2."";
if ($orderby == "DateA")         $orderbyText = ""._DATE1."";
if ($orderby == "DateD")         $orderbyText = ""._DATE2."";
if ($orderby == "ScoreA")         $orderbyText = ""._RATING1."";
if ($orderby == "ScoreD")         $orderbyText = ""._RATING2."";


echo "<font class=gensmall>
"._SORTREVIEWSBY."
Sub Cat (<a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=sub_catA#AllReviews\">A</a>\
      <a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=sub_catD#AllReviews\">D</a>)

Title (<a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=titleA#AllReviews\">A</a>\
      <a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=titleD#AllReviews\">D</a>)

Date (<a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=DateA#AllReviews\">A</a>\
     <a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=DateD#AllReviews\">D</a>)

Rating (<a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=ScoreA#AllReviews\">A</a>\
      <a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=ScoreD#AllReviews\">D</a>)

Popularity (<a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=HitsA#AllReviews\">A</a>\
          <a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=HitsD#AllReviews\">D</a>)
<br>";

if ($orderby != "")
echo ""._REVIEWSCURSORTEDBY."$orderbyText";

echo "</font></center><br><br>";

echo "<table bgcolor=\"$border_color\" name=TopReviews width=\"100%\" cellpadding=2 cellspacing=1>";
echo "<tr>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=35%><b>"._REVIEWSNAME."</b></td>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=20%><b>"._AUTHOR."</b></td>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=23%><b>"._DATE."</b></td>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=23%><b>"._SUBCATEGORY."</b></td>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=8%><b>"._SCORE."</b></td>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=5%><b>"._HITS."</b></td>";

if (is_admin($admin)) {
echo "<td bgcolor=\"$bgcolor2\" width=10%><b>"._ADMIN."</b></td>\n";
}
echo "</tr>";


if ($orderby == "sub_catA")         $orderbySQL = "scid ASC";
if ($orderby == "sub_catD")         $orderbySQL = "scid DESC";
if ($orderby == "titleA")         $orderbySQL = "pagename ASC";
if ($orderby == "titleD")         $orderbySQL = "pagename DESC";
if ($orderby == "HitsA")         $orderbySQL = "counter ASC";
if ($orderby == "HitsD")         $orderbySQL = "counter DESC";
if ($orderby == "DateA")         $orderbySQL = "date ASC";
if ($orderby == "DateD")         $orderbySQL = "date DESC";
if ($orderby == "ScoreA")         $orderbySQL = "score ASC";
if ($orderby == "ScoreD")         $orderbySQL = "score DESC";
if ($orderby == "")               $orderbySQL = "pagename";

$from = (($page * $max_results) - $max_results);
    $sql = "select * from ".$prefix."_MReviews where cid='$row[cid]' ORDER BY $orderbySQL  limit $from, $max_results";
    $result2 = $db->sql_query($sql);
    while($row2 = $db->sql_fetchrow($result2)) {

$sub_titlesql = "select sub_title from ".$prefix."_MReviews_sub_cats where scid='$row2[scid]'";
$sub_titleresult3 = $db->sql_query($sub_titlesql);
$sub_titlerow = $db->sql_fetchrow($sub_titleresult3);

$date = $row2["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));

    $arrow = "<img src='modules/Topics/images/arrow.gif' border='0' alt='' title=''>&nbsp;&nbsp;";
    $score = "$row2[score]";
echo "<tr>\n
<td width=35% bgcolor=\"$bgcolor1\">$arrow<a href=\"modules.php?name=MReviews&op=show&rid=$row2[rid]\">$row2[pagename]</A></td>\n
<td width=20% bgcolor=\"$bgcolor1\"><a href=\"mailto:$row2[author_email]\">$row2[author]</A></td>\n
<td width=17% bgcolor=\"$bgcolor1\">$fdate</td>\n
<td width=17% bgcolor=\"$bgcolor1\">$sub_titlerow[sub_title]</td>\n
<td width=8% bgcolor=\"$bgcolor1\">";
display_score($score);
echo "</td>\n
<td bgcolor=\"$bgcolor1\" width=5%>$row2[counter]</td>";
if (is_admin($admin)) {
echo "<td bgcolor=\"$bgcolor1\" width=10%><a href=\"admin.php?op=modMRevpage&rid=$row2[rid]\">E</a> | <a href=\"admin.php?op=delMRevconfirm&rid=$row2[rid]\">D</a></td>\n";
}

echo "</tr>";

}
echo "</td></tr></table><br>";
// Figure out the total number of results in DB:
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM ".$prefix."_MReviews where cid='$cid'"),0);

// Figure out the total number of pages. Always round up using ceil()
$total_pages = ceil($total_results / $max_results);

// Build Page Number Hyperlinks
echo "<center>Select a Page<br />";

// Build Previous Link
if($page > 1){
    $prev = ($page - 1);
    echo "« <a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&page=$prev\">Previous</a>&nbsp;|&nbsp;";
}

for($i = 1; $i <= $total_pages; $i++){
    if(($page) == $i){
        echo "$i&nbsp;|&nbsp;";
        } else {
            echo "<a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=$orderby&page=$i\">$i</a>&nbsp;|&nbsp;";
    }
}

// Build Next Link
if($page < $total_pages){
    $next = ($page + 1);
    echo "<a href=\"modules.php?name=MReviews&op=list_revs&cid=$cid&orderby=$orderby&page=$next\">Next</a> »";
}
echo "</center>";

CloseTable();
}


function show($rid, $cid, $page) {
global $prefix, $db, $admin, $prefix, $ReviewsImagesUrl;
OpenTable();
$sql = "SELECT * FROM ".$prefix."_MReviews WHERE rid='$rid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);

$sql = "select * from ".$prefix."_MReviews_cats where cid='$row[cid]'";
$result2 = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result2);

$sql = "select * from ".$prefix."_MReviews_sub_cats where scid='$row[scid]'";
$result3 = $db->sql_query($sql);
$row3 = $db->sql_fetchrow($result3);


$date = $row["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));
$score = $row["score"];
$content = $row["content"];
$content = nl2br($content);
    $contentpages = explode( "<!--pagebreak-->", $content );
    $pageno = count($contentpages);
    if ( $page=="" || $page < 1 )
   $page = 1;
    if ( $page > $pageno )
   $page = $pageno;
    $arrayelement = (int)$page;
    $arrayelement --;
echo "<font class=title>
<i>$row[pagename]</i><br>\n</font>";

echo "<Br>";
echo "<blockquote><p align=justify>";
if ($row[cover] != "")
echo "<img src=\"$ReviewsImagesUrl/$row[cover]\" align=\"right\" border=1 vspace=\"2\" alt=\"\">";
echo "$contentpages[$arrayelement]";
echo "</blockquote></p>";
echo "<br><Br>";
echo "<hr>";
echo "<font class=gensmall>";
if (is_admin($admin))
echo "<b>Admin:</b> <a href=\"admin.php?op=modMRevpage&rid=$rid\">Edit</a> | <a href=\"admin.php?op=delMRevconfirm&rid=$rid\">Delete</a><br>";
echo "<b>"._SORTTITLE.":</b> $row[pagename]<br>\n
<b>"._CATEGORY.":</b> <a href=\"modules.php?name=MReviews&op=list_revs&cid=$row2[cid]\">$row2[title]</a></b><br>\n
<b>"._SUBCATEGORY.":</b> <a href=\"modules.php?name=MReviews&op=list_revs&cid=$row2[cid]&orderby=sub_catA\">$row3[sub_title]</a></b><br>\n
<b>"._AUTHOR.":</b> <a href=\"mailto:$row[author_email]\">$row[author]</a><br>\n";
if ($row[r_link] != "")
echo "<b>"._RELATEDLINK.":</b> <a href=\"$row[r_link]\">$row[r_link_title]</a><br>\n";
echo "<b>"._ADDED.":</b> $fdate<br>\n
<b>"._HITS.":</b> $row[counter] Times<br>\n
<b>"._SCORE.":</b>"; display_score($score);
    if ($pageno > 1) {
   echo "<br><b>"._PAGE.":</b> $page/$pageno<br>";
    }
echo "<br><b>"._OPTIONS.":</b> <a href=\"modules.php?name=MReviews&file=friend&op=FriendSend&rid=$rid\"><img src=\"images/friend.gif\" border=\"0\" alt=\""._SENDTOFRIEND."\" title=\""._SENDTOFRIEND."\" width=\"16\" height=\"11\"></a>\n&nbsp;<a href=\"modules.php?name=MReviews&file=print&op=PrintPage&rid=$rid\"><img src=\"images/print.gif\" border=\"0\" alt=\""._PRINTREVIEW."\" title=\""._PRINTREVIEW."\" width=\"16\" height=\"11\"></a>";
echo "<Br>";
echo "<center>";
    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=\"\"> &nbsp;&nbsp; ";
   }
   $next_page .= "<a href=\"modules.php?name=MReviews&op=show&rid=$rid&page=$next_pagenumber\">"._NEXT." ($next_pagenumber/$pageno)</a> <a href=\"modules.php?name=MReviews&op=show&rid=$rid&page=$next_pagenumber\"><img src=\"images/download/right.gif\" border=\"0\" alt=\""._NEXT."\"></a>";
    }
    if($page <= 1) {
   $previous_page = "";
    } else {
   $previous_pagenumber = $page - 1;
   $previous_page = "<a href=\"modules.php?name=MReviews&op=show&rid=$rid&page=$previous_pagenumber\"><img src=\"images/download/left.gif\" border=\"0\" alt=\""._PREVIOUS."\"></a> <a href=\"modules.php?name=MReviews&op=show&rid=$rid&page=$previous_pagenumber\">"._PREVIOUS." ($previous_pagenumber/$pageno)</a>";
    }
    echo "<center>"
   ."$previous_page &nbsp;&nbsp; $next_page<br><br>";

echo "[ <a href=\"modules.php?name=MReviews\">"._RBACK."</a> | "
."<a href=\"modules.php?name=MReviews&op=list_revs&cid=$row[cid]\">"._BACKTO." $row2[title] "._INDEX."</a> | "
."<a href=\"modules.php?name=MReviews&op=postcomment&rid=$rid\">"._REPLYMAIN."</a> ]";
echo "<br>";
CloseTable();
echo "<Br>";
   mr_comments($rid, $pagename);


$updatecounter = "UPDATE ".$prefix."_MReviews SET counter=counter+1 where rid='$rid'";
$db->sql_query($updatecounter);
}

function write_MReview() {
global $prefix, $AllowGuestsToPost, $admin, $db, $sitename, $user, $cookie, $user_prefix, $module_name;

if ($AllowGuestsToPost == 'yes') {
write_MReview_guests();
} elseif ($AllowGuestsToPost == 'no' && (is_user($user))) {
write_MReview_guests();
} else {
OpenTable();
      echo ""._GUESTCANTPOST."<br><br>"._GOBACK."";
CloseTable();
         }
}
function write_MReview_guests() {
global $prefix, $AllowGuestsToPost, $admin, $db, $sitename, $user, $cookie, $user_prefix, $module_name;
OpenTable();
echo "<form action=\"modules.php?name=MReviews\" method=POST>";
echo "<input type=\"hidden\" name=\"op\" value=\"preview_review\">";
echo "<font class=\"title\">"._WRITEREVIEWFOR." $sitename</font>";
echo "<br><br><i>"._ENTERINFO."</i><br>";
echo "<b>"._REVIEWNAME.":</b><br> <input type=\"text\" name=\"pagename\"><br><i>"._NAMEPRODUCT."</i><br><br>";
echo "<b>"._CATEGORY.":</b><br> <select name=\"cid\">";

$sql = "SELECT * FROM ".$prefix."_MReviews_cats";
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)) {

echo "<option value=\"$row[cid]\">$row[title]</option>";
}
echo "</select><br><i>"._PRODUCTCAT."<Br><br>";

echo "<b>"._SUBCATEGORY.":</b><br> <select name=\"scid\">";

$sql = "SELECT * FROM ".$prefix."_MReviews_sub_cats";
$result2 = $db->sql_query($sql);
while($row2 = $db->sql_fetchrow($result2)) {

echo "<option value=\"$row2[scid]\">$row2[sub_title]</option>";
}
echo "</select><br><i>"._PRODUCTSUBCAT."<Br><br>";

echo "    <b>"._YOURNAME.":</b><br>";

    if (is_user($user)) {
$sql = "select name, user_email from ".$user_prefix."_users where username='$cookie[1]'";
$result2 = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result2);
  }
    echo "<input type=\"text\" name=\"author\" size=\"41\" maxlength=\"40\" value=\"$row2[name]\"><br>
    <i>"._FULLNAMEREQ."</i><br><br>
    <b>"._REMAIL.":</b><br>
    <input type=\"text\" name=\"author_email\" size=\"40\" maxlength=\"80\" value=\"$row2[user_email]\"><br>
    <i>"._REMAILREQ."</i><br><br>";

echo "<b>"._REVIEW.":</b><br> <textarea name=\"MReview_content\" rows=\"15\" cols=\"60\" class=\"post\"></textarea><br><i>"._CHECKREVIEW."</i><br><br>";
echo"<b>"._SCORE.":</b>
    <select name=\"score\">
    <option name=\"score\" value=\"10\">10</option>
    <option name=\"score\" value=\"9\">9</option>
    <option name=\"score\" value=\"8\">8</option>
    <option name=\"score\" value=\"7\">7</option>
    <option name=\"score\" value=\"6\">6</option>
    <option name=\"score\" value=\"5\">5</option>
    <option name=\"score\" value=\"4\">4</option>
    <option name=\"score\" value=\"3\">3</option>
    <option name=\"score\" value=\"2\">2</option>
    <option name=\"score\" value=\"1\">1</option>
    </select><br>
    <i>"._SELECTSCORE."</i><br><br>";
    if (is_admin($admin)) {
echo "<b>"._COVERIMAGE.":</b><br> <input type=\"text\" name=\"cover\"><br>";
echo "<i>"._RIMAGEFILEREQ."</i><br><br>";
}
echo "<b>"._RLINK.":</b><br> <input type=\"text\" name=\"r_link\"><br>";
echo "<i>"._PRODUCTSITE."</i><br><br>";
echo "<b>"._RLINKTITLE."</b>:<br> <input type=\"text\" name=\"r_link_title\"><br>";
echo "<i>"._LINKTITLEREQ."</i><br><br>";
echo "<input type=\"submit\" value=\""._PREVIEW."\">";
echo "</form>";
CloseTable();
}



function send_MReview($cid, $scid, $author, $author_email, $pagename, $MReview_content, $cover, $r_link, $r_link_title, $score) {
global $prefix, $admin, $db, $sitename, $EditedMessage, $module_name, $EmailNotification, $adminmail;
    if (eregi("<!--pagebreak-->", $MReview_content)) {
   $MReview_content = ereg_replace("<!--pagebreak-->","&lt;!--pagebreak--&gt;;",$MReview_content);
    }

    if (eregi("\"", $pagename)) {
      $pagename = ereg_replace("\"","&quot;",$pagename);
    }
    if (eregi("\"", $author)) {
      $author = ereg_replace("\"","&quot;",$author);
    }
    if (eregi("\"", $r_link_title)) {
      $r_link_title = ereg_replace("\"","&quot;",$r_link_title);
    }
    if (eregi("\"", $MReview_content)) {
      $MReview_content = ereg_replace("\"","&quot;",$MReview_content);
    }
               $pagename = stripslashes(FixQuotes(check_html($pagename, "nohtml")));
            $MReview_content = stripslashes(FixQuotes($MReview_content, ""));
             $r_link_title = stripslashes(check_html($r_link_title, "nohtml"));


if (is_admin($admin)) {
$sql = "INSERT INTO ".$prefix."_MReviews( date, pagename, content, cover, cid, scid, author, author_email, r_link, r_link_title, score)
VALUES (now(), '$pagename', '$MReview_content', '$cover', '$cid', '$scid', '$author', '$author_email', '$r_link', '$r_link_title', '$score')";
$result = $db->sql_query($sql);
 } else {
 $sql = "INSERT INTO ".$prefix."_MReviews_pend( date, pagename, content, cid, scid, author, author_email, r_link, r_link_title, score)
 VALUES (now(), '$pagename', '$MReview_content', '$cid', '$scid', '$author', '$author_email', '$r_link', '$r_link_title', '$score')";
 $result = $db->sql_query($sql);
 }
    if (eregi("&lt;!--pagebreak--&gt;", $MReview_content)) {
   $MReview_content = ereg_replace("&lt;!--pagebreak--&gt;","<!--pagebreak-->",$MReview_content);
    }
OpenTable();
//Code to check if statement executed properly and display message
if ($result) {

$sql = "SELECT * FROM ".$prefix."_MReviews_cats where cid='$cid'";
$result2 = $db->sql_query($sql);
$row2 = $db->sql_fetchrow($result2);

$sql = "SELECT * FROM ".$prefix."_MReviews_sub_cats where scid='$scid'";
$result3 = $db->sql_query($sql);
$row3 = $db->sql_fetchrow($result3);

if (is_admin($admin)) {
echo(""._RTHANKSADMIN."");
} else {
echo(""._RTHANKS."");
}
if ($EmailNotification == "on") {
$sitemail = "$adminmail";
$Subject = "New Review Submitted";
$mailheader = "From: $author <$author_email>\r\n";
$mailheader .= "Reply-To: $author_email\r\n";
$mailbody .= "$author has submitted a review\r\n======================================================\r\nReview Name: $pagename\r\nCategory: $row2[title]\r\nGenera: $row2[sub_title]\r\n\r\n $MReview_content";
mail($sitemail, $subject, $mailbody, $mailheader);
}

} else {
echo "An error has occured<Br>";
echo mysql_error();
}
CloseTable();

}

function mr_comments($rid, $pagename) {
    global $prefix, $admin, $dbi, $module_name;
    $result = sql_query("select com_id, userid, date, comments, score from ".$prefix."_MReviews_comments where rid='$rid' ORDER BY date DESC", $dbi);
    while(list($com_id, $uname, $date, $comments, $score) = sql_fetch_row($result, $dbi)) {
   OpenTable();
   $pagename = urldecode($pagename);
   echo "
   <b>$pagename</b><br>";
   if ($uname == "Anonymous" OR $uname == "Stranger") {
       echo "Posted by: $uname on $date<br>";
   } else {
       echo "Posted by: <a href=\"userinfo-.html$uname\">$uname</a> on $date<br>";
   }
   echo "My Score: ";
   display_score($score);
   if (is_admin($admin)) {
       echo "<br><b>Admin:</b> [ <a href=\"modules.php?name=MReviews&op=del_comment&com_id=$com_id&rid=$rid\">Delete</a> ]</font><hr noshade size=1>";
   } else {
       echo "</font><hr>";
   }
   $comments = FixQuotes(nl2br(filter_text($comments)));
   echo "
   $comments
   ";
   CloseTable();
   echo "<br>";
    }
}

function reviews($letter, $field, $order, $cid) {
    global $bgcolor4, $border_color, $bgcolor3, $bgcolor2, $bgcolor1, $sitename, $prefix, $multilingual, $currentlang, $dbi, $db, $module_name;
OpenTable();

$sql = "SELECT * FROM ".$prefix."_MReviews_cats WHERE cid='$cid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);



    echo "<center><b>$sitename $row[title] "._REVIEWS."</b><br>";
    echo "<i>"._REVIEWSLETTER." \"$letter\"</i><br><br>";
    switch ($field) {

   case "author":
   $result = sql_query("SELECT scid, rid, pagename, counter, date, author, author_email, score FROM ".$prefix."_MReviews WHERE cid='$cid' && UPPER(pagename) LIKE '$letter%' $querylang ORDER by author $order", $dbi);
   break;

   case "score":
   $result = sql_query("SELECT scid, rid, pagename, counter, date, author, author_email, score FROM ".$prefix."_MReviews WHERE cid='$cid' && UPPER(pagename) LIKE '$letter%' $querylang ORDER by score $order", $dbi);
   break;

   case "counter":
   $result = sql_query("SELECT scid, rid, pagename, counter, date, author, author_email, score FROM ".$prefix."_MReviews WHERE cid='$cid' && UPPER(pagename) LIKE '$letter%' $querylang ORDER by counter $order", $dbi);
   break;

   default:
   $result = sql_query("SELECT scid, rid, pagename, counter, date, author, author_email, score FROM ".$prefix."_MReviews WHERE cid='$cid' && UPPER(pagename) LIKE '$letter%' $querylang ORDER by pagename $order", $dbi);
   break;
    }
    $numresults = sql_num_rows($result, $dbi);
    if ($numresults == 0) {
   echo "<i><b>"._NOREVIEWS." \"$letter\"</b></i><br><br>";
    } elseif ($numresults > 0) {

echo "<table bgcolor=\"$border_color\" name=TopReviews width=\"100%\" cellpadding=2 cellspacing=1>";
echo "<tr>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=35%><b>"._REVIEWSNAME."</b></td>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=20%><b>"._SUBCATEGORY."</b></td>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=20%><b>"._AUTHOR."</b></td>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=23%><b>"._DATE."</b></td>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=8%><b>"._SCORE."</b></td>
<td bgcolor=\"$bgcolor2\" align=center valign=top width=5%><b>"._HITS."</b></td>";
echo "</tr>";
   while($myrow = sql_fetch_array($result, $dbi)) {
       $pagename = $myrow["pagename"];
       $rid = $myrow["rid"];
       $scid = $myrow["scid"];
       $author = $myrow["author"];
       $author_email = $myrow["author_email"];
       $score = $myrow["score"];
       $counter = $myrow["counter"];
   $sql = "SELECT * FROM ".$prefix."_MReviews_sub_cats WHERE scid='$scid'";
   $result2 = $db->sql_query($sql);
   $row2 = $db->sql_fetchrow($result2);


$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));

echo "<tr>\n
<td width=35% bgcolor=\"$bgcolor1\">$arrow<a href=\"modules.php?name=MReviews&op=show&rid=$rid\">$pagename</A></td>\n
<td width=20% bgcolor=\"$bgcolor1\">$row2[sub_title]</td>\n
<td width=20% bgcolor=\"$bgcolor1\"><a href=\"mailto:$author_email\">$author</A></td>\n
<td width=17% bgcolor=\"$bgcolor1\">$fdate</td>\n
<td width=8% bgcolor=\"$bgcolor1\">";
display_score($score);
echo "</td>\n
<td bgcolor=\"$bgcolor1\" width=5%>$counter</td>";
echo "</tr>";
   }
   echo "</TABLE>";
   echo "<br>$numresults "._TOTALREVIEWS."<br><br>";
    }
    echo "[ <a href=\"modules.php?name=$module_name\">"._RETURN2MAIN."</a> | <a href=\"modules.php?name=$module_name&op=list_revs&cid=$cid\">"._BACKTO." $row[title] index</a> ]";
CloseTable();
}

function postcomment($rid, $pagename) {
    global $prefix, $user, $cookie, $AllowableHTML, $anonymous, $module_name, $db;
    cookiedecode($user);
$sql = "SELECT pagename FROM ".$prefix."_MReviews WHERE rid='$rid'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$row[pagename] = urldecode($row[pagename]);
    OpenTable();
    echo "<center><font class=option><b>"._REVIEWCOMMENT." $row[pagename]</b><br><br></font></center>"
   ."<form action=modules.php?name=$module_name method=post>";
    if (!is_user($user)) {
   echo "<b>"._YOURNICK.":</b> $anonymous [ "._RCREATEACCOUNT." ]<br><br>";
   $uname = $anonymous;
    } else {
   echo "<b>"._YOURNICK.":</b> $cookie[1]<br>
   <input type=checkbox name=xanonpost> "._POSTANON."<br><br>";
   $uname = $cookie[1];
    }
    echo "
    <input type=hidden name=uname value=$uname>
    <input type=hidden name=rid value=$rid>
    <b>"._SCORE."</b>
    <select name=score>
    <option name=score value=10>10</option>
    <option name=score value=9>9</option>
    <option name=score value=8>8</option>
    <option name=score value=7>7</option>
    <option name=score value=6>6</option>
    <option name=score value=5>5</option>
    <option name=score value=4>4</option>
    <option name=score value=3>3</option>
    <option name=score value=2>2</option>
    <option name=score value=1>1</option>
    </select><br><br>
    <b>"._YOURCOMMENT.":</b><br>
    <textarea name=comments rows=10 cols=70></textarea><br>
    "._ALLOWEDHTML.":<br>";
    while (list($key,)= each($AllowableHTML)) echo " &lt;".$key."&gt;";
    echo "<br><br>
    <input type=hidden name=op value=savecomment>
    <input type=submit value=Submit>
    </form>
    ";
    CloseTable();
}

function savecomment($xanonpost, $uname, $rid, $score, $comments) {
    global $prefix, $anonymous, $user, $cookie, $dbi, $module_name;
    if ($xanonpost) {
   $uname = $anonymous;
    }
    $comments = stripslashes(FixQuotes(check_html($comments)));
    sql_query("insert into ".$prefix."_MReviews_comments values (NULL, '$rid', '$uname', now(), '$comments', '$score')", $dbi);
    Header("Location: modules.php?name=$module_name&op=show&rid=$rid");
}

function del_comment($com_id, $rid) {
    global $prefix, $admin, $dbi, $module_name;
    if (is_admin($admin)) {
        sql_query("delete from ".$prefix."_MReviews_comments where com_id='$com_id'", $dbi);
        Header("Location: modules.php?name=$module_name&op=show&rid=$rid");
    } else {
        echo "ACCESS DENIED";
    }
}

switch($op) {

   case "A":
   reviews(A, $field, $order, $cid, $scid);
   break;

   case "B":
   reviews(B, $field, $order, $cid, $scid);
   break;

   case "C":
   reviews(C, $field, $order, $cid, $scid);
   break;

   case "D":
   reviews(D, $field, $order, $cid, $scid);
   break;

   case "E":
   reviews(E, $field, $order, $cid, $scid);
   break;

   case "F":
   reviews(F, $field, $order, $cid, $scid);
   break;

   case "G":
   reviews(G, $field, $order, $cid, $scid);
   break;

   case "H":
   reviews(H, $field, $order, $cid, $scid);
   break;

   case "I":
   reviews(I, $field, $order, $cid, $scid);
   break;

   case "J":
   reviews(J, $field, $order, $cid, $scid);
   break;

   case "K":
   reviews(K, $field, $order, $cid, $scid);
   break;

   case "L":
   reviews(L, $field, $order, $cid, $scid);
   break;

   case "M":
   reviews(M, $field, $order, $cid, $scid);
   break;

   case "N":
   reviews(N, $field, $order, $cid, $scid);
   break;

   case "O":
   reviews(O, $field, $order, $cid, $scid);
   break;

   case "P":
   reviews(P, $field, $order, $cid, $scid);
   break;

   case "Q":
   reviews(Q, $field, $order, $cid, $scid);
   break;

   case "R":
   reviews(R, $field, $order, $cid, $scid);
   break;

   case "S":
   reviews(S, $field, $order, $cid, $scid);
   break;

   case "T":
   reviews(T, $field, $order, $cid, $scid);
   break;

   case "U":
   reviews(U, $field, $order, $cid, $scid);
   break;

   case "V":
   reviews(V, $field, $order, $cid, $scid);
   break;

   case "W":
   reviews(W, $field, $order, $cid, $scid);
   break;

   case "X":
   reviews(X, $field, $order, $cid, $scid);
   break;

   case "Y":
   reviews(Y, $field, $order, $cid, $scid);
   break;

   case "Z":
   reviews(Z, $field, $order, $cid, $scid);
   break;

   case "1":
   reviews(1, $field, $order, $cid, $scid);
   break;

   case "2":
   reviews(2, $field, $order, $cid, $scid);
   break;

   case "3":
   reviews(3, $field, $order, $cid, $scid);
   break;

   case "4":
   reviews(4, $field, $order, $cid, $scid);
   break;

   case "5":
   reviews(5, $field, $order, $cid, $scid);
   break;

   case "6":
   reviews(6, $field, $order, $cid, $scid);
   break;

   case "7":
   reviews(7, $field, $order, $cid, $scid);
   break;

   case "8":
   reviews(8, $field, $order, $cid, $scid);
   break;

   case "9":
   reviews(9, $field, $order, $cid, $scid);
   break;

    case "show":
    show($rid, $cid, $scid, $page, $author, $author_email, $cover, $pagename, $content, $counter, $r_link, $r_link_title, $score);
    break;

    case "show_cats":
   show_cats();
    break;

    case "list_revs":
   list_revs($cid, $scid, $orderby, $page);
    break;

    case "write_MReview":
    write_MReview();
    break;

    case "preview_review":
   preview_review($date, $pagename, $MReview_content, $author, $author_email, $score, $cover, $r_link, $r_link_title, $counter, $rid, $cid, $scid);
   break;

    case "send_MReview":
    send_MReview($cid, $scid, $author, $author_email, $pagename, $MReview_content, $cover, $r_link, $r_link_title, $score);
    break;

   case "postcomment":
   postcomment($rid, $pagename);
   break;

   case "savecomment":
   savecomment($xanonpost, $uname, $rid, $score, $comments);
   break;

   case "del_comment":
   del_comment($com_id, $rid);
   break;

    default:
    show_cats();
    break;


}

include ("footer.php");
?>
 
kguske







PostPosted: Thu Sep 22, 2005 7:13 pm Reply with quote

Check your installation instructions. There is a customization area in this - it appears that you need to specify a value for this setting:
Code:
$ReviewsImagesUrl  ="/";

It stores the value of that field in front of any images you load (the code refers to the image as a cover, but without the language file, I can't tell you exactly how it's described when you view it).

It should have allowed you to use something like images/powered/powered8.jpg (without any quotes) as your cover image, unless you are using a subdirectory or a subdomain for your root Nuke directory other than [ Only registered users can see links on this board! Get registered or login! ]
 
nuevonuke







PostPosted: Fri Sep 23, 2005 1:42 am Reply with quote

Hello, in the language file
_COVERIMAGE is the $ReviewsImagesUrl ="/";

There aren´t any problem with this: I put the url image and appears correctly. It don´t force double quotes, and in other modules work corectly too.

The problem is when I put the image in the form text with html code only in MReviews.
 
nuevonuke







PostPosted: Fri Sep 23, 2005 3:27 pm Reply with quote

Can anything help me!

Thank´s
 
kguske







PostPosted: Fri Sep 23, 2005 5:15 pm Reply with quote

I haven't seen anything in the code that would cause this. But I will do some testing to see if I can duplicate it.
 
kguske







PostPosted: Fri Sep 23, 2005 7:15 pm Reply with quote

This is an old copy of mReviews. Any reason for not upgrading to the 2.0 version?
 
kguske







PostPosted: Fri Sep 23, 2005 8:49 pm Reply with quote

Can't reproduce the problem. I used the unmodified MReviews version and the version you posted. I did not try the MReviews 2.0 version.

As instructed by the MReviews, I used single quotes in the HTML
Code:
<img src='images/myimage.jpg'>

It must be a PHP.ini setting - what is magic_quotes set to on your host? If you're not sure, insert this before the switch statement near the bottom of modules/MReviews/index.php:
Code:
function get_magic_quotes_sybase() { if (!ini_get('magic_quotes_sybase')) { return 0; } else { return 1; } }

echo 'magic_quotes_runtime = ' . get_magic_quotes_runtime() . "<br/>\n";
echo 'magic_quotes_gpc = ' . get_magic_quotes_gpc() . "<br/>\n";
echo 'magic_quotes_sybase = ' . get_magic_quotes_sybase() . "<br/>\n";
 
nuevonuke







PostPosted: Sat Sep 24, 2005 2:14 am Reply with quote

Hi, I have the lastest version 2.0
I´ll reinstall mReviews.

If it were an adjustment of PHP.ini it would happen in all the modules but single it happens in MReviews
 
kguske







PostPosted: Sat Sep 24, 2005 7:48 am Reply with quote

mReviews handles content differently than other modules which is why it recommends that you use single quotes in HTML. Other modules don't require that. I tested both the unmodified mReviews and your version, which was almost identical. Both worked as long as I put a single quote. If you check the ini settings, at least we can rule that out...
 
nuevonuke







PostPosted: Sat Sep 24, 2005 7:52 am Reply with quote

Where encounter the INI settings?
 
kguske







PostPosted: Sat Sep 24, 2005 7:56 am Reply with quote

In a previous post, I listed the code that you can add to show the 3 relevant ini settings.

Another option is to create a simple PHP script called phpinfo.php or info.php, for example, with the code below that can be used to display your ini settings.
Code:
<?php phpinfo(); ?>


Finally, some webhosts provide a function to display the ini settings in your control panel.
 
nuevonuke







PostPosted: Sat Sep 24, 2005 10:44 am Reply with quote

You can view my ini settings here


Last edited by nuevonuke on Sat Sep 24, 2005 11:06 am; edited 1 time in total 
kguske







PostPosted: Sat Sep 24, 2005 10:57 am Reply with quote

For your own security, please remove the file asap. It contains information that script kiddies can use to attack your site.

As I suspected, the magic_quotes_gpc is on. Since that cannot be set at run time, you will either need to create a local php.ini file (not recommended) or request that your host change this setting (magic_quotes_gpc) to off.
 
nuevonuke







PostPosted: Sat Sep 24, 2005 11:14 am Reply with quote

OK! thanks four your recomendation. I removed the info.php.

My doubt is that if this function would not have to affect all modules. So that it affects single MReviews, Why?. Is it possible correct this problem from index.php of MReviews. I if you are so kind , as is the function of magic_quotes_gpc?

Thank´s
 
kguske







PostPosted: Sat Sep 24, 2005 8:07 pm Reply with quote

Try commenting out this line - around line 711 - (I added the # to show how to comment it out) in function send_MReview in the modules/MReviews/index.php file:
Code:
#      $MReview_content = ereg_replace("\"","&quot;",$MReview_content);

I'm guessing, but I think this, combined with something TinyMCE is doing to your link, is causing the problem - and why it only appears in this module.
This line also appears in function preview_review, but you shouldn't need to comment that out.
 
nuevonuke







PostPosted: Mon Sep 26, 2005 3:05 pm Reply with quote

Thank you very much.

It works!!!!! has cost to solve it to me.

greetings
 
kguske







PostPosted: Mon Sep 26, 2005 3:32 pm Reply with quote

Great! It was driving me nuts too...
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©