PDA

View Full Version : Welcome to Newest Member Addon


godarmy
10-30-2013, 10:57 AM
Hi,

Can anyone know how to add Welcome to Newest member greeting in template ?
I got the function in core/includes/functions_databuild.php

function build_user_statistics()
{
$members = vB::getDbAssertor()->getRow('vBForum:fetchUserStats');

// get newest member
$newuser = vB::getDbAssertor()->getRow('vBForum:fetchnewuserstats',
array('userid' => $members['maxid']));

// make a little array with the data
$values = array(
'numbermembers' => $members['users'],
'activemembers' => isset($members['active']) ? $members['active'] : 0,
'newusername' => $newuser['username'],
'newuserid' => $newuser['userid']
);

// update the special template
vB::getDatastore()->build('userstats', serialize($values), 1);

return $values;
}


but how to add it on template system?
can anyone guide me?spending many hours to search it and not found it...

godarmy
10-30-2013, 11:53 AM
Found the answer

edit /core/vb/api/user.php
and add another function like this


public function newestmember() {
$members = vB::getDbAssertor()->getRow('vBForum:fetchUserStats');
$newuser = vB::getDbAssertor()->getRow('vBForum:fetchnewuserstats',array('userid' => $members['maxid']));
return $newuser;
}


and in the Vb5 template put like this
{vb:data newusername, user, newestmember}

Thanks for lynne for inspiration.

ageurtse
06-18-2014, 07:34 PM
this isn't working in vb 5.1.2 beta 1