The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Would you like it if I released a phpinclude API?
It would greatly simplify making phpinclude mods, and what's more even speed them up, depending on the situation. Also it would become so easy that you don't really need an inner working knowledge of vB to start making them.
For example, this code (sorry about the indenting, the code tag's doublespacing is incredibly irritating): if (strpos($_SERVER['PHP_SELF'], 'showthread.php') != false) { if (in_array($bbuserinfo['usergroupid'], array(5, 6, 7))) { if ($thread['notes'] == '') $thread['notes'] = 'None.'; eval("\$threadnotes = \"" . gettemplate("showthread_threadnotes") . "\";"); } else $threadnotes = ''; } Would be simplified to: if (thisis("showthread")) { if (userisingroup("5,6,7")) { if ($thread['notes'] == "") $thread['notes'] = "None."; evaltemplate("showthread_threadnotes", "threadnotes"); } else $threadnotes = ""; } And another example: if (strpos($_SERVER['PHP_SELF'], 'index.php') != false) { $totalchars = $DB_site->query("SELECT SUM(LENGTH(pagetext)) AS totalchars FROM post"); $totalchars = $DB_site->fetch_array($totalchars); $totalchars = number_format($totalchars['totalchars']); } becomes: if (thisis("index")) { $totalchars = numberformat(mysqlonlyresult("SELECT SUM(LENGTH(pagetext)) AS totalchars FROM post")); } |
#2
|
||||
|
||||
Thats one big change in code, guess it could help.
|
#3
|
|||
|
|||
Okay, since it seems to be welcomed I'll do it (or rather continue it since I had already started it).
It's more of a wrapper set of functions than an API but useful nonetheless. What I've coded but not tested so far: function thisis($filename) // returns true if $phpself contains $filename function evaltemplate($templatename, $storagevar) // evals $templatename and stores the output in $storagevar function mysqlonlyresult($query) // returns the first result array of $query function userisingroup($usergroupids) // returns true of the current user is a member of the given // comma-delimited list of usergroupids function setempty($varlist) // sets the variable names in $varlist (comma-delimited, no // leading $) to empty (''). This avoids security issues, // particurally those arising where register_globals allows // users to directly edit variable contents by simply // changing the page's URL. I'll be looking for testers, soon. |
#4
|
||||
|
||||
i honestly dont know whawt this is...but if it helps make coding easier for mods...why not!
|
#5
|
||||
|
||||
heh I have no idea what it is either but if it helps
what someone needs to do is make a WYSIWYG program so even stupid people like me can make mods l |
#6
|
||||
|
||||
lol...that would be funny
|
#7
|
|||
|
|||
It's just a set of functions designed to make things easier for people creating mods that use the phpinclude. It's basically a time-saver (and a very good one at that).
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|