We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46308
    • 8 Posts
    Hello guys,
    I set up a multilingual page with babel.
    Everything works fine except the links of the phpthumb component.
    I use the gallery package to manage the images. Just the location of the image, phpthumb is get, from gallery is wrong.

    Here you can see what I mean:
    <img alt="title" src="/assets/components/gallery/connector.php?action=web/phpthumb&ctx=de&w=100&h=100&zc=1&far=C&q=90&src=/de/site/albums/6/38.jpg" class="">

    Actually all requests to files in the (de|en)/assets or (de|en)/site folder should redirect to /assets or /site. There are no seperate folders for each language.

    Here is my .htaccess configuration:
    RewriteEngine On
    RewriteBase /
     
    # redirect all requests to /en/favicon.ico and /de/favicon.ico
    # to /favicon.ico
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|de)/favicon.ico$ favicon.ico [L,QSA]
     
    # redirect all requests to /en/assets* and /de/assets* to /assets*
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|de)/assets(.*)$ assets$2 [L,QSA]
    
    # redirect all requests to /en/site* and /de/site* to /site*
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(en|de)/site(.*)$ site$2 [L,QSA]
     
    # redirect all other requests to /en/* and /de/*
    # to index.php and set the cultureKey parameter
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(en|de)?/?(.*)$ index.php?cultureKey=$1&q=$2 [L,QSA]
    



    So what could I do to fix this? Any Ideas?

    Best regards
    Florian

    This question has been answered by florian@frm. See the first response.

      • 50923
      • 137 Posts
      Have you got solution for this problem, I also have it?
        <a href="www.play2web.com" title="izrada web sajtova">Izrada web sajtova</a>
      • discuss.answer
        • 46308
        • 8 Posts
        Yes, I have found the cause of this problem.
        I have modified some lines in the core/components/gallery/model/gallery/galitem.class.php.
        Around line 57:
        $ms = $this->getMediaSource();
        if($ms->getBaseUrl() != '/') {
            // $format['src'] = $ms->getBaseUrl().$this->xpdo->call('galAlbum','getFilesUrl',array(&$this->xpdo)).$filename;
            $format['src'] = $this->xpdo->call('galAlbum','getFilesUrl',array(&$this->xpdo)).$filename;
        }
        


        and line 82 the same:
        $ms = $this->getMediaSource();
        if($ms->getBaseUrl() != '/') {
            // $format['src'] = $ms->getBaseUrl().$this->xpdo->call('galAlbum','getFilesUrl',array(&$this->xpdo)).$filename;
            $format['src'] = $this->xpdo->call('galAlbum','getFilesUrl',array(&$this->xpdo)).$filename;
        }
        


        This should fix all link problems related with gallery and in the backend to if your site is located in a subfolder.

        I hope that helps.

        Otherwise you need to customize the two system settings entries:
        gallery.files_path and
        gallery.files_url


        Sorry that I didn't post this solution earlier.

        Good luck.