PDA

View Full Version : How to Add New Album Using The Album Data Maganer


mokujin
04 Nov 2008, 22:02
This is a tutorial of how to add new albums using data managers.

Just paste this code in to your file:
$albumdata =& datamanager_init('Album', $vbulletin, ERRTYPE_ARRAY);

$albumdata->set('userid', $vbulletin->userinfo['userid']);
$albumdata->set('title', 'Auto-Album');
$albumdata->set('description', 'Auto-Album description');
$albumdata->set('state', 'public');

$albumdata->pre_save();

if (empty($albumdata->errors))
{
$albumdata->save();
}
else
{
print_r($albumdata->errors);
}

'title' - Title of the Album
'description' - Album description
'state' - public, private or profile.