Page 1 of 1

replacing sql data in the image view page

Posted: 16 Jan 2013, 00:49
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

Re: replacing sql data in the image view page

Posted: 16 Jan 2013, 13:45
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

Re: replacing sql data in the image view page

Posted: 17 Jan 2013, 23:29
by Jan
Hi, if you don't get any error, both of the methods are Ok, I think :idea:

Re: replacing sql data in the image view page

Posted: 18 Jan 2013, 13:09
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

Re: replacing sql data in the image view page

Posted: 30 Jan 2013, 00:04
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

Re: replacing sql data in the image view page

Posted: 30 Jan 2013, 22:17
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

Re: replacing sql data in the image view page

Posted: 31 Jan 2013, 09:37
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 :-)

Re: replacing sql data in the image view page

Posted: 13 Feb 2013, 20:12
by Jan
Great, thank you for the guide.

Jan