it should be like this:
PHP Code:
class example
{
function exampe(&$registry, $otherags = 0 )
{
$this->registry =& $registry;
}
function fetch_example($id)
{
$this->registry->db->query_read("... some mysql ...");
/*
more code....
*/
}
}
$example1 = new example($vbulletin);
$example1->fetch_example(2);
Things to notice are the
&'s and the naming convention of registry to hold the vBulletin object (not required, but conforms to vB's approach)