Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //START ENCRYPT
- if($config['sef'] || $config['seftags']) {
- $addCopyright = 1;
- $copyright[0] = '<div class=\'txtCopyright\'>Running with <a href=\'http://www.rukispot.com/cube-cart-cc3-seo-mod-search-engine-friendly-urls-custom-urls-meta-tags-robotstxt-php-session-killer/\' class=\'txtCopyright\' target=\'_blank\'>Search Engine Friendly Mod</a> 6.5</div>';
- $copyright[1] = '<div class=\'txtCopyright\'><a href=\'http://www.rukispot.com/\' class=\'txtCopyright\' target=\'_blank\'>Ruki Spot Blog - Cube Cart, SEO, Ecommerce Discussions</a></div>';
- $copyright[2] = '<div class=\'txtCopyright\'><a href=\'http://www.funkymobilegames.com/temple-of-mirrors-puzzle-game.html\' class=\'txtCopyright\' target=\'_blank\'>Android & iPhone Puzzle Game - Temple of Mirrors</a></div>';
- $copyright[3] = '<div class=\'txtCopyright\'><a href=\'http://www.funkymobilegames.com/legions-stratego-board-game.html\' class=\'txtCopyright\' target=\'_blank\'>Android & iPhone Stratego Board Game - Legions</a></div>';
- /* security check, check if domain names match, if they do remove copyright notice */
- $domains = array(
- 'localhost',
- '127.0.0.1',
- 'jaymeds.com',
- );
- if(count($domains) >= 3) {
- for($i = 0; $i < count($domains); $i++) {
- if(strlen($domains[$i]) > 0) {
- if((strlen($GLOBALS['storeURL']) == 0) || (strpos(strtoupper($GLOBALS['storeURL']), strtoupper($domains[$i])) != FALSE)) {
- $addCopyright = 0;
- break;
- }
- }
- }
- }
- /* domain not found as valid so add copyright */
- if($addCopyright == 1) {
- // work out our seed
- if($_GET['productId'] > 0) {
- $indexSeed = $_GET['productId'];
- } else if($_GET['docId'] > 0) {
- $indexSeed = $_GET['docId'];
- } else if($_GET['catId'] > 0) {
- $indexSeed = $_GET['catId'];
- } else {
- $indexSeed = 0;
- }
- $index = $indexSeed % count($copyright);
- $page = preg_replace('/(\<\/body\>)/i', $copyright[$index].'$1', $page);
- }
- }
- if($config['sef']) {
- $indexscript = sef_get_base_url();
- $search = array(
- '/(?<=href)(\s*\=\s*)(\"|\')([^\"|\']*)index\.php\?act\=viewCat(\&\;|\&)catId\=([a-z0-9]+)([^\"|\']*)(\"|\')/ie',/* rewrite url */
- '/(?<=href)(\s*\=\s*)(\"|\')([^\"|\']*)index\.php\?act\=viewProd(\&\;|\&)productId\=([a-z0-9]+)([^\"|\']*)(\"|\')/ie',
- '/(?<=href)(\s*\=\s*)(\"|\')([^\"|\']*)index\.php\?act\=viewDoc(\&\;|\&)docId\=([a-z0-9]+)([^\"|\']*)(\"|\')/ie',
- '/(?<=href)(\s*\=\s*)(\"|\')([^\"|\']*)index\.php\?act\=taf(\&\;|\&)productId\=([a-z0-9]+)([^\"|\']*)(\"|\')/ie',
- /*
- '/(?<=href)(\s*\=\s*)(\"|\')([^\"|\']*)index\.php\?act\=latestNews(\&\;|\&)article\=([a-z0-9]+)([^\"|\']*)(\"|\')/ie', // ESTELLE NEWS
- '/(?<=href)(\s*\=\s*)(\"|\')([^\"|\']*)index\.php\?act\=latestNews(\&\;|\&)page\=([a-z0-9]+)([^\"|\']*)(\"|\')/ie', // ESTELLE NEWS
- '/(?<=href)(\s*\=\s*)(\"|\')([^\"|\']*)index\.php\?act\=newsArchive([^\"|\']*)(\"|\')/ie', // ESTELLE NEWS
- */
- '/(\"|\')(cart\.php|confirmed\.php|download\.php|index\.php|offLine\.php|switch\.php)/i', /* lets just make certain that these scripts are all referenced from absolute url */
- '/(href\s*\=\s*(\"|\'))(?!javascript|mailto:|https:|http:|\/|\"|\'|\#|\?)/i', /* convert relative to abs */
- '/(src\s*\=\s*(\"|\'))(?!javascript|mailto:|https:|http:|\/|\"|\'|\#|\?)/i',
- '/(action\s*\=\s*(\"|\'))(?!javascript|mailto:|https:|http:|\/|\"|\'|\#|\?)/i',
- '/(background\s*\=\s*(\"|\'))(?!javascript|mailto:|https:|http:|\/|\"|\'|\#|\?)/i',
- '/(javascript\s*:\s*openPopUp\s*\(\s*(\"|\'))(?!https:|mailto:|http:|\/|\"|\'|\#|\?)/i',
- );
- $replace = array(
- "'\\1'.substr('\\2',-1).'\\3'.'$indexscript'.generateCategoryUrl('\\5').generateQueryStr('\\6').substr('\\7',-1)",
- "'\\1'.substr('\\2',-1).'\\3'.'$indexscript'.generateProductUrl('\\5').generateQueryStr('\\6').substr('\\7',-1)",
- "'\\1'.substr('\\2',-1).'\\3'.'$indexscript'.generateDocumentUrl('\\5').generateQueryStr('\\6').substr('\\7',-1)",
- "'\\1'.substr('\\2',-1).'\\3'.'$indexscript'.generateTellFriendUrl('\\5').generateQueryStr('\\6').substr('\\7',-1)",
- /*
- "'\\1'.substr('\\2',-1).'\\3'.'$indexscript'.generateLatestNewsIndividualUrl('\\5').generateQueryStr('\\6').substr('\\7',-1)", // ESTELLE NEWS
- "'\\1'.substr('\\2',-1).'\\3'.'$indexscript'.generateLatestNewsPaginatedUrl('\\5').generateQueryStr('\\6').substr('\\7',-1)", // ESTELLE NEWS
- "'\\1'.substr('\\2',-1).'\\3'.'$indexscript'.generateLatestNewsArchiveUrl().generateQueryStr('\\5').substr('\\6',-1)", // ESTELLE NEWS
- */
- '$1'.$GLOBALS['rootRel'].'$2',
- '$1'.$GLOBALS['rootRel'],
- '$1'.$GLOBALS['rootRel'],
- '$1'.$GLOBALS['rootRel'],
- '$1'.$GLOBALS['rootRel'],
- '$1'.$GLOBALS['rootRel'],
- );
- $page = preg_replace($search, $replace, $page);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement