📄 side.php
字号:
<?php
!function_exists('getPath') && exit('Forbidden');
foreach ($side_name as $key => $value) {
!$leftdb[$key]['name'] && $leftdb[$key]['name'] = $value;
!$leftdb[$key]['sign'] && $leftdb[$key]['sign'] = $key;
}
$side_order = $lefts = $customdb = $getpath = $_ITEMDB = $_TEMPDB = ${$type} = $attachdb = $attachmentdb = array();
$sidedb = array('icon','notice','calendar','search','info','player','link','comment','archive','lastvisit','userclass');
if ($catetype == 'blog') {
$lefts = array('calendar'=>'0','userclass'=>'1','archive'=>'2','search'=>'3');
} elseif ($catetype == 'photo' || $catetype == 'bookmark' || $catetype == 'goods' || $catetype == 'file' || $catetype == 'music') {
$lefts = array('userclass'=>'0','search'=>'1');
} elseif ($catetype == 'team') {
$lefts = array('icon'=>'0','search'=>'1');
} elseif ($catetype == 'gbook') {
$lefts = array('icon'=>'0','info'=>'1');
}
foreach ($leftdb as $key => $value) {
if ($catetype != 'index') {
if (array_key_exists($key,$lefts)) {
$leftdb[$key]['ifshow'] = $value['ifshow'] = 1;
$leftdb[$key]['order'] = $value['order'] = (int)$lefts[$key];
} else {
$leftdb[$key]['ifshow'] = $value['ifshow'] = 0;
}
}
if ($value['ifshow']) {
$leftdb[$key]['name'] = $value['note'] ? $value['note'] : $value['name'];
$side_order[$key] = (int)$value['order'];
}
}
@asort($side_order);
foreach ($side_order as $key => $value) {
if (!in_array($key,$sidedb)) {
$customdb[] = $key;
$getpath[$key] = 'side_custom';
} else {
$getpath[$key] = "side_$key";
}
$side_order[$key] = $leftdb[$key];
}
unset($leftdb);
list($nowy,$nowm) = explode('-',get_date($timestamp,'Y-n'));
if ($side_order['icon']['ifshow']) {
$blogdb['icon'] = showfacedesign($blogdb['icon']);
$blogdb['age'] = '';
$bdaydb = explode('-',$blogdb['bday']);
foreach ($bdaydb as $key => $value) {
$bdaydb[$key] = (int)$value;
}
if (strlen($bdaydb[0])>3) {
$blogdb['age'] = ($nowy - $bdaydb[0]) - ($bdaydb[1] && ($nowm < $bdaydb[1]) ? 1 : 0);
}
$windgroup['cmduser'] && $blogdb['commend'] = $ilang['cmduser'.$blogdb['commend']];
$hobbydb = unserialize($blogdb['hobbydb']);
empty($hobbydb) && $hobbydb = array();
}
if ($side_order['notice']['ifshow'] || !empty($customdb)) {
$customsql = '';
$side_order['notice']['ifshow'] && $customsql = "'notice'";
foreach ($customdb as $value) {
$customsql .= ($customsql ? ',' : '')."'$value'";
}
if ($customsql) {
$customsql = strpos($customsql,',')===false ? "=$customsql" : " IN ($customsql)";
$query = $db->query("SELECT sign,content FROM pw_lcustom WHERE authorid='$uid' AND sign$customsql");
while ($rt = $db->fetch_array($query)) {
$rt['content'] = str_replace(array("\r","\n"),array('','<br />'),$rt['content']);
$customdb[$rt['sign']] = $rt['content'];
}
$db->free_result($query);
}
empty($customdb) && $side_order['notice'] = null;
}
if ($side_order['calendar']['ifshow']) {
InitGP(array('y','m'),'G');
$calendar = array();
$ny = !$y ? $nowy : $y;
$nm = !$m ? $nowm : $m;
require_once(R_P.'mod/calendar_mod.php');
$calendar['days'] = calendar($nm,$ny);
$calendar['nm'] = ($nm+1)>12 ? 1 : $nm+1;
$calendar['pm'] = ($nm-1)<1 ? 12 : $nm-1;
$calendar['ny'] = $ny+1;
$calendar['py'] = $ny-1;
$calendar['cur_date'] = get_date($timestamp,'Y n.j D');
}
if ($side_order['userclass']['ifshow']) {
$dirdb = unserialize($blogdb['dirdb']);
$dirdb = $dirdb[$type];
$dirdb[0]['typeid'] = '0';
$dirdb[0]['name'] = 'none';
$select = $L_join = '';
if ($winduid != $uid) {
$select .= ',u.friends';
$L_join .= ' LEFT JOIN pw_user u ON i.uid=u.uid';
}
@include(D_P.'data/cache/wordfb.php');
$_FORBIDDB = (array)$_REPLACE + (array)$_FORBID;
if ($catetype == 'photo' || $catetype == 'goods' || $catetype == 'file' || $catetype == 'music') {
$query = $db->query("SELECT i.itemid,i.dirid,i.author,i.subject,i.ifhide,i.postdate,i.hits,i.ifwordsfb,i.uploads,t.*$select FROM pw_items i LEFT JOIN pw_$type t ON i.itemid=t.itemid$L_join WHERE i.uid='$uid' AND i.type='$type' AND i.ifcheck='1' ORDER BY i.postdate DESC");
while ($rt = $db->fetch_array($query)) {
if ($uid == $winduid || $rt['ifhide']==0 || ($rt['ifhide']==2 && strpos(",$rt[friends],",",$winduid,")!==false)) {
if ($catetype == 'photo' && !$rt['uploads'] && !$rt['absoluteurl']) {
continue;
}
if (!$rt['ifwordsfb']) {
$ifwordsfb = 0;
$cktitle = $rt['subject'];
$ckcontent = $rt['content'];
foreach ($_FORBIDDB as $value) {
$cktitle = N_strireplace($value['word'],$value['wordreplace'],$cktitle);
$ckcontent = N_strireplace($value['word'],$value['wordreplace'],$ckcontent);
}
if ($cktitle != $rt['subject']) {
$rt['subject'] = $cktitle;
$ifwordsfb = 1;
}
if ($ckcontent != $rt['content']) {
$rt['content'] = $ckcontent;
$ifwordsfb = 1;
}
if ($ifwordsfb) {
$db->update("UPDATE pw_items SET ifwordsfb='1',subject='".addslashes($cktitle)."' WHERE itemid='$rt[itemid]'");
$db->update("UPDATE pw_$type SET content='".addslashes($ckcontent)."' WHERE itemid='$rt[itemid]'");
}
}
$rt['ifsign']<2 && $rt['content'] = nl2br($rt['content']);
$blogdb['wshownum'] && $rt['content'] = substrs($rt['content'],$blogdb['wshownum']);
$rt['ifconvert'] && $rt['content'] = convert($rt['content'],$db_post);
$db_copyctrl && $rt['content'] = preg_replace("/<br \/>/eis","copyctrl()",$rt['content']);
$rt['uploads'] = $rt['uploads'] ? unserialize($rt['uploads']) : array();
$_TEMPDB[$rt['dirid']][] = $rt;
}
}
} elseif ($catetype == 'bookmark') {
$dirdb = array();
$query = $db->query("SELECT i.itemid,i.subject,i.postdate,i.ifwordsfb,i.ifhide,i.uploads,b.tags,b.bookmarkurl,b.ifconvert,b.content$select FROM pw_items i LEFT JOIN pw_bookmark b ON i.itemid=b.itemid$L_join WHERE i.uid='$uid' AND i.type='bookmark' AND i.ifcheck='1' ORDER BY i.postdate DESC");
while ($rt = $db->fetch_array($query)) {
if ($uid == $winduid || $rt['ifhide']==0 || ($rt['ifhide']==2 && strpos(",$rt[friends],",",$winduid,")!==false)) {
$rt['tagsdb'] = array();
if ($rt['tags']) {
$taginfo = array_unique(explode(',',$rt['tags']));
foreach ($taginfo as $key => $value) {
if ($value) {
$rt['tagsdb'][$k] = array('name' => $value,'tagname' => rawurlencode($value));
$dirdb[rawurlencode($rt['name'])] = $rt['name'];
}
}
}
$rt['ifsign']<2 && $rt['content'] = nl2br($rt['content']);
$blogdb['wshownum'] && $rt['content'] = substrs($rt['content'],$blogdb['wshownum']);
if (!$rt['ifwordsfb']) {
$ifwordsfb = 0;
$cktitle = $rt['subject'];
$ckcontent = $rt['content'];
foreach ($_FORBIDDB as $value) {
$cktitle = N_strireplace($value['word'],$value['wordreplace'],$cktitle);
$ckcontent = N_strireplace($value['word'],$value['wordreplace'],$ckcontent);
}
if ($cktitle != $rt['subject']) {
$rt['subject'] = $cktitle;
$ifwordsfb = 1;
}
if ($ckcontent != $rt['content']) {
$rt['content'] = $ckcontent;
$ifwordsfb = 1;
}
if ($ifwordsfb) {
$db->update("UPDATE pw_items SET ifwordsfb='1',subject='".addslashes($cktitle)."' WHERE itemid='$rt[itemid]'");
$db->update("UPDATE pw_$type SET content='".addslashes($ckcontent)."' WHERE itemid='$rt[itemid]'");
}
}
$rt['ifconvert'] && $rt['content'] = convert($rt['content'],$db_post);
$db_copyctrl && $rt['content'] = preg_replace("/<br \/>/eis","copyctrl()",$rt['content']);
$rt['uploads'] = $rt['uploads'] ? unserialize($rt['uploads']) : array();
$_TEMPDB[$rt['itemid']] = $rt;
}
}
}
$query && $db->free_result($query);
}
if ($side_order['info']['ifshow']) {
include_once(D_P.'data/cache/level_cache.php');
$_alllevel = $_gdefault+$_gsystem+$_gmember+$_gspecial;
$blogdb['level'] = $_alllevel[$blogdb['groupid']]['title'];
unset($blogdb['groupid'],$blogdb['memberid'],$_alllevel);
$blogdb['rvrc'] = floor($blogdb['rvrc']/10);
$blogdb['onlinetime'] = floor($blogdb['onlinetime']/3600);
$blogdb['rdate'] = get_date($blogdb['regdate'],'Y-m-d');
}
if ($side_order['archive']['ifshow']) {
list($beginy,$beginm) = explode('-',get_date($blogdb['regdate'],'Y-n'));
$archive = array();
for ($i=$beginy;$i<$nowy;$i++) {
for ($j=$beginm;$j<=12;$j++) {
$archive[] = array('y'=>$i,'m'=>$j);
}
$beginm=1;
}
for ($j=$beginm;$j<=$nowm;$j++) {
$archive[] = array('y'=>$nowy,'m'=>$j);
}
}
if ($side_order['player']['ifshow'] && $blogdb['bmusicurl']) {
if (!preg_match('/^http/is',$blogdb['bmusicurl'])) {
$blogdb['bmusicurl'] = $db_blogurl."/$imgpath/skin/".rawurlencode($blogdb['bmusicurl']);
} else {
$blogdb['bmusicurl'] = substr($blogdb['bmusicurl'],0,strrpos($blogdb['bmusicurl'],'/')+1).rawurlencode(substr($blogdb['bmusicurl'],strrpos($blogdb['bmusicurl'],'/')+1));
}
}
if ($side_order['comment']['ifshow'] && $blogdb['commentdb']) {
$commentdb = unserialize($blogdb['commentdb']);
$commentdb = $commentdb[$type];
}
if ($side_order['lastvisit']['ifshow'] && $blogdb['lastvisitdb']) {
$lastvisitdb = unserialize($blogdb['lastvisitdb']);
}
if ($side_order['link']['ifshow'] && $blogdb['link']) {
$linkdb = unserialize($blogdb['link']);
}
include_once(getPath('side'));
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -