function templatePlaylist($template_src = false, $user_id = false) { $return = array(); if ($template_src !== false && $user_id != false) { include_once PATH_CLASS . '/CFlix.php'; $fl =& CFlix::getInstance(); $ar = $fl->templates($template_src, $user_id); if (count($ar) > 0) { $ids = (array) $this->dbh->asql_safe(explode(',', $ar['T_MUSIC'])); } else { $ids = array('NULL'); } $ids = implode(',', $ids); $sql = 'SELECT m_id AS M_ID, m_swf_src AS M_SWF_SRC, m_genre AS M_GENRE, m_tempo AS M_TEMPO, m_name AS M_NAME, m_description AS M_DESC ' . 'FROM music ' . 'WHERE m_id IN (' . $ids . ') AND m_active = \'Y\' ' . 'ORDER BY m_name ASC'; $return = $this->dbh->query_all($sql); } return $return; }
function addComment($element_id = false, $by_user_id = 0, $for_user_id = 0, $comment = false, $type = 'foto', $raw_name = null) { include_once PATH_INCLUDE . '/functions.php'; // used to sanitize() comment include_once PATH_CLASS . '/CUser.php'; // use for activity include_once PATH_CLASS . '/CUserManage.php'; // use for activity $return = false; if ($element_id !== false && $comment !== false) { $u =& CUser::getInstance(); $um =& CUserManage::getInstance(); $element_id = intval($element_id); $comment = $this->dbh->sql_safe(sanitize($comment, array('PRESERVE_ANCHORS' => true))); $typeSafe = $this->dbh->sql_safe($type); $by_user_id = intval($by_user_id); $for_user_id = intval($for_user_id); $raw_name = $this->dbh->sql_safe(sanitize($raw_name)); $sql = 'INSERT INTO comments(c_by_u_id, c_for_u_id, c_element_id, c_name, c_comment, c_type, c_time) ' . 'VALUES(' . $by_user_id . ', ' . $for_user_id . ', ' . $element_id . ', ' . $raw_name . ', ' . $comment . ', ' . $typeSafe . ', ' . NOW . ')'; $this->dbh->execute($sql); $return = $this->dbh->insert_id(); switch ($type) { case 'blog': $element_rep = $element_id; break; case 'flix': include_once PATH_CLASS . '/CFlix.php'; $f =& CFlix::getInstance(); $flixData = $f->search(array('FLIX_ID' => $element_id)); $element_rep = $flixData['US_KEY']; break; case 'foto': include_once PATH_CLASS . '/CFotobox.php'; $fb =& CFotobox::getInstance(); $fotoData = $fb->fotoData($element_id); $element_rep = $fotoData['P_KEY']; break; } $forUserData = $u->find($for_user_id); $byUserData = $u->find($by_user_id); $um->addActivity($by_user_id, $return, 'newComment', $byUserData['U_USERNAME'], $forUserData['U_USERNAME'], $element_rep, $type); } return $return; }
function _ffSrc($matches) { $return = $matches[1]; switch ($matches[1]) { case 'photo': include_once PATH_CLASS . '/CFotobox.php'; $fb =& CFotobox::getInstance(); $matches[2] = trim($matches[2]); $fotoData = $fb->fotoData($matches[2]); if ($fotoData !== false) { $return = ' <a href="/handler/photo/' . $matches[2] . '/" target="_blank"><img src="' . PATH_FOTO . $fotoData['P_THUMB_PATH'] . '" width="75" height="75" vspace="3" border="0" class="border_white_2px" /></a> '; } else { $return = ' <img src="' . PATH_FOTO . '/thumbnail/nofoto.jpg" width="75" height="75" border="0" class="border_white_2px" /> '; } break; case 'slideshow': include_once PATH_CLASS . '/CFlix.php'; include_once PATH_CLASS . '/CFotobox.php'; $fb =& CFotobox::getInstance(); $f =& CFlix::getInstance(); $matches[2] = trim($matches[2]); $flixData = $f->search(array('KEY' => $matches[2])); $fotoURL = $flixData['US_PHOTO']['thumbnailPath_str']; //$theme = $f->template( $flixData['A_TEMPLATE'] ); if ($fotoURL != '') { $return = '<div style="padding-top:4px; padding-bottom:4px;"><div class="flix_border" style="float:left;"><a href="/handler/slideshow/' . $matches[2] . '/" target="_blank"><img src="' . PATH_FOTO . $fotoURL . '" width="75" height="75" border="0" /></a></div><div>Title: ' . $flixData['US_NAME'] . '<br />Photos: ' . $flixData['US_FOTO_COUNT'] . '<br />Views: ' . $flixData['US_VIEWS'] . '<br clear="all" /></div></div>'; } else { $return = '<img src="' . PATH_FOTO . '/thumbnail/nofoto.jpg" width="75" height="75" border="0" />'; } break; //case 'i': //$return = '<div class="italic">' . $matches[2] . '</div>'; //break; } return $return; }
<?php $u =& CUser::getInstance(); $fl =& CFlix::getInstance(); $fb =& CFotobox::getInstance(); $sort = isset($_GET['ORDER']) ? $_GET['ORDER'] : false; if (!isset($_GET['tags'])) { $flix_array = $fl->search(array('MODE' => 'USER', 'USER_ID' => $_USER_ID, 'TYPE' => 'slideshow', 'ORDER_BY' => $sort)); } else { $tags = (array) explode(',', $_GET['tags']); $flix_array = $fl->search(array('MODE' => 'USER', 'USER_ID' => $_USER_ID, 'TAGS' => $tags, 'TYPE' => 'slideshow', 'ORDER_BY' => $sort)); } $user_data = $u->find($_USER_ID); $cnt_flix_array = $flix_array[0]['ROWS']; $page = isset($_GET['page']) ? intval($_GET['page']) : 1; $per_page = 12; $total_pages = ceil($cnt_flix_array / $per_page); $offset = $page * $per_page - $per_page; $p =& new CPaging($page, 10, $total_pages, 'page', '/', $_SERVER['QUERY_STRING']); if ($cnt_flix_array > 0 || isset($_GET['tags'])) { if ($cnt_flix_array > 0) { echo '<div style="overflow:hidden; padding-top:5px; padding-right:5px; padding-bottom:5px;">'; echo '<form method="GET" action="">'; echo '<input type="hidden" name="action" value="flix.flix_list" />'; if ($sort !== false) { echo '<input type="hidden" name="ORDER" value="' . $sort . '" />'; } echo '<div style="float:left; width:114px; padding-right:4px; padding-left:15px;"><input onfocus="this.select();" type="text" value="' . (isset($_GET['tags']) ? $_GET['tags'] : "tag search") . '" id="tags" name="tags" class="formfield" style="width:110px;" onblur="tagSearch()" /></div>'; echo '<div style="float:left; width:29px; padding-right:4px;"><input type="image" src="images/buttons/go.gif" width="25" height="17" border="0" /></div>'; echo '</form>'; echo '<div style="float:right; padding-right:50px;">';
function getXml($flix_ident, $user_id) { include_once PATH_CLASS . '/CFlix.php'; $fl =& CFlix::getInstance(); if (is_numeric($flix_ident)) { $flix_data = $fl->flixData($flix_ident, $user_id); $fastflix = $flix_data['A_FASTFLIX']; } else { $fastflix = $flix_ident; } if (isset($fastflix)) { $xml_string = ''; $mode = 'file'; $filename = (include_once PATH_HOMEROOT . '/dynamicFlixXML.php'); if (is_file($path = PATH_TMPROOT . '/' . $filename)) { $xml_string = file_get_contents($path); } return $xml_string; } else { return false; } }
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; } }
function flixContributions($u_id, $g_id, $offset = 0, $limit = 12) { include_once PATH_CLASS . '/CFlix.php'; $fl =& CFlix::getInstance(); $u_id = $this->dbh->sql_safe($u_id); $g_id = $this->dbh->sql_safe($g_id); $sql = 'SELECT SQL_CALC_FOUND_ROWS uf.uf_id AS A_ID, uf.uf_u_id AS A_U_ID, uf.uf_tags AS A_TAGS, uf.uf_autoplay AS A_AUTOPLAY, uf.uf_fastflix AS A_FASTFLIX, uf.uf_music AS A_MUSIC, uf.uf_template AS A_TEMPLATE, uf.uf_name AS A_NAME, uf.uf_createdBy AS A_CREATED_BY, uf.uf_description AS A_DESC, uf.uf_fotoCount AS A_FOTO_COUNT, uf.uf_length AS A_LENGTH, uf.uf_views AS A_VIEWS, uf.uf_public AS A_PUBLIC, uf.uf_privacy AS A_PRIVACY, UNIX_TIMESTAMP(uf.uf_dateCreated) AS A_DATECREATED ' . 'FROM group_fotoflix_map AS gf INNER JOIN user_fotoflix AS uf ON gf.uf_id = uf.uf_id ' . 'WHERE gf.g_id = ' . $g_id . ' ' . 'AND uf.uf_u_id = ' . $u_id . ' ' . 'ORDER BY A_DATECREATED DESC ' . 'LIMIT ' . $limit . ' ' . 'OFFSET ' . $offset . ' '; $rs = $this->dbh->query($sql); $i = 0; while ($data = $this->dbh->fetch_assoc($rs)) { $_internal_data = $fl->_data($data['A_ID'], 1); $return[$i] = $data; $return[$i]['A_DATA'] = $_internal_data; $i++; } $this->dbh->free_result($rs); return $return; }