当前位置: 首页>>代码示例>>PHP>>正文


PHP CGroup::getInstance方法代码示例

本文整理汇总了PHP中CGroup::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP CGroup::getInstance方法的具体用法?PHP CGroup::getInstance怎么用?PHP CGroup::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CGroup的用法示例。


在下文中一共展示了CGroup::getInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: intval

<?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);
    }
}
开发者ID:jmathai,项目名称:photos,代码行数:14,代码来源:group_check.dsp.php

示例2: dependencies

 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;
     }
 }
开发者ID:jmathai,项目名称:photos,代码行数:38,代码来源:CFotobox.php

示例3: shareFlix

 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;
     }
 }
开发者ID:jmathai,项目名称:photos,代码行数:32,代码来源:CGroupManage.php

示例4: substr

<?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 />';
    }
    ?>
开发者ID:jmathai,项目名称:photos,代码行数:30,代码来源:foto_viewer.dsp.php


注:本文中的CGroup::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。