![]() |
|
MySql Error when including template-functions - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: MySql Error when including template-functions (/thread-6278.html) Pages:
1
2
|
MySql Error when including template-functions - kgenly - 16-12-2009 Hi there, I've just installed zenphoto and (partially) integrated it into my wordpress site with skins. It works beautifully on its own. Everything displays correctly. However, on my homepage I want to also include some images from zenphoto. Unfortunately, when I use
I get "MySQL Error: Zenphoto could not connect to the database server.Check your zp-config.php file for the correct host, user name, and password.Note that you may need to change the host from localhost if your web server uses a separate MySQL server, which is common in large shared hosting environments like Dreamhost and GoDaddy.Also make sure the server is running, if you control it." I have checked zp-config.php multiple times and it is indeed correct. I feel pretty confident saying it's correct because when I visit my normal zenphoto gallery, everything works. It's just when I try to include the template functions on another page that it goes bananas. I've spent about an hour googling and poking at the thing and nothing seems to work. Any thoughts? MySql Error when including template-functions - sbillard - 16-12-2009 You have not told us what the structure of your site is. For instance, is Zenphoto installed in the /zenphoto folder? MySql Error when including template-functions - acrylian - 16-12-2009 Sorry, this is a known issue that the "zenphoto as a plugin" way sadly simply does s not work with Wordpress anymore. We were also not able to solve that as we don't know what and why Wordpress seems to override the db connection. We solved that on zenphoto.org by using some custom Wordpress template functions to get the info directly without using Zenphoto functions (on the download page for the latest images for the screenshots, themes and showcase)- On our extensions section there are also some Wordpress plugins to help. MySql Error when including template-functions - kgenly - 16-12-2009 To sbillard: Yes, that is where it is. Wordpress is also in the root, although not in a folder. To acrylian: Interesting! I'm glad I didn't spend too much more time struggling with this, then. Do you have an example of these custom functions somewhere that you could link me to? The code itself, I mean. I will check out the plugins... All the ones I've seen so far work in posts, but not in templates, which is where I really need to work it in. I'll poke around somemore. Thanks for your replies. MySql Error when including template-functions - acrylian - 16-12-2009 We have the same setup on zenphoto.org. We actually would like to find out why that including does not work but are stuck as we don't really know where to look right now. Sorry, I don't have a link to those functions as I did them directly for our specific use to get the latest images directly from the zenphoto cache (I was too lazy to implement any image processing). I will take a look later if I maybe can generalize them a little. MySql Error when including template-functions - kgenly - 16-12-2009 That would be an ENORMOUS help. It'd be great to at least have a place to jump off from. MySql Error when including template-functions - acrylian - 16-12-2009 Here we go: http://www.zenphoto.org/trac/attachment/wiki/ZenphotoPlugins/get-latest-zp-image-for-wp.zip MySql Error when including template-functions - ziguline - 22-12-2009 Hi Acrylian, I've used your function to display latest images on index page of my wordpress website, but for a strange reason I get this error: Query failed : Table 'morarte_zigu_test.zp_albums' doesn't exist It seems that the function opens the DB of my wordpress installation and not the DB of Zenphoto Gallery installation, BUT I've made the right connection parameters in order to connect to the right DB... Do you have any idea? Thank you as ever.. Dimitri MySql Error when including template-functions - acrylian - 22-12-2009 Do you really first used the function to connect to the database of Zenphoto and then the one for the latest image? Double, triple check the db details. It is working on our site although in a modified version. MySql Error when including template-functions - ziguline - 22-12-2009 As I did... MySql Error when including template-functions - ziguline - 22-12-2009 code in the function.php ` MySql Error when including template-functions - acrylian - 22-12-2009 You first have to call MySql Error when including template-functions - ziguline - 22-12-2009 You are right! now I'm struggling with the right name of image in the cache ; ) Thank you. Have a nice Christmas Time! Dimitri MySql Error when including template-functions - acrylian - 22-12-2009 Well, yeah, it's just a hacked workaround until we hopefully find out why the "plugin way" does not work anymore. MySql Error when including template-functions - navjotjsingh - 25-12-2009 How to modify so that I can get some n number of latest pics not from a album but latest images from overall gallery? I can't figure out since I have no experience of coding. Any help? MySql Error when including template-functions - acrylian - 25-12-2009 Sorry, you will have to learn a few things to do it yourself. You will understand that I can't do that for you. MySql Error when including template-functions - navjotjsingh - 25-12-2009 Ok...I have found a proper WP Plugin...will try to fork it to work according to my needs. MySql Error when including template-functions - rezo.kun - 03-01-2010 Hi all, I have the same problem. If I just call template-functions.php
it's ok, but, if I call it in some function, f.e.:
p.s. sorry for my english. MySql Error when including template-functions - acrylian - 03-01-2010 You can't place function definitions within function definitions... MySql Error when including template-functions - sbillard - 03-01-2010 Which means you must do the |