Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Complete Review System


jwilkins

Recommended Posts

Hi All,

 

I'm not sure whether there is a dedicated support thread for this contribution - If there is, I shall post there if directed.

 

Problem

 

I have had the complete review system installed for a while and is a great contribution! I have since upgraded to version 1.5.2 but seem to still be experiencing the Fatal error: Call to undefined function as indicated in the contribution trail and as shown below;

 

Fatal error: Call to undefined function tep_draw_pull_down_date() in xx\xxx\xxx\\admin\reviews.php on line 198

 

Has anyone else experienced this too?

 

I have performed all the install steps as indicated in the contained install.txt file... so am a bit stumped! Any help or direction would be greatly appreciated!

 

osCommerce RC2a

PHP 5.2.8

MySQL 5.0.51

Server - Linux

 

Kind regards,

James

Link to comment
Share on other sites

You may have missed this step.

 

open admin/includes/functions/html_output.php

 

add before the final ?>

 

////
// Creates a pull-down list for dates	
function tep_pull_down_date($name='date', $day='', $month='', $year='', $full=false, $mnth=false, $starty=''){
if ($day=='') {$day=date('d');}
if ($month=='') {$month=date('m');}
if ($year=='') {$year=date('Y');}
$endy=date('Y')-8;
if ($starty=='') {$starty=date('Y')-1;$endy=date('Y')+2;} 
$named = $name . 'd';
$namem = $name . 'm';
// Array for days
$days=array();
$days[] = array('id' => '00', 'text' => 'not');
for($i=1; $i<=31; $i++){
if(strlen($i)!= 2){
$j = '0' . $i;
} else {
$j = $i;
} 
$days[] = array('id' => $j, 'text' => $j); }

if ($mnth) {
$months = array(
array('id' => '00', 'text' => 'month'),
array('id' => '01', 'text' => TEXT_DATE_JAN),
array('id' => '02', 'text' => TEXT_DATE_FEB),
array('id' => '03', 'text' => TEXT_DATE_MAR),
array('id' => '04', 'text' => TEXT_DATE_APR),
array('id' => '05', 'text' => TEXT_DATE_MAY),
array('id' => '06', 'text' => TEXT_DATE_JUN),
array('id' => '07', 'text' => TEXT_DATE_JUL),
array('id' => '08', 'text' => TEXT_DATE_AUG),
array('id' => '09', 'text' => TEXT_DATE_SEP),
array('id' => '10', 'text' => TEXT_DATE_OCT),
array('id' => '11', 'text' => TEXT_DATE_NOV),
array('id' => '12', 'text' => TEXT_DATE_DEC));
} else {
$months[] = array('id' => '00', 'text' => 'set');
for($i=1; $i<=12; $i++){
if(strlen($i)!= 2){
$j = '0' . $i;
} else {
$j = $i;
} 
$months[] = array('id' => $j, 'text' => $j); }}

for($i=$starty; $i<=$endy; $i++){
$j = $i;
if ($full) {
$y = $i - 2000;
if(strlen($y)!= 2){
$j = '0' . $y;
} else {
$j = $y;
} }
$years[] = array('id' => $i, 'text' => $j); }
$field='';
// mm dd yy contries = 38 canada,139 Micronesia,163 Palau,168 Philippines,223 & 224 United States
if(STORE_COUNTRY == 223 || STORE_COUNTRY == 224 || STORE_COUNTRY == 38 || STORE_COUNTRY == 139 || STORE_COUNTRY == 163 || STORE_COUNTRY == 168) {
$field .= tep_draw_pull_down_menu($named, $months, $month);
$field .= tep_draw_pull_down_menu($namem, $days, $day); }
else {
$field .= tep_draw_pull_down_menu($named, $days, $day);
$field .= tep_draw_pull_down_menu($namem, $months, $month); }
$field .= tep_draw_pull_down_menu($name, $years, $year);

return $field;
}

Link to comment
Share on other sites

I concur, perhaps u modified includes/functions/html_output.php

in place of admin/includes/functions/html_output.php

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

I am getting the same tep_draw_pull_down_date() error and I have checked and doubled checked to make sure admin/includes/functions/html_output.php is the file modified.

 

Also, I'm getting an Internal Server Error when I make a test review and click continue. I have uninstalled and reinstalled this contribution and cannot figure it out. :blink:

Link to comment
Share on other sites

I am getting the same tep_draw_pull_down_date() error and I have checked and doubled checked to make sure admin/includes/functions/html_output.php is the file modified.

 

