Fork me on GitHub

Suggestion for structure of outputfilter.shorturls.php  Bottom

  • Hi,

    I wanted to get some opinion here on structure for short urls before clutteting up the NOC.

    I've been using short-urls for several months and thought it would be better if the $in and $out arrays were in the one multi-dimensional array.

    This would allow the entries to be grouped in pairs and would ease configuration of this file. Currently I used a split-pane editor. When editing existing entries or adding new ones there is a need to have the $in and $out arrays visible together with the .htaccess file. It is easy to get these arrays out of sync as it is currently setup.

    What is the reasoning for the current structure?

    It would be useful as well if this plugin could be overriden by placing it in the plugin directory for the theme. That would simplify configuration setps when PN version is updated.

    Opinions anyone?
  • The structure is simply based on the way Craig Saunders (coldrolledsteel) did his original short urls implementation. Any restructuing to make it easier would be welcome.

    Theme specific plugins can be already exist by placing the file in themes/<themename>/plugins. However i've not checked if this path is searched before the main one. It would be a fairly simple check to confirm this. I'm not sure what would be best here though.... Having the theme path checked first would be best for overriding plugins but this would mean that each plugin check for a standard plugin would require an additional file system check first.

    -Mark

    --
    Visit My homepage and Zikula themes.</themename>
  • I had a closer look at the code. It looks like it was structured in that way so that preg_replace function could be readily used. May need to look a little harder for a nice
    solution.

    Is there any change in the pipeline for short urls with regard to 0.8? I wouldn't want to spend time looking into it if there are plans for other changes to be made.
  • Mark,

    Would it solve the problem to add a Xanthia configuration variable to indicate whether or not to check the theme path for overridden standard plugins? You're already grabbing all the Xanthia configuration variables anyway, so just adding another one wouldn't add to the overhead and then the theme plugin directory would only be checked for standard plugins if the user states that it should be. Come to think of it, this could either be a user option or something that's defined in the theme itself. Or maybe both. Let the theme determine the default setting and allow the user to override that setting.


    Ed
  • Ed,

    Not necesarily. Every function call is an overhead and we need to ensure that we minimize those and all other permance related issues. I'll check the re-ordering of theme plugins to see the result. My aim is that a cache hit will be a quick as possible.

    -Mark

    --
    Visit My homepage and Zikula themes.

This list is based on users active over the last 60 minutes.