hello , anyone have this complet mod ( dynamic rules page mod) ? For tbdev 2009? Our staff edit rules ?!
pls,Thanks ✌
DND
22nd February 2016 19:11
for tbdev09 ? what source are you using? and what is the problem ?
post error log or something.. errors will tell you what is the problem and how to fix it.
CAGADA
22nd February 2016 22:00
1 Attachment(s)
Quote:
Originally Posted by DND
(Post 48512)
for tbdev09 ? what source are you using? and what is the problem ?
post error log or something.. errors will tell you what is the problem and how to fix it.
use TBdev 2009 final
It does not appear error. the code works, only that when I edit or delete the rules does not work.
admin/rules.php
Code:
/* Bigjoos, CoLdFuSiOn */
if ( ! defined( 'IN_TBDEV_ADMIN' ) )
{
print "
Incorrect access
You cannot access this file directly.";
exit();
}
require_once "include/user_functions.php";
function Cat_Delete($chk=false)
{
$id = isset($_GET['catid']) ? (int)$_GET['catid'] : 0;
if (!is_valid_id($id))
stderr("Error", "Bad ID!");
if( !$chk )
{
stderr("Sanity Check!", "You're about to delete a rules category, this will delete ALL content within that category! CONTINUE
or CANCEL");
}
@mysql_query("DELETE FROM rules WHERE id = $id") or stderr("SQL Error", "1OOps!");
@mysql_query("DELETE FROM rules_categories WHERE cid = $id") or stderr("SQL Error", "2OOps!");
stderr("Info", "Rules category deleted successfully! Go Back To Rules Admin?");
}
function Show_Cat_Edit_Form()
{
global $lang, $CURUSER;
$htmlout='';
$maxclass = $CURUSER['class'];
if (!isset($_GET['catid']) || empty($_GET['catid']) || !is_valid_id($_GET['catid']))
$htmlout .= Do_Error("Error", "No Section selected");
$cat_id = (int)$_GET['catid'];
$sql = mysql_query("SELECT * FROM rules_categories WHERE cid = {$cat_id}") or stderr("SQL Error", "OOps!");
if (!mysql_num_rows($sql))
stderr("SQL Error", "Nothing doing here!");
$sql = "INSERT INTO rules_categories (rcat_name,min_class_read) VALUES ($cat_name, $min_class_read)";
@mysql_query($sql);
if (mysql_affected_rows() == -1)
stderr("Warning", "Couldn't forefill that request");
$htmlout .= New_Cat_Form(1);
//return $htmlout;
print stdhead("Add New Heading") . $htmlout . stdfoot();
exit();
}
function Do_Rules_Add()
{
global $lang;
$cat_id = (int)$_POST['cat'];
if (!is_valid_id($cat_id))
stderr("Error", "No heading");
if (empty($_POST['heading']) || empty($_POST['body']) || strlen($_POST['heading']) > 100)
stderr("Error", "Field is blank or length too long! Go Back");