The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Hi all,
I'm trying to copy an existing photo to another album, but still have it available to the current users' album. I'm trying to do this with the picture data manager, but with little time to have played around with it I'm at a loss. Pictures (table: picture) and albums (table: albums) have an intermediary table called albumpicture. The problem arises when changing the albumid for the picture in this table using the picture data manager. What I have below is if the title of the album chosen does not match the current album for the picture, then reset the albuminfo (I think this is used in the picture data manager), then essentially copy the picture data to a new row in the picture table, and set a new row in albumpicture with the new albumid for that pictureid. Code:
if($vbulletin->GPC['pictures']["$album[albumid]"]['title'] != $albuminfo['title']) { $newalbumid = $vbulletin->GPC['pictures']["$album[albumid]"]['title']; $album_sql = $db->query_first(" SELECT albumid FROM " . TABLE_PREFIX . "album WHERE albumid LIKE '%$vbulletin->GPC['pictures']["$album[albumid]"]['title']%' "); // Reset albuminfo with destination albumid $albuminfo1 = fetch_albuminfo(album_sql['albumid']); $picturedata =& datamanager_init(fetch_picture_dm_name(), $vbulletin, ERRTYPE_SILENT, 'picture'); $picturedata->set('title', $vbulletin->GPC['pictures']["$picture[pictureid]"]['title']); $picturedata->set('caption', $vbulletin->GPC['pictures']["$picture[pictureid]"]['caption']); $picturedata->set('tags', $vbulletin->GPC['pictures']["$picture[pictureid]"]['tags']); $picturedata->save(); } P.s. also not sure what fetch_picture_dm_name() is doing here in the DM. Will this insert a new row for the picture, or does it refer to the pictureid's that are being looped through at that point? All help much appreciated! |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|