# 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']; $num = $db->get_value("SELECT COUNT(*) AS sum FROM pw_cnphoto WHERE aid=" . pwEscape($photo['aid']) . ' AND pid<=' . pwEscape($pid)); // $up_photo = $db->get_one("SELECT p.pid,p.path,p.ifthumb,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.ownerid=".pwEscape($u)." AND p.aid=".pwEscape($aid)." ORDER BY pid DESC"); // if ($up_photo) { // $up_photo['path'] = getphotourl($up_photo['path'],$up_photo['ifthumb']); // if ($up_photo['groupid'] == 6 && $db_shield && $groupid != 3) { // $up_photo['path'] = $pwModeImg.'/banuser.gif'; // } // $nearphoto[] = $up_photo; // } else { // $nearphoto[] = array('pid'=>'begin','path'=>'images/apps/pbegin.jpg'); // }
/** *查看照片 *@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); }
/** * 有条件处理日志内容和标题 * * @param array() $data 日志数据 * @param bool $islist 是否是列表,列表页日志内容显示字节 */ function _getContentANDSubjectByDiary($data, $islist = false, $isFilterFace = false) { global $groupid, $db_shield, $db_windpost, $o_shownum; $result = array(); if ($data['groupid'] == 6 && $db_shield && $groupid != 3) { $data['subject'] = ''; $data['content'] = appShield('ban_diary'); } $wordsService = $this->_serviceFactory('FilterUtil', 'filter'); /* @var $wordsService PW_FilterUtil */ if (!$wordsService->equal($data['ifwordsfb'])) { $data['content'] = $wordsService->convert($data['content'], array('id' => $data['did'], 'type' => 'diary', 'code' => $data['ifwordsfb'])); } $isFilterFace == true && ($data['content'] = preg_replace("/\\[s:(.+?)\\]/eis", '', $data['content'])); require_once R_P . 'require/bbscode.php'; $data['ifconvert'] == 2 && ($data['content'] = convert($data['content'], $db_windpost)); if ($islist) { $data['content'] = strip_tags($data['content']); $data['content'] = stripWindCode($this->escapeStr($data['content'])); $o_shownum && ($data['content'] = substrs($data['content'], $o_shownum)); } $data['content'] = preg_replace('/\\[upload=(\\d+)\\]/Ui', "", $data['content']); $data['content'] = str_replace("\n", "<br />", $data['content']); $result = array($data['subject'], $data['content']); return $result; }
$sqladd = 'WHERE d.privacy!=2'; $uids = array_keys($friends); $uids = array_diff($uids, array($winduid)); $uids && ($sqladd .= ' AND d.uid IN(' . pwImplode($uids) . ')'); } if ($sqladd) { require_once R_P . 'require/bbscode.php'; $sum = $db->get_value("SELECT COUNT(*) as count FROM pw_diary d {$sqladd}"); if ($sum) { $wordsfb = L::loadClass('FilterUtil'); list($pages, $limit) = pwLimitPages($sum, $page, $basename . "q=diary&a={$a}&"); $query = $db->query("SELECT d.did,d.dtid,d.uid,d.aid,d.username,d.privacy,d.subject,d.ifconvert,d.ifwordsfb,d.content,d.r_num,d.c_num,d.postdate,m.groupid,m.icon FROM pw_diary d LEFT JOIN pw_members m ON d.uid=m.uid {$sqladd} ORDER BY d.postdate DESC {$limit}"); while ($rt = $db->fetch_array($query)) { if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) { $rt['subject'] = ''; $rt['content'] = appShield('ban_diary'); } elseif (!$wordsfb->equal($rt['ifwordsfb'])) { $rt['content'] = $wordsfb->convert($rt['content'], array('id' => $rt['did'], 'type' => 'diary', 'code' => $rt['ifwordsfb'])); } $rt['postdate'] = get_date($rt['postdate'], 'Y-m-d H:i'); $rt['content'] = preg_replace("/\\[s:(.+?)\\]/eis", '', $rt['content']); if ($rt['ifconvert'] == 2) { $rt['content'] = convert($rt['content'], $db_windpost); } else { strpos($rt['content'], '[s:') !== false && ($rt['content'] = showface($rt['content'])); } if ($o_shownum) { $rt['content'] = substrs($rt['content'], $o_shownum); } $rt['content'] = str_replace("\n", "<br />", $rt['content']); $attachs = $aids = array();
$feeds[$key][] = $rt; } } $friends = getFriends($u, 0, 18, '', 1); //$sendfriends = getFriends($winduid,0,0,false,1); //留言板 if ($privacy['msgboard']) { $boards = array(); require_once R_P . 'require/bbscode.php'; $wordsfb = L::loadClass('FilterUtil'); $query = $db->query("SELECT o.*,m.icon as face,m.groupid FROM pw_oboard o LEFT JOIN pw_members m ON o.uid=m.uid WHERE o.touid=" . pwEscape($u) . " ORDER BY o.id DESC " . pwLimit(0, 15)); while ($rt = $db->fetch_array($query)) { $rt['postdate'] = get_date($rt['postdate']); list($rt['face']) = showfacedesign($rt['face'], 1, 'm'); if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) { $rt['title'] = appShield('ban_feed'); } elseif (!$wordsfb->equal($rt['ifwordsfb'])) { $rt['title'] = $wordsfb->convert($rt['title'], array('id' => $rt['id'], 'type' => 'oboard', 'code' => $rt['ifwordsfb'])); } if (strpos($rt['title'], '[s:') !== false) { $rt['title'] = showface($rt['title']); } if (strpos($rt['title'], '[url') !== false) { $rt['title'] = convert($rt['title'], $db_windpost); } $boardids[] = $rt['id']; $boards[] = $rt; } if (!empty($boardids)) { $commentdb = getCommentDb('board', $boardids); }
function browseAlbum($num) { global $db, $db_shield, $groupid, $pwModeImg; $albumdb = array(); $query = $db->query("SELECT c.aid,c.aname,c.photonum,c.ownerid,c.owner,c.lastphoto,c.lasttime,m.groupid FROM pw_cnalbum c LEFT JOIN pw_members m ON c.ownerid=m.uid WHERE c.atype='0' AND c.private='0' ORDER BY c.aid DESC LIMIT {$num}"); while ($rt = $db->fetch_array($query)) { $rt['lasttime'] = get_date($rt['lasttime']); $rt['lastphoto'] = getphotourl($rt['lastphoto']); if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) { $rt['lastphoto'] = $pwModeImg . '/banuser.gif'; $rt['aname'] = appShield('ban_album'); } $albumdb[] = $rt; } return $albumdb; }
function adorn_messageboard($data) { global $db_shield, $groupid; if (!$data || !is_array($data)) { return array(); } $wordsfb = L::loadClass('FilterUtil', 'filter'); foreach ($data as $key => $rt) { if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) { $rt['title'] = appShield('ban_feed'); } elseif (!$wordsfb->equal($rt['ifwordsfb'])) { $rt['title'] = $wordsfb->convert($rt['title'], array('id' => $rt['id'], 'type' => 'oboard', 'code' => $rt['ifwordsfb'])); } $data[$key] = $rt; } if (!empty($data)) { $commentdb = getCommentDb('board', array_keys($data)); } return array($data, $commentdb); }
$basename = "thread.php?cyid={$cyid}&showtype=write"; if (!$colony['ifwriteopen'] && !$ifadmin && (!$colony['ifcyer'] || $colony['ifadmin'] == '-1')) { Showmsg('colony_cnmenber'); } list($faceurl) = showfacedesign($winddb['icon'], 1, 'm'); $writedata = $typeid = array(); if ($count2 = $colony['writenum']) { $smileParser = L::loadClass('smileparser', 'smile'); /* @var $smileParser PW_SmileParser */ require_once R_P . 'require/showimg.php'; $page = (int) S::getGP('page'); list($pages, $limit) = pwLimitPages($count2, $page, "{$basename}&showtype=write&cyid={$cyid}&"); $query = $db->query("SELECT w.*,m.username,m.icon,m.groupid FROM pw_cwritedata w LEFT JOIN pw_members m ON w.uid=m.uid WHERE w.cyid=" . S::sqlEscape($cyid) . " ORDER BY w.replay_time DESC {$limit}"); while ($rt = $db->fetch_array($query)) { if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) { $rt['content'] = appShield('ban_write'); } $rt['content'] = $smileParser->parse($rt['content']); list($rt['postdate']) = getLastDate($rt['postdate']); list($rt['icon']) = showfacedesign($rt['icon'], 1, 'm'); $writedata[$rt['id']] = $rt; $typeid[] = $rt['id']; } } if ($typeid) { $sql = "SELECT tt.* FROM (SELECT cm.*,m.icon FROM pw_comment cm LEFT JOIN pw_members m ON cm.uid=m.uid WHERE type='groupwrite' AND typeid in (" . S::sqlImplode($typeid, false) . ") ORDER BY cm.id DESC) tt GROUP BY tt.typeid "; $query2 = $db->query($sql); while ($rt2 = $db->fetch_array($query2)) { $writedata[$rt2['typeid']]['replayuid'] = $rt2['uid']; $writedata[$rt2['typeid']]['replayusername'] = $rt2['username']; $writedata[$rt2['typeid']]['replaytitle'] = $rt2['title'];
/** * 取得@我的记录列表 * * @param $userId * @param $page * @param $perpage * @param $pageUrl */ function findWritesToUserInPage($userId, $page = 1, $perpage = 20, $pageUrl) { global $db_shield, $groupid, $winduid, $windid; $count = $this->countWritesToUser($userId); if (!$count) { return array(); } $pages = numofpage($count, $page, ceil($count / $perpage), $pageUrl); $writeDb = $this->_getWriteDB(); $writedata = $writeDb->findWritesToUser($userId, $page, $perpage); if (!$writedata) { return array(); } $result = array(); foreach ($writedata as $write) { if ($write['groupid'] == 6 && $db_shield && $groupid != 3) { $write['content'] = appShield('ban_write'); } list($write['postdate']) = getLastDate($write['postdate']); list($write['icon']) = showfacedesign($write['icon'], 1, 'm'); if ($write['touid'] && $write['username']) { $write['content'] = '<a href="' . USER_URL . $write['uid'] . '">' . $write['username'] . '</a> @<a href="u.php?&uid=' . $winduid . '">' . $windid . '</a> ' . $write['content']; } $result[] = $write; } return array($this->parse($result), $pages, $count); }
} elseif ($rt['admin'] == $windid) { $count++; $colonyids[] = $rt['id']; $group_own[] = $rt; } else { $count++; $colonyids[] = $rt['id']; $group_other[] = $rt; } } if ($colonyids) { $query = $db->query("SELECT f.*,m.username,m.groupid,c.id,c.cname FROM pw_feed f LEFT JOIN pw_members m ON f.uid=m.uid LEFT JOIN pw_colonys c ON f.typeid=c.id WHERE f.type IN('colony_post','colony_photo','colony') AND f.typeid IN(" . pwImplode($colonyids) . ') ORDER BY f.timestamp DESC LIMIT 30'); while ($rt = $db->fetch_array($query)) { $rt['descrip'] = parseFeed($rt['descrip']); if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) { $rt['descrip'] = appShield('ban_feed'); } $key = get_date($rt['timestamp'], 'y-m-d'); $groupdb[$rt['id']] = $rt['cname']; $feeds[$key][$rt['id']][] = $rt; } } } else { $space = 1; $friend = $db->get_one("SELECT uid,username,icon FROM pw_members WHERE uid=" . pwEscape($u)); $username = $friend['username']; $count = $db->get_value("SELECT COUNT(DISTINCT c.id) AS count FROM pw_cmembers cm LEFT JOIN pw_colonys c ON cm.colonyid=c.id WHERE cm.uid=" . pwEscape($u) . " AND cm.ifadmin <> '-1'"); if ($count) { $page = (int) GetGP('page'); $pageurl = $basename . 'u=' . $u . "&space=1&"; list($pages, $limit) = pwLimitPages($count, $page, "{$pageurl}");