Author |
Message |
pan
Involved


Joined: Jul 25, 2006
Posts: 354
|
Posted:
Tue Apr 14, 2009 4:40 pm |
|
nuken wrote: | if you could paste your cat.php file from the mreviews module, we might be able to see where the issue is. |
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
/* mreviews - Advanced */
/* 2008 Salman */
/* Sites: */
/* - http://www.dacoolsite.com */
/* - http://www.thalassemia.com.pk */
/************************************************************************/
if (!defined('MODULE_FILE')) {
die('You can\'t access this file directly...');
}
if (stristr($_SERVER['QUERY_STRING'], '%25')) header('Location: index.php');
require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
require_once("modules/$module_name/MFunctions.php");
$pagetitle = "- "._MREVIEWS."";
include("header.php");
// The Title Line shows: "TFPak.Com - Reviews"
title("$sitename "._MREVIEWS."");
if($_GET['page']) $page = $_GET['page'];
else $page = 0;
$rows_per_page = 10;
/**
* Showing category front
* REQUIRES CATEGORY ID
*/
function index($id) {
global $bgcolor4, $bgcolor3, $bgcolor2, $bgcolor1, $prefix, $multilingual, $currentlang, $db, $module_name, $page, $rows_per_page;
/**
* MULTILINGUAL HMM, LET'S LEAVE IT HERE
* SO I DON'T FORGET TO ADD IT IN FUTURE VERSIONS IF REQURIED :P
*/
if ($multilingual == 1) {
$querylang = "WHERE rlanguage='$currentlang'";
} else {
$querylang = "";
}
/**
* WE DONT HAVE THE CATEGORY ID OMG OMG
* LETS SHOW THE ERROR PAGE
*/
if(!$id) {
revhead("<a href='modules.php?name=$module_name'>Top</a> → "._MERROR."");
OpenTable();
echo ""._MCATID_NOT_FOUND_ERROR."";
CloseTable();
} else {
/**
* YAY WE HAVE THE ID
* LETS SHOW REVIEW HEAD WITH BREADCRUMBS TO THIS LOCATION
*/
revhead("PATH", $id);
/**
* Let's get all childs of this particular category
* so that we can use it later for stats silly ;d
*/
$all_kids = getall_childs($id);
$tdcount=1;
$result = $db->sql_query("select cid, title from ".$prefix."_mreviews_cats where pid='$id'");
$numcats = $db->sql_numrows($result);
/**
* WE HAVE SOME SUBCATEGORIES IN THIS CATEGORY, LIST THEM.
*/
if($numcats != 0) {
OpenTable();
echo "<table width=100% cellspacing=0 cellpadding=0>
<tr>";
while(list($cid, $title) = $db->sql_fetchrow($result)) {
echo "<td width=33% valign=top>
<table cellspacing=3 cellpadding=2>
<tr><td><img src='images/$module_name/arrow.gif'></td>
<td><a href='modules.php?name=$module_name&file=cat&id=$cid'><font class='storycat'>$title</font></a></td>
</tr>
</table>
</td>";
if($tdcount==3) {
$tdcount=1;
echo "</tr>
<tr><td colspan=2 height=10></td></tr>
<tr>";
} else {
$tdcount++;
}
}
echo " </table>";
CloseTable();
}
/**
* LETS LOOK FOR REVIEWS
* CHECKING HOW MANY REVIEWS WE ACTUALLY HAVE IN THIS CATEGORY
*/
$revresult = $db->sql_query("select rid from ".$prefix."_mreviews where cid='$id' && rpid='0'");
$numrevs = $db->sql_numrows($revresult);
/**
* LISTING REVIEWS IN THIS CATEGORY
* STARTS BELOW
* */
if($numrevs != 0) {
$limit = 'LIMIT ' .$page .',' .$rows_per_page;
$revresult = $db->sql_query("select * from ".$prefix."_mreviews where cid='$id' && rpid='0' ORDER BY rid DESC $limit");
OpenTable();
echo "<center>";
revtitle(""._MLISTING." "._MREVIEWS."");
echo "</center><br>";
echo "<table width=100% cellspacing=1 cellpadding=5 bgcolor=$bgcolor2>
<tr bgcolor=$bgcolor2>
<td valign=top>
<font color=$bgcolor3><b>"._MTITLE."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MREVIEWER."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MRANKING."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MREADS."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MSUBMITTEDON."</b></font>
</td>
</tr>";
$trcount = 1;
while(list($rid, $cid, $author, $author_email, $pagename, $content, $r_link, $r_link_title, $score, $num_votes, $counter, $date) = $db->sql_fetchrow($revresult)) {
if($trcount==1) {
$rowcolor = $bgcolor1;
$trcount=2;
} elseif ($trcount==2) {
$rowcolor = $bgcolor3;
$trcount=1;
}
echo " <tr bgcolor=$rowcolor>
<td valign=top>
<a href='modules.php?name=$module_name&file=rev&id=$rid'>$pagename</a>
</td>
<td valign=top>
<a href='mailto:$author_email'>$author</a>
</td>
<td valign=top>
$score
</td>
<td valign=top>
$counter
</td>
<td valign=top>
$date
</td>
</tr>";
}
echo "</table>";
if($numrevs > $rows_per_page) {
echo "<div class='pagination'><b>Page:</b> ";
$p = $page;
if($p == 0) $send_p = 0;
else $send_p = $p/$rows_per_page;
$paginationArray = generatePagination($send_p, $numrevs, $rows_per_page);
foreach($paginationArray as $page) {
$page2 = $page-1;
if($page == "0") {
} elseif($page == "a") {
echo "..."; // print an elipse, representing pages that arent displayed
} else {
if($p != 0) $p2 = ($p/$rows_per_page); else $p2 = $p;
if($page2 == $p2 OR ($page2==0 AND $p==1)) echo "<span class='current'><b>$page</b></span>";
else {
echo "<a href='modules.php?name=$module_name&file=cat&id=$id&page=".($page2*$rows_per_page)."'>$page</a>";
}
}
echo " "; // space the pages
}
echo "</div>";
}
CloseTable();
}
/**
* LISTING REVIEWS IN THIS CATEGORY
* ENDS ABOVE
*
* SO WE DONT HAVE REVIEWS IN THIS CATEGORY WHAT NOW?
* Oh yeah let's show some stats and requests if available
* STARTS BELOW
* */
else {
/**
* RECENT 10 AND POPULAR 10 TABLES TO BE SHOWN HERE
* BUT SINCE WE KNOW THIS CATEGORY HAS NO REVIEWS
* SO WE WILL CHECK IF IT HAS SOME SUB-CATEGORIES
* WHICH MIGHT HAVE SOME REVIEWS TO USE WITH STATS
* */
if($all_kids) {
$result_pop = $db->sql_query('SELECT cid, rid, pagename, counter FROM ' . $prefix . '_mreviews WHERE cid IN ('.$all_kids.') ORDER BY counter DESC LIMIT 10');
$num_pop = $db->sql_numrows($result_pop);
$result_rec = $db->sql_query('SELECT cid, rid, pagename, date, counter FROM ' . $prefix . '_mreviews WHERE cid IN ('.$all_kids.') ORDER BY date,rid DESC LIMIT 10');
$num_rec = $db->sql_numrows($result_rec);
if($num_pop || $num_rec) {
OpenTable();
echo '<table width=100% cellspacing=1 cellpadding=5 bgcolor='.$bgcolor2.'>';
echo '<tr><td width="50%" bgcolor="' . $bgcolor2 . '"><font color=$bgcolor3><b>' . _10MOSTPOP . '</b></font></td>';
echo '<td width="50%" bgcolor="' . $bgcolor2 . '"><font color=$bgcolor3><b>' . _10MOSTREC . '</b></font></td></tr>';
$y = 1;
/*
* montego:0000763 - check_html was already done prior to adding to the DB and will end up stripping slashes again!
* check_html() is really not necessary coming out of the DB. If SQL injection is possible from another poorly coded
* module, then there will be much bigger problems than doing no checks here!
*/
for ($x = 0;$x < 10;$x++) {
$myrow = $db->sql_fetchrow($result_pop);
list($CatName) = $db->sql_fetchrow($db->sql_query("select title from ".$prefix."_mreviews_cats where cid='$myrow[cid]'"));
$rid = intval($myrow['rid']);
$pagename = $myrow['pagename'];
$counter = intval($myrow['counter']);
echo '<tr><td width="50%" bgcolor="' . $bgcolor3 . '">' . $y . ') <a href="modules.php?name=' . $module_name . '&file=rev&rid=' . $rid . '">' . $pagename . '</a> <b>'._MIN.'</b> <a href="modules.php?name='.$module_name.'&file=cat&id='.$cid.'">'.$CatName.'</a></td>';
$myrow2 = $db->sql_fetchrow($result_rec);
$rid = intval($myrow2['rid']);
$pagename = $myrow2['pagename'];
$counter = intval($myrow2['counter']);
echo '<td width="50%" bgcolor="' . $bgcolor3 . '">' . $y . ') <a href="modules.php?name=' . $module_name . '&file=rev&rid=' . $rid . '">' . $pagename . '</a> <b>'._MIN.'</b> <a href="modules.php?name='.$module_name.'&file=cat&id='.$cid.'">'.$CatName.'</a></td></tr>';
$y++;
}
echo '</table>';
CloseTable();
}
/**
* SHOW REQUESTS IN THIS CATEGORY OR ANY CHILD CATEGORY
* STARTS BELOW
* */
$revresult = $db->sql_query("select * from ".$prefix."_mreviews_requests where cid IN ($all_kids) && active='1'");
$numrevs = $db->sql_numrows($revresult);
if($numrevs) {
OpenTable();
echo "<center>";
revtitle(""._MLISTING." "._MREQUESTS."");
echo "</center><br>";
echo "<table width=100% cellspacing=1 cellpadding=5 bgcolor=$bgcolor2>
<tr bgcolor=$bgcolor2>
<td valign=top>
<font color=$bgcolor3><b>"._MTITLE."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MDESCRIPTION."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MREVIEWEXISTS."</b></font>
</td>
</tr>";
$trcount = 1;
while(list($reqid, $cid, $pagename, $description, $rpid, $person_name, $person_email) = $db->sql_fetchrow($revresult)) {
if($trcount==1) {
$rowcolor = $bgcolor1;
$trcount=2;
} elseif ($trcount==2) {
$rowcolor = $bgcolor3;
$trcount=1;
}
if($rpid != 0) {
$revex = ""._MYES.", <a href='modules.php?name=$module_name&file=write&cid=$cid&request=$reqid&rpid=$rpid'>"._MWRITENEW."";
} else{
$revex = ""._MNO.", <a href='modules.php?name=$module_name&file=write&cid=$cid&request=$reqid'>"._MWRITEFIRST."";
}
echo "<tr bgcolor=$rowcolor>
<td valign=top width=150>
<a href='modules.php?name=$module_name&file=write&id=$cid&request=$reqid'>$pagename</a>
</td>
<td valign=top>
$description
</td>
<td valign=top width=150>
$revex
</td>
</tr>";
}
echo "</table>";
CloseTable();
}
/**
* SHOW REQUESTS IN THIS CATEGORY OR ANY CHILD CATEGORY
* ENDS ABOVE
* */
}
/**
* IF THIS CATEGORY HAS KIDS ENDS ABOVE
* IF We don't have any categories and reviews, show the sorry message. *boohoo*
* */
if(!eregi(",", $all_kids)) {
OpenTable();
echo _MWRITEFIRSTNOTE;
CloseTable();
}
}
/*
* SO WE DONT HAVE REVIEWS IN THIS CATEGORY WHAT NOW?
* Oh yeah let's show some stats and requests if available
* ENDS ABOVE
* */
}
/**
* THE PART WHERE WE HAD NO CATEGORY ID, REMEMBER?
* WELL IT END'S ABOVE hah
*/
}
switch($op) {
default:
index($id);
break;
}
include("footer.php");
?>
|
|
|
|
|
 |
