private function ManageSettings($messages = array()) { if (!gzte11(ISC_HUGEPRINT)) { $GLOBALS['HideVendorOptions'] = 'display: none'; } $GLOBALS['Message'] = GetFlashMessageBoxes(); if (GetConfig('UseWYSIWYG')) { $GLOBALS['IsWYSIWYGEnabled'] = 'checked="checked"'; } if (GetConfig('ShowThumbsInControlPanel')) { $GLOBALS['IsProductThumbnailsEnabled'] = 'checked="checked"'; } if (GetConfig('DesignMode')) { $GLOBALS['IsDesignMode'] = 'checked="checked"'; } if (GetConfig('UseSSL')) { $GLOBALS['IsSSLEnabled'] = 'checked="checked"'; } if (GetConfig('AllowPurchasing')) { $GLOBALS['IsPurchasingEnabled'] = 'checked="checked"'; } switch (GetConfig('WeightMeasurement')) { case 'LBS': $GLOBALS['IsPounds'] = 'selected="selected"'; break; case 'Ounces': $GLOBALS['IsOunces'] = 'selected="selected"'; break; case 'KGS': $GLOBALS['IsKilos'] = 'selected="selected"'; break; case 'Grams': $GLOBALS['IsGrams'] = 'selected="selected"'; break; case 'Tonnes': $GLOBLAS['IsTonnes'] = 'selected="selected"'; } if (GetConfig('LengthMeasurement') == "Inches") { $GLOBALS['IsInches'] = 'selected="selected"'; } else { $GLOBALS['IsCentimeters'] = 'selected="selected"'; } $GLOBALS['ShippingFactoringDimensionDepthSelected'] = ''; $GLOBALS['ShippingFactoringDimensionHeightSelected'] = ''; $GLOBALS['ShippingFactoringDimensionWidthSelected'] = ''; switch (GetConfig('ShippingFactoringDimension')) { case 'height': $GLOBALS['ShippingFactoringDimensionHeightSelected'] = 'selected="selected"'; break; case 'width': $GLOBALS['ShippingFactoringDimensionWidthSelected'] = 'selected="selected"'; break; case 'depth': default: $GLOBALS['ShippingFactoringDimensionDepthSelected'] = 'selected="selected"'; break; } if (GetConfig('TagCartQuantityBoxes') == "dropdown") { $GLOBALS['IsDropdown'] = 'selected="selected"'; } else { $GLOBALS['IsTextbox'] = 'selected="selected"'; } if (GetConfig('AddToCartButtonPosition') == "middle") { $GLOBALS['IsMiddle'] = 'selected="selected"'; } else { $GLOBALS['IsSide'] = 'selected="selected"'; } if (GetConfig('TagCloudsEnabled')) { $GLOBALS['IsTagCloudsEnabled'] = 'checked="checked"'; } if (GetConfig('BulkDiscountEnabled')) { $GLOBALS['IsBulkDiscountEnabled'] = 'checked="checked"'; } if (GetConfig('EnableProductTabs')) { $GLOBALS['IsProductTabsEnabled'] = 'checked="checked"'; } if (GetConfig('ShowAddToCartQtyBox')) { $GLOBALS['IsShownAddToCartQtyBox'] = 'checked="checked"'; } if (GetConfig('CaptchaEnabled')) { $GLOBALS['IsCaptchaEnabled'] = 'checked="checked"'; } if (GetConfig('StoreDSTCorrection')) { $GLOBALS['IsDSTCorrectionEnabled'] = "checked=\"checked\""; } if (GetConfig('ShowCartSuggestions')) { $GLOBALS['IsShowCartSuggestions'] = 'checked="checked"'; } if (GetConfig('ShowThumbsInCart')) { $GLOBALS['IsShowThumbsInCart'] = 'checked="checked"'; } if (GetConfig('TagCloudsEnabled')) { $GLOBALS['IsTagCloudsEnabled'] = 'checked="checked"'; } if (GetConfig('ShowAddToCartQtyBox')) { $GLOBALS['IsShownAddToCartQtyBox'] = 'checked="checked"'; } if (GetConfig('AutoApproveReviews')) { $GLOBALS['IsAutoApproveReviews'] = 'checked="checked"'; } if (GetConfig('SearchSuggest')) { $GLOBALS['IsSearchSuggest'] = 'checked="checked"'; } if (GetConfig('QuickSearch')) { $GLOBALS['IsQuickSearch'] = 'checked="checked"'; } if (GetConfig('ShowInventory')) { $GLOBALS['IsShowInventory'] = 'checked="checked"'; } // Bulk Discount Settings if (GetConfig('BulkDiscountEnabled')) { $GLOBALS['IsBulkDiscountEnabled'] = 'checked="checked"'; } if (GetConfig('EnableProductTabs')) { $GLOBALS['IsProductTabsEnabled'] = 'checked="checked"'; } // RSS Settings if (GetConfig('RSSNewProducts')) { $GLOBALS['IsRSSNewProductsEnabled'] = 'checked="checked"'; } if (GetConfig('RSSPopularProducts')) { $GLOBALS['IsRSSPopularProductsEnabled'] = 'checked="checked"'; } if (GetConfig('RSSCategories')) { $GLOBALS['IsRSSCategoriesEnabled'] = 'checked="checked"'; } if (GetConfig('RSSProductSearches')) { $GLOBALS['IsRSSProductSearchesEnabled'] = 'checked="checked"'; } if (GetConfig('RSSLatestBlogEntries')) { $GLOBALS['IsRSSLatestBlogEntriesEnabled'] = 'checked="checked"'; } if (GetConfig('RSSSyndicationIcons')) { $GLOBALS['IsRSSSyndicationIconsEnabled'] = 'checked="checked"'; } // Backup Settings if (GetConfig('BackupsLocal')) { $GLOBALS['IsBackupsLocalEnabled'] = 'checked="checked"'; } if (GetConfig('BackupsRemoteFTP')) { $GLOBALS['IsBackupsRemoteFTPEnabled'] = 'checked="checked"'; } if (GetConfig('BackupsAutomatic')) { $GLOBALS['IsBackupsAutomaticEnabled'] = 'checked="checked"'; } if (GetConfig('HTTPSSLVerifyPeer')) { $GLOBALS['IsHTTPSSLVerifyPeerEnabled'] = 'checked="checked"'; } if (GetConfig('ShowMailingListInvite')) { $GLOBALS['IsShowMailingListInvite'] = 'checked="checked"'; } if (strpos(strtolower(PHP_OS), 'win') === 0) { $binary = 'php.exe'; $path_to_php = Which($binary); } else { // Check if there is a separate PHP 5 binary first foreach (array('php5', 'php') as $phpBin) { $path_to_php = Which($phpBin); if ($path_to_php !== '') { break; } } } if ($path_to_php === '' && strpos(strtolower(PHP_OS), 'win') === 0) { $path_to_php = 'php.exe'; } elseif ($path_to_php === '') { $path_to_php = 'php'; } $GLOBALS['BackupsAutomaticPath'] = $path_to_php . ' -f ' . realpath(ISC_BASE_PATH . "/admin") . "/cron-backup.php"; if (GetConfig('BackupsAutomaticMethod') == "ftp") { $GLOBALS['IsBackupsAutomaticMethodFTP'] = 'selected="selected"'; } else { $GLOBALS['IsBackupsAutomaticMethodLocal'] = 'selected="selected"'; } if (GetConfig('BackupsAutomaticDatabase')) { $GLOBALS['IsBackupsAutomaticDatabaseEnabled'] = 'checked="checked"'; } if (GetConfig('BackupsAutomaticImages')) { $GLOBALS['IsBackupsAutomaticImagesEnabled'] = 'checked="checked"'; } if (GetConfig('BackupsAutomaticDownloads')) { $GLOBALS['IsBackupsAutomaticDownloadsEnabled'] = 'checked="checked"'; } $GLOBALS['LanguageOptions'] = $this->GetLanguageOptions(GetConfig('Language')); if (!function_exists('ftp_connect')) { $GLOBALS['FTPBackupsHide'] = "none"; } $GLOBALS['TimeZoneOptions'] = $this->GetTimeZoneOptions(GetConfig('StoreTimeZone')); $query = sprintf("select version() as version"); $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $row = $GLOBALS['ISC_CLASS_DB']->Fetch($result); $GLOBALS['dbVersion'] = $row['version']; // Hide the special offers tickbox if Interspire Email Marketer isn't integrated if (!(GetConfig('MailXMLAPIValid') && GetConfig('UseMailerForOrders') && GetConfig('MailOrderList') > 0)) { $GLOBALS['HideSpecialOffersBox'] = "none"; } if (GetConfig('MailAutomaticallyTickNewsletterBox')) { $GLOBALS['IsNewsletterBoxTicked'] = 'checked="checked"'; } if (GetConfig('MailAutomaticallyTickOrderBox')) { $GLOBALS['IsOrderBoxTicked'] = 'checked="checked"'; } // Logging Settings if (GetConfig('SystemLogging')) { $GLOBALS['IsSystemLoggingEnabled'] = "checked=\"checked\""; } if (GetConfig('DebugMode')) { $GLOBALS['IsDebugModeEnabled'] = "checked=\"checked\""; } if (GetConfig('SystemLogTypes')) { $types = explode(",", GetConfig('SystemLogTypes')); if (in_array('general', $types)) { $GLOBALS['IsGeneralLoggingEnabled'] = "selected=\"selected\""; } if (in_array('payment', $types)) { $GLOBALS['IsPaymentLoggingEnabled'] = "selected=\"selected\""; } if (in_array('shipping', $types)) { $GLOBALS['IsShippingLoggingEnabled'] = "selected=\"selected\""; } if (in_array('notification', $types)) { $GLOBALS['IsNotificationLoggingEnabled'] = "selected=\"selected\""; } if (in_array('ssnx', $types)) { $GLOBALS['IsSendStudioLoggingEnabled'] = "selected=\"selected\""; } if (in_array('sql', $types)) { $GLOBALS['IsSQLLoggingEnabled'] = "selected=\"selected\""; } if (in_array('php', $types)) { $GLOBALS['IsPHPLoggingEnabled'] = "selected=\"selected\""; } } if (GetConfig('SystemLogSeverity')) { $severities = explode(",", GetConfig('SystemLogSeverity')); if (in_array('errors', $severities)) { $GLOBALS['IsLoggingSeverityErrors'] = "selected=\"selected\""; } if (in_array('warnings', $severities)) { $GLOBALS['IsLoggingSeverityWarnings'] = "selected=\"selected\""; } if (in_array('notices', $severities)) { $GLOBALS['IsLoggingSeverityNotices'] = "selected=\"selected\""; } if (in_array('success', $severities)) { $GLOBALS['IsLoggingSeveritySuccesses'] = "selected=\"selected\""; } if (in_array('debug', $severities)) { $GLOBALS['IsLoggingSeverityDebug'] = "selected=\"selected\""; } } if (GetConfig('EnableSEOUrls') == 2) { $GLOBALS['IsEnableSEOUrlsAuto'] = "selected=\"selected\""; } else { if (GetConfig('EnableSEOUrls') == 1) { $GLOBALS['IsEnableSEOUrlsEnabled'] = "selected=\"selected\""; } else { $GLOBALS['IsEnableSEOUrlsDisabled'] = "selected=\"selected\""; } } if (!gzte11(ISC_MEDIUMPRINT)) { $GLOBALS['HideBackupSettings'] = "none"; } if (GetConfig('AdministratorLogging')) { $GLOBALS['IsAdministratorLoggingEnabled'] = "checked=\"checked\""; } if (GetConfig('HidePHPErrors')) { $GLOBALS['IsHidePHPErrorsEnabled'] = "checked=\"checked\""; } if (GetConfig('EnableWishlist')) { $GLOBALS['IsWishlistEnabled'] = "checked=\"checked\""; } if (GetConfig('EnableAccountCreation')) { $GLOBALS['IsEnableAccountCreation'] = "checked=\"checked\""; } if (GetConfig('EnableProductReviews')) { $GLOBALS['IsEnableProductReviews'] = "checked=\"checked\""; } if (GetConfig('EnableProductComparisons')) { $GLOBALS['IsEnableProductComparisons'] = "checked=\"checked\""; } // Product display settings if (GetConfig('ShowProductPrice')) { $GLOBALS['IsProductPriceShown'] = 'CHECKED'; } if (GetConfig('ShowProductSKU')) { $GLOBALS['IsProductSKUShown'] = 'CHECKED'; } if (GetConfig('ShowProductWeight')) { $GLOBALS['IsProductWeightShown'] = 'CHECKED'; } if (GetConfig('ShowProductBrand')) { $GLOBALS['IsProductBrandShown'] = 'CHECKED'; } if (GetConfig('ShowProductShipping')) { $GLOBALS['IsProductShippingShown'] = 'CHECKED'; } if (GetConfig('ShowProductRating')) { $GLOBALS['IsProductRatingShown'] = 'CHECKED'; } if (GetConfig('ShowAddToCartLink')) { $GLOBALS['IsAddToCartLinkShown'] = 'CHECKED'; } if (GetConfig('LowInventoryNotificationAddress') != '') { $GLOBALS['LowInventoryEmailsEnabledCheck'] = "checked=\"checked\""; } else { $GLOBALS['HideLowInventoryNotification'] = "none"; } if (GetConfig('ForwardInvoiceEmails') != '') { $GLOBALS['ForwardInvoiceEmailsCheck'] = "checked=\"checked\""; } else { $GLOBALS['HideForwardInvoiceEmails'] = 'none'; } if (GetConfig('MailUseSMTP')) { $GLOBALS['HideMailSMTPSettings'] = ''; $GLOBALS['MailUseSMTPChecked'] = "checked=\"checked\""; } else { $GLOBALS['HideMailSMTPSettings'] = 'none'; $GLOBALS['MailUsePHPChecked'] = "checked=\"checked\""; } if (GetConfig('ProductImageMode') == "lightbox") { $GLOBALS['ProductImageModeLightbox'] = 'selected="selected"'; } else { $GLOBALS['ProductImageModePopup'] = 'selected="selected"'; } if (GetConfig('CategoryDisplayMode') == "grid") { $GLOBALS['CategoryDisplayModeGrid'] = 'selected="selected"'; } else { $GLOBALS['CategoryDisplayModeList'] = 'selected="selected"'; } if (GetConfig('CategoryDefaultImage') !== '') { $GLOBALS['CatImageDefaultSettingMessage'] = sprintf(GetLang('CatImageDefaultSettingDesc'), GetConfig('ShopPath') . '/' . GetConfig('CategoryDefaultImage'), GetConfig('CategoryDefaultImage')); } else { $GLOBALS['CatImageDefaultSettingMessage'] = sprintf(GetLang('BrandImageDefaultSettingNoDeleteDesc'), GetConfig('ShopPath') . '/templates/' . GetConfig('template') . '/images/CategoryDefault.gif', 'templates/' . GetConfig('template') . '/images/CategoryDefault.gif'); } if (GetConfig('BrandDefaultImage') !== '') { $GLOBALS['BrandImageDefaultSettingMessage'] = sprintf(GetLang('BrandImageDefaultSettingDesc'), GetConfig('ShopPath') . '/' . GetConfig('BrandDefaultImage'), GetConfig('BrandDefaultImage')); } else { $GLOBALS['BrandImageDefaultSettingMessage'] = sprintf(GetLang('BrandImageDefaultSettingNoDeleteDesc'), GetConfig('ShopPath') . '/templates/' . GetConfig('template') . '/images/BrandDefault.gif', 'templates/' . GetConfig('template') . '/images/BrandDefault.gif'); } $GLOBALS['HideCurrentDefaultProductImage'] = 'display: none'; switch (GetConfig('DefaultProductImage')) { case 'template': $GLOBALS['DefaultProductImageTemplateChecked'] = 'checked="checked"'; break; case '': $GLOBALS['DefaultProductImageNoneChecked'] = 'checked="checked"'; break; default: $GLOBALS['DefaultProductImageCustomChecked'] = 'checked="checked"'; $GLOBALS['HideCurrentDefaultProductImage'] = ''; $GLOBALS['DefaultProductImage'] = GetConfig('DefaultProductImage'); } if (GetConfig('CategoryListingMode') == 'children') { $GLOBALS['CategoryListModeChildren'] = "checked=\"checked\""; } else { if (GetConfig('CategoryListingMode') == 'emptychildren') { $GLOBALS['CategoryListModeEmptyChildren'] = "checked=\"checked\""; } else { $GLOBALS['CategoryListModeSingle'] = "checked=\"checked\""; } } // Get a list of the customer groups $query = 'SELECT * FROM [|PREFIX|]customer_groups ORDER BY groupname ASC'; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $GLOBALS['CustomerGroupOptions'] = ''; while ($group = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { if (GetConfig('GuestCustomerGroup') == $group['customergroupid']) { $sel = 'selected="selected"'; } else { $sel = ''; } $GLOBALS['CustomerGroupOptions'] .= "<option value=\"" . $group['customergroupid'] . "\" " . $sel . ">" . isc_html_escape($group['groupname']) . "</option>"; } // Workout the HTTPS URL $GLOBALS['CompleteStorePath'] = fix_url($_SERVER['PHP_SELF']); $GLOBALS['HTTPSUrl'] = str_replace("http://", "https://", isc_strtolower($GLOBALS['ShopPath'])); $GLOBALS['HideVendorSettings'] = 'display: none'; if (gzte11(ISC_HUGEPRINT)) { $GLOBALS['HideVendorSettings'] = ''; } if (GetConfig('VendorLogoSize')) { $logoDimensions = explode('x', GetConfig('VendorLogoSize')); $GLOBALS['VendorLogoSizeW'] = (int) $logoDimensions[0]; $GLOBALS['VendorLogoSizeH'] = (int) $logoDimensions[1]; $GLOBALS['HideVendorLogoUploading'] = ''; $GLOBALS['VendorLogoUploadingChecked'] = 'checked="checked"'; } else { $GLOBALS['HideVendorLogoUploading'] = 'display: none'; } if (GetConfig('VendorPhotoSize')) { $photoDimensions = explode('x', GetConfig('VendorPhotoSize')); $GLOBALS['VendorPhotoSizeW'] = (int) $photoDimensions[0]; $GLOBALS['VendorPhotoSizeH'] = (int) $photoDimensions[1]; $GLOBALS['HideVendorPhotoUploading'] = ''; $GLOBALS['VendorPhotoUploadingChecked'] = 'checked="checked"'; } else { $GLOBALS['HideVendorPhotoUploading'] = 'display: none'; } foreach ($this->all_vars as $var) { if (is_string(GetConfig($var)) || is_numeric(GetConfig($var))) { $GLOBALS[$var] = isc_html_escape(GetConfig($var)); } } if (GetConfig('DisableDatabaseDetailFields')) { $GLOBALS['dbType'] = ''; $GLOBALS['dbServer'] = ''; $GLOBALS['dbUser'] = ''; $GLOBALS['dbPass'] = ''; $GLOBALS['dbDatabase'] = ''; $GLOBALS['tablePrefix'] = ''; $GLOBALS['HideDatabaseDetails'] = 'display: none'; } if (GetConfig('DisableLicenseKeyField')) { $GLOBALS['serverStamp'] = 'N/A'; $GLOBALS['HideLicenseKey'] = 'display: none'; } if (GetConfig('DisablePathFields')) { $GLOBALS['HidePathFields'] = 'display: none'; } if (GetConfig('DisableStoreUrlField')) { $GLOBALS['HideStoreUrlField'] = 'display: none'; } if (GetConfig('DisableLoggingSettingsTab')) { $GLOBALS['HideLoggingSettingsTab'] = 'display: none'; } if (GetConfig('DisableProxyFields')) { $GLOBALS['HideProxyFields'] = 'display: none'; } if (GetConfig('DisableBackupSettings')) { $GLOBALS['HideBackupSettings'] = 'none'; } $GLOBALS['ShopPath'] = GetConfig('ShopPathNormal'); $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("settings.manage"); $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(); }
/** * @return array (code => Status code, message => error message if available) * * 0 - OK, Feed already exists * 1 - OK, Feed added * 2 - Invalid URL * 3 - URL content is HTML, no feeds available * 4 - URL content is HTML which contains multiple feeds. * Here you should call extractfeedurls in rpc-backend * to get all possible feeds. * 5 - Couldn't download the URL content. * 6 - Content is an invalid XML. */ function subscribe_to_feed($url, $cat_id = 0, $auth_login = '', $auth_pass = '') { global $fetch_last_error; require_once "include/rssfuncs.php"; $url = fix_url($url); if (!$url || !validate_feed_url($url)) { return array("code" => 2); } $contents = @fetch_file_contents($url, false, $auth_login, $auth_pass); if (!$contents) { return array("code" => 5, "message" => $fetch_last_error); } foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) { $contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass); } if (is_html($contents)) { $feedUrls = get_feeds_from_html($url, $contents); if (count($feedUrls) == 0) { return array("code" => 3); } else { if (count($feedUrls) > 1) { return array("code" => 4, "feeds" => $feedUrls); } } //use feed url as new URL $url = key($feedUrls); } if ($cat_id == "0" || !$cat_id) { $cat_qpart = "NULL"; } else { $cat_qpart = "'{$cat_id}'"; } $result = db_query("SELECT id FROM ttrss_feeds\n\t\t\tWHERE feed_url = '{$url}' AND owner_uid = " . $_SESSION["uid"]); if (strlen(FEED_CRYPT_KEY) > 0) { require_once "crypt.php"; $auth_pass = substr(encrypt_string($auth_pass), 0, 250); $auth_pass_encrypted = 'true'; } else { $auth_pass_encrypted = 'false'; } $auth_pass = db_escape_string($auth_pass); if (db_num_rows($result) == 0) { $result = db_query("INSERT INTO ttrss_feeds\n\t\t\t\t\t(owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method,auth_pass_encrypted)\n\t\t\t\tVALUES ('" . $_SESSION["uid"] . "', '{$url}',\n\t\t\t\t'[Unknown]', {$cat_qpart}, '{$auth_login}', '{$auth_pass}', 0, {$auth_pass_encrypted})"); $result = db_query("SELECT id FROM ttrss_feeds WHERE feed_url = '{$url}'\n\t\t\t\t\tAND owner_uid = " . $_SESSION["uid"]); $feed_id = db_fetch_result($result, 0, "id"); if ($feed_id) { set_basic_feed_info($feed_id); } return array("code" => 1); } else { return array("code" => 0); } }
include $_SERVER['DOCUMENT_ROOT'] . '/library/modules/nav.php'; ?> <main role="main"> <h1>Card Details</h1> <table> <tr> <td class="leftcolumn"> <img src="<?php $set = get_set_by_id($card['set_id']); $url = '/pictures/' . $set['official_code'] . '/' . $card['card_name']; if ($card['variation_number'] != NULL) { $url = $url . $card['variation_number']; } $url = $url . '.jpg'; $url = fix_url($url); echo $url; ?> " alt="Card Image Goes Here"><br> Fair Trade Price:<br> <div id="price_area">...Loading...<script> $(document).ready(function () { get_price() }); </script></div> <div id="price_area_foil">...Loading...<script> </script></div> Variations<br> <?php $variations = get_variations($card['card_name'], $set['set_id']);
function get_feeds_from_html($url, $content) { $url = fix_url($url); $baseUrl = substr($url, 0, strrpos($url, '/') + 1); libxml_use_internal_errors(true); $doc = new DOMDocument(); $doc->loadHTML($content); $xpath = new DOMXPath($doc); $entries = $xpath->query('/html/head/link[@rel="alternate"]'); $feedUrls = array(); foreach ($entries as $entry) { if ($entry->hasAttribute('href')) { $title = $entry->getAttribute('title'); if ($title == '') { $title = $entry->getAttribute('type'); } $feedUrl = rewrite_relative_url($baseUrl, $entry->getAttribute('href')); $feedUrls[$feedUrl] = $title; } } return $feedUrls; }
function fix_url_price($card_name, $set_name) { //echo $card_name.'<br>'; //echo $set_name.'<br>'; $card_name = html_entity_decode($card_name); $card_name = str_replace(' ', '_', $card_name); $card_name = str_replace(':', '', $card_name); $card_name = str_replace('/', '', $card_name); $card_name = str_replace('"', '', $card_name); $card_name = str_replace('Æ', 'AE', $card_name); $card_name = trim($card_name); $card_name = fix_url($card_name); //echo $card_name.'<br>'; //$card_name = urlencode($card_name); //echo $card_name.'<br>'; $set_name = str_replace('.', '', $set_name); $set_name = str_replace(':', '', $set_name); $set_name = str_replace('"', '', $set_name); $set_name = str_replace("'", '', $set_name); $set_name = str_replace('(', '', $set_name); $set_name = str_replace(')', '', $set_name); //echo $set_name.'1<br>'; $set_name = str_replace('Magic The Gathering-', '', $set_name); //echo $set_name.'2<br>'; $set_name = str_replace('Limited', '', $set_name); $set_name = str_replace('City of Guilds', '', $set_name); $set_name = str_replace('Magic 20', 'M', $set_name); //echo $set_name.'3<br>'; $set_name = str_replace('Magic', '', $set_name); //echo $set_name.'4<br>'; $set_name = str_replace('into', 'Into', $set_name); $set_name = str_replace('Origins', 'Magic Origins', $set_name); $set_name = str_replace('Core Set', '', $set_name); $set_name = str_replace('Edition', '', $set_name); $set_name = str_replace('Tenth', '10th Edition', $set_name); $set_name = str_replace('Fifth', '5th Edition', $set_name); $set_name = str_replace('Seventh', '7th Edition', $set_name); $set_name = str_replace('Eighth', '8th Edition', $set_name); $set_name = str_replace('Ninth', '9th Edition', $set_name); $set_name = str_replace('Classic Sixth', '6th Edition', $set_name); $set_name = str_replace('Fourth', '4th Edition', $set_name); $set_name = str_replace('Deckmasters', 'Deckmasters Box Set', $set_name); //echo $set_name.'5<br>'; $set_name = trim(preg_replace('/\\s+/', ' ', $set_name)); $set_name = str_replace(' ', '_', $set_name); //echo $set_name.'6<br>'; //echo $card_name.'<br>'; //echo $set_name.'<br>'; $link = 'http://www.mtgprice.com/sets/' . $set_name . '/' . $card_name; //$link = urlencode($link); //echo $link.'<br>'; //echo fix_url($link).'<br>'; return $link; }
private function ManageSettings($messages=array()) { if(!gzte11(ISC_HUGEPRINT)) { $GLOBALS['HideVendorOptions'] = 'display: none'; } $GLOBALS['Message'] = GetFlashMessageBoxes(); // Get the getting started box if we need to $GLOBALS['GettingStartedStep'] = ''; if(empty($GLOBALS['Message']) && (isset($_GET['wizard']) && $_GET['wizard']==1) && !in_array('settings', GetConfig('GettingStartedCompleted')) && !GetConfig('DisableGettingStarted')) { $GLOBALS['GettingStartedTitle'] = GetLang('ConfigureStoreSettings'); $GLOBALS['GettingStartedContent'] = GetLang('ConfigureStoreSettingsDesc'); $GLOBALS['GettingStartedStep'] = $this->template->render('Snippets/GettingStartedModal.html'); } if (GetConfig('UseWYSIWYG')) { $GLOBALS['IsWYSIWYGEnabled'] = 'checked="checked"'; } if (GetConfig('ShowThumbsInControlPanel')) { $GLOBALS['IsProductThumbnailsEnabled'] = 'checked="checked"'; } if (GetConfig('DesignMode')) { $GLOBALS['IsDesignMode'] = 'checked="checked"'; } if (GetConfig('ForceControlPanelSSL')) { $GLOBALS['IsControlPanelSSLEnabled'] = 'checked="checked"'; } if (GetConfig('DownForMaintenance')) { $GLOBALS['IsDownForMaintenance'] = 'checked="checked"'; } $GLOBALS["CharacterSet"] = GetConfig('CharacterSet'); if(in_array(GetConfig('CharacterSet'), $this->validCharacterSets)) { $selectedCharset = GetConfig('CharacterSet'); $selectedCharset = isc_strtolower($selectedCharset); $selectedCharset = str_replace(array("-", "_"), "", $selectedCharset); $GLOBALS["CharacterSet_Selected_" . $selectedCharset] = 'selected="selected"'; } else { $GLOBALS["CharacterSet_Selected_utf8"] = 'selected="selected"'; } /* if (GetConfig('UseSSL')) { $GLOBALS['IsSSLEnabled'] = 'checked="checked"'; } */ switch (GetConfig('UseSSL')) { case SSL_NORMAL: $SSLOption = "UseNormalSSL"; break; case SSL_SHARED: $SSLOption = "UseSharedSSL"; break; case SSL_SUBDOMAIN: $SSLOption = "UseSubdomainSSL"; break; default: $SSLOption = "NoSSL"; } $GLOBALS[$SSLOption . 'Checked'] = 'checked="checked"'; if(GetConfig('AllowPurchasing')) { $GLOBALS['IsPurchasingEnabled'] = 'checked="checked"'; } switch(GetConfig('WeightMeasurement')) { case 'LBS': $GLOBALS['IsPounds'] = 'selected="selected"'; break; case 'Ounces': $GLOBALS['IsOunces'] = 'selected="selected"'; break; case 'KGS': $GLOBALS['IsKilos'] = 'selected="selected"'; break; case 'Grams': $GLOBALS['IsGrams'] = 'selected="selected"'; break; case 'Tonnes': $GLOBLAS['IsTonnes'] = 'selected="selected"'; } if (GetConfig('LengthMeasurement') == "Inches") { $GLOBALS['IsInches'] = 'selected="selected"'; } else { $GLOBALS['IsCentimeters'] = 'selected="selected"'; } $GLOBALS['ShippingFactoringDimensionDepthSelected'] = ''; $GLOBALS['ShippingFactoringDimensionHeightSelected'] = ''; $GLOBALS['ShippingFactoringDimensionWidthSelected'] = ''; switch (GetConfig('ShippingFactoringDimension')) { case 'height': $GLOBALS['ShippingFactoringDimensionHeightSelected'] = 'selected="selected"'; break; case 'width': $GLOBALS['ShippingFactoringDimensionWidthSelected'] = 'selected="selected"'; break; case 'depth': default: $GLOBALS['ShippingFactoringDimensionDepthSelected'] = 'selected="selected"'; break; } if (GetConfig('TagCartQuantityBoxes') == 'dropdown') { $GLOBALS['IsDropdown'] = 'selected="selected"'; } else { $GLOBALS['IsTextbox'] = 'selected="selected"'; } // Product breadcrumbs dropdown $GLOBALS['ProductBreadcrumbs'] = GetConfig('ProductBreadcrumbs'); $GLOBALS['ProductBreadcrumbOptions'] = array( "showall" => GetLang('ShowAll'), "showone" => GetLang('ShowOneOnly'), "shownone" => GetLang('DontShow'), ); if (GetConfig('FastCartAction') == 'popup') { $GLOBALS['IsShowPopWindow'] = 'selected="selected"'; } else { $GLOBALS['IsShowCartPage'] = 'selected="selected"'; } if (GetConfig('TagCloudsEnabled')) { $GLOBALS['IsTagCloudsEnabled'] = 'checked="checked"'; } if (GetConfig('BulkDiscountEnabled')) { $GLOBALS['IsBulkDiscountEnabled'] = 'checked="checked"'; } if (GetConfig('EnableProductTabs')) { $GLOBALS['IsProductTabsEnabled'] = 'checked="checked"'; } if (GetConfig('ShowAddToCartQtyBox')) { $GLOBALS['IsShownAddToCartQtyBox'] = 'checked="checked"'; } if (GetConfig('CaptchaEnabled')) { $GLOBALS['IsCaptchaEnabled'] = 'checked="checked"'; } if(GetConfig('StoreDSTCorrection')) { $GLOBALS['IsDSTCorrectionEnabled'] = "checked=\"checked\""; } if (GetConfig('ShowCartSuggestions')) { $GLOBALS['IsShowCartSuggestions'] = 'checked="checked"'; } if (GetConfig('ShowThumbsInCart')) { $GLOBALS['IsShowThumbsInCart'] = 'checked="checked"'; } if (GetConfig('TagCloudsEnabled')) { $GLOBALS['IsTagCloudsEnabled'] = 'checked="checked"'; } if (GetConfig('ShowAddToCartQtyBox')) { $GLOBALS['IsShownAddToCartQtyBox'] = 'checked="checked"'; } if (GetConfig('AutoApproveReviews')) { $GLOBALS['IsAutoApproveReviews'] = 'checked="checked"'; } if (GetConfig('SearchSuggest')) { $GLOBALS['IsSearchSuggest'] = 'checked="checked"'; } if (GetConfig('QuickSearch')) { $GLOBALS['IsQuickSearch'] = 'checked="checked"'; } if (GetConfig('ShowInventory')) { $GLOBALS['IsShowInventory'] = 'checked="checked"'; } if (GetConfig('ShowPreOrderInventory')) { $GLOBALS['IsShowPreOrderInventory'] = 'checked="checked"'; } // Bulk Discount Settings if (GetConfig('BulkDiscountEnabled')) { $GLOBALS['IsBulkDiscountEnabled'] = 'checked="checked"'; } if (GetConfig('EnableProductTabs')) { $GLOBALS['IsProductTabsEnabled'] = 'checked="checked"'; } // RSS Settings if (GetConfig('RSSNewProducts')) { $GLOBALS['IsRSSNewProductsEnabled'] = 'checked="checked"'; } if (GetConfig('RSSPopularProducts')) { $GLOBALS['IsRSSPopularProductsEnabled'] = 'checked="checked"'; } if (GetConfig('RSSFeaturedProducts')) { $GLOBALS['IsRSSFeaturedProductsEnabled'] = 'checked="checked"'; } if (GetConfig('RSSCategories')) { $GLOBALS['IsRSSCategoriesEnabled'] = 'checked="checked"'; } if (GetConfig('RSSProductSearches')) { $GLOBALS['IsRSSProductSearchesEnabled'] = 'checked="checked"'; } if (GetConfig('RSSLatestBlogEntries')) { $GLOBALS['IsRSSLatestBlogEntriesEnabled'] = 'checked="checked"'; } if (GetConfig('RSSSyndicationIcons')) { $GLOBALS['IsRSSSyndicationIconsEnabled'] = 'checked="checked"'; } if(GetConfig('EnableCustomersAlsoViewed')) { $GLOBALS['IsCustomersAlsoViewedEnabled'] = 'checked="checked"'; } // Product Images if (GetConfig('ProductImagesTinyThumbnailsEnabled')) { $GLOBALS['IsProductImagesTinyThumbnailsEnabled'] = 'checked="checked"'; } if(GetConfig('ProductImagesImageZoomEnabled')) { $GLOBALS['IsProductImagesImageZoomEnabled'] = 'checked="checked"'; } if((int)GetConfig('ProductImagesStorewideThumbnail_width') < 1) { $GLOBALS['ISC_CFG']['ProductImagesStorewideThumbnail_width'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_THUMBNAIL; } if((int)GetConfig('ProductImagesStorewideThumbnail_height') < 1) { $GLOBALS['ISC_CFG']['ProductImagesStorewideThumbnail_height'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_THUMBNAIL; } if((int)GetConfig('ProductImagesProductPageImage_width') < 1) { $GLOBALS['ISC_CFG']['ProductImagesProductPageImage_width'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_STANDARD; } if((int)GetConfig('ProductImagesProductPageImage_height') < 1) { $GLOBALS['ISC_CFG']['ProductImagesProductPageImage_height'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_STANDARD; } if((int)GetConfig('ProductImagesGalleryThumbnail_width') < 1) { $GLOBALS['ISC_CFG']['ProductImagesGalleryThumbnail_width'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_TINY; } if((int)GetConfig('ProductImagesGalleryThumbnail_height') < 1) { $GLOBALS['ISC_CFG']['ProductImagesGalleryThumbnail_height'] = ISC_PRODUCT_DEFAULT_IMAGE_SIZE_TINY; } // Backup Settings if (GetConfig('BackupsLocal')) { $GLOBALS['IsBackupsLocalEnabled'] = 'checked="checked"'; } if (GetConfig('BackupsRemoteFTP')) { $GLOBALS['IsBackupsRemoteFTPEnabled'] = 'checked="checked"'; } if (GetConfig('BackupsAutomatic')) { $GLOBALS['IsBackupsAutomaticEnabled'] = 'checked="checked"'; } if (GetConfig('HTTPSSLVerifyPeer')) { $GLOBALS['IsHTTPSSLVerifyPeerEnabled'] = 'checked="checked"'; } if (strpos(strtolower(PHP_OS), 'win') === 0) { $binary = 'php.exe'; $path_to_php = Which($binary); } else { // Check if there is a separate PHP 5 binary first foreach(array('php5', 'php') as $phpBin) { $path_to_php = Which($phpBin); if($path_to_php !== '') { break; } } } if ($path_to_php === '' && strpos(strtolower(PHP_OS), 'win') === 0) { $path_to_php = 'php.exe'; } elseif ($path_to_php === '') { $path_to_php = 'php'; } $GLOBALS['BackupsAutomaticPath'] = $path_to_php.' -f ' . realpath(ISC_BASE_PATH . "/admin")."/cron-backup.php"; if (GetConfig('BackupsAutomaticMethod') == "ftp") { $GLOBALS['IsBackupsAutomaticMethodFTP'] = 'selected="selected"'; } else { $GLOBALS['IsBackupsAutomaticMethodLocal'] = 'selected="selected"'; } if (GetConfig('BackupsAutomaticDatabase')) { $GLOBALS['IsBackupsAutomaticDatabaseEnabled'] = 'checked="checked"'; } if (GetConfig('BackupsAutomaticImages')) { $GLOBALS['IsBackupsAutomaticImagesEnabled'] = 'checked="checked"'; } if (GetConfig('BackupsAutomaticDownloads')) { $GLOBALS['IsBackupsAutomaticDownloadsEnabled'] = 'checked="checked"'; } $GLOBALS['LanguageOptions'] = $this->GetLanguageOptions(GetConfig('Language')); if (!function_exists('ftp_connect')) { $GLOBALS['FTPBackupsHide'] = "none"; } $GLOBALS['TimeZoneOptions'] = $this->GetTimeZoneOptions(GetConfig('StoreTimeZone')); $query = sprintf("select version() as version"); $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $row = $GLOBALS['ISC_CLASS_DB']->Fetch($result); $GLOBALS['dbVersion'] = $row['version']; // Logging Settings if (GetConfig('SystemLogging')) { $GLOBALS['IsSystemLoggingEnabled'] = "checked=\"checked\""; } if(GetConfig('DebugMode')) { $GLOBALS['IsDebugModeEnabled'] = "checked=\"checked\""; } if (GetConfig('SystemLogTypes')) { $types = explode(",", GetConfig('SystemLogTypes')); if (in_array('general', $types)) { $GLOBALS['IsGeneralLoggingEnabled'] = "selected=\"selected\""; } if (in_array('payment', $types)) { $GLOBALS['IsPaymentLoggingEnabled'] = "selected=\"selected\""; } if (in_array('shipping', $types)) { $GLOBALS['IsShippingLoggingEnabled'] = "selected=\"selected\""; } if (in_array('notification', $types)) { $GLOBALS['IsNotificationLoggingEnabled'] = "selected=\"selected\""; } if (in_array('sql', $types)) { $GLOBALS['IsSQLLoggingEnabled'] = "selected=\"selected\""; } if (in_array('php', $types)) { $GLOBALS['IsPHPLoggingEnabled'] = "selected=\"selected\""; } if (in_array('accounting', $types)) { $GLOBALS['IsAccountingLoggingEnabled'] = "selected=\"selected\""; } if (in_array('emailintegration', $types)) { $GLOBALS['IsEmailIntegrationLoggingEnabled'] = "selected=\"selected\""; } if (in_array('ebay', $types)) { $GLOBALS['IsEbayLoggingEnabled'] = "selected=\"selected\""; } if (in_array('shoppingcomparison', $types)) { $GLOBALS['IsShoppingComparisonLoggingEnabled'] = "selected=\"selected\""; } } if (GetConfig('SystemLogSeverity')) { $severities = explode(",", GetConfig('SystemLogSeverity')); if (in_array('errors', $severities)) { $GLOBALS['IsLoggingSeverityErrors'] = "selected=\"selected\""; } if (in_array('warnings', $severities)) { $GLOBALS['IsLoggingSeverityWarnings'] = "selected=\"selected\""; } if (in_array('notices', $severities)) { $GLOBALS['IsLoggingSeverityNotices'] = "selected=\"selected\""; } if (in_array('success', $severities)) { $GLOBALS['IsLoggingSeveritySuccesses'] = "selected=\"selected\""; } if (in_array('debug', $severities)) { $GLOBALS['IsLoggingSeverityDebug'] = "selected=\"selected\""; } } if (GetConfig('EnableSEOUrls') == 2) { $GLOBALS['IsEnableSEOUrlsAuto'] = "selected=\"selected\""; } else if (GetConfig('EnableSEOUrls') == 1) { $GLOBALS['IsEnableSEOUrlsEnabled'] = "selected=\"selected\""; } else { $GLOBALS['IsEnableSEOUrlsDisabled'] = "selected=\"selected\""; } if (!gzte11(ISC_MEDIUMPRINT)) { $GLOBALS['HideBackupSettings'] = "none"; } if (GetConfig('AdministratorLogging')) { $GLOBALS['IsAdministratorLoggingEnabled'] = "checked=\"checked\""; } if(GetConfig('HidePHPErrors')) { $GLOBALS['IsHidePHPErrorsEnabled'] = "checked=\"checked\""; } if(GetConfig('EnableWishlist')) { $GLOBALS['IsWishlistEnabled'] = "checked=\"checked\""; } if(GetConfig('EnableAccountCreation')) { $GLOBALS['IsEnableAccountCreation'] = "checked=\"checked\""; } if (!getProductReviewsEnabled()) { $GLOBALS['HideIfReviewsDisabled'] = 'display: none;'; } if(GetConfig('EnableProductComparisons')) { $GLOBALS['IsEnableProductComparisons'] = "checked=\"checked\""; } // Product display settings if(GetConfig('ShowProductPrice')) { $GLOBALS['IsProductPriceShown'] = 'CHECKED'; } if(GetConfig('ShowProductSKU')) { $GLOBALS['IsProductSKUShown'] = 'CHECKED'; } if(GetConfig('ShowProductWeight')) { $GLOBALS['IsProductWeightShown'] = 'CHECKED'; } if(GetConfig('ShowProductBrand')) { $GLOBALS['IsProductBrandShown'] = 'CHECKED'; } if(GetConfig('ShowProductShipping')) { $GLOBALS['IsProductShippingShown'] = 'CHECKED'; } if(GetConfig('ShowProductRating')) { $GLOBALS['IsProductRatingShown'] = 'CHECKED'; } if(GetConfig('ShowAddToCartLink')) { $GLOBALS['IsAddToCartLinkShown'] = 'CHECKED'; } if (GetConfig('ShowAddThisLink')) { $GLOBALS['IsAddThisLinkShown'] = 'checked="checked"'; } if(GetConfig('LowInventoryNotificationAddress') != '') { $GLOBALS['LowInventoryEmailsEnabledCheck'] = "checked=\"checked\""; } else { $GLOBALS['HideLowInventoryNotification'] = "none"; } if(GetConfig('ForwardInvoiceEmails') != '') { $GLOBALS['ForwardInvoiceEmailsCheck'] = "checked=\"checked\""; } else { $GLOBALS['HideForwardInvoiceEmails'] = 'none'; } if(GetConfig('MailUseSMTP')) { $GLOBALS['HideMailSMTPSettings'] = ''; $GLOBALS['MailUseSMTPChecked'] = "checked=\"checked\""; } else { $GLOBALS['HideMailSMTPSettings'] = 'none'; $GLOBALS['MailUsePHPChecked'] = "checked=\"checked\""; } if (GetConfig('ProductImageMode') == "lightbox") { $GLOBALS['ProductImageModeLightbox'] = 'selected="selected"'; } else { $GLOBALS['ProductImageModePopup'] = 'selected="selected"'; } if (GetConfig('CategoryDisplayMode') == "grid") { $GLOBALS['CategoryDisplayModeGrid'] = 'selected="selected"'; } else { $GLOBALS['CategoryDisplayModeList'] = 'selected="selected"'; } if (GetConfig('CategoryDefaultImage') !== '') { $GLOBALS['CatImageDefaultSettingMessage'] = sprintf(GetLang('CatImageDefaultSettingDesc'), GetConfig('ShopPath') . '/' . GetConfig('CategoryDefaultImage'), GetConfig('CategoryDefaultImage')); } else { $GLOBALS['CatImageDefaultSettingMessage'] = sprintf(GetLang('BrandImageDefaultSettingNoDeleteDesc'), $GLOBALS['IMG_PATH'].'/CategoryDefault.gif', $GLOBALS['IMG_PATH'].'CategoryDefault.gif'); } if (GetConfig('BrandDefaultImage') !== '') { $GLOBALS['BrandImageDefaultSettingMessage'] = sprintf(GetLang('BrandImageDefaultSettingDesc'), GetConfig('ShopPath') . '/' . GetConfig('BrandDefaultImage'), GetConfig('BrandDefaultImage')); } else { $GLOBALS['BrandImageDefaultSettingMessage'] = sprintf(GetLang('BrandImageDefaultSettingNoDeleteDesc'), $GLOBALS['IMG_PATH'].'/BrandDefault.gif', $GLOBALS['IMG_PATH'].'/BrandDefault.gif'); } $GLOBALS['HideCurrentDefaultProductImage'] = 'display: none'; switch(GetConfig('DefaultProductImage')) { case 'template': $GLOBALS['DefaultProductImageTemplateChecked'] = 'checked="checked"'; break; case '': $GLOBALS['DefaultProductImageNoneChecked'] = 'checked="checked"'; break; default: $GLOBALS['DefaultProductImageCustomChecked'] = 'checked="checked"'; $GLOBALS['HideCurrentDefaultProductImage'] = ''; $GLOBALS['DefaultProductImage'] = GetConfig('DefaultProductImage'); } if (GetConfig('CategoryListingMode') == 'children') { $GLOBALS['CategoryListModeChildren'] = "checked=\"checked\""; } else if (GetConfig('CategoryListingMode') == 'emptychildren') { $GLOBALS['CategoryListModeEmptyChildren'] = "checked=\"checked\""; } else { $GLOBALS['CategoryListModeSingle'] = "checked=\"checked\""; } // check if the images need to be resized automatically $GLOBALS['RunImageResize'] = '0'; if(isset($_SESSION['RunImageResize']) && $_SESSION['RunImageResize'] == 'yes') { $GLOBALS['RunImageResize'] = '1'; unset($_SESSION['RunImageResize']); } // Get a list of the customer groups $query = 'SELECT * FROM [|PREFIX|]customer_groups ORDER BY groupname ASC'; $result = $GLOBALS['ISC_CLASS_DB']->Query($query); $GLOBALS['CustomerGroupOptions'] = ''; while($group = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) { if(GetConfig('GuestCustomerGroup') == $group['customergroupid']) { $sel = 'selected="selected"'; } else { $sel = ''; } $GLOBALS['CustomerGroupOptions'] .= "<option value=\"".$group['customergroupid']."\" ".$sel.">".isc_html_escape($group['groupname'])."</option>"; } // Workout the HTTPS URL $GLOBALS['CompleteStorePath'] = fix_url($_SERVER['PHP_SELF']); $GLOBALS['HTTPSUrl'] = str_replace("http://", "https://", isc_strtolower($GLOBALS['ShopPath'])); $GLOBALS['HideVendorSettings'] = 'display: none'; if(gzte11(ISC_HUGEPRINT)) { $GLOBALS['HideVendorSettings'] = ''; } if(GetConfig('VendorLogoSize')) { $logoDimensions = explode('x', GetConfig('VendorLogoSize')); $GLOBALS['VendorLogoSizeW'] = (int)$logoDimensions[0]; $GLOBALS['VendorLogoSizeH'] = (int)$logoDimensions[1]; $GLOBALS['HideVendorLogoUploading'] = ''; $GLOBALS['VendorLogoUploadingChecked'] = 'checked="checked"'; } else { $GLOBALS['HideVendorLogoUploading'] = 'display: none'; } if(GetConfig('VendorPhotoSize')) { $photoDimensions = explode('x', GetConfig('VendorPhotoSize')); $GLOBALS['VendorPhotoSizeW'] = (int)$photoDimensions[0]; $GLOBALS['VendorPhotoSizeH'] = (int)$photoDimensions[1]; $GLOBALS['HideVendorPhotoUploading'] = ''; $GLOBALS['VendorPhotoUploadingChecked'] = 'checked="checked"'; } else { $GLOBALS['HideVendorPhotoUploading'] = 'display: none'; } foreach ($this->all_vars as $var) { if (is_string(GetConfig($var)) || is_numeric(GetConfig($var))) { $GLOBALS[$var] = isc_html_escape(GetConfig($var)); } } // the current value of auto_increment for the orders table $GLOBALS['StartingOrderNumber'] = ResetStartingOrderNumber(); if(GetConfig('DisableDatabaseDetailFields')) { $GLOBALS['dbType'] = ''; $GLOBALS['dbServer'] = ''; $GLOBALS['dbUser'] = ''; $GLOBALS['dbPass'] = ''; $GLOBALS['dbDatabase'] = ''; $GLOBALS['tablePrefix'] = ''; $GLOBALS['HideDatabaseDetails'] = 'display: none'; } if(GetConfig('DisableLicenseKeyField')) { $GLOBALS['serverStamp'] = 'N/A'; $GLOBALS['HideLicenseKey'] = 'display: none'; } if(GetConfig('DisablePathFields')) { $GLOBALS['HidePathFields'] = 'display: none'; } if(GetConfig('DisableStoreUrlField')) { $GLOBALS['HideStoreUrlField'] = 'display: none'; } if(GetConfig('DisableLoggingSettingsTab')) { $GLOBALS['HideLoggingSettingsTab'] = 'display: none'; } if(GetConfig('DisableProxyFields')) { $GLOBALS['HideProxyFields'] = 'display: none'; } if(GetConfig('DisableBackupSettings')) { $GLOBALS['HideBackupSettings'] = 'none'; } // Advance Search settings\ $GLOBALS['SearchDefaultProductSortOptions'] = getAdvanceSearchSortOptions("product"); $GLOBALS['SearchDefaultContentSortOptions'] = getAdvanceSearchSortOptions("content"); $GLOBALS['SearchProductDisplayModeOptions'] = ''; foreach (array('grid', 'list') as $type) { $GLOBALS['SearchProductDisplayModeOptions'] .= '<option value="' . $type . '"'; if (GetConfig('SearchProductDisplayMode') == $type) { $GLOBALS['SearchProductDisplayModeOptions'] .= ' selected'; } $GLOBALS['SearchProductDisplayModeOptions'] .= '>' . GetLang('SearchProductDisplayMode' . ucfirst($type)) . '</option>'; } $GLOBALS['SearchResultsPerPageOptions'] = ''; foreach (array('5', '10', '20', '50', '100') as $perpage) { $GLOBALS['SearchResultsPerPageOptions'] .= '<option value="' . $perpage . '"'; if (GetConfig('SearchResultsPerPage') == $perpage) { $GLOBALS['SearchResultsPerPageOptions'] .= ' selected'; } $GLOBALS['SearchResultsPerPageOptions'] .= '>' . $perpage . '</option>'; } $GLOBALS['SearchOptimisationOptions'] = ''; foreach (array('fulltext', 'like', 'both') as $mode) { $GLOBALS['SearchOptimisationOptions'] .= '<option value="' . $mode . '"'; if (GetConfig('SearchOptimisation') == $mode) { $GLOBALS['SearchOptimisationOptions'] .= ' selected'; } $GLOBALS['SearchOptimisationOptions'] .= '>' . GetLang('SearchOptimisation' . ucfirst(isc_strtolower($mode))) . '</option>'; } $GLOBALS["AbandonOrderLifetimeOptions"] = ""; foreach (array(1, 7, 14, 21, 30, 60, 90, 120, 150, 180) as $lifetimeType) { $GLOBALS["AbandonOrderLifetimeOptions"] .= "<option value=\"" . $lifetimeType . "\""; if ((int)GetConfig("AbandonOrderLifetime") == $lifetimeType) { $GLOBALS["AbandonOrderLifetimeOptions"] .= " selected=\"selected\""; } $GLOBALS["AbandonOrderLifetimeOptions"] .= ">" . GetLang("AbandonOrderLifetimeOption" . $lifetimeType . "Days") . "</option>\n"; } $GLOBALS['ShopPath'] = GetConfig('ShopPathNormal'); // get the maintenance message $GLOBALS['DownForMaintenanceMessage'] = Store_DownForMaintenance::getDownForMaintenanceMessage(); switch (GetConfig('RedirectWWW')) { case REDIRECT_TO_WWW: $redirectOption = 'RedirectToWWW'; break; case REDIRECT_TO_NO_WWW: $redirectOption = 'RedirectToNoWWW'; break; default: $redirectOption = 'RedirectNoPreference'; } $GLOBALS[$redirectOption . 'Selected'] = 'selected="selected"'; $GLOBALS['ShowPCISettings'] = !GetConfig('HidePCISettings'); $GLOBALS['FacebookLikeButtonEnabled'] = GetConfig('FacebookLikeButtonEnabled'); $GLOBALS['FacebookLikeButtonStyle' . GetConfig('FacebookLikeButtonStyle')] = 'selected="selected"'; $GLOBALS['FacebookLikeButtonPosition' . GetConfig('FacebookLikeButtonPosition')] = 'selected="selected"'; $GLOBALS['FacebookLikeButtonVerb' . GetConfig('FacebookLikeButtonVerb')] = 'selected="selected"'; $GLOBALS['FacebookLikeButtonShowFacesEnabled'] = GetConfig('FacebookLikeButtonShowFaces'); if (!isset($GLOBALS['TPL_CFG']['EnableFlyoutMenuSupport']) || !$GLOBALS['TPL_CFG']['EnableFlyoutMenuSupport']) { // force selection if template does not support flyout $GLOBALS['CategoryListStyle'] = 'static'; } $this->template->display('settings.manage.tpl'); }
<div class="inner-text"> <h2> <?php the_title(); ?> </h2> <?php the_content(); ?> <?php if (get_field('company_website')) { ?> <br> <a href="<?php echo fix_url(get_field('company_website')); ?> "> Read more here </a> <?php } ?> <br> <button class="button place-left" href="<?php echo esc_url(home_url('/')); ?> ?page_id=234" data-toggle="modal" data-target="#myModal"> Contact us here </button>
/** * Test fix_url with domain + paths */ public function testFixUrlWithPaths() { $this->assertEquals('http://tt-rss.org/foo', fix_url('tt-rss.org/foo')); $this->assertEquals('http://tt-rss.org/foo/bar/baz', fix_url('tt-rss.org/foo/bar/baz')); $this->assertEquals('http://tt-rss.org/foo/bar/baz/', fix_url('tt-rss.org/foo/bar/baz/')); }
include_once 'wall_includes/security.php'; include_once 'wall_includes/smileys.php'; $clientids = mysql_real_escape_string($_POST['clientids']); $message = clean(mysql_real_escape_string($_POST['message'])); $top_id = mysql_real_escape_string($_POST['top_id']); $message = special_chars($message); $time = time(); //getting image link if (!empty($_POST['pic_url'])) { $image = strip_tags($_POST['pic_url']); } else { $image = ''; } //getting video link if (!empty($_POST['y_link'])) { $video = fix_url(strip_tags($_POST['y_link'])); } else { $video = ''; } //insert into wall table $query = mysql_query("INSERT INTO `posts` (`desc`, `image_url`, `vid_url`,`users_id`,`client_id`, `tid`, `date`) VALUES ('{$message}', '{$image}', '{$video}','{$user_id}', '{$clientids}', '', '{$time}')") or die(mysql_error()); $ins_id = mysql_insert_id(); if ($top_id != "") { $topquery = mysql_query("UPDATE `posts` SET `tid` = '{$top_id}' WHERE `pid` = '{$ins_id}'") or die(mysql_error()); } $sql_usernames = "SELECT * FROM crm_users WHERE users_id = '{$user_id}'"; $res_usernames = mysql_query($sql_usernames); $rows = @mysql_num_rows($res_usernames); $fnames = stripslashes(@mysql_result($res_usernames, 0, 'first_name')); $lnames = stripslashes(@mysql_result($res_usernames, 0, 'last_name')); $fulln = ucfirst($fnames) . " " . ucfirst($lnames);
function redirect($url, $message = '', $title = '', $wait = 3, $usephp = false, $withbaseurl = true) { global $SITENAME, $BASEURL; if (empty($message)) { $message = "You will now be redirected..."; } if (empty($title)) { $title = $SITENAME; } $url = fix_url($url); if ($withbaseurl) { $url = $BASEURL . (substr($url, 0, 1) == '/' ? '' : '/') . $url; } if ($usephp) { @header('Location: ' . $url); exit; } ob_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DT...tional.dtd"> <html lang="en"> <head> <title><?php echo $title; ?> </title> <meta http-equiv="refresh" content="<?php echo $wait; ?> ;URL=<?php echo $url; ?> "> <link rel="stylesheet" href="<?php echo $BASEURL; ?> /themes/green/green.css" type="text/css" media="screen"> </head> <body> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <div align="center"> <table width="755" border="2" cellspacing="1" cellpadding="4" > <tr> <td bgcolor="#660000"><strong><a href="<?php echo $BASEURL; ?> "><center><?php echo $title; ?> </a></center></strong></td> </tr> <tr> <td align="center"><p><font color="#white"><?php echo $message; ?> </font></p></td> </tr> <tr> <td bgcolor="#660000" ><a href="<?php echo $url; ?> "> <span class="smalltext">Click here if you don't want to wait any longer.</span></a></td> </tr> </table> </div> </body> </html> <?php ob_end_flush(); exit; }
function _fix_url_callback2($m, $init = false) { static $base_url; if ($init) { $base_url = $m; return; } return '[[' . fix_url($base_url, $m) . trim($m[2]) . ']]'; }