Quote:
|
how the fuck can you call it trash? I took it from VBulletin, one of the best community scripts ever.
|
Ok than...
First off, it's uncommented. Scripts without proper comments suck by default.
The structure is trash. You put includes/requires on top not in the middle of your source. It's all about structure
The dbase class (and I even haven't seen it completly)is crap.
stuff like:
$dbservertype = strtolower($dbservertype);
$dbclassname="./admin/db_$dbservertype.php";
Are solutions you use when you start programming one month.
See adodb for how a good dbasewrappingclass looks like.
$DB_site->appname='vBulletin';
$DB_site->appshortname='vBulletin (forum)';
$DB_site->database=$dbname;
$DB_site->server=$servername;
$DB_site->user=$dbusername;
$DB_site->password=$dbpassword;
If you like to type a lot and do things double, go ahead. But this should be one line of code max).
if ($debug != 1) {
unset($showqueries);
unset($explain);
}
If you use debugging functionallity, write a global debugging function and put it in yr global/config file. And trigger it on seperate ages by simply adjusting a $debug to True or false;
Since PHP 4.0.x or something, global_vars are set off by default (for a very, very good security reason)
if (!empty($userid)) {
$userid = intval($userid);
} else if (!empty($HTTP_POST_VARS['userid'])) {
$userid = intval($HTTP_POST_VARS['userid']);
} else if (!empty($HTTP_GET_VARS['userid'])) {
$userid = intval($HTTP_GET_VARS['userid']);
} else {
$userid = 0;
}
ifelse loops like above are written by people who apparently have trouble understandig security issues and haven't made up their mind about what they're writing and what it should do in the first place.
Besides, you pass values like $userid through sessions not through forms.
So that's how the f*ck I call it trash
And yeah, I'm just bored, hehe