function dispTextyleMenu() { $menu = array(); $menu['Home'] = getFullSiteUrl($this->textyle->domain); $menu['Profile'] = getSiteUrl($this->textyle->domain, '', 'mid', $this->module_info->mid, 'act', 'dispTextyleProfile'); $menu['Guestbook'] = getSiteUrl($this->textyle->domain, '', 'mid', $this->module_info->mid, 'act', 'dispTextyleGuestbook'); //$menu['Tags'] = getSiteUrl($this->textyle->domain,'','mid',$this->module_info->mid,'act','dispTextyleTag'); $args->site_srl = $this->site_srl; $output = executeQueryArray('textyle.getExtraMenus', $args); if ($output->toBool() && $output->data) { foreach ($output->data as $v) { $menu[$v->name] = getUrl('', 'mid', $v->mid); } } $logged_info = Context::get('logged_info'); if ($logged_info->is_site_admin) { $menu['Write Post'] = getSiteUrl($this->textyle->domain, '', 'mid', $this->module_info->mid, 'act', 'dispTextylePostWrite'); } Context::set('menu', $menu); $this->setTemplateFile('menu'); }
/** * @brie display textule tool post manage write **/ function dispTextyleToolPostManageWrite() { // set filter Context::addJsFilter($this->module_path . 'tpl/filter', 'save_post.xml'); $oDocumentModel =& getModel('document'); $document_srl = Context::get('document_srl'); $material_srl = Context::get('material_srl'); if ($document_srl) { $oDocument = $oDocumentModel->getDocument($document_srl, false, false); } else { $document_srl = 0; $oDocument = $oDocumentModel->getDocument(0); if ($material_srl) { $oMaterialModel =& getModel('material'); $output = $oMaterialModel->getMaterial($material_srl); if ($output->data) { $material_content = $output->data[0]->content; Context::set('material_content', $material_content); } } } $category_list = $oDocumentModel->getCategoryList($this->module_srl); Context::set('category_list', $category_list); $oTagModel =& getModel('tag'); $args->module_srl = $this->module_srl; $args->list_count = 20; $output = $oTagModel->getTagList($args); Context::set('tag_list', $output->data); $oEditorModel =& getModel('editor'); $option->skin = $this->textyle->getPostEditorSkin(); $option->primary_key_name = 'document_srl'; $option->content_key_name = 'content'; $option->allow_fileupload = true; $option->enable_autosave = true; $option->enable_default_component = true; $option->enable_component = $option->skin == 'dreditor' ? false : true; $option->resizable = true; $option->height = 500; $option->content_font = $this->textyle->getFontFamily(); $option->content_font_size = $this->textyle->getFontSize(); $editor = $oEditorModel->getEditor($document_srl, $option); Context::set('editor', $editor); Context::set('editor_skin', $option->skin); // permalink $permalink = ''; if (isSiteID($this->textyle->domain)) { if (Context::isAllowRewrite()) { $permalink = getFullSiteUrl($this->textyle->domain, '') . '/entry/'; } else { $permalink = getFullSiteUrl($this->textyle->domain) . '?vid=' . $this->textyle->domain . '&mid=' . Context::get('mid') . '&entry='; } } else { if (Context::isAllowRewrite()) { $permalink = getFullSiteUrl($this->textyle->domain, '') . 'entry/'; } else { $premalink = getFullSiteUrl($this->textyle->domain, '', 'mid', Context::get('mid')) . '&entry='; } } Context::set('permalink', $permalink); $oTextyleModel =& getModel('textyle'); $alias = $oDocumentModel->getAlias($document_srl); Context::set('alias', $alias); $output = $oTextyleModel->getSubscriptionByDocumentSrl($document_srl); if ($output->data) { $publish_date = $output->data[0]->publish_date; $publish_date = sscanf($publish_date, '%04d%02d%02d%02d%02d'); Context::set('publish_date_yyyymmdd', sprintf("%s-%02d-%02d", $publish_date[0], $publish_date[1], $publish_date[2])); Context::set('publish_date_hh', sprintf("%02d", $publish_date[3])); Context::set('publish_date_ii', sprintf("%02d", $publish_date[4])); Context::set('subscription', 'Y'); } if ($oDocument->get('module_srl') != $this->module_srl && !$document_srl) { Context::set('from_saved', true); } $oPublish = $oTextyleModel->getPublishObject($this->module_srl, $oDocument->document_srl); if (count($oPublish->trackbacks)) { $trackbacks = $oPublish->getTrackbacks(); } if (count($oPublish->blogapis)) { $_apis = $oPublish->getApis(); } Context::set('oDocument', $oDocument); Context::set('oTextyle', $oTextyleModel->getTextyle($this->module_srl)); Context::set('oPublish', $oPublish); Context::set('category_list', $oDocumentModel->getCategoryList($this->module_srl)); Context::set('trackbacks', $trackbacks); Context::set('_apis', $_apis); }
public static function getUrl($pattern = null, $relative = true) { return ($relative ? '' : getFullSiteUrl()) . Context::pathToUrl(_XE_PATH_) . BaseRepository::vid() . '/' . $pattern; }
function processReview($args) { require_once $this->module_path . 'CallerService.php'; $cs = new CallerService(); $currencyCodeType = $this->plugin_info->currency_code; $paymentType = 'Sale'; $L_NAME0 = urlencode($args->order_title); $L_AMT0 = $args->price; if ($this->plugin_info->conversion_rate) { $L_AMT0 = round($args->price * $this->plugin_info->conversion_rate, 2); } $L_QTY0 = '1'; $L_NUMBER0 = $args->order_srl; $returnURL = urlencode(getNotEncodedFullUrl('', 'module', 'epay', 'act', 'procEpayDoPayment', 'epay_module_srl', $args->epay_module_srl, 'plugin_srl', $args->plugin_srl, 'order_srl', $args->order_srl, 'currencyCodeType', $currencyCodeType, 'paymentType', $paymentType)); $cancelURL = urlencode(getNotEncodedFullUrl('')); $itemamt = 0.0; $itemamt = $L_QTY0 * $L_AMT0; $amt = $itemamt; $maxamt = $amt + 25.0; $nvpstr = ""; $nvpstr = "&L_NAME0=" . $L_NAME0 . "&L_AMT0=" . $L_AMT0 . "&L_QTY0=" . $L_QTY0 . "&MAXAMT=" . (string) $maxamt . "&AMT=" . (string) $amt . "&ITEMAMT=" . (string) $itemamt . "&CALLBACKTIMEOUT=4&L_NUMBER0=" . $L_NUMBER0 . "&L_DESC0=" . $L_NAME0 . "&RETURNURL=" . $returnURL . "&CANCELURL=" . $cancelURL . "&CURRENCYCODE=" . $currencyCodeType . "&PAYMENTACTION=" . $paymentType; if ($this->plugin_info->logo_image) { $nvpstr .= "&HDRIMG=" . getFullSiteUrl() . $this->plugin_info->logo_image; } $nvpstr = $nvpHeader . $nvpstr; debugPrint('$nvpstr'); debugPrint($nvpstr); /* Make the call to PayPal to set the Express Checkout token If the API call succeded, then redirect the buyer to PayPal to begin to authorize payment. If an error occured, show the resulting errors */ $resArray = $cs->hash_call("SetExpressCheckout", $nvpstr); $_SESSION['reshash'] = $resArray; $ack = strtoupper($resArray["ACK"]); Context::set('resArray', $resArray); if ($ack == "SUCCESS") { // Redirect to paypal.com here $token = urldecode($resArray["TOKEN"]); $payPalURL = PAYPAL_URL . $token; $output = new Object(); $output->add('return_url', $payPalURL); return $output; } else { $errorCode = $_SESSION['curl_error_no']; $errorMessage = $_SESSION['curl_error_msg']; Context::set('errorCode', $errorCode); Context::set('errorMessage', $errorMessage); $oTemplate =& TemplateHandler::getInstance(); $tpl_path = _XE_PATH_ . "modules/epay/plugins/paypal/tpl"; $tpl_file = 'api_error.html'; $html = $oTemplate->compile($tpl_path, $tpl_file); $output = new Object(-1); $output->data = $html; $output->setMessage($html); return $output; } return new Object(); }
/** * Import member information * @param int $key * @param int $cur * @param string $index_file * @return int */ function importMember($key, $cur, $index_file) { if (!$cur) { $cur = 0; } // Create the xmlParser object $oXmlParser = new XmlParser(); // Create objects for importing member information $this->oMemberController = getController('member'); $this->oMemberModel = getModel('member'); // Get a default member group $default_group = $this->oMemberModel->getDefaultGroup(); $default_group_srl = $default_group->group_srl; // Get information of the Webmaster $oModuleModel = getModel('module'); $member_config = $oModuleModel->getModuleConfig('member'); // Open an index file $f = fopen($index_file, "r"); // Pass if already read for ($i = 0; $i < $cur; $i++) { fgets($f, 1024); } // Read by each line until the condition meets for ($idx = $cur; $idx < $cur + $this->unit_count; $idx++) { if (feof($f)) { break; } // Find a given location $target_file = trim(fgets($f, 1024)); // Load and parse the file $xmlObj = $oXmlParser->loadXmlFile($target_file); FileHandler::removeFile($target_file); if (!$xmlObj) { continue; } // List Objects $obj = null; $obj->user_id = base64_decode($xmlObj->member->user_id->body); $obj->password = base64_decode($xmlObj->member->password->body); $obj->user_name = base64_decode($xmlObj->member->user_name->body); $obj->nick_name = base64_decode($xmlObj->member->nick_name->body); if (!$obj->user_name) { $obj->user_name = $obj->nick_name; } $obj->email = base64_decode($xmlObj->member->email->body); $obj->homepage = base64_decode($xmlObj->member->homepage->body); $obj->blog = base64_decode($xmlObj->member->blog->body); $obj->birthday = substr(base64_decode($xmlObj->member->birthday->body), 0, 8); $obj->allow_mailing = base64_decode($xmlObj->member->allow_mailing->body); $obj->point = base64_decode($xmlObj->member->point->body); $obj->image_nickname = base64_decode($xmlObj->member->image_nickname->buff->body); $obj->image_mark = base64_decode($xmlObj->member->image_mark->buff->body); $obj->profile_image = base64_decode($xmlObj->member->profile_image->buff->body); $obj->signature = base64_decode($xmlObj->member->signature->body); $obj->regdate = base64_decode($xmlObj->member->regdate->body); $obj->last_login = base64_decode($xmlObj->member->last_login->body); if ($xmlObj->member->extra_vars) { foreach ($xmlObj->member->extra_vars as $key => $val) { if (in_array($key, array('node_name', 'attrs', 'body'))) { continue; } $obj->extra_vars->{$key} = base64_decode($val->body); } } // Create url for homepage and blog if ($obj->homepage && strncasecmp('http://', $obj->homepage, 7) !== 0 && strncasecmp('https://', $obj->homepage, 8) !== 0) { $obj->homepage = 'http://' . $obj->homepage; } // email address column $obj->email_address = $obj->email; list($obj->email_id, $obj->email_host) = explode('@', $obj->email); // Set the mailing option if ($obj->allow_mailing != 'Y') { $obj->allow_mailing = 'N'; } // Set the message option $obj->allow_message = 'Y'; if (!in_array($obj->allow_message, array('Y', 'N', 'F'))) { $obj->allow_message = 'Y'; } // Get member-join date if the last login time is not found if (!$obj->last_login) { $obj->last_login = $obj->regdate; } // Get a member_srl $obj->member_srl = getNextSequence(); $obj->list_order = -1 * $obj->member_srl; // List extra vars $extra_vars = $obj->extra_vars; unset($obj->extra_vars); $obj->extra_vars = serialize($extra_vars); // Check if the same nickname is existing $nick_args = new stdClass(); $nick_args->nick_name = $obj->nick_name; $nick_output = executeQuery('member.getMemberSrl', $nick_args); if (!$nick_output->toBool()) { $obj->nick_name .= '_' . $obj->member_srl; } // Add a member $output = executeQuery('member.insertMember', $obj); if ($output->toBool() && !$obj->password) { // Send a mail telling the user to reset his password. $oMail = new Mail(); $oMail->setTitle("Password update for your " . getFullSiteUrl() . " account"); $webmaster_name = $member_config->webmaster_name ? $member_config->webmaster_name : 'Webmaster'; $oMail->setContent("Dear {$obj->user_name}, <br /><br />\n\t\t\t\t\t\tWe recently migrated our phpBB forum to XpressEngine. Since you password was encrypted we could not migrate it too, so please reset it by following this link:\n\t\t\t\t\t\t<a href='" . getFullSiteUrl() . "/?act=dispMemberFindAccount' >" . getFullSiteUrl() . "?act=dispMemberFindAccount</a>. You need to enter you email address and hit the 'Find account' button. You will then receive an email with a new, generated password that you can change after login. <br /><br />\n\n\t\t\t\t\t\tThank you for your understanding,<br />\n\t\t\t\t\t\t{$webmaster_name}"); $oMail->setSender($webmaster_name, $member_config->webmaster_email); $oMail->setReceiptor($obj->user_name, $obj->email); $oMail->send(); } // add group join/image name-mark-signiture and so on if a new member successfully added if ($output->toBool()) { // Join to the default group $obj->group_srl = $default_group_srl; executeQuery('member.addMemberToGroup', $obj); // Image name if ($obj->image_nickname) { $target_path = sprintf('files/member_extra_info/image_name/%s/', getNumberingPath($obj->member_srl)); $target_filename = sprintf('%s%d.gif', $target_path, $obj->member_srl); FileHandler::writeFile($target_filename, $obj->image_nickname); } // Image mark if ($obj->image_mark && file_exists($obj->image_mark)) { $target_path = sprintf('files/member_extra_info/image_mark/%s/', getNumberingPath($obj->member_srl)); $target_filename = sprintf('%s%d.gif', $target_path, $obj->member_srl); FileHandler::writeFile($target_filename, $obj->image_mark); } // Profile image if ($obj->profile_image) { $target_path = sprintf('files/member_extra_info/profile_image/%s/', getNumberingPath($obj->member_srl)); $target_filename = sprintf('%s%d.gif', $target_path, $obj->member_srl); FileHandler::writeFile($target_filename, $obj->profile_image); } // Signiture if ($obj->signature) { $signature = removeHackTag($obj->signature); $signature_buff = sprintf('<?php if(!defined("__XE__")) exit();?>%s', $signature); $target_path = sprintf('files/member_extra_info/signature/%s/', getNumberingPath($obj->member_srl)); if (!is_dir($target_path)) { FileHandler::makeDir($target_path); } $target_filename = sprintf('%s%d.signature.php', $target_path, $obj->member_srl); FileHandler::writeFile($target_filename, $signature_buff); } } } fclose($f); return $idx - 1; }
function getAlternativeHref($module_info = null) { if ($this->site_url == null) { $this->init(); } if (!$module_info) { return sprintf('http://%s', $this->site_url); } if (!$module_info->site_srl) { return getFullUrl('', 'mid', $module_info->mid); } $domain = $module_info->domain; $url = getFullSiteUrl($domain, '', 'mid', $module_info->mid); if (substr($url, 0, 1) == '/') { $domain = 'http://' . $this->site_url . $url; } return $url; }
$post->publish = 1; $post->userid = $oDocument->get('user_id'); $post->mt_allow_pings = 0; $post->mt_allow_comments = $oDocument->allowComment() ? 1 : 0; $posts[] = $post; } $content = getXmlRpcResponse($posts); printContent($content); } break; // Display RSD if there is no request // Display RSD if there is no request default: $homepagelink = getUrl('', 'mid', $this->mid); $site_module_info = Context::get('site_module_info'); $api_url = getFullSiteUrl($site_module_info->domain, '', 'mid', $site_module_info->mid, 'act', 'api'); $content = <<<RSDContent <?xml version="1.0" ?> <rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd" > <service> <engineName>XpressEngine</engineName> <engineLink>http://www.xpressengine.com/ </engineLink> <homePageLink>{$homepagelink}</homePageLink> <apis> <api name="MetaWeblog" preferred="true" apiLink="{$api_url}" blogID="" /> </apis> </service> </rsd> RSDContent; printContent($content); break;
function getTrackbackUrl($domain, $document_srl) { $oTrackbackModel =& getModel('trackback'); $key = $oTrackbackModel->getTrackbackKey($document_srl); return getFullSiteUrl($domain, '', 'document_srl', $document_srl, 'key', $key, 'act', 'trackback'); }
/** * Send email to new users */ public function triggerSendSignUpEmail($member_args) { $site_module_info = Context::get('site_module_info'); $module_srl = $site_module_info->index_module_srl; $shop = new ShopInfo($module_srl); // Don't send anything if sender and receiver email addresses are missing if(!$shop->getEmail() || !$member_args->email_address) { ShopLogger::log("Failed to send welcome email to user. Member email is not set." . print_r($member_args, TRUE)); return; } global $lang; $email_subject = sprintf($lang->new_member_email_subject , $shop->getShopTitle() ); $email_content = sprintf($lang->new_member_email_content , getFullSiteUrl('', 'act', 'dispShopHome') , $shop->getShopTitle() , getFullSiteUrl('', 'act', 'dispShopMyAccount') , getFullSiteUrl('', 'act', 'dispShopHome') , $shop->getShopTitle() ); $oMail = new Mail(); $oMail->setTitle($email_subject); $oMail->setContent($email_content); $oMail->setSender($shop->getShopTitle(), $shop->getShopEmail()); $oMail->setReceiptor(FALSE, $member_args->email_address); $oMail->send(); }
echo $__Context->vid; ?> " /><input type="hidden" name="ruleset" value="insertRssConfig" /> <input type="hidden" name="module" value="rss" /> <input type="hidden" name="act" value="procRssAdminInsertConfig" /> <input type="hidden" name="xe_validator_id" value="modules/rss/tpl/rss_admin_index/1" /> <div class="x_control-group"> <div class="x_control-label"><?php echo $__Context->lang->url; ?> </div> <div class="x_controls" style="padding-top:5px"><a href="<?php echo getFullSiteUrl(); ?> rss" target="_blank"><?php echo getFullSiteUrl(); ?> rss</a></div> </div> <div class="x_control-group"> <label class="x_control-label"><?php echo $__Context->lang->total_feed; ?> </label> <div class="x_controls"> <label class="x_inline"> <input type="radio" name="use_total_feed" value="Y" id="use_total_feed_yes"<?php if (!$__Context->total_config->use_total_feed || $__Context->total_config->use_total_feed == 'Y') { ?> checked="checked"<?php }
/** * shop init service **/ public function initService(&$oModule, $is_other_module = FALSE, $isMobile = FALSE){ if (!$oModule) $oModule = $this; /** @var $oShopModel shopModel */ $oShopModel = getModel('shop'); $this->initCommon($is_other_module); Context::addJsFile($this->module_path.'tpl/js/shop_service.js'); $preview_skin = Context::get('preview_skin'); if(!$isMobile) { if($is_other_module){ $path_method = 'setLayoutPath'; $file_method = 'setLayoutFile'; $css_path_method = 'getLayoutPath'; Context::set('shop_mode', 'module'); Context::set('external_module', $oModule->module); }else{ $path_method = 'setTemplatePath'; $file_method = 'setTemplateFile'; $css_path_method = 'getTemplatePath'; } if(!$preview_skin){ $oShopModel->checkShopPath($this->module_srl, $this->module_info->skin); $oModule->{$path_method}($oShopModel->getShopPath($this->module_srl)); }else{ $oModule->{$path_method}($this->module_path.'skins/'.$preview_skin); } $oModule->{$file_method}('shop'); Context::addCssFile($oModule->{$css_path_method}().'shop.css',TRUE,'all','',100); } Context::set('root_url', Context::getRequestUri()); Context::set('home_url', getFullSiteUrl($this->shop->domain)); Context::set('profile_url', getSiteUrl($this->shop->domain,'','mid',$this->module_info->mid,'act','dispShopProfile')); if(Context::get('is_logged')) Context::set('admin_url', getSiteUrl($this->shop->domain,'','mid',$this->module_info->mid,'act','dispShopToolDashboard')); else Context::set('admin_url', getSiteUrl($this->shop->domain,'','mid','shop','act','dispShopToolLogin')); Context::set('shop_title', $this->shop->get('shop_title')); // set browser title Context::setBrowserTitle($this->shop->get('browser_title')); // Load cart for display on all pages (in header) $cartRepo = new CartRepository(); $logged_info = Context::get('logged_info'); // If cart doesn't exist, create new one $cart = $cartRepo->getCart($this->module_srl, NULL, $logged_info->member_srl, session_id(), TRUE); Context::set('cart', $cart); // Load cart preview (for ajax cart feature in header) $cart_preview = new CartPreview($cart, 3); Context::set('cart_preview', $cart_preview); // Load menu for display on all pages (in header) $shop = Context::get('shop'); $menus = $shop->getMenus(); foreach($menus as $menu_key => $menu_srl) { $menu = new ShopMenu($menu_srl); Context::set($menu_key, $menu->getHtml()); } // Load categories for display in search dropdown (header) $category_repository = new CategoryRepository(); $tree = $category_repository->getNavigationCategoriesTree($this->module_srl); $flat_tree = $tree->toFlatStructure(); Context::set('search_categories', $flat_tree); }
private static function sendNewOrderMailToAdministrator($shop, $order) { // Don't send anything if admin email is not configured if (!$shop->getEmail()) { ShopLogger::log("Failed to send order email to admin for order #{$order->order_srl}; Admin email is not configured"); return; } global $lang; $admin_email_subject = sprintf($lang->admin_order_email_subject, $order->client_name, ShopDisplay::priceFormat($order->total, $shop->getCurrencySymbol())); Context::set('email_order', $order); $oTemplateHandler = TemplateHandler::getInstance(); $order_content = $oTemplateHandler->compile('./modules/shop/tpl', 'order_email.html'); $admin_email_content = sprintf($lang->admin_order_email_content, getFullSiteUrl('', 'act', 'dispShopToolViewOrder', 'order_srl', $order->order_srl), $order->order_srl, $order_content); $oMail = new Mail(); $oMail->setTitle($admin_email_subject); $oMail->setContent($admin_email_content); $oMail->setSender($shop->getShopTitle(), $shop->getShopEmail()); $oMail->setReceiptor(false, $shop->getEmail()); $oMail->send(); }