*EDITED: This post originally contained a reward of free advertising to those who helped. This post is now outdated, so the title stating reward has been edited. One person offered decent help, they were offered advertising for their help. This is now closed.
--------
Ok, here's what's up. My Reviews module has been super modified to be a band database. All of the fields and such were mostly the same until recently.
I went into my phpmyadmin database, and in the _reviews, added one field called: question1
The type is text, same as the original field titled: text (for content of review).
I manually entered into my first band(review) questionone field: "This is a test."
I copied and went thru over and over the modules/Reviews/index.php file, adding the $questionone to everything..
Here's the problem. When I am logged in as admin, and edit the first band(review), all of the fields show up, including my $questionone, and in the box it shows my manually added info: "This is a test."
When I edit the field for $questionone, and do a preview, it shows up as changed. It acts as if everything is working fine.
However, when I submit the modifications, they never change the database for only $questionone.
Is there one simple thing I am missing out on?
Here is my modified modules/Reviews/index.php file:
Code:
<?php
/************************************************************************/
/* PHP-NUKE: Web Portal System */
/* =========================== */
/* */
/* Copyright (c) 2002 by Francisco Burzi */
/* http://phpnuke.org */
/* */
/* ===================== */
/* Base on Reviews Addon */
/* Copyright (c) 2000 by Jeff Lambert (jeffx@ican.net) */
/* http://www.qchc.com */
/* More scripts on http://www.jeffx.qchc.com */
/* */
/* 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. */
/************************************************************************/
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {
die ("You can't access this file directly...");
}
if ($score == 10) {
for ($i=0; $i < 1; $i++)
echo "$other";
} if ($score == 9) {
for ($i=0; $i < 1; $i++)
echo "$ska";
} if ($score == 8) {
for ($i=0; $i < 1; $i++)
echo "$emo";
} if ($score == 7) {
for ($i=0; $i < 1; $i++)
echo "$experimental";
} if ($score == 6) {
for ($i=0; $i < 1; $i++)
echo "$industrial";
} if ($score == 5) {
for ($i=0; $i < 1; $i++)
echo "$worship";
} if ($score == 4) {
for ($i=0; $i < 1; $i++)
echo "$punk";
} if ($score == 3) {
for ($i=0; $i < 1; $i++)
echo "$hxc";
} if ($score == 2) {
for ($i=0; $i < 1; $i++)
echo "$metal";
} if ($score == 1) {
for ($i=0; $i < 1; $i++)
echo "$rock";
}
}
function write_review() {
global $admin, $sitename, $user, $cookie, $prefix, $user_prefix, $currentlang, $multilingual, $dbi, $db, $module_name;
include ('header.php');
OpenTable();
echo "<b><span style=\"font-size: 20pt\">UNDER CONSTRUCTION. WE ARE CURRENTLY NOT ACCEPTING NEW BANDS. CHECK BACK IN A FEW DAYS. THANKS.</span><p>
<b>ADD A BAND:</b><br><i>Input the band info into the following form:</i><p>
<b>BAND HOMEPAGE URL:</b><br>
<input type=\"text\" name=\"url\" size=\"40\" maxlength=\"100\"><br>
<i>The band's official site. http:// is required. You may leave this blank if the band doesnt have a page.</i><br><br>
<b>LINK TITLE:</b><br>
<input type=\"text\" name=\"url_title\" size=\"40\" maxlength=\"50\"><br>
<i>A Link title is required if you add a link above.</i><br><br>
function send_review($date, $title, $text, $reviewer, $email, $score, $cover, $url, $url_title, $questionone, $hits, $id) {
global $admin, $EditedMessage, $prefix, $dbi, $db, $module_name;
include ('header.php');
if (eregi("<!--pagebreak-->", $text)) {
$text = ereg_replace("<!--pagebreak-->","<!--pagebreak-->;",$text);
}
$title = stripslashes(FixQuotes(check_html($title, "nohtml")));
$text = stripslashes(Fixquotes(urldecode(check_html($text, ""))));
if (eregi("<!--pagebreak-->", $text)) {
$text = ereg_replace("<!--pagebreak-->","<!--pagebreak-->",$text);
}
OpenTable();
echo "<br><center>Thanks for your submission.";
if ($id != 0)
echo " "._MODIFICATION."";
else
echo ", $reviewer";
echo "!<br>";
if ((is_admin($admin)) && ($id == 0)) {
sql_query("INSERT INTO ".$prefix."_reviews VALUES (NULL, '$date', '$title', '$text', '$reviewer', '$email', '$score', '$cover', '$url', '$url_title', '$questionone', '1', '$rlanguage')", $dbi);
echo "Thanks ADMIN.";
} else if ((is_admin($admin)) && ($id != 0)) {
sql_query("UPDATE ".$prefix."_reviews SET date='$date', title='$title', text='$text', reviewer='$reviewer', email='$email', score='$score', cover='$cover', url='$url', url_title='$url_title', 'questionone='$questionone', hits='$hits', rlanguage='$rlanguage' where id = $id", $dbi);
echo "Thanks ADMIN.";
} else {
sql_query("INSERT INTO ".$prefix."_reviews_add VALUES (NULL, '$date', '$title', '$text', '$reviewer', '$email', '$score', '$url', '$url_title', '$questionone', '$rlanguage')", $dbi);
echo "Your band info will be looked over and considered by an Admin.<br><br>MIHAVEN.COM reserves the right to edit,alter,add,deny graphics,info.";
}
echo "<br><br>[ <a href=\"modules.php?name=$module_name\">"._RBACK."</a> ]<br></center>";
CloseTable();
include ("footer.php");
}
function reviews_index() {
global $bgcolor4, $sitename, $prefix, $multilingual, $field, $currentlang, $dbi, $module_name, $banners;
include ('header.php');
OpenTable();
$tfnum = sql_num_rows(sql_query("select * from ".$prefix."_reviews", $dbi));
echo "<table align=center width=100% border=0 cellpadding=5 cellspacing=0>
<tr>
<td valign=top width=180>
<img src=\"modules/Home2/mihaven.jpg\"><br>
Mihaven.com is currently serving <b>$tfnum</b> Talent Files.<br><br>
<b>Newest Talent Files:</b><br>\n";
$sql = "SELECT id, title, hits FROM ".$prefix."_reviews ORDER BY id DESC LIMIT 0,10";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$id = $row[id];
$title = $row[title];
$hits = $row[hits];
echo "<img src=\"images/tri.gif\"> <a href=\"reviews.html&rop=showcontent&id=$id\">$title</a><br>\n";
}
echo "<br><br><b>Most Popular:</b><br>\n";
$sql = "SELECT id, title, hits FROM ".$prefix."_reviews ORDER BY hits DESC LIMIT 0,10";
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$hits = $row[hits];
echo "<img src=\"images/tri.gif\"> <a href=\"reviews.html&rop=showcontent&id=$row[id]\">$row[title]</a><br>";
}
case "reviewer":
$result = sql_query("SELECT id, title, hits, reviewer, score FROM ".$prefix."_reviews WHERE UPPER(title) LIKE '$letter%' $querylang ORDER by reviewer $order", $dbi);
break;
case "score":
$result = sql_query("SELECT id, title, hits, reviewer, score FROM ".$prefix."_reviews WHERE UPPER(title) LIKE '$letter%' $querylang ORDER by score $order", $dbi);
break;
case "hits":
$result = sql_query("SELECT id, title, hits, reviewer, score FROM ".$prefix."_reviews WHERE UPPER(title) LIKE '$letter%' $querylang ORDER by hits $order", $dbi);
break;
default:
$result = sql_query("SELECT id, title, hits, reviewer, score FROM ".$prefix."_reviews WHERE UPPER(title) LIKE '$letter%' $querylang ORDER by title $order", $dbi);
break;
function del_review($id_del) {
global $admin, $prefix, $dbi, $module_name;
if (is_admin($admin)) {
sql_query("delete from ".$prefix."_reviews where id = $id_del", $dbi);
sql_query("delete from ".$prefix."_reviews_comments where rid='$id_del'", $dbi);
Header("Location: modules.php?name=$module_name");
} else {
echo "ACCESS DENIED";
}
}
function del_comment($cid, $id) {
global $admin, $prefix, $dbi, $module_name;
if (is_admin($admin)) {
sql_query("delete from ".$prefix."_reviews_comments where cid='$cid'", $dbi);
Header("Location: modules.php?name=$module_name&rop=showcontent&id=$id");
} else {
echo "ACCESS DENIED";
}
}
switch($rop) {
case "showcontent":
showcontent($id, $page);
break;
case "postcomment":
postcomment($id, $title);
break;
case "savecomment":
savecomment($xanonpost, $uname, $id, $score, $comments);
break;
case "del_comment":
del_comment($cid, $id);
break;
default:
reviews_index();
break;
}
?>
Last edited by zao on Tue Jun 28, 2005 7:50 am; edited 2 times in total
zao Nuke Soldier
Joined: Apr 16, 2004
Posts: 26
Posted:
Thu May 05, 2005 8:02 am
Just for my own saftey, There needs to be a cutt off limit of like 15 people who get banners, or something.. I dont know, but I cant give out 50,000 banner ads. haha!
these don't have the same number of parameters...short by one in the second. as for the same value, try stipulating your columns with your values, like INSERT INTO (col1,col2) VALUES (val1,val2)...what I would also do is assign these to variables then echo the variables to track how your variables are being passed and in what order.
shrek_rock Captain
Joined: Nov 24, 2003
Posts: 709
Posted:
Thu May 05, 2005 8:18 am
You may also need to go to admin/modules/reviews.php and make the necessary changes there too..
_________________
zao Nuke Soldier
Joined: Apr 16, 2004
Posts: 26
Posted:
Thu May 05, 2005 9:00 am
Well I tried loading the original modules/Reviews/index.php, along with only my $questionone field added, and it worked, so Im going to go from there.. Thanks to you two for trying to help me. "Gettopreacherman", if you want advertising, send me your email in private message and I will contact you about it..
zao Nuke Soldier
Joined: Apr 16, 2004
Posts: 26
Posted:
Tue Jun 28, 2005 8:18 am
gettopreacherman - I sent you a private message about free ads for your help. If you are interested, check it out. Im making the cutt-off date August 05. -zao
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