Menu

#40 Skin block enhancement

closed-fixed
None
5
2002-05-30
2002-05-28
Will Dyson
No

When the skin block is displayed on a page that was
generated with a query string (such as an article
page), the links in the block to change skins are
incorrect. Example: article.php3?skin=basic generates
an error.

The attatched patch adds logic to
Block_render_skin.class to generate a correct query
string for the link and put that into a new template
parameter (URL). It also changes the basic and default
versions of skinblock.tpl to use "{URL}" instead of
"{PHP_SELF}?skin={SKIN}".

Now users can click on the skin changeing links from
article pages.

Discussion

  • Will Dyson

    Will Dyson - 2002-05-28

    patch to enhance skinblock

     
  • Joe Stewart

    Joe Stewart - 2002-05-30
    • assigned_to: nobody --> joestewart
    • status: open --> closed-fixed
     
  • Joe Stewart

    Joe Stewart - 2002-05-30

    Logged In: YES
    user_id=77269

    Thank you for the patch. Incorporated using the GLOBAL
    QUERY_STRING instead of the function submitted.

    This functionality has been applied to phpslash-ft cvs Thu
    May 30 16:00:15 2002 UTC.

     
  • Will Dyson

    Will Dyson - 2002-06-01

    Logged In: YES
    user_id=368834

    Hmm. I just looked at the function as applied to the tree,
    and it suffers from the problem that if a user switches
    skins several times while remaining on the same page, the
    querystring will continue to grow as "&skin=foo" is added to
    the end each time. Quite possible to end up with something
    like
    "http://mysite/article.php3?story_id=21&skin=default&skin=basic&skin=default&skin=foo".
    Perhaps this doesn't actually break anything, but it is
    (IMHO) very ugly. The function I supplied ensures that each
    query term is present only once in the query string.

     
  • Joe Stewart

    Joe Stewart - 2002-06-01

    Logged In: YES
    user_id=77269

    Will,

    See:

    http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phpslash/phpslash-ft/class/functions.inc.diff?r1=1.102&r2=1.103

    The changes to function setSkinTpl in functions.inc were
    committed shortly after that corrected the skin variable
    being continually being added to the url. This refresh was
    always in the code, just didn't like the way it worked so it
    was commented out.

     
  • Will Dyson

    Will Dyson - 2002-06-01

    Logged In: YES
    user_id=368834

    Joe,

    Ah, good. As long as it works. You should proabably remove
    the function I added to Block_render_skin.class, since it is
    not being used. And the extra template argument (URL) as well.

     

Log in to post a comment.