The assignments you're talking about replace
query_read() and
query_write() with a generic
mysql_query() function. There is no point in this because the reason for the difference between read and write are for security measures. Replacing the read and write functions would open your board up to more potential security exploits.
Furthermore, there's already a
$vbulletin->db->mysql_query() function. You should just use that if you don't want to employ the extra security of query_read and query_write.
However if you want your generic mysql_query(); function to act like read or write you should put something in your php file like this:
PHP Code:
function mysql_query($stmnt){
$vbulletin->db->query_read($stmnt);
}
or
PHP Code:
function mysql_query($stmnt){
$vbulletin->db->query_write($stmnt);
}
or even better...
PHP Code:
function mysql_query($stmnt){
if( stripos($stmnt, "select") ) {
$vbulletin->db->query_read($stmnt);
} else {
$vbulletin->db->query_write($stmnt);
}
}
Then you'd just call
mysql_query() without making reference to $db or $vbulletin before it.
However, this adds an extra layer of abstraction that you don't really need. Furthermore, it would be adding more calls to the program stack that runs on the PHP engine, and while it won't be noticible for small boards if you have this code on a large board it
will slow down your webserver.
EDIT:
Oh I see, you're porting the mod. You would need to define a vbulletin class that contains the stuff you need... like so
PHP Code:
class vbulletin {
class db {
function query_write($stmnt)
{
mysql_query($stmnt);
}
function query_read($stmnt)
{
mysql_query($stmnt);
}
}
$db = new db;
}
$vbulletin = new vbulletin;
Once you re-define those in place of your include 'global.php' (the global php file for vbulletin) then it should work.