replacing sql data in the image view page

Phoca Gallery - image gallery extension
vux-at
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 16 Jan 2013, 00:40

replacing sql data in the image view page

Post by vux-at »

hi

what do i need to change to replace
the $catalias variable in span lightbox rel='lightbox-$catalias on the final view with
filename (from sql database) table phocagallery - need for a big change in the JS of slimbox the path/filename for the link and the catalias shows lightbox-categoryname in lowercase

the slimbox does not function without the lightbox- in front of it or does it? can it be done without? or what would be the JS code to cut away the first 9 characters?

thank you very much, ...greatly, ...
and sorry for the weird description, it is late and i do not know at the moment how to describe it better

best regards,
stefan
vux-at
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 16 Jan 2013, 00:40

Re: replacing sql data in the image view page

Post by vux-at »

ok, found out how it works withouth the 'lightbox' in the rel part
just delete the && el.rel.test(/^lightbox/i) in the JS of slimbox

or would it be ok to add a rel2='$pathandfilename'? (clean code)
this would not change any of the underlying code and the js could load the rel2 for all the other data it needs
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49149
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: replacing sql data in the image view page

Post by Jan »

Hi, if you don't get any error, both of the methods are Ok, I think :idea:
If you find Phoca extensions useful, please support the project
vux-at
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 16 Jan 2013, 00:40

Re: replacing sql data in the image view page

Post by vux-at »

ok, thx - i guess :D
so - how do i get the mysql filename into that rel or rel2 ?
what changes are to be done in
renderfront
detail
default_images
vux-at
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 16 Jan 2013, 00:40

Re: replacing sql data in the image view page

Post by vux-at »

hi jan

any updates on this subject?

please help me on the changes in these few php files
i just need to get the mysql $filename entry into the rel='' or rel2='' part
the rest i can do in the js with ease

thank you very much

best regards,
stefan
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49149
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: replacing sql data in the image view page

Post by Jan »

Hi, unfortunatelly I am not on my PC now to do tests in the code, so really cannot say what exactly should be modified :-( ( forum-rules.php (9) )

just print_r the image variable to see which objects you have there (there should be the path too) - so there you should find the filename and the path you get from $this->tmpl['path'] variable or you can call it: PhocaGalleryPath::getPath(); (there are different paths used in Phoca Gallery)

Jan
If you find Phoca extensions useful, please support the project
vux-at
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 16 Jan 2013, 00:40

Re: replacing sql data in the image view page

Post by vux-at »

ok for everyone who is interested to have working download link(s) in slimbox here is a solution
in
default_images.php (components/com_phocagallery/views/category/tmpl)
add beneath

Code: Select all

// A Start
echo '<a class="'.$value->button->methodname.'"';
the following

Code: Select all

echo ' lblink="'.$value->filename.'"';
then change your slimbox.js to act like this (the autoload code block) (Text and Link details must be adjusted to your needs of course!!)

Code: Select all

// AUTOLOAD CODE BLOCK (MAY BE CHANGED OR REMOVED)
Slimbox.scanPage = function() {
        $$($$("a").filter(function(el) {
                return el.rel;
        })).slimbox({/* Put custom options here */}, function(el) {
                return [el.href, el.title + '<br /><a href="' + el.href + '" target="_blank">Webversion downloaden</a><br /><a href="./' + el.getAttribute("lblink") + '" target="_blank">10x15 Format downloaden</a><br /><a href="http://ANY.SITE.YOU/WANT/' + el.getAttribute("lblink") + '" target="_blank">ANY OTHER FORMAT</a>'];
        }, function(el) {
                return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
        });
};
window.addEvent("domready", Slimbox.scanPage);

thanks to jan for the little hint :-)
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49149
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: replacing sql data in the image view page

Post by Jan »

Great, thank you for the guide.

Jan
If you find Phoca extensions useful, please support the project
Post Reply