Skip to content
Permalink
Browse files

Added Ultimate SEO URLs5.

  • Loading branch information...
clustersolutions committed Nov 26, 2014
1 parent 381fe81 commit 422d1b7b511377190cfcfb26087d015e1b7670f3
Showing with 6,215 additions and 7 deletions.
  1. +34 −0 .htaccess
  2. +2 −2 README.md
  3. +6 −0 admin/categories.php
  4. +40 −0 admin/includes/functions/general.php
  5. +50 −2 includes/application_top.php
  6. +25 −1 includes/functions/general.php
  7. +12 −0 includes/functions/html_output.php
  8. +1 −1 includes/modules/product_listing.php
  9. +397 −0 includes/modules/ultimate_seo_urls5/abstracts/page_modules.php
  10. +105 −0 includes/modules/ultimate_seo_urls5/abstracts/uri_modules.php
  11. +140 −0 includes/modules/ultimate_seo_urls5/cache_system/file.php
  12. +151 −0 includes/modules/ultimate_seo_urls5/cache_system/memcache.php
  13. +119 −0 includes/modules/ultimate_seo_urls5/cache_system/mysql.php
  14. +191 −0 includes/modules/ultimate_seo_urls5/cache_system/sqlite.php
  15. BIN includes/modules/ultimate_seo_urls5/cache_system/sqlite/usu_cache.db
  16. +245 −0 includes/modules/ultimate_seo_urls5/database_install/installer_class.php
  17. +227 −0 includes/modules/ultimate_seo_urls5/database_install/installer_constants.php
  18. +35 −0 includes/modules/ultimate_seo_urls5/includes/notfound_404.php
  19. +29 −0 includes/modules/ultimate_seo_urls5/includes/uri_redirects_array.php
  20. +75 −0 includes/modules/ultimate_seo_urls5/includes/uri_redirects_class.php
  21. +399 −0 includes/modules/ultimate_seo_urls5/includes/usu_general_functions.php
  22. +29 −0 includes/modules/ultimate_seo_urls5/interfaces/cache_interface.php
  23. +534 −0 includes/modules/ultimate_seo_urls5/main/bootstrap.php
  24. +137 −0 includes/modules/ultimate_seo_urls5/main/registry.php
  25. +350 −0 includes/modules/ultimate_seo_urls5/main/usu5.php
  26. +199 −0 includes/modules/ultimate_seo_urls5/main/validator.php
  27. +167 −0 includes/modules/ultimate_seo_urls5/page_modules/article_info.php
  28. +173 −0 includes/modules/ultimate_seo_urls5/page_modules/articles.php
  29. +191 −0 includes/modules/ultimate_seo_urls5/page_modules/index.php
  30. +166 −0 includes/modules/ultimate_seo_urls5/page_modules/information.php
  31. +166 −0 includes/modules/ultimate_seo_urls5/page_modules/links.php
  32. +166 −0 includes/modules/ultimate_seo_urls5/page_modules/newsdesk_index.php
  33. +166 −0 includes/modules/ultimate_seo_urls5/page_modules/newsdesk_info.php
  34. +165 −0 includes/modules/ultimate_seo_urls5/page_modules/newsdesk_reviews_article.php
  35. +166 −0 includes/modules/ultimate_seo_urls5/page_modules/newsdesk_reviews_info.php
  36. +209 −0 includes/modules/ultimate_seo_urls5/page_modules/product_info.php
  37. +165 −0 includes/modules/ultimate_seo_urls5/page_modules/product_reviews.php
  38. +165 −0 includes/modules/ultimate_seo_urls5/page_modules/product_reviews_info.php
  39. +94 −0 includes/modules/ultimate_seo_urls5/uri_modules/osc_experimental.php
  40. +131 −0 includes/modules/ultimate_seo_urls5/uri_modules/path_rewrite.php
  41. +131 −0 includes/modules/ultimate_seo_urls5/uri_modules/path_standard.php
  42. +130 −0 includes/modules/ultimate_seo_urls5/uri_modules/rewrite.php
  43. +131 −0 includes/modules/ultimate_seo_urls5/uri_modules/standard.php
  44. +1 −1 index.php
@@ -36,3 +36,37 @@

# php_value session.use_trans_sid 0
# php_value register_globals 1
# If you are getting errors you may need to comment this out like ..
# Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
<IfModule mod_rewrite.c>
RewriteEngine On

# RewriteBase instructions
# Change RewriteBase dependent on how your shop is accessed as below.
# http://www.mysite.com = RewriteBase /
# http://www.mysite.com/catalog/ = RewriteBase /catalog/
# http://www.mysite.com/catalog/shop/ = RewriteBase /catalog/shop/

