I'm trying to make two versions of the slideshow, one that shows smaller pix and one that shows bigger pix. Ideally, it could be switched from within the slideshow, but from the way it's coded that looks like it might be tough.
Alternatively, I could use "small pix slideshow" and "big pix slideshow" links on my album and image pages, but for this to work, I'd need to be able to change the size parameter. I've pawed thru the functions a bit, but I'm not quite sure how to do it. I know you can set it in the plug-in options, but I'd like to change it when the user clicks that link.
I'm planning on just using the included slideshow plug-in, but if there's another method that isn't too labor-intensive, I could consider that, too.
Any ideas? Thanks in advance.
Comments
I *think* something like this is happening:
-printSlideShowLink() fills out a form and submits it
-somehow this calls slideshow.php in the themes folder
-which then calls printSlideShow() in the plug-ins folder
So my plan was to simply try to make a new function (called "printSlideShowCustomSize" that would have a size parameter. but i can't figure out how to intercept the sequence that I've outlined above, if indeed it is correct.
So in closing, if this is too much to explain, then I accept that I will just use the stock solution. But if it is relatively easy to take your expound on your suggestion a bit more, then I would be grateful. Thanks again in advance.
Just add a extra input field with the size value to the printSlideshowlink and submit that. Then process the submitted size value with the printSlideshow() function. Of course you need to make your custom functions variants.
Here's my plan:
1. create a new php file to be included that has a function in it called printSlideShowLinkCustomSize. This will look exactly like printSlideShowLink, except that the form will have a new name ("slideshowCustomSize_form") and it'll have an extra field.
2. create a new javascript somewhere that looks like this:
<script type="text/javascript">
function submit_slideshowCustomSize_form() {
document.slideshowCustomSize_form.submit();}</script>
3. add another new function to my new php file called printSlideShowCustomSize. again, this is just a copy of printSlideShow with the new size variable replacing the lines of code you originally mentioned.
--
So my questions are:
A. When the new form is submitted, what happens to it? How does this call the slideshow.php page in the theme folder? (Sorry, this is a gap in my HTML knowledge that I've tried to research, but so far come up empty.)
B. How do I pass the variable in the form to the new php function that prints out the new slideshow?
--
If passing the variable is too complicated, I could simply do a brute-force method of creating two functions that make fixed size slideshows (small and big). This is not an extensible solution; it solves my problem, but noone else could really use it. But still, in order to do this, I STILL have to figure out how the form calls the slideshow.php page in the themes folder. (I understand how that THAT page then invokes the big function housed in the slideshow.php file in the plug-ins folder, so I think that portion shouldn't be an issue).
Again, thanks for your help, and if this is too complicated to explain, you can tell me to buzz off.
In short to your questions:
3. Actually this functions does nothing more than turning a normal link (for better styling) into a form submit button.
A. The theme's slideshow.php is called in line 120 of the plugin's slideshow.php if someone submits the form behind printSlideshowlink(). That link itself is generated in line 115.
B. That is done via the POST submit that the printSlideshowlink() form does.
I would like to suggest to consult some php tutorials..:-)
if anybody is interested in the solution, just ask and i'll gladly share it.
unfortunately, i think i also discovered a bug in the stock slideshow stuff, but i'll post that elsewhere.
and to acrylian: yes, i'm researching php as i go. considering i hadn't done any work at all in php before zenphoto, i'm fairly pleased with what i've managed so far, but obviously there is always more to learn. tutorials are good, but they usually deal with ideal situations, and it's often non-trivial to extrapolate the examples to real-world code, especially that programmed by various different people. so i'm grateful for your tips!