Class SEO_URL

(line 417)

Description


Located in File: seo.class.php

Ultimate SEO URLs Base Class

Ultimate SEO URLs offers search engine optimized URLS for osCommerce based applications. Other features include optimized performance and automatic redirect script.



Class Variables

Summary:
array $attributes
string $base_url
string $base_url_ssl
array $cache
string $cache_file
resource $cache_query
array $data
object $DB
object $installer
boolean $is_seopage
integer $languages_id
boolean $need_redirect
string $path_info
array $performance
string $real_uri
array $reg_anchors
float $timestamp
string $uri
array $uri_parsed

$attributes (line 432)

Data type : array

$attributes array contains all the required settings for class

$base_url (line 437)

Data type : string

$base_url is the NONSSL URL for site

$base_url_ssl (line 442)

Data type : string

$base_url_ssl is the secure URL for the site

$cache (line 422)

Data type : array

$cache is the per page data array that contains all of the previously stripped titles

$cache_file (line 467)

Data type : string

$cache_file is the basename of the cache database entry

$cache_query (line 462)

Data type : resource

$cache_query is the resource_id used for database cache logic

$data (line 472)

Data type : array

$data array contains all records retrieved from database cache

$DB (line 507)

Data type : object

$DB is the database object

$installer (line 512)

Data type : object

$installer is the installer object

$is_seopage (line 482)

Data type : boolean

$is_seopage holds value as to whether page is in allowed SEO pages

$languages_id (line 427)

Data type : integer

$languages_id contains the language_id for this instance

$need_redirect (line 477)

Data type : boolean

$need_redirect determines whether the URL needs to be redirected

$path_info (line 502)

Data type : string

$path_info contains the getenv('PATH_INFO') value

$performance (line 447)

Data type : array

$performance array contains evaluation metric data

$real_uri (line 492)

Data type : string

$real_uri contains the $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'] value

$reg_anchors (line 457)

Data type : array

$reg_anchors holds the anchors used by the .htaccess rewrites

$timestamp (line 452)

Data type : float

$timestamp simply holds the temp variable for time calculations

$uri (line 487)

Data type : string

$uri contains the $_SERVER['REQUEST_URI'] value

$uri_parsed (line 497)

Data type : array

$uri_parsed contains the parsed uri value array

Class Constants

Summary:

Method Detail

Summary:
SEO_URL SEO_URL (integer $languages_id)
string add_sid (string $link, boolean $add_session_id, string $connection, string $separator)
void cache_gc ()
void check_redirect ()
void check_seo_page ()
string convert_time (string $expires)
void do_redirect ()
mixed expand (string $set)
void GetParentCategories (mixed &$categories, integer $categories_id)
string get_article_name (integer $aID)
mixed get_cache ([string $name = 'GLOBAL'], [boolean $local_memory = false])
mixed get_cache_memory (string $name, [string $method = 'RETURN'])
string get_category_name (integer &$cID)
string get_full_cPath (mixed $cID, integer &$original)
string get_information_name (integer $iID)
string get_manufacturer_name (integer $mID)
string get_product_name (integer $pID)
string get_topic_name (integer $tID)
string href_link ([string $page = ''], [string $parameters = ''], [string $connection = 'NONSSL'], [boolean $add_session_id = true])
string implode_assoc (array $array, [string $inner_glue = '='], [string $outer_glue = '&'])
boolean is_attribute_string (integer $pID)
void is_cached (string $name, boolean &$is_cached, boolean &$is_expired)
boolean is_cPath_string (string $params)
boolean is_product_string (string $params)
string make_url (string $page, string $string, string $anchor_type, integer $id, [string $extension = '.html'], string &$separator)
void need_redirect ()
boolean not_null (mixed $value)
string output_string (mixed $string, [mixed $translate = false], [boolean $protected = false], string $sting)
string parse_input_field_data (string $data, array $parse)
string parse_parameters (string $page, string $params, string &$separator)
array parse_path (string $path_info)
void PrintArray (mixed $array, [mixed $heading = ''])
void profile ()
void save_cache (string $name, mixed $value, [string $method = 'RETURN'], [integer $gzip = 1], integer $global, [string $expires = '30/days'])
string SessionID ([string $sessid = ''])
string SessionName ([string $name = ''])
string short_name (string $str, [integer $limit = 3])
void start (float &$start_time)
void stock_href_link ([mixed $page = ''], [mixed $parameters = ''], [mixed $connection = 'NONSSL'], [mixed $add_session_id = true], [mixed $search_engine_safe = true])
void stop (float $start, float &$time)
string strip (string $string)