# Change RewriteBase using the instructions above
RewriteBase /23resp/
RewriteRule ^([a-z0-9/-]+)-p-([0-9]+).html$ product_info.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-c-([0-9_]+).html$ index.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-m-([0-9]+).html$ index.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-pi-([0-9]+).html$ popup_image.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-pr-([0-9]+).html$ product_reviews.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-pri-([0-9]+).html$ product_reviews_info.php [NC,L,QSA]
# Articles contribution
RewriteRule ^([a-z0-9/-]+)-t-([0-9_]+).html$ articles.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-au-([0-9]+).html$ articles.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-a-([0-9]+).html$ article_info.php [NC,L,QSA]
# Information pages
RewriteRule ^([a-z0-9/-]+)-i-([0-9]+).html$ information.php [NC,L,QSA]
# Links contribution
RewriteRule ^([a-z0-9/-]+)-links-([0-9_]+).html$ links.php [NC,L,QSA]
# Newsdesk contribution
RewriteRule ^([a-z0-9/-]+)-n-([0-9]+).html$ newsdesk_info.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-nc-([0-9]+).html$ newsdesk_index.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-nri-([0-9]+).html$ newsdesk_reviews_info.php [NC,L,QSA]
RewriteRule ^([a-z0-9/-]+)-nra-([0-9]+).html$ newsdesk_reviews_article.php [NC,L,QSA]
</IfModule>
@@ -8,7 +8,7 @@ HG === Holy Grail (Ok my "holy grail" but I've been in the online retail trenche
Mods Installed (mods are like building blocks, you can help by adding one):

1. SEO_Header_Tag.
2. Coming soon...
3.
2. Ultimate SEO URLs5 (cache using MySQL causes error...TBD).
3. Coming soon...move contact number to address book table.


@@ -18,6 +18,12 @@
$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');
if (tep_not_null($action)) {
// ULTIMATE Seo Urls 5 PRO by FWR Media
// If the action will affect the cache entries
if ( $action == 'insert' || $action == 'update' || $action == 'setflag' ) {
tep_reset_cache_data_usu5( 'reset' );
}
switch ($action) {
case 'setflag':
if ( ($HTTP_GET_VARS['flag'] == '0') || ($HTTP_GET_VARS['flag'] == '1') ) {
@@ -1612,4 +1612,44 @@ function tep_get_products_name_review($product_id, $language_id = 0) {
return $product['products_name'];
}
/**
* ULTIMATE Seo Urls 5 PRO by FWR Media
* Reset the various cache systems
* @param string $action
*/
function tep_reset_cache_data_usu5( $action = false ) {
if ( $action == 'reset' ) {
$usu5_path = realpath( dirname( __FILE__ ) . '/../../../' ) . '/' . DIR_WS_MODULES . 'ultimate_seo_urls5/';
switch( USU5_CACHE_SYSTEM ) {
case 'file':
$path_to_cache = $usu5_path . 'cache_system/cache/';
$it = new DirectoryIterator( $path_to_cache );
while( $it->valid() ) {
if ( !$it->isDot() && is_readable( $path_to_cache . $it->getFilename() ) && ( substr( $it->getFilename(), -6 ) == '.cache' ) ) {
@unlink( $path_to_cache . $it->getFilename() );
}
$it->next();
}
break;
case 'mysql':
tep_db_query( 'TRUNCATE TABLE `usu_cache`' );
break;
case 'memcache':
if ( class_exists('Memcache') ){
include $usu5_path . 'interfaces/cache_interface.php';
include $usu5_path . 'cache_system/memcache.php';
Memcache_Cache_Module::iAdmin()->initiate()
->flushOut();
}
break;
case 'sqlite':
include $usu5_path . 'interfaces/cache_interface.php';
include $usu5_path . 'cache_system/sqlite.php';
Sqlite_Cache_Module::admini()->gc();
break;
}
tep_db_query( "UPDATE " . TABLE_CONFIGURATION . " SET configuration_value='false' WHERE configuration_key='USU5_RESET_CACHE'" );
}
} // end function
?>
@@ -44,8 +44,45 @@
$request_type = (getenv('HTTPS') == 'on') ? 'SSL' : 'NONSSL';
// set php_self in the local scope
$req = parse_url($HTTP_SERVER_VARS['SCRIPT_NAME']);
$PHP_SELF = substr($req['path'], ($request_type == 'NONSSL') ? strlen(DIR_WS_HTTP_CATALOG) : strlen(DIR_WS_HTTPS_CATALOG));
// $req = parse_url($HTTP_SERVER_VARS['SCRIPT_NAME']);
// $PHP_SELF = substr($req['path'], ($request_type == 'NONSSL') ? strlen(DIR_WS_HTTP_CATALOG) : strlen(DIR_WS_HTTPS_CATALOG));
/**
* ULTIMATE Seo Urls 5 PRO by FWR Media
* function to return the base filename
*/
function usu5_base_filename() {
// Probably won't get past SCRIPT_NAME unless this is reporting cgi location
$base = new ArrayIterator( array( 'SCRIPT_NAME', 'PHP_SELF', 'REQUEST_URI', 'ORIG_PATH_INFO', 'HTTP_X_ORIGINAL_URL', 'HTTP_X_REWRITE_URL' ) );
while ( $base->valid() ) {
if ( array_key_exists( $base->current(), $_SERVER ) && !empty( $_SERVER[$base->current()] ) ) {
if ( false !== strpos( $_SERVER[$base->current()], '.php' ) ) {
preg_match( '@[a-z0-9_]+\.php@i', $_SERVER[$base->current()], $matches );
if ( is_array( $matches ) && ( array_key_exists( 0, $matches ) )
&& ( substr( $matches[0], -4, 4 ) == '.php' )
&& ( is_readable( $matches[0] ) ) ) {
return $matches[0];
}
}
}
$base->next();
}
// Some odd server set ups return / for SCRIPT_NAME and PHP_SELF when accessed as mysite.com (no index.php) where they usually return /index.php
if ( ( $_SERVER['SCRIPT_NAME'] == '/' ) || ( $_SERVER['PHP_SELF'] == '/' ) ) {
return 'index.php';
}
// Return the standard RC3 code
//return ( ( ( strlen( ini_get( 'cgi.fix_pathinfo' ) ) > 0) && ( (bool)ini_get( 'cgi.fix_pathinfo' ) == false ) ) || !isset( $_SERVER['SCRIPT_NAME'] ) ) ? basename( $_SERVER['PHP_SELF'] ) : basename( $_SERVER['SCRIPT_NAME'] );
$req = parse_url($HTTP_SERVER_VARS['SCRIPT_NAME']);
return substr($req['path'], ($request_type == 'NONSSL') ? strlen(DIR_WS_HTTP_CATALOG) : strlen(DIR_WS_HTTPS_CATALOG));
} // End function
// set php_self in the local scope
$PHP_SELF = usu5_base_filename();
if ($request_type == 'NONSSL') {
define('DIR_WS_CATALOG', DIR_WS_HTTP_CATALOG);
@@ -280,6 +317,17 @@
$languages_id = $lng->language['id'];
}
/**
* ULTIMATE Seo Urls 5 PRO by FWR Media
*/
Usu_Main::i()->setVar( 'languages_id', $languages_id )
->setVar( 'request_type', $request_type )
->setVar( 'session_started', $session_started )
->setVar( 'sid', $SID )
->setVar( 'language', $language )
->setVar( 'filename', $PHP_SELF )
->initiate( ( isset( $lng ) && ( $lng instanceof language ) ) ? $lng : array(), $languages_id, $language );
// include the language translations
$_system_locale_numeric = setlocale(LC_NUMERIC, 0);
require(DIR_WS_LANGUAGES . $language . '.php');
@@ -29,7 +29,7 @@ function tep_exit() {
exit();
}
////
/*///
// Redirect to another page or site
function tep_redirect($url) {
if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {
@@ -50,6 +50,30 @@ function tep_redirect($url) {
tep_exit();
}
*/
/**
* ULTIMATE Seo Urls 5 PRO by FWR Media
* Redirect to another page or site
*/
function tep_redirect($url) {
if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) {
tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));
}
if ( (ENABLE_SSL == true) && (getenv('HTTPS') == 'on') ) { // We are loading an SSL page
if (substr($url, 0, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)) == HTTP_SERVER . DIR_WS_HTTP_CATALOG) { // NONSSL url
$url = HTTPS_SERVER . DIR_WS_HTTPS_CATALOG . substr($url, strlen(HTTP_SERVER . DIR_WS_HTTP_CATALOG)); // Change it to SSL
}
}
if ( false !== strpos($url, '&amp;') ){
$url = str_replace('&amp;', '&', $url);
}
// session_write_close();
header('Location: ' . $url);
tep_exit(); // exit;
}
////
// Parse the data used in the html tags to ensure the tags will not break
@@ -10,6 +10,7 @@
Released under the GNU General Public License
*/
/*
////
// The HTML href link wrapper function
function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
@@ -70,6 +71,17 @@ function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $ad
return $link;
}
*/
/**
* ULTIMATE Seo Urls 5 PRO by FWR Media
* Replacement for osCommerce href link wrapper function
*/
require_once DIR_WS_MODULES . 'ultimate_seo_urls5/main/usu5.php';
function tep_href_link( $page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true ) {
return Usu_Main::i()->hrefLink( $page, $parameters, $connection, $add_session_id, $search_engine_safe );
}
////
// The HTML image wrapper function
@@ -149,7 +149,7 @@
$prod_list_contents .= ' </div> <!--pricewrap-->';
$prod_list_contents .= ' <div class="btn-wrap">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing['products_id']), NULL, NULL, 'btn-success btn-sm');
$prod_list_contents .= ' <div class="btn-wrap">' . tep_draw_button(IMAGE_BUTTON_BUY_NOW, 'cart', tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action', 'products_id')) . 'action=buy_now&products_id=' . $listing['products_id']), NULL, NULL, 'btn-success btn-sm');
$prod_list_contents .= ' </div><!--btn-wrap-->';
$prod_list_contents .= ' <ul class="optional-wrap">';

0 comments on commit 422d1b7

Please sign in to comment.
You can’t perform that action at this time.