MyBB Community Forums

Full Version: MyBB Function Reference
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2008-06-29, 08:56 AM)ZiNgA BuRgA Wrote: [ -> ]If you don't know the name of a function, why are you looking it up?

Perhaps you forgot the name? Maybe you -think- there is a function that performs the task needed to be done but you don't know the name of it?
(2008-06-29, 10:47 AM)Ryan Ashbrook Wrote: [ -> ]
(2008-06-29, 08:56 AM)ZiNgA BuRgA Wrote: [ -> ]If you don't know the name of a function, why are you looking it up?

Perhaps you forgot the name? Maybe you -think- there is a function that performs the task needed to be done but you don't know the name of it?
If you forgot the name - ie, have no idea what the name is like - then a function reference isn't going to help you... For MyBB, just open inc/functions.php in Notepad++ (or whatever) and look at the function list there - no need for fancy documentation which doesn't tell you much more.
For MyBB, if you think a function should exist, then just drill down where the functionality is used and see how it's implemented.

Really, if you just look at a list of all the functions in MyBB, you'll probably get a whole heap of functions which serve no purpose to you. All the comments are available on the functions.
Won't help you if you're not dealing with PHP either (though many IDEs have some place displaying all the functions in the project)...

Well, at least in my experience, looking up a reference is far more bothersome than searching for keywords in a .php file.
grep -r Smile
I use that site only when i need and its got good reference Smile
(2008-06-30, 08:15 AM)ZiNgA BuRgA Wrote: [ -> ]If you forgot the name - ie, have no idea what the name is like - then a function reference isn't going to help you... For MyBB, just open inc/functions.php in Notepad++ (or whatever) and look at the function list there - no need for fancy documentation which doesn't tell you much more.
For MyBB, if you think a function should exist, then just drill down where the functionality is used and see how it's implemented.

Really, if you just look at a list of all the functions in MyBB, you'll probably get a whole heap of functions which serve no purpose to you. All the comments are available on the functions.
Won't help you if you're not dealing with PHP either (though many IDEs have some place displaying all the functions in the project)...

Well, at least in my experience, looking up a reference is far more bothersome than searching for keywords in a .php file.

You make it seem like the effort put into PHPdoc is useless. If PHPdoc isn't necessary, then why bother doing it the first place? You could just always type a one line comment.

I think there's a point of it and for some people, it's useful. (like meBig Grin)
(2008-06-30, 10:09 PM)Jeff Wrote: [ -> ]You make it seem like the effort put into PHPdoc is useless. If PHPdoc isn't necessary, then why bother doing it the first place? You could just always type a one line comment.
Pretty much. There's millions of projects which are probably not much more useful than for novelty purposes.

(2008-06-30, 10:09 PM)Jeff Wrote: [ -> ]I think there's a point of it and for some people, it's useful. (like meBig Grin)
Well, if you find it useful, then I can't say anything.

(2008-07-01, 12:28 AM)labrocca Wrote: [ -> ]Sometimes you forget how the function is named but you know part of it. Like the other day I did getuser() instead of get_user()...I checked quickly and saw the error. For me the phpdoc is faster than opening up the various function php pages...it's not like they are in one file. Also phpdoc is a good reference to see overall the various functions.
I'd just type the query out in full then:
$user = $db->fetch_array($db->simple_select("users", "*", "uid=".$uid));
Takes a few seconds - much faster than going through any reference.
Or, if "getuser" didn't work, use some intuition and try "get_user" or other variants. Of course, if you totally didn't know the name, I don't see how a function reference is going to help.
In MyBB, all the general purpose functions are located in inc/functions.php so you don't need to search through multiple PHP files. If the function isn't in functions.php, then you probably don't need to use it.
In your example, look at the functions list for functions.php, and you would've quickly seen "get_user".

(2008-07-01, 12:28 AM)labrocca Wrote: [ -> ]If you are comfortable in your own method that's great. But not everyone needs to do things your way. imho...whatever works ...works.
True, but most people like to use unnecessary "fancy" methods which really aren't more convenient.

(2008-07-01, 12:28 AM)labrocca Wrote: [ -> ]I disagree. If you have a reference bookmarked it's going to be a lot faster than checking multiple PHP files.
Bookmark PHP files?

(2008-07-01, 12:28 AM)labrocca Wrote: [ -> ]http://www.mybbcentral.com/docs/

That's one page and it's incredibly quick reference. Plus it gives the variables used. The classes part can be handy as well. It's all good and all in one place.
The side panel only has like... 500 lines? Not to mention that MyBB is relatively small compared to some other scripts out there, where there'll probably be thousands of functions you'll never use.
How often have you used the function draw_dots? hello_activate? myps_register_default? (that a MyBB function?)
IMO, automated documentation really isn't worthwhile. If documentation is done properly (manually), then it can, indeed, be a powerful tool.
I think we just should use the mybb wiki better and make that wiki much more active, that could be a great way of sharing our knowledge and experience with mybb.
So far, people have been quite reluctant to write content on the Wiki. Want to start? Smile
with pleasure, Big Grin I've already tried some times (one time I even removed something mistakenly, but I don't know what should be added?
We just need a page that list requested values, well I've just find it, never seen that before - ToDo List & Wanted Pages

But when I think about it... we have a lot work!
We need to make the wiki as best as we can, we could start with:
BTW, this is the contribution guide, and this is the sand box for trainings.
Just an update on the wiki status and 1.4 - I have (internally) updated a lot of the articles that require changes for 1.4 information. Once I finish those and 1.4 is released, I'll be working on updating the entire wiki (after I transfer all of our internal documents to the live wiki).
Pages: 1 2