Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Assign template to variable? Handle a set of templ. as one?
Goto page Previous  1, 2
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Apr 29, 2003 3:53 pm    Post subject: Reply with quote

I see, I was confused when you said:

Quote:

Why don't you "hardcode" C..Z as resource locators if the current OS is Windows?"


But what you really meant is, if the resource is C-Z and it isn't registered and it's Windows, then treat it as part of the filepath instead of throwing an error.

What about A-B? It's possible to get templates off a floppy yes? Especially those high traffic sites? Wink And of course, lower case should be allowed as well.

Monte
Back to top
View user's profile Send private message Visit poster's website
andre
Smarty Pro


Joined: 23 Apr 2003
Posts: 164
Location: Karlsruhe, Germany

PostPosted: Tue Apr 29, 2003 4:01 pm    Post subject: Reply with quote

My code snippet once again
Code:

if (!isset($this->_plugins['resource'][$resource_type]) && $current_os == "win" && (strtolower($resource_type) >= "a") && (strtolower($resource_type) <= "z") {
      if(file_exists($resource_type.":".$resource_name) && is_readable($resource_type.":".$resource_name)) {
        $readable = true;
        $resource_name = $resource_type.":".$resource_name;
    }


You see? If current OS is windows and the resource_type is "A".."Z" (upper or lower case) and wasn't registered manually then I re-add the $resource_type to the $resource_name to treat it as directory again.

I have written the above code in mind so there can be an error but I think this should work?! Confused
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Apr 29, 2003 4:09 pm    Post subject: Reply with quote

Yes I tried it and it has syntax errors and other problems. If you get it working clean and test it (I don't have windows handy) I'll put in the patch.

Monte
Back to top
View user's profile Send private message Visit poster's website
Wom.bat
Smarty Pro


Joined: 24 Apr 2003
Posts: 107
Location: Munich, Germany

PostPosted: Tue Apr 29, 2003 4:48 pm    Post subject: Reply with quote

I'd vote for minimum-two-character-resource-names Wink
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP