Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
janeuk
Regular
Regular



Joined: Oct 13, 2007
Posts: 61

PostPosted: Tue Nov 10, 2009 4:50 am Reply with quote

Hi,
I was in need of a feedback system, so thought I could try to modify the Reviews module to suit the purpose. I copied the module & database files and renamed it, so it is like a new module but I am finding when I do a test of adding a review, it goes to a page that says it has been saved in the database but then when I go to the Reviews index page it doesn't show any reviews at all and at the bottom of the page it says there are 0 reviews in the database, so must be a database issue. Please could someone tell me what I would have to change in the Reviews module code to make it connect properly with the database - I have changed code such as $prefix_reviews to the same name as what it is in the database, and renamed the module in the admin files but apart from that I'm not sure what else I have to do to make it work properly.

Thanks in advance for any help anyone can give me with this Smile

Jane
 
View user's profile Send private message
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Tue Nov 10, 2009 6:41 am Reply with quote

Are you getting an errors in your php log?

_________________
"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. 
View user's profile Send private message
janeuk







PostPosted: Wed Nov 11, 2009 8:22 am Reply with quote

Hi,

Yes I do have errors in the php log, which are

[10-Nov-2009 06:27:09] PHP Warning: Missing argument 11 for preview_review(), called in /home/xxxx/public_html/modules/Feedback_1/index.php on line 56 and defined in /home/xxxxx/public_html/modules/Feedback_1/index.php on line 181
[10-Nov-2009 06:27:09] PHP Warning: Missing argument 12 for preview_review(), called in /home/xxxxx/public_html/modules/Feedback_1/index.php on line 56 and defined in /home/xxxxx/public_html/modules/Feedback_1/index.php on line 181


I have checked what the code is on line 56 and 181, but I don't really understand what could be wrong, perhaps you might know what the issue is, I have included the code that is on these lines below

LINE 56 READS

case 'preview_review':
preview_review($date, $title, $text, $reviewer, $email, $score, $cover, $hits, $id, $rlanguage);
break;


LINE 181 READS

function preview_review($date, $title, $text, $reviewer, $email, $score, $cover, $hits, $id, $rlanguage) {
global $admin, $multilingual, $module_name;
if (eregi('<!--pagebreak-->', $text)) {
$text = ereg_replace('<!--pagebreak-->', '&lt;!--pagebreak--&gt;', $text);

Thanks for your help Smile

Paths edited by admin
 
janeuk







PostPosted: Mon Nov 16, 2009 8:59 pm Reply with quote

Please can someone help me understand what these errors are, so that I might be able to correct the problem?

Thanks for any help Smile
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Tue Nov 17, 2009 12:38 am Reply with quote

looks like you removed some of the variables in
case 'preview_review':

you have 10 and there were 12, so thus the missing argument 11 and 12...

probably just a matter of making some more changes to the module, some function somewhere is still expecting those variables to be there.

did you edit the admin files to correspond to your changes? This one near the bottom of Reviews/admin could be the culprit.
Code:


$db->sql_query('INSERT INTO ' . $prefix . '_reviews VALUES (NULL, \'' . $date . '\', \'' . $title . '\', \'' . $text . '\', \'' . $reviewer . '\', \'' . $email . '\', \'' . $score . '\', \'' . $cover . '\', \'' . $url . '\', \'' . $url_title . '\', \'1\', \'' . $rlanguage . '\')');
 
View user's profile Send private message Visit poster's website
janeuk







PostPosted: Tue Nov 17, 2009 4:44 am Reply with quote

Thank you, thats been very helpful Smile Its probably the $url & $url_title which I removed, but never made the same changes in the admin files, so I'll take a look at that.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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 ©