for each category there will be used a folder grafic with the name 'folder-{CATID}.gif' or 'folder-{CATNAME}.gif'. Only if this new picture files are not present, the orginal file 'folder.gif' will be used.
All extensions or questions to this little php coding are welcome.
If you want to see it working, i can post some links (only german sites, but for picture looking it will be okay ).
What you posted will not work for 4.1, except by accident if you have leftovers from a 4.0 install not properly removed, since you had it looking for template-associated images instead of style-associated images. Fixed it for you.
Using {CATNAME} will break on non-trivial names... possibly on spaces, almost certainly on apostrophes and punctuation. Worth noting it'd be case-sensitive on *nix.
An alternate method would be a custom file field for categories.
thanx for your help. I thought the using of {TEMPLATESDIR} is okay cause downlevel compatibility. But now I know it was randomly correct.
But your fixed version doesn't work for me, cause {IMAGESURL} includes every time the full url and the php function file_exists does not honor 'remote' urls. So I strip down {IMAGESURL} to have a relative dir.
Paul wrote: Ah, forgot that. {IMAGESPATH} is the one for file paths.
That's what i'm searching for... but it is also not working, cause {IMAGEPATH} contains the full installation dir from my hoster. (like automatcly File Upload Path: is filled) and not the relativ images path.
Comments on own folder graphic for each category
Forum Regular
Usergroup: Customer
Joined: Dec 20, 2007
Location: Germany
Total Topics: 33
Total Comments: 106
Hi to all,
for those who wants to have a unique folder graphic for each category here is a little solution. If you replace in main.tpl
with
for each category there will be used a folder grafic with the name 'folder-{CATID}.gif' or 'folder-{CATNAME}.gif'. Only if this new picture files are not present, the orginal file 'folder.gif' will be used.
All extensions or questions to this little php coding are welcome.
If you want to see it working, i can post some links (only german sites, but for picture looking it will be okay ).
Regards,
Frank
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
What you posted will not work for 4.1, except by accident if you have leftovers from a 4.0 install not properly removed, since you had it looking for template-associated images instead of style-associated images. Fixed it for you.
Using {CATNAME} will break on non-trivial names... possibly on spaces, almost certainly on apostrophes and punctuation. Worth noting it'd be case-sensitive on *nix.
An alternate method would be a custom file field for categories.
Forum Regular
Usergroup: Customer
Joined: Dec 20, 2007
Location: Germany
Total Topics: 33
Total Comments: 106
Hi Paul,
thanx for your help. I thought the using of {TEMPLATESDIR} is okay cause downlevel compatibility. But now I know it was randomly correct.
But your fixed version doesn't work for me, cause {IMAGESURL} includes every time the full url and the php function file_exists does not honor 'remote' urls. So I strip down {IMAGESURL} to have a relative dir.
Regards,
Frank
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Ah, forgot that. {IMAGESPATH} is the one for file paths.
Forum Regular
Usergroup: Customer
Joined: Dec 20, 2007
Location: Germany
Total Topics: 33
Total Comments: 106
Ah, forgot that. {IMAGESPATH} is the one for file paths.
That's what i'm searching for... but it is also not working, cause {IMAGEPATH} contains the full installation dir from my hoster. (like automatcly File Upload Path: is filled) and not the relativ images path.
thanx for help,
Frank
developer
Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California
Total Topics: 61
Total Comments: 7868
Why would you need a relative path? file_exists works with absolute paths, unless it's some sort of safe_mode restriction I'm unaware of.
Forum Regular
Usergroup: Customer
Joined: Dec 20, 2007
Location: Germany
Total Topics: 33
Total Comments: 106
thanx, you are right. file_exists works also with absolute paths. Here is the corrected coding: