looks very promising, at least from your blog. However, after following your instructions filling in all the required paths (i might have missed something) and puting [zp]"albumname"[/zp], i got this:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gioloves/public_html/wp-content/plugins/zenP.php on line 58
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gioloves/public_html/wp-content/plugins/zenP.php on line 63
i suspect it's got something to do with prefix of the tables in zenphoto db. As my tables have no prefix, i did not enter anything in line 36 "define('zp_PRE',$conf['']); // prefix of the tables in db"
I still can't get it. Same message. In step 2 of your intructions, you mentioned "2, change the following configuration of zenP". Could you specify exactly which lines must i change? So far I've changed
define('zp_PRE',$conf['mysql_prefix']); // prefix of the tables in db
function zenp($text) { preg_match_all("#\[zp\](.*?)\[/zp\]#si",$text,$matches);
if(count($matches[0])==0) return $text;
for ($i=0; $i < count($matches[0]); $i++) { $pos = strpos($text, $matches[0][$i]); $gallery = $matches[1][$i]; $replace=wpzp(trim($gallery)); $text = substr_replace($text, $replace ,$pos,strlen($matches[0][$i])); } mysql_select_db(DB_NAME);//select the db of wordpress, or wp will not work. return $text; }
function wpzp($album,$n=5){ $db=mysql_select_db(zp_DB); $result = mysql_query("SELECT * FROM `".zp_PRE."albums` WHERE `folder` = \"". $album ."\" LIMIT 1"); $_album = mysql_fetch_assoc($result); //suppose the album exists.
$result = mysql_query("SELECT * FROM `".zp_PRE."images` WHERE `albumid` = \"".$_album['id']."\" ORDER BY RAND() LIMIT ".$n); $imgs = array(); while ($row = mysql_fetch_assoc($result)) $imgs[] = $row;
Did i change the 2nd line correctly? Are there more lines to change/edit ?
In my post, i used this tag: [zp]Desktops[/zp]
and here's the error message:
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gioloves/public_html/wp-content/plugins/zenP.php on line 58
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/gioloves/public_html/wp-content/plugins/zenP.php on line 63
@kaiedo: it's right at the very top of this thread, after downloading it, change the extention to .php, then open it and edit 2 lines accordingly to your paths, before uploading to the wp-plugins folder and activating it.
This is great.. thanks for the code.. I now have it implemented on my site.. and now that I followed the directions.. it worked this time..
Not sure how hard it would be but I host wordpress blogs and zen photoalbums for friends, they would get confused if i tell them to write there own tags.. how hard would it be to add a button to auto insert the tags and prompt them for the album name? I know I am probably asking a bit much but just thought I would put in my 2 centes
@WeiChen: Thanks a lot for the nice and easy plugin. It just took me a while to figure out that you had to use the [zp]-Tag not in the source code and with just these brackets. At first I thought it was an html-tag that had to be used in source code like this: ``. Maybe you'd like to add this to the instructions, for beginners like me ;-).
Another issue: If I click on one of the images displayed by the zp-tag and get directed to my gallery, this gallery is unable to show German umlauts, while in fact my gallery does show them. If one then reloads the gallery, the umlauts are shown. Is there any way I can modify the code to have the umlauts shown correctly at once?
I’m trying to use your plugin, I uploaded it on my site (http://jadawin.netsons.org) in the plugins directories and changed the 2 rows it said in the file, but once I call directly that file I get this error:
atal error: Call to undefined function add_filter() in /var/www/netsons.org/jadawin/wp-content/plugins/zen.php on line 28
what could be?… I tried to read the old comments to see if it was happened to someone else but not.and I’m using WP 2.2….
Comments
care to help me out? cheers
define('zp_PRE',$conf['mysql_prefix'])
it will get the configure automatically
line 30: require_once("http://giolovesgod.com/gallery/zen/config.php");// your zenp config file
line34:
define('zp_PATH','http://giolovesgod.com/gallery');
That's it, 2 lines. Are my paths correct? What did i miss?
could you post your zen.php here for me to study?
require_once('/path/to/config.php'), the path of zenphoto config.php in your server, not URL.
In my post, i used this tag: [zp]Desktops[/zp]
and here's the error message: Help me?
Not sure how hard it would be but I host wordpress blogs and zen photoalbums for friends, they would get confused if i tell them to write there own tags.. how hard would it be to add a button to auto insert the tags and prompt them for the album name? I know I am probably asking a bit much but just thought I would put in my 2 centes
Another issue: If I click on one of the images displayed by the zp-tag and get directed to my gallery, this gallery is unable to show German umlauts, while in fact my gallery does show them. If one then reloads the gallery, the umlauts are shown. Is there any way I can modify the code to have the umlauts shown correctly at once?
Thanks in advance,
Claudia
This is an awesome plugin. Thanks for making it available to all. Keep up the good work!
Your plugin just made all my dreams come true. Thank you!
I’m trying to use your plugin, I uploaded it on my site (http://jadawin.netsons.org) in the plugins directories and changed the 2 rows it said in the file, but once I call directly that file I get this error:
atal error: Call to undefined function add_filter() in /var/www/netsons.org/jadawin/wp-content/plugins/zen.php on line 28
what could be?… I tried to read the old comments to see if it was happened to someone else but not.and I’m using WP 2.2….
Thanks in advance, Luigi
What to do??
Help me :-S