pan

|
Posted:
Thu Apr 23, 2009 4:59 pm |
|
|
|
 |
nuken
RavenNuke(tm) Development Team

Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina
|
Posted:
Thu Apr 23, 2009 5:14 pm |
|
No RavenNuke(tm) footer on your site yet. |
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
 |
pan

|
Posted:
Thu Apr 23, 2009 7:06 pm |
|
It's there; and I told you I was having issues with changing the footer.
Not to mention I havn't been able to access the internet for over a week preventing me from attending to it..........
Now, anything? |
|
|
|
 |
nuken

|
Posted:
Thu Apr 23, 2009 7:26 pm |
|
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
/* mreviews - Advanced */
/* 2008 Salman */
/* Sites: */
/* - http://www.dacoolsite.com */
/* - http://www.thalassemia.com.pk */
/************************************************************************/
if (!defined('MODULE_FILE')) {
die('You can\'t access this file directly...');
}
if (stristr($_SERVER['QUERY_STRING'], '%25')) header('Location: index.php');
require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
require_once("modules/$module_name/MFunctions.php");
$pagetitle = "- "._MREVIEWS."";
include("header.php");
// The Title Line shows: "TFPak.Com - Reviews"
title("$sitename "._MREVIEWS."");
if($_GET['page']) $page = $_GET['page'];
else $page = 0;
$rows_per_page = 10;
/**
* Showing category front
* REQUIRES CATEGORY ID
*/
function index($id) {
global $bgcolor4, $bgcolor3, $bgcolor2, $bgcolor1, $prefix, $multilingual, $currentlang, $db, $module_name, $page, $rows_per_page;
/**
* MULTILINGUAL HMM, LET'S LEAVE IT HERE
* SO I DON'T FORGET TO ADD IT IN FUTURE VERSIONS IF REQURIED :P
*/
if ($multilingual == 1) {
$querylang = "WHERE rlanguage='$currentlang'";
} else {
$querylang = "";
}
/**
* WE DONT HAVE THE CATEGORY ID OMG OMG
* LETS SHOW THE ERROR PAGE
*/
if(!$id) {
revhead("<a href='modules.php?name=$module_name'>Top</a> → "._MERROR."");
OpenTable();
echo ""._MCATID_NOT_FOUND_ERROR."";
CloseTable();
} else {
/**
* YAY WE HAVE THE ID
* LETS SHOW REVIEW HEAD WITH BREADCRUMBS TO THIS LOCATION
*/
revhead("PATH", $id);
/**
* Let's get all childs of this particular category
* so that we can use it later for stats silly ;d
*/
$all_kids = getall_childs($id);
$tdcount=1;
$result = $db->sql_query("select cid, title from ".$prefix."_mreviews_cats where pid='$id'");
$numcats = $db->sql_numrows($result);
/**
* WE HAVE SOME SUBCATEGORIES IN THIS CATEGORY, LIST THEM.
*/
if($numcats != 0) {
OpenTable();
echo "<table width=100% cellspacing=0 cellpadding=0>
<tr>";
while(list($cid, $title) = $db->sql_fetchrow($result)) {
echo "<td width=33% valign=top>
<table cellspacing=3 cellpadding=2>
<tr><td><img src='images/$module_name/arrow.gif'></td>
<td><a href='modules.php?name=$module_name&file=cat&id=$cid'><font class='storycat'>$title</font></a></td>
</tr>
</table>
</td>";
if($tdcount==3) {
$tdcount=1;
echo "</tr>
<tr><td colspan=2 height=10></td></tr>
<tr>";
} else {
$tdcount++;
}
}
echo " </table>";
CloseTable();
}
/**
* LETS LOOK FOR REVIEWS
* CHECKING HOW MANY REVIEWS WE ACTUALLY HAVE IN THIS CATEGORY
*/
$revresult = $db->sql_query("select rid from ".$prefix."_mreviews where cid='$id' && rpid='0'");
$numrevs = $db->sql_numrows($revresult);
/**
* LISTING REVIEWS IN THIS CATEGORY
* STARTS BELOW
* */
if($numrevs != 0) {
$limit = 'LIMIT ' .$page .',' .$rows_per_page;
$revresult = $db->sql_query("select * from ".$prefix."_mreviews where cid='$id' && rpid='0' ORDER BY rid DESC $limit");
OpenTable();
echo "<center>";
revtitle(""._MLISTING." "._MREVIEWS."");
echo "</center><br>";
echo "<table width=100% cellspacing=1 cellpadding=5 bgcolor=$bgcolor2>
<tr bgcolor=$bgcolor2>
<td valign=top>
<font color=$bgcolor3><b>"._MTITLE."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MREVIEWER."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MRANKING."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MREADS."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MSUBMITTEDON."</b></font>
</td>
</tr>";
$trcount = 1;
while(list($rid, $cid, $author, $author_email, $pagename, $content, $r_link, $r_link_title, $score, $num_votes, $counter, $date) = $db->sql_fetchrow($revresult)) {
if($trcount==1) {
$rowcolor = $bgcolor1;
$trcount=2;
} elseif ($trcount==2) {
$rowcolor = $bgcolor3;
$trcount=1;
}
echo " <tr bgcolor=$rowcolor>
<td valign=top>
<a href='modules.php?name=$module_name&file=rev&id=$rid'>$pagename</a>
</td>
<td valign=top>
<a href='mailto:$author_email'>$author</a>
</td>
<td valign=top>
$score
</td>
<td valign=top>
$counter
</td>
<td valign=top>
$date
</td>
</tr>";
}
echo "</table>";
if($numrevs > $rows_per_page) {
echo "<div class='pagination'><b>Page:</b> ";
$p = $page;
if($p == 0) $send_p = 0;
else $send_p = $p/$rows_per_page;
$paginationArray = generatePagination($send_p, $numrevs, $rows_per_page);
foreach($paginationArray as $page) {
$page2 = $page-1;
if($page == "0") {
} elseif($page == "a") {
echo "..."; // print an elipse, representing pages that arent displayed
} else {
if($p != 0) $p2 = ($p/$rows_per_page); else $p2 = $p;
if($page2 == $p2 OR ($page2==0 AND $p==1)) echo "<span class='current'><b>$page</b></span>";
else {
echo "<a href='modules.php?name=$module_name&file=cat&id=$id&page=".($page2*$rows_per_page)."'>$page</a>";
}
}
echo " "; // space the pages
}
echo "</div>";
}
CloseTable();
}
/**
* LISTING REVIEWS IN THIS CATEGORY
* ENDS ABOVE
*
* SO WE DONT HAVE REVIEWS IN THIS CATEGORY WHAT NOW?
* Oh yeah let's show some stats and requests if available
* STARTS BELOW
* */
else {
/**
* RECENT 10 AND POPULAR 10 TABLES TO BE SHOWN HERE
* BUT SINCE WE KNOW THIS CATEGORY HAS NO REVIEWS
* SO WE WILL CHECK IF IT HAS SOME SUB-CATEGORIES
* WHICH MIGHT HAVE SOME REVIEWS TO USE WITH STATS
* */
if($all_kids) {
$result_pop = $db->sql_query('SELECT cid, rid, pagename, counter FROM ' . $prefix . '_mreviews WHERE cid IN ('.$all_kids.') ORDER BY counter DESC LIMIT 10');
$num_pop = $db->sql_numrows($result_pop);
$result_rec = $db->sql_query('SELECT cid, rid, pagename, date, counter FROM ' . $prefix . '_mreviews WHERE cid IN ('.$all_kids.') ORDER BY date,rid DESC LIMIT 10');
$num_rec = $db->sql_numrows($result_rec);
if($num_pop || $num_rec) {
OpenTable();
echo '<table width=100% cellspacing=1 cellpadding=5 bgcolor='.$bgcolor2.'>';
echo '<tr><td width="50%" bgcolor="' . $bgcolor2 . '"><font color=$bgcolor3><b>' . _10MOSTPOP . '</b></font></td>';
echo '<td width="50%" bgcolor="' . $bgcolor2 . '"><font color=$bgcolor3><b>' . _10MOSTREC . '</b></font></td></tr>';
$y = 1;
/*
* montego:0000763 - check_html was already done prior to adding to the DB and will end up stripping slashes again!
* check_html() is really not necessary coming out of the DB. If SQL injection is possible from another poorly coded
* module, then there will be much bigger problems than doing no checks here!
*/
for ($x = 0;$x < 10;$x++) {
$myrow = $db->sql_fetchrow($result_pop);
list($CatName) = $db->sql_fetchrow($db->sql_query("select title from ".$prefix."_mreviews_cats where cid='$myrow[cid]'"));
$rid = intval($myrow['rid']);
$pagename = $myrow['pagename'];
$counter = intval($myrow['counter']);
echo '<tr><td width="50%" bgcolor="' . $bgcolor3 . '">' . $y . ') <a href="modules.php?name=' . $module_name . '&file=rev&id=' . $rid . '">' . $pagename . '</a> <b>'._MIN.'</b><a href="modules.php?name='.$module_name.'&file=cat&id=' . $cid . '">'.$CatName.'</a></td>';
$myrow2 = $db->sql_fetchrow($result_rec);
$rid = intval($myrow2['rid']);
$pagename = $myrow2['pagename'];
$counter = intval($myrow2['counter']);
echo '<td width="50%" bgcolor="' . $bgcolor3 . '">' . $y . ') <a href="modules.php?name=' . $module_name . '&file=rev&id=' . $rid . '">' . $pagename . '</a> <b>'._MIN.'</b> <a href="modules.php?name='.$module_name.'&file=cat&id=' . $cid . '">'.$CatName.'</a></td></tr>';
$y++;
}
echo '</table>';
CloseTable();
}
/**
* SHOW REQUESTS IN THIS CATEGORY OR ANY CHILD CATEGORY
* STARTS BELOW
* */
$revresult = $db->sql_query("select * from ".$prefix."_mreviews_requests where cid IN ($all_kids) && active='1'");
$numrevs = $db->sql_numrows($revresult);
if($numrevs) {
OpenTable();
echo "<center>";
revtitle(""._MLISTING." "._MREQUESTS."");
echo "</center><br>";
echo "<table width=100% cellspacing=1 cellpadding=5 bgcolor=$bgcolor2>
<tr bgcolor=$bgcolor2>
<td valign=top>
<font color=$bgcolor3><b>"._MTITLE."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MDESCRIPTION."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MREVIEWEXISTS."</b></font>
</td>
</tr>";
$trcount = 1;
while(list($reqid, $cid, $pagename, $description, $rpid, $person_name, $person_email) = $db->sql_fetchrow($revresult)) {
if($trcount==1) {
$rowcolor = $bgcolor1;
$trcount=2;
} elseif ($trcount==2) {
$rowcolor = $bgcolor3;
$trcount=1;
}
if($rpid != 0) {
$revex = ""._MYES.", <a href='modules.php?name=$module_name&file=write&cid=$cid&request=$reqid&rpid=$rpid'>"._MWRITENEW."";
} else{
$revex = ""._MNO.", <a href='modules.php?name=$module_name&file=write&cid=$cid&request=$reqid'>"._MWRITEFIRST."";
}
echo "<tr bgcolor=$rowcolor>
<td valign=top width=150>
<a href='modules.php?name=$module_name&file=write&id=$cid&request=$reqid'>$pagename</a>
</td>
<td valign=top>
$description
</td>
<td valign=top width=150>
$revex
</td>
</tr>";
}
echo "</table>";
CloseTable();
}
/**
* SHOW REQUESTS IN THIS CATEGORY OR ANY CHILD CATEGORY
* ENDS ABOVE
* */
}
/**
* IF THIS CATEGORY HAS KIDS ENDS ABOVE
* IF We don't have any categories and reviews, show the sorry message. *boohoo*
* */
if(!eregi(",", $all_kids)) {
OpenTable();
echo _MWRITEFIRSTNOTE;
CloseTable();
}
}
/*
* SO WE DONT HAVE REVIEWS IN THIS CATEGORY WHAT NOW?
* Oh yeah let's show some stats and requests if available
* ENDS ABOVE
* */
}
/**
* THE PART WHERE WE HAD NO CATEGORY ID, REMEMBER?
* WELL IT END'S ABOVE hah
*/
}
switch($op) {
default:
index($id);
break;
}
include("footer.php");
?>
|
See if this cat.php doesn't fix at least some of the issue. If it does than we are in the right ball park. It should give you the correct review link 10 most stuff, I think there will still be an issue with the category link. |
|
|
|
 |
pan

|
Posted:
Thu Apr 23, 2009 8:43 pm |
|
Ok.
I'm not exactly sure what it fixed.
But there are a couple of issues:
* There is now no space between 'in' and the next word (being the category) in '10 most popular reviews' (the other (10 most recent reviews) has a space)
eg. 3) Story inCategory
And the:
Category ID not found.
Please go back
issue is still happening |
|
|
|
 |
nuken

|
Posted:
Fri Apr 24, 2009 5:39 am |
|
What it did was fix the broken link for the review in the 10 most popular and 10 most recent. This one should have the space and remove the cat link after the review.
Code:<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License. */
/************************************************************************/
/* Additional security & Abstraction layer conversion */
/* 2003 chatserv */
/* http://www.nukefixes.com -- http://www.nukeresources.com */
/************************************************************************/
/* mreviews - Advanced */
/* 2008 Salman */
/* Sites: */
/* - http://www.dacoolsite.com */
/* - http://www.thalassemia.com.pk */
/************************************************************************/
if (!defined('MODULE_FILE')) {
die('You can\'t access this file directly...');
}
if (stristr($_SERVER['QUERY_STRING'], '%25')) header('Location: index.php');
require_once('mainfile.php');
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
require_once("modules/$module_name/MFunctions.php");
$pagetitle = "- "._MREVIEWS."";
include("header.php");
// The Title Line shows: "TFPak.Com - Reviews"
title("$sitename "._MREVIEWS."");
if($_GET['page']) $page = $_GET['page'];
else $page = 0;
$rows_per_page = 10;
/**
* Showing category front
* REQUIRES CATEGORY ID
*/
function index($id) {
global $bgcolor4, $cid, $bgcolor3, $bgcolor2, $bgcolor1, $prefix, $multilingual, $currentlang, $db, $module_name, $page, $rows_per_page;
/**
* MULTILINGUAL HMM, LET'S LEAVE IT HERE
* SO I DON'T FORGET TO ADD IT IN FUTURE VERSIONS IF REQURIED :P
*/
if ($multilingual == 1) {
$querylang = "WHERE rlanguage='$currentlang'";
} else {
$querylang = "";
}
/**
* WE DONT HAVE THE CATEGORY ID OMG OMG
* LETS SHOW THE ERROR PAGE
*/
if(!$id) {
revhead("<a href='modules.php?name=$module_name'>Top</a> → "._MERROR."");
OpenTable();
echo ""._MCATID_NOT_FOUND_ERROR."";
CloseTable();
} else {
/**
* YAY WE HAVE THE ID
* LETS SHOW REVIEW HEAD WITH BREADCRUMBS TO THIS LOCATION
*/
revhead("PATH", $id);
/**
* Let's get all childs of this particular category
* so that we can use it later for stats silly ;d
*/
$all_kids = getall_childs($id);
$tdcount=1;
$result = $db->sql_query("select cid, title from ".$prefix."_mreviews_cats where pid='$id'");
$numcats = $db->sql_numrows($result);
/**
* WE HAVE SOME SUBCATEGORIES IN THIS CATEGORY, LIST THEM.
*/
if($numcats != 0) {
OpenTable();
echo "<table width=100% cellspacing=0 cellpadding=0>
<tr>";
while(list($cid, $title) = $db->sql_fetchrow($result)) {
echo "<td width=33% valign=top>
<table cellspacing=3 cellpadding=2>
<tr><td><img src='images/$module_name/arrow.gif'></td>
<td><a href='modules.php?name=$module_name&file=cat&id=$cid'><font class='storycat'> $title</font></a></td>
</tr>
</table>
</td>";
if($tdcount==3) {
$tdcount=1;
echo "</tr>
<tr><td colspan=2 height=10></td></tr>
<tr>";
} else {
$tdcount++;
}
}
echo " </table>";
CloseTable();
}
/**
* LETS LOOK FOR REVIEWS
* CHECKING HOW MANY REVIEWS WE ACTUALLY HAVE IN THIS CATEGORY
*/
$revresult = $db->sql_query("select rid from ".$prefix."_mreviews where cid='$id' && rpid='0'");
$numrevs = $db->sql_numrows($revresult);
/**
* LISTING REVIEWS IN THIS CATEGORY
* STARTS BELOW
* */
if($numrevs != 0) {
$limit = 'LIMIT ' .$page .',' .$rows_per_page;
$revresult = $db->sql_query("select * from ".$prefix."_mreviews where cid='$id' && rpid='0' ORDER BY rid DESC $limit");
OpenTable();
echo "<center>";
revtitle(""._MLISTING." "._MREVIEWS."");
echo "</center><br>";
echo "<table width=100% cellspacing=1 cellpadding=5 bgcolor=$bgcolor2>
<tr bgcolor=$bgcolor2>
<td valign=top>
<font color=$bgcolor3><b>"._MTITLE."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MREVIEWER."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MRANKING."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MREADS."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MSUBMITTEDON."</b></font>
</td>
</tr>";
$trcount = 1;
while(list($rid, $cid, $author, $author_email, $pagename, $content, $r_link, $r_link_title, $score, $num_votes, $counter, $date) = $db->sql_fetchrow($revresult)) {
if($trcount==1) {
$rowcolor = $bgcolor1;
$trcount=2;
} elseif ($trcount==2) {
$rowcolor = $bgcolor3;
$trcount=1;
}
echo " <tr bgcolor=$rowcolor>
<td valign=top>
<a href='modules.php?name=$module_name&file=rev&id=$rid'>$pagename</a>
</td>
<td valign=top>
<a href='mailto:$author_email'>$author</a>
</td>
<td valign=top>
$score
</td>
<td valign=top>
$counter
</td>
<td valign=top>
$date
</td>
</tr>";
}
echo "</table>";
if($numrevs > $rows_per_page) {
echo "<div class='pagination'><b>Page:</b> ";
$p = $page;
if($p == 0) $send_p = 0;
else $send_p = $p/$rows_per_page;
$paginationArray = generatePagination($send_p, $numrevs, $rows_per_page);
foreach($paginationArray as $page) {
$page2 = $page-1;
if($page == "0") {
} elseif($page == "a") {
echo "..."; // print an elipse, representing pages that arent displayed
} else {
if($p != 0) $p2 = ($p/$rows_per_page); else $p2 = $p;
if($page2 == $p2 OR ($page2==0 AND $p==1)) echo "<span class='current'><b>$page</b></span>";
else {
echo "<a href='modules.php?name=$module_name&file=cat&id=$id&page=".($page2*$rows_per_page)."'>$page</a>";
}
}
echo " "; // space the pages
}
echo "</div>";
}
CloseTable();
}
/**
* LISTING REVIEWS IN THIS CATEGORY
* ENDS ABOVE
*
* SO WE DONT HAVE REVIEWS IN THIS CATEGORY WHAT NOW?
* Oh yeah let's show some stats and requests if available
* STARTS BELOW
* */
else {
/**
* RECENT 10 AND POPULAR 10 TABLES TO BE SHOWN HERE
* BUT SINCE WE KNOW THIS CATEGORY HAS NO REVIEWS
* SO WE WILL CHECK IF IT HAS SOME SUB-CATEGORIES
* WHICH MIGHT HAVE SOME REVIEWS TO USE WITH STATS
* */
if($all_kids) {
$result_pop = $db->sql_query('SELECT cid, rid, pagename, counter FROM ' . $prefix . '_mreviews WHERE cid IN ('.$all_kids.') ORDER BY counter DESC LIMIT 10');
$num_pop = $db->sql_numrows($result_pop);
$result_rec = $db->sql_query('SELECT cid, rid, pagename, date, counter FROM ' . $prefix . '_mreviews WHERE cid IN ('.$all_kids.') ORDER BY date,rid DESC LIMIT 10');
$num_rec = $db->sql_numrows($result_rec);
if($num_pop || $num_rec) {
OpenTable();
echo '<table width=100% cellspacing=1 cellpadding=5 bgcolor='.$bgcolor2.'>';
echo '<tr><td width="50%" bgcolor="' . $bgcolor2 . '"><font color=$bgcolor3><b>' . _10MOSTPOP . '</b></font></td>';
echo '<td width="50%" bgcolor="' . $bgcolor2 . '"><font color=$bgcolor3><b>' . _10MOSTREC . '</b></font></td></tr>';
$y = 1;
/*
* montego:0000763 - check_html was already done prior to adding to the DB and will end up stripping slashes again!
* check_html() is really not necessary coming out of the DB. If SQL injection is possible from another poorly coded
* module, then there will be much bigger problems than doing no checks here!
*/
for ($x = 0;$x < 10;$x++) {
$myrow = $db->sql_fetchrow($result_pop);
list($CatName) = $db->sql_fetchrow($db->sql_query("select title from ".$prefix."_mreviews_cats where cid='$myrow[cid]'"));
$rid = intval($myrow['rid']);
$pagename = $myrow['pagename'];
$counter = intval($myrow['counter']);
echo '<tr><td width="50%" bgcolor="' . $bgcolor3 . '">' . $y . ') <a href="modules.php?name=' . $module_name . '&file=rev&id=' . $rid . '"><b>' . $pagename . '</b></a> <i>'._MIN.' '.$CatName.'</i></td>';
$myrow2 = $db->sql_fetchrow($result_rec);
$rid = intval($myrow2['rid']);
$pagename = $myrow2['pagename'];
$counter = intval($myrow2['counter']);
echo '<td width="50%" bgcolor="' . $bgcolor3 . '">' . $y . ') <a href="modules.php?name=' . $module_name . '&file=rev&id=' . $rid . '"><b>' . $pagename . '</b></a> <i>'._MIN.' '.$CatName.'</i></td></tr>';
$y++;
}
echo '</table>';
CloseTable();
}
/**
* SHOW REQUESTS IN THIS CATEGORY OR ANY CHILD CATEGORY
* STARTS BELOW
* */
$revresult = $db->sql_query("select * from ".$prefix."_mreviews_requests where cid IN ($all_kids) && active='1'");
$numrevs = $db->sql_numrows($revresult);
if($numrevs) {
OpenTable();
echo "<center>";
revtitle(""._MLISTING." "._MREQUESTS."");
echo "</center><br>";
echo "<table width=100% cellspacing=1 cellpadding=5 bgcolor=$bgcolor2>
<tr bgcolor=$bgcolor2>
<td valign=top>
<font color=$bgcolor3><b>"._MTITLE."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MDESCRIPTION."</b></font>
</td>
<td valign=top>
<font color=$bgcolor3><b>"._MREVIEWEXISTS."</b></font>
</td>
</tr>";
$trcount = 1;
while(list($reqid, $cid, $pagename, $description, $rpid, $person_name, $person_email) = $db->sql_fetchrow($revresult)) {
if($trcount==1) {
$rowcolor = $bgcolor1;
$trcount=2;
} elseif ($trcount==2) {
$rowcolor = $bgcolor3;
$trcount=1;
}
if($rpid != 0) {
$revex = ""._MYES.", <a href='modules.php?name=$module_name&file=write&cid=$cid&request=$reqid&rpid=$rpid'>"._MWRITENEW."";
} else{
$revex = ""._MNO.", <a href='modules.php?name=$module_name&file=write&cid=$cid&request=$reqid'>"._MWRITEFIRST."";
}
echo "<tr bgcolor=$rowcolor>
<td valign=top width=150>
<a href='modules.php?name=$module_name&file=write&id=$cid&request=$reqid'>$pagename</a>
</td>
<td valign=top>
$description
</td>
<td valign=top width=150>
$revex
</td>
</tr>";
}
echo "</table>";
CloseTable();
}
/**
* SHOW REQUESTS IN THIS CATEGORY OR ANY CHILD CATEGORY
* ENDS ABOVE
* */
}
/**
* IF THIS CATEGORY HAS KIDS ENDS ABOVE
* IF We don't have any categories and reviews, show the sorry message. *boohoo*
* */
if(!eregi(",", $all_kids)) {
OpenTable();
echo _MWRITEFIRSTNOTE;
CloseTable();
}
}
/*
* SO WE DONT HAVE REVIEWS IN THIS CATEGORY WHAT NOW?
* Oh yeah let's show some stats and requests if available
* ENDS ABOVE
* */
}
/**
* THE PART WHERE WE HAD NO CATEGORY ID, REMEMBER?
* WELL IT END'S ABOVE hah
*/
}
switch($op) {
default:
index($id);
break;
}
include("footer.php");
?>
|
|
|
|
|
 |
pan

|
Posted:
Sun Apr 26, 2009 4:34 pm |
|
Ok..
Now the sections area has lost the link and there are some different bold and italics lettering now changed. |
Last edited by pan on Sun Apr 26, 2009 5:39 pm; edited 1 time in total |
|
|
 |
nuken

|
Posted:
Sun Apr 26, 2009 5:32 pm |
|
Yep. The links for the categories are at the top. What I did was make the link bold and italics the cat name. The link for the review is correct and the category link is removed since it is already at the top. Easiest fix that corrects the link issue. |
|
|
|
 |
pan

|
Posted:
Sun Apr 26, 2009 5:38 pm |
|
Ah, now I understand the means behind your fix.
Thanks so much for your help with this over the last few weeks.
It seems to be functional enough (to an extent) so that it will work with what I need.
You sir, are a patient, helpful champion =D |
|
|
|
 |
rogue3
Regular


Joined: Jul 02, 2009
Posts: 71
|
Posted:
Fri Jul 03, 2009 9:31 am |
|
Hey, if anyone can send me their files to look at to compare to mine that would be great. I'm having a problem where I submit the post and it doesn't add it to the database. I'd like to compare some of the code. I'm not sure why it does not add it. When I submit all it does is go to a page with the links at the top and nothing else. No messages of success or failure. |
|
|
|
 |
nuken

|
Posted:
Fri Jul 03, 2009 1:45 pm |
|
If you zip your mreviews and pm me a link, I will be glad to look through it later on today. |
|
|
|
 |
nuken

|
Posted:
Sun Jul 05, 2009 1:51 pm |
|
Sorry I couldn't help. Maybe someone else knows how to allow html in the mreviews 2.0 module? |
|
|
|
 |
pan

|
Posted:
Sun Jul 05, 2009 6:25 pm |
|
Once I had new reviews just using all the code from the surveys block.
Once I disabled the block it worked, but that just shows how flawed it is. |
|
|
|
 |
rogue3

|
Posted:
Sun Jul 05, 2009 6:41 pm |
|
I solved the admin problem. The problem I'm having now is that when I post a review, none of the information from the content field is posting. It just comes up blank. If I look in the database, that field is completely empty. At first I thought it was just stripping the html. But, after doing a simple test with some text, it is taking everything out of the field. |
|
|
|
 |
Palbin
Site Admin

Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Sun Jul 05, 2009 7:07 pm |
|
Zip up the entire thing and I will take a look at it. |
_________________ "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. |
|
|
 |
|