function shareFotos($user_id = false, $group_id = false, $array_fotos = false) { $retval = false; if ($user_id !== false && $group_id !== false && $array_fotos !== false) { include_once PATH_CLASS . '/CGroup.php'; include_once PATH_CLASS . '/CFotoboxManage.php'; $g =& CGroup::getInstance(); $fbm =& CFotoboxManage::getInstance(); $user_id = intval($user_id); $group_id = intval($group_id); $group_data = $g->groupData($group_id); $doCopy = $user_id != $group_data['G_U_ID']; // if the user is group owner then don't duplicate the photo in their account if ($group_data !== false) { $retval = array(); $sql = 'REPLACE INTO group_foto_map(up_id, g_id, u_id, u_orig_id, up_orig_id, gfm_status, dateCreated) VALUES'; $continue = false; if (!is_array($array_fotos)) { $array_fotos = array(intval($array_fotos)); } foreach ($array_fotos as $v) { $v = intval($v); if ($doCopy) { $isAdded = $fbm->copy($v, $group_data['G_U_ID'], true); // copy foto $v to group owner's account and then share that foto } else { $isAdded = $v; } if ($isAdded !== false) { $sql .= "({$isAdded}, {$group_id}, {$group_data['G_U_ID']}, {$user_id}, {$v}, 'Pending', NOW()),"; $retval[] = $isAdded; $continue = true; } } if ($continue === true) { $sql = substr($sql, 0, -1); $this->dbh->execute($sql); } } } return $retval; }
<?php $fbm =& CFotoboxManage::getInstance(); $mp3_id = $_POST['um_id']; $fbm->deleteMp3($mp3_id, $_USER_ID); $url = '/popup/mp3_manage';
function purgeDynamics($photoId = false, $userId = false) { if ($photoId !== false && $userId !== false) { include_once PATH_CLASS . '/CFotoboxManage.php'; $fbm =& CFotoboxManage::getInstance(); $fbm->removeDynamics($photoId, $userId, true); } }