![]() |
|
How to get setComment to work - 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: How to get setComment to work (/thread-10989.html) Pages:
1
2
|
How to get setComment to work - jphilbert - 2013-04-11 I just added "getcomment" to work in the Zenphoto lightroom plugin it can now syn all comments of images but for some reason I can get "setComment" to work .. what am I missing? function addImageComments($args) {
} How to get setComment to work - jphilbert - 2013-04-11 Do I need to set an object some how ? How to get setComment to work - acrylian - 2013-04-11
I don't remember Also you need to use the save() method after you setup a new object so you really save the values set (meaing if this is not an existing image in this case but a new one). How to get setComment to work - jphilbert - 2013-04-11 $image is a image object and the same coding works for my other functions with out a problem and I usually test it with an internal Zenphoto object I know works to make sure. As for the save() ...DUH!!! my bad let me check How to get setComment to work - jphilbert - 2013-04-11 Also having a issue with getting ratings it dies as soon as I do "$image->getRating()" function getImageRatings($args) {
} How to get setComment to work - jphilbert - 2013-04-11 This should help with your previous question:function getImageForImageID($id) {
How to get setComment to work - jphilbert - 2013-04-11 As soon as I add "$image->save();" it breaks the code... I think I have to make a dum theme and test my code in a actual Zenphoto environment to rule up any issues before I make new functions to connect to Zenphoto through the API. Let me know if you have any insight.. thanks ... kinda stuck. How to get setComment to work - acrylian - 2013-04-11
So you can't use the global directly? YOu also should not have to setup the gallery object as that is already in $_zp_gallery most everywhere. How to get setComment to work - jphilbert - 2013-04-11 Ok so I using one of the default themes to double check my code before I pull my hair out debugging what I can see .. When I executed this code This is the error it produced. Fatal error: Call to undefined method _Image::getRating() in /home1/glamwor2/public_html/clients.philbertphotography.com/themes/copy_of_default/image.php on line 56 How to get setComment to work - sbillard - 2013-04-11 There is no You should probably tell us what errors you are getting. But your descriptions all point to How to get setComment to work - acrylian - 2013-04-11 There is no How to get setComment to work - jphilbert - 2013-04-11 So you mean When I try it I get an error... let me rework the logic on that end later and see. How to get setComment to work - sbillard - 2013-04-11 Or use the function from the rating plugin How to get setComment to work - sbillard - 2013-04-11 Some suggestions: First there is always a global There is no guarantee that your will succeed, so you should be testing the result before using it. Otherwise, let us know the error and we can better tell what is failing. How to get setComment to work - jphilbert - 2013-04-11 This code $_zp_current_image->setComment('HELLO DOLLY'); Created this error... Fatal error: Call to undefined method _Image:etComment() in /home1/glamwor2/public_html/clients.philbertphotography.com/themes/copy_of_default/image.php on line 60 Well I am soo glad I was not going crazy after 10 hours of debugin I guess I have to make my own function to make this happen since the internal stuff is broken How to get setComment to work - acrylian - 2013-04-11
@sbillard: Aren't the functions You need to make sure that you use the methods on the right object. If you don't it never will work. How to get setComment to work - jphilbert - 2013-04-11 OK let me go over the docs again .. I think I made a mistake some where thanks so far .. So what is the "setcomment" for? How to get setComment to work - jphilbert - 2013-04-11 Thanks sbillard and acrylian! How to get setComment to work - sbillard - 2013-04-11 That is a method of the comment class, not the image class. That is why the URL you posted is to ...classes/Comment.html.... Theme objects have an @acrylian: You are right, I should always look first before posting a function name. How to get setComment to work - jphilbert - 2013-04-11 Yes got everything to work except "addcomment" but that is what I was looking for and I will lick it ... Thanks again for the help and understanding ... |