} else { if ($action == 'cancel_add') { $mode = 'view'; } else { if ($action == 'cancel_edit') { $mode = 'view'; } } } } } } } } // Start main content draw_title_bar(prepare_breadcrumbs(array(_LISTINGS_MANAGEMENT => '', _CATEGORY_DESCRIPTION => '', $category_info_name => '', ucfirst($action) => '')), prepare_permanent_link('index.php?admin=mod_categories&cid=' . (int) $cid, _BUTTON_BACK)); echo $msg; draw_content_start(); if ($mode == 'view') { $objCategoryDescr->DrawViewMode(); } else { if ($mode == 'add') { $objCategoryDescr->DrawAddMode(); } else { if ($mode == 'edit') { $objCategoryDescr->DrawEditMode($rid); } else { if ($mode == 'details') { $objCategoryDescr->DrawDetailsMode($rid); } }
/** * Draws mass mail form * $param $draw */ public function DrawMassMailForm($draw = true) { global $objSettings; $template_subject = ''; $template_content = ''; $result = database_query('SELECT COUNT(*) as cnt FROM ' . $this->TABLE_NAME . ' WHERE is_active = 1 AND email_notifications = 1 AND email != \'\'', DATA_ONLY, FIRST_ROW_ONLY); $members_emails_count = isset($result['cnt']) ? $result['cnt'] : 0; $result = database_query('SELECT COUNT(*) as cnt FROM ' . TABLE_ACCOUNTS . ' WHERE is_active = 1 AND email != \'\'', DATA_ONLY, FIRST_ROW_ONLY); $admins_emails_count = isset($result['cnt']) ? $result['cnt'] : 0; $emails_count = $members_emails_count + $admins_emails_count; $result = database_query('SELECT COUNT(*) as cnt FROM ' . TABLE_NEWS_SUBSCRIBED . ' WHERE email != \'\'', DATA_ONLY, FIRST_ROW_ONLY); $newsletter_subscribers_count = isset($result['cnt']) ? $result['cnt'] : 0; $send_copy_to_admin = '1'; $email_from = $objSettings->GetParameter('admin_email'); $template_code = isset($_GET['template_code']) ? prepare_input($_GET['template_code']) : ''; $duration = isset($_POST['duration']) ? (int) $_POST['duration'] : '5'; $members_module_installed = Modules::IsModuleInstalled($this->MODULE_NAME); // load appropriate email template if ($template_code != '') { $template = $this->GetTemplate($template_code, Application::Get('lang')); $template_subject = $template['template_subject']; $template_content = $template['template_content']; } if ($this->error == true) { $template_code = isset($_POST['template_name']) ? prepare_input($_POST['template_name']) : ''; $template_subject = isset($_POST['subject']) ? prepare_input($_POST['subject']) : ''; $template_content = isset($_POST['message']) ? prepare_input($_POST['message']) : ''; } $output = '<script type="text/javascript"> function duration_OnChange(val){ var el_package_size = (document.getElementById(\'package_size\')) ? document.getElementById(\'package_size\') : null; if(val == \'\' && el_package_size){ el_package_size.selectedIndex = 0; el_package_size.disabled = \'disabled\'; }else{ el_package_size.disabled = \'\'; } } function email_to_OnChange(val){ var el_send_copy_to_admin = (document.getElementById(\'send_copy_to_admin\')) ? document.getElementById(\'send_copy_to_admin\') : null; if(val == \'admins\' && el_send_copy_to_admin){ el_send_copy_to_admin.disabled = \'disabled\'; }else{ el_send_copy_to_admin.disabled = \'\'; } } function OnSubmit_Check(){ var email_to = (document.getElementById(\'email_to\')) ? document.getElementById(\'email_to\').value : \'\'; var email_from = (document.getElementById(\'email_from\')) ? document.getElementById(\'email_from\').value : \'\'; var subject = (document.getElementById(\'subject\')) ? document.getElementById(\'subject\').value : \'\'; var message = (document.getElementById(\'message\')) ? document.getElementById(\'message\').value : \'\'; if(email_to == \'\'){ alert(\'' . str_replace('_FIELD_', _EMAIL_TO, _FIELD_CANNOT_BE_EMPTY) . '\'); document.getElementById(\'email_to\').focus(); return false; }else if(email_from == \'\'){ alert(\'' . str_replace('_FIELD_', _EMAIL_FROM, _FIELD_CANNOT_BE_EMPTY) . '\'); document.getElementById(\'email_from\').focus(); return false; }else if(email_from != \'\' && !appIsEmail(email_from)){ alert(\'' . str_replace('_FIELD_', _EMAIL_FROM, _FIELD_MUST_BE_EMAIL) . '\'); document.getElementById(\'email_from\').focus(); return false; }else if(subject == \'\'){ alert(\'' . str_replace('_FIELD_', _SUBJECT, _FIELD_CANNOT_BE_EMPTY) . '\'); document.getElementById(\'subject\').focus(); return false; }else if(message == \'\'){ alert(\'' . str_replace('_FIELD_', _MESSAGE, _FIELD_CANNOT_BE_EMPTY) . '\'); document.getElementById(\'message\').focus(); return false; }else if(email_to == \'all\'){ if(!confirm(\'' . _PERFORM_OPERATION_COMMON_ALERT . '\')){ return false; } } return true; } </script>'; $output .= '<form action="index.php?admin=mass_mail" method="post" style="margin:0px;"> ' . draw_hidden_field('task', 'send', false) . ' ' . draw_hidden_field('email_random_code', get_random_string(10), false) . ' ' . draw_token_field(false) . ' <table border="0" cellspacing="10"> <tr> <td align="left" valign="top"> <fieldset style="height:410px;"> <legend><b>' . _FORM . ':</b></legend> <table width="97%" align="center" border="0" cellspacing="5"> <tr> <td align="right" nowrap="nowrap"> <label>' . _EMAIL_TEMPLATES . ':</label><br> ' . prepare_permanent_link('index.php?admin=email_templates', '[ ' . _MANAGE_TEMPLATES . ' ]', '', '') . ' </td> <td></td> <td> <table cellpadding="0" cellspacing="0"> <tr valign="middle"> <td> <select name="template_name" id="template_name" style="margin-bottom:3px;" onchange="javascript:appGoTo(\'admin=mass_mail&template_code=\'+this.value)"> <option value="">-- ' . _NO_TEMPLATE . ' --</option>'; $templates = $this->GetAllTemplates('is_system_template=0'); for ($i = 0; $i < $templates[1]; $i++) { $output .= '<option'; $output .= $templates[0][$i]['is_system_template'] == '1' ? ' style="background-color:#ffffcc;color:#000055"' : ''; $output .= $template_code == $templates[0][$i]['template_code'] ? ' selected="selected"' : ''; $output .= ' value="' . encode_text($templates[0][$i]['template_code']) . '">' . $templates[0][$i]['template_name'] . '</option>'; } $output .= ' </select> </td> </tr> </table> </td> </tr> <tr> <td align="right" nowrap="nowrap"><label>' . _EMAIL_TO . ':</label></td> <td><span class="mandatory_star">*</span></td> <td> <select name="email_to" id="email_to" style="margin-bottom:3px;" onchange="email_to_OnChange(this.value)"> <option value="">-- ' . _SELECT . ' --</option> <option value="test" style="background-color:#ffffcc;color:#000055">' . _TEST_EMAIL . ' (' . $email_from . ')</option>'; if (Modules::IsModuleInstalled('news')) { $output .= '<option value="newsletter_subscribers" style="background-color:#ffccff;color:#000055">' . _NEWSLETTER_SUBSCRIBERS . ' (' . $newsletter_subscribers_count . ')</option>'; } if ($members_module_installed) { $output .= '<optgroup label="' . $this->MEMBERS_NAME . '">'; $output .= '<option value="members|all">' . _ALL . ' (' . $members_emails_count . ')</option>'; if (self::$PROJECT == 'ShoppingCart' || self::$PROJECT == 'BusinessDirectory' || self::$PROJECT == 'HotelSite') { $arrMembersGroups = CustomerGroups::GetAllGroupsByCustomers(); } else { if (self::$PROJECT == 'MedicalAppointment') { $arrMembersGroups = PatientGroups::GetAllGroupsByPatiens(); } else { $arrMembersGroups = UserGroups::GetAllGroupsByUsers(); } } $member_groups_emails_count = 0; if ($arrMembersGroups[1] > 0) { foreach ($arrMembersGroups[0] as $key => $val) { if ($val[$this->MODULE_NAME . '_count']) { $output .= '<option value="members|' . $val['id'] . '">' . $val['name'] . ' (' . $val[$this->MODULE_NAME . '_count'] . ')</option>'; $member_groups_emails_count += $val[$this->MODULE_NAME . '_count']; } } } $member_non_groups_emails = $members_emails_count - $member_groups_emails_count; $output .= '<option value="members|uncategorized">' . _UNCATEGORIZED . ' (' . $member_non_groups_emails . ')</option>'; $output .= '</optgroup>'; } $output .= '<option value="admins">' . _ADMINS . ' (' . $admins_emails_count . ')</option>'; if ($members_module_installed) { $output .= '<option value="all">' . $this->ADMINS_MEMBERS_NAME . ' (' . $emails_count . ')</option>'; } $output .= '</select> </td> </tr> <tr> <td align="right" nowrap="nowrap"><label for="email">' . _EMAIL_FROM . ':</label></td> <td><span class="mandatory_star">*</span></td> <td> <input type="text" name="email_from" style="width:210px" id="email_from" value="' . decode_text($email_from) . '" maxlength="70" /> </td> </tr> <tr valign="top"> <td align="right" nowrap="nowrap"><label>' . _SUBJECT . ':</label></td> <td><span class="mandatory_star">*</span></td> <td> <input type="text" style="width:410px" name="subject" id="subject" value="' . decode_text($template_subject) . '" maxlength="255" /> </td> </tr> <tr valign="top"> <td align="right" nowrap="nowrap"><label>' . _MESSAGE . ':</label></td> <td><span class="mandatory_star">*</span></td> <td> <textarea style="width:465px;margin-right:10px;" rows="10" name="message" id="message">' . $template_content . '</textarea> </td> </tr>'; $output .= '<tr valign="middle"> <td colspan="2"></td> <td><img src="images/question_mark.png" alt="">' . _MASS_MAIL_ALERT . '</td> </tr>'; $output .= '<tr><td colspan="3" nowrap style="height:6px;"></td></tr> <tr> <td align="right" nowrap="nowrap"><a href="javascript:void(0);" onclick="appPopupWindow(\'mail_preview.html\',\'message\')">[ ' . _PREVIEW . ' ]</a></td> <td></td> <td> <div style="float:left"><input type="checkbox" class="form_checkbox" name="send_copy_to_admin" id="send_copy_to_admin" ' . ($send_copy_to_admin == '1' ? 'checked="checked"' : '') . ' value="1"> <label for="send_copy_to_admin">' . _SEND_COPY_TO_ADMIN . '</label></div> <div style="float:right"><input class="form_button" type="submit" name="btnSubmit" value="' . _SEND . '" onclick="return OnSubmit_Check();"> </div> </td> </tr> </table> </fieldset> </td> <td align="left" valign="top"> <fieldset style="padding-' . Application::Get('defined_right') . ':10px;"> <legend>' . _PREDEFINED_CONSTANTS . ':</legend> <ul> <li>{FIRST NAME} <br><span style="color:a0a0a0">' . _PC_FIRST_NAME_TEXT . '</span></li> <li>{LAST NAME} <br><span style="color:a0a0a0">' . _PC_LAST_NAME_TEXT . '</span></li> <li>{USER NAME} <br><span style="color:a0a0a0">' . _PC_USER_NAME_TEXT . '</span></li> <li>{USER EMAIL} <br><span style="color:a0a0a0">' . _PC_USER_EMAIL_TEXT . '</span></li> <li>{BASE URL} <br><span style="color:a0a0a0">' . _PC_WEB_SITE_BASED_URL_TEXT . '</span></li> <li>{WEB SITE} <br><span style="color:a0a0a0">' . _PC_WEB_SITE_URL_TEXT . '</span></li> <li>{YEAR} <br><span style="color:a0a0a0">' . _PC_YEAR_TEXT . '</span></li> </ul> </fieldset> </td> </tr> </table> </form>'; if ($draw) { echo $output; } else { return $output; } }
/** * Prepare admin panel link * @param $href * @param $link * @param $params * @param $class * @param $href_array */ private function PrepareLink($href, $link, $params = '', $class = '', $href_array = array()) { $output = ''; $css_class = $class != '' ? $class : ''; $logged_as = $this->IsLoggedInAsCustomer() ? 'customer' : 'admin'; if (Application::Get($logged_as) == $href || in_array(Application::Get($logged_as), $href_array)) { $is_active = true; if (!empty($params)) { $params_parts = explode('=', $params); $f_param = isset($params_parts[0]) && isset($_GET[$params_parts[0]]) ? $_GET[$params_parts[0]] : ''; $s_param = isset($params_parts[1]) ? $params_parts[1] : ''; if ($f_param != $s_param) { $is_active = false; } } } else { $is_active = false; } if (!empty($css_class)) { $css_class = $is_active ? $css_class . ' active' : ''; } else { $css_class = $is_active ? 'active' : ''; } $output = prepare_permanent_link('index.php?' . $logged_as . '=' . $href . (!empty($params) ? '&' . $params : $params), $link, '', $css_class); return $output; }
} } } } } } } } } // Start main content draw_title_bar(prepare_breadcrumbs(array(_ACCOUNTS => '', _CUSTOMERS_MANAGEMENT => '', _CUSTOMERS => '', ucfirst($action) => ''))); //if($objSession->IsMessage('notice')) echo $objSession->GetMessage('notice'); echo $msg; draw_content_start(); if ($mode == 'view') { $objCustomers->DrawOperationLinks(prepare_permanent_link('index.php?admin=mod_customers_groups', '[ ' . _CUSTOMER_GROUPS . ' ]')); $objCustomers->DrawViewMode(); } else { if ($mode == 'add') { $objCustomers->DrawAddMode(); } else { if ($mode == 'edit') { $objCustomers->DrawEditMode($rid); } else { if ($mode == 'details') { $objCustomers->DrawDetailsMode($rid); } } } } draw_content_end();
$mode = 'view'; } else { if ($action == 'cancel_edit') { $mode = 'view'; } } } } } } } } $objListings = Listings::Instance($listing_id); $listing_info_name = $objListings->GetField('business_name'); // Start main content draw_title_bar(prepare_breadcrumbs(array(_MY_ACCOUNT => '', _MY_LISTINGS => '', $listing_info_name => '', _CATEGORIES => '', ucfirst($action) => '')), prepare_permanent_link('index.php?customer=my_listings', _BUTTON_BACK)); //if($objSession->IsMessage('notice')) echo $objSession->GetMessage('notice'); echo $msg; draw_content_start(); if ($mode == 'view') { $objListingsCategories->DrawViewMode(); } else { if ($mode == 'add') { $objListingsCategories->DrawAddMode(); } else { if ($mode == 'edit') { $objListingsCategories->DrawEditMode($rid); } else { if ($mode == 'details') { $objListingsCategories->DrawDetailsMode($rid); }
*/ // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- if ($objLogin->IsLoggedInAs('owner') && Modules::IsModuleInstalled('backup')) { $submition_type = isset($_POST['submition_type']) ? prepare_input($_POST['submition_type']) : ''; $backup_file = isset($_POST['backup_file']) ? prepare_input($_POST['backup_file']) : ''; $st = isset($_GET['st']) ? prepare_input($_GET['st']) : ''; $fname = isset($_GET['fname']) ? prepare_input($_GET['fname']) : ''; $msg = ''; $objBackup = new Backup(); if ($st == 'restore') { // restore previouse backup if ($objBackup->RestoreBackup($fname)) { $msg = draw_success_message(str_replace('_FILE_NAME_', $fname, _BACKUP_WAS_RESTORED), false); } else { $msg = draw_important_message($objBackup->error, false); } } else { $msg = draw_message(_BACKUP_RESTORE_NOTE, false); } // draw title bar and message draw_title_bar(prepare_breadcrumbs(array(_MODULES => '', _BACKUP => '', _BACKUP_RESTORE => '')), prepare_permanent_link('index.php?admin=mod_backup_installation', _BACKUP_INSTALLATION)); echo $msg; draw_content_start(); $objBackup->DrawRestoreForm(); draw_content_end(); } else { draw_title_bar(_ADMIN); draw_important_message(_NOT_AUTHORIZED); }
<p> <?php echo $footer_text = $objSiteDescription->DrawFooter(false); ?> <?php if (!empty($footer_text)) { echo ' ' . draw_divider(false) . ' '; } ?> <?php if ($objLogin->IsLoggedIn()) { ?> <?php draw_hidden_field('submit_logout', 'logout'); ?> <a class="main_link" href="javascript:appFormSubmit('frmLogout');"><?php echo _BUTTON_LOGOUT; ?> </a> <?php } else { ?> <?php echo prepare_permanent_link('index.php?admin=login', _ADMIN_LOGIN, '', 'main_link'); ?> <?php } ?> </p> </form> </div>
} else { if ($action == 'cancel_add') { $mode = 'view'; } else { if ($action == 'cancel_edit') { $mode = 'view'; } } } } } } } } // Start main content draw_title_bar(prepare_breadcrumbs(array(_MY_ACCOUNT => '', _INQUIRIES => '', 'ID:' . $inq_id => '', _INQUIRIES_REPLIES => '', ucfirst($action) => '')), prepare_permanent_link('index.php?customer=inquiries', _BUTTON_BACK)); echo $msg; draw_content_start(); if ($mode == 'view') { $objInquiriesReplies->DrawViewMode(); } else { if ($mode == 'add') { $objInquiriesReplies->DrawAddMode(array('cancel' => false)); } else { if ($mode == 'edit') { $objInquiriesReplies->DrawEditMode($rid); } else { if ($mode == 'details') { $objInquiriesReplies->DrawDetailsMode($rid); } }
} else { if ($action == 'cancel_add') { $mode = 'view'; } else { if ($action == 'cancel_edit') { $mode = 'view'; } } } } } } } } // Start main content draw_title_bar(prepare_breadcrumbs(array(_LISTINGS_MANAGEMENT => '', _LISTINGS => '', $listing_info_name => '', _CATEGORIES => '', ucfirst($action) => '')), prepare_permanent_link('index.php?admin=mod_listings_management', _BUTTON_BACK)); //if($objSession->IsMessage('notice')) echo $objSession->GetMessage('notice'); echo $msg; draw_content_start(); if ($mode == 'view') { $objListingsCategories->DrawViewMode(); } else { if ($mode == 'add') { $objListingsCategories->DrawAddMode(); } else { if ($mode == 'edit') { $objListingsCategories->DrawEditMode($rid); } else { if ($mode == 'details') { $objListingsCategories->DrawDetailsMode($rid); }
} else { if ($action == 'cancel_add') { $mode = 'view'; } else { if ($action == 'cancel_edit') { $mode = 'view'; } } } } } } } } // Start main content draw_title_bar(prepare_breadcrumbs(array(_MODULES => '', _INQUIRIES_MANAGEMENT => '', 'ID:' . $inq_id => '', _INQUIRIES_REPLIES => '', ucfirst($action) => '')), prepare_permanent_link('index.php?admin=mod_inquiries_management', _BUTTON_BACK)); echo $msg; draw_content_start(); if ($mode == 'view') { $objInquiriesReplies->DrawViewMode(); } else { if ($mode == 'add') { $objInquiriesReplies->DrawAddMode(); } else { if ($mode == 'edit') { $objInquiriesReplies->DrawEditMode($rid); } else { if ($mode == 'details') { $objInquiriesReplies->DrawDetailsMode($rid); } }
} ?> </tr> <tr><td colspan="2" nowrap height="5px"></td></tr> <tr> <td valign="top" colspan="2"> <?php if (ModulesSettings::Get('customers', 'allow_registration') == 'yes') { echo prepare_permanent_link('index.php?customer=create_account', _CREATE_ACCOUNT) . '<br />'; } if (ModulesSettings::Get('customers', 'allow_reset_passwords') == 'yes') { echo prepare_permanent_link('index.php?customer=password_forgotten', _FORGOT_PASSWORD) . '<br />'; } if (ModulesSettings::Get('customers', 'allow_registration') == 'yes' && ModulesSettings::Get('customers', 'reg_confirmation') == 'by email') { echo prepare_permanent_link('index.php?customer=resend_activation', _RESEND_ACTIVATION_EMAIL); } ?> </td> </tr> <tr><td colspan="2" nowrap="nowrap" height="5px"></td></tr> </table> </form> </div> <script type="text/javascript"> appSetFocus("txt_user_name");</script> <?php } else { if ($objLogin->IsLoggedInAsCustomer()) { echo '<div class="pages_contents">'; draw_message(_ALREADY_LOGGED, true, true, false, 'width:100%'); echo '</div>';
/** * Draws vocabulary * @param $key */ public function DrawVocabulary($key) { $align_left = Application::Get('lang_dir') == 'ltr' ? 'left' : 'right'; $align_right = Application::Get('lang_dir') == 'ltr' ? 'right' : 'left'; $this->GetVocabulary($this->whereClause); echo '<a name="top"></a>'; echo '<table width="100%" align="center" border="0" cellspacing="0" cellpadding="2" class="main_text"> <tr> <td>' . _FILTER_BY . ': '; echo prepare_permanent_link('index.php?admin=vocabulary' . $this->langIdByUrl, _ALL) . ' - '; for ($i = 65; $i < 91; $i++) { if ($this->filterBy == chr($i)) { $chr_i = '<b><u>' . chr($i) . '</u></b>'; } else { $chr_i = chr($i); } echo prepare_permanent_link('index.php?admin=vocabulary&filter_by=' . chr($i) . $this->langIdByUrl, $chr_i) . ' '; } echo ' - '; for ($i = 1; $i <= 5; $i++) { if ($this->filterBy == $i) { $chr_i = '<b><u>' . $i . '</u></b>'; } else { $chr_i = $i; } echo prepare_permanent_link('index.php?admin=vocabulary&filter_by=' . $i . $this->langIdByUrl, $chr_i) . ' '; } echo '</td> <td width="7%" align="center" nowrap="nowrap"> ' . _TOTAL . ': ' . count($this->keys) . ' </td> </tr>'; echo '<tr align="center"><td colspan="2">' . draw_line('line_no_margin', IMAGE_DIRECTORY, false) . '</td></tr>'; echo '</table>'; if (!empty($this->keys)) { echo '<table width="100%" align="center" border="0" cellspacing="0" cellpadding="3" class="main_text">'; echo '<tr> <th width="1%">#</th> <th width="25%" align="' . $align_left . '">' . _KEY . '</th> <th width="65%" align="' . $align_left . '">' . _VALUE . '</th> <th width="9%"></th>'; for ($i = 0; $i < $this->vocabularySize; $i++) { // Prepare key_text for displaying $decoded_text = strip_tags(decode_text($this->keys[$i]['key_text'])); if (strlen($decoded_text) > 90) { $key_text = '<span style="cursor:help;" title="' . $decoded_text . '">' . substr_by_word($decoded_text, 95, true) . '</span>'; } else { $key_text = $decoded_text; } // Display vocabulary row if ($this->keys[$i]['key_value'] == $this->currentKey) { echo '<tr>'; echo '<td align="' . $align_right . '" class="voc_row_edit_' . $align_left . '" nowrap="nowrap">' . ($i + 1) . '.</td>'; echo '<td align="' . $align_left . '" class="voc_row_edit_middle" nowrap="nowrap">' . $this->keys[$i]['key_value'] . '</td>'; echo '<td align="' . $align_left . '" class="voc_row_edit_middle">' . $key_text . '</td> <td align="center" class="voc_row_edit_' . $align_right . '">' . prepare_permanent_link('index.php?admin=vocabulary&key=' . $this->keys[$i]['id'] . '&act=edit' . $this->filterByUrl . $this->langIdByUrl, '[ ' . _EDIT_WORD . ' ]') . '</td> </tr>'; } else { if ($this->keys[$i]['id'] == (int) $key) { echo '<tr>'; echo '<td align="' . $align_right . '" class="voc_row_update_' . $align_left . '" nowrap="nowrap">' . ($i + 1) . '.</td>'; echo '<td align="' . $align_left . '" class="voc_row_update_middle" nowrap="nowrap">' . $this->keys[$i]['key_value'] . '</td>'; echo '<td align="' . $align_left . '" class="voc_row_update_middle">' . $key_text . '</td> <td align="center" class="voc_row_update_' . $align_right . '">' . prepare_permanent_link('index.php?admin=vocabulary&key=' . $this->keys[$i]['id'] . '&act=edit' . $this->filterByUrl . $this->langIdByUrl, '[ ' . _EDIT_WORD . ' ]') . '</td> </tr>'; } else { echo '<tr ' . highlight(0) . ' onmouseover="oldColor=this.style.backgroundColor;this.style.backgroundColor=\'#ededed\';" onmouseout="this.style.backgroundColor=oldColor">'; echo '<td align="' . $align_right . '" nowrap="nowrap">' . ($i + 1) . '.</td>'; echo '<td align="' . $align_left . '" nowrap="nowrap">' . $this->keys[$i]['key_value'] . '</td>'; echo '<td align="' . $align_left . '">' . $key_text . '</td> <td align="center">' . prepare_permanent_link('index.php?admin=vocabulary&key=' . $this->keys[$i]['id'] . '&act=edit' . $this->filterByUrl . $this->langIdByUrl, '[ ' . _EDIT_WORD . ' ]') . '</td> </tr>'; } } } echo '<tr><td colspan="4" nowrap="nowrap" height="10px"></td></tr>'; if ($this->vocabularySize > 15) { echo '<tr valign="bottom"><td colspan="3"></td><td align="center">' . prepare_permanent_link('index.php?admin=vocabulary' . $this->filterByUrl . $this->langIdByUrl . '#top', _TOP . ' ^') . '</td></tr>'; } echo '</table>'; } else { draw_important_message(_VOC_NOT_FOUND); } }
</tr> <tr><td colspan="6" height="3px" nowrap><?php draw_line(); ?> </td></tr> <?php for ($i = 0; $i < $all_menus[1]; $i++) { echo '<tr ' . highlight(0) . ' onmouseover="oldColor=this.style.backgroundColor;this.style.backgroundColor=\'#e1e1e1\';" onmouseout="this.style.backgroundColor=oldColor"> <td align="' . Application::Get('defined_left') . '">' . $all_menus[0][$i]['menu_name'] . '</td> <td align="center">' . ucfirst($all_menus[0][$i]['access_level']) . '</td> <td align="center">' . ($all_menus[0][$i]['menu_placement'] == 'hidden' ? '- ' . $all_menus[0][$i]['menu_placement'] . ' -' : ucfirst($all_menus[0][$i]['menu_placement'])) . '</td> <td align="center">' . $all_menus[0][$i]['menu_order'] . '</td> <td align="center"> ' . prepare_permanent_link('index.php?admin=menus&act=move&mid=' . $all_menus[0][$i]['id'] . '&mo=' . $all_menus[0][$i]['menu_order'] . '&dir=up&language_id=' . $language_id, _UP) . '/' . prepare_permanent_link('index.php?admin=menus&act=move&mid=' . $all_menus[0][$i]['id'] . '&mo=' . $all_menus[0][$i]['menu_order'] . '&dir=down&language_id=' . $language_id, _DOWN) . ' </td> <td align="center" nowrap="nowrap"> ' . ($objLogin->HasPrivileges('edit_menus') ? prepare_permanent_link('index.php?admin=menus_edit&mid=' . $all_menus[0][$i]['id'] . '&language_id=' . $language_id, _EDIT_WORD) : '') . ' ' . ($objLogin->HasPrivileges('edit_menus') && $objLogin->HasPrivileges('delete_menus') ? ' ' . draw_divider(false) . ' ' : '') . ' ' . ($objLogin->HasPrivileges('delete_menus') ? '<a href="javascript:confirmDelete(\'' . $all_menus[0][$i]['id'] . '\',\'' . $all_menus[0][$i]['menu_order'] . '\');">' . _DELETE_WORD . '</a>' : '') . ' </td> </tr>'; } echo '</table>'; } else { draw_message(_MENU_NOT_FOUND); } draw_content_end(); } else { draw_title_bar(_ADMIN); draw_important_message(_NOT_AUTHORIZED); }
} $mode = 'view'; } } } } } } } } } draw_title_bar(prepare_breadcrumbs(array(_LISTINGS_MANAGEMENT => '', _LISTINGS => '', _CATEGORIES_MANAGEMENT => '', $category_info['third']['name'] => '', $category_info['second']['name'] => '', $category_info['first']['name'] => '', ucfirst($action) => '')), $cid != '0' ? prepare_permanent_link('index.php?admin=mod_categories&cid=' . $category_info_parent_id, _BUTTON_BACK) : ''); echo $msg; draw_content_start(); if ($mode == 'view') { $objCategories->DrawOperationLinks(prepare_permanent_link('index.php?admin=mod_categories&mg_action=recalculate', '[ ' . _RECALCULATE_LISTING_COUNT . ' ]')); $objCategories->DrawViewMode(); } else { if ($mode == 'add') { $objCategories->DrawAddMode(); } else { if ($mode == 'edit') { $objCategories->DrawEditMode($rid); } else { if ($mode == 'details') { $objCategories->DrawDetailsMode($rid); } } } } draw_content_end();
} else { if ($action == 'cancel_add') { $mode = 'view'; } else { if ($action == 'cancel_edit') { $mode = 'view'; } } } } } } } } // Start main content draw_title_bar(prepare_breadcrumbs(array(_ACCOUNTS => '', $role_info_name => '', _PRIVILEGES_MANAGEMENT => '', ucfirst($action) => '')), prepare_permanent_link('index.php?admin=roles_management', _BUTTON_BACK)); //if($objSession->IsMessage('notice')) echo $objSession->GetMessage('notice'); echo $msg; draw_content_start(); if ($mode == 'view') { $objRolePrivileges->DrawViewMode(); } else { if ($mode == 'add') { $objRolePrivileges->DrawAddMode(); } else { if ($mode == 'edit') { $objRolePrivileges->DrawEditMode($rid); } else { if ($mode == 'details') { $objRolePrivileges->DrawDetailsMode($rid); }
} } } // Start main content draw_title_bar(prepare_breadcrumbs(array(_MODULES => '', _FAQ => '', _FAQ_MANAGEMENT => '', $faq_info['name'] => '', ucfirst($action) => '')), prepare_permanent_link('index.php?admin=mod_faq_management', _BUTTON_BACK)); echo $msg; draw_content_start(); if ($mode == 'view') { $objFaqCategoryItems->DrawViewMode(); } else { if ($mode == 'add') { $objFaqCategoryItems->DrawAddMode(); } else { if ($mode == 'edit') { $objFaqCategoryItems->DrawEditMode($rid); } else { if ($mode == 'details') { $objFaqCategoryItems->DrawDetailsMode($rid); } } } } draw_content_end(); } else { draw_title_bar(prepare_breadcrumbs(array(_MODULES => '', _FAQ_MANAGEMENT => '', _QUESTIONS => '')), prepare_permanent_link('index.php?admin=mod_faq_management', _BUTTON_BACK)); draw_important_message(_WRONG_PARAMETER_PASSED); } } else { draw_title_bar(_ADMIN); draw_important_message(_NOT_AUTHORIZED); }
<td><input class="form_text" type="password" name="password" style="width:150px" maxlength="20" autocomplete="off" /></td> </tr> <tr><td colspan='2'> </td></tr> <tr> <td colspan="2"> <input class="form_button" type="submit" name="submit" value="<?php echo _BUTTON_LOGIN; ?> "> </td> </tr> <tr><td colspan="2" nowrap height="5px"></td></tr> <tr> <td valign='top' colspan="2"> <?php echo prepare_permanent_link('index.php?admin=password_forgotten', _FORGOT_PASSWORD); ?> </td> </tr> <tr><td colspan='2' nowrap height='5px'></td></tr> </table> </form> </div> <script type="text/javascript"> appSetFocus('txt_user_name'); </script> <?php } else { if ($objLogin->IsLoggedInAsAdmin()) { draw_important_message(_ALREADY_LOGGED); draw_content_start();
<td width="88%"><input class="form_text" type="text" name="email" id="email" size="22" maxlength="70" autocomplete="off" /></td> </tr> <tr><td colspan="2"> </td></tr> <tr> <td> <input class="form_button" type="submit" name="btnSend" value="<?php echo _SEND; ?> "> </td> </tr> <tr><td colspan='2' nowrap height='5px'></td></tr> <tr> <td colspan='2'> <?php echo prepare_permanent_link('index.php?admin=login', _ADMIN_LOGIN); ?> </td> </tr> <tr><td colspan='2' nowrap height='5px'></td></tr> </table> </form> </div> <script type="text/javascript"> appSetFocus('email'); </script> <?php } else { if ($objLogin->IsLoggedInAsAdmin()) { draw_important_message(_ALREADY_LOGGED); } else {
<?php /*_YOU_ARE_LOGGED_AS.': '*/ echo $objLogin->GetLoggedName(); ?> <?php echo ' ' . draw_divider(false) . ' '; ?> <?php echo prepare_permanent_link('index.php?admin=home', _HOME, '', 'main_link'); ?> <?php echo ' ' . draw_divider(false) . ' '; ?> <?php echo prepare_permanent_link('index.php?admin=my_account', _MY_ACCOUNT, '', 'main_link'); ?> <?php echo ' ' . draw_divider(false) . ' '; ?> <a class="main_link" href="javascript:appFormSubmit('frmLogout');"><?php echo _BUTTON_LOGOUT; ?> </a> </form> <?php } ?> </div> </div>
<?php echo Search::DrawQuickSearch(); ?> </div> <ul id="menu" class="nav_top dropdown_outer"> <?php // Draw top menu Menu::DrawTopMenu(); ?> </ul> <div class="slogan"> <?php if ($objLogin->IsLoggedInAsAdmin() && Application::Get('preview') == 'yes') { echo prepare_permanent_link('index.php?preview=no', _BACK_TO_ADMIN_PANEL, '', 'header'); } else { echo $objSiteDescription->GetParameter('slogan_text'); } ?> </div> <?php if (Modules::IsModuleInstalled('news') && ModulesSettings::Get('news', 'news_rss') == 'yes') { echo '<div class="rss"><a href="feeds/rss.xml"><img src="templates/' . Application::Get('template') . '/images/spacer.gif" title="RSS Feed" alt="RSS Feed" border="0" width="27" height="62" /></a></div>'; } ?> <div class="nav_language"> <?php
/** * Draws gallery * @param $draw */ public function DrawGallery($draw = true) { $lang = Application::Get('lang'); $output = ''; if (!Modules::IsModuleInstalled('gallery')) { return $output; } $icon_width = ModulesSettings::Get('gallery', 'album_icon_width'); $icon_height = ModulesSettings::Get('gallery', 'album_icon_height'); $albums_per_line = ModulesSettings::Get('gallery', 'albums_per_line'); $image_gallery_type = ModulesSettings::Get('gallery', 'image_gallery_type'); $show_items_count_in_album = ModulesSettings::Get('gallery', 'show_items_count_in_album'); $image_gallery_rel = $image_gallery_type == 'lytebox' ? 'lyteshow' : 'rokbox'; $sql = 'SELECT ga.id, ga.album_code, ga.album_type, gad.name, gad.description FROM ' . TABLE_GALLERY_ALBUMS . ' ga LEFT OUTER JOIN ' . TABLE_GALLERY_ALBUMS_DESCRIPTION . ' gad ON ga.id = gad.gallery_album_id AND gad.language_id = \'' . $lang . '\' WHERE ga.is_active = 1 ORDER BY ga.priority_order ASC'; $result = database_query($sql, DATA_AND_ROWS); if ($result[1] > 0) { $output .= '<table class="gallery_table" border="0" cellspacing="5">'; $output .= '<tr>'; for ($i = 0; $i < $result[1]; $i++) { if ($i != 0 && $i % $albums_per_line == 0) { $output .= '</tr><tr>'; } $output .= '<td valign="top" align="center">'; $sql = 'SELECT gai.item_file, gai.item_file_thumb, IF(gai.item_file_thumb != \'\', gai.item_file_thumb, gai.item_file) as mod_item_file_thumb, gaid.name as item_name, gaid.description as item_description, IF(gaid.description != \'\', gaid.description, gaid.name) as item_title FROM ' . TABLE_GALLERY_ALBUM_ITEMS . ' gai INNER JOIN ' . TABLE_GALLERY_ALBUM_ITEMS_DESCRIPTION . ' gaid ON gai.id = gaid.gallery_album_item_id AND gaid.language_id = \'' . $lang . '\' WHERE gai.item_file != \'\' AND gai.album_code = \'' . $result[0][$i]['album_code'] . '\' AND gai.is_active = 1 ORDER BY gai.priority_order ASC'; $result_items = database_query($sql, DATA_AND_ROWS); $gallery_icon = ''; $gallery_links = ''; $video_gallery_thumb = 'images/modules_icons/gallery/video_album.png'; for ($j = 0; $j < $result_items[1]; $j++) { if ($result[0][$i]['album_type'] == 'images') { if ($gallery_icon == '' && $result_items[0][$j]['mod_item_file_thumb'] != '') { $gallery_icon .= '<a href="' . APPHP_BASE . 'images/gallery/' . $result_items[0][$j]['item_file'] . '" rel="' . $image_gallery_rel . '[720 480](galbum' . $result[0][$i]['album_code'] . ')" title="' . $result_items[0][$j]['item_title'] . '"><img src="' . APPHP_BASE . 'images/gallery/' . $result_items[0][$j]['mod_item_file_thumb'] . '" width="' . $icon_width . '" ' . ($icon_height != 'px' ? 'height="' . $icon_height . '"' : '') . ' alt="" title="' . $result_items[0][$j]['item_title'] . '" border="0" /></a>'; } else { $gallery_links .= '<a href="' . APPHP_BASE . 'images/gallery/' . $result_items[0][$j]['item_file'] . '" rel="' . $image_gallery_rel . '[720 480](galbum' . $result[0][$i]['album_code'] . ')" title="' . $result_items[0][$j]['item_title'] . '"></a>'; } } else { if ($result[0][$i]['album_type'] == 'video') { if ($result_items[0][$j]['item_file_thumb'] != '' && @file_exists($video_gallery_thumb)) { $video_gallery_thumb = $result_items[0][$j]['item_file_thumb']; } } } } $output .= $gallery_icon; $output .= $gallery_links; if ($result[0][$i]['album_type'] == 'video') { $output .= '<img src="' . APPHP_BASE . $video_gallery_thumb . '" width="' . $icon_width . '" ' . ($icon_height != 'px' ? 'height="' . $icon_height . '"' : '') . ' alt="" title="" border="0" />'; if ($j == 0) { $output .= '<br /><span title="' . $result[0][$i]['description'] . '"><b>' . $result[0][$i]['name'] . '</b>' . ($show_items_count_in_album == 'yes' ? ' (' . $result_items[1] . ')' : '') . '</span>'; } else { $output .= '<br />' . prepare_permanent_link('index.php?page=gallery&acode=' . $result[0][$i]['album_code'], '<span title="' . $result[0][$i]['description'] . '"><b>' . $result[0][$i]['name'] . '</b>' . ($show_items_count_in_album == 'yes' ? ' (' . $result_items[1] . ')' : '') . '</span>'); } } else { if ($j == 0) { $output .= '<img src="' . APPHP_BASE . 'images/gallery/no_image.png" width="' . $icon_width . '" ' . ($icon_height != 'px' ? 'height="' . $icon_height . '"' : '') . ' alt="" title="" border="0" />'; $output .= '<br /><span title="' . $result[0][$i]['description'] . '"><b>' . $result[0][$i]['name'] . '</b>' . ($show_items_count_in_album == 'yes' ? '(' . $result_items[1] . ')' : '') . '</span>'; } else { $output .= '<br />' . prepare_permanent_link('index.php?page=gallery&acode=' . $result[0][$i]['album_code'], '<span title="' . $result[0][$i]['description'] . '"><b>' . $result[0][$i]['name'] . '</b>' . ($show_items_count_in_album == 'yes' ? ' (' . $result_items[1] . ')' : '') . '</span>'); } } $output .= '</td>'; } $output .= '</tr>'; $output .= '</table>'; } if ($draw) { echo $output; } else { return $output; } }
/** * Draws login form on Front-End * @param $draw */ public static function DrawLoginFormBlock($draw = true) { global $objLogin; $username = ''; $password = ''; $remember_me_checked = ''; // check if remember me cookies exists if (ModulesSettings::Get('customers', 'remember_me_allow') == 'yes') { $objLogin->CheckRememberMe($username, $password); if (!empty($username) && !empty($password)) { $remember_me_checked = 'checked="checked"'; } } $output = draw_block_top(_AUTHENTICATION, '', 'maximized', false); $output .= '<form class="customer_login" action="index.php?customer=login" method="post"> ' . draw_hidden_field('submit_login', 'login', false) . ' ' . draw_hidden_field('type', 'customer', false) . ' ' . draw_token_field(false) . ' <table border="0" cellspacing="1" cellpadding="1"> <tr><td>' . _USERNAME . ':</td></tr> <tr><td><input type="text" style="width:130px" name="user_name" id="user_name" maxlength="50" autocomplete="off" value="' . $username . '" /></td></tr> <tr><td>' . _PASSWORD . ':</td></tr> <tr><td><input type="password" style="width:130px" name="password" id="password" maxlength="20" autocomplete="off" value="' . $password . '" /></td></tr> <tr><td valign="middle">'; $output .= '<input class="form_button" type="submit" name="submit" value="' . _BUTTON_LOGIN . '" /> '; if (ModulesSettings::Get('customers', 'remember_me_allow') == 'yes') { $output .= '<input class="form_checkbox" ' . $remember_me_checked . ' name="remember_me" value="1" type="checkbox" /> ' . _REMEMBER_ME . '<br>'; } $output .= '</td></tr> <tr><td></td></tr>'; if (ModulesSettings::Get('customers', 'allow_registration') == 'yes') { $output .= '<tr><td>' . prepare_permanent_link('index.php?customer=create_account', _CREATE_ACCOUNT, '', 'form_link') . '</td></tr>'; } if (ModulesSettings::Get('customers', 'allow_reset_passwords') == 'yes') { $output .= '<tr><td>' . prepare_permanent_link('index.php?customer=password_forgotten', _FORGOT_PASSWORD, '', 'form_link') . '</td></tr>'; } $output .= '</table> </form>'; $output .= draw_block_bottom(false); if ($draw) { echo $output; } else { return $output; } }
$msg_text = isset($ccErrors[$msg]) ? $ccErrors[$msg] : ''; if ($payment_type == 'paypal') { $title_desc = _PAYPAL_ORDER; } else { if ($payment_type == '2co') { $title_desc = _2CO_ORDER; } else { if ($payment_type == 'authorize') { $title_desc = _AUTHORIZE_NET_ORDER; } else { $title_desc = _ONLINE_ORDER; } } } if (Modules::IsModuleInstalled('payments') && ModulesSettings::Get('payments', 'is_active') == 'yes') { draw_title_bar(prepare_breadcrumbs(array(_MY_ACCOUNT => '', _ADVERTISE => '', $title_desc => '')), prepare_permanent_link('index.php?customer=advertise', _BUTTON_BACK)); // test mode alert if (ModulesSettings::Get('payments', 'mode') == 'TEST MODE') { draw_message(_TEST_MODE_ALERT_SHORT, true, true); } if ($task == "do_order") { if (AdvertisePlans::DoOrder($payment_type)) { AdvertisePlans::DrawPrepayment(); } else { draw_important_message(AdvertisePlans::$message); } } else { if ($task == "repeat_order") { draw_important_message($msg_text); AdvertisePlans::ReDrawPrepayment(); } else {
/** * Draws menus * @param $menu_position * @param $draw */ public static function DrawMenu($menu_position = 'left', $draw = true) { global $objSettings, $objLogin; $output = ''; if ($menu_position == 'left') { $objLogin->DrawLoginLinks(); } // Get all menus which have items (links to pages) $menus = self::GetMenus($menu_position); $menus_count = $menus[1]; $objNews = News::Instance(); $show_news_block = ModulesSettings::Get('news', 'show_news_block'); $show_subscribe_block = ModulesSettings::Get('news', 'show_newsletter_subscribe_block'); if (Modules::IsModuleInstalled('news') && ($show_news_block == 'right side' || $show_subscribe_block == 'right side')) { $menus_count++; } $show_inquiries_block = ModulesSettings::Get('inquiries', 'show_inquiries_block'); if (Modules::IsModuleInstalled('inquiries') && $show_inquiries_block == 'right side') { $menus_count++; } if (ModulesSettings::Get('listings', 'show_categories_side_block') == $menu_position . ' side') { $output .= Categories::DrawSideBlock(false); $menus_count++; } if (ModulesSettings::Get('listings', 'show_featured_block') == $menu_position . ' side') { $output .= Listings::DrawFeaturedBlock(false); $menus_count++; } if (ModulesSettings::Get('listings', 'show_recent_block') == $menu_position . ' side') { $output .= Listings::DrawRecentBlock(false); $menus_count++; } if (ModulesSettings::Get('listings', 'show_directory_statistics') == $menu_position . ' side') { $menus_count++; } if ($menus_count > 0) { $output .= '<div id="column-' . $menu_position . '-wrapper">'; } // Display all menu titles (names) according to their order for ($menu_ind = 0; $menu_ind < $menus[1]; $menu_ind++) { // Start draw new menu $output .= draw_block_top($menus[0][$menu_ind]['menu_name'], '', 'maximazed', false); $menu_links = self::GetMenuLinks($menus[0][$menu_ind]['id'], Application::Get('lang'), $menu_position); if ($menu_links[1] > 0) { $output .= '<ul>'; } for ($menu_link_ind = 0; $menu_link_ind < $menu_links[1]; $menu_link_ind++) { $class = Application::Get('page_id') == $menu_links[0][$menu_link_ind]['id'] ? ' active' : ''; if ($menu_links[0][$menu_link_ind]['content_type'] == 'link') { $output .= '<li>' . prepare_permanent_link($menu_links[0][$menu_link_ind]['link_url'], $menu_links[0][$menu_link_ind]['menu_link'], $menu_links[0][$menu_link_ind]['link_target'], 'main_menu_link' . $class) . '</li>'; } else { // draw current menu link $output .= '<li>' . prepare_link('pages', 'pid', $menu_links[0][$menu_link_ind]['id'], $menu_links[0][$menu_link_ind]['page_key'], $menu_links[0][$menu_link_ind]['menu_link'], 'main_menu_link' . $class) . '</li>'; } } if ($menu_links[1] > 0) { $output .= '</ul>'; } $output .= draw_block_bottom(false); } if ($menu_position == 'left') { if (!$objLogin->IsLoggedIn() || Application::Get('preview') == 'yes') { if (Modules::IsModuleInstalled('customers') && ModulesSettings::Get('customers', 'allow_login') == 'yes') { if (Application::Get('customer') != 'login') { $output .= Customers::DrawLoginFormBlock(false); } } } if (Modules::IsModuleInstalled('news')) { if ($show_news_block == 'left side') { $output .= $objNews->DrawNewsBlock(false); } if ($show_subscribe_block == 'left side') { $output .= $objNews->DrawSubscribeBlock(false); } } if (Modules::IsModuleInstalled('inquiries')) { if ($show_inquiries_block == 'left side') { $output .= Inquiries::DrawLastInquiriesBlock(false); } } } if ($menu_position == 'right') { if (Modules::IsModuleInstalled('inquiries')) { if ($show_inquiries_block == 'right side') { $output .= Inquiries::DrawLastInquiriesBlock(false); } } if (Modules::IsModuleInstalled('news')) { if ($show_news_block == 'right side') { $output .= $objNews->DrawNewsBlock(false); } if ($show_subscribe_block == 'right side') { $output .= $objNews->DrawSubscribeBlock(false); } } } if (ModulesSettings::Get('listings', 'show_directory_statistics') == $menu_position . ' side') { $output .= Listings::DrawDirectoryStatistics(false); } if ($menu_position == 'right') { if (Modules::IsModuleInstalled('adsense')) { $output .= '<div class="adsense-vertical">' . Adsense::GetVerticalBanerCode() . '</div>'; } } if ($menus_count > 0) { $output .= '</div>'; } $output .= '<br />'; if ($draw) { echo $output; } else { return $output; } }
if ($objLogin->IsLoggedInAsAdmin()) { $objPage = new Pages(Application::Get('page_id'), false, $mg_language_id); } else { $objPage = new Pages(Application::Get('system_page') != '' ? Application::Get('system_page') : Application::Get('page_id'), true, $mg_language_id); } $button_text = ''; // check if there is a page if ($objSession->IsMessage('notice')) { draw_title_bar(_PAGE); echo $objSession->GetMessage('notice'); } else { if ($objPage->CheckAccessRights($objLogin->IsLoggedIn())) { // check if there is a page if ($objPage->GetId() != '') { if ($objLogin->IsLoggedInAsAdmin() && Application::Get('preview') != 'yes') { $button_text = prepare_permanent_link('index.php?admin=pages' . (Application::Get('type') == 'system' ? '&type=system' : '') . '&mg_language_id=' . $mg_language_id, _BUTTON_BACK); } $objPage->DrawTitle($button_text); if (Modules::IsModuleInstalled('adsense') && (ModulesSettings::Get('adsense', 'adsense_code_activation') == 'All' || ModulesSettings::Get('adsense', 'adsense_code_activation') == 'Horizontal')) { //echo '<div class="adsense-horizontal">'.Adsense::GetHorizontalBanerCode().'</div>'; } $objPage->DrawText(); } else { draw_title_bar(_PAGES); draw_important_message(_PAGE_UNKNOWN); } } else { draw_title_bar(_PAGE); draw_important_message(_MUST_BE_LOGGED); } }
/** * Draws article comments * @param $article_id * @param $draw */ public function DrawArticleComments($article_id = '', $draw = true) { if (!$article_id) { return ''; } global $objLogin; $delete_pending_time = ModulesSettings::Get('comments', 'delete_pending_time'); $user_type = ModulesSettings::Get('comments', 'user_type'); $comment_length = ModulesSettings::Get('comments', 'comment_length'); $image_verification = ModulesSettings::Get('comments', 'image_verification_allow'); $comments_on_page = ModulesSettings::Get('comments', 'page_size'); $is_published = ModulesSettings::Get('comments', 'pre_moderation_allow') == 'yes' ? '0' : '1'; if ($image_verification == 'yes') { include_once 'modules/captcha/securimage.php'; $objImg = new Securimage(); } //echo '<pre>'; //print_r($_SERVER); //echo '</pre>'; $task = isset($_POST['task']) ? prepare_input($_POST['task']) : ''; $comment_id = isset($_POST['comment_id']) ? (int) $_POST['comment_id'] : ''; $init_state = 'closed'; $user_id = isset($_POST['user_id']) ? (int) $_POST['user_id'] : ''; $user_name = isset($_POST['comment_user_name']) ? prepare_input($_POST['comment_user_name']) : ''; $user_email = isset($_POST['comment_user_email']) ? prepare_input($_POST['comment_user_email']) : ''; $comment_text = isset($_POST['comment_text']) ? prepare_input($_POST['comment_text']) : ''; $captcha_code = isset($_POST['captcha_code']) ? prepare_input($_POST['captcha_code']) : ''; $msg = ''; $task_completed = false; $focus_field = ''; $current_page = isset($_GET['p']) ? abs((int) $_GET['p']) : '1'; if ($task == 'publish_comment') { $init_state = 'opened'; if ($user_name == '') { $msg = draw_important_message(_USERNAME_EMPTY_ALERT, false); $focus_field = 'comment_user_name'; } else { if (!check_email_address($user_email) && !$objLogin->IsLoggedInAs($this->user_type_name)) { $msg = draw_important_message(_EMAIL_IS_WRONG, false); $focus_field = 'comment_user_email'; } else { if ($comment_text == '') { $msg = draw_important_message(_MESSAGE_EMPTY_ALERT, false); $focus_field = 'comment_text'; } else { if ($comment_text != '' && strlen($comment_text) > $comment_length) { $msg = draw_important_message(str_replace('_LENGTH_', $comment_length, _COMMENT_LENGTH_ALERT), false); $focus_field = 'comment_text'; } else { if ($image_verification == 'yes' && !$objImg->check($captcha_code)) { $msg = draw_important_message(_WRONG_CODE_ALERT, false); $focus_field = 'captcha_code'; } else { // Block operation in demo mode if (strtolower(SITE_MODE) == 'demo') { $msg = draw_important_message(_OPERATION_BLOCKED, false); } else { if ($objLogin->IpAddressBlocked(get_current_ip())) { $msg = draw_important_message(_IP_ADDRESS_BLOCKED, false); } else { if ($objLogin->EmailBlocked($user_email)) { $msg = draw_important_message(_EMAIL_BLOCKED, false); } else { $sql = 'INSERT INTO ' . TABLE_COMMENTS . '( id, article_id, user_id, user_name, user_email, comment_text, date_created, date_published, is_published )VALUES( NULL, ' . (int) $article_id . ', ' . (int) $user_id . ', \'' . encode_text($user_name) . '\', \'' . encode_text($user_email) . '\', \'' . encode_text(strip_tags($comment_text, '<b><i><u><br>')) . '\', \'' . date('Y-m-d H:i:s') . '\', \'' . ($is_published == '1' ? date('Y-m-d H:i:s') : '0000-00-00 00:00:00') . '\', \'' . $is_published . '\' )'; if (database_void_query($sql)) { if ($is_published == '1') { $msg = draw_success_message(_COMMENT_POSTED_SUCCESS, false); } else { $msg = draw_success_message(_COMMENT_SUBMITTED_SUCCESS, false); } $task_completed = true; } else { $msg = draw_important_message(_TRY_LATER, false); } } } } } } } } } } else { if ($task == 'delete_comment') { $init_state = 'opened'; $sql = 'DELETE FROM ' . $this->tableName . ' WHERE TIMESTAMPDIFF(MINUTE, date_published, \'' . date('Y-m-d H:i:s') . '\') < ' . $delete_pending_time . ' AND id = ' . (int) $comment_id; if (database_void_query($sql)) { $msg = draw_success_message(_COMMENT_DELETED_SUCCESS, false); } else { $msg = draw_important_message(_TRY_LATER, false); } } } // -------- pagination $total_comments = 0; $page_size = $comments_on_page; $sql = 'SELECT COUNT(*) as cnt FROM ' . TABLE_COMMENTS . ' WHERE is_published = 1 AND article_id = ' . (int) $article_id; $comments_result = database_query($sql, DATA_ONLY, FIRST_ROW_ONLY); $total_comments = $comments_result['cnt']; $total_pages = (int) ($total_comments / $page_size); if ($current_page > $total_pages + 1) { $current_page = 1; } if ($total_comments % $page_size != 0) { $total_pages++; } if ($task_completed) { $current_page = $total_pages; } if (!is_numeric($current_page) || (int) $current_page <= 0) { $current_page = 1; } $start_row = ($current_page - 1) * $page_size; if (isset($_GET['p'])) { $init_state = 'opened'; } // -------- $sql = 'SELECT * FROM ' . TABLE_COMMENTS . ' WHERE article_id = ' . (int) $article_id . ' AND is_published = 1 ORDER BY date_published ASC LIMIT ' . $start_row . ', ' . $page_size; $result = database_query($sql, DATA_AND_ROWS); $output = '<script type="text/javascript">function deleteComment(cid) { if(confirm(\'' . _PERFORM_OPERATION_COMMON_ALERT . '\')){ jQuery(\'#comment_task\').val(\'delete_comment\'); jQuery(\'#comment_id\').val(cid); jQuery(\'#frmComments\').submit(); return true; } return false; } </script>'; $output .= '<div id="commentsLink"><a href="javascript:void(0);" onclick="javascript:jQuery(\'#commentsWrapper\').slideToggle(\'fast\');">' . str_replace('_COUNT_', $total_comments, _COMMENTS_LINK) . '</a><br /><br /></div>'; $output .= '<div id="commentsWrapper" style="display:' . ($init_state == 'opened' ? '' : 'none') . ';">'; $output .= '<div id="commentsPublished">'; if ($result[1] > 0) { for ($i = 0; $i < $result[1]; $i++) { $output .= '<div class="comment">'; $output .= '<div class="comment_user_name"><b>' . $result[0][$i]['user_name'] . '</b> ' . _SAID . '...</div>'; $output .= '<div class="comment_test">' . $result[0][$i]['comment_text'] . '</div>'; $output .= '<div class="comment_date">'; if ($result[0][$i]['user_id'] == $objLogin->GetLoggedID() && floor(time_diff(date('Y-m-d H:i:s'), $result[0][$i]['date_published']) / 60) < $delete_pending_time) { $output .= '<img src="images/published_x.gif" alt="" style="cursor:pointer;margin-bottom:-3px;margin-right:3px;" onclick="deleteComment(\'' . $result[0][$i]['id'] . '\');">'; } $output .= '<i>' . _PUBLISHED . ': ' . format_datetime($result[0][$i]['date_published']) . '</i></div>'; $output .= '</div>'; } // draw pagination links if ($total_pages > 1) { $output .= '<div class="paging">'; for ($page_ind = 1; $page_ind <= $total_pages; $page_ind++) { $output .= prepare_permanent_link('index.php?page=' . Application::Get('page') . '&pid=' . Application::Get('page_id') . '&p=' . $page_ind, $page_ind == $current_page ? '<b>[' . $page_ind . ']</b>' : $page_ind, '', 'paging_link') . ' '; } $output .= '</div>'; } } else { $output .= '<div class="comment">'; $output .= '<b>' . _NO_COMMENTS_YET . '</b><br /><br />'; $output .= '</div>'; } $output .= '</div>'; $output .= $msg != '' ? $msg . '<br />' : ''; if ($user_type == 'registered' && !$objLogin->IsLoggedInAs($this->user_type_name)) { $output .= draw_message(_POST_COM_REGISTERED_ALERT, false); } else { $output .= $this->DrawCommentsForm($article_id, $image_verification, $focus_field, $task_completed, false); } $output .= '</div>'; if ($draw) { echo $output; } else { return $output; } }
<td colspan="2"> <input class="form_button" type="submit" name="btnSend" value="<?php echo _SEND; ?> "> </td> </tr> <tr><td colspan="2" nowrap="nowrap" height="5px"></td></tr> <tr> <td colspan="2"> <?php if (ModulesSettings::Get('customers', 'allow_login') == 'yes') { echo prepare_permanent_link('index.php?customer=login', _CUSTOMER_LOGIN) . '<br />'; } if (ModulesSettings::Get('customers', 'allow_registration') == 'yes') { echo prepare_permanent_link('index.php?customer=create_account', _CREATE_ACCOUNT); } ?> </td> </tr> <tr><td colspan="2" nowrap="nowrap" height="5px"></td></tr> </table> </form> </div> <script type="text/javascript"> appSetFocus("resend_email"); </script> <?php //draw_content_end(); } else { if ($objLogin->IsLoggedInAsCustomer()) {
if (strlen($page_header) > 60) { $page_header = substr($page_header, 0, 60) . '..'; } // prepare menu link for display $menu_name = $all_pages[0][$i]['menu_name']; if (strlen($menu_name) > 18) { $menu_name = substr($menu_name, 0, 18) . '..'; } // display page row echo '<tr ' . highlight(0) . ' onmouseover="oldColor=this.style.backgroundColor;this.style.backgroundColor=\'#e7e7e7\';" onmouseout="this.style.backgroundColor=oldColor"> <td align="' . Application::Get('defined_left') . '">' . $page_header . '</td> <td align="center">' . ($menu_name != '' ? $menu_name : _NOT_AVAILABLE) . '</td> <td align="center">' . format_datetime($all_pages[0][$i]['status_changed']) . '</td> <td align="center">' . ucfirst($all_pages[0][$i]['content_type']) . '</td> <td align="center" nowrap> ' . prepare_permanent_link('index.php?page=pages&pid=' . $all_pages[0][$i]['id'] . '&mg_language_id=' . $language_id, _VIEW_WORD) . ' ' . draw_divider(false) . ' ' . ($objLogin->HasPrivileges('edit_pages') ? '<a href="javascript:void(0)" onclick="javascript:confirmRestore(\'' . $all_pages[0][$i]['id'] . '\');">' . _RESTORE . '</a>' : '') . ' ' . ($objLogin->HasPrivileges('edit_pages') && $objLogin->HasPrivileges('delete_pages') ? ' ' . draw_divider(false) . '' : '') . ' ' . ($objLogin->HasPrivileges('delete_pages') ? '<a href="javascript:void(0)" onclick="javascript:confirmDelete(\'' . $all_pages[0][$i]['id'] . '\');">' . _DELETE_WORD . '</a>' : '') . ' </td> </tr>'; } ?> </table> <?php } else { echo '<br />'; draw_important_message(_PAGE_NOT_FOUND, true, true, false, 'width:100%'); } draw_content_end(); } else {
} } // Start main content draw_title_bar(prepare_breadcrumbs(array(_MODULES => '', _GALLERY_MANAGEMENT => '', _ALBUM => '', $album_info[0]['name'] => '', ucfirst($action) => '')), prepare_permanent_link('index.php?admin=mod_gallery_management', _BUTTON_BACK)); //if($objSession->IsMessage('notice')) echo $objSession->GetMessage('notice'); echo $msg; draw_content_start(); if ($mode == 'view') { $objAlbumItems->DrawViewMode(); } else { if ($mode == 'add') { $objAlbumItems->DrawAddMode(); } else { if ($mode == 'edit') { $objAlbumItems->DrawEditMode($rid); } else { if ($mode == 'details') { $objAlbumItems->DrawDetailsMode($rid); } } } } draw_content_end(); } else { draw_title_bar(prepare_breadcrumbs(array(_MODULES => '', _GALLERY_MANAGEMENT => '', _ALBUM => '')), prepare_permanent_link('index.php?admin=mod_gallery_management', _BUTTON_BACK)); draw_important_message(_WRONG_PARAMETER_PASSED); } } else { draw_title_bar(_ADMIN); draw_important_message(_NOT_AUTHORIZED); }
/** * Draws search result * @param $search_result - search result * @param $page * @param $keyword * @param $type */ public function DrawSearchResult($search_result, $page = 1, $keyword = '', $type = 'quick') { $total_pages = (int) ($this->totalSearchRecords / $this->pageSize); if (!is_numeric($total_pages) || (int) $total_pages <= 0) { $total_pages = 1; } if ($search_result != '' && $search_result[1] > 0) { echo '<div class="pages_contents">'; for ($i = 0; $i < $search_result[1]; $i++) { if ($search_result[0][$i]['content_type'] == 'article') { echo $i + 1 . '. ' . prepare_permanent_link('index.php?' . $search_result[0][$i]['url'], decode_text($search_result[0][$i]['title'])) . '<br />'; if (isset($search_result[0][$i]['image_file_thumb'])) { echo '<img src="images/listings/' . $search_result[0][$i]['image_file_thumb'] . '" style="width:42px;height:42px;margin:4px;" align="' . Application::Get('defined_left') . '" alt="" />'; } $page_text = $search_result[0][$i]['text']; $page_text = str_replace(array('\\r', '\\n'), '', $page_text); $page_text = preg_replace('/{module:(.*?)}/i', '', $page_text); $page_text = strip_tags($page_text); $page_text = decode_text($page_text); if (!empty($keyword)) { $page_text = $this->HighLight($page_text, array($keyword)); } echo substr_by_word($page_text, 512) . '...<br />'; } else { echo $i + 1 . '. <a href="' . $search_result[0][$i]['link_url'] . '">' . decode_text($search_result[0][$i]['title']) . '</a> <img src="images/external_link.gif" alt="" /><br />'; } echo '<br />'; draw_line(); echo '<br />'; } echo '<b>' . _PAGES . ':</b> '; for ($i = 1; $i <= $total_pages; $i++) { echo '<a class="paging_link" href="javascript:void(0);" onclick="javascript:appPerformSearch(' . $i . ', \'' . ($type == 'advanced' ? 'frmAdvSearch' : 'frmQuickSearch') . '\');">' . ($i == $page ? '<b>[' . $i . ']</b>' : $i) . '</a> '; } echo '</div>'; } else { draw_important_message(_NO_RECORDS_FOUND); } }