function fn_exim_products_discussion_export($product_id) { $data = fn_get_discussion($product_id, 'P'); if (!empty($data['type'])) { $return = $data['type']; } else { $return = false; } return $return; }
} } } $show_discussion_crumb = true; if ($data['object_type'] == 'E') { // testimonials $show_discussion_crumb = false; } $discussion_object_data = fn_get_discussion_object_data($data['object_id'], $data['object_type']); fn_add_breadcrumb($discussion_object_data['description'], $discussion_object_data['url']); if ($show_discussion_crumb && AREA != 'A') { fn_add_breadcrumb(__('discussion')); } if (!empty($_SESSION['discussion_post_id'])) { Registry::get('view')->assign('current_post_id', $_SESSION['discussion_post_id']); unset($_SESSION['discussion_post_id']); } $discussion = fn_get_discussion($data['object_id'], $data['object_type'], true, $_REQUEST); Registry::get('view')->assign('search', $discussion['search']); Registry::get('view')->assign('object_id', $data['object_id']); Registry::get('view')->assign('title', $discussion_object_data['description']); Registry::get('view')->assign('object_type', $data['object_type']); } function fn_discussion_get_object_by_thread($thread_id) { static $cache = array(); if (empty($cache[$thread_id])) { $cache[$thread_id] = db_get_row("SELECT object_type, object_id, type FROM ?:discussion WHERE thread_id = ?i", $thread_id); } return $cache[$thread_id]; }
/*************************************************************************** * * * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if (!empty($_REQUEST['discussion']) && !empty($_REQUEST['discussion']['object_id']) && !empty($_REQUEST['discussion']['object_type'])) { $discussion = fn_get_discussion($_REQUEST['discussion']['object_id'], $_REQUEST['discussion']['object_type']); if (!empty($discussion['thread_id'])) { db_query('UPDATE ?:discussion SET ?u WHERE thread_id = ?i', $_REQUEST['discussion'], $discussion['thread_id']); } else { $_data = $_REQUEST['discussion']; if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) { $_data['company_id'] = Registry::get('runtime.company_id'); } db_query("REPLACE INTO ?:discussion ?e", $_data); } } return; }
<?php // // $Id: news.post.php 7502 2009-05-19 14:54:59Z zeke $ // if (!defined('AREA')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { return; } if ($mode == 'update') { $discussion = fn_get_discussion($_REQUEST['news_id'], 'N'); if (!empty($discussion) && $discussion['type'] != 'D') { Registry::set('navigation.tabs.discussion', array('title' => fn_get_lang_var('discussion_title_news'), 'js' => true)); $view->assign('discussion', $discussion); } }
**************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($mode == 'update') { if (!empty($_REQUEST['posts'])) { fn_update_discussion_posts($_REQUEST['posts']); } } return; } if ($mode == 'update') { $page = Tygh::$app['view']->getTemplateVars('page_data'); $discussion = fn_get_discussion($_REQUEST['page_id'], 'A', true, $_REQUEST); if (!empty($discussion) && $discussion['type'] != 'D' && $page['page_type'] != PAGE_TYPE_LINK) { if (fn_allowed_for('MULTIVENDOR') || fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) { Registry::set('navigation.tabs.discussion', array('title' => __('discussion_title_page'), 'js' => true)); Tygh::$app['view']->assign('discussion', $discussion); } } } elseif ($mode == 'm_update') { if ($selected_fields['discussion_type'] == 'Y') { $field_names['discussion_type'] = __('discussion_title_page'); $fields2update[] = 'discussion_type'; } }
if (!empty($_REQUEST['discussion'])) { $discussion = fn_get_discussion($_REQUEST['discussion']['object_id'], $_REQUEST['discussion']['object_type']); if (!empty($discussion['thread_id']) && $discussion['type'] != $_REQUEST['discussion']['type']) { db_query('UPDATE ?:discussion SET ?u WHERE thread_id = ?i', $_REQUEST['discussion'], $discussion['thread_id']); if ($_REQUEST['discussion']['type'] != 'D') { $_REQUEST['selected_section'] = 'discussion'; } } elseif (empty($discussion['thread_id'])) { $data = $_REQUEST['discussion']; if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) { $data['company_id'] = Registry::get('runtime.company_id'); } elseif (fn_allowed_for('ULTIMATE') && Registry::get('runtime.simple_ultimate')) { $data['company_id'] = Registry::get('runtime.forced_company_id'); } db_query("REPLACE INTO ?:discussion ?e", $data); if ($_REQUEST['discussion']['type'] != 'D') { $_REQUEST['selected_section'] = 'discussion'; } } } } } if ($mode == 'details') { $discussion = fn_get_discussion($_REQUEST['order_id'], 'O', true, $_REQUEST); if (!empty($discussion) && $discussion['type'] != 'D') { if (fn_allowed_for('MULTIVENDOR') || fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id') || Registry::get('runtime.simple_ultimate')) { Registry::set('navigation.tabs.discussion', array('title' => __('communication'), 'js' => true)); Registry::get('view')->assign('discussion', $discussion); } } }
<?php /*************************************************************************** * * * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($mode == 'view' || $mode == 'quick_view') { $product = Registry::get('view')->getTemplateVars('product'); $product['discussion'] = fn_get_discussion($product['product_id'], "P", true, $_REQUEST); Registry::get('view')->assign('product', $product); }
* (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($mode == 'update') { if (!empty($_REQUEST['posts'])) { fn_update_discussion_posts($_REQUEST['posts']); } } return; } if ($mode == 'update') { $discussion = fn_get_discussion($_REQUEST['news_id'], 'N', true, $_REQUEST); if (!empty($discussion) && $discussion['type'] != 'D') { if (fn_allowed_for('MULTIVENDOR') || fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) { Registry::set('navigation.tabs.discussion', array('title' => __('discussion_title_news'), 'js' => true)); Registry::get('view')->assign('discussion', $discussion); } } }
<?php /*************************************************************************** * * * (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($mode == 'initiate_discussion' && !empty($_REQUEST['order_id'])) { $_data = array('object_id' => $_REQUEST['order_id'], 'object_type' => 'O', 'type' => 'C'); $discussion = fn_get_discussion($_REQUEST['order_id'], 'O'); if (!empty($discussion['thread_id'])) { db_query("UPDATE ?:discussion SET ?u WHERE thread_id = ?i", $_data, $discussion['thread_id']); } else { if (fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) { $_data['company_id'] = Registry::get('runtime.company_id'); } db_query("REPLACE INTO ?:discussion ?e", $_data); } return array(CONTROLLER_STATUS_REDIRECT, "orders.details?order_id={$_REQUEST['order_id']}&selected_section=discussion"); }
function content_55d7320b9467b7_31111710($_smarty_tpl) { if (!is_callable('smarty_block_hook')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php'; } if (!is_callable('smarty_modifier_date_format')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.date_format.php'; } if (!is_callable('smarty_function_cycle')) { include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.cycle.php'; } if (!is_callable('smarty_modifier_replace')) { include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/modifier.replace.php'; } if (!is_callable('smarty_function_set_id')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php'; } fn_preload_lang_vars(array('write_review', 'new_post', 'no_posts_found', 'sign_in', 'purchase_to_review', 'sign_in_and_purchase_to_review', 'sign_in', 'sign_in', 'sign_in_to_review', 'sign_in', 'write_review', 'new_post', 'no_posts_found', 'sign_in', 'purchase_to_review', 'sign_in_and_purchase_to_review', 'sign_in', 'sign_in', 'sign_in_to_review', 'sign_in')); if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") { $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null); ob_start(); $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value, true, $_REQUEST), null, 0); if ($_smarty_tpl->tpl_vars['object_type']->value == "P") { ?> <?php $_smarty_tpl->tpl_vars['new_post_title'] = new Smarty_variable($_smarty_tpl->__("write_review"), null, 0); } else { ?> <?php $_smarty_tpl->tpl_vars['new_post_title'] = new Smarty_variable($_smarty_tpl->__("new_post"), null, 0); } if ($_smarty_tpl->tpl_vars['discussion']->value && $_smarty_tpl->tpl_vars['discussion']->value['type'] != "D") { ?> <div class="discussion-block" id="<?php if ($_smarty_tpl->tpl_vars['container_id']->value) { echo htmlspecialchars($_smarty_tpl->tpl_vars['container_id']->value, ENT_QUOTES, 'UTF-8'); } else { ?> content_discussion<?php } ?> "> <?php if ($_smarty_tpl->tpl_vars['wrap']->value == true) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("content", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['title']->value), 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['subheader']->value) { ?> <h4><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['subheader']->value, ENT_QUOTES, 'UTF-8'); ?> </h4> <?php } ?> <div id="posts_list"> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['posts']) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value, 'extra_url' => "&selected_section=discussion", 'search' => $_smarty_tpl->tpl_vars['discussion']->value['search']), 0); ?> <?php $_smarty_tpl->tpl_vars['post'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['post']->_loop = false; $_from = $_smarty_tpl->tpl_vars['discussion']->value['posts']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['post']->key => $_smarty_tpl->tpl_vars['post']->value) { $_smarty_tpl->tpl_vars['post']->_loop = true; ?> <div class="ty-discussion-post__content"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "discussion:items_list_row")); $_block_repeat = true; echo smarty_block_hook(array('name' => "discussion:items_list_row"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <span class="ty-discussion-post__author"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['name'], ENT_QUOTES, 'UTF-8'); ?> </span> <span class="ty-discussion-post__date"><?php echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['post']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8'); ?> </span> <div class="ty-discussion-post <?php echo smarty_function_cycle(array('values' => ", ty-discussion-post_even"), $_smarty_tpl); ?> " id="post_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8'); ?> "> <span class="ty-caret"> <span class="ty-caret-outer"></span> <span class="ty-caret-inner"></span></span> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B" && $_smarty_tpl->tpl_vars['post']->value['rating_value'] > 0) { ?> <div class="clearfix ty-discussion-post__rating"> <?php echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0); ?> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") { ?> <div class="ty-discussion-post__message"><?php echo nl2br(htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message'], ENT_QUOTES, 'UTF-8', true)); ?> </div> <?php } ?> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "discussion:items_list_row"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value, 'extra_url' => "&selected_section=discussion", 'search' => $_smarty_tpl->tpl_vars['discussion']->value['search']), 0); ?> <?php } else { ?> <p class="ty-no-items"><?php echo $_smarty_tpl->__("no_posts_found"); ?> </p> <?php } ?> <!--posts_list--></div> <?php if (strpos("CRB", $_smarty_tpl->tpl_vars['discussion']->value['type']) !== false && !$_smarty_tpl->tpl_vars['discussion']->value['disable_adding']) { ?> <?php if ($_smarty_tpl->tpl_vars['object_type']->value == 'P' && $_smarty_tpl->tpl_vars['addons']->value['cscr_purchase_to_review']['review_setup'] == 'purchase_to_review') { ?> <?php $_smarty_tpl->tpl_vars["is_purchased"] = new Smarty_variable(fn_check_customer_purchase($_smarty_tpl->tpl_vars['auth']->value['user_id'], $_smarty_tpl->tpl_vars['object_id']->value), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['is_purchased']->value == 'Y') { ?> <div class="ty-discussion-post__buttons buttons-container"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_new_post", 'but_text' => $_smarty_tpl->tpl_vars['new_post_title']->value, 'but_role' => "submit", 'but_target_id' => "new_post_dialog_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'but_meta' => "cm-dialog-opener cm-dialog-auto-size ty-btn__primary", 'but_rel' => "nofollow"), 0); ?> </div> <?php echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion/components/new_post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('new_post_title' => $_smarty_tpl->tpl_vars['new_post_title']->value), 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["return_current_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("cscr_sign_in", null, null); ob_start(); ?> <a href="<?php if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "auth" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "login_form") { echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['config']->value['current_url']), ENT_QUOTES, 'UTF-8'); } else { echo htmlspecialchars(fn_url("auth.login_form?return_url=" . (string) $_smarty_tpl->tpl_vars['return_current_url']->value), ENT_QUOTES, 'UTF-8'); } ?> " <?php if ($_smarty_tpl->tpl_vars['settings']->value['Security']['secure_auth'] != "Y") { ?> data-ca-target-id="login_block<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['snapping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="cm-dialog-opener cm-dialog-auto-size ty-btn ty-btn__primary"<?php } else { ?> class="ty-btn ty-btn__primary"<?php } ?> rel="nofollow"><?php echo $_smarty_tpl->__("sign_in"); ?> </a> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php if ($_smarty_tpl->tpl_vars['auth']->value['user_id']) { echo $_smarty_tpl->__("purchase_to_review"); } else { echo smarty_modifier_replace($_smarty_tpl->__("sign_in_and_purchase_to_review"), "[sign_in]", Smarty::$_smarty_vars['capture']['cscr_sign_in']); } ?> <?php if ($_smarty_tpl->tpl_vars['settings']->value['Security']['secure_auth'] != "Y") { ?> <div id="login_block<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['snapping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="hidden" title="<?php echo $_smarty_tpl->__("sign_in"); ?> "> <div class="ty-login-popup"> <?php echo $_smarty_tpl->getSubTemplate("views/auth/login_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('style' => "popup", 'id' => "popup" . (string) $_smarty_tpl->tpl_vars['block']->value['snapping_id']), 0); ?> </div> </div> <?php } ?> <?php } ?> <?php } elseif ($_smarty_tpl->tpl_vars['object_type']->value != 'P' && $_smarty_tpl->tpl_vars['addons']->value['cscr_purchase_to_review']['review_setup'] == 'purchase_to_review') { ?> <div class="ty-discussion-post__buttons buttons-container"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_new_post", 'but_text' => $_smarty_tpl->tpl_vars['new_post_title']->value, 'but_role' => "submit", 'but_target_id' => "new_post_dialog_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'but_meta' => "cm-dialog-opener cm-dialog-auto-size ty-btn__primary", 'but_rel' => "nofollow"), 0); ?> </div> <?php echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion/components/new_post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('new_post_title' => $_smarty_tpl->tpl_vars['new_post_title']->value), 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['addons']->value['cscr_purchase_to_review']['review_setup'] == 'sign_in_to_review') { ?> <?php if ($_smarty_tpl->tpl_vars['auth']->value['user_id']) { ?> <div class="ty-discussion-post__buttons buttons-container"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_new_post", 'but_text' => $_smarty_tpl->tpl_vars['new_post_title']->value, 'but_role' => "submit", 'but_target_id' => "new_post_dialog_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'but_meta' => "cm-dialog-opener cm-dialog-auto-size ty-btn__primary", 'but_rel' => "nofollow"), 0); ?> </div> <?php echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion/components/new_post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('new_post_title' => $_smarty_tpl->tpl_vars['new_post_title']->value), 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["return_current_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("cscr_sign_in", null, null); ob_start(); ?> <a href="<?php if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "auth" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "login_form") { echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['config']->value['current_url']), ENT_QUOTES, 'UTF-8'); } else { echo htmlspecialchars(fn_url("auth.login_form?return_url=" . (string) $_smarty_tpl->tpl_vars['return_current_url']->value), ENT_QUOTES, 'UTF-8'); } ?> " <?php if ($_smarty_tpl->tpl_vars['settings']->value['Security']['secure_auth'] != "Y") { ?> data-ca-target-id="login_block<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['snapping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="cm-dialog-opener cm-dialog-auto-size ty-btn ty-btn__primary"<?php } else { ?> class="ty-btn ty-btn__primary"<?php } ?> rel="nofollow"><?php echo $_smarty_tpl->__("sign_in"); ?> </a> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo smarty_modifier_replace($_smarty_tpl->__("sign_in_to_review"), "[sign_in]", Smarty::$_smarty_vars['capture']['cscr_sign_in']); ?> <?php if ($_smarty_tpl->tpl_vars['settings']->value['Security']['secure_auth'] != "Y") { ?> <div id="login_block<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['snapping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="hidden" title="<?php echo $_smarty_tpl->__("sign_in"); ?> "> <div class="ty-login-popup"> <?php echo $_smarty_tpl->getSubTemplate("views/auth/login_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('style' => "popup", 'id' => "popup" . (string) $_smarty_tpl->tpl_vars['block']->value['snapping_id']), 0); ?> </div> </div> <?php } ?> <?php } ?> <?php } ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['wrap']->value == true) { ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo Smarty::$_smarty_vars['capture']['content']; ?> <?php } else { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null); ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8'); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php } ?> </div> <?php } list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } if (trim(Smarty::$_smarty_vars['capture']['template_content'])) { if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") { ?> <span class="cm-template-box template-box" data-ca-te-template="addons/cscr_purchase_to_review/overrides/addons/discussion/views/discussion/view.tpl" id="<?php echo smarty_function_set_id(array('name' => "addons/cscr_purchase_to_review/overrides/addons/discussion/views/discussion/view.tpl"), $_smarty_tpl); ?> "><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php echo Smarty::$_smarty_vars['capture']['template_content']; ?> <!--[/tpl_id]--></span><?php } else { echo Smarty::$_smarty_vars['capture']['template_content']; } } } else { $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value, true, $_REQUEST), null, 0); if ($_smarty_tpl->tpl_vars['object_type']->value == "P") { ?> <?php $_smarty_tpl->tpl_vars['new_post_title'] = new Smarty_variable($_smarty_tpl->__("write_review"), null, 0); } else { ?> <?php $_smarty_tpl->tpl_vars['new_post_title'] = new Smarty_variable($_smarty_tpl->__("new_post"), null, 0); } if ($_smarty_tpl->tpl_vars['discussion']->value && $_smarty_tpl->tpl_vars['discussion']->value['type'] != "D") { ?> <div class="discussion-block" id="<?php if ($_smarty_tpl->tpl_vars['container_id']->value) { echo htmlspecialchars($_smarty_tpl->tpl_vars['container_id']->value, ENT_QUOTES, 'UTF-8'); } else { ?> content_discussion<?php } ?> "> <?php if ($_smarty_tpl->tpl_vars['wrap']->value == true) { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("content", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['title']->value), 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['subheader']->value) { ?> <h4><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['subheader']->value, ENT_QUOTES, 'UTF-8'); ?> </h4> <?php } ?> <div id="posts_list"> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['posts']) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value, 'extra_url' => "&selected_section=discussion", 'search' => $_smarty_tpl->tpl_vars['discussion']->value['search']), 0); ?> <?php $_smarty_tpl->tpl_vars['post'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['post']->_loop = false; $_from = $_smarty_tpl->tpl_vars['discussion']->value['posts']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['post']->key => $_smarty_tpl->tpl_vars['post']->value) { $_smarty_tpl->tpl_vars['post']->_loop = true; ?> <div class="ty-discussion-post__content"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "discussion:items_list_row")); $_block_repeat = true; echo smarty_block_hook(array('name' => "discussion:items_list_row"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <span class="ty-discussion-post__author"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['name'], ENT_QUOTES, 'UTF-8'); ?> </span> <span class="ty-discussion-post__date"><?php echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['post']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8'); ?> </span> <div class="ty-discussion-post <?php echo smarty_function_cycle(array('values' => ", ty-discussion-post_even"), $_smarty_tpl); ?> " id="post_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8'); ?> "> <span class="ty-caret"> <span class="ty-caret-outer"></span> <span class="ty-caret-inner"></span></span> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B" && $_smarty_tpl->tpl_vars['post']->value['rating_value'] > 0) { ?> <div class="clearfix ty-discussion-post__rating"> <?php echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0); ?> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") { ?> <div class="ty-discussion-post__message"><?php echo nl2br(htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message'], ENT_QUOTES, 'UTF-8', true)); ?> </div> <?php } ?> </div> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "discussion:items_list_row"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> <?php } ?> <?php echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value, 'extra_url' => "&selected_section=discussion", 'search' => $_smarty_tpl->tpl_vars['discussion']->value['search']), 0); ?> <?php } else { ?> <p class="ty-no-items"><?php echo $_smarty_tpl->__("no_posts_found"); ?> </p> <?php } ?> <!--posts_list--></div> <?php if (strpos("CRB", $_smarty_tpl->tpl_vars['discussion']->value['type']) !== false && !$_smarty_tpl->tpl_vars['discussion']->value['disable_adding']) { ?> <?php if ($_smarty_tpl->tpl_vars['object_type']->value == 'P' && $_smarty_tpl->tpl_vars['addons']->value['cscr_purchase_to_review']['review_setup'] == 'purchase_to_review') { ?> <?php $_smarty_tpl->tpl_vars["is_purchased"] = new Smarty_variable(fn_check_customer_purchase($_smarty_tpl->tpl_vars['auth']->value['user_id'], $_smarty_tpl->tpl_vars['object_id']->value), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['is_purchased']->value == 'Y') { ?> <div class="ty-discussion-post__buttons buttons-container"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_new_post", 'but_text' => $_smarty_tpl->tpl_vars['new_post_title']->value, 'but_role' => "submit", 'but_target_id' => "new_post_dialog_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'but_meta' => "cm-dialog-opener cm-dialog-auto-size ty-btn__primary", 'but_rel' => "nofollow"), 0); ?> </div> <?php echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion/components/new_post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('new_post_title' => $_smarty_tpl->tpl_vars['new_post_title']->value), 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["return_current_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("cscr_sign_in", null, null); ob_start(); ?> <a href="<?php if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "auth" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "login_form") { echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['config']->value['current_url']), ENT_QUOTES, 'UTF-8'); } else { echo htmlspecialchars(fn_url("auth.login_form?return_url=" . (string) $_smarty_tpl->tpl_vars['return_current_url']->value), ENT_QUOTES, 'UTF-8'); } ?> " <?php if ($_smarty_tpl->tpl_vars['settings']->value['Security']['secure_auth'] != "Y") { ?> data-ca-target-id="login_block<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['snapping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="cm-dialog-opener cm-dialog-auto-size ty-btn ty-btn__primary"<?php } else { ?> class="ty-btn ty-btn__primary"<?php } ?> rel="nofollow"><?php echo $_smarty_tpl->__("sign_in"); ?> </a> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php if ($_smarty_tpl->tpl_vars['auth']->value['user_id']) { echo $_smarty_tpl->__("purchase_to_review"); } else { echo smarty_modifier_replace($_smarty_tpl->__("sign_in_and_purchase_to_review"), "[sign_in]", Smarty::$_smarty_vars['capture']['cscr_sign_in']); } ?> <?php if ($_smarty_tpl->tpl_vars['settings']->value['Security']['secure_auth'] != "Y") { ?> <div id="login_block<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['snapping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="hidden" title="<?php echo $_smarty_tpl->__("sign_in"); ?> "> <div class="ty-login-popup"> <?php echo $_smarty_tpl->getSubTemplate("views/auth/login_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('style' => "popup", 'id' => "popup" . (string) $_smarty_tpl->tpl_vars['block']->value['snapping_id']), 0); ?> </div> </div> <?php } ?> <?php } ?> <?php } elseif ($_smarty_tpl->tpl_vars['object_type']->value != 'P' && $_smarty_tpl->tpl_vars['addons']->value['cscr_purchase_to_review']['review_setup'] == 'purchase_to_review') { ?> <div class="ty-discussion-post__buttons buttons-container"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_new_post", 'but_text' => $_smarty_tpl->tpl_vars['new_post_title']->value, 'but_role' => "submit", 'but_target_id' => "new_post_dialog_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'but_meta' => "cm-dialog-opener cm-dialog-auto-size ty-btn__primary", 'but_rel' => "nofollow"), 0); ?> </div> <?php echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion/components/new_post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('new_post_title' => $_smarty_tpl->tpl_vars['new_post_title']->value), 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['addons']->value['cscr_purchase_to_review']['review_setup'] == 'sign_in_to_review') { ?> <?php if ($_smarty_tpl->tpl_vars['auth']->value['user_id']) { ?> <div class="ty-discussion-post__buttons buttons-container"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_new_post", 'but_text' => $_smarty_tpl->tpl_vars['new_post_title']->value, 'but_role' => "submit", 'but_target_id' => "new_post_dialog_" . (string) $_smarty_tpl->tpl_vars['obj_id']->value, 'but_meta' => "cm-dialog-opener cm-dialog-auto-size ty-btn__primary", 'but_rel' => "nofollow"), 0); ?> </div> <?php echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion/components/new_post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('new_post_title' => $_smarty_tpl->tpl_vars['new_post_title']->value), 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["return_current_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); ?> <?php $_smarty_tpl->_capture_stack[0][] = array("cscr_sign_in", null, null); ob_start(); ?> <a href="<?php if ($_smarty_tpl->tpl_vars['runtime']->value['controller'] == "auth" && $_smarty_tpl->tpl_vars['runtime']->value['mode'] == "login_form") { echo htmlspecialchars(fn_url($_smarty_tpl->tpl_vars['config']->value['current_url']), ENT_QUOTES, 'UTF-8'); } else { echo htmlspecialchars(fn_url("auth.login_form?return_url=" . (string) $_smarty_tpl->tpl_vars['return_current_url']->value), ENT_QUOTES, 'UTF-8'); } ?> " <?php if ($_smarty_tpl->tpl_vars['settings']->value['Security']['secure_auth'] != "Y") { ?> data-ca-target-id="login_block<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['snapping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="cm-dialog-opener cm-dialog-auto-size ty-btn ty-btn__primary"<?php } else { ?> class="ty-btn ty-btn__primary"<?php } ?> rel="nofollow"><?php echo $_smarty_tpl->__("sign_in"); ?> </a> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo smarty_modifier_replace($_smarty_tpl->__("sign_in_to_review"), "[sign_in]", Smarty::$_smarty_vars['capture']['cscr_sign_in']); ?> <?php if ($_smarty_tpl->tpl_vars['settings']->value['Security']['secure_auth'] != "Y") { ?> <div id="login_block<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['snapping_id'], ENT_QUOTES, 'UTF-8'); ?> " class="hidden" title="<?php echo $_smarty_tpl->__("sign_in"); ?> "> <div class="ty-login-popup"> <?php echo $_smarty_tpl->getSubTemplate("views/auth/login_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('style' => "popup", 'id' => "popup" . (string) $_smarty_tpl->tpl_vars['block']->value['snapping_id']), 0); ?> </div> </div> <?php } ?> <?php } ?> <?php } ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['wrap']->value == true) { ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo Smarty::$_smarty_vars['capture']['content']; ?> <?php } else { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null); ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8'); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php } ?> </div> <?php } } }
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($mode == 'update') { if (!empty($_REQUEST['posts'])) { fn_update_discussion_posts($_REQUEST['posts']); } } return; } if ($mode == 'update') { $discussion = fn_get_discussion($_REQUEST['product_id'], 'P', true, $_REQUEST); if (!empty($discussion) && $discussion['type'] != 'D') { if (fn_allowed_for('MULTIVENDOR') || fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) { Registry::set('navigation.tabs.discussion', array('title' => __('discussion_title_product'), 'js' => true)); Tygh::$app['view']->assign('discussion', $discussion); } } } elseif ($mode == 'manage') { $selected_fields = Tygh::$app['view']->getTemplateVars('selected_fields'); $selected_fields[] = array('name' => '[products_data][discussion_type]', 'text' => __('discussion_title_product')); Tygh::$app['view']->assign('selected_fields', $selected_fields); } elseif ($mode == 'm_update') { $selected_fields = $_SESSION['selected_fields']; if (!empty($selected_fields['products_data'])) { $field_groups = Tygh::$app['view']->getTemplateVars('field_groups'); $filled_groups = Tygh::$app['view']->getTemplateVars('filled_groups');
function content_55cdb2ac85faf1_67964872($_smarty_tpl) { fn_preload_lang_vars(array('communication', 'and', 'rating', 'communication', 'rating', 'disabled', 'communication', 'and', 'rating', 'communication', 'rating', 'disabled')); ?> <div class="control-group <?php if ($_smarty_tpl->tpl_vars['no_hide_input']->value) { ?> cm-no-hide-input<?php } ?> "> <label class="control-label" for="discussion_type"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8'); ?> :</label> <div class="controls"> <?php $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value), null, 0); ?> <?php if (fn_check_view_permissions("discussion.add")) { ?> <select name="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['prefix']->value, ENT_QUOTES, 'UTF-8'); ?> [discussion_type]" id="discussion_type"> <option <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") { ?> selected="selected"<?php } ?> value="B"><?php echo $_smarty_tpl->__("communication"); ?> <?php echo $_smarty_tpl->__("and"); ?> <?php echo $_smarty_tpl->__("rating"); ?> </option> <option <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C") { ?> selected="selected"<?php } ?> value="C"><?php echo $_smarty_tpl->__("communication"); ?> </option> <option <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R") { ?> selected="selected"<?php } ?> value="R"><?php echo $_smarty_tpl->__("rating"); ?> </option> <option <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "D" || !$_smarty_tpl->tpl_vars['discussion']->value) { ?> selected="selected"<?php } ?> value="D"><?php echo $_smarty_tpl->__("disabled"); ?> </option> </select> <?php } else { ?> <span class="shift-input"><?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") { echo $_smarty_tpl->__("communication"); ?> <?php echo $_smarty_tpl->__("and"); ?> <?php echo $_smarty_tpl->__("rating"); } elseif ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C") { echo $_smarty_tpl->__("communication"); } elseif ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R") { echo $_smarty_tpl->__("rating"); } else { echo $_smarty_tpl->__("disabled"); } ?> </span> <?php } ?> </div> </div><?php }
<?php // // $Id: products.post.php 7502 2009-05-19 14:54:59Z zeke $ // if (!defined('AREA')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { return; } if ($mode == 'update') { $discussion = fn_get_discussion($_REQUEST['product_id'], 'P'); if (!empty($discussion) && $discussion['type'] != 'D') { Registry::set('navigation.tabs.discussion', array('title' => fn_get_lang_var('discussion_title_product'), 'js' => true)); $view->assign('discussion', $discussion); } } elseif ($mode == 'manage') { $selected_fields = $view->get_var('selected_fields'); $selected_fields[] = array('name' => '[products_data][discussion_type]', 'text' => fn_get_lang_var('discussion_title_product')); $view->assign('selected_fields', $selected_fields); } elseif ($mode == 'm_update') { $selected_fields = $_SESSION['selected_fields']; if (!empty($selected_fields['products_data'])) { $field_groups = $view->get_var('field_groups'); $filled_groups = $view->get_var('filled_groups'); $field_groups['S']['discussion_type'] = array('name' => 'products_data', 'variants' => array('D' => fn_get_lang_var('disabled'), 'C' => fn_get_lang_var('communication'), 'R' => fn_get_lang_var('rating'), 'B' => fn_get_lang_var('all'))); $filled_groups['S']['discussion_type'] = fn_get_lang_var('discussion_title_product'); $view->assign('field_groups', $field_groups); $view->assign('filled_groups', $filled_groups); }
function fn_update_discussion($params) { $_data = fn_check_table_fields($params, 'discussion'); $discussion = fn_get_discussion($params['object_id'], $params['object_type']); if (!empty($discussion['thread_id'])) { db_query("UPDATE ?:discussion SET ?u WHERE thread_id = ?i", $_data, $discussion['thread_id']); } else { db_query("REPLACE INTO ?:discussion ?e", $_data); } return true; }
* and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { return; } if ($mode == 'view') { $page_data = Tygh::$app['view']->getTemplateVars('page'); if ($page_data['page_type'] == PAGE_TYPE_PROJECTS) { list($subpages, $search) = fn_get_pages(array('parent_id' => $page_data['page_id'], 'page' => !empty($_REQUEST['page']) ? $_REQUEST['page'] : 0, 'page_type' => PAGE_TYPE_PROJECTS, 'get_image' => true, 'status' => 'A', 'sort_by' => 'timestamp', 'sort_order' => 'desc'), Registry::get('settings.Appearance.elements_per_page')); if (!empty($subpages)) { foreach ($subpages as &$subpage) { $subpage['discussion'] = fn_get_discussion($subpage['page_id'], 'A', true); //fn_print_die($subpage['page_id'],$discussion); } } else { $page_data['discussion'] = fn_get_discussion($page_data['page_id'], 'A', true); } //fn_print_die($discussion,$page_data,$subpages); Tygh::$app['view']->assign('page', $page_data); Tygh::$app['view']->assign('subpages', $subpages); Tygh::$app['view']->assign('search', $search); } }
<?php // // $Id: events.post.php 7502 2009-05-19 14:54:59Z zeke $ // if (!defined('AREA')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { return; } if ($mode == 'update') { $discussion = fn_get_discussion($_REQUEST['event_id'], 'G'); if (!empty($discussion) && $discussion['type'] != 'D') { Registry::set('navigation.tabs.discussion', array('title' => fn_get_lang_var('discussion_title_giftreg'), 'js' => true)); $view->assign('discussion', $discussion); } }
function content_55d5c759232616_54699455($_smarty_tpl) { fn_preload_lang_vars(array('discussion', 'discussion_title_order', 'disabled', 'enabled', 'enabled', 'disabled')); if ($_smarty_tpl->tpl_vars['runtime']->value['company_id'] && fn_allowed_for("ULTIMATE") || fn_allowed_for("MULTIVENDOR") || $_smarty_tpl->tpl_vars['runtime']->value['simple_ultimate']) { ?> <?php $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion($_smarty_tpl->tpl_vars['order_info']->value['order_id'], "O"), null, 0); ?> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("discussion")), 0); ?> <div class="control-group"> <label class="control-label"><?php echo $_smarty_tpl->__("discussion_title_order"); ?> </label> <div class="controls"> <?php if (fn_check_view_permissions("discussion.add")) { ?> <input type="hidden" name="discussion[object_id]" value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['order_id'], ENT_QUOTES, 'UTF-8'); ?> " /> <input type="hidden" name="discussion[object_type]" value="O" /> <select name="discussion[type]"> <option <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "D") { ?> selected="selected"<?php } ?> value="D"><?php echo $_smarty_tpl->__("disabled"); ?> </option> <option <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C") { ?> selected="selected"<?php } ?> value="C"><?php echo $_smarty_tpl->__("enabled"); ?> </option> </select> <?php } else { ?> <span class="shift-input"><?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C") { echo $_smarty_tpl->__("enabled"); } else { echo $_smarty_tpl->__("disabled"); } ?> </span> <?php } ?> </div> </div> <?php } }
<?php // // $Id: pages.post.php 7502 2009-05-19 14:54:59Z zeke $ // if (!defined('AREA')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { return; } if ($mode == 'update') { $page = $view->get_var('page_data'); $discussion = fn_get_discussion($_REQUEST['page_id'], 'A'); if (!empty($discussion) && $discussion['type'] != 'D' && $page['page_type'] != PAGE_TYPE_LINK) { Registry::set('navigation.tabs.discussion', array('title' => fn_get_lang_var('discussion_title_page'), 'js' => true)); $view->assign('discussion', $discussion); } } elseif ($mode == 'm_update') { if ($selected_fields['discussion_type'] == 'Y') { $field_names['discussion_type'] = fn_get_lang_var('discussion_title_page'); $fields2update[] = 'discussion_type'; } }
function fn_get_review_count($object_id, $object_type, $thread_id = 0) { if (!$thread_id) { global $db_tables; $discussion = fn_get_discussion($object_id, $object_type); if (empty($discussion)) { return false; } $thread_id = $discussion['thread_id']; } return db_get_field("SELECT COUNT(b.post_id) as val FROM ?:discussion_rating as a LEFT JOIN ?:discussion_posts as b ON a.post_id = b.post_id WHERE a.thread_id = ?i and b.status = 'A'", $thread_id); }
$title = $data['is_like'] ? __('you_like_this') : __('you_not_like_this'); $msg = __('thanks_for_vote'); fn_set_notification('N', $title, $msg); } else { fn_set_notification('E', __('error'), __('no_more_vote'), 'I'); } } exit; } if ($mode == 'view_posts') { $posts = array(); $object_id = $_REQUEST["object_id"]; if ($object_id) { $object_type = $_REQUEST['object_type']; $page = $_REQUEST["page"]; $discussion = fn_get_discussion($object_id, $object_type, true, $_REQUEST); $attributes = fn_get_review_attributes_work($object_id); $no_atributes = true; if ($attributes) { $no_atributes = false; } $ratings = fn_get_review_ratings($discussion["thread_id"], $no_atributes); $posts = fn_get_review_posts($discussion['thread_id'], $page); } Registry::set('runtime.root_template', 'addons/altteam_review_attributes/views/view_posts.tpl'); $discussion_object_types = array('P' => 'product', 'C' => 'category', 'A' => 'page', 'O' => 'order', 'E' => 'home_page'); //get the values from the settings $getDiscutionsPostPerPageSettings = db_get_field("\n SELECT ?:settings_objects.value\n FROM ?:settings_objects\n JOIN ?:settings_sections ON ?:settings_sections.section_id = ?:settings_objects.section_id\n WHERE \n ?:settings_sections.name = 'discussion'\n AND ?:settings_objects.name=?s\n ", $discussion_object_types[$object_type] . "_posts_per_page"); // $total_posts = db_get_field("SELECT COUNT(*) FROM ?:discussion_posts WHERE ?:discussion_posts.status = 'A' AND ?:discussion_posts.thread_id=?i", $discussion["thread_id"]); if ($page * $getDiscutionsPostPerPageSettings >= $total_posts) {
function content_55e61dcc9a2ac0_81934437($_smarty_tpl) { if (!is_callable('smarty_block_hook')) { include '/var/www/html/market/app/functions/smarty_plugins/block.hook.php'; } if (!is_callable('smarty_function_cycle')) { include '/var/www/html/market/app/lib/vendor/smarty/smarty/libs/plugins/function.cycle.php'; } if (!is_callable('smarty_modifier_truncate')) { include '/var/www/html/market/app/functions/smarty_plugins/modifier.truncate.php'; } if (!is_callable('smarty_modifier_date_format')) { include '/var/www/html/market/app/functions/smarty_plugins/modifier.date_format.php'; } if (!is_callable('smarty_function_set_id')) { include '/var/www/html/market/app/functions/smarty_plugins/function.set_id.php'; } if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") { $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null); ob_start(); ?> <?php $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion(0, "E", true, $_smarty_tpl->tpl_vars['block']->value['properties']), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['discussion']->value && $_smarty_tpl->tpl_vars['discussion']->value['type'] != "D" && $_smarty_tpl->tpl_vars['discussion']->value['posts']) { ?> <?php $_smarty_tpl->tpl_vars["obj_prefix"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['block']->value['block_id'] . "000", null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['outside_navigation'] == "Y") { ?> <div class="owl-theme ty-owl-controls"> <div class="owl-controls clickable owl-controls-outside" id="owl_outside_nav_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8'); ?> "> <div class="owl-buttons"> <div id="owl_prev_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8'); ?> " class="owl-prev"><i class="ty-icon-left-open-thin"></i></div> <div id="owl_next_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8'); ?> " class="owl-next"><i class="ty-icon-right-open-thin"></i></div> </div> </div> </div> <?php } ?> <div class="ty-mb-l"> <div class="ty-scroller-discussion-list"> <div id="scroll_list_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8'); ?> " class="owl-carousel ty-scroller-list"> <?php $_smarty_tpl->tpl_vars['post'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['post']->_loop = false; $_from = $_smarty_tpl->tpl_vars['discussion']->value['posts']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['post']->key => $_smarty_tpl->tpl_vars['post']->value) { $_smarty_tpl->tpl_vars['post']->_loop = true; ?> <div class="ty-discussion-post__content ty-scroller-discussion-list__item"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "discussion:items_list_row")); $_block_repeat = true; echo smarty_block_hook(array('name' => "discussion:items_list_row"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <a href="<?php echo htmlspecialchars(fn_url("discussion.view?thread_id=" . (string) $_smarty_tpl->tpl_vars['discussion']->value['thread_id'] . "&post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id']), ENT_QUOTES, 'UTF-8'); ?> #post_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8'); ?> "> <div class="ty-discussion-post <?php echo smarty_function_cycle(array('values' => ", ty-discussion-post_even"), $_smarty_tpl); ?> " id="post_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8'); ?> "> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") { ?> <div class="ty-discussion-post__message"><?php echo nl2br(smarty_modifier_truncate($_smarty_tpl->tpl_vars['post']->value['message'], 100)); ?> </div> <?php } ?> <span class="ty-caret-bottom"><span class="ty-caret-outer"></span><span class="ty-caret-inner"></span></span> </div> </a> <span class="ty-discussion-post__author"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['name'], ENT_QUOTES, 'UTF-8'); ?> </span> <span class="ty-discussion-post__date"><?php echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['post']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format']), ENT_QUOTES, 'UTF-8'); ?> </span> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B" && $_smarty_tpl->tpl_vars['post']->value['rating_value'] > 0) { ?> <div class="clearfix ty-discussion-post__rating"> <?php echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0); ?> </div> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "discussion:items_list_row"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> <?php } ?> </div> </div> </div> <?php echo $_smarty_tpl->getSubTemplate("common/scroller_init_with_quantity.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('prev_selector' => "#owl_prev_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value, 'next_selector' => "#owl_next_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value), 0); ?> <?php } list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } if (trim(Smarty::$_smarty_vars['capture']['template_content'])) { if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") { ?> <span class="cm-template-box template-box" data-ca-te-template="addons/discussion/blocks/testimonials.tpl" id="<?php echo smarty_function_set_id(array('name' => "addons/discussion/blocks/testimonials.tpl"), $_smarty_tpl); ?> "><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php echo Smarty::$_smarty_vars['capture']['template_content']; ?> <!--[/tpl_id]--></span><?php } else { echo Smarty::$_smarty_vars['capture']['template_content']; } } } else { ?> <?php $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion(0, "E", true, $_smarty_tpl->tpl_vars['block']->value['properties']), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['discussion']->value && $_smarty_tpl->tpl_vars['discussion']->value['type'] != "D" && $_smarty_tpl->tpl_vars['discussion']->value['posts']) { ?> <?php $_smarty_tpl->tpl_vars["obj_prefix"] = new Smarty_variable((string) $_smarty_tpl->tpl_vars['block']->value['block_id'] . "000", null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['block']->value['properties']['outside_navigation'] == "Y") { ?> <div class="owl-theme ty-owl-controls"> <div class="owl-controls clickable owl-controls-outside" id="owl_outside_nav_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8'); ?> "> <div class="owl-buttons"> <div id="owl_prev_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8'); ?> " class="owl-prev"><i class="ty-icon-left-open-thin"></i></div> <div id="owl_next_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['obj_prefix']->value, ENT_QUOTES, 'UTF-8'); ?> " class="owl-next"><i class="ty-icon-right-open-thin"></i></div> </div> </div> </div> <?php } ?> <div class="ty-mb-l"> <div class="ty-scroller-discussion-list"> <div id="scroll_list_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['block']->value['block_id'], ENT_QUOTES, 'UTF-8'); ?> " class="owl-carousel ty-scroller-list"> <?php $_smarty_tpl->tpl_vars['post'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['post']->_loop = false; $_from = $_smarty_tpl->tpl_vars['discussion']->value['posts']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['post']->key => $_smarty_tpl->tpl_vars['post']->value) { $_smarty_tpl->tpl_vars['post']->_loop = true; ?> <div class="ty-discussion-post__content ty-scroller-discussion-list__item"> <?php $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "discussion:items_list_row")); $_block_repeat = true; echo smarty_block_hook(array('name' => "discussion:items_list_row"), null, $_smarty_tpl, $_block_repeat); while ($_block_repeat) { ob_start(); ?> <a href="<?php echo htmlspecialchars(fn_url("discussion.view?thread_id=" . (string) $_smarty_tpl->tpl_vars['discussion']->value['thread_id'] . "&post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id']), ENT_QUOTES, 'UTF-8'); ?> #post_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8'); ?> "> <div class="ty-discussion-post <?php echo smarty_function_cycle(array('values' => ", ty-discussion-post_even"), $_smarty_tpl); ?> " id="post_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8'); ?> "> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") { ?> <div class="ty-discussion-post__message"><?php echo nl2br(smarty_modifier_truncate($_smarty_tpl->tpl_vars['post']->value['message'], 100)); ?> </div> <?php } ?> <span class="ty-caret-bottom"><span class="ty-caret-outer"></span><span class="ty-caret-inner"></span></span> </div> </a> <span class="ty-discussion-post__author"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['name'], ENT_QUOTES, 'UTF-8'); ?> </span> <span class="ty-discussion-post__date"><?php echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['post']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format']), ENT_QUOTES, 'UTF-8'); ?> </span> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B" && $_smarty_tpl->tpl_vars['post']->value['rating_value'] > 0) { ?> <div class="clearfix ty-discussion-post__rating"> <?php echo $_smarty_tpl->getSubTemplate("addons/discussion/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0); ?> </div> <?php } ?> <?php $_block_content = ob_get_clean(); $_block_repeat = false; echo smarty_block_hook(array('name' => "discussion:items_list_row"), $_block_content, $_smarty_tpl, $_block_repeat); } array_pop($_smarty_tpl->smarty->_tag_stack); ?> </div> <?php } ?> </div> </div> </div> <?php echo $_smarty_tpl->getSubTemplate("common/scroller_init_with_quantity.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('prev_selector' => "#owl_prev_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value, 'next_selector' => "#owl_next_" . (string) $_smarty_tpl->tpl_vars['obj_prefix']->value), 0); ?> <?php } } }
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($mode == 'update') { if (!empty($_REQUEST['posts'])) { fn_update_discussion_posts($_REQUEST['posts']); } } return; } if ($mode == 'update') { $discussion = fn_get_discussion($_REQUEST['category_id'], 'C', true, $_REQUEST); if (!empty($discussion) && $discussion['type'] != 'D') { if (fn_allowed_for('MULTIVENDOR') || fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) { Registry::set('navigation.tabs.discussion', array('title' => __('discussion_title_category'), 'js' => true)); Registry::get('view')->assign('discussion', $discussion); } } } elseif ($mode == 'm_update') { $selected_fields = $_SESSION['selected_fields']; if (!empty($selected_fields['extra']) && in_array('discussion_type', $selected_fields['extra'])) { $field_names = Registry::get('view')->getTemplateVars('field_names'); $fields2update = Registry::get('view')->getTemplateVars('fields2update'); $field_names['discussion_type'] = __('discussion_title_category'); $fields2update[] = 'discussion_type'; Registry::get('view')->assign('field_names', $field_names); Registry::get('view')->assign('fields2update', $fields2update);
die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($mode == 'm_delete') { if (!empty($_REQUEST['delete_posts']) && is_array($_REQUEST['delete_posts'])) { foreach ($_REQUEST['delete_posts'] as $p_id => $v) { fn_discussion_delete_post($p_id); } } } if ($mode == 'delete') { if (!empty($_REQUEST['post_id'])) { fn_discussion_delete_post($_REQUEST['post_id']); } } return array(CONTROLLER_STATUS_OK); } if ($mode == 'update') { $discussion = array(); if (!empty($_REQUEST['discussion_type'])) { $discussion = fn_get_discussion(0, $_REQUEST['discussion_type'], true, $_REQUEST); } if (!empty($discussion) && $discussion['type'] != 'D' && Registry::ifGet('addons.discussion.home_page_testimonials', 'N') != 'D') { if (fn_allowed_for('MULTIVENDOR') || fn_allowed_for('ULTIMATE') && Registry::get('runtime.company_id')) { Registry::set('navigation.tabs.discussion', array('title' => __('discussion_title_home_page'), 'js' => true)); } } else { $discussion['is_empty'] = true; } Tygh::$app['view']->assign('discussion', $discussion); }
function content_55ccec9fd41274_29204611($_smarty_tpl) { if (!is_callable('smarty_function_cycle')) { include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.cycle.php'; } if (!is_callable('smarty_modifier_date_format')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.date_format.php'; } if (!is_callable('smarty_function_set_id')) { include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php'; } fn_preload_lang_vars(array('write_your_review', 'write_your_review')); if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") { $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null); ob_start(); if ($_smarty_tpl->tpl_vars['_REQUEST']->value['dispatch'] == 'products.view') { ?> <?php $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value, true, $_REQUEST), null, 0); ?> <?php $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable($_smarty_tpl->tpl_vars['discussion']->value['posts'], null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['discussion']->value && $_smarty_tpl->tpl_vars['discussion']->value['type'] != "D") { ?> <style> div.review_post_images{ display: block; } div.review_post_image{ display: inline-block; padding: 5px; } div.review_post_image > img{ max-width: 150px; } </style> <div id="content_review_attributes"> <?php if ($_smarty_tpl->tpl_vars['wrap']->value == true) { ?> <p> </p> <?php $_smarty_tpl->_capture_stack[0][] = array("content", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['title']->value), 0); ?> <?php } else { ?> <h2 class="reviews-title"><?php echo $_smarty_tpl->__('customer_reviews'); ?> </h2> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == 'E') { ?> <?php $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable(fn_get_likes(fn_get_review_posts(0, $_REQUEST['page'])), null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable(fn_get_likes(fn_get_review_posts($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], $_REQUEST['page'])), null, 0); ?> <?php } ?> <?php $_smarty_tpl->tpl_vars["attributes"] = new Smarty_variable(fn_get_review_attributes_work($_smarty_tpl->tpl_vars['object_id']->value), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['object_type']->value == 'P' && $_smarty_tpl->tpl_vars['attributes']->value) { ?> <?php $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id']), null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], true), null, 0); ?> <?php } ?> <?php if (!$_smarty_tpl->tpl_vars['ratings']->value || $_smarty_tpl->tpl_vars['ratings']->value['average'] == 0.0 && !$_smarty_tpl->tpl_vars['ratings']->value['rating']) { ?> <?php $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], true), null, 0); ?> <?php } ?> <?php $_smarty_tpl->tpl_vars["posts_count"] = new Smarty_variable(fn_get_review_posts_count($_smarty_tpl->tpl_vars['discussion']->value['thread_id']), null, 0); ?> <?php if (($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") && $_smarty_tpl->tpl_vars['ratings']->value) { ?> <div> <div class="global-average-rating"> <h3><?php echo $_smarty_tpl->__('average_rating'); ?> </h3> <p><?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average']), 'mode' => 'big'), 0); ?> </p> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ratings']->value['count'], ENT_QUOTES, 'UTF-8'); ?> <?php echo $_smarty_tpl->__('reviews'); ?> </div> <div class="global-attribute-rating"> <table cellpadding="0" cellspacing="0" class="ga-rating"> <?php $_smarty_tpl->tpl_vars["attribute"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["attribute"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['attributes']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["attribute"]->key => $_smarty_tpl->tpl_vars["attribute"]->value) { $_smarty_tpl->tpl_vars["attribute"]->_loop = true; ?> <tr> <td class="right"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_name'], ENT_QUOTES, 'UTF-8'); ?> = </td> <td class="left"> <?php $_smarty_tpl->tpl_vars["attr_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], null, 0); ?> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_attr'][$_smarty_tpl->tpl_vars['attr_id']->value]['value'])), 0); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ratings']->value['average_by_attr'][$_smarty_tpl->tpl_vars['attr_id']->value]['percent'], ENT_QUOTES, 'UTF-8'); ?> </td> </tr> <?php } ?> </table> </div> </div> <?php } ?> <div class="clearfix" style="padding-top: 20px;"></div> <?php if (strpos("CRB", $_smarty_tpl->tpl_vars['discussion']->value['type']) !== false) { ?> <div class="buttons-container"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_new_post", 'but_text' => __("write_your_review"), 'but_role' => "submit", 'but_target_id' => "new_extended_post_dialog", 'but_meta' => "ty-btn__secondary ty-btn cm-dialog-opener cm-dialog-auto-size", 'data_ca_view_id' => time()), 0); ?> </div> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/new_post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('new_post_title' => $_smarty_tpl->tpl_vars['new_post_title']->value), 0); ?> <?php } ?> <div class="sort-review-block"> <label for="sort_review" class="sort-review-label"><?php echo $_smarty_tpl->__('sort_by'); ?> </label> <select id="sort_review" name="sort_review" onchange="$.ceAjax('request', fn_url(this.value), <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8'); ?> result_ids: 'content_review_attributes,attributes_head'<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8'); ?> );"> <option value="<?php echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=MH&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'MH' || !$_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review']) { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__('most_helpful_first'); ?> </option> <option value="<?php echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=HR&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'HR') { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__('highest_rating_first'); ?> </option> <option value="<?php echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=LR&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'LR') { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__('lowest_rating_first'); ?> </option> <option value="<?php echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=NW&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'NW') { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__('newest_first'); ?> </option> <option value="<?php echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=OD&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'OD') { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__('oldest_first'); ?> </option> </select> </div> <?php if ($_smarty_tpl->tpl_vars['posts']->value) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value), 0); ?> <?php $_smarty_tpl->tpl_vars["escaped_current_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); ?> <table cellpadding="0" cellspacing="0" class="posts-table"> <?php $_smarty_tpl->tpl_vars['post'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['post']->_loop = false; $_from = $_smarty_tpl->tpl_vars['posts']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['post']->key => $_smarty_tpl->tpl_vars['post']->value) { $_smarty_tpl->tpl_vars['post']->_loop = true; ?> <tr class="posts<?php echo smarty_function_cycle(array('values' => ", manage-post"), $_smarty_tpl); ?> clear-both" id="post_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8'); ?> "> <td class="r-legend"> <p class="r-author"><?php echo htmlspecialchars(htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['name'], ENT_QUOTES, 'UTF-8', true), ENT_QUOTES, 'UTF-8'); ?> </p> <p class="r-date"><?php echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['post']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8'); ?> </p> <p class="r-user-age"> <?php echo $_smarty_tpl->__('age_group'); ?> : <?php if ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 1) { echo $_smarty_tpl->__('24&under'); ?> <?php } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 2) { echo $_smarty_tpl->__('between25and34'); ?> <?php } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 3) { echo $_smarty_tpl->__('between35and44'); ?> <?php } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 4) { echo $_smarty_tpl->__('between45and54'); ?> <?php } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 5) { echo $_smarty_tpl->__('between55and64'); ?> <?php } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 6) { echo $_smarty_tpl->__('65andafter'); ?> <?php } ?> </p> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") { ?> <?php if ($_smarty_tpl->tpl_vars['attributes']->value) { ?> <table cellpadding="0" cellspacing="0" class="ga-rating"> <?php $_smarty_tpl->tpl_vars["post_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['post']->value['post_id'], null, 0); ?> <?php $_smarty_tpl->tpl_vars["attribute"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["attribute"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['attributes']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["attribute"]->key => $_smarty_tpl->tpl_vars["attribute"]->value) { $_smarty_tpl->tpl_vars["attribute"]->_loop = true; ?> <tr> <td class="right"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_name'], ENT_QUOTES, 'UTF-8'); ?> = </td> <td class="left" style="margin-top: 2px;"> <?php $_smarty_tpl->tpl_vars["attr_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], null, 0); ?> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['rating'][$_smarty_tpl->tpl_vars['post_id']->value][$_smarty_tpl->tpl_vars['attr_id']->value])), 0); ?> </td> </tr> <?php } ?> </table> <?php } ?> <?php } ?> </td> <td class="r-message"> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] != "C") { ?> <div class="r-subject"> <?php if ($_smarty_tpl->tpl_vars['attributes']->value) { ?> <?php $_smarty_tpl->tpl_vars["rates"] = new Smarty_variable(fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_post'][$_smarty_tpl->tpl_vars['post_id']->value]), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['rates']->value[$_smarty_tpl->getVariable('smarty')->value['section']['FULL']['index']] != 0 || $_smarty_tpl->tpl_vars['rates']->value[$_smarty_tpl->getVariable('smarty')->value['section']['PART']['index']] != 0) { ?> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_post'][$_smarty_tpl->tpl_vars['post_id']->value])), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0); ?> <?php } ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0); ?> <?php } ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message_title'], ENT_QUOTES, 'UTF-8'); ?> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") { ?> <?php echo nl2br(htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message'], ENT_QUOTES, 'UTF-8', true)); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['post']->value['image1'] || $_smarty_tpl->tpl_vars['post']->value['image2']) { ?> <div class="review_post_images"> <?php if ($_smarty_tpl->tpl_vars['post']->value['image1']) { ?> <div class="review_post_image"><img class="img_review_post_image" src="/images/review_img/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['image1'], ENT_QUOTES, 'UTF-8'); ?> " alt="img" border="0"></div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['post']->value['image1']) { ?> <div class="review_post_image"><img class="img_review_post_image" src="/images/review_img/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['image2'], ENT_QUOTES, 'UTF-8'); ?> " alt="img" border="0"></div> <?php } ?> </div> <?php } ?> <div class="r-likes"> <div class="is-useful float-left"><?php echo $_smarty_tpl->__('found_useful'); ?> : <strong><?php if ($_smarty_tpl->tpl_vars['post']->value['likes']['yes']) { echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['likes']['yes'], ENT_QUOTES, 'UTF-8'); } else { ?> 0<?php } ?> </strong> <?php echo $_smarty_tpl->__('out_of'); ?> <strong><?php if ($_smarty_tpl->tpl_vars['post']->value['likes']['votes']) { echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['likes']['votes'], ENT_QUOTES, 'UTF-8'); } else { ?> 0<?php } ?> </strong></div> <?php echo $_smarty_tpl->__('was_helpful'); ?> <?php if ($_smarty_tpl->tpl_vars['auth']->value['user_id']) { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_yes'), 'but_meta' => "cm-ajax", 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=review_attributes.likes&like=1&post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id']), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_no'), 'but_meta' => "cm-ajax", 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=review_attributes.likes&like=0&post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id']), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_yes'), 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=auth.login_form&return_url=" . (string) $_smarty_tpl->tpl_vars['escaped_current_url']->value), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_no'), 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=auth.login_form&return_url=" . (string) $_smarty_tpl->tpl_vars['escaped_current_url']->value), 0); ?> <?php } ?> </div> </td> </tr> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['object_type']->value == "E" && $_smarty_tpl->tpl_vars['current_post_id']->value) { ?> <script type="text/javascript"> //<![CDATA[ $(document).ready(function()<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8'); ?> if ($('#post_' + <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['current_post_id']->value, ENT_QUOTES, 'UTF-8'); ?> ).length) <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8'); ?> jQuery.scrollToElm($('#post_' + <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['current_post_id']->value, ENT_QUOTES, 'UTF-8'); ?> )); <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8'); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8'); ?> ); //]]> </script> <?php } ?> </table> <script type="text/javascript"> //<![CDATA[ $(document).ready(function()<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8'); ?> var userCheckForReview = true; var user_product_ordered = 1; $('a#opener_new_post').click(function(){ var checkout_est_url = fn_url('review_attributes.check_user&object_id=<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8'); ?> &is_ajax=1'); var ajax_exectute = $.ajax({ url: checkout_est_url, dataType:'html', async:false, cache: false, beforeSend: function(xhr) { xhr.withCredentials = true; }, }); ajax_exectute.done(function(data) { if(typeof data ==="string" ){ data = JSON.parse(data); } if(data.text=='notordered'){ user_product_ordered = 0; }else if(data.text=='logedout'){ window.location.href = fn_url('auth.login_form&return_url=<?php echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['config']->value['current_url']), ENT_QUOTES, 'UTF-8'); ?> '); userCheckForReview = false; }else if(data.text=='allchecked'){ user_product_ordered = 1; userCheckForReview = true; }else { user_product_ordered = 1; userCheckForReview = true; } }); $('form#add_extended_post_form').trigger('reset'); $('div.ls_review_image_container2').remove(); $('img#ls_uploadPreview').attr("src","/images/review_img/review_no_image.jpg"); $('input#user_product_ordered').val(user_product_ordered); return userCheckForReview; }); <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8'); ?> ); //]]> </script> <div class="div_show_more_posts_action" style="text-align:center"> <input type="hidden" value="2" id="input_show_more_posts_action" /> <input type="hidden" value="<?php if ($_REQUEST['sort_review']) { echo htmlspecialchars($_REQUEST['sort_review'], ENT_QUOTES, 'UTF-8'); } else { ?> MH<?php } ?> " id="input_sort_review" /> <?php if ($_smarty_tpl->tpl_vars['posts_count']->value > count($_smarty_tpl->tpl_vars['posts']->value)) { ?> <a onclick="ls_show_more_posts(<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8'); ?> ,'<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['object_type']->value, ENT_QUOTES, 'UTF-8'); ?> ');return false;" id="show_more_posts"><?php echo $_smarty_tpl->__('show_more_posts'); ?> </a> <?php } ?> </div> <?php echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value), 0); ?> <?php } else { ?> <p class="no-items ty-no-items"><?php echo $_smarty_tpl->__('no_posts_found'); ?> </p> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['wrap']->value == true) { ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo $_smarty_tpl->getSubTemplate("common/group.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['content']), 0); ?> <?php } else { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null); ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8'); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php } ?> <!--content_review_attributes--></div> <?php } } list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } if (trim(Smarty::$_smarty_vars['capture']['template_content'])) { if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") { ?> <span class="cm-template-box template-box" data-ca-te-template="addons/altteam_review_attributes/views/discussion/view.tpl" id="<?php echo smarty_function_set_id(array('name' => "addons/altteam_review_attributes/views/discussion/view.tpl"), $_smarty_tpl); ?> "><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php echo Smarty::$_smarty_vars['capture']['template_content']; ?> <!--[/tpl_id]--></span><?php } else { echo Smarty::$_smarty_vars['capture']['template_content']; } } } else { if ($_smarty_tpl->tpl_vars['_REQUEST']->value['dispatch'] == 'products.view') { ?> <?php $_smarty_tpl->tpl_vars["discussion"] = new Smarty_variable(fn_get_discussion($_smarty_tpl->tpl_vars['object_id']->value, $_smarty_tpl->tpl_vars['object_type']->value, true, $_REQUEST), null, 0); ?> <?php $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable($_smarty_tpl->tpl_vars['discussion']->value['posts'], null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['discussion']->value && $_smarty_tpl->tpl_vars['discussion']->value['type'] != "D") { ?> <style> div.review_post_images{ display: block; } div.review_post_image{ display: inline-block; padding: 5px; } div.review_post_image > img{ max-width: 150px; } </style> <div id="content_review_attributes"> <?php if ($_smarty_tpl->tpl_vars['wrap']->value == true) { ?> <p> </p> <?php $_smarty_tpl->_capture_stack[0][] = array("content", null, null); ob_start(); ?> <?php echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['title']->value), 0); ?> <?php } else { ?> <h2 class="reviews-title"><?php echo $_smarty_tpl->__('customer_reviews'); ?> </h2> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['object_type'] == 'E') { ?> <?php $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable(fn_get_likes(fn_get_review_posts(0, $_REQUEST['page'])), null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["posts"] = new Smarty_variable(fn_get_likes(fn_get_review_posts($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], $_REQUEST['page'])), null, 0); ?> <?php } ?> <?php $_smarty_tpl->tpl_vars["attributes"] = new Smarty_variable(fn_get_review_attributes_work($_smarty_tpl->tpl_vars['object_id']->value), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['object_type']->value == 'P' && $_smarty_tpl->tpl_vars['attributes']->value) { ?> <?php $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id']), null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], true), null, 0); ?> <?php } ?> <?php if (!$_smarty_tpl->tpl_vars['ratings']->value || $_smarty_tpl->tpl_vars['ratings']->value['average'] == 0.0 && !$_smarty_tpl->tpl_vars['ratings']->value['rating']) { ?> <?php $_smarty_tpl->tpl_vars["ratings"] = new Smarty_variable(fn_get_review_ratings($_smarty_tpl->tpl_vars['discussion']->value['thread_id'], true), null, 0); ?> <?php } ?> <?php $_smarty_tpl->tpl_vars["posts_count"] = new Smarty_variable(fn_get_review_posts_count($_smarty_tpl->tpl_vars['discussion']->value['thread_id']), null, 0); ?> <?php if (($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") && $_smarty_tpl->tpl_vars['ratings']->value) { ?> <div> <div class="global-average-rating"> <h3><?php echo $_smarty_tpl->__('average_rating'); ?> </h3> <p><?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average']), 'mode' => 'big'), 0); ?> </p> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ratings']->value['count'], ENT_QUOTES, 'UTF-8'); ?> <?php echo $_smarty_tpl->__('reviews'); ?> </div> <div class="global-attribute-rating"> <table cellpadding="0" cellspacing="0" class="ga-rating"> <?php $_smarty_tpl->tpl_vars["attribute"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["attribute"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['attributes']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["attribute"]->key => $_smarty_tpl->tpl_vars["attribute"]->value) { $_smarty_tpl->tpl_vars["attribute"]->_loop = true; ?> <tr> <td class="right"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_name'], ENT_QUOTES, 'UTF-8'); ?> = </td> <td class="left"> <?php $_smarty_tpl->tpl_vars["attr_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], null, 0); ?> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_attr'][$_smarty_tpl->tpl_vars['attr_id']->value]['value'])), 0); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ratings']->value['average_by_attr'][$_smarty_tpl->tpl_vars['attr_id']->value]['percent'], ENT_QUOTES, 'UTF-8'); ?> </td> </tr> <?php } ?> </table> </div> </div> <?php } ?> <div class="clearfix" style="padding-top: 20px;"></div> <?php if (strpos("CRB", $_smarty_tpl->tpl_vars['discussion']->value['type']) !== false) { ?> <div class="buttons-container"> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_id' => "opener_new_post", 'but_text' => __("write_your_review"), 'but_role' => "submit", 'but_target_id' => "new_extended_post_dialog", 'but_meta' => "ty-btn__secondary ty-btn cm-dialog-opener cm-dialog-auto-size", 'data_ca_view_id' => time()), 0); ?> </div> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/new_post.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('new_post_title' => $_smarty_tpl->tpl_vars['new_post_title']->value), 0); ?> <?php } ?> <div class="sort-review-block"> <label for="sort_review" class="sort-review-label"><?php echo $_smarty_tpl->__('sort_by'); ?> </label> <select id="sort_review" name="sort_review" onchange="$.ceAjax('request', fn_url(this.value), <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8'); ?> result_ids: 'content_review_attributes,attributes_head'<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8'); ?> );"> <option value="<?php echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=MH&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'MH' || !$_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review']) { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__('most_helpful_first'); ?> </option> <option value="<?php echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=HR&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'HR') { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__('highest_rating_first'); ?> </option> <option value="<?php echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=LR&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'LR') { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__('lowest_rating_first'); ?> </option> <option value="<?php echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=NW&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'NW') { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__('newest_first'); ?> </option> <option value="<?php echo htmlspecialchars(fn_url("products.view&product_id=" . (string) $_smarty_tpl->tpl_vars['object_id']->value . "&sort_review=OD&selected_section=review_attributes"), ENT_QUOTES, 'UTF-8'); ?> " <?php if ($_smarty_tpl->tpl_vars['_REQUEST']->value['sort_review'] == 'OD') { ?> selected="selected"<?php } ?> ><?php echo $_smarty_tpl->__('oldest_first'); ?> </option> </select> </div> <?php if ($_smarty_tpl->tpl_vars['posts']->value) { ?> <?php echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value), 0); ?> <?php $_smarty_tpl->tpl_vars["escaped_current_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0); ?> <table cellpadding="0" cellspacing="0" class="posts-table"> <?php $_smarty_tpl->tpl_vars['post'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['post']->_loop = false; $_from = $_smarty_tpl->tpl_vars['posts']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['post']->key => $_smarty_tpl->tpl_vars['post']->value) { $_smarty_tpl->tpl_vars['post']->_loop = true; ?> <tr class="posts<?php echo smarty_function_cycle(array('values' => ", manage-post"), $_smarty_tpl); ?> clear-both" id="post_<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['post_id'], ENT_QUOTES, 'UTF-8'); ?> "> <td class="r-legend"> <p class="r-author"><?php echo htmlspecialchars(htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['name'], ENT_QUOTES, 'UTF-8', true), ENT_QUOTES, 'UTF-8'); ?> </p> <p class="r-date"><?php echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['post']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8'); ?> </p> <p class="r-user-age"> <?php echo $_smarty_tpl->__('age_group'); ?> : <?php if ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 1) { echo $_smarty_tpl->__('24&under'); ?> <?php } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 2) { echo $_smarty_tpl->__('between25and34'); ?> <?php } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 3) { echo $_smarty_tpl->__('between35and44'); ?> <?php } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 4) { echo $_smarty_tpl->__('between45and54'); ?> <?php } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 5) { echo $_smarty_tpl->__('between55and64'); ?> <?php } elseif ($_smarty_tpl->tpl_vars['post']->value['user_age'] == 6) { echo $_smarty_tpl->__('65andafter'); ?> <?php } ?> </p> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "R" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") { ?> <?php if ($_smarty_tpl->tpl_vars['attributes']->value) { ?> <table cellpadding="0" cellspacing="0" class="ga-rating"> <?php $_smarty_tpl->tpl_vars["post_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['post']->value['post_id'], null, 0); ?> <?php $_smarty_tpl->tpl_vars["attribute"] = new Smarty_Variable(); $_smarty_tpl->tpl_vars["attribute"]->_loop = false; $_from = $_smarty_tpl->tpl_vars['attributes']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars["attribute"]->key => $_smarty_tpl->tpl_vars["attribute"]->value) { $_smarty_tpl->tpl_vars["attribute"]->_loop = true; ?> <tr> <td class="right"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['attribute']->value['attr_name'], ENT_QUOTES, 'UTF-8'); ?> = </td> <td class="left" style="margin-top: 2px;"> <?php $_smarty_tpl->tpl_vars["attr_id"] = new Smarty_variable($_smarty_tpl->tpl_vars['attribute']->value['attr_id'], null, 0); ?> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['rating'][$_smarty_tpl->tpl_vars['post_id']->value][$_smarty_tpl->tpl_vars['attr_id']->value])), 0); ?> </td> </tr> <?php } ?> </table> <?php } ?> <?php } ?> </td> <td class="r-message"> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] != "C") { ?> <div class="r-subject"> <?php if ($_smarty_tpl->tpl_vars['attributes']->value) { ?> <?php $_smarty_tpl->tpl_vars["rates"] = new Smarty_variable(fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_post'][$_smarty_tpl->tpl_vars['post_id']->value]), null, 0); ?> <?php if ($_smarty_tpl->tpl_vars['rates']->value[$_smarty_tpl->getVariable('smarty')->value['section']['FULL']['index']] != 0 || $_smarty_tpl->tpl_vars['rates']->value[$_smarty_tpl->getVariable('smarty')->value['section']['PART']['index']] != 0) { ?> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['ratings']->value['average_by_post'][$_smarty_tpl->tpl_vars['post_id']->value])), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0); ?> <?php } ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("addons/altteam_review_attributes/views/discussion/components/stars.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('stars' => fn_get_discussion_rating($_smarty_tpl->tpl_vars['post']->value['rating_value'])), 0); ?> <?php } ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message_title'], ENT_QUOTES, 'UTF-8'); ?> </div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['discussion']->value['type'] == "C" || $_smarty_tpl->tpl_vars['discussion']->value['type'] == "B") { ?> <?php echo nl2br(htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['message'], ENT_QUOTES, 'UTF-8', true)); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['post']->value['image1'] || $_smarty_tpl->tpl_vars['post']->value['image2']) { ?> <div class="review_post_images"> <?php if ($_smarty_tpl->tpl_vars['post']->value['image1']) { ?> <div class="review_post_image"><img class="img_review_post_image" src="/images/review_img/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['image1'], ENT_QUOTES, 'UTF-8'); ?> " alt="img" border="0"></div> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['post']->value['image1']) { ?> <div class="review_post_image"><img class="img_review_post_image" src="/images/review_img/<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['image2'], ENT_QUOTES, 'UTF-8'); ?> " alt="img" border="0"></div> <?php } ?> </div> <?php } ?> <div class="r-likes"> <div class="is-useful float-left"><?php echo $_smarty_tpl->__('found_useful'); ?> : <strong><?php if ($_smarty_tpl->tpl_vars['post']->value['likes']['yes']) { echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['likes']['yes'], ENT_QUOTES, 'UTF-8'); } else { ?> 0<?php } ?> </strong> <?php echo $_smarty_tpl->__('out_of'); ?> <strong><?php if ($_smarty_tpl->tpl_vars['post']->value['likes']['votes']) { echo htmlspecialchars($_smarty_tpl->tpl_vars['post']->value['likes']['votes'], ENT_QUOTES, 'UTF-8'); } else { ?> 0<?php } ?> </strong></div> <?php echo $_smarty_tpl->__('was_helpful'); ?> <?php if ($_smarty_tpl->tpl_vars['auth']->value['user_id']) { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_yes'), 'but_meta' => "cm-ajax", 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=review_attributes.likes&like=1&post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id']), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_no'), 'but_meta' => "cm-ajax", 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=review_attributes.likes&like=0&post_id=" . (string) $_smarty_tpl->tpl_vars['post']->value['post_id']), 0); ?> <?php } else { ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_yes'), 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=auth.login_form&return_url=" . (string) $_smarty_tpl->tpl_vars['escaped_current_url']->value), 0); ?> <?php echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => '', 'but_text' => __('review_attributes_no'), 'but_href' => (string) $_smarty_tpl->tpl_vars['index_script']->value . "?dispatch=auth.login_form&return_url=" . (string) $_smarty_tpl->tpl_vars['escaped_current_url']->value), 0); ?> <?php } ?> </div> </td> </tr> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['object_type']->value == "E" && $_smarty_tpl->tpl_vars['current_post_id']->value) { ?> <script type="text/javascript"> //<![CDATA[ $(document).ready(function()<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8'); ?> if ($('#post_' + <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['current_post_id']->value, ENT_QUOTES, 'UTF-8'); ?> ).length) <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8'); ?> jQuery.scrollToElm($('#post_' + <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['current_post_id']->value, ENT_QUOTES, 'UTF-8'); ?> )); <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8'); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8'); ?> ); //]]> </script> <?php } ?> </table> <script type="text/javascript"> //<![CDATA[ $(document).ready(function()<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['ldelim']->value, ENT_QUOTES, 'UTF-8'); ?> var userCheckForReview = true; var user_product_ordered = 1; $('a#opener_new_post').click(function(){ var checkout_est_url = fn_url('review_attributes.check_user&object_id=<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8'); ?> &is_ajax=1'); var ajax_exectute = $.ajax({ url: checkout_est_url, dataType:'html', async:false, cache: false, beforeSend: function(xhr) { xhr.withCredentials = true; }, }); ajax_exectute.done(function(data) { if(typeof data ==="string" ){ data = JSON.parse(data); } if(data.text=='notordered'){ user_product_ordered = 0; }else if(data.text=='logedout'){ window.location.href = fn_url('auth.login_form&return_url=<?php echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['config']->value['current_url']), ENT_QUOTES, 'UTF-8'); ?> '); userCheckForReview = false; }else if(data.text=='allchecked'){ user_product_ordered = 1; userCheckForReview = true; }else { user_product_ordered = 1; userCheckForReview = true; } }); $('form#add_extended_post_form').trigger('reset'); $('div.ls_review_image_container2').remove(); $('img#ls_uploadPreview').attr("src","/images/review_img/review_no_image.jpg"); $('input#user_product_ordered').val(user_product_ordered); return userCheckForReview; }); <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['rdelim']->value, ENT_QUOTES, 'UTF-8'); ?> ); //]]> </script> <div class="div_show_more_posts_action" style="text-align:center"> <input type="hidden" value="2" id="input_show_more_posts_action" /> <input type="hidden" value="<?php if ($_REQUEST['sort_review']) { echo htmlspecialchars($_REQUEST['sort_review'], ENT_QUOTES, 'UTF-8'); } else { ?> MH<?php } ?> " id="input_sort_review" /> <?php if ($_smarty_tpl->tpl_vars['posts_count']->value > count($_smarty_tpl->tpl_vars['posts']->value)) { ?> <a onclick="ls_show_more_posts(<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['object_id']->value, ENT_QUOTES, 'UTF-8'); ?> ,'<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['object_type']->value, ENT_QUOTES, 'UTF-8'); ?> ');return false;" id="show_more_posts"><?php echo $_smarty_tpl->__('show_more_posts'); ?> </a> <?php } ?> </div> <?php echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "pagination_contents_comments_" . (string) $_smarty_tpl->tpl_vars['object_id']->value), 0); ?> <?php } else { ?> <p class="no-items ty-no-items"><?php echo $_smarty_tpl->__('no_posts_found'); ?> </p> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['wrap']->value == true) { ?> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php echo $_smarty_tpl->getSubTemplate("common/group.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['content']), 0); ?> <?php } else { ?> <?php $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null); ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['title']->value, ENT_QUOTES, 'UTF-8'); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <?php } ?> <!--content_review_attributes--></div> <?php } } } }
* (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ use Tygh\Registry; if (!defined('BOOTSTRAP')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { if ($mode == 'update') { if (!empty($_REQUEST['posts'])) { fn_update_discussion_posts($_REQUEST['posts']); } } return; } if ($mode == 'update') { if (!fn_allowed_for('ULTIMATE')) { $discussion = fn_get_discussion($_REQUEST['company_id'], 'M', true, $_REQUEST); if (!empty($discussion) && $discussion['type'] != 'D') { Registry::set('navigation.tabs.discussion', array('title' => __('discussion_title_company'), 'js' => true)); Registry::get('view')->assign('discussion', $discussion); } } }
/*************************************************************************** * * * Copyright (c) 2004 Simbirsk Technologies Ltd. All rights reserved. * * * * This is commercial software, only users who have purchased a valid * * license and accept to the terms of the License Agreement can install * * and use this program. * * * **************************************************************************** * PLEASE READ THE FULL TEXT OF THE SOFTWARE LICENSE AGREEMENT IN THE * * "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE. * ****************************************************************************/ // // $Id: discussion.post.php 10229 2010-07-27 14:21:39Z 2tl $ // if (!defined('AREA')) { die('Access denied'); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { return array(CONTROLLER_STATUS_OK); } if ($mode == 'update') { if (!empty($_REQUEST['discussion_type'])) { $discussion = fn_get_discussion(0, $_REQUEST['discussion_type']); } if (!empty($discussion) && $discussion['type'] != 'D') { Registry::set('navigation.tabs.discussion', array('title' => fn_get_lang_var('discussion_title_home_page'), 'js' => true)); $view->assign('discussion', $discussion); } }