It is currently Mon Dec 11, 2017 4:56 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Apr 12, 2013 8:57 am 
Offline

Joined: Wed Feb 20, 2013 11:12 am
Posts: 6
Hi, this is (I believe) a bug related with my other "finding" on theme_path [http://www.vasiljevski.com/forum/viewtopic.php?f=35&t=783].

The theme_path variable is used just to get to the next and previous images and in the original code it failed to be set, so we have to hardcode it at the top of the jquery.galleryview-2.1.1.js file like this:

Code:
var loader_path = 'plugins/content/admirorgallery/admirorgallery/templates/galleryView/';
var theme_path = loader_path + 'themes/';


However, it still fails to find the images. For it to find them, the theme_path should include the dir where joomla is installed on my server.

The problem is that it is looking for the images at:

Quote:
http://myserver/plugins/content/admirorgallery/admirorgallery/templates/galleryView/themes/light/prev.gif


which fails because joomla is at http://myserver/joomla/ and the galleryView images are at:
Quote:
http://myserver/joomla/plugins/content/admirorgallery/admirorgallery/templates/galleryView/themes/light/prev.gif


How can I fix this whitout having to hardcode tha [b]joomla[b] subpath in the code?

Kind regards
--santilĂ­n


Top
 Profile  
 
 Post subject: galleryView next and prev images not found
PostPosted: Fri Apr 12, 2013 8:57 am 
Top  
PostPosted: Thu Apr 18, 2013 9:33 am 
Offline
Developer
Developer
User avatar

Joined: Sat Aug 14, 2010 9:31 pm
Posts: 1241
Location: Novi Sad, Serbia
Well previous proposed solution, by me, was not so nice :)

Better solution would be to define a variable and add path from PHP, then later use it in the script, something like:
Code:
$AG->insertJSCode(' var full_loader_path = "'.$AG->pluginPath . $AG->currTemplateRoot.'";');


So add line from above in index.php in galleryView folder:
Code:
$AG->loadCSS($AG->currTemplateRoot.'galleryview.css');
$AG->loadCSS($AG->currTemplateRoot.'albums/albums.css');
$AG->loadCSS($AG->currTemplateRoot.'pagination/pagination.css');

$AG->insertJSCode(' var full_loader_path = "'.$AG->pluginPath . $AG->currTemplateRoot.'";');

$AG->loadJS($AG->currTemplateRoot.'jquery.timers-1.2.js');
$AG->loadJS($AG->currTemplateRoot.'jquery.easing.1.3.js');
$AG->loadJS($AG->currTemplateRoot.'jquery.galleryview-2.1.1.js');


Then in "jquery.galleryview-2.1.1.js" change this part:
Code:
         $('script').each(function(i){
            var s = $(this);
            if(s.attr('src') && s.attr('src').match(/jquery\.galleryview/)){
               loader_path = s.attr('src').split('jquery.galleryview')[0];
               theme_path = s.attr('src').split('jquery.galleryview')[0]+'themes/';   
            }
         });


to
Code:
         $('script').each(function(i){
            var s = $(this);
            if(s.attr('src') && s.attr('src').match(/jquery\.galleryview/)){
               loader_path = full_loader_path; //s.attr('src').split('jquery.galleryview')[0];
               theme_path = s.attr('src').split('jquery.galleryview')[0]+'themes/';   
            }
         });


This should be more bulletproof solution :)

_________________
Help Admiror Gallery become even better,
give us a review on JED


Top
 Profile  
 
PostPosted: Mon Apr 22, 2013 5:44 pm 
Offline

Joined: Wed Feb 20, 2013 11:12 am
Posts: 6
I had to remove the initial slash from the "/"+theme_path expressions when adding the images.

Now it works like a charm!

Only a doubt, why is still necessary the old code to get the theme path?

Code:
         
            $('script').each(function(i){
            var s = $(this);
            if(s.attr('src') && s.attr('src').match(/jquery\.galleryview/)){
               loader_path = s.attr('src').split('jquery.galleryview')[0];
               theme_path = s.attr('src').split('jquery.galleryview')[0]+'themes/';   
            }
         });


Wouldn't be just enough to set:

Code:
                        loader_path = full_loader_path; //s.attr('src').split('jquery.galleryview')[0];
                        theme_path = loader_path + 'themes/';   


Thanks!


Top
 Profile  
 
PostPosted: Thu Apr 25, 2013 11:57 am 
Offline
Developer
Developer
User avatar

Joined: Sat Aug 14, 2010 9:31 pm
Posts: 1241
Location: Novi Sad, Serbia
Quote:
Wouldn't be just enough to set:

Code:
loader_path = full_loader_path; //s.attr('src').split('jquery.galleryview')[0];
theme_path = loader_path + 'themes/';


Thanks!


Yes, you are right, it would be enough :)

When I saw your post and investigated the issue, I was working on something else, and honestly didn't pay much attention, I just wanted to make it work :)

_________________
Help Admiror Gallery become even better,
give us a review on JED


Top
 Profile  
 
PostPosted: Mon Apr 29, 2013 9:07 am 
Offline

Joined: Wed Feb 20, 2013 11:12 am
Posts: 6
Ok, thanks, it works perfectly now.


Top
 Profile  
 
 Post subject: [solved] Re: galleryView next and prev images not found
PostPosted: Mon Apr 29, 2013 9:07 am 
Top  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

 


All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron

This is the official Admiror Joomla! Community Forum. You are welcome to join the Admiror Joomla! Community. All Admiror Joomla! Extensions Users, Joomla! Developers, PHP or mySQL Developers are welcome to support & contribute to Admiror Joomla! Projects.

Joomla! is a free and open source content management system (CMS) for publishing content on the World Wide Web and intranets. With a vibrant volunteer community, user-friendly features and plenty of power, Joomla is perfect for your website!

Joomla! is written in PHP, uses object-oriented programming (OOP) techniques and software patterns, stores data in a MySQL database, and includes features such as page caching, RSS feeds, printable versions of pages, news flashes, blogs, polls, search, and support for language internationalization.

Joomla! is the property of Open Source Matters, Inc. All rights reserved. Read more about Joomla! at http://www.joomla.org/.


Protected by Anti-Spam ACP Powered by phpBB® Forum Software © phpBB Group