function get_cardtopic($uid, $num = 1) { require_once R_P . 'require/functions.php'; $_sql_where = ''; if ($notInFid = getSpecialFid()) { $_sql_where = ' AND fid NOT IN(' . $notInFid . ')'; } $rt = $this->_db->get_one("SELECT tid,subject,postdate FROM pw_threads WHERE authorid=" . S::sqlEscape($uid) . $_sql_where . ' ORDER BY tid DESC LIMIT 1'); if (empty($rt)) { return array(); } $pw_tmsgs = getTtable($rt['tid']); $r2 = $this->_db->get_one("SELECT aid,content FROM {$pw_tmsgs} WHERE tid=" . S::sqlEscape($rt['tid'])); $rt['subject'] = substrs(stripWindCode($rt['subject']), 100, N); $rt['content'] = substrs(stripWindCode($r2['content']), 100, N); $rt['postdate_s'] = get_date($rt['postdate']); if ($r2['aid']) { $attachs = L::loadDB('attachs', 'forum'); $rt['attimages'] = array(); $atts = $attachs->getByTid($rt['tid'], 0, 4, 'img'); foreach ($atts as $key => $val) { $a_url = geturl($val['attachurl'], 'show', $val['ifthumb']); if ($a_url != 'nopic') { $rt['attimages'][] = is_array($a_url) ? $a_url[0] : $a_url; } } } return $rt; }
function transfer() { if (empty($this->flashatt)) { return false; } global $timestamp, $winddb; require_once R_P . 'require/functions.php'; $pw_attachs = L::loadDB('attachs', 'forum'); $saveAttach = $this->getSaveAttach($this->uid); $deltmp = array(); $attach = $pw_attachs->gets(array('tid' => 0, 'pid' => 0, 'uid' => $this->uid, 'did' => 0, 'mid' => 0)); foreach ($attach as $rt) { $deltmp[] = $rt['aid']; if (!isset($this->flashatt[$rt['aid']])) { pwDelatt($rt['attachurl'], $this->ifftp); continue; } $saveAttach && $saveAttach->add($rt); $value = $this->flashatt[$rt['aid']]; $rt['descrip'] = $value['desc']; $this->attachs[] = array('id' => $rt['aid'], 'attname' => 'attachment', 'name' => $rt['name'], 'type' => $rt['type'], 'fileuploadurl' => $rt['attachurl'], 'size' => $rt['size'], 'descrip' => str_replace('\\', '', $rt['descrip']), 'ifthumb' => $rt['ifthumb']); $winddb['uploadnum']++; $winddb['uploadtime'] = $timestamp; } $saveAttach && $saveAttach->execute(); $deltmp && $pw_attachs->delete($deltmp); return true; }
function transfer() { if (empty($this->flashatt)) { return false; } global $db_enhideset, $db_sellset, $db_ifpwcache, $timestamp; require_once R_P . 'require/functions.php'; $pw_attachs = L::loadDB('attachs', 'forum'); $saveAttach = $this->getSaveAttach($this->uid); $deltmp = array(); $attach = $pw_attachs->gets(array('tid' => 0, 'pid' => 0, 'uid' => $this->uid, 'did' => 0, 'mid' => 0)); foreach ($attach as $rt) { if (!isset($this->flashatt[$rt['aid']])) { pwDelatt($rt['attachurl'], $this->ifftp); $deltmp[] = $rt['aid']; continue; } $saveAttach && $saveAttach->add($rt); $value = $this->flashatt[$rt['aid']]; $rt['descrip'] = $value['desc']; $pw_attachs->updateById($rt['aid'], array('mid' => '1', 'descrip' => $rt['descrip'])); $this->attachs[$rt['aid']] = array('aid' => $rt['aid'], 'name' => $rt['name'], 'type' => $rt['type'], 'attachurl' => $rt['attachurl'], 'size' => $rt['size'], 'hits' => $rt['hits'], 'desc' => str_replace('\\', '', $rt['descrip']), 'ifthumb' => $rt['ifthumb']); $this->fieldDatas[] = array('uid' => $this->uid, 'aid' => $rt['aid'], 'mid' => $this->mid, 'rid' => $this->rid, 'status' => 1); } $saveAttach && $saveAttach->execute(); $deltmp && $pw_attachs->delete($deltmp); return true; }
function AttUpload($uid, $flashatt = null, $savetoalbum = 0, $albumid = 0) { global $db, $pwforum, $pwpost, $db_ifathumb, $db_athumbsize, $db_uploadfiletype; parent::uploadBehavior(); $this->pw_attachs = L::loadDB('attachs', 'forum'); $this->uid = $uid; $this->db =& $db; $this->forum =& $pwforum; $this->post =& $pwpost; if ($pwforum->forumset['ifthumb'] == 1) { $this->ifthumb = 1; $this->thumbsize = $pwforum->forumset['thumbsize']; } elseif ($pwforum->forumset['ifthumb'] == 2) { $this->ifthumb = 0; $this->thumbsize = 0; } else { $this->ifthumb = $db_ifathumb; $this->thumbsize = $db_athumbsize; } list($uploadcredit, $uploadmoney) = explode("\t", $pwforum->forumset['uploadset']); $this->uploadmoney = $uploadmoney; $this->uploadcredit = $uploadcredit; $this->ftype =& $db_uploadfiletype; $this->uploadImgNum = 0; $this->uptype = 'all'; $this->setFlashAtt($flashatt, $savetoalbum, $albumid); }
function getPcvalueDao() { static $sPcvalueDao; if (!$sPcvalueDao) { $sPcvalueDao = L::loadDB('pcvalue', 'forum'); } return $sPcvalueDao; }
function getDebateDao() { static $sDebateDao; if (!$sDebateDao) { $sDebateDao = L::loadDB('debate', 'forum'); } return $sDebateDao; }
/** * 不通过缓存直接从数据库获取weibo content信息 * * @param array $mids * @return array */ function _getWeiboContentsDataByMidsNoCache($mids) { if (!S::isArray($mids)) { return false; } $contentDao = L::loadDB('weibo_content', 'sns'); return $contentDao->getWeibosByMid($mids); }
function getForumsDao() { static $sForumsDao; if (!$sForumsDao) { $sForumsDao = L::loadDB('forums', 'forum'); } return $sForumsDao; }
function getRewardDao() { static $sRewardDao; if (!$sRewardDao) { $sRewardDao = L::loadDB('reward', 'forum'); } return $sRewardDao; }
function getDefaultBlockByStamp($stamp) { $stampdata = $this->getDataByStamp($stamp); if ($stampdata['init']) { $pw_block = L::loadDB('block'); return $pw_block->getData($stampdata['init']); } }
/** * @return PW_Weibo_ContentDB */ function _getWeiboDao() { static $sWeiboDao; if (!$sWeiboDao) { $sWeiboDao = L::loadDB('weibo_content', 'sns'); } return $sWeiboDao; }
/** * 根据日志ID数组获得日志信息 * @return array */ function _getDataByTags() { if (empty($this->tags)) { return array(); } $diaryDB = L::loadDB('diary', 'diary'); $result = $diaryDB->getsByDids($this->tags); return $result; }
/** * 根据日志ID数组获得日志信息 * @return array */ function _getDataByTags() { if (empty($this->tags)) { return array(); } $threadsDB = L::loadDB('threads', 'forum'); $result = $threadsDB->getsBythreadIds($this->tags); return $result; }
/** * 根据日志ID数组获得日志信息 * @return array */ function _getDataByTags() { if (empty($this->tags)) { return array(); } $cnphotoDB = L::loadDB('cnphoto', 'colony'); $result = $cnphotoDB->getDataByPids($this->tags); return $result; }
/** * 根据日志ID数组获得日志信息 * @return array */ function _getDataByTags() { if (empty($this->tags)) { return array(); } $cnphotoDB = L::loadDB('owritedata', 'sns'); $result = $cnphotoDB->getDataByIds($this->tags); return $result; }
function _initConfigCondition($array) { $invokePieceDB = L::loadDB('invokepiece', 'area'); $invokePieceStruct = $invokePieceDB->getStruct(); foreach ($array as $key => $value) { if (in_array($key, $invokePieceStruct)) { continue; } $array['config'][$key] = $value; unset($array[$key]); } return $array; }
/** * @param string $type * @param int $num */ function _getData($type, $num) { switch ($type) { case '': case 'new': $write = L::loadDB('owritedata', 'sns'); return $write->getNewData($num); case 'comment': $datanalyse = L::loadClass('datanalyseService', 'datanalyse'); return $datanalyse->getDataByAction('owrite', 'writeComment', $num); default: return; } }
function replaceData($array) { $array = $this->_checkData($array); if (!$array || !$array['invokename'] || !$array['action'] || !$array['title'] || !$array['num'] || !$array['param']) { return null; } if (!$array['func'] || !$array['cachetime']) { $pw_stamp = L::loadDB('stamp'); $block = $pw_stamp->getDefaultBlockByStamp($array['action']); $array['func'] = $block['func']; $array['cachetime'] = $block['cachetime']; $array['rang'] = $block['rang']; } $this->_db->update("REPLACE INTO " . $this->_tableName . " SET " . pwSqlSingle($array, false)); return $this->_db->insert_id(); }
function AttUpload($uid, $flashatt = null) { global $db, $pwforum, $pwpost, $db_ifathumb, $db_athumbsize, $uploadmoney, $uploadcredit, $db_uploadfiletype; parent::uploadBehavior(); $this->pw_attachs = L::loadDB('attachs'); $this->uid = $uid; $this->db =& $db; $this->forum =& $pwforum; $this->post =& $pwpost; $this->ifthumb =& $db_ifathumb; $this->thumbsize =& $db_athumbsize; $this->uploadmoney =& $uploadmoney; $this->uploadcredit =& $uploadcredit; $this->ftype =& $db_uploadfiletype; $this->uptype = 'all'; $this->setFlashAtt($flashatt); }
function ModifyAttach($aid) { global $db, $db_ifathumb, $db_athumbsize, $db_uploadfiletype; parent::uploadBehavior(); $this->db =& $db; $this->pw_attachs = L::loadDB('attachs', 'forum'); $this->attach = $this->pw_attachs->get($aid); $this->forum = new PwForum($this->attach['fid']); $this->ifthumb =& $db_ifathumb; if ($this->forum->forumset['ifthumb'] == 0) { $this->thumbsize =& $db_athumbsize; } elseif ($this->forum->forumset['ifthumb'] == 1) { $this->thumbsize =& $pwforum->forumset['thumbsize']; } elseif ($this->forum->forumset['ifthumb'] == 2) { $this->thumbsize = 0; $this->ifthumb = 0; } else { $this->thumbsize =& $db_athumbsize; } $this->ftype =& $db_uploadfiletype; $this->uptype = 'all'; }
function AttMutiUpload($uid, $fid) { global $db, $db_ifathumb, $db_athumbsize, $db_uploadfiletype, $_G; parent::uploadBehavior(); $this->pw_attachs = L::loadDB('attachs', 'forum'); $this->uid = $uid; $this->db =& $db; $this->forum = new PwForum($fid); if ($this->forum->forumset['ifthumb'] == 1) { $this->ifthumb = 1; $this->thumbsize = $pwforum->forumset['thumbsize']; } elseif ($this->forum->forumset['ifthumb'] == 2) { $this->ifthumb = 0; $this->thumbsize = 0; } else { $this->ifthumb = $db_ifathumb; $this->thumbsize = $db_athumbsize; } $_G['uploadtype'] && ($db_uploadfiletype = $_G['uploadtype']); $db_uploadfiletype = !empty($db_uploadfiletype) ? is_array($db_uploadfiletype) ? $db_uploadfiletype : unserialize($db_uploadfiletype) : array(); $this->ftype =& $db_uploadfiletype; $this->uptype = 'all'; }
function _getPageInvokeDB() { return L::loadDB('PageInvoke', 'area'); }
pwFtpClose($ftp); if (!($photos = $img->getAttachs())) { refreshto("{$basename}a=upload", 'colony_uploadnull'); } $photoNum = count($photos); $pid = $img->getNewID(); $lastpid = getLastPid($aid, 4); array_unshift($lastpid, $pid); if (!$rt['private']) { $feedText = "[url={$db_bbsurl}/{$basename}space=1&a=album&aid={$aid}&u={$winduid}]{$rt[aname]}[/url]\n"; foreach ($photos as $value) { $feedText .= "[url={$db_bbsurl}/{#APPS_BASEURL#}q=photos&space=1&a=view&pid={$pid}&u={$winduid}][img]" . getphotourl($value['path'], $value['ifthumb']) . "[/img][/url] "; } pwAddFeed($winduid, 'photo', $pid, array('num' => $photoNum, 'text' => $feedText)); //会员资讯缓存 $usercache = L::loadDB('Usercache'); $usercachedata = $usercache->get($winduid, 'photos'); $usercachedata = explode(',', $usercachedata['value']); is_array($usercachedata) || ($usercachedata = array()); if (count($usercachedata) >= 4) { array_pop($usercachedata); } array_unshift($usercachedata, $pid); $usercachedata = implode(',', $usercachedata); $usercache->update($winduid, 'photos', $pid, $usercachedata); } $db->update("UPDATE pw_cnalbum SET photonum=photonum+" . pwEscape($photoNum, false) . ",lasttime=" . pwEscape($timestamp, false) . ',lastpid=' . pwEscape(implode(',', $lastpid)) . (!$rt['lastphoto'] ? ',lastphoto=' . pwEscape($img->getLastPhoto()) : '') . " WHERE aid=" . pwEscape($aid)); countPosts("+{$photoNum}"); //积分变动 require_once R_P . 'require/credit.php'; $o_photos_creditset = unserialize($o_photos_creditset);
function _getCareerDao() { return L::loadDB('UserCareer', 'user'); }
/** * 加载用户标签dao * * @return PW_TagsDB */ function _getMemberTagsRelationsDB() { return L::loadDB('memberTagsRelations', 'user'); }
<?php !defined('P_W') && exit('Forbidden'); PostCheck(); S::gp(array('aid', 'page')); empty($aid) && Showmsg('job_attach_error'); $pw_attachs = L::loadDB('attachs', 'forum'); $attach = $pw_attachs->get($aid); !$attach && Showmsg('job_attach_error'); if (empty($attach['attachurl']) || strpos($attach['attachurl'], '..') !== false) { Showmsg('job_attach_error'); } $fid = $attach['fid']; $aid = $attach['aid']; $tid = $attach['tid']; $pid = $attach['pid']; if (!($foruminfo = L::forum($fid))) { Showmsg('data_error'); } require_once R_P . 'require/forum.php'; require_once R_P . 'require/updateforum.php'; wind_forumcheck($foruminfo); $isGM = S::inArray($windid, $manager); //获取管理权限 $isBM = admincheck($foruminfo['forumadmin'], $foruminfo['fupadmin'], $windid); if ($isGM || pwRights($isBM, 'delattach')) { $admincheck = 1; } else { $admincheck = 0; } if ($groupid != 'guest' && ($admincheck || $attach['uid'] == $winduid)) {
</ul>', 'image' => '16.jpg'), '16' => array('tplid' => '18', 'type' => 'subject', 'name' => '帖子及图片复合', 'descrip' => '由图片模块和帖子模块组成', 'tagcode' => '<list action="image" num="3" title="图片模块" /> <loop> <a href="{url}" target="_blank"><img src="{image,100,100}" class="fl" /></a> </loop> <div class="c"></div> <list action="subject" num="7" title="帖子模块" /> <ul> <loop> <li><a href="{url}" target="_blank">{title,36}</a></li> </loop> </ul>', 'image' => '17.jpg'), '17' => array('tplid' => '19', 'type' => 'tag', 'name' => '标签模块', 'descrip' => '标签列表', 'tagcode' => '<list action="tag" num="10" title="标签模块" /> <loop> <a href="{url}" target="_blank">{title}</a> </loop>', 'image' => '18.jpg'), '18' => array('tplid' => '20', 'type' => 'subject', 'name' => '帖子及图片复合2', 'descrip' => '由图片模块和帖子模块组成', 'tagcode' => '<list action="image" num="1" title="图片模块" /> <loop> <a href="{url}" target="_blank"><img src="{image,100,100}" class="fl" /></a> <h4><a href="{url}" target="_blank">{title,40}</a></h4> <p>{descrip,60}</p> </loop> <div class="c"></div> <list action="subject" num="7" title="帖子模块" /> <ul> <loop> <li><a href="{url}" target="_blank">{title,40}</a></li> </loop> </ul>', 'image' => '19.jpg')); $pw_tpl = L::loadDB('tpl'); $db->query("TRUNCATE TABLE `pw_tpl`"); foreach ($tpls as $key => $value) { $pw_tpl->insertData($value); }
function _getJobDoerDao() { $job = L::loadDB('jobdoer', 'job'); return $job; }
function _getChannelDAO() { return L::loadDB('Channel', 'area'); }
function _getSchoolDao() { return L::loadDB('School', 'user'); }