Constructor SEO_URL (line 520)

SEO_URL SEO_URL( integer $languages_id)

SEO_URL class constructor

Parameters

  • integer $languages_id:

Info

  • version - 1.1
  • author - Bobby Easland

Method add_sid (line 728)

string add_sid( string $link, boolean $add_session_id, string $connection, string $separator)

Function to append session ID if needed

Parameters

  • string $link:
  • boolean $add_session_id:
  • string $connection:
  • string $separator:

Info

  • version - 1.2
  • author - Bobby Easland

Method cache_gc (line 1702)

void cache_gc( )

Function to perform basic garbage collection for database cache system

Info

  • version - 1.0
  • author - Bobby Easland

Method calculate_performance (line 1217)

mixed calculate_performance( )

Function used to calculate and output the performance metrics of the class

Info

  • return - Output of performance data wrapped in HTML pre tags
  • version - 1.0
  • author - Bobby Easland

Method check_redirect (line 1765)

void check_redirect( )

Function to initialize the redirect logic

Info

  • version - 1.1
  • author - Bobby Easland

Method check_seo_page (line 1818)

void check_seo_page( )

Function to check if it's a valid redirect page

Info

  • version - 1.1
  • author - Bobby Easland

Method convert_time (line 1713)

string convert_time( string $expires)

Function to convert time for cache methods

Parameters

  • string $expires:

Info

  • version - 1.0
  • author - Bobby Easland

Method do_redirect (line 1857)

void do_redirect( )

Function to perform redirect

Info

  • version - 1.0
  • author - Bobby Easland

Method expand (line 1250)

mixed expand( string $set)

Function to expand the SEO_CONVERT_SET group

Parameters

  • string $set:

Info

  • version - 1.0
  • author - Bobby Easland

Method generate_articles_cache (line 1494)

void generate_articles_cache( )

Function to generate articles cache entries

Info

  • version - 1.0
  • author - Bobby Easland

Method generate_categories_cache (line 1461)

void generate_categories_cache( )

Function to generate categories cache entries

Info

  • version - 1.1
  • author - Bobby Easland

Method generate_information_cache (line 1542)

void generate_information_cache( )

Function to generate information cache entries

Info

  • version - 1.0
  • author - Bobby Easland

Method generate_manufacturers_cache (line 1437)

void generate_manufacturers_cache( )

Function to generate manufacturers cache entries

Info

  • version - 1.0
  • author - Bobby Easland

Method generate_products_cache (line 1413)

void generate_products_cache( )

Function to generate products cache entries

Info

  • version - 1.0
  • author - Bobby Easland

Method generate_topics_cache (line 1518)

void generate_topics_cache( )

Function to generate topics cache entries

Info

  • version - 1.0
  • author - Bobby Easland

Method GetParentCategories (line 1120)

void GetParentCategories( mixed &$categories, integer $categories_id)

Recursion function to retrieve parent categories from category ID

Parameters

  • mixed $categories: Passed by reference
  • integer $categories_id:

Info

  • version - 1.0
  • author - Bobby Easland

Method get_article_name (line 1003)

string get_article_name( integer $aID)

Function to get the article name. Use evaluated cache, per page cache, or database query in that order of precedent.

Parameters

  • integer $aID:

Info

  • version - 1.0
  • author - Bobby Easland

Method get_cache (line 1610)

mixed get_cache( [string $name = 'GLOBAL'], [boolean $local_memory = false])

Function to get cache entry

Parameters

  • string $name:
  • boolean $local_memory:

Info

  • version - 1.0
  • author - Bobby Easland

Method get_cache_memory (line 1678)

mixed get_cache_memory( string $name, [string $method = 'RETURN'])

Function to get cache from memory

