Beispiel #1
0
            $rt['sub_pintro'] = substrs($rt['pintro'], 25);
            $rt['uptime'] = get_date($rt['uptime']);
            $cnpho[] = $rt;
        }
    }
    $u = $album['ownerid'];
    $username = $album['owner'];
} elseif ($a == 'view') {
    InitGP(array('pid'));
    $db->update("UPDATE pw_cnphoto SET hits=hits+1 WHERE pid=" . pwEscape($pid));
    //$photo = $db->get_one("SELECT p.pid,p.aid,p.pintro,p.path as basepath,p.uploader,p.uptime,p.hits,p.c_num,p.ifthumb,a.aname,a.private, a.ownerid,a.owner,a.photonum,m.groupid FROM pw_cnphoto p LEFT JOIN pw_cnalbum a ON p.aid=a.aid LEFT JOIN pw_members m ON p.uploader=m.username WHERE p.pid=" . pwEscape($pid) . " AND a.atype='0'");
    # album photos
    $nearphoto = array();
    $register = array('db_shield' => $db_shield, "groupid" => $groupid, "pwModeImg" => $pwModeImg);
    require_once R_P . 'lib/showpicture.class.php';
    $sp = new PW_ShowPicture($register);
    list($photo, $nearphoto, $prePid, $nextPid) = $sp->getPictures($pid, $aid);
    $isown = $photo['ownerid'] == $winduid ? '1' : '0';
    empty($photo) && Showmsg('data_error');
    if ($photo['ownerid'] != $winduid && $photo['private'] == 1 && !isFriend($photo['ownerid'], $winduid) && $groupid != 3) {
        Showmsg('mode_o_photos_private');
    }
    $photo['uptime'] = get_date($photo['uptime']);
    $photo['path'] = getphotourl($photo['basepath']);
    if ($photo['groupid'] == 6 && $db_shield && $groupid != 3) {
        $photo['path'] = $pwModeImg . '/banuser.gif';
        $photo['pintro'] = appShield('ban_photo_pintro');
    }
    $u = $photo['ownerid'];
    $username = $photo['owner'];
    $aid = $photo['aid'];
Beispiel #2
0
 /**
  *查看照片
  *@param $pid int 照片ID
  *@param $aid int 相册ID
  *@return Array 照片相关信息
  */
 function viewPhoto($pid)
 {
     global $attachpath;
     $nearphoto = array();
     $register = array('db_shield' => $this->_dbshield, "groupid" => $this->_groupid, "pwModeImg" => $this->_pwModeImg);
     L::loadClass('showpicture', 'colony', false);
     $sp = new PW_ShowPicture($register);
     list($photo, $nearphoto, $prePid, $nextPid) = $sp->getPictures($pid);
     if (empty($photo)) {
         return 'data_error';
     }
     $album = $this->albumViewRight($photo['aid']);
     if (!is_array($album)) {
         return $album;
     }
     $photo['privacy'] = $album['privacy'];
     $photo['uptime'] = get_date($photo['uptime']);
     $photo['path'] = getphotourl($photo['basepath']);
     $tmpPath = substr($photo['path'], 0, strlen($attachpath) + 1) == "{$attachpath}/" ? R_P . $photo['path'] : $photo['path'];
     list($photo['w'], $photo['h']) = getimagesize($tmpPath);
     if ($this->_dbshield && $photo['groupid'] == 6 && !$this->isPermission()) {
         $photo['path'] = $this->_pwModeImg . '/banuser.gif';
         $photo['pintro'] = appShield('ban_photo_pintro');
     }
     $photoDao = $this->_getDaoFactory('CnPhoto');
     $data['hits'] = intval($photo['hits']) + 1;
     $photoDao->update($data, $pid);
     return array($photo, $nearphoto, $prePid, $nextPid);
 }