Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • rajacks Friend
    #128904

    I recently upgraded my site to Joomla 1.5 and Virtuemart 1.1. Everything has been going smoothly except I ran into a minor bug after upgrading the JA_Paritti template to 1.5 along with JA_Slideshow.

    Basically the slideshow was functioning however any time it displayed a captioned picture the control bar would push down to the bottom and was not visible. I traced the problem down and found that the stylesheet “ja-slideshow.css” was not getting loaded. Here was the HTML output from the frontpage:

    <link rel=”stylesheet” href=”http://www.beautifulthingsboutique.net//modules/mod_jaslideshow/ja_slideshow/ja-slideshow.css” type=”text/css” />

    As you can see there were two forward slashes before referencing ‘modules/mod_jaslideshow/ja_slideshow/ja-slideshow.css’.

    Looking further I found the following statement in the PHP source:

    JHTML::stylesheet(‘ja-slideshow.css’, JURI::base().’/modules/mod_jaslideshow/ja_slideshow/’);

    The function JHTML::stylesheet looks like it prepends a slash to the given path parameter.

    Changing the code as shown below fixed the problem:

    JHTML::stylesheet(‘ja-slideshow.css’, ‘modules/mod_jaslideshow/ja_slideshow/’);

    Best Regards,
    Rodney

    pala999 Friend
    #250604

    Hi rajacks,

    in your Source Code are more Links with double slash
    Are you sure, that your Live Site in configuration.php is correct ?

    http://www.beautifulthingsboutique.net/
    Without trailing slash !

    I updated Paritii in all Versions and never got this error.

    Greetings from Germany

    pala

    whw07 Friend
    #250628

    ja_slideshow.css is an empty file in my installation. What classes should be defined in this CSS?

    rajacks Friend
    #250629

    Hi pala,

    Thanks for the response. I doubled checked my sites configuration.php file and the $live_site variable was an empty string. I also checked my joomla 1.5 installation log and found no trailing slash on the site name. After that I went digging a little deeper looking at the docs and code for JURI::base(). The docs don’t mention anything about base() returning a URI with a trailing slash, however, it looks like it does: I found the following piece of code in the JURI:base() function.

    function base($pathonly = false)
    {
    static $base;

    // Get the base request path
    if (!isset($base))
    {
    $config =& JFactory::getConfig();
    $live_site = $config->getValue(‘config.live_site’);
    if(trim($live_site) != ”) {
    $uri =& JURI::getInstance($live_site);
    $base[‘prefix’] = $uri->toString( array(‘scheme’, ‘host’, ‘port’));
    $base[‘path’] = rtrim($uri->toString( array(‘path’)), ‘/\’);
    if(JPATH_BASE == JPATH_ADMINISTRATOR) {
    $base[‘path’] .= ‘/administrator’;
    }
    } else {
    $uri =& JURI::getInstance();
    $base[‘prefix’] = $uri->toString( array(‘scheme’, ‘host’, ‘port’));

    if (strpos(php_sapi_name(), ‘cgi’) !== false && !empty($_SERVER[‘REQUEST_URI’])) {
    //Apache CGI
    $base[‘path’] = rtrim(dirname($_SERVER[‘PHP_SELF’]), ‘/\’);
    } else {
    //Others
    $base[‘path’] = rtrim(dirname($_SERVER[‘SCRIPT_NAME’]), ‘/\’);
    }
    }
    }

    return $pathonly === false ? $base[‘prefix’].$base[‘path’].’/’ : $base[‘path’];
    }

    Please correct me if I’m wrong but it looks like the return function is adding a trailing slash if the $pathonly flag is not set to true.

    So in the mod_jaslideshow.php file, the following lines should be changed which append a string that starts with a leading forward slash onto the base path that already includes a trailing slash:

    if ($mootools) { echo ‘<script src=”‘.JURI::base().’/modules/mod_jaslideshow/ja_slideshow/mootools.v1.1.js” type=”text/javascript”></script>’ . “n”; }

    echo ‘<script src=”‘.JURI::base().’/modules/mod_jaslideshow/ja_slideshow/ja-slideshow.js” type=”text/javascript”></script>’ . “n”;

    $linktag = ‘<link href=”‘.JURI::base().’/modules/mod_jaslideshow/ja_slideshow/ja-slideshow.css” rel=”stylesheet” type=”text/css” />’;

    JHTML::stylesheet(‘ja-slideshow.css’, JURI::base().’/modules/mod_jaslideshow/ja_slideshow/’);

    Wonderful templates and extensions by the way!

    Best Regards,
    Rodney

    P.S> I also found the following mentions to the trailing slash in these forum postings:

    http://www.theartofjoomla.com/magazine/article/29-removing-a-legacy-part-2.html
    http://forum.joomla.org/viewtopic.php?f=231&t=233734

    rajacks Friend
    #250635

    I’m not speaking for JA but two. The ja-slideshow.css had:

    /*————————————————————————

    # JA SlideShow

    # ————————————————————————

    # Copyright (C) 2004-2006 J.O.O.M Solutions Co., Ltd. All Rights Reserved.

    # @license – Copyrighted Commercial Software

    # Author: J.O.O.M Solutions Co., Ltd

    # Websites: http://www.joomlart.comhttp://www.joomlancers.com

    ————————————————————————-*/

    .description {

    position: absolute;

    bottom: 0;

    background: #999999;

    width: 100%;

    padding: 4px 0;

    text-indent: 8px;

    }

    .description-hidden {

    padding: 0;

    position: absolute;

    bottom: 0;

    }

    Best Regards,
    Rodney

    pala999 Friend
    #250651

    Hi again, Rodney.

    Now the confusion is perfect 🙂

    1) My file is empty, same like “whw07” said
    2) No double-slash in source code and no errors (checked in Firebug`s “Net” Function)
    everything will be loaded.

    What is your J!-Version, 1.0 or 1.5 ?

    Sorry, no compliance for that error from my side.

    However a very well coded and good looking Template, i like it.

    Greetings from Germany

    pala

    rajacks Friend
    #250658

    Hi Pala,

    I am running Joomla 1.5.1.

    Best Regards,
    Rodney

Viewing 7 posts - 1 through 7 (of 7 total)

This topic contains 7 replies, has 3 voices, and was last updated by  rajacks 16 years, 3 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum