A good challenege :)
Now and again I help out a friend or two with PHP code, today I was given a good little challenge to help on, the issue was a event calendar, one side displayed the text title/date/time of the event, the other side showed a thumbnail of the event’s flyer, the task was simple:
- When you click the TEXT link it would change the side picture template (already working)
- Data for Events/Info pulled from database (already working)
- When you click thumbnail, have it popup the full-sized image (not working)
So #3 is where I came in, to find a solution for the code bit to make it dynamically load the pop-up code instead of the one static image it was doing, so I got to thinking, and what I came up with was tweaking the existing javascript in the PHP end of things - I made a function that set one of the variables needed in the javascript popup code “imageURL” so when you clicked the link and it went to change the image thumbnail, it set a variable that was the image location the popup needed.
Was pretty cool, I realize that seems maybe trivial at some level, but it was a fun challenge to tackle with a hybrid of php & javascript,it was a nice stretch of the ol brain as javascript is not one of my languages of choice, but in this case my knowledge cut it
and I made a few other tweaks to the code - came out really nice.
Well busy night tonight, Denny’s, Server Migration, Sleep - I personally after the in-and-out heat today couldĀ go for “sleep”
but the migration should go pretty smooth - so on with the evening - have a good weekend folks!






Leave a Comment