Start ::
Extensions and Distributions Support ::
Modules ::
How to make this function API compliant.
Moderated by: Support Team
-
- rank:
-
Freshman
- registered:
- January 2003
- Status:
- offline
- last visit:
- 26.08.04
- Posts:
- 26
I am using this code to sort some of my arrays and I was wondering if someone could help me add it to my pnuserapi.php. Also how would I call it from pnuser.php? It works great puting in side the function but I would like to keep everything compliant if possible. Thanks in advance.
-
- rank:
-
Moderator
- registered:
- March 2002
- Status:
- offline
- last visit:
- 26.08.08
- Posts:
- 7720
Functions is the userapi need to be named <module>_userapi_function. The function then takes an arguments array.
So the function looks like
The function is then called using a call to pnModAPIFunc('modulename', 'type', 'func', argsarray) having first loaded the user API
loading and calling a function is
-Mark</module> -
- rank:
-
Freshman
- registered:
- January 2003
- Status:
- offline
- last visit:
- 26.08.04
- Posts:
- 26
Hey mark, been a while.. I understand the format it should be in. I just can get the original function converted over and call it properly.. Probably figure it out like always right after I send this post off.. Thanks again. -
- rank:
-
Freshman
- registered:
- January 2003
- Status:
- offline
- last visit:
- 26.08.04
- Posts:
- 26
Thanks once again but I'm having a heck of a time getting the arguments over to the API. The function is looking for $array and $args. I have tried
I have also tried changing the function to look for $sortby instead of $args and I still get Invalid argument supplied for foreach()
That is for the frist foreach that looks for the $args or $sortby array. -
- rank:
-
Freshman
- registered:
- January 2003
- Status:
- offline
- last visit:
- 26.08.04
- Posts:
- 26
I got it working. Thanks again for your help Mark.. Here is what I got incase anyone else was following this thread. I wish I would have found this function months ago, would have saved me a lot of time and trouble with sorting these arrays..
Start ::
Extensions and Distributions Support ::
Modules ::
How to make this function API compliant.
