function shareFlix($group_id = false, $array_flix = false, $user_id = false, $share_fotos = false) { if ($group_id !== false && $array_flix !== false && $user_id !== false) { include_once PATH_CLASS . '/CFlix.php'; include_once PATH_CLASS . '/CFlixManage.php'; include_once PATH_CLASS . '/CGroup.php'; $fl =& CFlix::getInstance(); $flm =& CFlixManage::getInstance(); $g =& CGroup::getInstance(); $safe_group_id = $this->dbh->sql_safe($group_id); $safe_user_id = $this->dbh->sql_safe($user_id); foreach ($array_flix as $v) { $flix_data = $fl->search(array('FLIX_ID' => $v, 'USER_ID' => $user_id)); if ($share_fotos === true) { $photo_array = (array) explode(',', $flix_data['US_PHOTO']['photoId_int']); $this->shareFotos($user_id, $group_id, $photo_array); } $group_data = $g->groupData($group_id, $user_id); $flix_id = $this->dbh->sql_safe($v); if ($user_id != $group_data['G_U_ID']) { $new_flix_id = $flm->duplicate($v, $group_data['G_U_ID']); } else { $new_flix_id = $flix_id; } $sql = 'REPLACE INTO group_fotoflix_map(g_id, u_id, uf_id, u_orig_id, uf_orig_id, gfm_status, dateModified) VALUES(' . $safe_group_id . ', ' . $group_data['G_U_ID'] . ', ' . $new_flix_id . ', ' . $safe_user_id . ', ' . $flix_id . ', \'Pending\', NOW())'; $this->dbh->execute($sql); } return true; } else { return false; } }
<?php include '../../init_constants.php'; include PATH_INCLUDE . '/functions.php'; include PATH_HOMEROOT . '/init.php'; include_once PATH_DOCROOT . '/init_database.php'; include_once PATH_CLASS . '/CSession.php'; include_once PATH_DOCROOT . '/init_session.php'; include PATH_CLASS . '/CToolbox.php'; include PATH_CLASS . '/CFlixManage.php'; include PATH_CLASS . '/CFotobox.php'; $tb =& CToolbox::getInstance(); $flm =& CFlixManage::getInstance(); $fb =& CFotobox::getInstance(); $fotos = $tb->get($_USER_ID); $params = array('MODE' => 'INSERT', 'USER_ID' => $_USER_ID, 'TAGS' => 'stuff', 'NAME' => date('h:i:s', time()), 'ELEMENTS' => array(), 'SETTINGS' => array()); $params['SETTINGS'] = array(array('instanceName_str' => 'someinstance', 'depth_int' => 0, 'swfPath_str' => '/path/to/swf'), array('instanceName_str' => 'someotherinstance', 'depth_int' => 0, 'swfPath_str' => '/path/to/swf', 'maskPath_str' => '/path/to/mask')); foreach ($fotos as $k => $v) { $fotoData = $fb->fotoData($v['P_ID']); $params['ELEMENTS'][$k] = array('photoId_int' => $fotoData['P_ID'], 'photoPath_str' => $fotoData['P_ORIG_PATH'], 'thumbnailPath_str' => $fotoData['P_THUMB_PATH'], 'photoKey_str' => $fotoData['P_KEY']); if ($k % 2 == 0) { $params['ELEMENTS'][$k]['hotSpot_arr'] = array(array('note_str' => 'This is a note', 'fill_bool' => false, 'depth_int' => 1), array('note_str' => 'This is a note', 'fill_bool' => false, 'depth_int' => 1, 'draw_arr' => array(array('x_int' => 0, 'y_int' => 10), array('x_int' => 1, 'y_int' => 11), array('x_int' => 2, 'y_int' => 12)))); } } //print_r($params); echo jsonEncode($params); $flm->flashInput($params);
function deleteMp3($mp3_id = false, $user_id) { if ($mp3_id !== false && $user_id !== false) { include_once PATH_CLASS . '/CUser.php'; include_once PATH_CLASS . '/CUserManage.php'; include_once PATH_CLASS . '/CFlixManage.php'; $us =& CUser::getInstance(); $usm =& CUserManage::getInstance(); $flm =& CFlixManage::getInstance(); $mp3_data = $this->fb->mp3($mp3_id, $user_id); $user_data = $us->find($user_id); $mp3_src = PATH_FOTOROOT . $mp3_data['M_PATH']; $usm->update(array('u_id' => $user_id, 'u_spaceUsed' => intval($user_data['U_SPACEUSED'] - $mp3_data['M_SIZE']))); $flm->clearMp3($mp3_data['M_PATH']); $mp3_id = $this->dbh->sql_safe($mp3_id); //$this->dbh->query('DELETE FROM user_mp3s WHERE um_id = ' . $mp3_id); $this->dbh->query("UPDATE user_mp3s SET um_status = 'Deleted' WHERE um_id = {$mp3_id}"); if (file_exists($mp3_src)) { unlink($mp3_src); } return true; } return false; }