PDA

View Full Version : Modify Categories links?


Drefsab
07-09-2005, 05:38 PM
Hi, Im trying to get this software working on a webserver that doesnt allow exicution of scripts that dont have extensions. I have renamed the files to .php (ie blogs becomes blogs.php) and have moddified the class's and templates to reflect these changes. How ever the last problem I have run into is on the main page.. on the left hand side where the category list is. Links always goto http://www.foo.com/categories/News/ and they should goto http://www.foo.com/categories.php/News/. Now I tracked the code down to RootArticleCategoriesPanel.php in the templates folder but I cant see how I can alter is to reflect the changes.

$output .= sprintf("
< div class=\"ListItem\" >
< div class=\"ListItem\" >
< A href='%s '>
%s
< /A >
< /div >


Is the current code. The %s in the href statement comes with a full url and the other one just is the categories name. Both seam to be giving different values. Please could someone help me with this.

p.s. I know there shouldnt be spaces in the brackets but I had to add them for them to show properly in this post cos for some reason the [CODE] tags didnt let me display them properly.

Thanks in advance

Drefsab

Jordie (Interspire Staff)
07-13-2005, 08:26 AM
If you wish to change the main files to have a .php extension, insert this code into your main .htaccess file and it should work fine without any other modification:


RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} categories.*
RewriteRule ^categories(.*)$ categories.php?$1 [T=application/x-httpd-php,L]

RewriteCond %{REQUEST_URI} articles.*
RewriteRule ^articles(.*)$ articles.php?$1 [T=application/x-httpd-php,L]

RewriteCond %{REQUEST_URI} pages.*
RewriteRule ^pages(.*)$ pages.php?$1 [T=application/x-httpd-php,L]

RewriteCond %{REQUEST_URI} blogs.*
RewriteRule ^blogs(.*)$ blogs.php?$1 [T=application/x-httpd-php,L]

RewriteCond %{REQUEST_URI} search.*
RewriteRule ^search(.*)$ search.php?$1 [T=application/x-httpd-php,L]

RewriteCond %{REQUEST_URI} authors.*
RewriteRule ^authors(.*)$ authors.php?$1 [T=application/x-httpd-php,L]



the %s signs you see are placeholders which are replaced further on in the code., Look after the closing quote " and there should be two variables that replace the two %s.

The bit you are looking for looks like AL_HELPER::CategoryLink($catRow["CategoryID"], $catRow["Name"]) You can alter this to "http://www.foo.com/categories.php/".$catRow["Name"]Hope this helps!