array('label' => 'Friendly Default', 'examples' => array('{SITEURL}download/category/3/my-category-name')), 'non-numeric' => array('label' => 'Friendly (experimental)', 'examples' => array('{SITEURL}download/my-category/my-sub-category/my-file-name')), ); // Batch generate SEF URls on tables. public $generate = array( 0 => array('table'=> 'download', 'primary'=>'download_id', 'input'=>'download_name', 'output'=>'download_sef'), 1 => array('table'=> 'download_category', 'primary'=>'download_category_id', 'input'=>'download_category_name', 'output'=>'download_category_sef') ); function config($profile=null) { switch($profile) { case "non-numeric": $config = $this->profile2(); break; case "default": default: $config = $this->profile1(); } return $config; } private function profile2() { $config = $this->profile1(); $config['subcategory'] = array( 'regex' => '^{alias}/([^\/]*)/([^\/]*)/?$', 'redirect' => '{e_PLUGIN}vstore/vstore.php?catsef=$2', 'sef' => '{alias}/{cat_sef}/{subcat_sef}' ); $config['category'] = array( 'regex' => '^{alias}/([^\/]*)/(.*)$', 'redirect' => '{e_PLUGIN}download/download.php?action=list&id=$1', 'sef' => '{alias}/{download_category_sef}', ); return $config; } private function profile1() { $config = array(); /* $config['subcategory'] = array( 'regex' => '^{alias}/([^\/]*)/([^\/]*)/?$', 'redirect' => '{e_PLUGIN}vstore/vstore.php?catsef=$2', 'sef' => '{alias}/{cat_sef}/{subcat_sef}' ); */ $config['category'] = array( 'regex' => '^{alias}/category/([\d]*)/(.*)$', 'redirect' => '{e_PLUGIN}download/download.php?action=list&id=$1', 'sef' => '{alias}/category/{download_category_id}/{download_category_sef}/', ); $config['item'] = array( 'regex' => '^{alias}/([\d]*)/(.*)$', 'redirect' => '{e_PLUGIN}download/download.php?action=view&id=$1', 'sef' => '{alias}/{download_id}/{download_sef}', ); $config['get'] = array( 'regex' => '^{alias}/get/([\d]*)/(.*)$', 'sef' => '{alias}/get/{download_id}/{download_sef}', 'redirect' => '{e_PLUGIN}download/request.php?id=$1', // file-path of what to load when the regex returns true. ); $config['report'] = array( 'regex' => '^{alias}/report/([\d]*)/(.*)$', 'sef' => '{alias}/report/{download_id}/{download_sef}', 'redirect' => '{e_PLUGIN}download/download.php?action=report&id=$1', // file-path of what to load when the regex returns true. ); $config['image'] = array( 'regex' => '^{alias}/image/([\d]*)/(.*)$', 'sef' => '{alias}/image/{download_id}/{download_sef}', 'redirect' => '{e_PLUGIN}download/request.php?download.$1', // file-path of what to load when the regex returns true. ); $config['index'] = array( 'regex' => '{alias}/?(.*)$', 'sef' => '{alias}/', 'redirect' => '{e_PLUGIN}download/download.php$1', ); return $config; } }