public function browse() { $categoryList = array(); $form = new Form('download_form'); $this->addForm($form); $cmpCategories = new SPDOWNLOAD_CMP_Category(); $this->addComponent('cmpCategories', $cmpCategories); $arraylabel = array('label_table_th1' => OW::getLanguage()->text('spdownload', 'label_table_th1'), 'label_table_th2' => OW::getLanguage()->text('spdownload', 'label_table_th2'), 'label_table_th3' => OW::getLanguage()->text('spdownload', 'label_table_th3')); $files = null; $arrayId = array(); if (empty($_GET['ct']) || !isset($_GET['ct'])) { OW::getApplication()->redirect(OW::getRouter()->urlForRoute('spdownload.index')); } else { $arrayId = $_GET['ct']; $files = SPDOWNLOAD_BOL_FileService::getInstance()->getFileCategoryIdList($arrayId); $this->assign('arrayId', $arrayId); } $url = OW::getPluginManager()->getPlugin('spdownload')->getUserFilesUrl(); foreach ($files as $key => $value) { $value->addedTime = date("Y-m-d H:i:s", $value->addedTime); $nameImage = 'icon_small_' . $value->id . '.png'; $value->icon = $url . $nameImage; } $this->assign('files', $files); $this->assign('arraylabel', $arraylabel); }
public function run() { $config = OW::getConfig(); // check if uninstall is in progress if (!$config->getValue('groups', 'uninstall_inprogress')) { return; } if (!$config->configExists('groups', 'uninstall_cron_busy')) { $config->addConfig('groups', 'uninstall_cron_busy', 0); } // check if cron queue is not busy if ($config->getValue('groups', 'uninstall_cron_busy')) { return; } $config->saveConfig('groups', 'uninstall_cron_busy', 1); $service = GROUPS_BOL_Service::getInstance(); try { $groups = $service->findLimitedList(self::GROUPS_DELETE_LIMIT); if (empty($groups)) { BOL_PluginService::getInstance()->uninstall('groups'); OW::getApplication()->setMaintenanceMode(false); return; } foreach ($groups as $group) { $service->deleteGroup($group->id); } $config->saveConfig('groups', 'uninstall_cron_busy', 0); } catch (Exception $e) { $config->saveConfig('groups', 'uninstall_cron_busy', 0); throw $e; } }
/** * Constructor. */ public function __construct() { parent::__construct(); if (OW::getApplication()->getContext() != OW_Application::CONTEXT_DESKTOP) { throw new InterceptException(array(OW_RequestHandler::ATTRS_KEY_CTRL => 'BASE_MCTRL_BaseDocument', OW_RequestHandler::ATTRS_KEY_ACTION => 'notAvailable')); } if (!OW::getUser()->isAdmin()) { throw new AuthenticateException(); } if (!OW::getRequest()->isAjax()) { $document = OW::getDocument(); $document->setMasterPage(new ADMIN_CLASS_MasterPage()); $this->setPageTitle(OW::getLanguage()->text('admin', 'page_default_title')); } BOL_PluginService::getInstance()->checkManualUpdates(); BOL_ThemeService::getInstance()->checkManualUpdates(); $plugin = BOL_PluginService::getInstance()->findNextManualUpdatePlugin(); $handlerParams = OW::getRequestHandler()->getHandlerAttributes(); // TODO refactor shortcut below if (!defined('OW_PLUGIN_XP') && $plugin !== null) { if ($handlerParams['controller'] === 'ADMIN_CTRL_Plugins' && $handlerParams['action'] === 'manualUpdateRequest') { //action } else { throw new RedirectException(OW::getRouter()->urlFor('ADMIN_CTRL_Plugins', 'manualUpdateRequest', array('key' => $plugin->getKey()))); } } // TODO temp admin pge inform event function admin_check_if_admin_page() { return true; } OW::getEventManager()->bind('admin.check_if_admin_page', 'admin_check_if_admin_page'); }
public function redirectToDesktop() { $urlToRedirect = OW::getRouter()->getBaseUrl(); if (!empty($_GET['back-uri'])) { $urlToRedirect .= urldecode($_GET['back-uri']); } OW::getApplication()->redirect($urlToRedirect, OW::CONTEXT_DESKTOP); }
public function index($params = array()) { if (OW::getRequest()->isAjax()) { exit; } if (!OW::getUser()->isAuthenticated()) { throw new AuthenticateException(); } $plugin = OW::getPluginManager()->getPlugin('blogs'); OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'blogs', 'main_menu_item'); $this->setPageHeading(OW::getLanguage()->text('blogs', 'save_page_heading')); $this->setPageHeadingIconClass('ow_ic_write'); if (!OW::getUser()->isAuthorized('blogs', 'add')) { $this->setTemplate(OW::getPluginManager()->getPlugin('base')->getCtrlViewDir() . 'authorization_failed.html'); return; } $eventParams = array('pluginKey' => 'blogs', 'action' => 'add_blog'); $credits = OW::getEventManager()->call('usercredits.check_balance', $eventParams); if ($credits === false) { $this->assign('authMsg', OW::getEventManager()->call('usercredits.error_message', $eventParams)); return; } $this->assign('authMsg', null); $id = empty($params['id']) ? 0 : $params['id']; $service = PostService::getInstance(); /* @var $service PostService */ $tagService = BOL_TagService::getInstance(); if (intval($id) > 0) { $post = $service->findById($id); if ($post->authorId != OW::getUser()->getId() && !OW::getUser()->isAuthorized('blogs')) { throw new Redirect404Exception(); } $eventParams = array('action' => PostService::PRIVACY_ACTION_VIEW_BLOG_POSTS, 'ownerId' => $post->authorId); $privacy = OW::getEventManager()->getInstance()->call('plugin.privacy.get_privacy', $eventParams); if (!empty($privacy)) { $post->setPrivacy($privacy); } } else { $post = new Post(); $eventParams = array('action' => PostService::PRIVACY_ACTION_VIEW_BLOG_POSTS, 'ownerId' => OW::getUser()->getId()); $privacy = OW::getEventManager()->getInstance()->call('plugin.privacy.get_privacy', $eventParams); if (!empty($privacy)) { $post->setPrivacy($privacy); } $post->setAuthorId(OW::getUser()->getId()); } $form = new SaveForm($post); if (OW::getRequest()->isPost() && (!empty($_POST['command']) && in_array($_POST['command'], array('draft', 'publish'))) && $form->isValid($_POST)) { $form->process($this); OW::getApplication()->redirect(OW::getRouter()->urlForRoute('post-save-edit', array('id' => $post->getId()))); } $this->addForm($form); $this->assign('info', array('dto' => $post)); OW::getDocument()->setTitle(OW::getLanguage()->text('blogs', 'meta_title_new_blog_post')); OW::getDocument()->setDescription(OW::getLanguage()->text('blogs', 'meta_description_new_blog_post')); }
public function index() { if (!OW::getUser()->isAuthenticated()) { throw new AuthenticateException(); } $form = new BuyCreditsForm(); $this->addForm($form); $creditService = USERCREDITS_BOL_CreditsService::getInstance(); if (OW::getRequest()->isPost() && $form->isValid($_POST)) { $values = $form->getValues(); $lang = OW::getLanguage(); $userId = OW::getUser()->getId(); $billingService = BOL_BillingService::getInstance(); if (empty($values['gateway']['url']) || empty($values['gateway']['key']) || !($gateway = $billingService->findGatewayByKey($values['gateway']['key']) || !$gateway->active)) { OW::getFeedback()->error($lang->text('base', 'billing_gateway_not_found')); $this->redirect(); } if (!($pack = $creditService->findPackById($values['pack']))) { OW::getFeedback()->error($lang->text('usercredits', 'pack_not_found')); $this->redirect(); } // create pack product adapter object $productAdapter = new USERCREDITS_CLASS_UserCreditsPackProductAdapter(); // sale object $sale = new BOL_BillingSale(); $sale->pluginKey = 'usercredits'; $sale->entityDescription = strip_tags($creditService->getPackTitle($pack->price, $pack->credits)); $sale->entityKey = $productAdapter->getProductKey(); $sale->entityId = $pack->id; $sale->price = floatval($pack->price); $sale->period = 30; $sale->userId = $userId ? $userId : 0; $sale->recurring = 0; $saleId = $billingService->initSale($sale, $values['gateway']['key']); if ($saleId) { // sale Id is temporarily stored in session $billingService->storeSaleInSession($saleId); $billingService->setSessionBackUrl($productAdapter->getProductOrderUrl()); // redirect to gateway form page OW::getApplication()->redirect($values['gateway']['url']); } } $lang = OW::getLanguage(); $accountTypeId = $creditService->getUserAccountTypeId(OW::getUser()->getId()); $packs = $creditService->getPackList($accountTypeId); $this->assign('packs', $packs); $this->setPageHeading($lang->text('usercredits', 'buy_credits_page_heading')); $this->setPageHeadingIconClass('ow_ic_user'); OW::getDocument()->setTitle($lang->text('usercredits', 'meta_title_buy_credits')); OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, 'base', 'dashboard'); }
/** * Constructor. */ public function __construct() { parent::__construct(); if (OW::getApplication()->getContext() != OW_Application::CONTEXT_DESKTOP) { throw new InterceptException(array(OW_RequestHandler::ATTRS_KEY_CTRL => 'BASE_MCTRL_BaseDocument', OW_RequestHandler::ATTRS_KEY_ACTION => 'notAvailable')); } if (!OW::getUser()->isAdmin()) { throw new AuthenticateException(); } if (!OW::getRequest()->isAjax()) { $document = OW::getDocument(); $document->setMasterPage(new ADMIN_CLASS_MasterPage()); $this->setPageTitle(OW::getLanguage()->text('admin', 'page_default_title')); } }
public function onAfterRout(OW_Event $event) { $handlerAtr = OW::getRequestHandler()->getHandlerAttributes(); if ($handlerAtr['controller'] == 'BASE_CTRL_ComponentPanel' && $handlerAtr['action'] == 'profile') { $profileUserName = empty($handlerAtr['params']['username']) ? false : $handlerAtr['params']['username']; $profileUserId = BOL_UserService::getInstance()->findByUsername($profileUserName)->id; $currentId = OW::getUser()->getId(); if ($profileUserId == $currentId) { return; } $total = BOL_QuestionService::getInstance()->getQuestionData(array($profileUserId, $currentId), array('sex')); if ($total[$profileUserId]['sex'] == $total[$currentId]['sex']) { OW::getApplication()->redirect(OW::getRouter()->urlForRoute('not-for-your-sex', array('type' => $_POST['type']))); } } }
public function init() { $configDev = (int) OW::getConfig()->getValue("base", self::CONFIG_NAME); if ($configDev > 0) { $this->refreshEntitiesCache($configDev); OW::getConfig()->saveConfig("base", self::CONFIG_NAME, 0); OW::getApplication()->redirect(); } if (defined("OW_DEV_MODE") && OW_DEV_MODE) { $this->refreshEntitiesCache(OW_DEV_MODE); } // show profiler only for desktop and if it's enabled if (!OW::getApplication()->isDesktop() || OW::getRequest()->isAjax() || !OW_PROFILER_ENABLE) { return; } OW_View::setCollectDevInfo(true); OW::getEventManager()->setDevMode(true); OW::getEventManager()->bind("base.append_markup", array($this, "onAppendMarkup")); }
/** * Returns processed catch all requests attributes. * * @return string */ protected function processCatchAllRequestsAttrs() { if (empty($this->catchAllRequestsAttributes)) { return null; } $catchRequest = true; $lastKey = array_search(end($this->catchAllRequestsAttributes), $this->catchAllRequestsAttributes); foreach ($this->catchAllRequestsExcludes[$lastKey] as $exclude) { if ($exclude[self::CATCH_ALL_REQUEST_KEY_CTRL] == $this->handlerAttributes[self::ATTRS_KEY_CTRL]) { if ($exclude[self::CATCH_ALL_REQUEST_KEY_ACTION] === null || $exclude[self::CATCH_ALL_REQUEST_KEY_ACTION] == $this->handlerAttributes[self::ATTRS_KEY_ACTION]) { if ($exclude[self::CATCH_ALL_REQUEST_KEY_PARAMS] === null || $exclude[self::CATCH_ALL_REQUEST_KEY_PARAMS] == $this->handlerAttributes[self::ATTRS_KEY_VARLIST]) { $catchRequest = false; break; } } } } if ($catchRequest) { if (isset($this->catchAllRequestsAttributes[$lastKey][self::CATCH_ALL_REQUEST_KEY_REDIRECT]) && (bool) $this->catchAllRequestsAttributes[$lastKey][self::CATCH_ALL_REQUEST_KEY_REDIRECT]) { $route = isset($this->catchAllRequestsAttributes[$lastKey][self::CATCH_ALL_REQUEST_KEY_ROUTE]) ? trim($this->catchAllRequestsAttributes[$lastKey][self::CATCH_ALL_REQUEST_KEY_ROUTE]) : null; $params = isset($this->catchAllRequestsAttributes[$lastKey][self::CATCH_ALL_REQUEST_KEY_PARAMS]) ? $this->catchAllRequestsAttributes[$lastKey][self::CATCH_ALL_REQUEST_KEY_PARAMS] : array(); $redirectUrl = $route !== null ? OW::getRouter()->urlForRoute($route, $params) : OW::getRouter()->urlFor($this->catchAllRequestsAttributes[$lastKey][self::CATCH_ALL_REQUEST_KEY_CTRL], $this->catchAllRequestsAttributes[$lastKey][self::CATCH_ALL_REQUEST_KEY_ACTION], $params); $redirectUrl = OW::getRequest()->buildUrlQueryString($redirectUrl, array('back_uri' => OW::getRequest()->getRequestUri())); if (isset($this->catchAllRequestsAttributes[$lastKey][self::CATCH_ALL_REQUEST_KEY_JS]) && (bool) $this->catchAllRequestsAttributes[$lastKey][self::CATCH_ALL_REQUEST_KEY_JS]) { // TODO resolve hotfix // hotfix for splash screen + members only case if (array_key_exists('base.members_only', $this->catchAllRequestsAttributes)) { if (in_array($this->handlerAttributes[self::CATCH_ALL_REQUEST_KEY_CTRL], array('BASE_CTRL_User', 'BASE_MCTRL_User')) && $this->handlerAttributes[self::CATCH_ALL_REQUEST_KEY_ACTION] === 'standardSignIn') { $backUri = isset($_GET['back_uri']) ? $_GET['back_uri'] : OW::getRequest()->getRequestUri(); OW::getDocument()->addOnloadScript("window.location = '" . OW::getRequest()->buildUrlQueryString($redirectUrl, array('back_uri' => $backUri)) . "'"); return null; } else { $ru = OW::getRequest()->buildUrlQueryString(OW::getRouter()->urlForRoute('static_sign_in'), array('back_uri' => OW::getRequest()->getRequestUri())); OW::getApplication()->redirect($ru); } } OW::getDocument()->addOnloadScript("window.location = '" . $redirectUrl . "'"); return null; } UTIL_Url::redirect($redirectUrl); } return $this->getCatchAllRequestsAttributes($lastKey); } return null; }
/** * Returns document key for current page. * * @return string */ public function getDocumentKey() { return OW::getApplication()->getDocumentKey(); }
public function process() { $values = $this->getValues(); $lang = OW::getLanguage(); $userId = OW::getUser()->getId(); $billingService = BOL_BillingService::getInstance(); $membershipService = MEMBERSHIP_BOL_MembershipService::getInstance(); $url = OW::getRouter()->urlForRoute('membership_subscribe'); if (!($plan = $membershipService->findPlanById($values['plan']))) { OW::getFeedback()->error($lang->text('membership', 'plan_not_found')); OW::getApplication()->redirect($url); } if ($plan->price == 0) { // trial plan // check if trial plan used $used = $membershipService->isTrialUsedByUser($userId); if ($used) { OW::getFeedback()->error($lang->text('membership', 'trial_used_error')); OW::getApplication()->redirect($url); } else { // give trial plan $userMembership = new MEMBERSHIP_BOL_MembershipUser(); $userMembership->userId = $userId; $userMembership->typeId = $plan->typeId; $userMembership->expirationStamp = time() + (int) $plan->period * 3600 * 24; $userMembership->recurring = 0; $userMembership->trial = 1; $membershipService->setUserMembership($userMembership); $membershipService->addTrialPlanUsage($userId, $plan->id, $plan->period); OW::getFeedback()->info($lang->text('membership', 'trial_granted', array('days' => $plan->period))); OW::getApplication()->redirect($url); } } if (empty($values['gateway']['url']) || empty($values['gateway']['key'])) { OW::getFeedback()->error($lang->text('base', 'billing_gateway_not_found')); OW::getApplication()->redirect($url); } $gateway = $billingService->findGatewayByKey($values['gateway']['key']); if (!$gateway || !$gateway->active) { OW::getFeedback()->error($lang->text('base', 'billing_gateway_not_found')); OW::getApplication()->redirect($url); } // create membership plan product adapter object $productAdapter = new MEMBERSHIP_CLASS_MembershipPlanProductAdapter(); // sale object $sale = new BOL_BillingSale(); $sale->pluginKey = 'membership'; $sale->entityDescription = $membershipService->getFormattedPlan($plan->price, $plan->period, $plan->recurring); $sale->entityKey = $productAdapter->getProductKey(); $sale->entityId = $plan->id; $sale->price = floatval($plan->price); $sale->period = $plan->period; $sale->userId = $userId ? $userId : 0; $sale->recurring = $plan->recurring; $saleId = $billingService->initSale($sale, $values['gateway']['key']); if ($saleId) { // sale Id is temporarily stored in session $billingService->storeSaleInSession($saleId); $billingService->setSessionBackUrl($productAdapter->getProductOrderUrl()); // redirect to gateway form page OW::getApplication()->redirect($values['gateway']['url']); } }
public function check_user_activity() { //for guest restrict mode - hard mode //file_put_contents("ow_plugins/startpage/xxxxxxx.LOGS", "\n\n------check_user_activity------:\n".print_r($_POST,1)."\n---------------\n".print_r($_GET,1),FILE_APPEND); //echo "afadf";exit; if (OW::getConfig()->getValue('startpage', 'disable_force_imagechache') == "1") { $firce_disable_image_cache = true; } else { $firce_disable_image_cache = false; } $id_user = OW::getUser()->getId(); //citent login user (uwner) $is_user = OW::getUser()->getId(); //citent login user (uwner) $is_admin = OW::getUser()->isAdmin(); //iss admin $curent_url = OW_URL_HOME; //echo OW::getConfig()->getValue('startpage', 'disable_startpage'); if (OW::getConfig()->getValue('startpage', 'disable_startpage') != "0") { return; } //echo "sss";exit; // if (OW::getConfig()->getValue('startpage', 'disable_startpage')=="2") return; //return; /* //======================= echo "START<br>"; $i=rand(88888,99999999); $_POST['acctype']="asdasd".$i; $_POST['uname']="asdasd".$i; $_POST['email']="asdasdasdasd".$i."@asdas.com"; $_POST['pass']="******"; $_POST['pass2']="afsdfwdfsdfsd"; $_POST['ss']=substr(session_id(),3,5); echo $this->register(); echo "<br>END"; exit; //====================== */ //============v1 //---s st if (strpos($_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"], "ow_cron") === true) { return; } if (OW::getRequest()->isPost()) { return; } if (OW::getPluginManager()->isPluginActive('mobille')) { if (OW::getConfig()->getValue('mobille', 'disable_detect_mobile') != "1") { if (MOBILLE_BOL_Service::getInstance()->get_mobile_status()) { return; } } } //print_r($_SESSION); //print_r($_POST); //print_r($_GET); //exit; $pageURL = 'http'; if (isset($_SERVER["HTTPS"]) and $_SERVER["HTTPS"] == "on") { $pageURL .= "s"; } $pageURL .= "://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; $tmp = str_replace(OW_URL_HOME, "", $pageURL); if (substr($tmp, 0, 1) == "/") { $tmp = substr($tmp, 1); } /* if ($tmp=="sign-in?"){ return; } if ($id_user){ return; } */ //http://facejuggle.com/str/sign-in //sign-in //http://test.a6.pl/sign-in //echo $_SERVER["REQUEST_URI"]; //echo $tmp;exit; $v1 = strtolower(substr($tmp, 0, 8)); $v1 = str_replace("/", "", $v1); $v1 = str_replace("\\", "", $v1); $testx_tmp = explode("?", $v1); if (isset($testx_tmp[0])) { $v1 = $testx_tmp[0]; } $v1 = str_replace("?", "", $v1); $v2 = strtolower(substr($tmp, 0, 7)); $v2 = str_replace("/", "", $v2); $v2 = str_replace("\\", "", $v2); $testx_tmp = explode("?", $v2); if (isset($testx_tmp[0])) { $v2 = $testx_tmp[0]; } $v2 = str_replace("?", "", $v2); $testx = $tmp; $testx_tmp = explode("?", $testx); if (isset($testx_tmp[0])) { $testx = $testx_tmp[0]; } //echo $v1."--".$v2; //print_r($_POST);exit; //print_r($_GET);exit; ////sign-in--sign-inArray ( [form_name] => std-sign-in [identity] => aron [password] => Aronx1403 [submit] => Sign In ) if (isset($_POST['form_name']) and $_POST['form_name'] == "sign-in") { return; } else { if ($v1 == "sign-in" or $v2 == "sign-in" and !isset($_POST['form_name'])) { return; } else { if ($testx == "mobille/" or $testx == "/mobille" or $testx == "mobile/" or $testx == "/mobile" or strpos($testx, "mobille") !== false or strpos($testx, "mobile") !== false) { return; } else { if ($testx == "adsense/" or $testx == "/adsense" or strpos($testx, "adsense/show") !== false) { return; } else { if ($testx == "terms-of-use" or $testx == "terms-of-use/" or $testx == "/terms-of-use" or strpos($testx, "terms-of-use") !== false) { return; } else { if ($testx == "privacy-policy" or $testx == "privacy-policy/" or $testx == "/privacy-policy" or strpos($testx, "privacy-policy") !== false) { return; } else { if ($testx == "rss" or $testx == "rss/" or $testx == "/rss" or strpos($testx, "rsss.php") !== false or strpos($testx, "rss/") !== false) { return; } else { if ($testx == "facebook-connect" or $testx == "/facebook-connect" or $testx == "fbconnect_channel.html" or $testx == "/fbconnect_channel.html" or strpos($testx, "facebook-connect") !== false or strpos($testx, "fbconnect_channel.html") !== false) { return; } else { if ($testx == "base/base-document/maintenance" or $testx == "/base/base-document/maintenance" or $testx == "base/base-document/maintenance" or strpos($testx, "base/base-document/maintenance") !== false) { return; } else { if ($testx == "base/captcha" or $testx == "/base/captcha" or $testx == "base/captcha/" or strpos($testx, "base/captcha") !== false) { return; } else { if (OW::getConfig()->getValue('base', 'maintenance') == 1) { return; } else { if ($testx == "contact/" or $testx == "/contact" or $testx == "contact/user/" or $testx == "/contact/user" or strpos($testx, "contact/user/") !== false) { return; } else { if ($testx == "reset-password" or $testx == "reset-password/" or $testx == "/reset-password" or strpos($testx, "reset-password") !== false) { return; } else { if ($testx == "forgot-password" or $testx == "forgot-password/" or $testx == "/forgot-password" or strpos($testx, "forgot-password") !== false) { return; } } } } } } } } } } } } } } //---s en // AND ($id_user>0 OR !$testx OR $testx=="index" OR strpos($testx,"index/")!==false)) { //echo $testx;exit; //return; // if (!OW::getConfig()->getValue('startpage', 'force_for_guest') AND ($testx!="" OR $testx=="index" OR $testx=="index/")) { if (!OW::getConfig()->getValue('startpage', 'force_for_guest') and ($testx != "" and $testx != "startx") and !$id_user) { // if (!OW::getConfig()->getValue('startpage', 'force_for_guest') AND ($testx!="") AND !$id_user) { return; } //============v2 //print_r($_SESSION);exit; //print_r(OW::getSession());exit; if (isset($_SERVER['REQUEST_URI'])) { $test1 = $_SERVER['REQUEST_URI']; } else { $test1 = ""; } //if (strpos($test1,"language_id=")===true) return;//language //echo "fsdfSDF";exit; //echo $test1;exit; $test1_tmp = explode("?", $test1); if (isset($test1_tmp[0])) { $test1 = $test1_tmp[0]; } //echo "--".strpos($_SERVER['REQUEST_URI'],"");exit; if ($test1 == "mobille/" or $test1 == "/mobille" or $test1 == "mobile/" or $test1 == "/mobile" or strpos($_SERVER['REQUEST_URI'], "mobille") !== false) { return; } else { if ($test1 == "rss" or $test1 == "rss/" or $test1 == "/rss" or strpos($test1, "rsss.php") !== false or strpos($test1, "rss/") !== false) { return; } else { if ($test1 == "paypal_ipn" or $test1 == "/paypal_ipn" or strpos($_SERVER['REQUEST_URI'], "paypal_ipn") !== false) { return; } else { if ($test1 == "shopipn" or $test1 == "/shopipn" or $test1 == "shopipn/" or $test1 == "shopipn/back" or $test1 == "/shopipn/back" or $test1 == "/shopipn/back/" or $test1 == "shopipn/back/" or strpos($_SERVER['REQUEST_URI'], "shopipn") !== false) { return; } else { if ($test1 == "cartipn" or $test1 == "/cartipn" or strpos($_SERVER['REQUEST_URI'], "cartipn") !== false) { return; } else { if ($test1 == "paypal_cancel" or $test1 == "/paypal_cancel" or strpos($_SERVER['REQUEST_URI'], "paypal_cancel") !== false) { return; } else { if ($test1 == "paypal_complete" or $test1 == "/paypal_complete" or strpos($_SERVER['REQUEST_URI'], "paypal_complete") !== false) { return; } else { if ($test1 == "facebook-connect" or $test1 == "/facebook-connect" or $test1 == "/facebook-connect/login" or $test1 == "facebook-connect/login" or strpos($_SERVER['REQUEST_URI'], "facebook-connect/login") !== false) { return; } else { if ($test1 == "base/base-document/maintenance" or $test1 == "/base/base-document/maintenance" or $test1 == "base/base-document/maintenance" or strpos($_SERVER['REQUEST_URI'], "base/base-document/maintenance") !== false) { return; } else { if ($test1 == "base/captcha" or $test1 == "/base/captcha" or $test1 == "base/captcha/" or strpos($_SERVER['REQUEST_URI'], "base/captcha") !== false) { return; } else { if (OW::getConfig()->getValue('base', 'maintenance') == 1) { return; } else { if ($test1 == "contact/" or $test1 == "/contact" or $test1 == "contact/user/" or $test1 == "/contact/user" or strpos($test1, "contact/user/") !== false) { return; } else { if (strpos($_SERVER['REQUEST_URI'], "startpage/checkf") !== false) { //----aa start $retconf = array(); $retconf['ss'] = substr(session_id(), 3, 5); // if (isset($_POST['ss']) AND $_POST['ss']==substr(session_id(),3,5)){ $fileElementName = 'fileToUpload'; //print_r($_FILES); //echo isset($_FILES[$fileElementName])."--".$_FILES[$fileElementName]['error']; //echo "---"; /* // if(isset($_FILES[$fileElementName]) AND !empty($_FILES[$fileElementName]['error']) AND $_FILES[$fileElementName]['error']=="0"){ if(isset($_FILES[$fileElementName]) AND $_FILES[$fileElementName]['error']=="0"){ $resultcreate=array(); $resultcreate=$this->upload_av($fileElementName); if ($resultcreate['comm']=="OK"){ $retconf['status']="SUCCES"; $retconf['comm']="OK"; }else{ $retconf=$resultcreate; } }else{ $retconf['status']="ERROR"; $retconf['comm']="ERROR... 2001"; } */ //print_r($_FILES); //echo $_FILES[$fileElementName]['tmp_name']; $fileElementName = 'fileToUpload'; if (isset($_FILES[$fileElementName]) and $_FILES[$fileElementName]['error'] == "0" and !empty($_FILES[$fileElementName]['tmp_name']) and $_FILES[$fileElementName]['tmp_name'] != 'none') { $resultcreate = array(); // $resultcreate=STARTPAGE_BOL_Service::getInstance()->upload_av($fileElementName); // image_copy_resize($file_source="",$file_dest="",$crop=false,$width=800,$height=600) $uploaddir = OW::getPluginManager()->getPlugin('startpage')->getUserFilesDir(); $img_temp = session_id() . ".tmpav.jpg"; //echo $uploaddir.$img_temp;exit; if ($this->image_copy_resize($_FILES[$fileElementName]['tmp_name'], $uploaddir . $img_temp, false, 150, 150)) { //echo $uploaddir.$img_temp;exit; // if ($resultcreate['comm']=="OK"){ $retconf['status'] = "SUCCES"; $retconf['comm'] = "OK"; } else { // $retconf=$resultcreate; $retconf['status'] = "ERROR"; $retconf['comm'] = "ERROR...1002"; } } else { $retconf['status'] = "ERROR"; $retconf['comm'] = STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_select_file') . " 1001"); } // $retconf=$this->upload_av($_FILES); // $retconf['status']="SUCCES"; // $retconf['comm']="OK"; echo json_encode($retconf); exit; } else { if ($test1 == "startpage" or $test1 == "/startpage" or strpos($_SERVER['REQUEST_URI'], "startpage/check") !== false) { //----aa start $retconf = array(); $retconf['ss'] = substr(session_id(), 3, 5); if (isset($_POST['ss']) and $_POST['ss'] == substr(session_id(), 3, 5)) { $resultcreate = 0; $_SESSION['userId'] = $resultcreate; OW::getSession()->set('userId', $resultcreate); $resultcreate = $this->register(); // $resultcreate=STARTPAGE_BOL_Service::getInstance()->register(); if ($resultcreate > 0) { $retconf['status'] = "SUCCES"; $retconf['comm'] = "OK"; $_SESSION['userId'] = $resultcreate; OW::getSession()->set('userId', $resultcreate); } else { if ($resultcreate == -100) { $retconf['status'] = "ERROR"; $retconf['comm'] = STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_email_already_exist') . " [204]"); } else { if ($resultcreate == -200) { $retconf['status'] = "ERROR"; $retconf['comm'] = STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_login_already_exist') . " [203]"); } else { $retconf['status'] = "ERROR"; $retconf['comm'] = STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_create_account_tryagain') . " [202]"); } } } } else { //errror $retconf['status'] = "ERROR"; $retconf['comm'] = STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_create_account_tryagain') . " [201-ses]"); } echo json_encode($retconf); exit; //----aa end return; } else { if ($test1 == "sign-in" or $test1 == "/sign-in") { return; } else { if ($test1 == "forgot-password" or $test1 == "/forgot-password") { return; } else { if ($test1 == "sign-in" or $test1 == "/sign-in") { return; } else { if ($test1 == "forgot-password" or $test1 == "/forgot-password") { return; } } } } } } } } } } } } } } } } } } //if (OW::getConfig()->getValue('startpage', 'disable_startpage')=="1" AND !$id_user){ //OW::getDocument()->getMasterPage()->setTemplate(OW::getThemeManager()->getMasterPageTemplate(OW_MasterPage::TEMPLATE_BLANK)); //exit; //echo OW::getRequest()->isPost()."|"; //return; //session_destroy(); //print_r($_POST);print_r($_GET);print_r($_SESSION); //echo $id_user;exit; if ($id_user > 0) { return; } else { if (OW::getRequest()->isPost()) { if (isset($_SERVER['REQUEST_URI']) and strpos($_SERVER['REQUEST_URI'], "base/join/join-form-submit") !== false) { OW::getApplication()->redirect($curent_url . "join"); exit; } else { if (OW::getConfig()->getValue('startpage', 'force_for_guest') == "1" and !$id_user) { } else { return; } } } else { if (!OW::getRequest()->isPost()) { //echo "dfsdf";exit; //print_r($_GET); //print_r($_POST); //print_r($_SESSION);exit; //exit; $test = str_replace($curent_url, "", $_SERVER['REQUEST_URI']); if (strpos($test, "?language_id") !== false) { return; // OW::getApplication()->redirect($curent_url."join"); OW::getApplication()->redirect($curent_url . "start"); exit; } $test2_tmp = explode("?", $test); if (isset($test2_tmp[0])) { $test = $test2_tmp[0]; } $test = str_replace("///", "/", $test); $test = str_replace("//", "/", $test); //echo "-----".$test;exit; if (OW::getConfig()->getValue('startpage', 'force_for_guest') == "1" and !$id_user) { } else { if ($test != "/join" and $test != "/" and $test != "" and $test != "startx" and $test != "/startx" and $test != "startx/") { return; } } // }else if ($test=="/join" AND (strpos($test,"?language_id")===true) ) return; //echo $test;exit; // if (strpos($_GET,"/join" } } } //echo "sfsdF";exit; /* [joinStep] => 1 [join.real_question_list] => Array ( [41123565984518694488af6c] => username [61536939255518694488b0be] => email ) */ /* if (isset($_SESSION['joinStep']) AND isset($_SESSION['join.real_question_list']) AND $_SESSION['joinStep']==1){ $jreal=$_SESSION['join.real_question_list']; foreach($jreal as $language => $value ){ echo "<hr>".$language."--".$value."--".OW::getLanguage()->text('base', 'questions_question_'.$value.'_label'); //OW::getLanguage()->text('base', 'questions_question_'.$language.'_label'); } } */ /* [joinData] => Array ( [accountType] => 290365aadde35a97f11207ca7e4279cc [username] => aaaa [email] => aaaa@aaaa.pl [password] => aaaaaa ) */ //exit; /* echo OW::getRequest()->isPost(); echo "<hr>"; echo $_SERVER['REQUEST_URI']; echo strpos($_SERVER['REQUEST_URI'],"base/join/join-form-submit"); exit; */ /* if (OW::getRequest()->isPost()){ if (isset($_SERVER['REQUEST_URI']) AND strpos($_SERVER['REQUEST_URI'],"base/join/join-form-submit")!==false){ OW::getApplication()->redirect($curent_url."join"); exit; }else{ return; } } else if (OW::getRequest()->isPost()){ return; } */ /* $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } */ //print_r($_SERVER);exit; //$pluginStaticDir $pluginStaticURL =OW::getPluginManager()->getPlugin('shoppro')->getUserFilesUrl(); // $pluginStaticDir =OW::getPluginManager()->getPlugin('startpage')->getUserFilesDir(); // $path_file=$pluginStaticDir."files/"; // $name_file="file_".$value['entityId']."_".$hash.".pack"; // $table .="<table>"; // if (is_file($path_file.$name_file)){ $default_theme = OW::getConfig()->getValue('startpage', 'curent_theme'); if (!$default_theme) { $default_theme = "default"; } $pluginStaticU = OW::getPluginManager()->getPlugin('startpage')->getStaticUrl(); $pluginStaticD = OW::getPluginManager()->getPlugin('startpage')->getStaticDir(); $plname = "startpage"; $source = OW_DIR_PLUGIN . $plname . DS . 'static' . DS; $pluginStaticDir = OW_DIR_STATIC . 'plugins' . DS . $plname . DS; $contentlang = ""; foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $lang) { $pattern = '/^(?P<primarytag>[a-zA-Z]{2,8})' . '(?:-(?P<subtag>[a-zA-Z]{2,8}))?(?:(?:;q=)' . '(?P<quantifier>\\d\\.\\d))?$/'; $splits = array(); // printf("Lang:,,%s''\n", $lang); if (preg_match($pattern, $lang, $splits)) { // print_r($splits); if (isset($splits[0])) { $contentlang = $splits[0]; break; } //echo $splits[0];exit; // } else { // echo "\nno match\n"; } } if (!$contentlang) { // $contentlang="pl-PL"; $contentlang = "en-US"; } $charset = "UTF-8"; //$contentlang="pl-PL"; //$contentlang="en-US"; $title = OW::getConfig()->getValue('startpage', 'theme_seo_title'); $keywords = OW::getConfig()->getValue('startpage', 'theme_seo_keywords'); $descriptio = OW::getConfig()->getValue('startpage', 'theme_seo_desc'); //echo $descriptio;exit; //print_r($params);exit; // if ( empty($userId) ){return;} //echo "0000".OW::getDocument()->getMasterPage()->setTemplate(OW::getThemeManager()->getMasterPageTemplate('blank'));exit; //echo "0000".OW::getDocument()->getMasterPage();exit; $thenam = OW::getThemeManager()->getSelectedTheme()->getDto()->getName(); //echo "---".str_replace("/","\/",$curent_url);exit; // $th=file_get_contents($curent_url."ow_static/plugins/startpage/join.html"); //----head $th = file_get_contents($pluginStaticD . "join_header.html"); $th = str_replace("[tthemename]", $thenam, $th); $th = str_replace("[tturl]", $curent_url, $th); $th = str_replace("[tturlsl]", str_replace("/", "\\/", $curent_url), $th); if (OW::getConfig()->getValue('startpage', 'after_login_backto') == "index") { $th = str_replace("[after_login_backto]", "index", $th); } else { $th = str_replace("[after_login_backto]", "dashboard", $th); } $th = str_replace("[tctheme]", $default_theme, $th); //curent theme //xx // $theme=OW::getConfig()->getValue('startpage', 'curent_theme'); //if (!$theme) $theme="default"; //$pluginStaticU=OW::getPluginManager()->getPlugin('startpage')->getStaticUrl(); // $img_bckground=$pluginStaticURL2."themes".DS.$default_theme.DS."css.css"; // OW::getDocument()->addStyleSheet($pluginStaticURL2."themes".DS.$default_theme.DS."css.css"); $th = str_replace("[tt_ss]", substr(session_id(), 3, 5), $th); // $th=str_replace("[url_jon_finished]",$curent_url."sign-in",$th); // $th=str_replace("[url_jon_finished]",$curent_url,$th); $th = str_replace("[url_jon_finished]", $curent_url . "profile/edit", $th); $th = str_replace("[url_jon_errror]", $curent_url . "join", $th); $th = str_replace("[ttalertlform]", STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'enterloginandpasswword')), $th); // $uploaddir = OW::getPluginManager()->getPlugin('startpage')->getUserFilesDir(); $uploadurl = OW::getPluginManager()->getPlugin('startpage')->getUserFilesUrl(); $img_temp = session_id() . ".tmpav.jpg?a="; $th = str_replace("[tt_urlavthimb]", $uploadurl . $img_temp, $th); $img_bckground = $pluginStaticDir . "themes" . DS . $default_theme . DS . OW::getConfig()->getValue('startpage', 'background_image'); $big_bg_image = ""; if (strlen(OW::getConfig()->getValue('startpage', 'background_image')) > 4 and is_file($img_bckground)) { $img_bckground = $pluginStaticU . "themes" . DS . $default_theme . DS . OW::getConfig()->getValue('startpage', 'background_image'); $big_bg_image = $img_bckground; if (OW::getConfig()->getValue('startpage', 'background_image_pos')) { $bpos = "background-position:" . OW::getConfig()->getValue('startpage', 'background_image_pos') . ";"; } else { $bpos = ""; } if (OW::getConfig()->getValue('startpage', 'background_color')) { $bcol = "background-color:" . OW::getConfig()->getValue('startpage', 'background_color') . ";"; } else { $bcol = ""; } // $xbckground=" style=\"background-image:url(".$img_bckground.");".$bpos."background-repeat: no-repeat;".$bcol."overflow:hidden; padding:0;margin:0;height:100%;width:100%;\" "; $xbckground = " style=\"" . $bcol . "min-width: 100%;background-image:none;overflow:hidden; padding:0;margin:0;height:100%;width:100%;\" "; if ($firce_disable_image_cache) { $ran = "?fakecache=" . rand(88888, 999999); } else { $ran = ""; } $xbckgroundim = "<img id=\"bgimg\" src=\"" . $img_bckground . $ran . "\" />"; } else { if (strlen(OW::getConfig()->getValue('startpage', 'background_color')) > 3) { $bcol = "background-color:" . OW::getConfig()->getValue('startpage', 'background_color') . ";"; $xbckground = " style=\"min-width: 100%;background-image:none;" . $bcol . "\" "; $xbckgroundim = ""; } else { $bckground = " style=\"min-width: 100%;background-image:none;background-color:transparent;\""; $xbckgroundim = ""; } } $th = str_replace("[tbckground]", $xbckground, $th); $th = str_replace("[tbckgroundim]", $xbckgroundim, $th); //-------------------------------private css.css starrt //[tbig_background_image] // $th=str_replace("[css_from_theme]","<link rel=\"stylesheet\" type=\"text/css\" href=\"".$pluginStaticU."themes".DS.$default_theme.DS."css.css\" media=\"all\" />",$th); // $th=str_replace("[css_from_theme]","<link rel=\"stylesheet\" type=\"text/css\" href=\"".$pluginStaticU."themes".DS.$default_theme.DS."css.css\" media=\"all\" />",$th); $file_css_private = file_get_contents($pluginStaticD . "themes" . DS . $default_theme . DS . "css.css"); if (!$big_bg_image) { $big_bg_image = $pluginStaticU . "themes" . DS . $default_theme . DS . "img/bg.jpg"; } $file_css_private = str_replace("[tbig_background_image]", $big_bg_image, $file_css_private); //big image backhround //echo $file_css_private;exit; $th = str_replace("[theme_css_private]", $file_css_private, $th); //curent theme //-------------------------------private css.css end if (OW::getPluginManager()->isPluginActive('mobille') and MOBILLE_BOL_Service::getInstance()->is_file_application()) { $pluginStaticUM = OW::getPluginManager()->getPlugin('mobille')->getStaticUrl(); $content_x = "<" . "script type=\"text/javascript\" src=\"" . $pluginStaticUM . "ext" . DS . "qrcode.js\"></script>"; $content_x .= "<script>"; $content_x .= "\$(document).ready(function() {"; $content_x .= "\$('#mobile_qrcode_download').qrcode({width: 96,height: 96,text: '" . $curent_url . "mobile/downloadapplication'});"; $content_x .= "});"; $content_x .= "</script>"; $header_main = str_replace("[custom_script]", $custom_script, $header_main); $th = str_replace("[additional_je_files]", $content_x, $th); //curent theme } else { $th = str_replace("[additional_je_files]", "", $th); //curent theme } //----add header start $addheader = ""; $default_theme = OW::getConfig()->getValue('startpage', 'curent_theme'); if (!$default_theme) { $default_theme = "default"; } $pluginStaticU = OW::getPluginManager()->getPlugin('startpage')->getStaticUrl(); $pluginStaticD = OW::getPluginManager()->getPlugin('startpage')->getStaticDir(); // OW::getDocument()->addScript(OW_URL_HOME.'ow_static/themes/'.$default_theme.'/js.js'); // OW::getDocument()->addStyleSheet(OW_URL_HOME.'ow_static/themes/'.$default_theme.'/css.css'); $addheader .= "<script type=\"text/javascript\" src=\"" . $pluginStaticU . "themes/" . $default_theme . "/js.js\"></script>"; // $addheader .="<link rel=\"stylesheet\" type=\"text/css\" href=\"".$pluginStaticU."themes/".$default_theme."/css.css\" media=\"all\" />";//add abouwe with replace $addheader .= "<script>"; $addheader .= "\$(document).ready(function() {"; $plname = "startpage"; $ct = OW::getConfig()->getValue('startpage', 'curent_theme'); if (!$ct) { $ct = "default"; } if (OW::getConfig()->getValue('startpage', 'content_background_image')) { $addheader .= "\$('#tt_form').css('background-image','url(" . $pluginStaticU . "themes" . DS . $ct . DS . OW::getConfig()->getValue('startpage', 'content_background_image') . ")');"; $addheader .= "\$('#tt_form').css('background-repeat','repeat');"; // $addheader .="$('#tt_form').css('background-size','100%');"; } if (OW::getConfig()->getValue('startpage', 'content_background')) { $addheader .= "\$('#tt_form').css('background-color','" . OW::getConfig()->getValue('startpage', 'content_background') . "');"; } if (OW::getConfig()->getValue('startpage', 'content_text_color')) { $addheader .= "\$('#tt_form').css('color','" . OW::getConfig()->getValue('startpage', 'content_text_color') . "');"; } // $addheader .="$('#tt_form').css('background','url(\'http://mycollegesocial.com/ow_static/plugins/startpage/themes/2column_wlogin/bg1.jpg\') repeat scroll 0% 0% transparent;');"; if (OW::getConfig()->getValue('startpage', 'topbar_background_image')) { $addheader .= "\$('#tt_top_bar').css('background-image','url(" . $pluginStaticU . "themes" . DS . $ct . DS . OW::getConfig()->getValue('startpage', 'topbar_background_image') . ")');"; $addheader .= "\$('#tt_form').css('background-repeat','repeat');"; } if (OW::getConfig()->getValue('startpage', 'topbar_background')) { $addheader .= "\$('#tt_top_bar').css('background-color','" . OW::getConfig()->getValue('startpage', 'topbar_background') . "');"; } if (OW::getConfig()->getValue('startpage', 'topbar_text_color')) { $addheader .= "\$('#tt_top_bar').css('color','" . OW::getConfig()->getValue('startpage', 'topbar_text_color') . "');"; } // $addheader .="$('#tt_top_bar').css('background-image','url(http://mycollegesocial.com/ow_static/plugins/startpage/themes/2column_wlogin/bg1.jpg)');"; $addheader .= "});"; $addheader .= "</script>"; $th = str_replace("[tbaddheader]", $addheader, $th); //----add header end //echo $addheader; //exit; if (OW::getConfig()->getValue('startpage', 'allow_show_captha') == "1") { $th = str_replace("[tusingcaptha]", "true", $th); } else { $th = str_replace("[tusingcaptha]", "false", $th); } if (OW::getConfig()->getValue('startpage', 'show_agree_newsletter') == "1") { $th = str_replace("[tusingtherm]", "true", $th); } else { $th = str_replace("[tusingtherm]", "false", $th); } if (OW::getConfig()->getValue('startpage', 'show_agree_therm_of_use') == "1") { $th = str_replace("[tusingtherm_therm]", "true", $th); } else { $th = str_replace("[tusingtherm_therm]", "false", $th); } $th = str_replace("[tusingcapthaerror]", STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'tusingcapthaerror')), $th); $bodyclass = "main_body_" . $thenam; $th = str_replace("[bodyclass]", $bodyclass, $th); if (OW::getConfig()->getValue('startpage', 'show_realname') == "1") { $th = str_replace("[show_realname]", "true", $th); } else { $th = str_replace("[show_realname]", "false", $th); } $th = str_replace("[ttcharset]", $charset, $th); $th = str_replace("[tttitle]", $title, $th); $th = str_replace("[ttdescription]", $descriptio, $th); $th = str_replace("[ttkeywords]", $keywords, $th); $th = str_replace("[ttcontentlang]", $contentlang, $th); $th = str_replace("[error_muname]", STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_muname')), $th); $th = str_replace("[error_uname]", STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_uname')), $th); $th = str_replace("[error_email]", STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_email')), $th); $th = str_replace("[error_passwordl]", STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_passwordl')), $th); $th = str_replace("[error_passretype]", STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_passretype')), $th); $th = str_replace("[error_passmisma]", STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_passmisma')), $th); $th = str_replace("[error_agree_newsletter]", STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_agree_newsletter')), $th); $th = str_replace("[error_agree_therm_of_use]", STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'error_agree_therm_of_use')), $th); /* $xx=print_r($_POST,1); $xx=str_replace("\r\n"," ",$xx); $xx=str_replace("\n"," ",$xx); $xx=str_replace("\r"," ",$xx); $xx=str_replace("'","",$xx); */ $th = str_replace("[error_connection]", OW::getLanguage()->text('startpage', 'error_connection'), $th); // $th=str_replace("[error_connection]",OW::getLanguage()->text('startpage', 'error_connection').$xx,$th); $th = str_replace("[error_uploadavatar]", OW::getLanguage()->text('startpage', 'error_uploadavatar'), $th); echo $th; //----body------------------------------------------------------ $imgp = $pluginStaticDir . "themes" . DS . $default_theme . DS . "image.jpg"; $imgl = $pluginStaticDir . "themes" . DS . $default_theme . DS . "logo.jpg"; $imgp_u = $pluginStaticDir . "themes" . DS . $default_theme . DS . OW::getConfig()->getValue('startpage', 'theme_image_cover'); $imgl_u = $pluginStaticDir . "themes" . DS . $default_theme . DS . OW::getConfig()->getValue('startpage', 'theme_image_top'); //echo $pluginStaticU;exit; if (strlen(OW::getConfig()->getValue('startpage', 'theme_image_cover')) > 4 and is_file($imgp_u)) { $imgp = $pluginStaticU . "themes" . DS . $default_theme . DS . OW::getConfig()->getValue('startpage', 'theme_image_cover'); } else { $imgp = $pluginStaticU . "themes" . DS . $default_theme . DS . "image.jpg"; } if (strlen(OW::getConfig()->getValue('startpage', 'theme_image_top')) > 4 and is_file($imgl_u)) { $imgl = $pluginStaticU . "themes" . DS . $default_theme . DS . OW::getConfig()->getValue('startpage', 'theme_image_top'); } else { $imgl = $pluginStaticU . "themes" . DS . $default_theme . DS . "logo.jpg"; } //$imgbuttonlogin=$pluginStaticU."themes".DS.$default_theme.DS."login.jpg"; // $th=file_get_contents($pluginStaticD."join.html"); $th = file_get_contents($pluginStaticD . "themes" . DS . $default_theme . DS . "join.html"); if ($firce_disable_image_cache) { $ran = "?fakecache=" . rand(88888, 999999); } else { $ran = ""; } $th = str_replace("[ttimg]", $imgp . $ran, $th); //aaaaaaaaaaaaaaaaaaaaaaaa $th = str_replace("[tctheme]", $default_theme, $th); //curent theme $th = str_replace("[pathtocurentheme]", $pluginStaticU . "themes" . DS . $default_theme . DS, $th); //path to curent theme if (OW::getConfig()->getValue('startpage', 'theme_header_height')) { $lh = OW::getConfig()->getValue('startpage', 'theme_header_height'); } else { $lh = "64px"; } if (OW::getConfig()->getValue('startpage', 'logo_margin_left') > 0) { $logo_margin_left = "margin-left:" . OW::getConfig()->getValue('startpage', 'logo_margin_left') . "px;"; } else { $logo_margin_left = ""; } if ($firce_disable_image_cache) { $ran = "?fakecache=" . rand(88888, 999999); } else { $ran = ""; } $logo = "<img src=\"" . $imgl . $ran . "\"class=\"ow_left\" style=\"max-height:" . $lh . ";" . $logo_margin_left . "\"/>"; $login = ""; $login2 = ""; //$login="******"".$curent_url."sign-in\"><img src=\"".$imgbuttonlogin."\" class=\"ow_right\" style=\"margin-top:20px;margin-right:150px;border:0;\"/></a>"; //$login .="<div class=\"clearfix\" style=\"margin-top:20px;margin-right:150px;border:0;\"> //if ($default_theme=="default"){ $login .= "<a href=\"" . $curent_url . "sign-in?back-uri=index\">"; if ($default_theme == "default") { // $login .="<div class=\"clearfix\" style=\"margin-right:150px;border:0;max-height: 64px;bottom: 10%;position: absolute;z-index: 5;float: right;right: 0px;\">";//for DE $login .= "<div class=\"clearfix\" style=\"margin-right:150px;border:0;max-height: 64px;bottom: 10%;z-index: 5;float: right;right: 0px;\">"; } else { if ($default_theme == "twocolumn") { // $login .="<div class=\"clearfix\" style=\"margin-right:150px;border:0;max-height: 64px;bottom: 10%;position: absolute;z-index: 5;float: right;right: 0px;\">";//for DE $login .= "<div class=\"clearfix\" style=\"border:0;max-height: 64px;bottom: 10%;z-index: 5;float: right;right: 0px;\">"; } else { // $login .="<div class=\"clearfix\" style=\"border:0;max-height: 64px;bottom: 10%;xposition: absolute;z-index: 5;float: right;right: 0px;\">";//for DE $login .= "<div class=\"clearfix\" style=\"border:0;max-height: 64px;bottom: 10%;xposition: absolute;z-index: 5;float: right;right: 0px;\">"; } } $login .= "<div class=\"ow_right\" style=\"margin-right:10px;\">\n <span class=\"ow_button ow_positive\"><span>"; $login .= "<input type=\"button\" value=\"" . OW::getLanguage()->text('startpage', 'login') . "\" id=\"b_login\" class=\"ow_button ow_ic_submit\" name=\"joinSubmit\">"; $login .= "</span></span>\n </div>"; $login .= "</div>"; $login .= "</a>"; //$login=""; if (!OW::getConfig()->getValue('startpage', 'force_for_guest')) { $login = ""; $login2 .= "<a href=\"" . $curent_url . "sign-in?back-uri=index\">"; $login2 .= "<div class=\"ow_right\" style=\"margin-right:10px;\">\n <span class=\"ow_button ow_positive\"><span>"; $login2 .= "<input type=\"button\" value=\"" . OW::getLanguage()->text('startpage', 'login') . "\" id=\"b_login\" class=\"ow_button ow_ic_submit\" name=\"joinSubmit\">"; $login2 .= "</span></span>\n </div>"; $login2 .= "</a>"; } //$register ="<div class=\"clearfix ow_center\" style=\"\"> // <span class=\"ow_button\"><span class=\" ow_button ow_ic_submit\">"; $register = "<div class=\"clearfix ow_right\" >\n <div class=\"ow_center\" style=\"\">\n <span class=\"ow_button ow_positive\"><span>"; $register .= "<input type=\"submit\" value=\"" . OW::getLanguage()->text('startpage', 'register') . "\" id=\"register\" class=\"ow_button ow_ic_submit\" name=\"joinSubmit\">"; $register .= "</span></span>\n </div>\n</div>"; $indexp = ""; $menup = ""; if (!OW::getConfig()->getValue('startpage', 'force_for_guest') and !OW::getConfig()->getValue('startpage', 'force_hide_homebutton')) { $indexp .= "<a href=\"" . $curent_url . "index\">"; // $indexp .="<div class=\"ow_right\" style=\"margin-right:10px;\">"; $valx = ""; if ($default_theme == "default") { $valx = OW::getLanguage()->text('startpage', 'index'); } else { if ($default_theme == "twocolumn" or $default_theme == "2column_wlogin") { $valx = OW::getLanguage()->text('startpage', 'index_asguest'); // $indexp.="<span class=\"ow_button ow_positive\">"; } else { $valx = OW::getLanguage()->text('startpage', 'index'); } } $indexp .= "<span class=\"ow_button ow_positive\">"; $indexp .= "<span><input type=\"button\" value=\"" . $valx . "\" title=\"" . OW::getLanguage()->text('startpage', 'index') . "\" id=\"b_home\" class=\"ow_button ow_ic_house\" name=\"joinSubmit\"></span>"; $indexp .= "</span>"; if ($default_theme == "default") { // $indexp.="</span>"; } else { if ($default_theme == "twocolumn" or $default_theme == "2column_wlogin") { // $indexp.="</span>"; } } // $indexp .="</div>"; $indexp .= "</a>"; } $sql = "SELECT * FROM " . OW_DB_PREFIX . "base_menu_item WHERE type='bottom' AND (visibleFor='1' OR visibleFor='3') ORDER BY `order` "; $arr = OW::getDbo()->queryForList($sql); $num = 0; foreach ($arr as $value) { $rurl = ""; $target = ""; if ($value['documentKey'] and !$value['externalUrl'] and !$value['routePath']) { /* $sql2 = "SELECT * FROM " . OW_DB_PREFIX. "base_document WHERE `key`='".addslashes($value['documentKey'])."' LIMIT 1"; $arr2 = OW::getDbo()->queryForList($sql2); if (isset($arr2[0])){ $value2=$arr2[0]; */ $namx = OW::getLanguage()->text($value['prefix'], $value['key']); // $rurl=OW::getRouter()->urlForRoute($value2['uri']); $rurl = OW::getRouter()->urlForRoute($value['key']); if ($rurl) { if ($menup) { $menup .= " | "; } $menup .= "<a href=\"" . $rurl . "\" " . $target . ">" . $namx . "</a>"; } // } } else { if ($value['externalUrl']) { $rurl = $value['externalUrl']; } else { if ($value['routePath']) { $rurl = OW::getRouter()->urlForRoute($value['routePath']); } } if ($value['newWindow'] == 1) { $target = " target=\"_blank\""; } $namx = OW::getLanguage()->text($value['prefix'], $value['key']); if ($rurl) { if ($menup) { $menup .= " | "; } $menup .= "<a href=\"" . $rurl . "\" " . $target . ">" . $namx . "</a>"; } } //$this->redirect(OW::getRouter()->urlForRoute('contactus.admin')); } if ($menup) { $menup = "<div class=\"ow_footer_menu\" style=\"width:100%;margin:auto;\">" . $menup . "</div>"; } /* $indexp ="<div class=\"clearfix ow_center\" >"; // $indexp .="<div class=\"ow_right\" style=\"margin-right:10px;\"> $indexp .="<div class=\"ow_left\" style=\"margin-right:10px;\"> <span class=\"ow_button\"><span class=\" ow_button \">"; $indexp .="<a href=\"".$curent_url."index\">"; $indexp .="<input type=\"button\" value=\"".OW::getLanguage()->text('startpage', 'index')."\" id=\"input_79820058\" class=\"ow_button ow_ic_house\" name=\"joinSubmit\">"; $indexp .="</a>"; $indexp .="</span></span> </div> </div>"; */ if (OW::getPluginManager()->isPluginActive('fbconnect') and OW::getConfig()->getValue('fbconnect', 'app_id')) { $fbloginform = ""; //$fbloginform .="<div class=\"ow_left\"><a href=\"javascript:window.open('".$curent_url."facebook-connect/login?backUri=index','facebook','width = 500, height = 350');\" style=\"background:transparent;display:inline-block;width:82px;height:22px;position:absolute;z-index:999999;\"></a> $fbloginform .= "<div class=\"ow_left\"><a href=\"" . $curent_url . "facebook-connect/login?backUri=dashboard\" style=\"background:transparent;display:inline-block;width:82px;height:22px;position:absolute;z-index:78;\"></a>\n<div id=\"fb-root\"></div>\n<script>(function(d, s, id) {\n var js, fjs = d.getElementsByTagName(s)[0];\n if (d.getElementById(id)) return;\n js = d.createElement(s); js.id = id;\n js.src = \"//connect.facebook.net/en_US/all.js#xfbml=1&appId=" . OW::getConfig()->getValue('fbconnect', 'app_id') . "\";\n fjs.parentNode.insertBefore(js, fjs);\n}(document, 'script', 'facebook-jssdk'));\n</script>\n<div class=\"fb-login-button\" data-show-faces=\"false\" data-width=\"200\" data-max-rows=\"1\"></div>\n</div>"; //$fbloginform .="</a>"; } else { $fbloginform = ""; } $th = str_replace("[fbloginform]", $fbloginform, $th); if (OW::getConfig()->getValue('startpage', 'show_gender') == "1") { $show_gender = "<tr class=\"ow_alt1 ow_tr_last\">\n <td class=\"ow_value\">\n<div class=\"tt_wrapper\">\n<label>" . OW::getLanguage()->text('startpage', 'sex_gender') . ":</label>\n <select class=\"withPlaceholder\" id=\"sex\" name=\"sex\"/>\n <option value=\"1\">" . OW::getLanguage()->text('startpage', 'sex_male') . "</option>\n <option value=\"2\">" . OW::getLanguage()->text('startpage', 'sex_female') . "</option>\n </seclec>\n <label class=\"tt_placeholder\" for=\"sex\">" . OW::getLanguage()->text('startpage', 'sex_gender') . "</label>\n</div>\n <div style=\"height:1px;\"></div>\n <span id=\"input_sex_error\" style=\"display:none;\" class=\"error\"></span>\n </td>\n </tr>"; $th = str_replace("[show_gender]", $show_gender, $th); } else { $th = str_replace("[show_gender]", "", $th); } if (OW::getConfig()->getValue('startpage', 'show_realname') == "1") { $show_realname = "<tr class=\"ow_587953966575186054400185 ow_alt1 \">\n <td class=\"ow_value\">\n<div class=\"tt_wrapper\">\n <input class=\"withPlaceholder sp_require_text\" type=\"text\" id=\"muname\" name=\"f_muname\" />\n <label class=\"tt_placeholder\" for=\"muname\">" . OW::getLanguage()->text('startpage', 'musername') . "</label>\n</div>\n <div style=\"height:1px;\"></div>\n <span id=\"input_musername_error\" style=\"display:none;\" class=\"error\"></span>\n </td>\n </tr>"; $th = str_replace("[show_realname]", $show_realname, $th); } else { $th = str_replace("[show_realname]", "", $th); } if (OW::getConfig()->getValue('startpage', 'show_eage') == "1") { $show_eage = "<tr class=\"ow_587953966575186054400185 ow_alt1 \">\n <td class=\"ow_value\">\n<div class=\"clearfix\">\n<label>" . OW::getLanguage()->text('startpage', 'eage') . ":</label>\n</div>\n\n<div class=\"tt_wrapper\" style=\"float:left;margin-right:10px;\">\n\n <input class=\"withPlaceholder sp_require_text\" type=\"text\" id=\"eage_d\" name=\"eage_d\" style=\"max-width:70px;\"/>\n <label class=\"tt_placeholder\" for=\"eage_d\">" . OW::getLanguage()->text('startpage', 'show_eage_d') . "</label>\n</div>\n\n<div class=\"tt_wrapper\" style=\"float:left;margin-right:10px;\">\n <input class=\"withPlaceholder sp_require_text\" type=\"text\" id=\"eage_m\" name=\"eage_m\" style=\"max-width:70px;\"/>\n <label class=\"tt_placeholder\" for=\"eage_m\">" . OW::getLanguage()->text('startpage', 'show_eage_m') . "</label>\n</div>\n\n<div class=\"tt_wrapper\" style=\"float:left;margin-right:10px;\">\n <input class=\"withPlaceholder sp_require_text\" type=\"text\" id=\"eage_y\" name=\"eage_y\" style=\"max-width:70px;\"/>\n <label class=\"tt_placeholder\" for=\"eage_y\">" . OW::getLanguage()->text('startpage', 'show_eage_y') . "</label>\n</div>\n <div style=\"height:1px;\"></div>\n <span id=\"input_musername_error\" style=\"display:none;\" class=\"error\"></span>\n </td>\n </tr>"; $th = str_replace("[show_eage]", $show_eage, $th); } else { $th = str_replace("[show_eage]", "", $th); } $th = str_replace("[translate_musername]", OW::getLanguage()->text('startpage', 'musername'), $th); $th = str_replace("[translate_username]", OW::getLanguage()->text('startpage', 'username'), $th); $th = str_replace("[translate_email]", OW::getLanguage()->text('startpage', 'email'), $th); $th = str_replace("[translate_password]", OW::getLanguage()->text('startpage', 'password'), $th); $th = str_replace("[translate_password_retype]", OW::getLanguage()->text('startpage', 'password_retype'), $th); $th = str_replace("[translate_registertitle]", OW::getLanguage()->text('startpage', 'register_title'), $th); //$th=str_replace("[translate_accounttype]",OW::getLanguage()->text('startpage', 'account_type'),$th); $th = str_replace("[translate_sex_male]", OW::getLanguage()->text('startpage', 'sex_male'), $th); $th = str_replace("[translate_sex_female]", OW::getLanguage()->text('startpage', 'sex_female'), $th); $th = str_replace("[translate_sex_retype]", OW::getLanguage()->text('startpage', 'sex_gender'), $th); ////echo "AfDSF";exit; // $th=str_replace("[translate_upload_avatar]",OW::getLanguage()->text('startpage', 'select_avatar'),$th); // $th=str_replace("[translate_upload]",OW::getLanguage()->text('startpage', 'upload_avatar'),$th); if (OW::getConfig()->getValue('startpage', 'allow_upload_avatar') == "1") { $upav = "<tr class=\"ow_tr_first\"><th >" . OW::getLanguage()->text('startpage', 'select_avatar') . "</th></tr> \n <tr class=\"ow_alt1 ow_tr_last\">\n <td class=\"ow_value\" style=\"text-align:center;\">\n<div id=\"av_thumn\" uploaded=\"er\" style=\"width:150px;height:150px;border:1px solid #ddd;background-repeat: no-repeat;background-position: center center;display:none;background-color:#fff;position: absolute;z-index:50;margin-left: -160px;margin-top: -91px;\"></div>\n<input id=\"fileToUpload\" type=\"file\" size=\"\" name=\"fileToUpload\" accept=\"image/gif,image/png,image/jpeg,image/x-png\" class=\"input\" style=\"max-width:150px;\">\n<button class=\"button\" id=\"buttonUpload\" onclick=\"return ajaxFileUpload();\">" . OW::getLanguage()->text('startpage', 'upload_avatar') . "</button>\n </td>\n </tr>"; $th = str_replace("[ttuploadav]", $upav, $th); } else { $th = str_replace("[ttuploadav]", "<div id=\"av_thumn\" uploaded=\"yok\"></div>", $th); } $captha = ""; if (OW::getConfig()->getValue('startpage', 'allow_show_captha') == "1") { $captha .= "<tr class=\"ow_tr_first \"><th >" . OW::getLanguage()->text('startpage', 'retype_catcha') . "</th></tr>"; $img_fromtheme = $curent_url . "ow_static/themes/" . OW::getConfig()->getValue('base', 'selectedTheme') . "/images/ic_refresh.png"; // $captha .="<tr><td id=\"captcha_image\" colspan=\"2\" style=\"text-align:center;\"><img id=\"capthaimagex\" src=\"".$curent_url."/base/captcha/index/\"> <a id=\"refreshcapthabutton\" href=\"javascript://\" onclick=\"window.location ='".$curent_url."start';\"><img src=\"".$img_fromtheme."\"></a></td></tr>"; $captha .= "<tr class=\"ow_alt1\"><td id=\"captcha_image\" colspan=\"2\" style=\"text-align:center;\"><a id=\"refreshcapthabutton\" href=\"javascript://\"><img id=\"capthaimagex\" src=\"" . $curent_url . "/base/captcha/index/\"> <img src=\"" . $img_fromtheme . "\"></a></td></tr>"; $captha .= "<tr class=\"ow_alt1 ow_tr_last\"><td id=\"captcha_retype\" class=\"ow_value\" style=\"text-align:center;\" colspan=\"2\" ><input type=\"text\" id=\"captha\" placeholder=\"" . OW::getLanguage()->text('startpage', 'retype_catcha') . "\" name=\"captha\" value=\"\"></td></tr>"; $th = str_replace("[ttcaptha]", $captha, $th); } else { $th = str_replace("[ttcaptha]", "", $th); } $ttagree_nwsletter = ""; if (OW::getConfig()->getValue('startpage', 'show_agree_newsletter') == "1") { $ttagree_nwsletter .= "<tr class=\"ow_tr_first\"><th >" . OW::getLanguage()->text('startpage', 'agree_therm') . "</th></tr> \n <tr class=\"ow_alt1 ow_tr_last\">\n <td id=\"td_agree_newsletter\" class=\"ow_value\" style=\"text-align:left;\">\n<input checked type=\"checkbox\" name=\"agree_newsletter\" id=\"agree_newsletter\" value=\"1\"> " . OW::getLanguage()->text('startpage', 'agree_newsletter') . "\n </td>\n </tr>"; } if (OW::getConfig()->getValue('startpage', 'show_agree_therm_of_use') == "1") { if (OW::getConfig()->getValue('startpage', 'therm_of_use_url')) { $turl = OW::getConfig()->getValue('startpage', 'therm_of_use_url'); } else { $turl = $curent_url . "terms-of-use"; } $ttagree_nwsletter .= "<tr class=\"ow_alt1 ow_tr_last\">\n <td id=\"td_agree_therm_of_use\" class=\"ow_value\" style=\"text-align:left;\">\n<input checked type=\"checkbox\" name=\"agree_therm_of_use\" id=\"agree_therm_of_use\" value=\"1\"> <a href=\"" . $turl . "\" target=\"_blank\">" . OW::getLanguage()->text('startpage', 'agree_therm_of_use') . "</a>\n </td>\n </tr>"; } if ($ttagree_nwsletter) { $th = str_replace("[ttagree_nwsletter]", $ttagree_nwsletter, $th); } else { $th = str_replace("[ttagree_nwsletter]", "", $th); } //if ( /* OW::getConfig()->addConfig('fbconnect', 'api_key', '', 'Facebook Api Key'); OW::getConfig()->addConfig('fbconnect', 'app_id', '', 'Facebook Application ID'); OW::getConfig()->addConfig('fbconnect', 'api_secret', '', 'Facebook Application Secret'); OW::getConfig()->addConfig('fbconnect', 'allow_synchronize', 0, 'Allow synchronization for non-Facebook profiles'); */ /* if ( OW::getPluginManager()->isPluginActive('fbconnect')){ $api_key=OW::getConfig()->getValue('fbconnect', 'api_key'); $app_id=OW::getConfig()->getValue('fbconnect', 'app_id'); $api_secret=OW::getConfig()->getValue('fbconnect', 'api_secret'); $allow_synchronize=OW::getConfig()->getValue('fbconnect', 'allow_synchronize'); $fbc="<div class=\"fb-login-button\" data-show-faces=\"false\" data-width=\"200\" data-max-rows=\"1\" ></div>"; $th=str_replace("[fbconnect]",$fbc,$th); }else{ $th=str_replace("[tturl]","",$th); } */ $loginform = "\n<form id=\"form_login\" method=\"post\" action=\"\" name=\"sign-in\">\n<input name=\"form_name\" id=\"form_login\" value=\"sign-in\" type=\"hidden\">\n<input name=\"ss\" id=\"form_ss\" value=\"" . substr(session_id(), 2, 5) . "\" type=\"hidden\">\n<input name=\"remember\" id=\"form_login_rm\" value=\"on\" type=\"hidden\">\n\n <div class=\"clearfix\" style=\"margin-top:5px;\"\\>\n <div class=\"ow_user_name\" style=\"display: inline-block;\">\n <input name=\"identity\" id=\"identity\" placeholder=\"" . OW::getLanguage()->text('startpage', 'username_email') . "\" value=\"\" class=\"invitation\" type=\"text\">\n </div>\n <div class=\"ow_password\" style=\"display: inline-block;\">\n <input name=\"password\" id=\"password\" placeholder=\"" . OW::getLanguage()->text('startpage', 'password') . "\" value=\"\" class=\"invitation\" type=\"password\">\n </div>\n <div class=\"ow_form_options\" style=\"display: inline-block;\">\n <span class=\"ow_button ow_positive\"><span><input value=\"" . OW::getLanguage()->text('startpage', 'login') . "\" id=\"login_submit\" class=\"ow_positive\" name=\"submit\" type=\"submit\"></span></span>\n </div>\n </div>\n\n</form>\n"; $th = str_replace("[tturl]", $curent_url, $th); $th = str_replace("[tt_ss]", substr(session_id(), 3, 5), $th); $th = str_replace("[tttoplogo]", $logo, $th); $th = str_replace("[ttform]", $loginform, $th); $th = str_replace("[ttalertlform]", STARTPAGE_BOL_Service::getInstance()->corect_for_java(OW::getLanguage()->text('startpage', 'enterloginandpasswword')), $th); $th = str_replace("[ttmenu]", $menup, $th); $th = str_replace("[ttindexbutton]", $indexp, $th); $ttforgetpassword = ""; $ttforgetpassword .= "<a href=\"" . $curent_url . "forgot-password\">"; $ttforgetpassword .= "<span class=\"ow_button ow_positive\"><span>"; $ttforgetpassword .= "<input type=\"button\" value=\"" . OW::getLanguage()->text('startpage', 'forgot_password') . "\" title=\"" . OW::getLanguage()->text('startpage', 'forgot_password') . "\" id=\"b_forgot_password\" class=\"ow_button ow_ic_house\" name=\"sdfsdfsdf\">"; $ttforgetpassword .= "</span></span>"; $ttforgetpassword .= "</a>"; // $ttforgetpassword=$indexp; /* $ttforgetpassword=""; $ttforgetpassword .="<span class=\"ow_button\">"; $ttforgetpassword .="<a href=\"".$curent_url."forgot-password\" >"; $ttforgetpassword .="<input type=\"button\" value=\"".OW::getLanguage()->text('startpage', 'forgot_password')."\" id=\"b_forget\" class=\"ow_button ow_ic_submit\" name=\"Forget\">"; // $ttforgetpassword .="<input type=\"button\" value=\"Wejdź jako Gość\" title=\"Start\" id=\"b_home\" class=\"ow_button ow_ic_house\" name=\"joinSubmit\" />"; $ttforgetpassword .="</a>"; $ttforgetpassword .="</span>"; */ $th = str_replace("[ttforgetpassword]", $ttforgetpassword, $th); if ($default_theme == "2column_wlogin") { $th = str_replace("[ttloginbutton]", "", $th); $th = str_replace("[ttloginbutton2]", "", $th); } else { $th = str_replace("[ttloginbutton]", $login, $th); $th = str_replace("[ttloginbutton2]", $login2, $th); } $th = str_replace("[ttregisterbutton]", $register, $th); if (OW::getConfig()->getValue('startpage', 'theme_header_backgroundcolor')) { $th = str_replace("[tt_header_bc]", "background-color:" . OW::getConfig()->getValue('startpage', 'theme_header_backgroundcolor') . ";", $th); } else { $th = str_replace("[tt_header_bc]", "", $th); } if (OW::getConfig()->getValue('startpage', 'theme_center_column')) { $th = str_replace("[tt_center_content]", OW::getConfig()->getValue('startpage', 'theme_center_column'), $th); } else { $th = str_replace("[tt_center_content]", OW::getLanguage()->text('startpage', 'content_center_column'), $th); } if (OW::getConfig()->getValue('startpage', 'theme_slogan')) { $th = str_replace("[tt_slogan]", OW::getConfig()->getValue('startpage', 'theme_slogan'), $th); } else { $th = str_replace("[tt_slogan]", OW::getLanguage()->text('startpage', 'default_slogan'), $th); } if (OW::getConfig()->getValue('startpage', 'theme_slogan_desc')) { $th = str_replace("[tt_slogan_desc]", OW::getConfig()->getValue('startpage', 'theme_slogan_desc'), $th); } else { $th = str_replace("[tt_slogan_desc]", OW::getLanguage()->text('startpage', 'default_slogan_desc'), $th); } if (OW::getConfig()->getValue('startpage', 'theme_header_height')) { $th = str_replace("[tt_header_height]", OW::getConfig()->getValue('startpage', 'theme_header_height'), $th); } else { $th = str_replace("[tt_header_height]", "64px", $th); } if (OW::getConfig()->getValue('startpage', 'theme_header_width')) { $th = str_replace("[tt_header_width]", OW::getConfig()->getValue('startpage', 'theme_header_width'), $th); } else { $th = str_replace("[tt_header_width]", "100%", $th); } if (OW::getPluginManager()->isPluginActive('mobille') and MOBILLE_BOL_Service::getInstance()->is_file_application()) { $content_x = "<div style=\"clearfix\" style=\"font-weigfht:bold;text-align:left;\"><a href=\"" . $curent_url . "mobile/downloadapplication\"><div id=\"mobile_qrcode_download\" style=\"float:left;margin:10px;display:inline-block;\"></div><div style=\"float:left;margin-top:25px;display:inline-block;\">Download for Android OS</div></a></div>"; $th = str_replace("[download_mobile_version]", $content_x, $th); } else { $th = str_replace("[download_mobile_version]", "", $th); } $act = ""; $act_first = ""; $sql = "SELECT * FROM " . OW_DB_PREFIX . "base_question_account_type ORDER BY `sortOrder` "; $arr = OW::getDbo()->queryForList($sql); $num = 0; foreach ($arr as $value) { //ow_base_document // $sql2 = "SELECT * FROM " . OW_DB_PREFIX. "base_language_key WHERE "; // $arr2 = OW::getDbo()->queryForList($sql2); // $act .="<option value=\"".$value['name']."\">".OW::getLanguage()->text('base', 'content_center_column')."</option>"; $act .= "<option value=\"" . $value['name'] . "\">" . OW::getLanguage()->text('base', 'questions_account_type_' . $value['name']) . "</option>"; if (!$act_first) { $act_first = "<input type=\"hidden\" name=\"accountType\" id=\"input_actype\" value=\"" . $value['name'] . "\">"; if (OW::getConfig()->getValue('startpage', 'hide_accouttype')) { break; } } $num = $num + 1; } $act_f = ""; if (OW::getConfig()->getValue('startpage', 'hide_accouttype') and $act_first and $act) { $th = str_replace("[tt_fhiden]", $act_first, $th); } else { if ($act) { $act_f = "<tr class=\"ow_alt1 ow_tr_first ow_tr_last\">\n <td class=\"ow_value ow_center\">\n<div class=\"ow_label\">\n<label for=\"input_30125731\">" . OW::getLanguage()->text('startpage', 'account_type') . "</label>\n</div>\n <select name=\"accountType\" id=\"input_actype\">\n " . $act . "\n </select>\n <div style=\"height:1px;\"></div>\n <span id=\"input_30125731_error\" style=\"display:none;\" class=\"error\"></span>\n </td>\n </tr>"; $th = str_replace("[tt_fhiden]", "", $th); } else { $act_f = "<tr class=\"ow_alt1 ow_tr_first ow_tr_last\">\n <td class=\"ow_value ow_center\">\n<div class=\"ow_label\">\n<label for=\"input_30125731\">" . OW::getLanguage()->text('startpage', 'problem_with_accout_type') . "</label>\n</div>\n <div style=\"height:1px;\"></div>\n <span id=\"input_30125731_error\" style=\"display:none;\" class=\"error\"></span>\n </td>\n </tr>"; $th = str_replace("[tt_fhiden]", "", $th); } } $th = str_replace("[tt_act]", $act_f, $th); //ow_static/plugins/base/css/images/flags/NL.png //---fls $flg = ""; $sql = "SELECT * FROM " . OW_DB_PREFIX . "base_language WHERE status='active' ORDER BY `order` "; //if (OW::getConfig()->getValue('startpage', 'show_small_startpage_list')=="1"){ $arr = OW::getDbo()->queryForList($sql); foreach ($arr as $value) { $fn = ""; $fn_tmp = explode("-", $value['tag']); if (isset($fn_tmp[0])) { $fn_tmp2 = explode("_", $fn_tmp[0]); if (isset($fn_tmp2[0])) { $fn = $fn_tmp2[0]; } else { $fn = $fn_tmp[0]; } } else { $fn = $fn_tmp[0]; } if ($fn) { $fn = strtoupper($fn); if ($fn == "EN") { $fn = "US"; } // $flg .="<a href=\"javascript:void(0);\" onclick=\"location.href='".$curent_url."join?language_id=".$value['id']."';\" title=\"".$value['label']."\">"; $flg .= "<a href=\"javascript:void(0);\" onclick=\"location.href='" . $curent_url . "start?language_id=" . $value['id'] . "';\" title=\"" . $value['label'] . "\">"; $flg .= "<img src=\"" . $curent_url . "ow_static/plugins/base/css/images/flags/" . $fn . ".png\" >"; $flg .= "</a>"; } } $th = str_replace("[tt_flg]", $flg, $th); if (OW::getConfig()->getValue('startpage', 'try_use_mytheme') == "1") { $text_color_style = ""; $text_color_style2 = ""; } else { $text_color_style = "color: #464646;"; $text_color_style2 = "color:#777777;"; } $th = str_replace("[tt_text_color_style]", $text_color_style, $th); $th = str_replace("[tt_text_color_style2]", $text_color_style2, $th); //---fle //$type="pl-PL"; //echo BOL_FlagService::getInstance()->findLangKey($type);exit; echo $th; //if () if (OW::getConfig()->getValue('startpage', 'try_use_mytheme') == "1") { $bg_content_color = ""; $border_content_color = ""; } else { $bg_content_color = "background: #fff;"; $border_content_color = "border: 1px solid #e7e7e7;"; } $add_style = "\n<style>\n#tt_form{\nmargin: 8px;\n/*padding: 40px 40px 22px 40px;*/\npadding: 20px 20px 12px 20px;\n" . $bg_content_color . "\n-moz-border-radius: 5px;\n-webkit-border-radius: 5px;\n-khtml-border-radius: 5px;\nborder-radius: 5px;\n-webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);\n-moz-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);\nbox-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);\n" . $border_content_color . "\n}\n</style>\n"; echo $add_style; //OW::getDocument()->appendBody($add_style); //----footer $th = file_get_contents($pluginStaticD . "join_footer.html"); echo $th; // echo UTIL_Url::selfUrl(); //OW::getDocument()->setTemplate(OW::getThemeManager()->getMasterPageTemplate(self::TEMPLATE_BLANK)); //OW::getDocument()->setTemplate(OW::getThemeManager()->getMasterPageTemplate('club')); exit; }
public function index($param) { if (!OW::getUser()->isAuthenticated()) { exit; } $smile = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley.gif\">"; $cool = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-cool.gif\">"; $confused = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-confused.gif\">"; $cry = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-cry.gif\">"; $lol = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-lol.gif\">"; $mad = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-mad.gif\">"; $neutral = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-neutral.gif\">"; $razz = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-razz.gif\">"; $sad = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-sad.gif\">"; $shock = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-surprise.gif\">"; $wink = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-wink.gif\">"; $thumbsup = "<img style=\"height: 61px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugin/chatrooms/smilies/cool.gif\">"; $bash = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-bash.gif\">"; $censored = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-censored.gif\">"; $santa = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-santa.gif\">"; $shy = "<img style=\"height: 20px; width: 20px;\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/smilies/smiley-shy.gif\">"; $content = ""; $is_admin = false; if (OW::getUser()->isAdmin()) { $is_admin = true; $content .= "<script type=\"text/javascript\" src=\"" . OW_URL_HOME . "ow_static/plugins/chatrooms/jquery.contextmenu.js\"></script>"; } $no_avatar = OW_URL_HOME . "ow_static/themes/" . OW::getConfig()->getValue('base', 'selectedTheme') . "/images/no-avatar.png"; $user = OW::getUser()->getId(); $user_service = BOL_UserService::getInstance(); $avat_service = BOL_AvatarService::getInstance(); $chats = ""; $chat_id = $param['chat']; if ($chat_id == "" or $chat_id <= 0 or $chat_id >= 6 or !is_numeric($chat_id)) { $chat_id = 1; } //check for blocked status $now = time(); $sql = "SELECT block_id,reason FROM " . OW_DB_PREFIX . "superfeed_user_blocked WHERE user_id='{$user}' AND (room_id = '{$chat_id}' OR room_id = '*') LIMIT 1"; $query_data = OW::getDbo()->queryForList($sql); $data = $query_data[0]; $block = $data['block_id']; $reason = $data['reason']; if ($block != "" or $reason != "") { $info = "You have been blocked from live chat (reason: {$reason})"; OW::getFeedback()->warning($info); OW::getApplication()->redirect(OW_URL_HOME); exit; } // GET LATEST CHAT COMMENTS $sql = "SHOW TABLE STATUS WHERE `Name` = '" . OW_DB_PREFIX . "super_feed_message'"; $query_data = OW::getDbo()->queryForList($sql); $latest = $query_data[0]['Auto_increment']; $now = time(); $sql = "DELETE FROM " . OW_DB_PREFIX . "superfeed_chat_users WHERE userId='{$user}' LIMIT 1;\n INSERT INTO " . OW_DB_PREFIX . "superfeed_chat_users VALUES(null,'{$user}','{$chat_id}','{$now}');\n "; OW::getDbo()->query($sql); $displayname = $user_service->getDisplayName($user); $now = time(); $msg = "{$displayname} has joined the room!"; $sql = "INSERT INTO " . OW_DB_PREFIX . "super_feed_message VALUES(null,'{$chat_id}','{$user}','{$msg}', {$now},'userjoin')"; OW::getDbo()->insert($sql); // END GET LATEST CHAT COMMENTS // GET PEOPLE IN CHAT $totpeople = ""; $users_in_chat = ""; $then = strtotime("-2 Minute"); $sql = "SELECT userId FROM " . OW_DB_PREFIX . "superfeed_chat_users WHERE chatId='{$chat_id}' AND LastUpdate >= {$then}"; $query_data = OW::getDbo()->queryForList($sql); foreach ($query_data as $users) { $totpeople = intval($totpeople) + 1; //added to get total chatters $userIdx = $users['userId']; $displayname = $user_service->getDisplayName($userIdx); $displayimage = $avat_service->getAvatarUrl($userIdx); if (!$displayimage) { $displayimage = $no_avatar; } $users_in_chat .= "\n <div style=\"padding-bottom:5px;\"><img style=\"width:24px;height:24px;vertical-align:middle\" src=\"{$displayimage}\"> <span id=\"{$userIdx}\" class=\"userblock\" style=\"\">{$displayname}</span></div>\n "; } // END GET PEOPLE IN CHAT if ($latest == "") { $latest = 0; } $s1 = ""; $s2 = ""; $s3 = ""; $s4 = ""; $s5 = ""; $title1 = OW::getConfig()->getValue('chatrooms', 'chat_1_title'); if ($title1 == "") { $title1 = "Chat 1"; } $title2 = OW::getConfig()->getValue('chatrooms', 'chat_2_title'); if ($title2 == "") { $title2 = "Chat 2"; } $title3 = OW::getConfig()->getValue('chatrooms', 'chat_3_title'); if ($title3 == "") { $title3 = "Chat 3"; } $title4 = OW::getConfig()->getValue('chatrooms', 'chat_4_title'); if ($title4 == "") { $title4 = "Chat 4"; } $title5 = OW::getConfig()->getValue('chatrooms', 'chat_5_title'); if ($title5 == "") { $title5 = "Chat 5"; } if ($chat_id == "1") { $s1 = "active"; } if ($chat_id == "2") { $s2 = "active"; } if ($chat_id == "3") { $s3 = "active"; } if ($chat_id == "4") { $s4 = "active"; } if ($chat_id == "5") { $s5 = "active"; } $content .= "<div class=\"ow_content_menu_wrap\">\n<ul class=\"ow_content_menu clearfix\">\n <li class=\"_recent {$s1}\"><a href=\"" . OW_URL_HOME . "chatrooms/1\"><span class=\"ow_ic_files\">{$title1}</span></a></li>\n <li class=\"_recent {$s2}\"><a href=\"" . OW_URL_HOME . "chatrooms/2\"><span class=\"ow_ic_files\">{$title2}</span></a></li>\n <li class=\"_recent {$s3}\"><a href=\"" . OW_URL_HOME . "chatrooms/3\"><span class=\"ow_ic_files\">{$title3}</span></a></li>\n <li class=\"_recent {$s4}\"><a href=\"" . OW_URL_HOME . "chatrooms/4\"><span class=\"ow_ic_files\">{$title4}</span></a></li>\n <li class=\"_recent {$s5}\"><a href=\"" . OW_URL_HOME . "chatrooms/5\"><span class=\"ow_ic_files\">{$title5}</span></a></li>\n"; if (OW::getUser()->isAdmin()) { $content .= " <li class=\"_recent \"><a href=\"" . OW_URL_HOME . "chatrooms/admin/setup\"><span class=\"ow_ic_files\">Setup</span></a></li> "; } $content .= "</ul><br>\n\tTotal Chat Users(all rooms) = {$totpeople} <br>\n\t<b>Smilies:</b> :) , :( , :*( , :D , :p , :o , :x , ;) , B-) , :|\n</div>\n\n\n"; $chat_refresh = OW::getConfig()->getValue('chatrooms', 'chat_newmsg_check'); $user_refresh = OW::getConfig()->getValue('chatrooms', 'chat_userlist_refresh'); $user_list_script = "\n<script>\n\t\t window.setInterval(function(){\n\t\t var latest = \$('#lastids').text();\n\n\t\t \$.ajax({\n\t\t \n\t\t type : 'POST',\n cache : false,\n url : '" . OW_URL_HOME . "chatrooms/getuser/{$chat_id}',\n data : 'latest=' + latest,\n success : function(data) {\n \n var returndata = data.split('-xUSERx-');\n \n var html = '';\n for (var i = 0; i < returndata.length; i++) \n {\n var msgdata = returndata[i].split(':data:');\n var usern = msgdata[0];\n var useri = msgdata[1];\n var userid = msgdata[2];\n\n if(usern != '') \n {\n var newhtml = '<div style=\\'padding-bottom:10px;\\'><img style=\\'width:24px;height:24px;vertical-align:middle\\' src=\\''+useri+'\\'><span id=\\''+userid+'\\' class=\\'userblock\\' style=\\'\\'> '+usern+'</span></div>';\n html += newhtml;\n \n }\n }\n \n \n \$('#div_user').html(html);\n }\n\t\t \n\t\t \n\t\t });\n\t\t \n\t\t },{$user_refresh} );\n\t\t</script>\n\t\t"; $content .= "\n<script type='text/javascript' src='" . OW_URL_HOME . "ow_static/plugins/chatrooms/scroll.js'></script>\n<style type=\"text/css\" media=\"screen\">\n\t\t\t.chat_time {\n\t\t\t\tfont-style: italic;\n\t\t\t\tfont-size: 9px;\n\t\t\t}\n\t\t</style>\n\t\t\n\t\t\n\t\t<script>\n\t\tvar lastmsg = 0;\n\t\tfunction ChatMsg() {\n \$.ajax({type:'POST', url: '" . OW_URL_HOME . "chatrooms/chat/{$chat_id}', data:\$('#frmmain').serialize(), success: function(response) {\n \n var returndata = response.split('::');\n \n var status = returndata[0];\n var userdn = returndata[1];\n var usermg = returndata[2];\n var posttd = returndata[3];\n \n if(status == 'BLOCKED')\n {\n \n var html='<div><b>You have been blocked from this chat</b></div>';\n \$('#div_chat').append(html);\n \$('#txt_message').val('');\n \$('#div_chat').scrollTo('max', {axis: 'y'});\n }\n \n if(status == 'POSTED')\n {\n \n var html = '<div><b>'+userdn+'</b>: '+usermg+'</div>';\n \n \$('#div_chat').append(html);\n \$('#txt_message').val('');\n \$('#div_chat').scrollTo('max', {axis: 'y'});\n }\n \n \n \n }});\n\n return false;\n}\n\t\t</script>\n\t\t<script>\n\t\t\n\t\t\n\t\t window.setInterval(function(){\n\t\t var latest = \$('#lastids').text();\n\n\t\t \$.ajax({\n\t\t \n\t\t type : 'POST',\n cache : false,\n url : '" . OW_URL_HOME . "chatrooms/getchat/{$chat_id}',\n data : 'latest=' + latest,\n success : function(data) {\n \n var returndata = data.split(':NEWMSGSTARTER:');\n \n for (var i = 1; i < returndata.length; i++) \n {\n var msgdata = returndata[i].split('-cmdx-');\n \n var usid = msgdata[0];\n var disn = msgdata[1];\n var msgx = msgdata[2];\n var tdst = msgdata[3];\n var lstid = msgdata[4];\n var msgtype = msgdata[5];\n \n if(msgtype == 'usermsg') { var html = '<div><b>'+disn+'</b>: '+msgx+'</div>'; }\n if(msgtype == 'userjoin') { var html = '<div><i>'+msgx+'</i></div>'; }\n \n \$('#div_chat').append(html);\n \n \$('#div_chat').scrollTo('max', {axis: 'y'});\n }\n \n \$('#lastids').text(lstid);\n \$('#div_chat').scrollTo('max', {axis: 'y'});\n \n }\n\t\t \n\t\t \n\t\t });\n\t\t \n\t\t },{$chat_refresh});\n\t\t</script>\n\t\t\n\t\t{$user_list_script}\n\t\t\n\t</head>\n\t<body onload=\"\">\n\t <div style=\"float: center; width: 100%;\">\n\t\t<div id=\"div_chat\" style=\"float: left; height: 300px; width: 620px; overflow: auto; background-color: #CCCCCC; border: 1px solid #555555; color: #000000\">{$chat}</div>\n\t\t<div id=\"div_user\" style=\"float: right; height: 300px; width: 150px; overflow: auto; background-color: #CCCCCC; border: 1px solid #555555; color: #000000\">{$users_in_chat}</div>\n\t\t</div>\n\t\t<form id=\"frmmain\" name=\"frmmain\" onsubmit=\"return ChatMsg();\">\n\t\t\t<input type=\"text\" id=\"txt_message\" name=\"txt_message\" style=\"width: 525px;\" autocomplete=\"off\" />\n\t\t\t<span class=\"ow_button\"><span class=\" ow_button ow_ic_save\"><input type=\"submit\" name=\"btn_send_chat\" id=\"btn_send_chat\" value=\"Send\" /></span></span>\n\t\t</form>\n\t\t<div id=\"lastids\" class=\"lastids\" style=\"display: none; visibility: hidden\">{$latest}</div>\n\t\t\n\n"; if ($is_admin == true) { $content .= "<script>\n\$(\".userblock\").live(\"click\", function() {\n var dataid = \$(this).attr('id');\n var xx = confirm('Block User from chat system?');\n \n if(xx == true)\n {\n \n var why = prompt(\"Reason for block\");\n var chat = " . $chat_id . ";\n var time = 999999;\n \n\n \n \$.ajax({\n type : \"POST\",\n cache : false,\n url : \"" . OW_URL_HOME . "chatrooms/admin/setup/block\",\n data : \"data=\"+ \$(this).attr('id') + \"&reason=\"+why+\"&time=\"+time+\"&room=\"+chat,\n success : function(datax) {\n \n if(datax == 'BLOCKED')\n {\n window.OW.info(\"User has been blocked\"); \n }\n }\n \n });\n return false;\n }\n});\n</script>\n"; } $content .= "\n\n<script>\n\$(document).ready(function(){\n window.onbeforeunload = function(){\n var chat = " . $chat_id . ";\n \$.ajax({\n type: 'POST',\n async: false,\n url: '" . OW_URL_HOME . "chatrooms/bye/bye',\n data: \"room=\"+chat\n\n});\n\n }\n});\n</script>\n\n"; $this->assign("content", $content); }
public function uninstall() { $config = OW::getConfig(); if (!$config->configExists('groups', 'uninstall_inprogress')) { $config->addConfig('groups', 'uninstall_inprogress', 0); } if (isset($_POST['action']) && $_POST['action'] == 'delete_content') { $config->saveConfig('groups', 'uninstall_inprogress', 1); OW::getFeedback()->info(OW::getLanguage()->text('groups', 'plugin_set_for_uninstall')); OW::getApplication()->setMaintenanceMode(true); $this->redirect(); } $this->setPageHeading(OW::getLanguage()->text('groups', 'page_title_uninstall')); $this->setPageHeadingIconClass('ow_ic_delete'); $inprogress = $config->getValue('groups', 'uninstall_inprogress'); $this->assign('inprogress', $inprogress); $js = new UTIL_JsGenerator(); $js->jQueryEvent('#btn-delete-content', 'click', 'if ( !confirm("' . OW::getLanguage()->text('groups', 'confirm_delete_groups') . '") ) return false;'); OW::getDocument()->addOnloadScript($js); }
public function coreUpdate() { $this->checkXP(); if (!(bool) OW::getConfig()->getValue('base', 'update_soft')) { throw new Redirect404Exception(); } $language = OW::getLanguage(); $archivePath = OW_DIR_PLUGINFILES . 'ow' . DS . 'core.zip'; $tempDir = OW_DIR_PLUGINFILES . 'ow' . DS . 'core' . DS; $ftp = $this->getFtpConnection(); $errorMessage = false; OW::getApplication()->setMaintenanceMode(true); $this->pluginService->downloadCore($archivePath); if (!file_exists($archivePath)) { $errorMessage = $language->text('admin', 'core_update_download_error'); } else { mkdir($tempDir); $zip = new ZipArchive(); $zopen = $zip->open($archivePath); if ($zopen === true) { $zip->extractTo($tempDir); $zip->close(); $ftp->uploadDir($tempDir, OW_DIR_ROOT); $ftp->chmod(0777, OW_DIR_STATIC); $ftp->chmod(0777, OW_DIR_STATIC_PLUGIN); } else { $errorMessage = $language->text('admin', 'core_update_unzip_error'); } } if (file_exists($tempDir)) { UTIL_File::removeDir($tempDir); } if (file_exists($archivePath)) { unlink($archivePath); } if ($errorMessage !== false) { OW::getApplication()->setMaintenanceMode(false); OW::getFeedback()->error($errorMessage); $this->redirect(OW::getRouter()->urlFor('ADMIN_CTRL_Index', 'index')); } $this->redirect(OW_URL_HOME . 'ow_updates/index.php'); }
/** * Returns default avatar URL * * @param int $size * @return string */ public function getDefaultAvatarUrl($size = 1) { $custom = self::getCustomDefaultAvatarUrl($size); if ($custom != null) { return $custom; } // remove dirty check isMobile switch ($size) { case 1: return OW::getThemeManager()->getSelectedTheme()->getStaticImagesUrl(OW::getApplication()->isMobile()) . 'no-avatar.png'; case 2: return OW::getThemeManager()->getSelectedTheme()->getStaticImagesUrl(OW::getApplication()->isMobile()) . 'no-avatar-big.png'; } return null; }
public function __construct(array $params) { parent::__construct(); $this->forumService = FORUM_BOL_ForumService::getInstance(); if (!isset($params['groupId']) || !($groupId = (int) $params['groupId'])) { $this->setVisible(false); return; } $groupInfo = $this->forumService->getGroupInfo($groupId); if (!$groupInfo) { $this->setVisible(false); return; } $forumSection = $this->forumService->findSectionById($groupInfo->sectionId); if (!$forumSection) { $this->setVisible(false); return; } $isHidden = $forumSection->isHidden; $userId = OW::getUser()->getId(); if ($isHidden) { $isModerator = OW::getUser()->isAuthorized($forumSection->entity); $event = new OW_Event('forum.can_view', array('entity' => $forumSection->entity, 'entityId' => $groupInfo->entityId), true); OW::getEventManager()->trigger($event); $canView = $event->getData(); $eventParams = array('entity' => $forumSection->entity, 'entityId' => $groupInfo->entityId, 'action' => 'add_topic'); $event = new OW_Event('forum.check_permissions', $eventParams); OW::getEventManager()->trigger($event); $canEdit = $event->getData(); } else { $isModerator = OW::getUser()->isAuthorized('forum'); $canView = OW::getUser()->isAuthorized('forum', 'view'); $canEdit = OW::getUser()->isAuthorized('forum', 'edit'); $canEdit = $canEdit || $isModerator ? true : false; } if ($groupInfo->isPrivate) { if (!$userId) { $this->assign('authFailed', true); return; } else { if (!$isModerator) { if (!$this->forumService->isPrivateGroupAvailable($userId, json_decode($groupInfo->roles))) { $this->assign('authFailed', true); return; } } } } if (!$canView) { $this->assign('authFailed', true); return; } $page = !empty($_GET['page']) && (int) $_GET['page'] ? abs((int) $_GET['page']) : 1; if (!$groupInfo) { $forumUrl = OW::getRouter()->urlForRoute('forum-default'); OW::getApplication()->redirect($forumUrl); } $topicList = $this->forumService->getGroupTopicList($groupId, $page); $topicCount = $this->forumService->getGroupTopicCount($groupId); $userIds = array(); $topicIds = array(); foreach ($topicList as $topic) { array_push($topicIds, $topic['id']); if (isset($topic['lastPost']) && !in_array($topic['lastPost']['userId'], $userIds)) { array_push($userIds, $topic['lastPost']['userId']); } } $attachments = FORUM_BOL_PostAttachmentService::getInstance()->getAttachmentsCountByTopicIdList($topicIds); $this->assign('attachments', $attachments); $usernames = BOL_UserService::getInstance()->getUserNamesForList($userIds); $this->assign('usernames', $usernames); $displayNames = BOL_UserService::getInstance()->getDisplayNamesForList($userIds); $this->assign('displayNames', $displayNames); $perPage = $this->forumService->getTopicPerPageConfig(); $pageCount = $topicCount ? ceil($topicCount / $perPage) : 1; $paging = new BASE_CMP_Paging($page, $pageCount, $perPage); $this->assign('paging', $paging->render()); $addTopicUrl = OW::getRouter()->urlForRoute('add-topic', array('groupId' => $groupId)); $this->assign('addTopicUrl', $addTopicUrl); $this->assign('canEdit', $canEdit); $this->assign('groupId', $groupId); $this->assign('topicList', $topicList); $this->assign('isHidden', $isHidden); $showCaption = !empty($params['caption']) ? $params['caption'] : false; if ($showCaption) { $groupName = htmlspecialchars($groupInfo->name); OW::getDocument()->setHeading(OW::getLanguage()->text('forum', 'forum_page_heading', array('forum' => $groupName))); OW::getDocument()->setHeadingIconClass('ow_ic_forum'); OW::getDocument()->setTitle($groupName); OW::getDocument()->setDescription(OW::getLanguage()->text('forum', 'group_meta_description', array('group' => $groupName))); if ($isHidden) { $event = new OW_Event('forum.find_forum_caption', array('entity' => $forumSection->entity, 'entityId' => $groupInfo->entityId)); OW::getEventManager()->trigger($event); $eventData = $event->getData(); $componentForumCaption = $eventData['component']; if (!empty($componentForumCaption)) { $this->assign('componentForumCaption', $componentForumCaption->render()); } else { $componentForumCaption = false; $this->assign('componentForumCaption', $componentForumCaption); } OW::getNavigation()->deactivateMenuItems(OW_Navigation::MAIN); OW::getNavigation()->activateMenuItem(OW_Navigation::MAIN, $forumSection->entity, $eventData['key']); } else { $bcItems = array(array('href' => OW::getRouter()->urlForRoute('forum-default'), 'label' => OW::getLanguage()->text('forum', 'forum_index')), array('href' => OW::getRouter()->urlForRoute('section-default', array('sectionId' => $groupInfo->sectionId)), 'label' => $forumSection->name), array('label' => $groupInfo->name)); $breadCrumbCmp = new BASE_CMP_Breadcrumb($bcItems); $this->addComponent('breadcrumb', $breadCrumbCmp); } } $this->addComponent('search', new FORUM_CMP_ForumSearch(array('scope' => 'group', 'groupId' => $groupId))); $this->assign('showCaption', $showCaption); }
/** * Includes init script for provided plugin */ public function initPlugin(OW_Plugin $pluginObject) { $this->addPackagePointers($pluginObject->getDto()); $initDirPath = $pluginObject->getRootDir(); if (OW::getApplication()->getContext() == OW::CONTEXT_MOBILE) { $initDirPath = $pluginObject->getMobileDir(); } if (OW::getApplication()->getContext() == OW::CONTEXT_CLI) { $initDirPath = $pluginObject->getCliDir(); } else { if (OW::getApplication()->getContext() == OW::CONTEXT_API) { $initDirPath = $pluginObject->getApiDir(); } } OW::getEventManager()->trigger(new OW_Event("core.performance_test", array("key" => "plugin_init.start", "pluginKey" => $pluginObject->getKey()))); $this->pluginService->includeScript($initDirPath . BOL_PluginService::SCRIPT_INIT); OW::getEventManager()->trigger(new OW_Event("core.performance_test", array("key" => "plugin_init.end", "pluginKey" => $pluginObject->getKey()))); }
private function reloadParentPage() { $router = OW::getRouter(); OW::getApplication()->redirect(OW::getRequest()->buildUrlQueryString()); }
public function dept() { $content = ""; // $this->setPageTitle(OW::getLanguage()->text('search', 'admin_dept_title')); $this->setPageTitle(OW::getLanguage()->text('search', 'admin_dept_heading')); $this->setPageHeading(OW::getLanguage()->text('search', 'admin_dept_heading')); $id_user = OW::getUser()->getId(); //citent login user (uwner) $is_admin = OW::getUser()->isAdmin(); //iss admin $curent_url = OW_URL_HOME; $config = OW::getConfig(); $content = ""; if (!isset($_POST['save'])) { $_POST['save'] = ""; } if ($is_admin and $id_user > 0 and $_POST['save'] == "besave") { if ($_POST['c_horizontal_position'] != "") { $horizontal_position = $_POST['c_horizontal_position']; } else { $horizontal_position = -300; } $config->saveConfig('search', 'horizontal_position', $horizontal_position); if ($_POST['c_vertical_position'] != "") { $vertical_position = $_POST['c_vertical_position']; } else { $vertical_position = 0; } $config->saveConfig('search', 'vertical_position', $vertical_position); if (!$_POST['c_zindex_position']) { $zindex_position = 0; } else { $zindex_position = $_POST['c_zindex_position']; } $config->saveConfig('search', 'zindex_position', $zindex_position); if (OW::getPluginManager()->isPluginActive('adsense')) { $config->saveConfig('search', 'allow_ads_adsense', $_POST['c_allow_ads_adsense']); } if (OW::getPluginManager()->isPluginActive('adspro')) { $config->saveConfig('search', 'allow_ads_adspro', $_POST['c_allow_ads_adspro']); } if (OW::getPluginManager()->isPluginActive('ads')) { $config->saveConfig('search', 'allow_ads_ads', $_POST['c_allow_ads_ads']); } $config->saveConfig('search', 'width_topsearchbar', $_POST['c_width_topsearchbar']); $config->saveConfig('search', 'height_topsearchbar', $_POST['c_height_topsearchbar']); $config->saveConfig('search', 'turn_off_topsearchbar', $_POST['c_turn_off_topsearchbar']); $config->saveConfig('search', 'hmanyitems_show_topsearchbarlist', $_POST['c_hmanyitems_show_topsearchbarlist']); $config->saveConfig('search', 'maxallitems_topsearchbarlist', $_POST['c_maxallitems_topsearchbarlist']); $config->saveConfig('search', 'search_force_users', $_POST['c_search_force_users']); $config->saveConfig('search', 'search_position', $_POST['c_search_position']); if (isset($_POST['c_turn_offplugin_cms'])) { $config->saveConfig('search', 'turn_offplugin_cms', $_POST['c_turn_offplugin_cms']); } if (isset($_POST['c_turn_offplugin_forum'])) { $config->saveConfig('search', 'turn_offplugin_forum', $_POST['c_turn_offplugin_forum']); } if (isset($_POST['c_turn_offplugin_links'])) { $config->saveConfig('search', 'turn_offplugin_links', $_POST['c_turn_offplugin_links']); } if (isset($_POST['c_turn_offplugin_video'])) { $config->saveConfig('search', 'turn_offplugin_video', $_POST['c_turn_offplugin_video']); } if (isset($_POST['c_turn_offplugin_photo'])) { $config->saveConfig('search', 'turn_offplugin_photo', $_POST['c_turn_offplugin_photo']); } if (isset($_POST['c_turn_offplugin_shoppro'])) { $config->saveConfig('search', 'turn_offplugin_shoppro', $_POST['c_turn_offplugin_shoppro']); } if (isset($_POST['c_turn_offplugin_classifiedspro'])) { $config->saveConfig('search', 'turn_offplugin_classifiedspro', $_POST['c_turn_offplugin_classifiedspro']); } if (isset($_POST['c_turn_offplugin_pages'])) { $config->saveConfig('search', 'turn_offplugin_pages', $_POST['c_turn_offplugin_pages']); } if (isset($_POST['c_turn_offplugin_groups'])) { $config->saveConfig('search', 'turn_offplugin_groups', $_POST['c_turn_offplugin_groups']); } if (isset($_POST['c_turn_offplugin_blogs'])) { $config->saveConfig('search', 'turn_offplugin_blogs', $_POST['c_turn_offplugin_blogs']); } if (isset($_POST['c_turn_offplugin_event'])) { $config->saveConfig('search', 'turn_offplugin_event', $_POST['c_turn_offplugin_event']); } if (isset($_POST['c_turn_offplugin_fanpage'])) { $config->saveConfig('search', 'turn_offplugin_fanpage', $_POST['c_turn_offplugin_fanpage']); } if (isset($_POST['c_turn_offplugin_html'])) { $config->saveConfig('search', 'turn_offplugin_html', $_POST['c_turn_offplugin_html']); } if (isset($_POST['c_turn_offplugin_games'])) { $config->saveConfig('search', 'turn_offplugin_games', $_POST['c_turn_offplugin_games']); } if (isset($_POST['c_turn_offplugin_adsense'])) { $config->saveConfig('search', 'turn_offplugin_adsense', $_POST['c_turn_offplugin_adsense']); } if (isset($_POST['c_turn_offplugin_mochigames'])) { $config->saveConfig('search', 'turn_offplugin_mochigames', $_POST['c_turn_offplugin_mochigames']); } if (isset($_POST['c_turn_offplugin_basepages'])) { $config->saveConfig('search', 'turn_offplugin_basepages', $_POST['c_turn_offplugin_basepages']); } if (isset($_POST['c_turn_offplugin_adspro'])) { $config->saveConfig('search', 'turn_offplugin_adspro', $_POST['c_turn_offplugin_adspro']); } if (isset($_POST['c_turn_offplugin_map'])) { $config->saveConfig('search', 'turn_offplugin_map', $_POST['c_turn_offplugin_map']); } if (isset($_POST['c_turn_offplugin_wiki'])) { $config->saveConfig('search', 'turn_offplugin_wiki', $_POST['c_turn_offplugin_wiki']); } if (isset($_POST['c_turn_offplugin_news'])) { $config->saveConfig('search', 'turn_offplugin_news', $_POST['c_turn_offplugin_news']); } $config->saveConfig('search', 'bg_results_topsearchbar', $_POST['c_bg_results_topsearchbar']); OW::getApplication()->redirect($curent_url . "admin/plugins/search"); } $content .= "<form action=\"" . $curent_url . "admin/plugins/search\" method=\"post\">"; $content .= "<input type=\"hidden\" name=\"save\" value=\"besave\">"; $content .= "<table style=\"width:auto;\">"; $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff') . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_off_topsearchbar'); $content .= "<select name=\"c_turn_off_topsearchbar\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_hmanyitems_showperplugin') . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'hmanyitems_show_topsearchbarlist'); $content .= "<input type=\"text\" name=\"c_hmanyitems_show_topsearchbarlist\" value=\"" . $mode . "\" style=\"display:inline-block;width:45px;text-align:center;font-weight:bold;\"> <b>def=6px, disable=0</b>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_maxalitemson_dropdownsearchbar') . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'maxallitems_topsearchbarlist'); $content .= "<input type=\"text\" name=\"c_maxallitems_topsearchbarlist\" value=\"" . $mode . "\" style=\"display:inline-block;width:45px;text-align:center;font-weight:bold;\"> <b>def=12</b>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_search_exactlybyusers') . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'search_force_users'); $content .= "<select name=\"c_search_force_users\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; if ($mode == "2") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"2\">" . OW::getLanguage()->text('search', 'config_yes') . " (" . OW::getLanguage()->text('search', 'config_yes_precisely') . ")</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td colspan=\"2\">"; $content .= "<hr/>"; $content .= "</td>"; $content .= "</tr>"; if (OW::getPluginManager()->isPluginActive('adsense')) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnon_ads_adsense') . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'allow_ads_adsense'); $content .= "<select name=\"c_allow_ads_adsense\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } if (OW::getPluginManager()->isPluginActive('adspro')) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnon_ads_adspro') . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'allow_ads_adspro'); $content .= "<select name=\"c_allow_ads_adspro\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } if (OW::getPluginManager()->isPluginActive('ads')) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnon_ads_ads') . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'allow_ads_ads'); $content .= "<select name=\"c_allow_ads_ads\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } if (OW::getPluginManager()->isPluginActive('adsense') or OW::getPluginManager()->isPluginActive('adspro') or OW::getPluginManager()->isPluginActive('ads')) { $content .= "<tr>"; $content .= "<td colspan=\"2\">"; $content .= "<hr/>"; $content .= "</td>"; $content .= "</tr>"; } $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_search_search_position') . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'search_position'); $content .= "<select name=\"c_search_position\" >"; if ($mode == "oxwall15" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"oxwall15\">" . OW::getLanguage()->text('search', 'config_oxwall15') . "</option>"; if ($mode == "absolute") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"absolute\">" . OW::getLanguage()->text('search', 'config_absolute') . "</option>"; if ($mode == "realtive") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"realtive\">" . OW::getLanguage()->text('search', 'config_relative') . "</option>"; if ($mode == "fixed") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"fixed\">" . OW::getLanguage()->text('search', 'config_fixed') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'admin_top_searchbar_resultsbackground') . ":</b>"; $content .= "</td>"; $content .= "<td nowrap=\"nowrap\">"; $bg_results_topsearchbar = OW::getConfig()->getValue('search', 'bg_results_topsearchbar'); if (!$bg_results_topsearchbar) { $bg_results_topsearchbar = ""; } $content .= "<input type=\"text\" name=\"c_bg_results_topsearchbar\" value=\"" . $bg_results_topsearchbar . "\" style=\"display:inline-block;width:45px;color:#f00;text-align:center;font-weight:bold;\"> <b>default: empty</b>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'admin_width_topsearchbar') . ":</b>"; $content .= "</td>"; $content .= "<td nowrap=\"nowrap\">"; $width_topsearchbar = OW::getConfig()->getValue('search', 'width_topsearchbar'); if ($width_topsearchbar == "" or $width_topsearchbar == 0) { $width_topsearchbar = "250"; } $content .= "<input type=\"text\" name=\"c_width_topsearchbar\" value=\"" . $width_topsearchbar . "\" style=\"display:inline-block;width:45px;color:#f00;text-align:center;font-weight:bold;\"> <b>def=250px</b>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'admin_height_topsearchbar') . ":</b>"; $content .= "</td>"; $content .= "<td nowrap=\"nowrap\">"; $height_topsearchbar = OW::getConfig()->getValue('search', 'height_topsearchbar'); if ($height_topsearchbar == "" or $height_topsearchbar == 0) { $height_topsearchbar = "24"; } $content .= "<input type=\"text\" name=\"c_height_topsearchbar\" value=\"" . $height_topsearchbar . "\" style=\"display:inline-block;width:45px;color:#f00;text-align:center;font-weight:bold;\"> <b>def=24px</b>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'admin_horizontal_position') . ":</b>"; $content .= "</td>"; $content .= "<td nowrap=\"nowrap\">"; $horizontal_position = OW::getConfig()->getValue('search', 'horizontal_position'); if (!$horizontal_position) { $horizontal_position = "0"; } $content .= "<b>[-]</b> <input type=\"text\" name=\"c_horizontal_position\" value=\"" . $horizontal_position . "\" style=\"display:inline-block;width:45px;color:#f00;text-align:center;font-weight:bold;\"> <b>[+]</b>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td colspan=\"2\" wrap=\"wrap\" style=\"background-color:#eee;\">"; $content .= OW::getLanguage()->text('search', 'admin_horizontal_position_info'); $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'admin_vertical_position') . ":</b>"; $content .= "</td>"; $content .= "<td nowrap=\"nowrap\">"; $vertical_position = OW::getConfig()->getValue('search', 'vertical_position'); if (!$vertical_position) { $vertical_position = "0"; } $content .= "<b>[-]</b> <input type=\"text\" name=\"c_vertical_position\" value=\"" . $vertical_position . "\" style=\"display:inline-block;width:45px;color:#f00;text-align:center;font-weight:bold;\"> <b>[+]</b>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'admin_zindex_position') . ":</b>"; $content .= "</td>"; $content .= "<td nowrap=\"nowrap\">"; $zindex_position = OW::getConfig()->getValue('search', 'zindex_position'); if ($zindex_position == "") { $zindex_position = "101"; } $content .= "<input type=\"text\" name=\"c_zindex_position\" value=\"" . $zindex_position . "\" style=\"display:inline-block;width:45px;color:#f00;text-align:center;font-weight:bold;\"> <b>def=101</b>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td colspan=\"2\">"; $content .= "<hr/>"; $content .= "</td>"; $content .= "</tr>"; $plnam = "cms"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "forum"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "map"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "links"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "video"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "photo"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "shoppro"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "classifiedspro"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "pages"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "groups"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "blogs"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "event"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "fanpage"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "html"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "games"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } /* //-------------------disable Adsense $plnam="adsense"; if ( OW::getPluginManager()->isPluginActive($plnam) ){ $content .="<tr>"; $content .="<td >"; $content .="<b>".OW::getLanguage()->text('search', 'config_turnoff_'.$plnam).":</b>"; $content .="</td>"; $content .="<td>"; $mode=$config->getValue('search', 'turn_offplugin_'.$plnam); $content .="<select name=\"c_turn_offplugin_".$plnam."\" >"; if ($mode=="0" OR !$mode) $sel=" selected "; else $sel=""; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('search', 'config_no')."</option>"; if ($mode=="1") $sel=" selected "; else $sel=""; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('search', 'config_yes')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; } */ //-------------------disable Adsense /* if ( OW::getPluginManager()->isPluginActive('adsense') ){ $plunin_installed['adsense']=true; }else{ $plunin_installed['adsense']=false; } */ $plunin_installed['adsense'] = false; $plnam = "mochigames"; if (OW::getPluginManager()->isPluginActive($plnam)) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } $plnam = "wiki"; // if ( OW::getPluginManager()->isPluginActive($plnam) ){ if (OW::getPluginManager()->isPluginActive('userwiki')) { $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('search', 'config_turnoff_' . $plnam) . ":</b>"; $content .= "</td>"; $content .= "<td>"; $mode = $config->getValue('search', 'turn_offplugin_' . $plnam); $content .= "<select name=\"c_turn_offplugin_" . $plnam . "\" >"; if ($mode == "0" or !$mode) { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('search', 'config_no') . "</option>"; if ($mode == "1") { $sel = " selected "; } else { $sel = ""; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('search', 'config_yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } /* $plnam="basepages"; if ( OW::getPluginManager()->isPluginActive($plnam) ){ $content .="<tr>"; $content .="<td >"; $content .="<b>".OW::getLanguage()->text('search', 'config_turnoff_'.$plnam).":</b>"; $content .="</td>"; $content .="<td>"; $mode=$config->getValue('search', 'turn_offplugin_'.$plnam); $content .="<select name=\"c_turn_offplugin_".$plnam."\" >"; if ($mode=="0" OR !$mode) $sel=" selected "; else $sel=""; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('search', 'config_no')."</option>"; if ($mode=="1") $sel=" selected "; else $sel=""; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('search', 'config_yes')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; } */ /* if ( OW::getPluginManager()->isPluginActive('basepages') ){//TODO... $plunin_installed['basepages']=true; }else{ $plunin_installed['basepages']=false; } */ /* $plnam="adspro"; if ( OW::getPluginManager()->isPluginActive($plnam) ){ $content .="<tr>"; $content .="<td >"; $content .="<b>".OW::getLanguage()->text('search', 'config_turnoff_'.$plnam).":</b>"; $content .="</td>"; $content .="<td>"; $mode=$config->getValue('search', 'turn_offplugin_'.$plnam); $content .="<select name=\"c_turn_offplugin_".$plnam."\" >"; if ($mode=="0" OR !$mode) $sel=" selected "; else $sel=""; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('search', 'config_no')."</option>"; if ($mode=="1") $sel=" selected "; else $sel=""; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('search', 'config_yes')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; } */ $content .= "<tr>"; $content .= "<td colspan=\"2\">"; $content .= "<hr/>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr>"; $content .= "<td colspan=\"2\">"; // $content .="<input type=\"submit\" name=\"dosave\" value=\"".OW::getLanguage()->text('search', 'admin_save')."\">"; $content .= "<div class=\"clearfix ow_submit ow_smallmargin\">\n <div class=\"ow_center\">\n <span class=\"ow_button\">\n <span class=\" ow_ic_save ow_positive\">\n <input type=\"submit\" name=\"dosave\" value=\"" . OW::getLanguage()->text('search', 'admin_save') . "\" class=\"ow_ic_save ow_positive\">\n </span>\n </span>\n </div>\n </div>"; $content .= "</td>"; $content .= "</tr>"; $content .= "</table>"; $content .= "</form>"; $this->assign('content', $content); }
public function setMaintenanceMode($mode = true) { $config = OW::getConfig(); if ($mode) { $state = (int) $config->getValue('base', 'maintenance'); $config->saveConfig('forum', 'maintenance_mode_state', $state); OW::getApplication()->setMaintenanceMode($mode); } else { $state = (int) $config->getValue('forum', 'maintenance_mode_state'); $config->saveConfig('base', 'maintenance', $state); } }
public function onFinalizeCheckIfSiteFullyInstalled(OW_Event $event) { if (!OW::getConfig()->getValue("base", "install_complete")) { OW::getApplication()->redirect(OW::getRouter()->urlForRoute("base_page_install_completed") . "?redirect=1"); } }
public function getDispatchAttrs() { $attrs = parent::getDispatchAttrs(); $str = urldecode($attrs[OW_Route::DISPATCH_ATTRS_VARLIST][$this->pathProperty]); /* @var $slug OASEO_BOL_Slug */ $slug = $this->seoService->getSlugForString($this->entityType, $str); if ($slug === null) { $rnSlug = $this->seoService->findActiveSlugForInactiveOne($this->entityType, $str); if ($rnSlug !== null) { $generatedUri = ''; foreach ($this->pathArray as $value) { if (mb_substr($value, 0, 1) !== ':') { $generatedUri .= $value . '/'; } else { $varName = mb_substr($value, 1); $generatedUri .= urlencode($varName == $this->pathProperty ? $rnSlug->getString() : $attrs[OW_Route::DISPATCH_ATTRS_VARLIST][$varName]) . '/'; } } throw new RedirectException(OW_URL_HOME . mb_substr($generatedUri, 0, -1)); } else { if (is_numeric($str)) { $slug = $this->seoService->findActiveSlugForEntityItem($this->entityType, $str); if ($slug !== null) { $key = array_search(':' . $this->pathProperty, $this->pathArray); if ($key) { $pathArray = explode('/', OW::getRequest()->getRequestUri()); $pathArray[$key] = $slug->getString(); $redirectUri = implode('/', $pathArray); OW::getApplication()->redirect(OW_URL_HOME . $redirectUri); } } } } } if ($slug !== null) { $attrs[OW_Route::DISPATCH_ATTRS_VARLIST][$this->pathProperty] = $slug->getEntityId(); if (!$this->slugChecked) { $this->seoService->checkEntityUpdate($this->entityType, $slug->getEntityId(), $this->serviceCallback, $this->dtoProperty); $this->slugChecked = true; } } return $attrs; }
public function initPlugin(OW_Plugin $pluginObject) { $this->addPackagePointers($pluginObject->getDto()); $initDirPath = $pluginObject->getRootDir(); if (OW::getApplication()->getContext() == OW::CONTEXT_MOBILE) { $initDirPath = $pluginObject->getMobileDir(); } else { if (OW::getApplication()->getContext() == OW::CONTEXT_API) { $initDirPath = $pluginObject->getApiDir(); } } if (file_exists($initDirPath . 'init.php')) { OW::getEventManager()->trigger(new OW_Event("core.performance_test", array("key" => "plugin_init.start", "pluginKey" => $pluginObject->getKey()))); include $initDirPath . 'init.php'; OW::getEventManager()->trigger(new OW_Event("core.performance_test", array("key" => "plugin_init.end", "pluginKey" => $pluginObject->getKey()))); } }
public function dept() { $content = ""; $this->setPageTitle(OW::getLanguage()->text('map', 'admin_dept_title')); $this->setPageHeading(OW::getLanguage()->text('map', 'admin_dept_heading')); $id_user = OW::getUser()->getId(); //citent login user (uwner) $is_admin = OW::getUser()->isAdmin(); //iss admin $curent_url = OW_URL_HOME; $config = OW::getConfig(); $content = ""; if (!isset($_POST['save'])) { $_POST['save'] = ""; } if ($is_admin and $id_user > 0 and $_POST['save'] == "besave") { if (isset($_POST['c_tabdisable_shop'])) { $config->saveConfig('map', 'tabdisable_shop', $_POST['c_tabdisable_shop']); } if (isset($_POST['c_tabdisable_fanpage'])) { $config->saveConfig('map', 'tabdisable_fanpage', $_POST['c_tabdisable_fanpage']); } if (isset($_POST['c_tabdisable_event'])) { $config->saveConfig('map', 'tabdisable_event', $_POST['c_tabdisable_event']); } if (isset($_POST['c_tabdisable_news'])) { $config->saveConfig('map', 'tabdisable_news', $_POST['c_tabdisable_news']); } // $pluginStaticDir =OW::getPluginManager()->getPlugin('map')->getUserFilesDir(); // $pluginStaticDir =OW::getPluginManager()->getPlugin('map')->getPluginFilesDir(); $pluginStaticDir = OW::getPluginManager()->getPlugin('map')->getRootDir(); if (is_file($pluginStaticDir . "map_mobile.apk")) { $config->saveConfig('map', 'support_mobile_app', $_POST['c_support_mobile_app']); } else { $config->saveConfig('map', 'support_mobile_app', '0'); } /* $config->saveConfig('map', 'backgrounc_cards_color', $_POST['c_backgrounc_cards_color']); $config->saveConfig('map', 'border_cards_color', $_POST['c_border_cards_color']); if (isset($_POST['c_tabdisable_shop'])){ $config->saveConfig('map', 'tabdisable_shop', $_POST['c_tabdisable_shop']); } if (isset($_POST['c_tabdisable_photo'])){ $config->saveConfig('map', 'tabdisable_photo', $_POST['c_tabdisable_photo']); } if (isset($_POST['c_tabdisable_blogs'])){ $config->saveConfig('map', 'tabdisable_blogs', $_POST['c_tabdisable_blogs']); } if (isset($_POST['c_tabdisable_forum'])){ $config->saveConfig('map', 'tabdisable_forum', $_POST['c_tabdisable_forum']); } if (isset($_POST['c_tabdisable_event'])){ $config->saveConfig('map', 'tabdisable_event', $_POST['c_tabdisable_event']); } if (isset($_POST['c_tabdisable_groups'])){ $config->saveConfig('map', 'tabdisable_groups', $_POST['c_tabdisable_groups']); } if (isset($_POST['c_tabdisable_video'])){ $config->saveConfig('map', 'tabdisable_video', $_POST['c_tabdisable_video']); } if (isset($_POST['c_tabdisable_fanpage'])){ $config->saveConfig('map', 'tabdisable_fanpage', $_POST['c_tabdisable_fanpage']); } $config->saveConfig('map', 'showpost_membersonly', $_POST['c_showpost_membersonly']); */ $config->saveConfig('map', 'perpage', $_POST['c_perpage']); $config->saveConfig('map', 'show_owner', $_POST['c_show_owner']); //echo OW::getConfig()->getValue('map', 'perpage');exit; /* if ($_POST['c_protectkey']){ $rss_protect_key=$_POST['c_protectkey']; }else{ $rss_protect_key=substr(md5(date('d-m-Y H:i:s')),0,10); } if ($_POST['c_generateforusers']){ $generateforusers=1; }else{ $generateforusers=0; } $rss_max_items_eachplugin=$_POST['c_maxitemseachplugin']; if (!$rss_max_items_eachplugin) $rss_max_items_eachplugin=10; if ($rss_max_items_eachplugin>50) $rss_max_items_eachplugin=50; $rss_max_items_sitemap=$_POST['c_maxitemsforsitemap']; if (!$rss_max_items_sitemap) $rss_max_items_sitemap=1000; if ($rss_max_items_sitemap>9999) $rss_max_items_sitemap=9999; $config->saveConfig('rss', 'rss_protect_key', $rss_protect_key); $config->saveConfig('rss', 'rss_generateforusers', $generateforusers); $config->saveConfig('rss', 'rss_max_items_eachplugin', $rss_max_items_eachplugin); $config->saveConfig('rss', 'rss_max_items_sitemap', $rss_max_items_sitemap); */ /* if (!$_POST['c_map_perpage']) $_POST['c_map_perpage']=12; $config->saveConfig('map', 'map_perpage', $_POST['c_map_perpage']); if (!$_POST['c_items_top10']) $_POST['c_items_top10']=0; $config->saveConfig('map', 'items_top10', $_POST['c_items_top10']); if ($_POST['c_admin_membercanaddgame']=="") $_POST['c_admin_membercanaddgame']=0; $config->saveConfig('map', 'admin_membercanaddgame', $_POST['c_admin_membercanaddgame']); if ($_POST['c_admin_show_gameinfo']=="") $_POST['c_admin_show_gameinfo']=0; $config->saveConfig('map', 'admin_show_gameinfo', $_POST['c_admin_show_gameinfo']); if ($_POST['c_admin_show_latest']=="") $_POST['c_admin_show_latest']=0; $config->saveConfig('map', 'admin_show_latest', $_POST['c_admin_show_latest']); */ OW::getApplication()->redirect($curent_url . "admin/plugins/map"); } //$content .="<div class=\"ow_content ow_table_1 ow_form ow_stdmargin\">"; $content .= "<form action=\"" . $curent_url . "admin/plugins/map\" method=\"post\" style=\"width:100%;\">"; $content .= "<input type=\"hidden\" name=\"save\" value=\"besave\">"; $content .= "<table style=\"width:100%;\" class=\"ow_table_1 ow_form ow_stdmargin\">"; $content .= "<th class=\"ow_name ow_txtleft\" colspan=\"3\">\n <span class=\"ow_section_icon ow_ic_gear_wheel\">" . OW::getLanguage()->text('map', 'admin_dept_title') . "</span>\n </th>"; $content .= "<tr>"; $content .= "<td >"; $content .= "<b>" . OW::getLanguage()->text('map', 'perpage') . ":</b>"; $content .= "</td>"; $content .= "<td >"; $itelss = OW::getConfig()->getValue('map', 'perpage'); if (!$itelss) { $itelss = "300"; } $content .= "<input type=\"text\" name=\"c_perpage\" value=\"" . $itelss . "\" style=\"display:inline-block;width:100px;\">"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr class=\"ow_alt1x\">"; $content .= "<td class=\"ow_labelx\">"; $content .= "<b>" . OW::getLanguage()->text('map', 'support_mobile_app') . ":</b>"; $content .= "<br/><i>" . OW::getLanguage()->text('map', 'mobile_info_admin') . "</i>"; //$pluginStaticDir =OW::getPluginManager()->getPlugin('map')->getUserFilesDir(); $pluginStaticDir = OW::getPluginManager()->getPlugin('map')->getRootDir(); $isfileok = false; if (is_file($pluginStaticDir . "map_mobile.apk")) { $content .= "<br/><span style=\"color:#00ff00;\"><b>" . OW::getLanguage()->text('map', 'status_application') . ":</b> " . OW::getLanguage()->text('map', 'you_have_appication') . "</span>"; $isfileok = true; } else { $content .= "<br/><span style=\"color:#ff0000;\"><b>" . OW::getLanguage()->text('map', 'status_application') . ":</b> " . OW::getLanguage()->text('map', 'you_dont_have_application') . "</span>"; $isfileok = false; } $content .= "</td>"; $content .= "<td class=\"ow_valuex\">"; if (!$isfileok) { $content .= "<select name=\"c_support_mobile_app\" disabled>"; } else { $content .= "<select name=\"c_support_mobile_app\">"; } if (OW::getConfig()->getValue('map', 'support_mobile_app') == "0" or OW::getConfig()->getValue('map', 'support_mobile_app') == "" or !$isfileok) { $sel = " selected "; } else { $sel = " "; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('map', 'no') . "</option>"; if (OW::getConfig()->getValue('map', 'support_mobile_app') == "1" and $isfileok) { $sel = " selected "; } else { $sel = " "; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('map', 'yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; $content .= "<tr class=\"ow_alt1x\">"; $content .= "<td class=\"ow_labelx\">"; $content .= "<b>" . OW::getLanguage()->text('map', 'admin_shwo_owneronthemap') . ":</b>"; $content .= "</td>"; $content .= "<td class=\"ow_valuex\">"; $content .= "<select name=\"c_show_owner\">"; if (OW::getConfig()->getValue('map', 'show_owner') == "0" or OW::getConfig()->getValue('map', 'show_owner') == "") { $sel = " selected "; } else { $sel = " "; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('map', 'no') . "</option>"; if (OW::getConfig()->getValue('map', 'show_owner') == "1") { $sel = " selected "; } else { $sel = " "; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('map', 'yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; if (OW::getPluginManager()->isPluginActive('shoppro')) { $content .= "<tr class=\"ow_alt1x\">"; $content .= "<td class=\"ow_labelx\">"; $content .= "<b>" . OW::getLanguage()->text('map', 'admin_disable_shoptab') . ":</b>"; $content .= "</td>"; $content .= "<td class=\"ow_valuex\">"; $content .= "<select name=\"c_tabdisable_shop\">"; if (OW::getConfig()->getValue('map', 'tabdisable_shop') == "0" or OW::getConfig()->getValue('map', 'tabdisable_shop') == "") { $sel = " selected "; } else { $sel = " "; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('map', 'no') . "</option>"; if (OW::getConfig()->getValue('map', 'tabdisable_shop') == "1") { $sel = " selected "; } else { $sel = " "; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('map', 'yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } if (OW::getPluginManager()->isPluginActive('fanpage')) { $content .= "<tr class=\"ow_alt1x\">"; $content .= "<td class=\"ow_labelx\">"; $content .= "<b>" . OW::getLanguage()->text('map', 'admin_disable_fanpagetab') . ":</b>"; $content .= "</td>"; $content .= "<td class=\"ow_valuex\">"; $content .= "<select name=\"c_tabdisable_fanpage\">"; if (OW::getConfig()->getValue('map', 'tabdisable_fanpage') == "0" or OW::getConfig()->getValue('map', 'tabdisable_fanpage') == "") { $sel = " selected "; } else { $sel = " "; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('map', 'no') . "</option>"; if (OW::getConfig()->getValue('map', 'tabdisable_fanpage') == "1") { $sel = " selected "; } else { $sel = " "; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('map', 'yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } if (OW::getPluginManager()->isPluginActive('news')) { $content .= "<tr class=\"ow_alt1x\">"; $content .= "<td class=\"ow_labelx\">"; $content .= "<b>" . OW::getLanguage()->text('map', 'admin_disable_newstab') . ":</b>"; $content .= "</td>"; $content .= "<td class=\"ow_valuex\">"; $content .= "<select name=\"c_tabdisable_news\">"; if (OW::getConfig()->getValue('map', 'tabdisable_news') == "0" or OW::getConfig()->getValue('map', 'tabdisable_news') == "") { $sel = " selected "; } else { $sel = " "; } $content .= "<option " . $sel . " value=\"0\">" . OW::getLanguage()->text('map', 'no') . "</option>"; if (OW::getConfig()->getValue('map', 'tabdisable_news') == "1") { $sel = " selected "; } else { $sel = " "; } $content .= "<option " . $sel . " value=\"1\">" . OW::getLanguage()->text('map', 'yes') . "</option>"; $content .= "</select>"; $content .= "</td>"; $content .= "</tr>"; } /* if (OW::getPluginManager()->isPluginActive('event')){ $content .="<tr class=\"ow_alt1x\">"; $content .="<td class=\"ow_labelx\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_disable_eventtab').":</b>"; $content .="</td>"; $content .="<td class=\"ow_valuex\">"; $content .="<select name=\"c_tabdisable_event\">"; if (OW::getConfig()->getValue('map', 'tabdisable_event')=="0" OR OW::getConfig()->getValue('map', 'tabdisable_event')=="") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('map', 'no')."</option>"; if (OW::getConfig()->getValue('map', 'tabdisable_event')=="1") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('map', 'yes')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; } */ /* if (OW::getPluginManager()->isPluginActive('photo')){ $content .="<tr class=\"ow_alt1x\">"; $content .="<td class=\"ow_labelx\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_disable_phototab').":</b>"; $content .="</td>"; $content .="<td class=\"ow_valuex\">"; $content .="<select name=\"c_tabdisable_photo\">"; if (OW::getConfig()->getValue('map', 'tabdisable_photo')=="0" OR OW::getConfig()->getValue('map', 'tabdisable_photo')=="") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('map', 'no')."</option>"; if (OW::getConfig()->getValue('map', 'tabdisable_photo')=="1") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('map', 'yes')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; } if (OW::getPluginManager()->isPluginActive('video')){ $content .="<tr class=\"ow_alt1x\">"; $content .="<td class=\"ow_labelx\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_disable_videotab').":</b>"; $content .="</td>"; $content .="<td class=\"ow_valuex\">"; $content .="<select name=\"c_tabdisable_video\">"; if (OW::getConfig()->getValue('map', 'tabdisable_video')=="0" OR OW::getConfig()->getValue('map', 'tabdisable_video')=="") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('map', 'no')."</option>"; if (OW::getConfig()->getValue('map', 'tabdisable_video')=="1") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('map', 'yes')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; } if (OW::getPluginManager()->isPluginActive('blogs')){ $content .="<tr class=\"ow_alt1x\">"; $content .="<td class=\"ow_labelx\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_disable_blogstab').":</b>"; $content .="</td>"; $content .="<td class=\"ow_valuex\">"; $content .="<select name=\"c_tabdisable_blogs\">"; if (OW::getConfig()->getValue('map', 'tabdisable_blogs')=="0" OR OW::getConfig()->getValue('map', 'tabdisable_blogs')=="") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('map', 'no')."</option>"; if (OW::getConfig()->getValue('map', 'tabdisable_blogs')=="1") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('map', 'yes')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; } if (OW::getPluginManager()->isPluginActive('forum')){ $content .="<tr class=\"ow_alt1x\">"; $content .="<td class=\"ow_labelx\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_disable_forumtab').":</b>"; $content .="</td>"; $content .="<td class=\"ow_valuex\">"; $content .="<select name=\"c_tabdisable_forum\">"; if (OW::getConfig()->getValue('map', 'tabdisable_forum')=="0" OR OW::getConfig()->getValue('map', 'tabdisable_forum')=="") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('map', 'no')."</option>"; if (OW::getConfig()->getValue('map', 'tabdisable_forum')=="1") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('map', 'yes')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; } if (OW::getPluginManager()->isPluginActive('event')){ $content .="<tr class=\"ow_alt1x\">"; $content .="<td class=\"ow_labelx\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_disable_eventtab').":</b>"; $content .="</td>"; $content .="<td class=\"ow_valuex\">"; $content .="<select name=\"c_tabdisable_event\">"; if (OW::getConfig()->getValue('map', 'tabdisable_event')=="0" OR OW::getConfig()->getValue('map', 'tabdisable_event')=="") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('map', 'no')."</option>"; if (OW::getConfig()->getValue('map', 'tabdisable_event')=="1") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('map', 'yes')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; } if (OW::getPluginManager()->isPluginActive('groups')){ $content .="<tr class=\"ow_alt1x\">"; $content .="<td class=\"ow_labelx\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_disable_groupstab').":</b>"; $content .="</td>"; $content .="<td class=\"ow_valuex\">"; $content .="<select name=\"c_tabdisable_groups\">"; if (OW::getConfig()->getValue('map', 'tabdisable_groups')=="0" OR OW::getConfig()->getValue('map', 'tabdisable_groups')=="") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('map', 'no')."</option>"; if (OW::getConfig()->getValue('map', 'tabdisable_groups')=="1") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('map', 'yes')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; } $content .="<tr>"; $content .="<td valign=\"top\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_border_cart_color').":</b>"; $content .="<br/>"; $content .="Set the color of the line only when then in Your Theme is necessary! (For example, when the boxes are unreadable). <b>By default, leave the field empty.</b> Entered Color as HTML format eg.: #FF0000, #00FF00, #0000FF"; $content .="</td>"; $content .="<td d valign=\"top\">"; $curent=OW::getConfig()->getValue('map', 'border_cards_color'); $content .="<input type=\"text\" name=\"c_border_cards_color\" value=\"".$curent."\" style=\"display:inline-block;width:100px;\">"; $content .="</td>"; $content .="</tr>"; $content .="<tr>"; $content .="<td d valign=\"top\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_background_cart_color').":</b>"; $content .="<br/>"; $content .="Set the background box color only when the Your Theme necessary and Your theme set boxes as \"transparent\"! (For example, when the boxes are unreadable). <b>By default, leave the field empty.</b> Entered Color as HTML format eg.: #FF0000, #00FF00, #0000FF"; $content .="</td>"; $content .="<td d valign=\"top\">"; $curent=OW::getConfig()->getValue('map', 'backgrounc_cards_color'); $content .="<input type=\"text\" name=\"c_backgrounc_cards_color\" value=\"".$curent."\" style=\"display:inline-block;width:100px;\">"; $content .="</td>"; $content .="</tr>"; */ /* $content .="<tr class=\"ow_alt1\">"; $content .="<td class=\"ow_label\" style=\"min-width:450px;\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_start_page').":</b>"; $content .="</td>"; $content .="<td nowrap=\"nowrap\" class=\"ow_value\">"; $startpage=OW::getConfig()->getValue('map', 'startpage'); if (!$startpage) $startpage=0; $content .="<select name=\"pf_startpage\" id=\"pf_startpage\">"; if (!$startpage){ $content .="<option selected value=\"0\">--- ".OW::getLanguage()->text('map', 'select_startpage')." --- </option>"; } $content .=map_BOL_Service::getInstance()->make_pageslist($startpage); $content .="</select>"; $content .="</td>"; $content .="</tr>"; */ /* $content .="<tr class=\"ow_alt1\">"; $content .="<td class=\"ow_label\" >"; $content .="<b>".OW::getLanguage()->text('map', 'admin_howmanyutems_fortop10').":</b>"; $content .="</td>"; $content .="<td nowrap=\"nowrap\" class=\"ow_value\">"; $content .="<input type=\"text\" name=\"c_items_top10\" value=\"".OW::getConfig()->getValue('map', 'items_top10')."\" style=\"display:inline-block;width:50px;\">"; $content .="</td>"; $content .="</tr>"; $content .="<tr class=\"ow_alt1\">"; $content .="<td class=\"ow_label\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_membercanaddmap').":</b>"; $content .="</td>"; $content .="<td class=\"ow_value\">"; $content .="<select name=\"c_admin_membercanaddgame\">"; if (OW::getConfig()->getValue('map', 'admin_membercanaddgame')=="1" OR OW::getConfig()->getValue('map', 'admin_membercanaddgame')=="") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('map', 'yes')."</option>"; if (OW::getConfig()->getValue('map', 'admin_membercanaddgame')=="0") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('map', 'no')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; $content .="<tr class=\"ow_alt1\">"; $content .="<td class=\"ow_label\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_doshowgameinfo').":</b>"; $content .="</td>"; $content .="<td class=\"ow_value\">"; $content .="<select name=\"c_admin_show_gameinfo\">"; if (OW::getConfig()->getValue('map', 'admin_show_gameinfo')=="1" OR OW::getConfig()->getValue('map', 'admin_show_gameinfo')=="") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('map', 'yes')."</option>"; if (OW::getConfig()->getValue('map', 'admin_show_gameinfo')=="0") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('map', 'no')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; $content .="<tr class=\"ow_alt1\">"; $content .="<td class=\"ow_label\">"; $content .="<b>".OW::getLanguage()->text('map', 'admin_doshowlatestmap').":</b>"; $content .="</td>"; $content .="<td class=\"ow_value\">"; $content .="<select name=\"c_admin_show_latest\">"; if (OW::getConfig()->getValue('map', 'admin_show_latest')=="1" OR OW::getConfig()->getValue('map', 'admin_show_latest')=="") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('map', 'yes')."</option>"; if (OW::getConfig()->getValue('map', 'admin_show_latest')=="0") $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('map', 'no')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; */ /* $content .="<tr>"; $content .="<td colspan=\"2\" wrap=\"wrap\" style=\"background-color:#eee;\">"; $content .=OW::getLanguage()->text('rss', 'admin_protectkey_informationofuse'); $content .="</td>"; $content .="</tr>"; $content .="<tr>"; $content .="<td >"; $content .="<b>".OW::getLanguage()->text('rss', 'admin_userprofiledata').":</b>"; $content .="</td>"; $content .="<td >"; $content .="<select name=\"c_generateforusers\">"; if (OW::getConfig()->getValue('rss', 'rss_generateforusers') OR !OW::getConfig()->getValue('rss', 'rss_generateforusers')) $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"0\">".OW::getLanguage()->text('rss', 'admin_dontgeneratememberstoo')."</option>"; if (OW::getConfig()->getValue('rss', 'rss_generateforusers')==1) $sel=" selected "; else $sel=" "; $content .="<option ".$sel." value=\"1\">".OW::getLanguage()->text('rss', 'admin_generatememberstoo')."</option>"; $content .="</select>"; $content .="</td>"; $content .="</tr>"; $content .="<tr>"; $content .="<td >"; $content .="<b>".OW::getLanguage()->text('rss', 'admin_maxitemseachplugin').":</b>"; $content .="</td>"; $content .="<td >"; $itels=OW::getConfig()->getValue('rss', 'rss_max_items_eachplugin'); if (!$itels) $itels=10; $content .="<input type=\"text\" name=\"c_maxitemseachplugin\" value=\"".$itels."\" style=\"display:inline-block;width:100px;\">"; $content .=" ".OW::getLanguage()->text('rss', 'admin_maxitemseachplugin_info').""; $content .="</td>"; $content .="</tr>"; $content .="<tr>"; $content .="<td >"; $content .="<b>".OW::getLanguage()->text('rss', 'admin_maxitemsforsitemap').":</b>"; $content .="</td>"; $content .="<td >"; $itelss=OW::getConfig()->getValue('rss', 'rss_max_items_sitemap'); if (!$itelss) $itelss=1000; $content .="<input type=\"text\" name=\"c_maxitemsforsitemap\" value=\"".$itelss."\" style=\"display:inline-block;width:100px;\">"; $content .=" ".OW::getLanguage()->text('rss', 'admin_maxitemsforsitemap_info').""; $content .="</td>"; $content .="</tr>"; */ /* $content .="<tr>"; $content .="<td >"; $content .="<b>".OW::getLanguage()->text('map', 'admin_show_newsfeedads_frommemberonly').":</b>"; $content .="<br/>"; $content .="<b>".OW::getLanguage()->text('map', 'your_user_id').":</b> ".$id_user; $content .="</td>"; $content .="<td >"; $itelss=OW::getConfig()->getValue('map', 'showpost_membersonly'); if (!$itelss) $itelss=""; $content .="<input type=\"text\" name=\"c_showpost_membersonly\" value=\"".$itelss."\" style=\"display:inline-block;width:100px;\">"; $content .=" ".OW::getLanguage()->text('map', 'admin_show_newsfeedads_frommemberonly_info').""; $content .="</td>"; $content .="</tr>"; */ $content .= "<tr>"; $content .= "<td colspan=\"2\">"; // $content .="<input type=\"submit\" name=\"dosave\" value=\"".OW::getLanguage()->text('map', 'admin_save')."\">"; $content .= "<div class=\"clearfix ow_submit ow_smallmargin\">\n <div class=\"ow_center\">\n <span class=\"ow_button\">\n <span class=\"ow_positive\">\n <input type=\"submit\" name=\"saveb\" value=\"" . OW::getLanguage()->text('map', 'save') . "\" class=\"ow_ic_save ow_positive\">\n </span>\n </span>\n </div>\n </div>"; $content .= "</td>"; $content .= "</tr>"; $content .= "</table>"; $content .= "</form>"; //$content .="</div>"; $this->assign('content', $content); }
/** * SkadateX intialization */ define('_OW_', true); define('DS', DIRECTORY_SEPARATOR); define('OW_DIR_ROOT', substr(dirname(__FILE__), 0, -strlen('api'))); require OW_DIR_ROOT . 'ow_includes' . DS . 'init.php'; if (!defined('OW_ERROR_LOG_ENABLE') || (bool) OW_ERROR_LOG_ENABLE) { $logFilePath = OW_DIR_LOG . 'error.log'; $logger = OW::getLogger('ow_core_log'); $logger->setLogWriter(new BASE_CLASS_FileLogWriter($logFilePath)); $errorManager->setLogger($logger); } @(include OW_DIR_ROOT . 'ow_install' . DS . 'install.php'); OW::getSession()->start(); $application = OW::getApplication(); if (OW_PROFILER_ENABLE || OW_DEV_MODE) { UTIL_Profiler::getInstance()->mark('before_app_init'); } $application->init(); if (OW_PROFILER_ENABLE || OW_DEV_MODE) { UTIL_Profiler::getInstance()->mark('after_app_init'); } $event = new OW_Event(OW_EventManager::ON_APPLICATION_INIT); OW::getEventManager()->trigger($event); $application->route(); $event = new OW_Event(OW_EventManager::ON_AFTER_ROUTE); if (OW_PROFILER_ENABLE || OW_DEV_MODE) { UTIL_Profiler::getInstance()->mark('after_route'); } OW::getEventManager()->trigger($event);
public function redirectToMobile() { OW::getApplication()->redirect(OW::getRouter()->getBaseUrl(), OW::CONTEXT_MOBILE); }
public function index($params) { $content = ""; $menu = ""; $id_user = OW::getUser()->getId(); //citent login user (uwner) $is_admin = OW::getUser()->isAdmin(); $curent_url = 'http'; if (isset($_SERVER["HTTPS"])) { $curent_url .= "s"; } $curent_url .= "://"; $curent_url .= $_SERVER["SERVER_NAME"] . "/"; $curent_url = OW_URL_HOME; /* $from_config=$curent_url; $from_config=str_replace("https://","",$from_config); $from_config=str_replace("http://","",$from_config); $trash=explode($from_config,$_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]); $url_detect=$trash[1]; //print_r($trash); //echo $url_detect; */ if (!$id_user) { OW::getFeedback()->error(OW::getLanguage()->text('search', 'for_search_mastbe_login')); // OW::getApplication()->redirect($curent_url); $curent_full_url = $_SERVER["REQUEST_URI"]; OW::getApplication()->redirect($curent_url . "sign-in?back-uri=" . urlencode($curent_full_url)); exit; } $add_paramurl = ""; $per_page = 20; $start_form = 0; if (isset($_GET['page']) and $_GET['page'] > 0) { $curent_page = $_GET['page']; } else { $curent_page = 0; } //echo $curent_page; $start_form = $curent_page * $per_page; if (!$start_form) { $start_form = 0; } $prev_page = $curent_page - 1; if ($prev_page < 0) { $prev_page = 0; } $paging = ""; // $paging=$this->pagination($curent_page=0,$next_page=0,$url_pages="") // $paging=$this->pagination(); $limit_all = 10; $limit_single = $limit_all; $curent_bg = 2; $option = ""; if (isset($params['option'])) { $option = $params['option']; } //echo "------------------------------------".$option; $query = "*"; if (isset($_GET['query'])) { $query = $_GET['query']; } if (strlen($query) < 2) { $query = "*"; } //echo "--".$query; $header_add = ""; $tab = ""; $header = ""; if ($query) { $add = "?query=" . $query; } else { $add = ""; } if ($query) { $add_paramurl = "&query=" . $query; } //if (strlen($query)<2 OR $query=="*"){ // $add_paramurl=$_SERVER['REQUEST_URI']; // list($a,$b)=explode("?",$_SERVER['REQUEST_URI']); // list($a,$b)=explode("?",$_SERVER['QUERY']); //} //print_r( parse_url($_SERVER['REQUEST_URI']) ); //echo $a."--".$b; // if ($b) $add_paramurl="&".$b; // else if ($a) $add_paramurl="&".$a; $queryfromule = parse_url($_SERVER['REQUEST_URI']); //$add_paramurl =$queryfromule['query']; if (!isset($queryfromule['query'])) { $queryfromule['query'] = array(); $queryfromule['query'] = ""; } $array_query = explode("&", $queryfromule['query']); //print_r($array_query); $add_paramurl_search = ""; for ($i = 0; $i < count($array_query); $i++) { if (substr($array_query[$i], 0, 11) == "search_text" or substr($array_query[$i], 0, 10) == "search_sel") { if ($add_paramurl_search) { $add_paramurl_search .= "&"; } $add_paramurl_search .= $array_query[$i]; } } if ($add_paramurl_search) { if ($add_paramurl) { $add_paramurl .= "&" . $add_paramurl_search; } else { $add_paramurl = "&" . $add_paramurl_search; } } //print_r(parse_url($_GET));exit; //print_r($_SERVER['REQUEST_URI']); //print_r($_SERVER['REQUEST_URI']); //echo $_SERVER['REQUEST_URI']; $foundsomething = false; if ($id_user > 0) { if (!$option or $option == "search") { $option = "user"; } if ($option == "user") { $header_add = OW::getLanguage()->text('search', 'main_yousearchoption_user'); } $header = "<b>" . OW::getLanguage()->text('search', 'main_yousearching') . ":</b> <a href=\"" . $curent_url . "query" . $add . "\" class=\"ow_lbutton\"><b>" . $query . "</b></a>"; if ($header_add) { $header .= " > <a href=\"" . $curent_url . "query" . $add . "\" class=\"ow_lbutton\">" . $header_add . "</a>"; } // $this->setPageTitle("Contact Us"); // $this->setPageHeading("Contact Us"); $this->setPageTitle(OW::getLanguage()->text('search', 'index_page_title')); //title menu $this->setPageHeading(OW::getLanguage()->text('search', 'index_page_heading')); //title page /* $query = "SELECT * FROM " . OW_DB_PREFIX. "base_user WHERE username LIKE '".addslashes($query)."%' ORDER BY joinIp DESC LIMIT 10"; $arr = OW::getDbo()->queryForList($query); $mtab=""; foreach ( $arr as $value ) { $dname=BOL_UserService::getInstance()->getDisplayName($value['id']); $uurl=BOL_UserService::getInstance()->getUserUrl($value['id']); $uimg=BOL_AvatarService::getInstance()->getAvatarUrl($value['id']); $mtab .="<tr>"; $mtab .="<td>"; if ($uimg){ $mtab .="<img src=\"".$uimg."\" alt=\"".$dname."\" title=\"".$dname."\">"; }else{ $mtab .="<i>".OW::getLanguage()->text('search', 'index_hasnotimage')."</i>"; } //BOL_UserService::getInstance()->getDisplayName($userId) //BOL_UserService::getInstance()->getUserUrl($userId) $mtab .="</td>"; $mtab .="<td>"; $mtab .=$value['id'].") "; // $tab .=$value['username']; $mtab .=$dname; $mtab .="</td>"; $mtab .="</tr>"; } if ($mtab){ $menu .="<table style=\"width:100%;margin:auto;\">"; $menu .=$mtab; $menu .="</table>"; } */ //echo print_r($_GET['search_text']); if (strlen($query) > 1 or $query == "*" or isset($_GET['search_text']) and $_GET['search_text'] != "" or isset($_GET['search_sel']) and $_GET['search_sel'] != "") { // $content .=OW::getLanguage()->text('search', 'main_yousearching').": <b>".$query."</b>"; // $content .="<hr/>"; if (!$option or $option == "user") { if (!$option) { $limit = $limit_all; } else { // $limit=$limit_single; $limit = $start_form . "," . $per_page; } //echo $start_form; //print_r($_POST['search_text']); //print_r($_GET['search_text']);exit; //base_question_data $joinon = ""; $joinonleft = ""; $joinonleft2 = ""; $joinon_select = ""; $joinonwhere = ""; //if ($query){ if (isset($_GET['search_text'])) { $addsearch = $_GET['search_text']; } else { $addsearch = ""; } if (isset($_GET['search_sel'])) { $addsearch_sel = $_GET['search_sel']; } else { $addsearch_sel = ""; } if ($addsearch) { foreach ($addsearch as $name => $valx) { if ($name and $valx) { if ($joinonwhere) { $joinonwhere .= " AND "; } $joinonwhere .= " ( "; $joinonwhere .= "(bd2.questionName = '" . addslashes($name) . "' AND (bd2.textValue LIKE '%" . addslashes($valx) . "%' OR LOWER(bd2.textValue) LIKE '%" . addslashes(strtolower($valx)) . "%')) "; if ($valx > 0) { $joinonwhere .= " OR "; $joinonwhere .= " (bd2.questionName = '" . addslashes($name) . "' AND bd2.intValue ='" . addslashes($valx) . "') "; } $joinonwhere .= " ) "; if ($joinonleft) { $joinonleft .= " AND "; } $joinonleft .= " (bd2.userId=uss.id AND (`bd2`.`questionName` = '" . addslashes($name) . "') AND (bd2.textValue LIKE '%" . addslashes($valx) . "%' OR LOWER(bd2.textValue) LIKE '%" . addslashes(strtolower($valx)) . "%')) "; // if (strlen($query)>1){ // if ($joinonleft2) $joinonleft2 .=" AND "; // $joinonleft2 .=" (bd3.userId=uss.id AND (`bd3`.`questionName` = 'realname') AND (bd3.textValue LIKE '".addslashes($valx)."%' OR LOWER(bd3.textValue) LIKE '".addslashes(strtolower($valx))."%')) "; // } } } } if ($addsearch_sel) { foreach ($addsearch_sel as $name => $valx) { if ($name and $valx) { if (!$joinonwhere) { $joinonwhere = "1"; } /* if ($joinonwhere) $joinonwhere .=" AND "; $joinonwhere .=" ("; $joinonwhere .=" (bd.questionName = '".addslashes($name)."' AND bd.intValue= '".addslashes($valx)."') "; if ($valx>0){ $joinonwhere .=" OR "; $joinonwhere .=" (bd.questionName = '".addslashes($name)."' AND bd.textValue LIKE '%".addslashes($valx)."%') "; } $joinonwhere .=" ) "; */ // if ($joinonleft) $joinonleft .=" AND "; // $joinonleft .=" (bd2.userId=uss.id AND (`bd2`.`questionName` = '".addslashes($name)."') AND bd2.textValue LIKE '%".addslashes($valx)."%') "; //SELECT uss.*,bd.textValue,bd.intValue,bd.questionName FROM ow_base_user uss INNER JOIN `ow_base_question_data` `bd` ON ( bd.userId=uss.id AND (`bd`.`questionName` = 'sex' AND `bd`.`intValue` & '1' ) ) //LEFT JOIN `ow_base_question_data` `bd2` ON ( bd2.userId=uss.id AND (`bd2`.`questionName` = '7fd3b96ec84474824e77b40b4a596b38') ) //WHERE 1 ORDER BY uss.joinIp DESC LIMIT 0,20 $joinon .= " AND (`bd`.`questionName` = '" . addslashes($name) . "' AND `bd`.`intValue` & '" . addslashes($valx) . "' ) "; // $joinon .=" AND (`bd2`.`questionName` = '".addslashes($name)."' AND `bd2`.`intValue` & '".addslashes($valx)."' ) "; } } } if ($joinonleft) { $joinonleft = "LEFT JOIN `" . OW_DB_PREFIX . "base_question_data` `bd2` ON (" . $joinonleft . ") "; } //$joinonwhere ="1"; if ($joinonwhere) { if ($joinon) { $joinon_select = ",bd.textValue,bd.intValue,bd.questionName"; // $joinon_select =",bd2.textValue,bd.intValue,bd2.questionName"; } // $joinon="LEFT JOIN " . OW_DB_PREFIX. "base_question_data bd ON (bd.userId=uss.id AND bd.questionName = '".addslashes($name)."') "; // $joinon="INNER JOIN `" . OW_DB_PREFIX. "base_question_data` `bd` ON ( bd.userId=uss.id AND `bd`.`questionName` = '".addslashes($name)."' AND `bd`.`intValue` & '16' ) "; if ($joinon) { $joinon = "INNER JOIN `" . OW_DB_PREFIX . "base_question_data` `bd` ON ( bd.userId=uss.id " . $joinon . " ) "; } $joinonwhere = " (" . $joinonwhere . ") "; } /* if (OW::getConfig()->getValue('search', 'search_force_users')==2){ $add_query .=" AND (uadd.textValue LIKE '%".addslashes($query)."%' OR LOWER(uadd.textValue) LIKE '%".addslashes(strtolower($query))."%') "; $add_users=""; $add_users_lower=""; $add_users .=" uss.username LIKE '%".addslashes($query)."%' OR "; $add_users .=" uadd.textValue LIKE '%".addslashes($query)."%' OR "; $add_users_lower .=" LOWER(uss.username) LIKE '%".addslashes(strtolower($query))."%' OR "; $add_users_lower .=" LOWER(uadd.textValue) LIKE '%".addslashes(strtolower($query))."%' "; */ $add_query_search = ""; if (strlen($query) > 1) { if ($joinonwhere) { $joinonwhere .= " AND "; } if (OW::getConfig()->getValue('search', 'search_force_users') == 2) { $add_query_search .= " (uss.username LIKE '%" . addslashes($query) . "%' OR LOWER(uss.username) LIKE '%" . addslashes(strtolower($query)) . "%') "; } else { $add_query_search .= " (uss.username LIKE '" . addslashes($query) . "%' OR LOWER(uss.username) LIKE '" . addslashes(strtolower($query)) . "%') "; } } else { if ($query == "*" and !$joinonwhere) { $add_query_search .= " 1 "; } } //SELECT uss.* ,bd3.textValue FROM ow_base_user uss //LEFT JOIN `ow_base_question_data` `bd3` ON ( (bd3.userId=uss.id AND (`bd3`.`questionName` = 'realname') AND (bd3.textValue LIKE 'las v%' OR LOWER(bd3.textValue) LIKE 'las v%')) ) //WHERE ( ( (uss.username LIKE 'las v%' OR LOWER(uss.username) LIKE 'las v%') ) OR (bd3.textValue LIKE 'las v%' OR LOWER(bd3.textValue) LIKE 'las v%')) GROUP BY uss.id ORDER BY uss.joinIp DESC LIMIT 10 if (strlen($query) > 1) { if (!$option or $option == "search" or $option == "user") { if (!is_array($addsearch_sel)) { //jesli nie mam szukania po question if (OW::getConfig()->getValue('search', 'search_force_users') == 2) { $joinonleft2_if = " (bd3.userId=uss.id AND (bd3.textValue LIKE '%" . addslashes($query) . "%' OR LOWER(bd3.textValue) LIKE '%" . addslashes(strtolower($query)) . "%') ) "; } else { $joinonleft2_if = " (bd3.userId=uss.id AND (bd3.textValue LIKE '" . addslashes($query) . "%' OR LOWER(bd3.textValue) LIKE '" . addslashes(strtolower($query)) . "%') ) "; } } else { $joinonleft2_if = " (bd3.userId=uss.id AND (bd3.textValue LIKE '" . addslashes($query) . "' OR LOWER(bd3.textValue) LIKE '" . addslashes(strtolower($query)) . "') ) "; } } else { if (OW::getConfig()->getValue('search', 'search_force_users') == 2) { $joinonleft2_if = " (bd3.userId=uss.id AND (`bd3`.`questionName` = 'realname') AND (bd3.textValue LIKE '%" . addslashes($query) . "%' OR LOWER(bd3.textValue) LIKE '%" . addslashes(strtolower($query)) . "%')) "; } else { $joinonleft2_if = " (bd3.userId=uss.id AND (`bd3`.`questionName` = 'realname') AND (bd3.textValue LIKE '" . addslashes($query) . "%' OR LOWER(bd3.textValue) LIKE '" . addslashes(strtolower($query)) . "%')) "; } } $joinonleft2 = "LEFT JOIN `" . OW_DB_PREFIX . "base_question_data` `bd3` ON (" . $joinonleft2_if . ") "; // if ($joinon OR $joinonleft) $joinonleft2 =" AND ".$joinonleft2; $joinon_select .= " ,bd3.textValue "; // if ($add_query_search) $add_query_search .=" AND "; if (OW::getConfig()->getValue('search', 'search_force_users') == 2) { $add_query_search = "( (" . $add_query_search . ") OR (bd3.textValue LIKE '%" . addslashes($query) . "%' OR LOWER(bd3.textValue) LIKE '%" . addslashes(strtolower($query)) . "%'))"; } else { $add_query_search = "( (" . $add_query_search . ") OR (bd3.textValue LIKE '" . addslashes($query) . "%' OR LOWER(bd3.textValue) LIKE '" . addslashes(strtolower($query)) . "%'))"; } } //echo "-----------".is_array($addsearch_sel)."---".isset($addsearch_sel); /* //OK SELECT DISTINCT `user`.id, `user`.`activityStamp` FROM `ow_base_user` `user` INNER JOIN `ow_base_question_data` `qd0` ON ( `user`.`id` = `qd0`.`userId` AND `qd0`.`questionName` = 'relationship' AND `qd0`.`intValue` & '16' ) LEFT JOIN `ow_base_user_suspend` as `s` ON( `user`.`id` = `s`.`userId` ) LEFT JOIN `ow_base_user_disapprove` as `d` ON( `user`.`id` = `d`.`userId` ) WHERE `s`.`id` IS NULL AND `d`.`id` IS NULL ORDER BY `user`.`activityStamp` DESC */ //} // $sql = "SELECT * FROM " . OW_DB_PREFIX. "base_user WHERE username LIKE '".addslashes($query)."%' ORDER BY joinIp DESC LIMIT ".$limit; /* $sql = "SELECT uss.*,uadd.textValue FROM " . OW_DB_PREFIX. "base_user uss LEFT JOIN " . OW_DB_PREFIX. "base_question_data uadd ON (uadd.userId=uss.id AND uadd.questionName='realname') WHERE (uss.username LIKE '".addslashes($query)."%' OR uadd.textValue LIKE '".addslashes($query)."%' OR LOWER(uss.username) LIKE '".addslashes(strtolower($query))."%' OR LOWER(uadd.textValue) LIKE '".addslashes(strtolower($query))."%') ORDER BY uss.joinIp DESC LIMIT ".$limit; */ // LEFT JOIN " . OW_DB_PREFIX. "base_question_data uadd ON (uadd.userId=uss.id AND uadd.questionName='realname') // $sql = "SELECT uss.*".$joinon_select." FROM " . OW_DB_PREFIX. "base_user uss // ".$joinon." // WHERE ".$joinonwhere." (uss.username LIKE '".addslashes($query)."%' OR LOWER(uss.username) LIKE '".addslashes(strtolower($query))."%') ORDER BY uss.joinIp DESC LIMIT ".$limit; // LEFT JOIN " . OW_DB_PREFIX. "base_question_data uadd ON (uadd.userId=uss.id AND uadd.questionName='realname') $sql = "SELECT uss.*" . $joinon_select . " FROM " . OW_DB_PREFIX . "base_user uss \n " . $joinon . " " . $joinonleft . " " . $joinonleft2 . " \n WHERE " . $joinonwhere . " " . $add_query_search . " GROUP BY uss.id ORDER BY uss.joinIp DESC LIMIT " . $limit; //echo $sql; // WHERE ".$joinonwhere." (uss.username LIKE '".addslashes($query)."%' OR uadd.textValue LIKE '".addslashes($query)."%' OR LOWER(uss.username) LIKE '".addslashes(strtolower($query))."%' OR LOWER(uadd.textValue) LIKE '".addslashes(strtolower($query))."%') ORDER BY uss.joinIp DESC LIMIT ".$limit; //echo $sql; //echo BOL_QuestionService::getInstance()->getQuestionData(array(OW::getUser()->getUserObject()->getId()), array('realname')); //print_r(BOL_QuestionService::getInstance()->getQuestionData(array(OW::getUser()->getUserObject()->getId()), array('relationship'))); //print_r(BOL_QuestionService::getInstance()->getQuestionData(array(OW::getUser()->getUserObject()->getId()))); //echo $sql; if ($joinonwhere or $add_query_search) { $arr = OW::getDbo()->queryForList($sql); $tabt = ""; foreach ($arr as $value) { $dname = BOL_UserService::getInstance()->getDisplayName($value['id']); $uurl = BOL_UserService::getInstance()->getUserUrl($value['id']); $uimg = BOL_AvatarService::getInstance()->getAvatarUrl($value['id']); $tabt .= "<tr class=\"ow_alt" . $curent_bg . "\">"; $tabt .= "<td style=\"width:45px;\">"; if ($uimg) { $tabt .= "<a href=\"" . $uurl . "\">"; $tabt .= "<img src=\"" . $uimg . "\" alt=\"" . $dname . "\" title=\"" . $dname . "\" width=\"45px\" style=\"border:0;margin:10px;align:left;display:inline;\" align=\"left\" >"; $tabt .= "</a>"; } else { // $tabt .="<i>".OW::getLanguage()->text('search', 'index_hasnotimage')."</i>"; $tabt .= "<a href=\"" . $uurl . "\" >"; $tabt .= "<img src=\"" . $curent_url . "ow_static/themes/" . OW::getConfig()->getValue('base', 'selectedTheme') . "/images/no-avatar.png\" title=\"" . OW::getLanguage()->text('search', 'index_hasnotimage') . "\" width=\"45px\" style=\"border:0;margin:10px;align:left;display:inline;\" align=\"left\" >"; $tabt .= "</a>"; } //BOL_UserService::getInstance()->getDisplayName($userId) //BOL_UserService::getInstance()->getUserUrl($userId) $tabt .= "</td>"; $tabt .= "<td style=\"margin:auto;\">"; $tabt .= "<a href=\"" . $uurl . "\" title=\"" . $dname . "\" style=\"display:inline;\">"; $tabt .= $dname; $tabt .= "</a>"; $tabt .= "</td>"; $tabt .= "</tr>"; $tabt .= "<tr >"; $tabt .= "<td style=\"height:3px;\" colspan=\"2\" >"; // $tabt .=" "; $tabt .= "</td>"; $tabt .= "</tr>"; $curent_bg = $curent_bg + 1; if ($curent_bg > 2) { $curent_bg = 1; } } if ($tabt) { //echo $option; if (!$option) { $tab .= "<tr >"; $tab .= "<td style=\"height:5px;\" colspan=\"2\" >"; $tab .= " "; $tab .= "</td>"; $tab .= "</tr>"; $tab .= "<tr class=\"ow_alt" . $curent_bg . "\">"; // $tab .="<td class=\"ow_box_cap_empty ow_box_cap_body\" style=\"border:1px solid #ddd;\" colspan=\"2\" >"; // $tab .="<td style=\"border:1px solid #ddd;border-bottom:2px solid #aaa;border-left:2px solid #aaa;\" colspan=\"2\" >"; $tab .= "<td class=\"ow_ipc_header clearfix\" style=\"margin:auto;\" colspan=\"2\">"; $tab .= "<b>" . OW::getLanguage()->text('search', 'main_yousearchoption_user') . "</b>"; $tab .= "</td>"; $tab .= "</tr>"; $tab .= "<tr >"; $tab .= "<td style=\"height:5px;\" colspan=\"2\" >"; // $tab .=" "; $tab .= "</td>"; $tab .= "</tr>"; } $curent_bg = $curent_bg + 1; if ($curent_bg > 2) { $curent_bg = 1; } $tab .= $tabt; } //echo $prev_page; //echo "--".$tabt ; if (!$option) { $paging = ""; } else { if (!$tabt and (!$curent_page or $curent_page == 0)) { $paging = ""; } else { if ($tabt) { // $paging=$this->pagination($curent_page=0,$next_page=0,$url_pages="") $paging = $this->pagination($curent_page, $prev_page, $curent_page + 1, "user", $add_paramurl); } else { $paging = $this->pagination($curent_page, $prev_page, 0, "user", $add_paramurl); } } } //echo $paging; } //if $joinonwhere." ".$add_query_search } if ($tab) { $content .= "<table style=\"width:100%;margin:auto;\">"; $content .= $tab; $content .= "</table>"; } //--------------------------------menu start // if (strlen($query)>1){ /* if (strlen($query)>1 OR ($query=="*" AND !is_array($addsearch_sel) ) ){ if (!$option) $sel="border-left:4px solid #aaa;font-weight:bold;border-bottom:2px solid #aaa;"; else $sel=""; $menu .="<div class=\"clearfix\" style=\"margin:auto;\">"; $menu .="<div class=\"ow_ipc_header clearfix\" style=\"border-right:2px solid #aaa;margin:2px;".$sel."\" >"; $menu .="<a href=\"".$curent_url."query".$add."\">"; $menu .=OW::getLanguage()->text('search', 'menu_results_all'); $menu .="</a>"; $menu .="</div>"; $menu .="</div>"; } */ /* if ($option=="user") $sel="border-left:4px solid #aaa;font-weight:bold;border-bottom:2px solid #aaa;"; else $sel=""; $menu .="<div class=\"clearfix\" style=\"margin:auto;\">"; $menu .="<div class=\"ow_ipc_header clearfix\" style=\"border-right:2px solid #aaa;margin:2px;".$sel."\" >"; //echo $add."--".$query."--"; //if (!$add AND $query) $add="?query=*"; if ($add=="" AND !$query) $add="?query=*"; //else $add="xx"; $menu .="<a href=\"".$curent_url."query/user".$add."\">"; $menu .=OW::getLanguage()->text('search', 'menu_results_user'); $menu .="</a>"; $menu .="</div>"; $menu .="</div>"; */ // }//if if (strlen($query)>1){ //--------------------------------menu end //echo "adasD";exit; $foundsomething = true; } else { $foundsomething = false; $content .= OW::getLanguage()->text('search', 'main_noresultsfound'); // $content.="<form metod=\"get\" action=\"".$curent_url."query/".$option.$add."\">"; /// $content .="<input type=\"text\" name=\"query\" value=\"".$query."\" style=\"width:80%;\">"; $content .= $add_opt; // $content .="<input type=\"submit\" name=\"\" value=\"".OW::getLanguage()->text('search', 'search')."\">"; // $content .="<span class=\"ow_button ow_ic_lens\"><span><input type=\"submit\" value=\"".OW::getLanguage()->text('search', 'search')."\" id=\"btn-add-new-photo\" class=\"ow_ic_lens\"></span></span>"; $content .= "<span class=\"ow_button\"><span><input type=\"submit\" value=\"" . OW::getLanguage()->text('search', 'search') . "\" id=\"btn-add-new-photo\" class=\"ow_ic_lens\"></span></span>"; // $content .="</form>"; } } //if user $this->assign('post_url', $curent_url . "members/" . $option . $add); $menu = $this->make_options("search", "", $option); if ($foundsomething) { if (!isset($plunin_installed)) { $plunin_installed = ""; } $tabs = $this->make_tabs("search", $plunin_installed, $option); if (!$paging and $option != "") { $this->assign('paging1', OW::getLanguage()->text('search', 'menu_results_nofound')); $this->assign('paging2', ""); } else { if ($content) { $this->assign('paging1', $paging); $this->assign('paging2', $paging); } else { $this->assign('paging1', $paging); $this->assign('paging2', OW::getLanguage()->text('search', 'menu_results_nofound')); } } $this->assign('tabs', $tabs); $this->assign('header', $header); $this->assign('menu', $menu); $this->assign('content', $content); } else { $this->assign('paging1', OW::getLanguage()->text('search', 'menu_results_nofound')); $this->assign('paging2', ""); $this->assign('tabs', ""); $this->assign('header', ""); $this->assign('menu', $menu); $this->assign('content', $content); } }
<?php /** * Copyright (c) 2014, Skalfa LLC * All rights reserved. * * ATTENTION: This commercial software is intended for exclusive use with SkaDate Dating Software (http://www.skadate.com) and is licensed under SkaDate Exclusive License by Skalfa LLC. * * Full text of this license can be found at http://www.skadate.com/sel.pdf */ //temp fix of context switch if (OW::getApplication()->getContext() == OW_Application::CONTEXT_MOBILE) { OW::getApplication()->redirect(OW_URL_HOME . OW::getRequest()->getRequestUri(), OW_Application::CONTEXT_DESKTOP); }