function initStyle() { $style = L::style(null, L::config('db_defaultstyle')); foreach ($style as $key => $value) { $this->vars[$key] = $value; } $this->vars['css_path'] = D_P . 'data/style/wind_css.htm'; if (file_exists(R_P . "template/{$style[tplpath]}/readtpl.htm")) { $this->tpl = R_P . "template/{$style[tplpath]}/readtpl.htm"; } else { $this->tpl = R_P . "template/wind/readtpl.htm"; } }
<?php !defined('M_P') && exit('Forbidden'); !defined('USED_HEAD') && define('USED_HEAD', 1); define('F_M', true); extract(L::style(null, 'wind')); if (!defined('MSG')) { if (in_array($q, array('write', 'diary', 'share', 'article', 'photos', 'groups', 'group', 'galbum', 'friend', 'home', 'myapp', 'app', 'board', 'browse', 'invite', 'hot'))) { if ($space == 1) { $pwModeCss = $imgpath . '/apps/browse-style.css'; } else { $pwModeCss = $imgpath . '/apps/app-style.css'; } } elseif ($q == 'user') { $pwModeCss = $imgpath . '/apps/browse-style.css'; } else { $pwModeCss = $imgpath . '/apps/index-style.css'; } } else { $pwModeCss = $imgpath . '/apps/app-style.css'; } if ($q == 'home') { $baseUrl = 'mode.php?m=' . $m . '&'; } $db_menuinit .= ",'td_userinfomore' : 'menu_userinfomore'"; $jobnum = $winddb['jobnum'] > 0 ? "(" . $winddb['jobnum'] . ")" : ""; list($_Navbar, $_LoginInfo) = pwNavBar(); $searchUrl = $basename . 'q=friend&type=find&'; require_once PrintEot('header'); unset($_Navbar, $pwModeCss);
ajax_footer(); } else { PostCheck(1, $db_gdcheck & 4 && $winddb['postnum'] < $db_postgd, $winddb['postnum'] < $postq); InitGP(array('atc_title', 'atc_content'), 'P', 0); require_once R_P . 'require/bbscode.php'; if ($postmodify->type == 'topic') { $postdata = new topicPostData($pwpost); } else { $postdata = new replyPostData($pwpost); } $postdata->initData($postmodify); $postdata->setTitle($atc_title); $postdata->setContent($atc_content); $postdata->setConvert(1); $postmodify->execute($postdata); extract(L::style()); $aids = array(); if ($atcdb['attachs']) { $aids = attachment($atc_content); } $leaveword = $atcdb['leaveword'] ? leaveword($atcdb['leaveword']) : ''; $content = convert($postdata->data['content'] . $leaveword, $db_windpost); if (strpos($content, '[p:') !== false || strpos($content, '[s:') !== false) { $content = showface($content); } if ($atcdb['ifsign'] < 2) { $content = str_replace("\n", '<br />', $content); } if ($postdata->data['ifwordsfb'] == 0) { $content = addslashes(wordsConvert(stripslashes($content))); }
function PrintEot($template, $EXT = 'htm') { $tplpath = L::style('tplpath'); !$template && ($template = 'N'); //cms if ($template == 'bbscode' || in_array($template, array('c_header', 'c_footer'))) { if (file_exists(R_P . "template/{$tplpath}/{$template}.{$EXT}")) { return R_P . "template/{$tplpath}/{$template}.{$EXT}"; } elseif (file_exists(R_P . "template/wind/{$template}.{$EXT}")) { return R_P . "template/wind/{$template}.{$EXT}"; } else { exit("Can not find {$template}.{$EXT} file"); } } //cms if (file_exists(R_P . "template/admin/{$template}.{$EXT}")) { return R_P . "template/admin/{$template}.{$EXT}"; } else { exit("Can not find {$template}.{$EXT} file"); } }
<?php !defined('P_W') && exit('Forbidden'); S::gp(array('alias', 'ifactive'), 'G'); header('Content-type: application/javascript;charset=' . $db_charset); header('Cache-Control: no-cache'); extract(L::style('', $skinco)); //* include_once pwCache::getPath(D_P.'data/bbscache/area_config.php'); pwCache::getData(D_P . 'data/bbscache/area_config.php'); $chanelService = L::loadClass('channelService', 'area'); $channelInfo = $chanelService->getChannelInfoByAlias($alias); if (empty($channelInfo)) { exit; } $areaLevelService = L::loadClass('arealevel', 'area'); $ifChannelEdit = $areaLevelService->getAreaLevel($winduid, $channelInfo['id']); list($_Navbar, $_LoginInfo) = pwNavBar(); list(, $showq) = explode("\t", $db_qcheck); require modeEot('m_header'); $output = str_replace(array('<!--<!---->', '<!---->'), '', ob_get_contents()); $output = addslashes(preg_replace("'([\r\n])+'", "", trim($output))); $output = str_replace('</script>', '<\\/script>', $output); echo ObContents("document.write('" . $output . "');");
/** * 处理日志附件、内容图片 * * @param $aid 日志里附件存储数据,unserialize格式类型 aid * @param $content 日志内容 * @param $authorid 日志作者 */ function _getAttachs($aid, &$content, $authorid) { global $winduid, $isGM; if (!$aid || !($attachs = unserialize($aid)) || !is_array($attachs)) { return array(); } $GLOBALS += L::style(); require_once R_P . 'require/bbscode.php'; $attachShow = new attachShow($isGM, '', false, 'diary'); $attachShow->setData($attachs); return $attachShow->parseAttachs('tpc', $content, $winduid == $authorid); }
<?php define('SCR', 'register'); require_once 'global.php'; require_once R_P . 'require/functions.php'; require L::style('', $skinco, true); if ("wind" != $tplpath && file_exists(D_P . 'data/style/' . $tplpath . '_css.htm')) { $css_path = D_P . 'data/style/' . $tplpath . '_css.htm'; } else { $css_path = D_P . 'data/style/wind_css.htm'; } $rg_config = L::reg(); $inv_config = L::config(null, 'inv_config'); list($regminname, $regmaxname) = explode("\t", $rg_config['rg_namelen']); list($rg_regminpwd, $rg_regmaxpwd) = explode("\t", $rg_config['rg_pwdlen']); if ($db_pptifopen && $db_ppttype == 'client') { Showmsg('passport_register'); } list(, $showq) = explode("\t", $db_qcheck); if (S::getGP('action', 'P') == 'regcheck') { $registerCheckService = L::loadClass('registercheck', 'user', true); S::gp(array('type'), 'P'); if ($type == 'regname') { S::gp('username', 'P'); echo $registerCheckService->checkUsername($username); } elseif ($type == 'regemail') { sleep(1); S::gp('email', 'P'); echo $registerCheckService->checkEmail($email); } elseif ($type == 'reggdcode') { S::gp('gdcode', 'P');
function headguide($guidename, $onmouseover = true) { global $db_menu, $db_bbsname, $db_bfn, $imgpath, $db_menu, $db_mode, $db_bbsurl; if ($db_mode == 'bbs' && $db_bfn == 'index.php') { $db_bfn_temp = $db_bbsurl . "/index.php?m=bbs"; } else { $db_bfn_temp = $db_bfn; } if ($db_menu && $onmouseover) { $headguide = "<img id=\"td_cate\" src=\"{$imgpath}/" . L::style('stylepath') . "/thread/home.gif\" title=\"快速跳转至其他版块\" onClick=\"return pwForumList(false,false,null,this);\" class=\"cp breadHome\" /><em class=\"breadEm\"></em><a href=\"{$db_bfn_temp}\" title=\"{$db_bbsname}\">{$db_bbsname}</a>"; } else { $headguide = "<a href=\"{$db_bfn}\" title=\"{$db_bbsname}\">{$db_bbsname}</a>"; } if (!is_array($guidename)) { return $headguide . '<em>></em>' . $guidename; } foreach ($guidename as $key => $value) { if ($value[1]) { $headguide .= '<em>></em><a href="' . $value[1] . '">' . $value[0] . '</a>'; } else { $headguide .= '<em>></em>' . $value[0]; } } return $headguide; }
} $baseUrl = $temp_baseUrl; } if (file_exists(R_P . 'u/require/core.php')) { require_once R_P . 'u/require/core.php'; } $pwModeImg = "{$imgpath}/apps"; list($app, $route) = app_specialRoute($q); $appdir = $app; list($basePath, $baseFile) = app_router($app); //* @include_once pwCache::getPath(D_P . 'data/bbscache/o_config.php'); pwCache::getData(D_P . 'data/bbscache/o_config.php'); if ($groupid != 3 && $o_share_groups && strpos($o_share_groups, ",{$groupid},") === false) { $shareGM = 1; } extract(L::style(null, $skinco)); if ($space == 1 && !in_array($q, array('group', 'galbum'))) { $pwModeCss = $imgpath . '/apps/browse-style.css'; } else { $pwModeCss = $imgpath . '/apps/app-style.css'; } list($_Navbar, $_LoginInfo) = pwNavBar(); require_once S::escapePath($baseFile); if ($m == "o") { $isheader && (require_once PrintEot('header')); $isleft && (include_once PrintEot('m_appleft')); $tplname && (include_once PrintEot($tplname)); $isfooter && footer(); } else { $cssForum = TRUE; unset($pwModeCss);
function GetLang($lang, $EXT = 'php') { $tplpath = L::style('tplpath'); $tplpath || ($tplpath = 'wind'); if (file_exists(R_P . "template/{$tplpath}/lang_{$lang}.{$EXT}")) { return R_P . "template/{$tplpath}/lang_{$lang}.{$EXT}"; } elseif (file_exists(R_P . "template/wind/lang_{$lang}.{$EXT}")) { return R_P . "template/wind/lang_{$lang}.{$EXT}"; } else { exit("Can not find lang_{$lang}.{$EXT} file"); } }
function PrintEot($template, $EXT = 'htm') { //Copyright (c) 2003-09 PHPWind global $db_mode, $db_modes, $pwModeImg, $db_tplstyle, $appdir, $tplapps; $tplpath = L::style('tplpath'); !$template && ($template = 'N'); //apps template render if (!defined('PWERROR')) { if (defined('A_P') && $appdir && in_array($template, $tplapps) && file_exists(A_P . "{$appdir}/template/{$template}.{$EXT}")) { return A_P . "{$appdir}/template/{$template}.{$EXT}"; } if (defined('F_M')) { $temp = modeEot($template, $EXT); if ($temp) { return $temp; } } } //if (defined('A_P') && !in_array($template,array('header','footer'))/* || ($db_mode && $db_mode != 'bbs')*/) { // return A_P."$appdir/template/$template.$EXT"; //} if (file_exists(R_P . "template/{$tplpath}/{$template}.{$EXT}")) { return R_P . "template/{$tplpath}/{$template}.{$EXT}"; } elseif (file_exists(R_P . "template/wind/{$template}.{$EXT}")) { return R_P . "template/wind/{$template}.{$EXT}"; } else { exit("Can not find {$template}.{$EXT} file"); } }
//我的日志列表 $dtid = (int) S::getGP('dtid'); //TODO 查看日志分类ID $diaryTypeId = $dtid == '-1' ? 0 : (is_numeric($dtid) && $dtid > 0 ? $dtid : null); $diaryPrivacy = $dtid == '-2' ? array(2) : array(); $diaryService = L::loadClass('Diary', 'diary'); /* @var $diaryService PW_Diary */ list($diaryNums, $diaryType, $defaultTypeNum, $privacyNum) = $diaryService->getDiaryTypeMode($winduid, 0); //TODO 右侧分类Start $count = (int) $diaryService->countUserDiarys($winduid, $diaryTypeId, $diaryPrivacy); $page > ceil($count / $db_perpage) && ($page = ceil($count / $db_perpage)); $diaryDb = $count ? $diaryService->findUserDiarysInPage($winduid, $page, $db_perpage, $diaryTypeId, $diaryPrivacy) : array(); $pages = numofpage($count, $page, ceil($count / $db_perpage), "{$basename}a={$a}&dtid={$dtid}&"); } elseif ($a == 'detail') { //查看我的日志 $stylepath = L::style('stylepath'); $did = (int) S::getGP('did'); $fuid = (int) S::getGP('fuid'); !$did && Showmsg("日志不存在"); $diaryService = L::loadClass('Diary', 'diary'); /* @var $diaryService PW_Diary */ list($diaryNums, $diaryType, $defaultTypeNum, $privacyNum) = $diaryService->getDiaryTypeMode($winduid, 0); //TODO 右侧分类Start $diaryTemp = $diaryService->get($did); if ($diaryTemp['uid'] != $winduid) { //转跳处理 $url = $db_bbsurl . "/apps.php?q=diary&a=detail&did=" . $did . "&uid=" . $diaryTemp['uid']; ObHeader($url); } $diary = $diaryService->getDiaryDbView($diaryTemp); list($commentdb, $subcommentdb, $pages) = getCommentDbByTypeid('diary', $did, $page, "{$basename}a={$a}&did={$did}&#createcommentbox");
$pw_posts = GetPtable($ptable); $query = $db->query("SELECT * FROM {$pw_posts} WHERE tid=" . S::sqlEscape($tid) . " AND ifcheck='1' AND pid IN(" . S::sqlImplode($pidArr) . ')'); while ($read = $db->fetch_array($query)) { $readdb[] = $read; $read['aid'] && ($_pids[$read['pid']] = $read['pid']); } } require_once R_P . 'require/bbscode.php'; if ($_pids) { $attachShow = new attachShow($isGM || $pwSystem['delattach'], $forumset['uploadset'], $forumset['viewpic']); $attachShow->init($tid, $_pids); } foreach ($readdb as $key => $read) { $readdb[$key] = viewread($read); } $GLOBALS += L::style(''); require_once PrintEot('readfloor'); ajax_footer(); function viewread($read) { global $winduid, $isGM, $pwSystem, $_G, $db_windpost, $tpc_buy, $tpc_pid, $tpc_tag, $tpc_author, $tid; $tpc_buy = $read['buy']; $tpc_pid = $read['pid']; $tpc_tag = NULL; $tpc_author = ''; if ($read['anonymous']) { $anonymous = !$isGM && $winduid != $read['authorid'] && !$pwSystem['anonyhide']; } else { $anonymous = false; } if (!$anonymous) {
function getAttachHtml($attach) { global $db_windpost, $basename; $html = ''; switch ($attach['type']) { case 'img': $html = '<br>' . cvpic($attach['attachurl'], 1, '', '', $attach['ifthumb'] & 1); break; default: $html = '<b>' . $attach['descrip'] . '</b>' . "<img src=\"{$GLOBALS['imgpath']}/" . L::style('stylepath') . "/file/{$attach['type']}.gif\" align=\"absmiddle\" /><a href=\"{$basename}q=download&aid={$attach['attach_id']}\" target=\"_blank\"> {$attach['name']}</a> ({$attach['size']} K)"; $ext = strtolower(substr(strrchr($attach['name'], '.'), 1)); if (in_array($ext, array('mp3', 'wma', 'wmv', 'rm', 'swf'))) { $html .= "[<a style=\"cursor:pointer\" onclick=\"playatt('{$attach['attach_id']}');\">试播</a>]"; } break; } return "<span id=\"att_{$attach['attach_id']}\">" . $html . '</span>'; }
function headguide($guidename, $onmouseover = true) { global $db_menu, $db_bbsname, $db_bfn, $imgpath, $db_menu, $db_mode, $db_bbsurl; if (empty($db_mode) && $db_bfn == 'index.php') { $db_bfn_temp = $db_bbsurl . "/index.php?m=bbs"; } else { $db_bfn_temp = $db_bfn; } if ($db_menu && $onmouseover) { $headguide = "<img style=\"cursor:pointer\" id=\"td_cate\" src=\"{$imgpath}/" . L::style('stylepath') . "/thread/home.gif\" onClick=\"return pwForumList(false,false,null,this);\" align=\"absmiddle\" /> <a href=\"{$db_bfn_temp}\" title=\"{$db_bbsname}\">{$db_bbsname}</a>"; } else { $headguide = "<a href=\"{$db_bfn}\" title=\"{$db_bbsname}\">{$db_bbsname}</a>"; } if (!is_array($guidename)) { return $headguide . ' » ' . $guidename; } foreach ($guidename as $key => $value) { if ($value[1]) { $headguide .= ' » <a href="' . $value[1] . '">' . $value[0] . '</a>'; } else { $headguide .= ' » ' . $value[0]; } } return $headguide; }
function getpath($template, $EXT = 'htm') { if (!defined('PWERROR')) { global $appdir; if (defined('A_P') && $appdir && substr($template, 0, 2) == 'm_' && file_exists(A_P . "{$appdir}/template/{$template}.{$EXT}")) { return S::escapePath(A_P . "{$appdir}/template/{$template}.{$EXT}"); } if (defined('F_M')) { $temp = modeEot($template, $EXT); if ($temp) { return S::escapePath($temp); } } } $tplpath = L::style('tplpath'); if (file_exists($this->dir . "{$tplpath}/{$template}.{$EXT}")) { return $this->dir . "{$tplpath}/{$template}.{$EXT}"; } if (file_exists($this->dir . "wind/{$template}.{$EXT}")) { return $this->dir . "wind/{$template}.{$EXT}"; } return false; }