Zeile 44 | Zeile 44 |
---|
$options = array( "limit" => 1 );
|
$options = array( "limit" => 1 );
|
$query = $db->simple_select("posts", "tid", "pid=".$mybb->get_input('pid', MyBB::INPUT_INT), $options);
| $query = $db->simple_select("posts", "fid,tid,visible", "pid=".$mybb->get_input('pid', MyBB::INPUT_INT), $options);
|
$post = $db->fetch_array($query);
|
$post = $db->fetch_array($query);
|
if(empty($post))
| if(empty($post) || ($post['visible'] == 0 && !is_moderator($post['fid'], 'canviewunapprove')) || ($post['visible'] == -1 && !is_moderator($post['fid'], 'canviewdeleted')))
|
{ // post does not exist --> show corresponding error error($lang->error_invalidpost);
| { // post does not exist --> show corresponding error error($lang->error_invalidpost);
|
Zeile 55 | Zeile 55 |
---|
$mybb->input['tid'] = $post['tid']; }
|
$mybb->input['tid'] = $post['tid']; }
|
}
| }
|
// Get the thread details from the database. $thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));
| // Get the thread details from the database. $thread = get_thread($mybb->get_input('tid', MyBB::INPUT_INT));
|
Zeile 69 | Zeile 69 |
---|
$thread['threadprefix'] = ''; $thread['displayprefix'] = ''; if($thread['prefix'] != 0)
|
$thread['threadprefix'] = ''; $thread['displayprefix'] = ''; if($thread['prefix'] != 0)
|
{
| {
|
$threadprefix = build_prefixes($thread['prefix']);
if(!empty($threadprefix['prefix']))
| $threadprefix = build_prefixes($thread['prefix']);
if(!empty($threadprefix['prefix']))
|
Zeile 115 | Zeile 115 |
---|
{ $visibleonly = " AND visible IN (-1,0,1)"; $visibleonly2 = "AND p.visible IN (-1,0,1) AND t.visible IN (-1,0,1)";
|
{ $visibleonly = " AND visible IN (-1,0,1)"; $visibleonly2 = "AND p.visible IN (-1,0,1) AND t.visible IN (-1,0,1)";
|
}
| }
|
} } else { $ismod = false;
|
} } else { $ismod = false;
|
}
| $visibleonly = " AND visible=1"; $visibleonly2 = "AND p.visible=1 AND t.visible=1"; }
|
// Make sure we are looking at a real thread here. if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] == 0 && !is_moderator($fid, "canviewunapprove")) || ($thread['visible'] == -1 && !is_moderator($fid, "canviewdeleted"))) { error($lang->error_invalidthread);
|
// Make sure we are looking at a real thread here. if(($thread['visible'] != 1 && $ismod == false) || ($thread['visible'] == 0 && !is_moderator($fid, "canviewunapprove")) || ($thread['visible'] == -1 && !is_moderator($fid, "canviewdeleted"))) { error($lang->error_invalidthread);
|
}
| }
|
$forumpermissions = forum_permissions($thread['fid']);
| $forumpermissions = forum_permissions($thread['fid']);
|
Zeile 138 | Zeile 140 |
---|
}
if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
|
}
if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] == 1 && $thread['uid'] != $mybb->user['uid'])
|
{
| {
|
error_no_permission(); }
| error_no_permission(); }
|
Zeile 230 | Zeile 232 |
---|
"limit" => 1, "order_by" => "dateline", "order_dir" => "asc"
|
"limit" => 1, "order_by" => "dateline", "order_dir" => "asc"
|
);
| );
|
$lastread = (int)$lastread; $query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}' {$visibleonly}", $options); $newpost = $db->fetch_array($query);
| $lastread = (int)$lastread; $query = $db->simple_select("posts", "pid", "tid='{$tid}' AND dateline > '{$lastread}' {$visibleonly}", $options); $newpost = $db->fetch_array($query);
|
Zeile 785 | Zeile 787 |
---|
else if($mybb->settings['threadusenetstyle'] == 1) { $defaultmode = 'threaded';
|
else if($mybb->settings['threadusenetstyle'] == 1) { $defaultmode = 'threaded';
|
} else
| } else
|
{ $defaultmode = 'linear'; }
| { $defaultmode = 'linear'; }
|
Zeile 811 | Zeile 813 |
---|
else { $where = " ORDER BY dateline LIMIT 0, 1";
|
else { $where = " ORDER BY dateline LIMIT 0, 1";
|
}
| }
|
$query = $db->query(" SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername FROM ".TABLE_PREFIX."posts p
| $query = $db->query(" SELECT u.*, u.username AS userusername, p.*, f.*, eu.username AS editusername FROM ".TABLE_PREFIX."posts p
|
Zeile 824 | Zeile 826 |
---|
// Choose what pid to display. if(!$mybb->input['pid'])
|
// Choose what pid to display. if(!$mybb->input['pid'])
|
{
| {
|
$mybb->input['pid'] = $showpost['pid']; }
| $mybb->input['pid'] = $showpost['pid']; }
|
Zeile 891 | Zeile 893 |
---|
if(!empty($mybb->input['pid'])) { $post = get_post($mybb->input['pid']);
|
if(!empty($mybb->input['pid'])) { $post = get_post($mybb->input['pid']);
|
if($post)
| if(empty($post) || ($post['visible'] == 0 && !is_moderator($post['fid'], 'canviewunapprove')) || ($post['visible'] == -1 && !is_moderator($post['fid'], 'canviewdeleted'))) { $footer .= '<script type="text/javascript">$(document).ready(function() { $.jGrowl(\''.$lang->error_invalidpost.'\', {theme: \'jgrowl_error\'}); });</script>'; } else
|
{ $query = $db->query(" SELECT COUNT(p.dateline) AS count FROM ".TABLE_PREFIX."posts p
| { $query = $db->query(" SELECT COUNT(p.dateline) AS count FROM ".TABLE_PREFIX."posts p
|
Zeile 1339 | Zeile 1345 |
---|
if(is_moderator($forum['fid'], "canopenclosethreads")) { eval("\$openclosethread = \"".$templates->get("showthread_moderationoptions_openclose")."\";");
|
if(is_moderator($forum['fid'], "canopenclosethreads")) { eval("\$openclosethread = \"".$templates->get("showthread_moderationoptions_openclose")."\";");
|
}
| }
|
if(is_moderator($forum['fid'], "canstickunstickthreads")) { eval("\$stickunstickthread = \"".$templates->get("showthread_moderationoptions_stickunstick")."\";");
|
if(is_moderator($forum['fid'], "canstickunstickthreads")) { eval("\$stickunstickthread = \"".$templates->get("showthread_moderationoptions_stickunstick")."\";");
|
}
| }
|
if(is_moderator($forum['fid'], "candeletethreads"))
|
if(is_moderator($forum['fid'], "candeletethreads"))
|
{
| {
|
eval("\$deletethread = \"".$templates->get("showthread_moderationoptions_delete")."\";");
|
eval("\$deletethread = \"".$templates->get("showthread_moderationoptions_delete")."\";");
|
}
| }
|
if(is_moderator($forum['fid'], "canmanagethreads")) { eval("\$threadnotes = \"".$templates->get("showthread_moderationoptions_threadnotes")."\";"); eval("\$managethread = \"".$templates->get("showthread_moderationoptions_manage")."\";");
|
if(is_moderator($forum['fid'], "canmanagethreads")) { eval("\$threadnotes = \"".$templates->get("showthread_moderationoptions_threadnotes")."\";"); eval("\$managethread = \"".$templates->get("showthread_moderationoptions_manage")."\";");
|
}
| }
|
if($pollbox && is_moderator($forum['fid'], "canmanagepolls")) { eval("\$adminpolloptions = \"".$templates->get("showthread_moderationoptions_deletepoll")."\";"); }
if(is_moderator($forum['fid'], "canapproveunapprovethreads"))
|
if($pollbox && is_moderator($forum['fid'], "canmanagepolls")) { eval("\$adminpolloptions = \"".$templates->get("showthread_moderationoptions_deletepoll")."\";"); }
if(is_moderator($forum['fid'], "canapproveunapprovethreads"))
|
{
| {
|
if($thread['visible'] == 0)
|
if($thread['visible'] == 0)
|
{
| {
|
$approveunapprovethread = "<option value=\"approvethread\">".$lang->approve_thread."</option>"; } else
| $approveunapprovethread = "<option value=\"approvethread\">".$lang->approve_thread."</option>"; } else
|
Zeile 1377 | Zeile 1383 |
---|
if(is_moderator($forum['fid'], "cansoftdeletethreads") && $thread['visible'] != -1) { eval("\$softdeletethread = \"".$templates->get("showthread_moderationoptions_softdelete")."\";");
|
if(is_moderator($forum['fid'], "cansoftdeletethreads") && $thread['visible'] != -1) { eval("\$softdeletethread = \"".$templates->get("showthread_moderationoptions_softdelete")."\";");
|
}
| }
|
elseif(is_moderator($forum['fid'], "canrestorethreads") && $thread['visible'] == -1) { eval("\$softdeletethread = \"".$templates->get("showthread_moderationoptions_restore")."\";");
| elseif(is_moderator($forum['fid'], "canrestorethreads") && $thread['visible'] == -1) { eval("\$softdeletethread = \"".$templates->get("showthread_moderationoptions_restore")."\";");
|
Zeile 1386 | Zeile 1392 |
---|
if(!empty($openclosethread) || !empty($stickunstickthread) || !empty($deletethread) || !empty($managethread) || !empty($adminpolloptions) || !empty($approveunapprovethread) || !empty($softdeletethread)) { eval("\$standardthreadtools = \"".$templates->get("showthread_moderationoptions_standard")."\";");
|
if(!empty($openclosethread) || !empty($stickunstickthread) || !empty($deletethread) || !empty($managethread) || !empty($adminpolloptions) || !empty($approveunapprovethread) || !empty($softdeletethread)) { eval("\$standardthreadtools = \"".$templates->get("showthread_moderationoptions_standard")."\";");
|
}
| }
|
// Only show mod menu if there's any options to show if(!empty($standardthreadtools) || !empty($customthreadtools)) { eval("\$moderationoptions = \"".$templates->get("showthread_moderationoptions")."\";"); }
|
// Only show mod menu if there's any options to show if(!empty($standardthreadtools) || !empty($customthreadtools)) { eval("\$moderationoptions = \"".$templates->get("showthread_moderationoptions")."\";"); }
|
}
| }
|
// Display 'send thread' link if permissions allow $sendthread = ''; if($mybb->usergroup['cansendemail'] == 1)
| // Display 'send thread' link if permissions allow $sendthread = ''; if($mybb->usergroup['cansendemail'] == 1)
|
Zeile 1408 | Zeile 1414 |
---|
if(!$thread['poll'] && ($thread['uid'] == $mybb->user['uid'] || $ismod == true) && $forumpermissions['canpostpolls'] == 1 && $forum['open'] != 0 && $thread['closed'] != 1 && ($ismod == true || $thread['dateline'] > ($time-($mybb->settings['polltimelimit']*60*60)) || $mybb->settings['polltimelimit'] == 0)) { eval("\$addpoll = \"".$templates->get("showthread_add_poll")."\";");
|
if(!$thread['poll'] && ($thread['uid'] == $mybb->user['uid'] || $ismod == true) && $forumpermissions['canpostpolls'] == 1 && $forum['open'] != 0 && $thread['closed'] != 1 && ($ismod == true || $thread['dateline'] > ($time-($mybb->settings['polltimelimit']*60*60)) || $mybb->settings['polltimelimit'] == 0)) { eval("\$addpoll = \"".$templates->get("showthread_add_poll")."\";");
|
}
| }
|
// Subscription status $add_remove_subscription = 'add'; $add_remove_subscription_text = $lang->subscribe_thread;
| // Subscription status $add_remove_subscription = 'add'; $add_remove_subscription_text = $lang->subscribe_thread;
|
Zeile 1522 | Zeile 1528 |
---|
/** * Build a navigation tree for threaded display. *
|
/** * Build a navigation tree for threaded display. *
|
* @param unknown_type $replyto * @param unknown_type $indent * @return unknown
| * @param int $replyto * @param int $indent * @return string
|
*/
|
*/
|
function buildtree($replyto="0", $indent="0")
| function buildtree($replyto=0, $indent=0)
|
{
|
{
|
global $tree, $mybb, $theme, $mybb, $pid, $tid, $templates, $parser;
| global $tree, $mybb, $theme, $mybb, $pid, $tid, $templates, $parser, $lang;
|
|
|
if($indent) { $indentsize = 13 * $indent; } else { $indentsize = 0; }
| $indentsize = 13 * $indent;
|
++$indent;
|
++$indent;
|
| $posts = '';
|
if(is_array($tree[$replyto])) { foreach($tree[$replyto] as $key => $post)
| if(is_array($tree[$replyto])) { foreach($tree[$replyto] as $key => $post)
|