View Single Post
  #2  
Old 04-26-2006, 01:43 PM
 
intel352 intel352 is offline
 

X-Wizard
  
Join Date: Dec 2005
Posts: 1,071
 

Default

Patching X-Cart for the SEO mod:

open config.php:
Find
Code:
@include_once($xcart_dir."/config.local.php");

After, Add
Code:
############################################################ # SEO Optimization Mod by intel352 ############################################################ $seo_enable = true; // enabling the seo url optimizer $seo_bot_lofi = false; // enabling lofi mode for bots (not certain of effects yet) # END SEO

Open auth.php:
Find
Code:
include_once $xcart_dir."/config.php";

After, Add
Code:
############################################################ # SEO Optimization Mod by intel352 ############################################################ if($seo_enable) include_once $xcart_dir."/seo.php"; # END SEO

open smarty.php:
Find
Code:
$smarty->debug_tpl="file:debug_templates.tpl";

After, Add
Code:
############################################################ # SEO Optimization Mod by intel352 ############################################################ # # Output Filters # if(AREA_TYPE=='C' && $seo_enable) $smarty->load_filter('output','seo'); # END SEO

Open skin1_original/meta.tpl:
Find
Code:
{assign var="_meta_keywords" value="$_meta_keywords`$config.SEO.meta_keywords`"} <META name="description" content="{$_meta_descr|truncate:"500":"...":false|replace:'"':"'"}"> <META name="keywords" content="{$_meta_keywords|truncate:"500":"":false|replace:'"':"'"}">

After, Add
Code:
{if $is_robot and $lofi_mode} <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> <META NAME="ROBOTS" CONTENT="INDEX,FOLLOW,NOARCHIVE"> <META NAME="GOOGLEBOT" CONTENT="NOARCHIVE"> {/if}


Froogle SEO mod - this modification is optional:

open modules/Froogle/froogle.php:
Find
Code:
if ( !defined('XCART_SESSION_START') ) { header("Location: ../../"); die("Access denied"); }

After, Add
Code:
############################################################ # SEO Optimization Mod by intel352 ############################################################ # # Output Filters # if($seo_enable && !is_object($seo)){ include_once( $xcart_dir.'/include/class.xcart_seo.php' ); $seo = new XCart_SEO; } # END SEO

Find
Code:
# Define product category path $cats = array(); $catids = explode("/", $product['categoryid_path']);

After, Add
Code:
$seo->forceProductsArr($product['productid'], $product['product'], end($catids));

Find
Code:
$tmbn = $http_location."/image.php?productid=".$product['productid'];

Replace With
Code:
$tmbn = $seo->createProductUrl($product['productid'],$http_location);

Find
Code:
$post = $http_location.constant("DIR_CUSTOMER")."/product.php?productid=".$product['productid']."\t".

Replace With
Code:
$product_uri = $seo->createProductUrl($product['productid'],$http_location.constant("DIR_CUSTOMER")); $post = $product_uri."\t".

Save and Close all files.

############################

IMPORTANT: if you already have a .htaccess file on your server, you need to (selectively) add in the changes, from the provided .htaccess file.

Download the zip file linked in the first post, extract the contents to your harddrive, and upload:
.htaccess -> xcart root
seo.php -> xcart root
include/class.xcart_seo.php -> include/
include/templater/plugins/outputfilter.seo.php -> include/templater/plugins/

Done
__________________
-Jon Langevin
WARNING: Unethical developer - NOT RECOMMENDED
See details here
Reply With Quote