예제 #1
0
<?php

include_once PATH_CLASS . '/CGroup.php';
if (isset($_GET['group_id'])) {
    $groupId = intval($_GET['group_id']);
    $gp =& CGroup::getInstance();
    $groupData = $gp->groupData($groupId);
    $groupName = $groupData['G_NAME'];
    $action = $_GET['action'];
    if ($gp->isMember($_USER_ID, $groupId) == false && $action != 'group.member_accept') {
        $url = '/?action=confirm.main&type=group_failed';
        header('Location: ' . $url);
    }
}
예제 #2
0
파일: CFotobox.php 프로젝트: jmathai/photos
 function dependencies($foto_ids = false)
 {
     $return = array();
     if ($foto_ids != false) {
         include_once PATH_CLASS . '/CGroup.php';
         $g =& CGroup::getInstance();
         foreach ($foto_ids as $v) {
             if (is_numeric($v)) {
                 $id = $this->dbh->sql_safe($v);
                 $rs = $this->dbh->query($sql = 'SELECT ufd_uf_id AS F_ID FROM user_fotoflix_data WHERE ufd_up_id = ' . $id);
                 $found = false;
                 if ($this->dbh->num_rows($rs) > 0) {
                     $return[$v] = array();
                     $return[$v]['FLIX_IDS'] = array();
                     while ($v2 = $this->dbh->fetch_assoc($rs)) {
                         $return[$v]['FLIX_IDS'][] = $v2['F_ID'];
                     }
                 }
                 $groups = $g->fotoShared($v);
                 foreach ($groups as $v3) {
                     $found = true;
                     if (!isset($return[$v])) {
                         $return[$v] = array();
                     }
                     $return[$v]['GROUPS'][] = $v3;
                 }
                 $return[$v]['P_ID'] = $v;
                 /*if($found === true)
                   {
                     $return[$v]['P_ID']     = $v;
                   }*/
             }
         }
         return $return;
     } else {
         return $return;
     }
 }
예제 #3
0
 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;
     }
 }
예제 #4
0
<?php

$prefix = substr($action, 0, strpos($action, '.'));
$viewmode = isset($args) ? $args[0] : false;
$id_hash = !isset($id_hash) ? $args[1] : $id_hash;
if ($prefix == 'fotobox' || $viewmode == 'fotoviewer') {
    $obj =& CFotobox::getInstance();
} else {
    $obj =& CGroup::getInstance();
}
if (strlen($id_hash) == 32) {
    $foto_data = $obj->fotoData($id_hash);
} else {
    $image_id = substr($id_hash, 6);
    $foto_data = $obj->fotoData($image_id);
}
if (!is_file(PATH_FOTOROOT . $foto_data['P_WEB_PATH'])) {
    echo '<div class="bold" align="center" style="width:100%;">Sorry, but we can not load the foto you requested.</div.';
} else {
    $foto_size = @getimagesize(PATH_FOTOROOT . $foto_data['P_WEB_PATH']);
    ?>

    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr>
        <td align="center">
          <?php 
    if ($viewmode !== false) {
        echo 'FotoLink: http://' . FF_SERVER_NAME . '/' . $viewmode . '?' . $foto_data['P_KEY'] . '<br />';
    }
    ?>