Working on Extension, Need a Tip

Discuss PivotX 2.0.x extensions here, and view extensions that are available for download.

Working on Extension, Need a Tip

Postby Stingray » Sat Feb 20, 2010 12:17 am

I'm curious how I can access the array that has the display names of the categories in an extension. I'm able to pull in entry information from $PIVOTX['db'], but where do I find the categories?

Thanks!
Stingray
 
Posts: 107
Joined: Wed Oct 28, 2009 2:40 pm

Re: Working on Extension, Need a Tip

Postby Stingray » Sat Feb 20, 2010 12:58 am

Okay, I think I found a way, but is there a better way to do it?

This is what I've done:
Code: Select all
    $temp_category_array = load_serialize($PIVOTX['paths']['db_path']."ser_categories.php", true);
Stingray
 
Posts: 107
Joined: Wed Oct 28, 2009 2:40 pm

Re: Working on Extension, Need a Tip

Postby hansfn » Sat Feb 20, 2010 9:47 am

Yes, the documentation for extensions has to be written.

Anyway, please look at the function initializePivotX in lib.php to see what is available in $PIVOTX and then look at the corresponding classes in objects.php. (You should have used $PIVOTX['categories'].)

PS! See http://pivotx.net/dev/docs/trunk/ and http://pivotx.net/dev/docsxref/trunk/ for source code documentation (in stead of looking directly into for example objects.php).
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Working on Extension, Need a Tip

Postby Stingray » Sat Feb 20, 2010 4:57 pm

Thanks a ton, hans. I just about have the extension completed. It's working as written; I just keep adding more stuff to it. :D

It's an older extension originally written by Tenshi for PivotLog. I've converted it for PivotX and added some more stuff to it, though. Waiting to hear word back from him before I release it to the public, if he doesn't take too long.
Stingray
 
Posts: 107
Joined: Wed Oct 28, 2009 2:40 pm

Re: Working on Extension, Need a Tip

Postby hansfn » Sat Feb 20, 2010 5:14 pm

PS! If you want to include documentation, please include it in a docs directory and name the file either summary.html og index.html (full documentation) or both - look at the standard extensions.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Working on Extension, Need a Tip

Postby Stingray » Sun Feb 21, 2010 1:20 am

hansfn wrote:PS! If you want to include documentation, please include it in a docs directory and name the file either summary.html og index.html (full documentation) or both - look at the standard extensions.


Thanks...I've done just that. The extension's finished as far I want to bring it right now...just waiting for word from Tenshi.
Stingray
 
Posts: 107
Joined: Wed Oct 28, 2009 2:40 pm


Return to 2.x Extensions

Who is online

Users browsing this forum: No registered users and 1 guest

cron