<?php /* * @copyright Leyun internet Technology(Shanghai)Co.,Ltd * @license http://www.dzzoffice.com/licenses/license.txt * @package DzzOffice * @link http://www.dzzoffice.com * @author zyx(zyx@dzz.cc) */ if (!defined('IN_DZZ')) { exit('Access Denied'); } //print_r($_GET);exit('dfdfs'); $uid = isset($_GET['uid']) ? intval($_GET['uid']) : $_G['uid']; $space = dzzgetspace($uid); $space['self'] = intval($space['self']); $do = empty($_GET['do']) ? '' : $_GET['do']; //判断数据唯一 $refer = dreferer(); if ($do == 'newlink') { if (!submitcheck('newlinksubmit')) { $pfid = intval($_GET['path']); } else { $link = trim($_GET['link']); //$link = dhtmlspecialchars(trim($_POST['link'])); $pfid = intval($_GET['pfid']); //判断有没有权限添加 //检查网址合法性 if (!preg_match("/^(http|ftp|https|mms)\\:\\/\\/.{5,300}\$/i", $link)) { $link = 'http://' . preg_replace("/^(http|ftp|https|mms)\\:\\/\\//i", '', $link); }
if (!defined('IN_DZZ')) { exit('Access Denied'); } $dzz->reject_robot(); //阻止机器人访问 if (empty($_G['uid']) && !C::t('setting')->fetch('feed_guest_allow')) { include template('common/header_reload'); echo "<script type=\"text/javascript\">"; echo "try{top._login.logging();win.Close();}catch(e){location.href='user.php?mod=logging'}"; echo "</script>"; include template('common/footer_reload'); exit; } $ismobile = helper_browser::ismobile(); include libfile('function/code'); $space = dzzgetspace($_G['uid']); $space['attachextensions'] = $space['attachextensions'] ? explode(',', $space['attachextensions']) : array(); $space['maxattachsize'] = intval($space['maxattachsize']); $feedType = empty($_GET['feedType']) ? $_G['uid'] ? $_G['setting']['feed_feedType_default'] ? $_G['setting']['feed_feedType_default'] : 'aboutme' : 'all' : $_GET['feedType']; $gets = array('mod' => 'feed', 'feedType' => $feedType); $theurl = DZZSCRIPT . "?" . url_implode($gets); $page = empty($_GET['page']) ? 1 : intval($_GET['page']); $perpage = 10; $start = ($page - 1) * $perpage; $orderby = ' order by t.lastpost DESC'; $sql = 'p.`first`>0'; switch ($feedType) { case 'aboutme': $navtitle = '与我相关'; $wherearr = array(); //@我的
function SpaceSize($size, $gid, $isupdate = 0) { //size: 增加的话为正值,减少的话为负值; //gid : 大于零位群组空间,否则为$_G['uid']的空间, //isupdate: 为true,则实际改变空间,否则只是检查是否有空间 global $_G, $space; if ($gid > 0) { if (!($org = C::t('organization')->fetch($gid))) { //机构不存在时,返回错误; return false; } $spacearr['usesize'] = $org['usesize']; $spacearr['maxspacesize'] = $org['maxspacesize']; } else { if (!$space) { $space = dzzgetspace($_G['uid']); } $spacearr = $space; } if ($isupdate) { $new_usesize = $spacearr['usesize'] + $size > 0 ? $spacearr['usesize'] + $size : 0; if ($gid > 0) { C::t('organization')->update($gid, array('usesize' => $new_usesize)); } else { C::t('user_field')->update($_G['uid'], array('usesize' => $new_usesize)); } return true; } else { if ($gid) { if ($spacearr['maxspacesize'] == 0) { return true; } //机构最大空间为0 表示不限制 if ($spacearr['usesize'] + $size > $spacearr['maxspacesize']) { return false; } else { return true; } return true; } else { if ($space['maxspacesize'] == 0) { return true; } elseif ($space['maxspacesize'] < 0) { return false; } //用户组最大空间<0 表示没有空间 if ($spacearr['usesize'] + $size > $spacearr['maxspacesize']) { return false; } else { return true; } } } }