Parameters

  • string $name:
  • string $method:

Info

  • version - 1.0
  • author - Bobby Easland

Method get_category_name (line 929)

string get_category_name( integer &$cID)

Function to get the category name. Use evaluated cache, per page cache, or database query in that order of precedent

Parameters

  • integer $cID: NOTE: passed by reference

Info

  • return - Stripped anchor text
  • version - 1.1
  • author - Bobby Easland

Method get_full_cPath (line 1097)

string get_full_cPath( mixed $cID, integer &$original)

Function to retrieve full cPath from category ID

Parameters

  • mixed $cID: Could contain cPath or single category_id
  • integer $original: Single category_id passed back by reference

Info

  • return - Full cPath string
  • version - 1.1
  • author - Bobby Easland

Method get_information_name (line 1065)

string get_information_name( integer $iID)

Function to get the informatin name. Use evaluated cache, per page cache, or database query in that order of precedent.

Parameters

  • integer $iID:

Info

  • version - 1.1
  • author - Bobby Easland

Method get_manufacturer_name (line 972)

string get_manufacturer_name( integer $mID)

Function to get the manufacturer name. Use evaluated cache, per page cache, or database query in that order of precedent.

Parameters

  • integer $mID:

Info

  • version - 1.1
  • author - Bobby Easland

Method get_product_name (line 898)

string get_product_name( integer $pID)

Function to get the product name. Use evaluated cache, per page cache, or database query in that order of precedent

Parameters

  • integer $pID:

Info

  • return - Stripped anchor text
  • version - 1.1
  • author - Bobby Easland

Method get_topic_name (line 1034)

string get_topic_name( integer $tID)

Function to get the topic name. Use evaluated cache, per page cache, or database query in that order of precedent.

Parameters

  • integer $tID:

Info

  • version - 1.1
  • author - Bobby Easland

Method href_link (line 615)

string href_link( [string $page = ''], [string $parameters = ''], [string $connection = 'NONSSL'], [boolean $add_session_id = true])

Function to return SEO URL link SEO'd with stock generattion for error fallback

Parameters

  • string $page: Base script for URL
  • string $parameters: URL parameters
  • string $connection: NONSSL/SSL
  • boolean $add_session_id: Switch to add osCsid

Info

  • return - Formed href link
  • version - 1.0
  • author - Bobby Easland

Method implode_assoc (line 1298)

string implode_assoc( array $array, [string $inner_glue = '='], [string $outer_glue = '&'])

Function to implode an associative array

Parameters

  • array $array: Associative data array
  • string $inner_glue:
  • string $outer_glue:

Info

  • version - 1.0
  • author - Bobby Easland

Method is_attribute_string (line 1162)

boolean is_attribute_string( integer $pID)

Function to check if the products_id contains an attribute

Parameters

  • integer $pID:

Info

  • version - 1.1
  • author - Bobby Easland

Method is_cached (line 1749)

void is_cached( string $name, boolean &$is_cached, boolean &$is_expired)

Function to check if the cache is in the database and expired

Parameters

  • string $name:
  • boolean $is_cached: NOTE: passed by reference
  • boolean $is_expired: NOTE: passed by reference

Info

  • version - 1.0
  • author - Bobby Easland

Method is_cPath_string (line 1192)

boolean is_cPath_string( string $params)

Function to check if cPath is in the parameter string

Parameters

  • string $params:

Info

  • version - 1.0
  • author - Bobby Easland

Method is_product_string (line 1177)

boolean is_product_string( string $params)

Function to check if the params contains a products_id

Parameters

  • string $params:

Info

  • version - 1.1
  • author - Bobby Easland

Method make_url (line 879)

string make_url( string $page, string $string, string $anchor_type, integer $id, [string $extension = '.html'], string &$separator)

Function to return the generated SEO URL

Parameters

  • string $page:
  • string $string: Stripped, formed anchor
  • string $anchor_type: Parameter type (products_id, cPath, etc.)
  • integer $id:
  • string $extension: Default = .html
  • string $separator: NOTE: passed by reference

Info

  • version - 1.0
  • author - Bobby Easland

Method need_redirect (line 1787)

void need_redirect( )

Function to check if the URL needs to be redirected

Info

  • version - 1.2
  • author - Bobby Easland

Method not_null (line 1139)

boolean not_null( mixed $value)

Function to check if a value is NULL

Parameters

  • mixed $value:

Info

  • version - 1.0
  • author - Bobby Easland as abstracted from osCommerce-MS2.2

Method output_string (line 1366)

string output_string( mixed $string, [mixed $translate = false], [boolean $protected = false], string $sting)

Function to output a translated or sanitized string

Parameters

  • string $sting: String to be output
  • mixed $translate: Array of translation characters
  • boolean $protected: Switch for htemlspecialchars processing

Info

  • version - 1.0
  • author - Bobby Easland

Method parse_input_field_data (line 1353)

string parse_input_field_data( string $data, array $parse)

Function to translate a string

Parameters

  • string $data: String to be translated
  • array $parse: Array of tarnslation variables

Info

  • version - 1.0
  • author - Bobby Easland

Method parse_parameters (line 762)

string parse_parameters( string $page, string $params, string &$separator)

SFunction to parse the parameters into an SEO URL

Parameters

  • string $page:
  • string $params:
  • string $separator: NOTE: passed by reference

Info

  • version - 1.2
  • author - Bobby Easland

Method parse_path (line 1838)

array parse_path( string $path_info)

Function to parse the path for old SEF URLs

Parameters

  • string $path_info:

Info

  • version - 1.0
  • author - Bobby Easland

Method PrintArray (line 1314)

void PrintArray( mixed $array, [mixed $heading = ''])

Function to print an array within pre tags, debug use

Parameters

  • mixed $array:

Info

  • version - 1.0
  • author - Bobby Easland

Method profile (line 1205)

void profile( )

Function used to output class profile

Info

  • version - 1.0
  • author - Bobby Easland

Method save_cache (line 1572)

void save_cache( string $name, mixed $value, [string $method = 'RETURN'], [integer $gzip = 1], [integer $global = 0], [string $expires = '30/days'])

Function to save the cache to database

Parameters

  • string $name: Cache name
  • mixed $value: Can be array, string, PHP code, or just about anything
  • string $method: RETURN, ARRAY, EVAL
  • integer $gzip: Enables compression
  • integer $global: Sets whether cache record is global is scope
  • string $expires: Sets the expiration

Info

  • version - 1.0
  • author - Bobby Easland

Method SessionID (line 1385)

string SessionID( [string $sessid = ''])

Function to return the session ID

Parameters

  • string $sessid:

Info

  • version - 1.0
  • author - Bobby Easland

Method SessionName (line 1400)

string SessionName( [string $name = ''])

Function to return the session name

Parameters

  • string $name:

Info

  • version - 1.0
  • author - Bobby Easland

Method short_name (line 1273)

string short_name( string $str, [integer $limit = 3])

Function to return the short word filtered string

Parameters

  • string $str:
  • integer $limit:

Info

  • return - Short word filtered
  • version - 1.0
  • author - Bobby Easland

Method start (line 1329)

void start( float &$start_time)

Function to start time for performance metric

Parameters

  • float $start_time:

Info

  • version - 1.0
  • author - Bobby Easland

Method stock_href_link (line 648)

void stock_href_link( [mixed $page = ''], [mixed $parameters = ''], [mixed $connection = 'NONSSL'], [mixed $add_session_id = true], [mixed $search_engine_safe = true])

Stock function, fallback use

Info

Method stop (line 1340)

void stop( float $start, float &$time)

Function to stop time for performance metric

Parameters

  • float $start:
  • float $time: NOTE: passed by reference

Info

  • version - 1.0
  • author - Bobby Easland

Method strip (line 1232)

string strip( string $string)

Function to strip the string of punctuation and white space

Parameters

  • string $string:

Info

  • return - Stripped text. Removes all non-alphanumeric characters.
  • version - 1.1
  • author - Bobby Easland

Inherited Variables

Inherited Class Variable Summary

Inherited Methods

Inherited Method Summary


Documentation generated on Sun, 12 Jun 2005 14:35:29 -0400 by phpDocumentor 1.3.0RC3