Author |
Message |
janeuk
Regular
![Regular Regular](modules/Forums/images/ranks/2stars.gif)
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined: Oct 13, 2007
Posts: 61
|
Posted:
Tue Nov 10, 2009 4:50 am |
|
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
Jane |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
Palbin
Site Admin
![](modules/Forums/images/avatars/Dilbert/Dilbert_-_Dogbert_King.gif)
Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania
|
Posted:
Tue Nov 10, 2009 6:41 am |
|
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. |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
janeuk
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Wed Nov 11, 2009 8:22 am |
|
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-->', '<!--pagebreak-->', $text);
Thanks for your help
Paths edited by admin |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
janeuk
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Mon Nov 16, 2009 8:59 pm |
|
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](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
spasticdonkey
RavenNuke(tm) Development Team
![](modules/Forums/images/avatars/48fb116845dfecf66294c.gif)
Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA
|
Posted:
Tue Nov 17, 2009 12:38 am |
|
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 . '\')');
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
janeuk
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Tue Nov 17, 2009 4:44 am |
|
Thank you, thats been very helpful 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. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|