Also, I'm getting an Internal Server Error when I make a test review and click continue. I have uninstalled and reinstalled this contribution and cannot figure it out. :blink:

 

 

Can u post the full error message, and are u creating test review in admin or client side.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Can u post the full error message, and are u creating test review in admin or client side.

 

I am reinstalling the contribution. I will post the full error when/if I duplicate it. (And I was creating a test review on the client side.)

Link to comment
Share on other sites

I am reinstalling the contribution. I will post the full error when/if I duplicate it. (And I was creating a test review on the client side.)

 

Hi All,

 

Thanks for posting your thoughts and sorry for the delay in responding, I've been tied up all today (not literally!)

 

I've gone through all the code again, checked the the function has been included in admin/includes/functions/html_output.php and the other code steps, but still come across the tep_draw_pull_down_date() error ... I shall try a complete uninstall/re-install, see what happens and report back!

 

Cheers

James

 

EDIT - FYI Sam, I was running an admin side review - I haven't yet tested client side

Edited by jwilkins
Link to comment
Share on other sites

Just in case anyone else has run into this problem as indicated below from another post thread (thought I'd pull it into this thread as a potential one-stop-shop)

 

I installed the complete reviews system and at is great! It does exactly what I want... except I just noticed that the email that gets sent to the administratior notifying them to approve or reject a review is coming through with the variables in the body and email fields rather than the values for the variables.

For example.. here is the body of the email:

 

ADMIN_EMAIL_MESSAGE

 

Spooks has fixed the above error as shown below (thanks Spooks)

 

catalog/product_reviews_write.php

 

Find:

	  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, ADMIN_EMAIL_SUBJECT, ADMIN_EMAIL_MESSAGE, ADMIN_EMAIL_FROM_NAME, STORE_OWNER_EMAIL_ADDRESS);
  tep_redirect(tep_href_link(FILENAME_REVIEW_NOTICE, tep_get_all_get_params(array('action'))));

 

Replace with:

$name = tep_db_input($customer['customers_firstname']) . ' ' . tep_db_input($customer['customers_lastname']);
  tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, 'New Review Submitted', 'A new review has been submitted for approval, please log in and check.', $name, $email);
  tep_redirect(tep_href_link(FILENAME_REVIEW_NOTICE, tep_get_all_get_params(array('action'))));

 

Regards,

James

Link to comment
Share on other sites

To report back...

 

I have done a full un-install and re-install of the contribution (i.e install the original package and then add the admin modifications as per latest release), but still come across the tep_draw_pull_down_date() error as stated above.

 

This only occurs admin side - a test product review has been placed client side - this works (is visible client side once approved).

 

The review is visible though admin control - catalog - reviews

 

The tep_draw_pull_down_date() error comes in either when: editing a review and creating an admin 'pseudo' review.

 

As indicated above, the codes drops at line 198 of admin/reviews - the function call tep_draw_pull_down_date()

 

If there is any more information that would prove useful in looking at the problem, please let me know.

 

Thanks in advance for any advice!

 

Regards,

James

Link to comment
Share on other sites

Perhaps your admin/includes/application_top.php has some mods?

 

The sequences goes like this, the first line of admin/reviews.php is:

 

require('includes/application_top.php');

around line 73 of admin/includes/application_top.php should be:

 

require(DIR_WS_FUNCTIONS . 'html_output.php');

so if admin/includes/functions/html_output.php contains the function tep_draw_pull_down_date() it becomes available

 

if its not (& you get you error) one of the above is not there!!

 

or you have modded admin/includes/functions/html_output.php in such a way that it ignores the function, ie post the contents of that.

Edited by spooks

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Hi Sam,

 

Thanks for the pointers re: the tep_draw_pull_down_date() issue - I have now located the problem and managed to fix as shown below. The fix will need to be applied to the install package.

 

FIX

 

Within the Complete Reviews System (Admin) V1.5.2 contribution, locate - Complete Reviews System (Admin) V1.5.2.txt

 

Towards the bottom of the file find:

 

////
// Creates a pull-down list for dates	
function tep_pull_down_date($name='date', $day='', $month='', $year='', $full=false, $mnth=false, $starty=''){

 

Replace with:

 

////
// Creates a pull-down list for dates	
function tep_draw_pull_down_date($name='date', $day='', $month='', $year='', $full=false, $mnth=false, $starty=''){

 

OR if the contribution has already been applied to your store:

 

Locate - admin/includes/functions/html_output.php and replace the code sequence above i.e include the tep_draw_pull_down_date

 

However (and I'll have a look at this tomorrow), this deals with the displayed error - but has not actually produced a pull down list of dates.... something to have a look at later...

 

I hope the above helps,

 

Regards,

James

Link to comment
Share on other sites

Oops :blush: yes my error, sorry I did`nt see it myself.

 

I had 2 versions of the pull down date function, as I created some variations whilst writing, the one I included is not the one I used for this!! :blush:

 

The correct version is:

 

 

function tep_draw_pull_down_date($day='', $month='', $year='', $full=false, $starty='', $name='date'){
if ($day=='') {$day=date('d');}
if ($month=='') {$month=date('m');}
if ($year=='') {$year=date('Y');}
$eyear=date('Y');
if ($starty == '') {$starty=date('Y')-1; $eyear=date('Y')+2;} 

// Array for days
$days=array();
$days[] = array('id' => '00', 'text' => 'not');
for($i=1; $i<=31; $i++){
if(strlen($i)!= 2){
$j = '0' . $i;
} else {
$j = $i;
} 
$days[] = array('id' => $j, 'text' => $j); }

$months[] = array('id' => '00', 'text' => 'set');
for($i=1; $i<=12; $i++){
if(strlen($i)!= 2){
$j = '0' . $i;
} else {
$j = $i;
} 
$months[] = array('id' => $j, 'text' => $j); }

for($i=$starty; $i<=$eyear; $i++){
$j = $i;
if (!$full) {
$y = $i - 2000;
if(strlen($y)!= 2){
$j = '0' . $y;
} else {
$j = $y;
} }
$years[] = array('id' => $i, 'text' => $j); }

// mm dd yy contries = 38 canada,139 Micronesia,163 Palau,168 Philippines,223 & 224 United States
if(STORE_COUNTRY == 223 || STORE_COUNTRY == 224 || STORE_COUNTRY == 38 || STORE_COUNTRY == 139 || STORE_COUNTRY == 163 || STORE_COUNTRY == 168) {
echo tep_draw_pull_down_menu('select_month', $months, $month);
echo tep_draw_pull_down_menu('select_day', $days, $day); }
else {
echo tep_draw_pull_down_menu('select_day', $days, $day);
echo tep_draw_pull_down_menu('select_month', $months, $month); }
echo tep_draw_pull_down_menu('select_year', $years, $year);

$select_date =   $_POST['select_day'].'/'.$_POST['select_month'].'/'.$_POST['select_year'];

return $select_date;
}

 

Sorry about the error & hastle caused.

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Sorry about the error & hastle caused.

 

Hi Spooks,

 

There was no hastle at all.. I'm grateful for the contribution, so a hiccup isn't a problem!

 

Thanks again for the code above, it now works well!

 

Regards,

James

Link to comment
Share on other sites

  • 3 weeks later...

Hi there,

 

any thoughts on what caused this?

 

Warning: Division by zero in /mnt/w0103/d43/s46/b01d5bdc/www/store/catalog/admin/includes/classes/split_page_results.php on line 33

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-0, MAX_SEARCH_RESULTS_ADMIN' at line 1

 

select reviews_id, products_id, last_modified, reviews_rating, approved, date_added from reviews order by date_added DESC limit -0, MAX_SEARCH_RESULTS_ADMIN

 

[TEP STOP]

 

it happens when i go to the reviews page in my admin view. as far as i know i have not changed anything in the split_page_results.php page

 

in my configuration page the max search results is set to 200, does that have anything to do with it? i am using 1.5.3.

 

Cheers,

 

AL

Edited by Ironhalo
Link to comment
Share on other sites

Its a new admin setting I added that I forgot to inclide in the release, apply this sql to fix:

 

INSERT INTO `configuration` (`configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
('Display Results In Admin', 'MAX_SEARCH_RESULTS_ADMIN', '20', 'Maximum Display Results In Admin', 3, 2, now(), now(), '', '');

Or you could use Total Configuration http://addons.oscommerce.com/info/5040 to manually add the setting.

That gives you full control over all settings, allows you to add new ones & shows some that are 'hidden' by default.

Its a quick easy install.

 

Edited by spooks

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

hi ya,

 

thanks for that, i got it to work.

 

now i have another issue.

 

i got the following error:

 

Fatal error: Call to undefined function: tep_noslash_string() in /mnt/w0103/d43/s46/b01d5bdc/www/store/catalog/admin/reviews.php on line 220

 

Also on the reviews page it looks like the titles for Entry Name and Entry Language have no normal title.

 

is there an language file change missing. i looked in the contribution but could not find it.

 

Any thoughts?

 

Cheers,

 

AL

Link to comment
Share on other sites

You have failed to complete the install for 1.5.3, go over it all again.

 

Also 1.5.3 is admin only, if you refer to the last full release by Hotclutch you will see the language files u seem to have also missed.

 

Always double check your installs, esp if u get errors

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 3 months later...

Hey Great! Glad that got fixed. But it seems that the images for the ratings are missing. Any ideas?

Yes, this still seems to be the case - no images for the star rating, when a review is created in admin. Also seems to be no image for the 'approved' button. Are these missing from the package or are we supposed to make or find our own?

 

Otherwise a very useful contribution. For further development I would like to see a 'Thank you' message appear after a review is entered rather than just be taken back to a screen saying there are no product reviews (if there aren't already some approved ones, presumably if there are it displays a list of reviews). Also an ability to reject reviews without even having to look at them if they contain words from a banned list.

 

Yes, I know, some people are never satisfied ;)

www.jyoshna.com. Currently using OsC with STS, Super Download Store, Categories Descriptons, Manufacturers Description, Individual Item Status, Infopages unlimited, Product Sort, Osplayer with flashmp3player, Product Tabs 2.1 with WebFx Tabpane and other bits and pieces including some I made myself. Many thanks to all whose contributions I have used!

Link to comment
Share on other sites

For further development I would like to see a 'Thank you' message appear after a review is entered

Oops. It does have a 'thank you' screen doesn't it? In the process of playing around with various things I restored the original product_reviews_write script. I thought it wasn't how I remembered it... :blush:

www.jyoshna.com. Currently using OsC with STS, Super Download Store, Categories Descriptons, Manufacturers Description, Individual Item Status, Infopages unlimited, Product Sort, Osplayer with flashmp3player, Product Tabs 2.1 with WebFx Tabpane and other bits and pieces including some I made myself. Many thanks to all whose contributions I have used!

Link to comment
Share on other sites

Yes, this still seems to be the case - no images for the star rating, when a review is created in admin. Also seems to be no image for the 'approved' button. Are these missing from the package or are we supposed to make or find our own?

...

Alright, well now I found the stars and the buttons. The star images are only in the catalog/images directory and not in the admin/images directory and the admin reviews.php file sometimes refers to them in the DIR_WS_IMAGES directory and sometimes DIR_WS_CATALOG_IMAGES while they only exist in one place, on the catalog and not the admin side, unless you copy them over into the admin/images directory.

 

The approve/disapprove image buttons weren't showing up for me because I've installed the Mindsparx admin and it keeps buttons in a different place. :-"

 

Anyway I have another point, at risk of making a further fool of myself: there seems to be a need to add a few more define texts into the relevant reviews.php languages file, which the packages don't provide or have instructions about, specifically:

TEXT_INFO_REVIEW_TEXT
TEXT_DISAPPROVE
TEXT_APPROVE

 

The define statements need to be, added in admin/includes/languages/english/reviews.php:

define('TEXT_INFO_REVIEW_TEXT', '<b>Review Text:</b> '); 
define('TEXT_DISAPPROVE', 'DISAPPROVE');
define('TEXT_APPROVE', 'APPROVE');

 

A small point. Everything else is perfect. Well, apart from a banned word list but I'm not too bothered about that really.

Edited by Ben Nevis

www.jyoshna.com. Currently using OsC with STS, Super Download Store, Categories Descriptons, Manufacturers Description, Individual Item Status, Infopages unlimited, Product Sort, Osplayer with flashmp3player, Product Tabs 2.1 with WebFx Tabpane and other bits and pieces including some I made myself. Many thanks to all whose contributions I have used!

Link to comment
Share on other sites

  • 1 month later...

Currently get the following error when I click the preview button in the admin section for a review, thoughts?

 

Thanks for the great mod!

 

Fatal error: Call to undefined function tep_store_date() in /admin/reviews.php on line 389

 

 

u have failed to completge the install!!, please always triple check your edits if any errors.

 

 

In includes/languages/english.php ?

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

u have failed to completge the install!!, please always triple check your edits if any errors.

 

 

In includes/languages/english.php ?

 

I followed the instructions exactly, this line is added into includes/languagres/english.php

 

// return a dbase formatted date for ddmmyyyy format adjust if you use the mmddyyyy format
function tep_store_date ($date) {

  return substr($date, 6, 4) . '-' . substr($date, 3, 2) . '-' . substr($date, 0, 2) . ' ' . date('H:i:s');

 }

Edited by Stealth1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...