Re: jQuery Scrolling Sideboxes [Support Thread]
I managed to stop the above Error log generating by commenting out the following line in /includes/modules/sideboxes/reviews_scrolling.php.
Code:
// if (isset($_GET['products_id'])) { $scrolling_review .= " and p.products_id = '" . (int)$_GET['products_id'] . "'"; }
The scrolling review box still seems to work fine, not sure if this was the correct way to stop that error log or if doing this will effect any other function on my website?!
Hope someone can confirm :lookaroun
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
rlexyd
I managed to stop the above Error log generating by commenting out the following line in /includes/modules/sideboxes/reviews_scrolling.php.
Code:
// if (isset($_GET['products_id'])) { $scrolling_review .= " and p.products_id = '" . (int)$_GET['products_id'] . "'"; }
The scrolling review box still seems to work fine, not sure if this was the correct way to stop that error log or if doing this will effect any other function on my website?!
Hope someone can confirm :lookaroun
You're appending that AND clause to the wrong variable:
Code:
if (isset($_GET['products_id'])) { $scrolling_review_sql .= " and p.products_id = '" . (int)$_GET['products_id'] . "'"; }
Re: jQuery Scrolling Sideboxes [Support Thread]
Thank you Cindy, that stopped the error log :)
Can you Please have a peak at the final code changes below and if you can give them your thumbs up :thumbsup: before I add them to my live site? Thanking you in advance!
1) includes/templates/MYTEMPLATE/sideboxes/tpl_reviews_random_scrolling.php:
Code:
$content = '<div id="scrolling_review" class="sideBoxContent centeredContent">';
$count = 1;
while (!$scrolling_review->EOF) {
$rs_pid = $scrolling_review->fields['products_id'];
$rs_pname = $scrolling_review->fields['products_name'];
$content .= PHP_EOL . ' <div class="sideBoxContentItem hiddenField reviewsScroller">';
$content .= "$rs_pname<br /><br /></a>";
$content .= '<a href="' . zen_href_link(FILENAME_PRODUCT_REVIEWS_INFO, 'products_id=' . $scrolling_review->fields['products_id'] . '&reviews_id=' . $scrolling_review->fields['reviews_id']) . '">' . zen_image(DIR_WS_IMAGES . $scrolling_review->fields['products_image'], $rs_pname, SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<br />' . nl2br(zen_trunc_string(zen_output_string_protected(stripslashes($scrolling_review->fields['reviews_text'])), 60)) . '</a><br /><br />' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $scrolling_review->fields['reviews_rating'] . '.png' , sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $scrolling_review->fields['reviews_rating']));
$content .= '</div>';
$count++;
$scrolling_review->MoveNextRandom();
}
$content .= '</div><script type="text/javascript">$("div.reviewsScroller").cycle(5000);</script>' . "\n";
2) includes/modules/sideboxes/reviews_scrolling.php:
Code:
$review_status = " and r.status = 1 ";
$scrolling_review_sql = "select r.reviews_id, r.reviews_rating, p.products_id, p.products_image, pd.products_name,
substring(reviews_text, 1, 70) as reviews_text
from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd, "
. TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
where p.products_status = '1'
and p.products_id = r.products_id
and r.reviews_id = rd.reviews_id
and rd.languages_id = '" . (int)$_SESSION['languages_id'] . "'
and p.products_id = pd.products_id
and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" .
$review_status;
if (isset($_GET['products_id'])) {
$scrolling_review_sql .= " and p.products_id = '" . (int)$_GET['products_id'] . "'";
}
$scrolling_review = $db->ExecuteRandomMulti($scrolling_review_sql, (int)MAX_RANDOM_SELECT_REVIEWS);
if (!$scrolling_review->EOF) {
require($template->get_template_dir('tpl_reviews_random_scrolling.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_reviews_random_scrolling.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_reviews_write.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_reviews_write.php');
} else {
// display 'no reviews' box
require($template->get_template_dir('tpl_reviews_none.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_reviews_none.php');
}
$title = BOX_HEADING_REVIEWS_SCROLLING;
$title_link = FILENAME_REVIEWS;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
?>
3) includes/languages/english/extra_definitions/scrolling_sideboxes.php:
Code:
define('BOX_HEADING_REVIEWS_SCROLLING', 'Reviews');
Re: jQuery Scrolling Sideboxes [Support Thread]
Looks similar to what I've got staged for release. The major differences are using HTML5 so I've changed all the <br /> to <br> and removed the type="text/javascript" from the <script> tag.
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
lat9
Looks similar to what I've got staged for release. The major differences are using HTML5 so I've changed all the <br /> to <br> and removed the type="text/javascript" from the <script> tag.
Thanks for the confirmation Cindy.
Just noticed the write review box on mobile view is not aligned well. https://i.imgur.com/qo45Xya.jpg
It's displaying half way, which is weird as this seems to only display that way when there is NO reviews to display on that product page.
If there is a product review for that product, than the scrolling review box appears correctly on the page.
Any suggestions on how to center that write review box correctly?
Thank you.
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
rlexyd
Thanks for the confirmation Cindy.
Just noticed the write review box on mobile view is not aligned well.
https://i.imgur.com/qo45Xya.jpg
It's displaying half way, which is weird as this seems to only display that way when there is NO reviews to display on that product page.
If there is a product review for that product, than the scrolling review box appears correctly on the page.
Any suggestions on how to center that write review box correctly?
Thank you.
No suggestions in this support-thread, since that's template-dependent. How about posting in the support-thread for the template you're using.
Re: jQuery Scrolling Sideboxes [Support Thread]
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
honrheart
Will this work on 2.0?
I see no reason why these sideboxes should not work on zc200's responsive_classic template or a clone thereof.
Re: jQuery Scrolling Sideboxes [Support Thread]
is there a trick to get it to scroll in 2.0? The box shows up but there is no scrolling as it's only showing 1 product although there are more new products in the store.
Re: jQuery Scrolling Sideboxes [Support Thread]
Quote:
Originally Posted by
honrheart
is there a trick to get it to scroll in 2.0? The box shows up but there is no scrolling as it's only showing 1 product although there are more new products in the store.
I dunno, haven't tried. When you're viewing the site, press your browser's F12 (in Windows or the equivalent for your OS) to view the Developers' Tools. Click the "Console" tab to see if there are any errors.
If the site's accessible, you can post a link like https://mysite(dot)com so that others can view but search engines won't.