Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
10-30-2012, 02:33 AM #1
foreach($fullpic_array as $key => $imagelink)
/* remove the single quotes from each value now that you have the comma seperation */
$fullpic_array[$k] = str_replace("'","",$fullpic_array[$k]);
$medpic_array[$k] = str_replace("'","",$medpic_array[$k]);
$imagenow = "<a href='".$fullpic_array[$k]."' rel='lightbox[myprofile]'><img src='".$CONST_LINK_ROOT.'/'.$medpic_array[$k]."' border='0' alt='' /></a>";
}//close function show_big
Total pics = <a href="#" onclick="show_big();"><?=$no_of_pics;?></a>
Last edited by durangod; 10-30-2012 at 09:09 PM.
10-30-2012, 04:02 AM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,662 Times in 2,631 Posts
Yep. PHP is preprocessed though, so you'll end up with whatever is in $imagenow on the last iteration. You can't interact with it in any way of course since PHP is not capable of responding to client events.
So yep, you can create JS code with PHP. Nope you cannot interact with PHP using JS.
10-30-2012, 04:32 AM #3
Thanks Fou-Lu, i changed the foreach to a while
But i will have to look at this in the morning again, im getting very tired, its still not even trying to open the images in the lightbox and i did test the $imagenow seperately and it is correct it does work if i take it out of the function and just manually assign it to  rather than $k,PHP Code:
while($k < count($fullpic_array))
but ill look at it again tomorrow, i may end up having to open a window and display them on a sep window first.
Thanks so much... im headed to bed
10-30-2012, 06:48 PM #4
i got it, that was the last item on the list for this deal and thanks for all your help.
The fix was so obvious and right there in front of me but i was so tired and stressed over this that i just didnt see it. Remember that i said i may have to open another window for the lightbox. In the back of my mind i kept thinking there has to be a way im not the first one to have this issue.
I just kept thinking two things, they must be on a page first, and you have to click them, before it will work. And then it hit me like a ton of bricks man, i about fell out of my chair, and i remember i had seen it before on other sites but just didnt pay attention.
I just listed the images 30x30 in a row under the main image side by side, they are large enough to make out the image somewhat and small enough to put 8 of them under there before making another row.
Now i have them listed on the page using that array we made and now i can use lightbox, you click on one and then you can click next and prev images. I honestly have seen this setup so many times but it just never hit me till now after much needed sleep and after stressing all weekend over this.
Also doing it this way i did not have to use it wrapped in a function so much better.
Thanks sooooooooooooooo much for your help, really appreciate it..
Last edited by durangod; 10-30-2012 at 06:54 PM.