![]() |
|
Custom Plugin Undefined Function Error - 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: Custom Plugin Undefined Function Error (/thread-12388.html) |
Custom Plugin Undefined Function Error - Epsilon - 2015-12-19 I am building another plugin to add Disqus Commenting system to Zenphoto. I have the plugin working but whenever I call it I get the php "undefined function" error. The plugin is setup like: class disqus_comment_form { //options function function printDisqusCommentForm { } I have tested that the class exists on the page with: if (class_exists('disqus_comment_form')){//test} But it still can't find the function unless I use: $disqus = new disqus_comment_form(); $disqus->printDisqusCommentForm(); All of the other example plugins I have been looking through don't have to do this but I can't figure out what I have done differently. I've probably missed something very simple but any help would be greatly appreciated. Custom Plugin Undefined Function Error - acrylian - 2015-12-19
Our official comment_form plugin is based on a class as well but it also additionally has the plain function Custom Plugin Undefined Function Error - acrylian - 2015-12-19 FYI, our team member gjr once had made disqus plugin we have rediscovered so we put it on our unsuppported repository: http://www.zenphoto.org/news/zpdisqus Custom Plugin Undefined Function Error - Epsilon - 2015-12-20 I moved my function out of the class and got it to work as I wanted. I'm still pretty new to using classes etc. so I appreciate your help With my Disqus plugin I am hoping to use Single Sign On (SSO) so the user wont have to register for my site twice (once to use favorites etc. and the other to use Disqus comments). To do this I need to be able to get the current user's id, name and email and use it on any page that Disqus is active. What would be the best way to get this information? Custom Plugin Undefined Function Error - Epsilon - 2015-12-21 Looking over the documentation you provided I'm guessing I need to use some combination of the class Zenphoto_Administrator and the functions getID(), getName() and getEmail() but I can't seem to get it right. Custom Plugin Undefined Function Error - fretzl - 2015-12-21 You can use the global (always available) variable
Custom Plugin Undefined Function Error - acrylian - 2015-12-21 Quote:I'm still pretty new to using classes etc. so I appreciate your help There is a federated logon plugin available for similar things. Never used it myself and we don't really maintain it although it is included I admit. |