HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


[RESOLVED] addon_installed() does not appear to work for 3rd-party addons.

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#68140 (In Topic #14493)
Avatar

Community saint

I've installed the ocUsermap addon and it works fine.

I am in the process of integrating it into join.php so that new members will get a default lat/long based on the country they are from.

I'm trying to use "addon_installed('ocUsermap')" to make my code more robust, but it returning false, indication that the addon in not installed.

I know my syntax is correct because it works fine when I use "addon_installed('stats')" as a test.

From what I can tell it seems to work for ocPortal default addons, but not 3rd-party ones, and I can't find any reference in codebook.pdf to indicate that it shouldn't work with 3rd-party addons.

Is this supposed to work?

(I was going to originally post this to the developing forum, but as it seems like a bug, so I thought it might be more appropriate here.)


Last edit: by temp1024

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#68143
Avatar

It only works with the bundled addons as they are written in a different way. I'm updating the API documentation to explain that, because you're right it does not say this.

You're best off doing a file_exists(get_file_base().'/sources_custom/blocks/whatever.php').


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#68160
Avatar

Community saint

Will do, thanks Chris  :thumbs:

For anyone that is interested, I will be posting the code in the Developing forum shortly.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: