/** * 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']) { $objComments = new Comments(); $objComments->DrawArticleComments($this->page['id']); } } } echo '</div>'; } else { if ($this->page['content_type'] == 'link' && isset($this->page['link_url'])) { $link_url = decode_text($this->page['link_url']); echo '<div class="pages_contents">'; echo '<a href="' . $link_url . '">' . $link_url . '</a>'; echo '</div>'; } } }
/** * @project ApPHP Business Directory * @copyright (c) 2011 ApPHP * @author ApPHP <*****@*****.**> * @license http://www.gnu.org/licenses/ */ // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- if ($objLogin->IsLoggedInAs('owner', 'mainadmin') && Modules::IsModuleInstalled('faq')) { $action = MicroGrid::GetParameter('action'); $rid = MicroGrid::GetParameter('rid'); $fcid = MicroGrid::GetParameter('fcid', false); $mode = 'view'; $msg = ''; $objFaqCategories = new FaqCategories(); $faq_info = $objFaqCategories->GetInfoById($fcid); if (count($faq_info) > 0) { $objFaqCategoryItems = new FaqCategoryItems($fcid); if ($action == 'add') { $mode = 'add'; } else { if ($action == 'create') { if ($objFaqCategoryItems->AddRecord()) { $msg .= draw_success_message(_ADDING_OPERATION_COMPLETED, false); $mode = 'view'; } else { $msg = draw_important_message($objFaqCategoryItems->error, false); $mode = 'add'; } } else {
/** * @project ApPHP Business Directory * @copyright (c) 2011 ApPHP * @author ApPHP <*****@*****.**> * @license http://www.gnu.org/licenses/ */ // *** Make sure the file isn't accessed directly defined('APPHP_EXEC') or die('Restricted Access'); //-------------------------------------------------------------------------- if ($objLogin->IsLoggedInAs('owner', 'mainadmin') && Modules::IsModuleInstalled('faq')) { $action = MicroGrid::GetParameter('action'); $rid = MicroGrid::GetParameter('rid'); $mode = 'view'; $msg = ''; $objFaqCategories = new FaqCategories(); if ($action == 'add') { $mode = 'add'; } else { if ($action == 'create') { if ($objFaqCategories->AddRecord()) { $msg .= draw_success_message(_ADDING_OPERATION_COMPLETED, false); $mode = 'view'; } else { $msg = draw_important_message($objFaqCategories->error, false); $mode = 'add'; } } else { if ($action == 'edit') { $mode = 'edit'; } else {