本文整理汇总了PHP中Modules::IsModuleInstalled方法的典型用法代码示例。如果您正苦于以下问题:PHP Modules::IsModuleInstalled方法的具体用法?PHP Modules::IsModuleInstalled怎么用?PHP Modules::IsModuleInstalled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Modules
的用法示例。
在下文中一共展示了Modules::IsModuleInstalled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetHorizontalBanerCode
/**
* Returns horizontal banner code
*/
public static function GetHorizontalBanerCode()
{
if (Modules::IsModuleInstalled('adsense')) {
$activation = strtolower(ModulesSettings::Get('adsense', 'adsense_code_activation'));
if ($activation == 'horizontal' || $activation == 'all') {
return ModulesSettings::Get('adsense', 'adsense_code_horizontal');
}
}
return '';
}
示例2:
<div class="center_box_wrapper <?php
echo Application::Get('defined_alignment');
?>
">
<!-- MAIN CONTENT -->
<?php
if (Application::Get('page') != '' && Application::Get('page') != 'home') {
if (file_exists('page/' . Application::Get('page') . '.php')) {
include_once 'page/' . Application::Get('page') . '.php';
} else {
include_once 'page/404.php';
}
} else {
if (Application::Get('customer') != '') {
if (Modules::IsModuleInstalled('customers') && file_exists('customer/' . Application::Get('customer') . '.php')) {
include_once 'customer/' . Application::Get('customer') . '.php';
} else {
include_once 'customer/404.php';
}
} else {
if (Application::Get('admin') != '' && file_exists('admin/' . Application::Get('admin') . '.php')) {
include_once 'admin/' . Application::Get('admin') . '.php';
} else {
if (Application::Get('template') == 'admin') {
include_once 'admin/home.php';
} else {
include_once 'page/pages.php';
}
}
}
示例3: defined
<?php
////////////////////////////////////////////////////////////////////////////////
// PayPal Order Notify
// Last modified: 23.02.2012
////////////////////////////////////////////////////////////////////////////////
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if (Modules::IsModuleInstalled('payments')) {
$mode = ModulesSettings::Get('payments', 'mode');
if (ModulesSettings::Get('payments', 'is_active') == 'yes') {
//----------------------------------------------------------------------
define('LOG_MODE', false);
define('LOG_TO_FILE', false);
define('LOG_ON_SCREEN', false);
define('TEST_MODE', $mode == 'TEST MODE' ? true : false);
$log_data = '';
$msg = '';
$nl = "\n";
// --- Get PayPal response
$objPaymentIPN = new PaymentIPN($_REQUEST, 'paypal');
$status = $objPaymentIPN->GetPaymentStatus();
$order_number = $objPaymentIPN->GetParameter('custom');
$transaction_number = $objPaymentIPN->GetParameter('txn_id');
$payer_status = $objPaymentIPN->GetParameter('payer_status');
$pp_payment_type = $objPaymentIPN->GetParameter('payment_type');
$total = $objPaymentIPN->GetParameter('mc_gross');
// Payment Types : 0 - Online Order, 1 - PayPal, 2 - 2CO, 3 - Authorize.Net
// Payment Methods : 0 - Payment Company Account, 1 - Credit Card, 2 - E-Check
if ($status == 'Completed') {
示例4: defined
<?php
/**
* @project ApPHP Business Directory
* @copyright (c) 2011 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if ($objLogin->IsLoggedInAsAdmin() && Modules::IsModuleInstalled('gallery')) {
$action = MicroGrid::GetParameter('action');
$rid = MicroGrid::GetParameter('rid');
$album = MicroGrid::GetParameter('album', false);
$mode = 'view';
$msg = '';
$objAlbums = new GalleryAlbums();
$album_info = $objAlbums->GetAlbumInfo($album);
if (count($album_info) > 0) {
$objAlbumItems = new GalleryAlbumItems();
if ($action == 'add') {
$mode = 'add';
} else {
if ($action == 'create') {
if ($objAlbumItems->AddRecord()) {
$msg = draw_success_message(_ADDING_OPERATION_COMPLETED, false);
$mode = 'view';
} else {
$msg = draw_important_message($objAlbumItems->error, false);
$mode = 'add';
示例5: DrawMassMailForm
/**
* 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 . ' ]', '', '') . '
//.........这里部分代码省略.........
示例6: defined
<?php
/**
* @project ApPHP Medical Appointment
* @copyright (c) 2012 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if ($objLogin->IsLoggedInAsCustomer() && Modules::IsModuleInstalled('listings')) {
$action = MicroGrid::GetParameter('action');
$rid = MicroGrid::GetParameter('rid');
$listing_id = MicroGrid::GetParameter('listing_id', false);
$mode = 'view';
$msg = '';
if (!empty($listing_id)) {
$objListingsCategories = new ListingsCategories($listing_id, 'me');
if ($action == 'add') {
$mode = 'add';
} else {
if ($action == 'create') {
if ($objListingsCategories->AddRecord()) {
$msg = draw_success_message(_ADDING_OPERATION_COMPLETED, false);
$mode = 'view';
} else {
$msg = draw_important_message($objListingsCategories->error, false);
$mode = 'add';
}
} else {
示例7: DrawBannersTop
/**
* Draw top banners code
* @param $banner_image
* @param $show_always
* @param $draw
*/
public static function DrawBannersTop(&$banner_image, $show_always = true, $draw = true)
{
global $objLogin;
$default_banner_image = '';
$nl = "\n";
if (Modules::IsModuleInstalled('banners')) {
$is_banners_active = ModulesSettings::Get('banners', 'is_active');
$rotate_delay = ModulesSettings::Get('banners', 'rotate_delay');
$rotation_type = ModulesSettings::Get('banners', 'rotation_type');
$caption_html = ModulesSettings::Get('banners', 'slideshow_caption_html');
if ($is_banners_active == 'yes') {
$objBanners = new Banners();
if ($rotation_type == 'slide show') {
$arrBanners = $objBanners->GetBannersArray();
if ($show_always || !$show_always && Application::Get('page') == 'home' && !$objLogin->IsLoggedIn()) {
$output = '<script src="' . APPHP_BASE . 'modules/cslide/jquery.cross-slide.min.js" type="text/javascript"></script>' . $nl;
$output .= '<script type="text/javascript">' . $nl;
$output .= 'jQuery(function() {
jQuery(\'#slideshow\').crossSlide({
sleep: ' . $rotate_delay . ', fade: 2,variant: true
}, [
';
$ind = '0';
foreach ($arrBanners as $key => $val) {
if ($ind == '0') {
$default_banner_image = 'images/banners/' . $val['image_file'];
} else {
$output .= ',';
}
$output .= '{ src: \'images/banners/' . $val['image_file'] . '\', alt: \'' . encode_text($val['image_text']) . ($val['link_url'] != '' ? '##' . $val['link_url'] : '') . '\', to:\'up\' }';
$ind++;
}
$output .= '], function(idx, img, idxOut, imgOut) {
var img_alt_split = img.alt.split(\'##\');
var caption_width = jQuery(\'div#slideshow\').width() - 20;
if(idxOut == undefined){
/* starting single image phase, put up caption */
if(img.alt != \'\'){
jQuery(\'div.slideshow-caption\').click(function(){ if(img_alt_split[1] != undefined && img_alt_split[1] != \'\') appGoToPage(img_alt_split[1]); });
jQuery(\'div.slideshow-caption\').' . ($caption_html == 'yes' ? 'html' : 'text') . '(img_alt_split[0]).animate({ opacity: .7 })
jQuery(\'div.slideshow-caption\').fadeIn();
if(caption_width != null) jQuery(\'div.slideshow-caption\').width(caption_width);
}
}else{
// starting cross-fade phase, take out caption
jQuery(\'div.slideshow-caption\').click(function() { });
jQuery(\'div.slideshow-caption\').fadeOut();
}}) });';
$output .= '</script>' . $nl;
if ($ind == 1) {
$banner_image = '<div class="banners-box-random" id="slideshow">' . $objBanners->GetRandomBanner() . '</div>';
} else {
if ($draw) {
echo $output;
} else {
return $output;
}
$banner_image = '<div class="banners-box-slideshow" id="slideshow"></div><div class="slideshow-caption"></div>';
}
}
} else {
if ($show_always || !$show_always && Application::Get('page') == 'home' && !$objLogin->IsLoggedIn()) {
$banner_image = '<div class="banners-box-random" id="slideshow">' . $objBanners->GetRandomBanner() . '</div>';
}
}
}
}
}
示例8: defined
<?php
/**
* @project ApPHP Business Directory
* @copyright (c) 2011 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if (Modules::IsModuleInstalled('gallery')) {
$objGalleryAlbum = new GalleryAlbums();
$objGalleryAlbum->DrawAlbum(Application::Get('album_code'));
} else {
draw_important_message(_PAGE_UNKNOWN);
}
?>
示例9: defined
<?php
/**
* @project ApPHP Business Directory
* @copyright (c) 2011 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if ($objLogin->IsLoggedInAsCustomer() && Modules::IsModuleInstalled('inquiries')) {
$action = MicroGrid::GetParameter('action');
$rid = MicroGrid::GetParameter('rid');
$act = MicroGrid::GetParameter('act', false);
$mode = 'view';
$msg = '';
$inq_id = isset($_GET['inq_id']) ? (int) $_GET['inq_id'] : '0';
$customer_id = $objLogin->GetLoggedID();
$objInquiries = Inquiries::Instance();
if ($objInquiries->CustomerRelatedToInquire($inq_id)) {
$objInquiriesReplies = new InquiriesReplies($inq_id, $customer_id);
if ($act == 'add') {
$customer_replies = !empty($customer_id) ? InquiriesReplies::GetInquiryRepliesForCustomer($inq_id, $customer_id) : 0;
$inquiry_info = $objInquiries->GetInfoByID($inq_id);
$is_active = isset($inquiry_info['is_active']) ? $inquiry_info['is_active'] : 0;
$add_mode = $is_active && !empty($customer_id) && !$customer_replies ? true : false;
if ($add_mode) {
$action = 'add';
$objInquiriesReplies->SetActions(array('add' => $add_mode));
}
示例10: defined
<?php
/**
* @project ApPHP Business Directory
* @copyright (c) 2011 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
if ($objLogin->IsLoggedInAsAdmin() && Modules::IsModuleInstalled('inquiries')) {
$action = MicroGrid::GetParameter('action');
$rid = MicroGrid::GetParameter('rid');
$mode = 'view';
$msg = '';
$inq_id = isset($_GET['inq_id']) ? (int) $_GET['inq_id'] : '0';
$objInquiries = Inquiries::Instance();
$inquiry_info = $objInquiries->GetInfoByID($inq_id);
if (count($inquiry_info) > 0) {
$objInquiriesReplies = new InquiriesReplies($inq_id);
if ($action == 'add') {
$mode = 'view';
} else {
if ($action == 'create') {
$mode = 'view';
} else {
if ($action == 'edit') {
$mode = 'edit';
} else {
if ($action == 'update') {
示例11: defined
<?php
/**
* @project ApPHP Business Directory
* @copyright (c) 2012 ApPHP
* @author ApPHP <info@apphp.com>
* @license http://www.gnu.org/licenses/
*/
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
$email = isset($_REQUEST['email']) ? prepare_input($_REQUEST['email']) : '';
$task = isset($_REQUEST['task']) ? prepare_input($_REQUEST['task']) : '';
$focus_field = '';
draw_title_bar(_SUBSCRIBE_TO_NEWSLETTER);
if (Modules::IsModuleInstalled('news')) {
$objNews = News::Instance();
if ($task == 'subscribe') {
if ($objNews->ProcessSubscription($email)) {
draw_success_message(_NEWSLETTER_SUBSCRIBE_SUCCESS);
} else {
draw_important_message($objNews->error);
$focus_field = 'subscribe_email';
}
} else {
if ($task == 'unsubscribe') {
if ($objNews->ProcessUnsubscription($email)) {
draw_success_message(_NEWSLETTER_UNSUBSCRIBE_SUCCESS);
} else {
draw_important_message($objNews->error);
$focus_field = 'unsubscribe_email';
示例12: defined
<?php
// *** Make sure the file isn't accessed directly
defined('APPHP_EXEC') or die('Restricted Access');
//--------------------------------------------------------------------------
include_once 'include/functions.admin.inc.php';
if (@$objLogin->IsLoggedInAsAdmin() && Modules::IsModuleInstalled('payments')) {
define('TABS_DIR', 'modules/tabs/');
require_once TABS_DIR . 'tabs.class.php';
echo '<script type="text/javascript" src="http://www.google.com/jsapi"></script>';
$first_tab_content = '';
$second_tab_content = '';
$third_tab_content = '';
$tabid = isset($_POST['tabid']) ? prepare_input($_POST['tabid']) : '1_1';
$nl = "\n";
$chart_type = isset($_POST['chart_type']) ? prepare_input($_POST['chart_type']) : 'columnchart';
$year = isset($_POST['year']) ? prepare_input($_POST['year']) : date('Y');
if ($tabid == '1_1') {
$first_tab_content = '
<script type="text/javascript">
function drawVisualization(){
// Create and populate the data table.
var data = new google.visualization.DataTable();
data.addColumn(\'string\', \'' . _MONTH . '\');
data.addColumn(\'number\', \'' . _ORDERS . '\');';
$selStatType = 'COUNT(*)';
$join_clause = '';
$where_clause = ' AND status > 1';
$sql = 'SELECT
(SELECT ' . $selStatType . ' FROM ' . TABLE_ORDERS . ' o ' . $join_clause . ' WHERE SUBSTRING(o.payment_date, 6, 2) = \'01\' AND SUBSTRING(o.payment_date, 1, 4) = \'' . $year . '\' ' . $where_clause . ') as month1,
(SELECT ' . $selStatType . ' FROM ' . TABLE_ORDERS . ' o ' . $join_clause . ' WHERE SUBSTRING(o.payment_date, 6, 2) = \'02\' AND SUBSTRING(o.payment_date, 1, 4) = \'' . $year . '\' ' . $where_clause . ') as month2,
示例13: DrawText
/**
* Draw page text
*/
public function DrawText()
{
global $objLogin;
$objGallery = new GalleryAlbums();
$objContactUs = ContactUs::Instance();
$replace_needles = 1;
$module_page = false;
if (!count($this->page)) {
return false;
}
// dont show this page if it was expired
if (!$objLogin->IsLoggedInAsAdmin() && $this->page['finish_publishing'] != '0000-00-00' && date('Y-m-d') > $this->page['finish_publishing']) {
draw_important_message(_PAGE_EXPIRED);
return false;
}
if ($this->page['content_type'] == 'article' && isset($this->page['page_text'])) {
$page_text = decode_text($this->page['page_text'], false);
echo '<div class="pages_contents">';
if (preg_match('/{module:gallery}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:gallery}/i', $objGallery->DrawGallery(false), $page_text, 1);
}
if (preg_match_all('/{module:album=(.*?)}/i', $page_text, $matches)) {
$module_page = true;
if (is_array($matches[1])) {
foreach ($matches[1] as $key => $val) {
if (strtolower($val) != 'code') {
$val = @preg_replace('/[^A-Za-z0-9:]/i', '', $val);
$page_text = @preg_replace('/{module:album=' . $val . '}/i', $objGallery->DrawAlbum($val, false), $page_text, 1);
}
}
}
}
if (self::$PROJECT == 'MedicalAppointment') {
if (preg_match('/{module:about_us}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:about_us}/i', Clinic::DrawAboutUs(false), $page_text, 1);
}
}
if (self::$PROJECT == 'HotelSite') {
if (preg_match('/{module:about_us}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:about_us}/i', Hotels::DrawAboutUs(false), $page_text, 1);
}
if (preg_match('/{module:rooms}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:rooms}/i', Rooms::DrawRoomsInfo(false), $page_text, 1);
}
if (preg_match('/{module:testimonials}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:testimonials}/i', Testimonials::DrawTestimonails(false), $page_text, 1);
}
}
if (preg_match('/{module:contact_us}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:contact_us}/i', $objContactUs->DrawContactUsForm(false), $page_text, 1);
}
if (preg_match('/{module:faq}/i', $page_text)) {
$module_page = true;
$page_text = @preg_replace('/{module:faq}/i', FaqCategories::DrawFaqList(false), $page_text, 1);
}
if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
$page_text = stripslashes($page_text);
}
if ($this->page['is_home']) {
if (self::$PROJECT == 'HotelSite') {
Campaigns::DrawCampaignBanner('standard');
Campaigns::DrawCampaignBanner('global');
}
}
//echo $page_text;
//echo "<hr>";
// draw all needed blocks for Home page
if ($this->page['is_home']) {
if (self::$PROJECT == 'BusinessDirectory') {
if (ModulesSettings::Get('listings', 'show_categories_home_block') == 'yes') {
Categories::DrawHomePageBlock();
}
} else {
if (self::$PROJECT == 'ShoppingCart') {
if (ModulesSettings::Get('products_catalog', 'is_active') == 'yes') {
Campaigns::DrawCampaignBanner();
if (ModulesSettings::Get('products_catalog', 'show_featured_block') == 'home page') {
Products::DrawFeaturedBlock('home');
}
if (ModulesSettings::Get('products_catalog', 'show_new_products_block') == 'home page') {
Products::DrawNewProductsBlock();
}
Categories::DrawHomePageBlock();
}
}
}
}
// draw comments form
if (!$this->page['is_home'] && !$module_page) {
if (Modules::IsModuleInstalled('comments')) {
if (ModulesSettings::Get('comments', 'comments_allow') == 'yes' && $this->page['comments_allowed']) {
//.........这里部分代码省略.........
示例14: DrawTopGuideBlock
/**
* Draws top guide block (3 steps)
* @param $draw
*/
public static function DrawTopGuideBlock($draw = true)
{
$page = Application::Get('page');
$output = '';
$inquiry_category = isset($_POST['inquiry_category']) ? $_POST['inquiry_category'] : '';
if (Modules::IsModuleInstalled('inquiries') && in_array($page, array('home', 'inquiry_send', 'inquiry_form', 'inquiry_send')) && Application::Get('customer') == '') {
// prepare categories array
$objCategories = Categories::Instance();
$total_categories = $objCategories->GetAllExistingCategories();
$arr_categories = array();
foreach ($total_categories as $key => $val) {
if ($val['level'] == '1') {
$arr_categories[$val['id']] = $val['name'];
} else {
if ($val['level'] == '2') {
$arr_categories[$val['id']] = ' • ' . $val['name'];
} else {
if ($val['level'] == '3') {
$arr_categories[$val['id']] = ' :: ' . $val['name'];
}
}
}
}
$output .= '
<table id="guide-block">
<tr>
<td width="33%">
<div class="steps step1' . ($page == 'inquiry_form' ? ' active' : '') . '">
<div class="header">' . _STEP . ' 1</div>
<div class="content">' . _STEP_1_DESCRIPTION . '</div>
</div>
</td>
<td width="34%">
<div class="steps step2' . ($page == 'inquiry_send' ? ' active' : '') . '">
<div class="header">' . _STEP . ' 2</div>
<div class="content">' . _STEP_2_DESCRIPTION . '</div>
</div>
</td>
<td width="33%">
<div class="steps step3">
<div class="header">' . _STEP . ' 3</div>
<div class="content">' . _STEP_3_DESCRIPTION . '</div>
</div>
</td>
</tr>';
if ($page == 'home') {
$output .= '<tr>
<td colspan="3">
<div class="footer">
<div class="content">
<form name="frmGideBlock" action="index.php?page=inquiry_form" method="post">
' . draw_token_field(false) . '
' . _WHAT_DO_YOU_NEED . ' ';
$output .= '<select name="inquiry_category">';
$output .= '<option value="">-- ' . _SELECT . ' --</option>';
foreach ($arr_categories as $key => $val) {
$output .= '<option value="' . $key . '"' . ($inquiry_category == $key ? ' selected="selected"' : '') . '>' . $val . '</option>';
}
$output .= '</select>';
$output .= ' <input type="submit" class="form_button" value="' . _SUBMIT . '">
</form>
</div>
</div>
</td>
</tr>';
}
$output .= '</table>';
}
if ($draw) {
echo $output;
} else {
return $output;
}
}
示例15: DrawPlans
/**
* Draws all active plans
* @param $draw
*/
public static function DrawPlans($draw = true)
{
$output = '';
$arr_durations = self::PrepareDurationsArray();
$default_payment_system = isset($_GET['payment_type']) ? $_GET['payment_type'] : ModulesSettings::Get('payments', 'default_payment_system');
$payment_type_online = ModulesSettings::Get('payments', 'payment_method_online');
$payment_type_paypal = ModulesSettings::Get('payments', 'payment_method_paypal');
$payment_type_2co = ModulesSettings::Get('payments', 'payment_method_2co');
$payment_type_authorize = ModulesSettings::Get('payments', 'payment_method_authorize');
$payment_type_cnt = ($payment_type_online === 'yes') + ($payment_type_paypal === 'yes') + ($payment_type_2co === 'yes') + ($payment_type_authorize === 'yes');
$exclude_free_plans = true;
//($default_payment_system != 'online') ? true : false;
$inquiry_field_visible = Modules::IsModuleInstalled('inquiries') == 'yes' ? true : false;
$ratings_field_visible = Modules::IsModuleInstalled('ratings') == 'yes' ? true : false;
$sql = 'SELECT
ap.*,
apd.name,
apd.description
FROM ' . TABLE_ADVERTISE_PLANS . ' ap
LEFT OUTER JOIN ' . TABLE_ADVERTISE_PLANS_DESCRIPTION . ' apd ON ap.id = apd.advertise_plan_id AND apd.language_id = \'' . Application::Get('lang') . '\'
WHERE 1=1
ORDER BY ap.id ASC';
//'.(($exclude_free_plans) ? ' AND ap.price != 0' : '' ).'
$result = database_query($sql, DATA_AND_ROWS, ALL_ROWS);
if ($result[1] > 0) {
$output .= '<form name="frmAdvertiseForm" id="frmAdvertiseForm" action="index.php?customer=advertise_prepayment" method="post">';
$output .= draw_hidden_field('task', 'do_order', false);
$output .= draw_token_field(false);
$output .= '<div class="advertise_plans_container">';
$output .= '<table style="margin:7px 16px 0px 16px">';
$output .= '<tr><td>' . _CURRENCY . ':</td><td>' . Currencies::GetCurrenciesDDL(false) . '</td></tr>';
if ($payment_type_cnt >= 1) {
///onchange="appGoToPage(\'index.php?customer=advertise\',\'&payment_type=\'+this.value)"
$output .= '<tr><td>' . _PAYMENT_TYPE . ': </td><td>
<select name="payment_type" id="payment_type">';
if ($payment_type_online == 'yes') {
$output .= '<option value="online" ' . ($default_payment_system == 'online' ? 'selected="selected"' : '') . '>' . _ONLINE_ORDER . '</option>';
}
if ($payment_type_paypal == 'yes') {
$output .= '<option value="paypal" ' . ($default_payment_system == 'paypal' ? 'selected="selected"' : '') . '>' . _PAYPAL . '</option>';
}
if ($payment_type_2co == 'yes') {
$output .= '<option value="2co" ' . ($default_payment_system == '2co' ? 'selected="selected"' : '') . '>2CO</option>';
}
if ($payment_type_authorize == 'yes') {
$output .= '<option value="authorize" ' . ($default_payment_system == 'authorize' ? 'selected="selected"' : '') . '>Authorize.Net</option>';
}
$output .= '</select></td></tr>';
} else {
$output .= '<tr><td colspan="2">';
$output .= draw_important_message(_NO_PAYMENT_METHODS_ALERT, false);
$output .= '</td></tr>';
}
$output .= '</table>';
$active_ind = '-1';
$output .= '<div class="plans_wrapper">';
$output .= '<h2>' . _SELECT_PLAN . '</h2>';
for ($i = 0; $i < $result[1]; $i++) {
if ($result[0][$i]['price'] != 0 && $active_ind == '-1') {
$active_ind = $i;
}
$duration = isset($arr_durations[$result[0][$i]['duration']]) ? $arr_durations[$result[0][$i]['duration']] : '';
$no_text = '<span class=no>' . _NO . '</span>';
$yes_text = '<span class=yes>' . _YES . '</span>';
$output .= '
<div class="item ' . ($i == $active_ind ? 'active' : ($result[0][$i]['price'] == 0 ? 'free' : '')) . '" id="item_' . $i . '">
<h3>' . $result[0][$i]['name'] . '</h3>
<div class="item_text" title="' . _CLICK_TO_SELECT . '">
<label for="plan_' . $result[0][$i]['id'] . '">
' . _DURATION . ': <b>' . $duration . '</b><br />
' . _LISTINGS . ': <b>' . $result[0][$i]['listings_count'] . '</b><br />
' . _CATEGORIES . ': <b>' . $result[0][$i]['categories_count'] . '</b><br />
' . _KEYWORDS . ': <b>' . $result[0][$i]['keywords_count'] . '</b><br />
' . _NAME . ': <b>' . ($result[0][$i]['business_name'] ? $yes_text : $no_text) . '</b><br />
' . _DESCRIPTION . ': <b>' . ($result[0][$i]['business_description'] ? $yes_text : $no_text) . '</b><br />
' . _LOGO . ': <b>' . ($result[0][$i]['logo'] ? $yes_text : $no_text) . '</b><br />
' . _IMAGES . ': <b>' . $result[0][$i]['images_count'] . '</b><br />
' . _VIDEO . ': <b>' . ($result[0][$i]['video_link'] ? $yes_text : $no_text) . '</b><br />
' . _PHONE . ': <b>' . ($result[0][$i]['phone'] ? $yes_text : $no_text) . '</b><br />
' . _ADDRESS . ': <b>' . ($result[0][$i]['address'] ? $yes_text : $no_text) . '</b><br />
' . _MAP . ': <b>' . ($result[0][$i]['map'] ? $yes_text : $no_text) . '</b><br />
' . ($inquiry_field_visible ? _INQUIRY_BUTTON . ': <b>' . ($result[0][$i]['inquiry_button'] ? $yes_text : $no_text) . '</b><br />' : '') . '
' . ($inquiry_field_visible ? _INQUIRIES . '/' . _MONTH . ': <b>' . ($result[0][$i]['inquiries_count'] == '-1' ? '<span title="' . _UNLIMITED . '">∞</span>' : $result[0][$i]['inquiries_count']) . '</b><br />' : '') . '
' . ($ratings_field_visible ? _RATING . ': <b>' . ($result[0][$i]['rating_button'] ? $yes_text : $no_text) . '</b><br />' : '') . '
' . _PRICE . ': <b>' . Currencies::PriceFormat($result[0][$i]['price'] * Application::Get('currency_rate')) . '</b><br />
<div class="item_description">' . $result[0][$i]['description'] . '</div>
</label>
</div>
<div class="item_radio">';
if ($result[0][$i]['price'] != 0) {
$output .= '<input ' . ($i == $active_ind ? 'checked="checked"' : '') . ' type="radio" name="plan_id" id="plan_' . $result[0][$i]['id'] . '" value="' . $result[0][$i]['id'] . '" onclick="appSelectBlock(\'' . $i . '\');">';
}
$output .= '</div>
</div>';
}
$output .= '</div>';
//.........这里部分代码省略.........