Pull Database Info from JQuery

ElGringo

Joined: 2008-03-19
Posts: 5
Posted: Mon, 2009-08-24 12:22

Is it possible to pull database information via jquery/javascript if I have the photo ID number? I am playing with a custom theme that uses Jquery and would like to pull down link information, description, etc. for an item.

If so, please let me know the syntax or point to an example module or piece of code in the base system to give me a clue on how to achieve this.

Thanks!

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2009-08-24 23:24

If you're creating a custom theme, pop open /themes/default/views/page.html.php and the other pages in there and take a look at how the default theme grabs that information.

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
ElGringo

Joined: 2008-03-19
Posts: 5
Posted: Mon, 2009-08-24 23:28

What I am trying to do is create a Jquery type gallery theme (similar to pikachoose: http://pikachoose.com/demo/). I am somewhat green to coding in general but can stumble along pretty readily with enough examples/info to go by.

In the theme I am trying to create, I would like to have the sidebar block information housed in the sidebar div be dynamically regenerated along with the main image when a thumbnail is clicked on below the main image. I figure i need to fire a PHP routine from Jquery to generate the sidebar output to a variable and then refill the Div with the content.

I apologize if my terminology is not exactly correct, but hopefully you get the idea of what I am trying to do here. I think Gallery 3 is far enough along for me to attempt to do this, correct?

Thanks!

 
ElGringo

Joined: 2008-03-19
Posts: 5
Posted: Mon, 2009-08-24 23:33
nivekiam wrote:
If you're creating a custom theme, pop open /themes/default/views/page.html.php and the other pages in there and take a look at how the default theme grabs that information.

I see that sidebar.html.php calls "<?= $theme->photo_menu() ?>".

How would I fire this and get the results posted to a variable in Jquery to use to reconstruct the sidebar?

Thanks.

 
ElGringo

Joined: 2008-03-19
Posts: 5
Posted: Tue, 2009-08-25 20:22

Nevermind. I was thinking about the solution to my problem from the wrong end. I am starting to wrap my head around the code for Gallery3 a bit better and think I have another plan of attack to do what I want.

Once I get something pulled together, I'll post it up for everyone. Though I must warn you upfront, that my coding skills aren't fully up there and my solution may be more of a hack than an actual solution. Anyways, hope to be able to pull it together soon.

Later.

 
Glooper

Joined: 2005-09-21
Posts: 225
Posted: Wed, 2009-08-26 04:33

I've done something similar in this theme

http://www.gatephotography.co.nz/

I create a list of LI's which has the information about the image within in it at the server end... (check the source for a page with several photos on to see the list of LI's)

I've then used jquery to traverse the list when the page is loaded and to stream the images onto the page, at which point the thumb is created.

You can probably use some of the code in that pikachoose demo for this side of it... alternatively have a look at http://devkick.com/lab/galleria/ which does a similar thing.

Ben

Benjamin Albert Smith - Photography

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2009-08-29 20:28

Glooper, are you using any 3rd party stuff, slideshow etc code in there or is that just pure G3 customized?
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
Glooper

Joined: 2005-09-21
Posts: 225
Posted: Sat, 2009-08-29 21:33

It's just a G3 theme. Though I did write a small module for the contact and about page.

I think I had to do a couple of small changes to the main code as well, that was to get the login dialog to look right in the theme. If I remember rightly I changed the standard dialog width from 500 to 300 and removed the html on the login dialog for the forgotten password as I didn't want to use this feature.

The slideshow was originally based on the galleria javascript code (see above)... though It's changed a hell of a lot from the original as I removed unused functionality and changed the way some of it worked.

Ben

Benjamin Albert Smith - Photography

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2009-08-29 21:45

Thanks Glooper, sent you a PM about another question.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2009-08-29 22:42

Thanks Glooper.

Quote:
I think I had to do a couple of small changes to the main code as well, that was to get the login dialog to look right in the theme. If I remember rightly I changed the standard dialog width from 500 to 300 and removed the html on the login dialog for the forgotten password as I didn't want to use this feature.

As far as you can recall is that the only change you did to core code?

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
Glooper

Joined: 2005-09-21
Posts: 225
Posted: Sat, 2009-08-29 22:55

I believe so yes. Ah wait I also changed some of the superfish.css. though I did this by doing my own version in the css directory. I changed it to make the menu bar when in admin mode appear like a toolbar at the top of the screen rather than within the screen.

Due to problems I was getting with performance of the css and js I also ended up converging them into a combined file... On the production version this then goes through smartoptimizer to compress and allow for client caching. When going into admin mode it goes back to the slower method of combining on the fly. I will look into this again at some point but currently I'm concentrating on getting a shopping cart / paypal module completed (which is pretty much ready to go once I've done a bit more testing / tweaking! :).

Ben

Benjamin Albert Smith - Photography

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2009-08-30 05:58

Sweet! Are those going to be released for the community? :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
Glooper

Joined: 2005-09-21
Posts: 225
Posted: Sun, 2009-08-30 06:02

Yep... :)

Might release them later today if I can get it to a reasonably stable state!

Ben

Benjamin Albert Smith - Photography