Hi, I'm using 1.5 and love testimonial manager. Having a strange issue where things go haywire on all testimonial display when I add testimonial #5.
Admittedly I know just enough about zen to be dangerous and I did add a product field and a switch case request to allow links to a specific product's testimonials. Is it because of my hack or has anyone run into this before?
And yes...I know the styling should all be in my css files, but my server is caching the css results and I can find no quick relief, so please pardon the inline styling here. :-/
Appreciate any help or guidance. Thanks so much!
Code:
<?php
/**
* Testimonials Manager
*
* @package Template System
* @copyright 2007 Clyde Jones
* @copyright Portions Copyright 2003-2007 Zen Cart Development Team
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: Testimonials_Manager.php v1.5.4
*/
?> <style>
blockquote {margin:0 !important;padding:0 !important;
-webkit-border-radius: 20px; -mozborder-radius: 20px; border-radius: 20px;
box-shadow: 5px 5px 5px #007;;
height:1%;width:95%;
background-color:#ffffff;}
blockquote div {padding:38px 56px;height:1%;margin-left:auto; margin-right:auto;}
</style>
<div class="centerColumn" id="testimonialDefault" style="background-image:url(includes/templates/classic/images/background-wallpaper2.jpg); box-shadow: 5px 5px 5px #007;">
<? switch($_REQUEST['req']){
case "read": ?>
<h3> All Testimonials for:</h3>
<? $query = mysql_query("SELECT * FROM zen_testimonials_manager
WHERE testimonials_pid='{$_GET['testimonials_pid']}'");?>
<? $row = mysql_fetch_assoc($query);
$pid = $row['testimonials_pid'];
{?>
<div style="width:250px; height:250px; box-shadow:5px 5px 5px #000080; text-align:center; margin-right:auto; margin-left:auto; border-radius:25px;background-image:url(images/products/<? echo $pid?>.jpg); background-size: 250px 250px;"></div><br />
<? echo "<a href='index.php?main_page=product_info&products_id=".$pid."'>"; echo "<p><br />Click here for product details.</p></a>";?>
<?php
}
?>
<br class="clearBoth" />
<? $query = mysql_query("SELECT * FROM zen_testimonials_manager
WHERE testimonials_pid='{$_GET['testimonials_pid']}'");?>
<? while($row = mysql_fetch_assoc($query)){
$text = $row['testimonials_html_text'];
$pid = $row['testimonials_pid'];
$id = $row['products_id'];
$title = $row['testimonials_title'];
$author = $row['testimonials_name'];
?>
<blockquote>
<div class="testimonial">
<h3><? echo $title ?></h3>
<p>"<?php echo $text?>"</p>
<p align="right"><? echo $author?></p>
</div>
</blockquote><br /><br />
<br class="clearBoth" />
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
<div class="buttonRow forward"><a href="<?php echo zen_href_link(FILENAME_TESTIMONIALS_ADD, '', 'SSL'); ?>"><?php echo zen_image_button(BUTTON_IMAGE_TESTIMONIALS, BUTTON_TESTIMONIALS_ADD_ALT); ?></a></div>
<br class="clearBoth" />
</div><?
} break; ?>
<? default: ?>
<span style="color:#fff"><?php echo HEADING_TITLE; ?></span>
<?php
// $testimonials_query_raw = "select * from " . TABLE_TESTIMONIALS_MANAGER . " where status = 1 and language_id = '" . (int)$_SESSION['languages_id'] . "' order by date_added DESC, testimonials_title";
// $testimonials_split = new splitPageResults($testimonials_query_raw, MAX_DISPLAY_TESTIMONIALS_MANAGER_ALL_TESTIMONIALS);
if (($testimonials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<div id="productsListingTopNumber" class="navSplitPagesResult back"><?php echo $testimonials_split->display_count(TEXT_DISPLAY_NUMBER_OF_TESTIMONIALS_MANAGER_ITEMS); ?></div>
<div id="productsListingListingTopLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $testimonials_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div>
<br />
<br class="clearBoth" />
<hr />
<?php
} // split page
?>
<?php
$testimonials = $db->Execute($testimonials_split->sql_query);
while (!$testimonials->EOF) {
$date_published = $testimonials->fields['date_added'];
?>
<blockquote>
<div class="testimonial">
<table width="100%" border="0" cellpadding="5">
<tr>
<td width="44%"><p class="back"><b><a href="<?php echo zen_href_link(FILENAME_TESTIMONIALS_MANAGER, 'testimonials_id=' . $testimonials->fields['testimonials_id']);?>"><?php echo $testimonials->fields['testimonials_title'];?></a></b></p>
</td>
<td width="56%"><p class="forward"><?php if (DISPLAY_TESTIMONIALS_DATE_PUBLISHED == 'true') { echo zen_date_long($date_published); } ?></p><br class="clearBoth" /></td>
</tr>
<tr>
<td><?php
if (($testimonials->fields[testimonials_image]) != ('')) {
$testimonials_image = zen_image(DIR_WS_IMAGES . $testimonials->fields[testimonials_image], $testimonials->fields['testimonials_title'], TESTIMONIAL_IMAGE_WIDTH, TESTIMONIAL_IMAGE_HEIGHT);
?><?php /*if (($testimonials->fields['testimonials_url']) == ('http://') or ($testimonials->fields['testimonials_url']) == ('')) {
echo $testimonials_image;
} else {
echo '<a href="' . $testimonials->fields['testimonials_url'] . '" target="_blank">' . $testimonials_image . '</a>';
}*/
?>
<a href="index.php?main_page=product_info&products_id=<? echo $testimonials->fields['testimonials_pid']?>"><img src="images/products/<? echo ($testimonials->fields['testimonials_pid'])?>.jpg" width="250" height="250" alt="Mark Cahill Ministries" /></a><br /><? if ($testimonials->fields['testimonials_pid'] !=0){
echo "<a href='index.php?main_page=product_info&products_id=".nl2br($testimonials->fields['testimonials_pid']."'>"); ?> </p>
<p><br />
Click here for product details.</p>
</a>
<? } ?></td>
<td style="font-size:16px; font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, serif">"<?php echo nl2br($testimonials->fields['testimonials_html_text']);?>"
<p align="right"> <span class="buttonRow back" style="text-align:right; font-size:11px;"><?php echo TESTIMONIALS_BY; ?> <?php echo $testimonials->fields[testimonials_name] . $testimonial_info; ?></span></p></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</table>
<?php
}
?>
</div>
</blockquote>
<?php
$testimonial_info = '';
if ( (!empty($testimonials->fields[testimonials_city])) and (!empty($testimonials->fields[testimonials_country])) ) {
$testimonial_info .= NAME_SEPARATOR . $testimonials->fields[testimonials_city] . CITY_STATE_SEPARATOR . $testimonials->fields[testimonials_country];
}
if ( (!empty($testimonials->fields[testimonials_city])) and (empty($testimonials->fields[testimonials_country])) ) {
$testimonial_info .= NAME_SEPARATOR . $testimonials->fields[testimonials_city];
}
if ( (empty($testimonials->fields[testimonials_city])) and (!empty($testimonials->fields[testimonials_country])) ) {
$testimonial_info .= NAME_SEPARATOR . $testimonials->fields[testimonials_country];
}
if (!empty($testimonials->fields[testimonials_company])) {
$testimonial_info .= NAME_SEPARATOR . $testimonials->fields[testimonials_company];
}
?>
<br class="clearBoth" />
<br />
<hr />
<?php
$testimonials->MoveNext();
}
?>
<?php
if (($testimonials_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {
?>
<div id="productsListingBottomNumber" class="navSplitPagesResult back"><?php echo $testimonials_split->display_count(TEXT_DISPLAY_NUMBER_OF_TESTIMONIALS_MANAGER_ITEMS); ?></div>
<div id="productsListingListingBottomLinks" class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $testimonials_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div>
<?php
} // split page
?>
<br class="clearBoth" />
<div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
<div class="buttonRow forward"><a href="<?php echo zen_href_link(FILENAME_TESTIMONIALS_ADD, '', 'SSL'); ?>"><?php echo zen_image_button(BUTTON_IMAGE_TESTIMONIALS, BUTTON_TESTIMONIALS_ADD_ALT); ?></a></div>
<br class="clearBoth" />
</div><? } ?>
Bookmarks