Your example above still requires the key value pairs being passed through the URL in a normal fasion (?this=that). What I'm talking about is writing a url as
http://www.mysite.com/library/articles/articleid/31/page/2
While the above isn't a shorter url it does do one very important thing, it romves the "?" from the URL which is what trips up most search spiders.
Now if there was a way to have mod_rewrite - Keep in mind I'm not all that familiar with this function of apache so I may be missing something - rewrite the url to something like
/modules/wfsection/articles.php?articleid=31&page=2
that would be great. Now this could be done I suppose in this type of fashion:
1. match the first directory against some list of modules where we know /library/ is equal to /modules/wfsections/
2. Then match the next directory in the URL to a php file, in this case /articles/ is equal to /articles.php.
3. Anthing after the page match is a var=value par. simple php loop can determine that.
So the URL is broken up like this
http://[domain name]/[module alias]/[page name]/[var/value]Once this works for one module it would work for all. The only thing taht might trip it up a bit is sub directories of the main, but if you mape the sub direcotries to the [module alias] it won't matter. The nice things is the [module alias] could be set in the Xoops_version file. Mean while never actually changing the modules absolute path.
Hope this makes sense. It does in my brain, but getting it our is the hard part.
-----
As for the problem of writing the initial url, this is a bit of work since there would need to be a common makeurl() function used in all modules and the core. The nice thing with that is you could have error checking for broken links easily incorporated into such a function.
Something like this:
Quote:
function makeUrl($mod_path,$mod_alias, $page_name, $var_array){
// error check, does this file exist?
if(!file_exists($mod_path.$page_name){
$error = 'return an error, page doesn't exist';
return $error;
}
// assemble var value paring
$count = count($var_array);
if(is_array($var_array)){
for($i=0;$i!=$count;$i++){
var_val .= $var_array[$i]['var'].'/'.$var_array[$i]['value'];
($i < $count)? var_val .= '/':'';
}
}
// strip the ".php" off the page name
$page = substr($page,0,strpos(".php",$page));
// assemble new url
$url = $mod_alias.$page."/".var_val;
return $url;
Don't use the above, it's not tested but you get the idea.