Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1

    Default duplicate reviews sidebox?

    i need to duplicate the reviews sidebox, and rename it concerts.
    im wondering if there is a "list" in someones head of the files i need to duplicate, i have duplicated all that i can find, but im fearing im missing some. I havent tried it yet, because i know that i need to run an sql command, im just not sure what.

    can someone help me please?

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,886
    Plugin Contributions
    6

    Default Re: duplicate reviews sidebox?

    Sideboxes have two peices:
    /includes/modules/sideboxes/my_sidebox.php
    /includes/templates/template_default/sideboxes/tpl_my_sidebox.php

    You might look at the Free Software add on for the Blank Sidebox to get a feel for this and how new ones can be added ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  3. #3

    Default Re: duplicate reviews sidebox?

    ok, thank you. i will look at it as soon as i get a few minutes. does anybody know about the sql query i will need though? im sure it will use one, because when someone posts a review, i am assuming it gets stored in the database, so to duplicate that, and have someone post a concert, that will need to be stored as well. am i correct?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,886
    Plugin Contributions
    6

    Default Re: duplicate reviews sidebox?

    Assuming you followed the pattern of Reviews ...

    Look at how your data is stored in your new concerts and concerts_description tables ...

    You should be able to use similar SELECT statements where the fields match your new tables but those should be similar to how the Reviews are setup ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  5. #5

    Default Re: duplicate reviews sidebox?

    how do i view that? in phpMyAdmin? im sorry, im just not sure. would it be in a php file? or is it a query that is run everytime.

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,886
    Plugin Contributions
    6

    Default Re: duplicate reviews sidebox?

    I am assuming that you added new tables to the database to manage your concerts ...

    The current Review sidebox uses:
    /includes/modules/sideboxes/reviews.php

    and uses one of three template files:
    /includes/templates/template_default/sideboxes/tpl_reviews_random.php
    /includes/templates/template_default/sideboxes/tpl_reviews_write.php
    /includes/templates/template_default/sideboxes/tpl_reviews_none.php

    The SELECT statements are in the module file for this to get the data out of the database tables ...

    This can help give you ideas of how to get your data for the concerts out of the database tables ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  7. #7

    Default Re: duplicate reviews sidebox?

    ok, thank you. that was very helpful., i guess when i quick installed it, the prefix zen_ was added, i edited all 4 files, created the tables first of course.

    i think the problem lies in the file concerts.php, in the modules directory, here is my code, im just not sure where to add the prefixes in the file
    Code:
    $concerts_status = " and r.status = 1 ";
    
      $random_concert_sidebox_select = "select c.concerts_id, c.concerts_rating, p.products_id, p.products_image, pd.products_name
                        from " . TABLE_ZEN_CONCERTS . " c, " . TABLE_CONCERTS_DESCRIPTION . " cd, "
                               . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                        where p.products_status = '1'
                        and p.products_id = c.products_id
                        and c.concerts_id = cd.concerts_id
                        and cd.languages_id = '" . (int)$_SESSION['languages_id'] . "'
                        and p.products_id = pd.products_id
                        and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
                        $concerts_status;
    
      if (isset($_GET['products_id'])) {
        $random_concert_sidebox_select .= " and p.products_id = '" . (int)$_GET['products_id'] . "'";
      }
      $random_concert_sidebox_select .= " limit " . MAX_RANDOM_SELECT_CONCERTS;
      $random_concert_sidebox_product = zen_random_select($random_concert_sidebox_select);
      if ($random_concert_sidebox_product->RecordCount() > 0) {
    // display random review box
        $concert_box_text_query = "select substring(concert_text, 1, 60) as concerts_text
                         from " . TABLE_CONCERTS_DESCRIPTION . "
                         where concerts_id = '" . (int)$random_concert_sidebox_product->fields['concerts_id'] . "'
                         and languages_id = '" . (int)$_SESSION['languages_id'] . "'";
    
        $concert_box_text = $db->Execute($concert_box_text_query);
    
    //    $review_box_text = zen_break_string(zen_output_string_protected($review_box_text->fields['reviews_text']), 15, '-<br />');
        $concert_box_text = zen_break_string(nl2br(zen_output_string_protected(stripslashes($concert_box_text->fields['concerts_text']))), 60, '-<br />');
    
        require($template->get_template_dir('tpl_concerts_random.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_concerts_random.php');
      } elseif (isset($_GET['products_id']) and zen_products_id_valid($_GET['products_id'])) {
    // display 'write a review' box
        require($template->get_template_dir('tpl_concerts_write.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_concerts_write.php');
      } else {
    // display 'no reviews' box
        require($template->get_template_dir('tpl_concerts_none.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_concerts_none.php');
      }
      $title =  BOX_HEADING_CONCERTS;
      $title_link = FILENAME_CONCERTS;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    ?>

  8. #8

    Default Re: duplicate reviews sidebox?

    sorry, i dont mean to double post, im just realizing that it might not be a pefix issue, here is mySQL code, maybe i have an error there?
    Code:
    DROP TABLE IF EXISTS concerts;
    CREATE TABLE concerts (
      concerts_id int(11) NOT NULL auto_increment,
      products_id int(11) NOT NULL default '0',
      customers_id int(11) default NULL,
      customers_name varchar(64) NOT NULL default '',
      concerts_rating int(1) default NULL,
      date_added datetime default NULL,
      last_modified datetime default NULL,
      concerts_read int(5) NOT NULL default '0',
      status int(1) NOT NULL default '1',
      PRIMARY KEY  (concerts_id),
      KEY idx_products_id_zen (products_id),
      KEY idx_customers_id_zen (customers_id),
      KEY idx_status_zen (status),
      KEY idx_date_added_zen (date_added)
    ) TYPE=MyISAM;
    
    DROP TABLE IF EXISTS concerts_description;
    CREATE TABLE concerts_description (
      concerts_id int(11) NOT NULL default '0',
      languages_id int(11) NOT NULL default '0',
      concerts_text text NOT NULL,
      PRIMARY KEY  (concerts_id,languages_id)
    ) TYPE=MyISAM;
    and i did fix the
    Code:
    $concerts_status = " and r.status = 1 ";
    to what it should be
    Code:
    $concerts_status = " and c.status = 1 ";

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,886
    Plugin Contributions
    6

    Default Re: duplicate reviews sidebox?

    The table constant definitions manage prefixes ...

    You have a constant:
    TABLE_ZEN_CONCERTS

    I would call this:
    TABLE_CONCERTS

    and then define it as the other tables are defined, for example, the reviews table is defined as:
    define('TABLE_REVIEWS', DB_PREFIX . 'reviews');

    This will "pickup" the table prefix if it is used from the configure.php file:
    define('DB_PREFIX', '');

    It there are prefixes used, they would be contained in that constant definition ...

    What are the constants for your new tables and what are the definitions used to define them?

    Where did you place these definitions?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  10. #10

    Default Re: duplicate reviews sidebox?

    i changed the mod file lijke you said,

    the definitions are here:

    includes/languages/english/extra_definitions/concerts.php

    Code:
    define('BOX_HEADING_CONCERTS', 'Concerts');
    define('BOX_CONCERTS_WRITE_CONCERT', 'Post a Concert related to this music.');
    define('BOX_CONCERTS_NO_CONCERTS', 'There are currently no concerts.');
    define('BOX_CONCERTS_TEXT_OF_5_STARS', '%s of 5 Stars!');
    define('TEXT_CONCERT_BY', 'by %s');
    define('TEXT_CONCERT_WORD_COUNT', '%s words');
    define('TEXT_CONCERT_RATING', 'Rating: %s [%s]');
    define('TEXT_CONCERT_DATE_ADDED', 'Date Added: %s');
    define('TEXT_NO_CONCERTS', 'There are currently no concerts.');
    includes/languages/english/concerts.php

    Code:
    define('NAVBAR_TITLE', 'Concerts');
    
    define('TEXT_OF_5_STARS', '');
    
    
    
    define('TEXT_PRODUCT_INFO', 'Music Information');
    
    define('TEXT_READ_CONCERT', 'View Concert');

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. reviews sidebox!? main page problem
    By MB1 in forum Basic Configuration
    Replies: 34
    Last Post: 3 Sep 2011, 02:17 AM
  2. Sidebox needed for article reviews
    By pinwest in forum Basic Configuration
    Replies: 0
    Last Post: 23 Sep 2008, 03:29 AM
  3. Remove Images from Reviews Sidebox
    By troutette in forum Addon Sideboxes
    Replies: 0
    Last Post: 31 Aug 2007, 02:49 PM
  4. New sidebox is adopting reviews sidebox title link.
    By stevenicel in forum Basic Configuration
    Replies: 0
    Last Post: 29 Nov 2006, 12:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •