📄 func_forum_post.php
字号:
'</strong></span>';
} else
{
$str .= '<span><input onclick="exchagneIt();return true;" type="radio" name=move[forum] value="' .
$_fid . '"' . (forum_post_pv(array('fid' => $_fid), 't_insert') ? '' :
' disabled="disabled"') . ' />' . html($val['name']) . '</span>';
}
}
} else
{
$str = '<span><input onclick="exchagneIt();return true;" type="radio" name=move[forum] value="0" disabled="disabled" />' .
$GLOBALS['tpl']['鍙栨秷'] . '</span>';
foreach ($data as $_fid => $val)
{
if ($fid == $_fid)
{
$str .= '<span><input onclick="exchagneIt();return true;" type="radio" name=move[forum] value="' .
$_fid . '" disabled="disabled" checked="checked" /><strong>' . html($val['name']) .
'</strong></span>';
} else
{
$str .= '<span><input onclick="exchagneIt();return true;" type="radio" name=move[forum] value="' .
$_fid . '" disabled="disabled" />' . html($val['name']) . '</span>';
}
}
}
}
}
return $str;
}
function forum_p_insert($con = array())
{
$db = db::getinstance();
$db->query("update " . PF . "forum_titles set etime='" . SYSTIME .
"' where tid='$con[tid]'");
upcache('file','forum_' . $con['fid'] . '_p_news');
return true;
}
function forum_t_link($con = array(), $pv = false)
{
$db = db::getinstance();
$db->query("update " . PF . "forum_titles set etime='" . SYSTIME .
"' where tid='$con[lid]'");
return true;
}
function forum_p_update()
{
return true;
}
function forum_l_delete($lid, $tid = false, $fid = false, $pv = false)
{
if (empty($tid) || empty($fid))
{
if (false === ($row = forum_t_select($lid)))
return false;
if (empty($row['lid']))
return false;
$tid = $row['tid'];
$fid = $row['fid'];
}
if (!empty($pv))
{
if (false == forum_post_pv(array('fid' => $fid), 'l_delete'))
return false;
}
$db = db::getinstance();
$db->query("update " . PF . "center_titles set lid='0' where tid='$lid'");
if (!$db->num_rows("select count(*) from " . PF . "center_titles where lid='$tid'"))
{
$db->query("update " . PF . "center_titles set f_link='0' where tid='$tid'");
}
return true;
}
function forum_p_delete($pid, $fid = false, $pv = false)
{
if (!empty($pv))
{
if (empty($fid))
{
if (false === ($row = forum_p_select($pid)))
return false;
$fid = $row['fid'];
}
if (false == forum_post_pv(array('fid' => $fid), 'p_delete'))
return false;
}
delpid($pid);
}
function forum_post_pv($row, $type, &$pv = false)
{
call_func('forum_pv');
switch ($type)
{
case 't_delete':
case 'l_delete':
case 'p_delete':
if (false === ($pv = forum_pv($row['fid'], true)))
return false;
return empty($pv['p4']) ? false:
true;
break;
case 't_insert':
if (false === ($pv = forum_pv($row['fid'], true)))
return false;
return empty($pv['p0']) ? false:
true;
break;
case 't_update':
if (false === ($pv = forum_pv($row['fid'], true)))
return false;
if ($GLOBALS['user']['uid'] == $row['authorid'] && $row['authorid'] > 0)
return true;
return empty($pv['p3']) ? false:
true;
break;
case 'p_insert':
if (false === ($pv = forum_pv($row['fid'], true)))
return false;
return (empty($pv['p1']) || !empty($row['f_lock'])) ? false:
true;
break;
case 't_link':
if (empty($GLOBALS['userpv']['center']['p7']))
return false;
if (false === ($pv = forum_pv($row['fid'], true)))
return false;
if ($GLOBALS['user']['uid'] <> $row['authorid'])
return false;
return true;
break;
case 'p_update':
if (false === ($pv = forum_pv($row['fid'], true)))
return false;
if ($GLOBALS['user']['uid'] == $row['authorid'] && $row['authorid'] > 0)
return true;
return empty($pv['p3']) ? false:
true;
break;
default:
return false;
break;
}
}
function forum_show($ps)
{
$tid = $ps['tid'];
$pid = $ps['pid'];
$url = '';
$db = db::getinstance();
$conf = read_config('forum_config');
if (empty($pid))
{
$tids = array();
$tids[0] = 0;
$result = $db->query("select a.tid from " . PF .
"forum_titles as a ,(select fid from " . PF . "forum_titles where tid='$tid') as b where a.fid=b.fid order by a.etime desc");
while ($row = $db->fetch_array($result))
{
$tids[] = $row['tid'];
}
$key = array_search($tid, $tids);
if (false === $key)
return false;
$conf[3] = intval($conf[3]);
for ($i = 0, $fpage = 0; $i < $key; $i += $conf[3], $fpage++)
;
return RT . '?mod=forum&file=showps&tid=' . $tid . '&fpage=' . $fpage .
'&toa=0';
} else
{
$fpage=abs(intval($_GET['fpage']));
$fpage<1 && $fpage=1;
$pids = array();
$pids[0] = '';
$result = $db->query("select pid from " . PF . "center_posts where tid='$tid' order by ptime");
while ($row = $db->fetch_array($result))
{
$pids[] = $row['pid'];
}
$key = array_search($pid, $pids);
for ($i = 0, $tpage = 0; $i < $key; $i += $conf[4], $tpage++)
;
return RT . '?mod=forum&file=showps&tid=' . $tid . '&fpage=' . $fpage .
'&tpage=' . $tpage . '&toa=' . $key;
}
}
function forum_epost($con, $pv, $type)
{
global $user;
$tpl=LANG('forum','_post');
if ($type > 2)
return array();
$_menujs = ',sell: [true, sell, false ]';
$_funjs = "function sell(cmdID) {
editor.focusEditor();
text = editor.getsel();
sm = '['+cmdID+']'+text+'[/'+cmdID+']';
AddCode(sm,text);
}
";
$_menulist = '<span title="'.$tpl['鍑哄敭鍐呭
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -