PDA

View Full Version : Complete Reviews System



michael_s
08-23-2014, 03:53 AM
If looking for only Admin Create Review function only, this can be a full package

Screenshots included

Upgrade Modified to support 3.5.1. Gives admin full access to edit, and create Reviews from scratch.

This upgrade is for admin only, please use older package for remaining install.


Modified the admin part of the package so:

1. Can enter edit for any product directly (not have to select first)
2. Can limit the display to a selected product
3. This version has the rating system, you are not forced to use it though.
4. Drop downs are used for date input
5. You can alter the product for the review in edit mode
6. You can update/insert reviews directly, no need to preview first.
7. Modified 'rating' to more logical display in edit/insert.

Fixed the following bugs:

1. When selecting 'back' from preview all edits were lost

2. Various errors within the code (don`t recall them all)

3. Added missing function (sorry, my error)

4. Changed to the correct date function (another oops!!)

Installation replace admin/reviews.php with the included reviews.php

open admin/includes/functions/html_output.php

add before the final ?_

////
// Creates a pull-down list for dates
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;
}


***************************************

in admin/includes/functions/general.php

b4 the final ?_ add:

// Remove / from text
function tep_noslash_string($string) {
$search = array(chr(92),chr(47));
return str_replace($search,'',$string);
}

**************************************

in /admin/includes/configure.php


b4 the final ?_ add:

define('MAX_SEARCH_RESULTS_ADMIN', '20');

**************************************

In includes/languages/english.php (or other language)

after:

function tep_date_raw($date, $reverse = false) {
if ($reverse) {
return substr($date, 0, 2) . substr($date, 3, 2) . substr($date, 6, 4);
} else {
return substr($date, 6, 4) . substr($date, 3, 2) . substr($date, 0, 2);
}
}

add:

// 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');

}


thats it!!


Thats all there is to it!!

More... (http://addons.oscommerce.com/info/4397)