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...');
}
/**
* 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);
/**
* 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);
} 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
* */
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
*/
}
Joined: Mar 11, 2007 Posts: 1536 Location: North Carolina
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...');
}
/**
* 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);
/**
* 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);
} 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
* */
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.
* 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)
Joined: Mar 11, 2007 Posts: 1536 Location: North Carolina
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...');
}
/**
* 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);
/**
* 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);
} 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
* */
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
*/
}
Joined: Mar 11, 2007 Posts: 1536 Location: North Carolina
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.
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.
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.
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