Zeile 90 | Zeile 90 |
---|
} break; case "forum":
|
} break; case "forum":
|
$sortfield = "t.fid";
| $sortfield = "f.name";
|
break; case "starter": if($search['resulttype'] == "threads")
| break; case "starter": if($search['resulttype'] == "threads")
|
Zeile 352 | Zeile 352 |
---|
SELECT t.*, u.username AS userusername FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
|
SELECT t.*, u.username AS userusername FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
|
| LEFT JOIN ".TABLE_PREFIX."forums f ON (t.fid=f.fid)
|
WHERE $where_conditions AND {$unapproved_where} {$permsql} AND t.closed NOT LIKE 'moved|%' ORDER BY $sortfield $order LIMIT $start, $perpage
| WHERE $where_conditions AND {$unapproved_where} {$permsql} AND t.closed NOT LIKE 'moved|%' ORDER BY $sortfield $order LIMIT $start, $perpage
|
Zeile 523 | Zeile 524 |
---|
} if($thread['closed'] == 1) {
|
} if($thread['closed'] == 1) {
|
$folder .= "lock"; $folder_label .= $lang->icon_lock;
| $folder .= "close"; $folder_label .= $lang->icon_close;
|
} $folder .= "folder";
| } $folder .= "folder";
|
Zeile 707 | Zeile 708 |
---|
while($tool = $db->fetch_array($query)) {
|
while($tool = $db->fetch_array($query)) {
|
| $tool['name'] = htmlspecialchars_uni($tool['name']);
|
eval("\$customthreadtools .= \"".$templates->get("search_results_threads_inlinemoderation_custom_tool")."\";"); } // Build inline moderation dropdown
| eval("\$customthreadtools .= \"".$templates->get("search_results_threads_inlinemoderation_custom_tool")."\";"); } // Build inline moderation dropdown
|
Zeile 888 | Zeile 890 |
---|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
|
FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid)
|
| LEFT JOIN ".TABLE_PREFIX."forums f ON (t.fid=f.fid)
|
WHERE p.pid IN (".$db->escape_string($search['posts']).") ORDER BY $sortfield $order LIMIT $start, $perpage
| WHERE p.pid IN (".$db->escape_string($search['posts']).") ORDER BY $sortfield $order LIMIT $start, $perpage
|
Zeile 1016 | Zeile 1019 |
---|
} if($post['thread_closed'] == 1) {
|
} if($post['thread_closed'] == 1) {
|
$folder .= "lock"; $folder_label .= $lang->icon_lock;
| $folder .= "close"; $folder_label .= $lang->icon_close;
|
} $folder .= "folder";
| } $folder .= "folder";
|
Zeile 1303 | Zeile 1306 |
---|
} elseif($mybb->input['action'] == "finduserthreads") {
|
} elseif($mybb->input['action'] == "finduserthreads") {
|
$where_sql = "t.uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'";
$unsearchforums = get_unsearchable_forums(); if($unsearchforums) { $where_sql .= " AND t.fid NOT IN ($unsearchforums)"; } $inactiveforums = get_inactive_forums(); if($inactiveforums) { $where_sql .= " AND t.fid NOT IN ($inactiveforums)"; }
$permsql = ""; $onlyusfids = array();
// Check group permissions if we can't view threads not started by us $group_permissions = forum_permissions(); foreach($group_permissions as $fid => $forum_permissions) { if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1) { $onlyusfids[] = $fid; }
| $where_sql = "uid='".$mybb->get_input('uid', MyBB::INPUT_INT)."'";
$unsearchforums = get_unsearchable_forums(); if($unsearchforums) { $where_sql .= " AND fid NOT IN ($unsearchforums)"; } $inactiveforums = get_inactive_forums(); if($inactiveforums) { $where_sql .= " AND fid NOT IN ($inactiveforums)"; }
$permsql = ""; $onlyusfids = array();
// Check group permissions if we can't view threads not started by us $group_permissions = forum_permissions(); foreach($group_permissions as $fid => $forum_permissions) { if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1) { $onlyusfids[] = $fid; } } if(!empty($onlyusfids)) { $where_sql .= "AND ((fid IN(".implode(',', $onlyusfids).") AND uid='{$mybb->user['uid']}') OR fid NOT IN(".implode(',', $onlyusfids)."))"; }
$tids = ''; $comma = ''; $query = $db->simple_select("threads", "tid", $where_sql); while($tid = $db->fetch_field($query, "tid")) { $tids .= $comma.$tid; $comma = ','; }
$sid = md5(uniqid(microtime(), true)); $searcharray = array( "sid" => $db->escape_string($sid), "uid" => $mybb->user['uid'], "dateline" => TIME_NOW, "ipaddress" => $db->escape_binary($session->packedip), "threads" => $db->escape_string($tids), "posts" => '', "resulttype" => "threads", "querycache" => $db->escape_string($where_sql), "keywords" => '' ); $plugins->run_hooks("search_do_search_process"); $db->insert_query("searchlog", $searcharray); redirect("search.php?action=results&sid=".$sid, $lang->redirect_searchresults); } elseif($mybb->input['action'] == "getnew") {
$where_sql = "lastpost >= '".(int)$mybb->user['lastvisit']."'";
if($mybb->get_input('fid', MyBB::INPUT_INT)) { $where_sql .= " AND fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'"; } else if($mybb->get_input('fids')) { $fids = explode(',', $mybb->get_input('fids')); foreach($fids as $key => $fid) { $fids[$key] = (int)$fid; }
if(!empty($fids)) { $where_sql .= " AND fid IN (".implode(',', $fids).")"; } }
$unsearchforums = get_unsearchable_forums(); if($unsearchforums) { $where_sql .= " AND fid NOT IN ($unsearchforums)"; } $inactiveforums = get_inactive_forums(); if($inactiveforums) { $where_sql .= " AND fid NOT IN ($inactiveforums)"; }
$permsql = ""; $onlyusfids = array();
// Check group permissions if we can't view threads not started by us $group_permissions = forum_permissions(); foreach($group_permissions as $fid => $forum_permissions) { if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1) { $onlyusfids[] = $fid; }
|
} if(!empty($onlyusfids)) {
|
} if(!empty($onlyusfids)) {
|
$where_sql .= "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";
| $where_sql .= "AND ((fid IN(".implode(',', $onlyusfids).") AND uid='{$mybb->user['uid']}') OR fid NOT IN(".implode(',', $onlyusfids)."))"; } $tids = ''; $comma = ''; $query = $db->simple_select("threads", "tid", $where_sql); while($tid = $db->fetch_field($query, "tid")) { $tids .= $comma.$tid; $comma = ',';
|
}
$sid = md5(uniqid(microtime(), true));
| }
$sid = md5(uniqid(microtime(), true));
|
Zeile 1339 | Zeile 1427 |
---|
"uid" => $mybb->user['uid'], "dateline" => TIME_NOW, "ipaddress" => $db->escape_binary($session->packedip),
|
"uid" => $mybb->user['uid'], "dateline" => TIME_NOW, "ipaddress" => $db->escape_binary($session->packedip),
|
"threads" => '',
| "threads" => $db->escape_string($tids),
|
"posts" => '', "resulttype" => "threads", "querycache" => $db->escape_string($where_sql), "keywords" => '' );
|
"posts" => '', "resulttype" => "threads", "querycache" => $db->escape_string($where_sql), "keywords" => '' );
|
|
|
$plugins->run_hooks("search_do_search_process"); $db->insert_query("searchlog", $searcharray); redirect("search.php?action=results&sid=".$sid, $lang->redirect_searchresults); }
|
$plugins->run_hooks("search_do_search_process"); $db->insert_query("searchlog", $searcharray); redirect("search.php?action=results&sid=".$sid, $lang->redirect_searchresults); }
|
elseif($mybb->input['action'] == "getnew")
| elseif($mybb->input['action'] == "getdaily")
|
{
|
{
|
$where_sql = "t.lastpost >= '".(int)$mybb->user['lastvisit']."'";
| if($mybb->get_input('days', MyBB::INPUT_INT) < 1) { $days = 1; } else { $days = $mybb->get_input('days', MyBB::INPUT_INT); } $datecut = TIME_NOW-(86400*$days);
$where_sql = "lastpost >='".$datecut."'";
|
if($mybb->get_input('fid', MyBB::INPUT_INT)) {
|
if($mybb->get_input('fid', MyBB::INPUT_INT)) {
|
$where_sql .= " AND t.fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'";
| $where_sql .= " AND fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'";
|
} else if($mybb->get_input('fids')) {
| } else if($mybb->get_input('fids')) {
|
Zeile 1367 | Zeile 1465 |
---|
}
if(!empty($fids))
|
}
if(!empty($fids))
|
{ $where_sql .= " AND t.fid IN (".implode(',', $fids).")"; } }
| { $where_sql .= " AND fid IN (".implode(',', $fids).")"; } }
|
$unsearchforums = get_unsearchable_forums(); if($unsearchforums)
|
$unsearchforums = get_unsearchable_forums(); if($unsearchforums)
|
{ $where_sql .= " AND t.fid NOT IN ($unsearchforums)";
| { $where_sql .= " AND fid NOT IN ($unsearchforums)";
|
} $inactiveforums = get_inactive_forums(); if($inactiveforums) {
|
} $inactiveforums = get_inactive_forums(); if($inactiveforums) {
|
$where_sql .= " AND t.fid NOT IN ($inactiveforums)";
| $where_sql .= " AND fid NOT IN ($inactiveforums)";
|
}
$permsql = "";
| }
$permsql = "";
|
Zeile 1396 | Zeile 1494 |
---|
} } if(!empty($onlyusfids))
|
} } if(!empty($onlyusfids))
|
{ $where_sql .= "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))"; }
$sid = md5(uniqid(microtime(), true)); $searcharray = array( "sid" => $db->escape_string($sid), "uid" => $mybb->user['uid'], "dateline" => TIME_NOW, "ipaddress" => $db->escape_binary($session->packedip), "threads" => '', "posts" => '', "resulttype" => "threads", "querycache" => $db->escape_string($where_sql), "keywords" => '' );
$plugins->run_hooks("search_do_search_process"); $db->insert_query("searchlog", $searcharray); redirect("search.php?action=results&sid=".$sid, $lang->redirect_searchresults); } elseif($mybb->input['action'] == "getdaily") { if($mybb->get_input('days', MyBB::INPUT_INT) < 1) { $days = 1; } else { $days = $mybb->get_input('days', MyBB::INPUT_INT); } $datecut = TIME_NOW-(86400*$days);
$where_sql = "t.lastpost >='".$datecut."'";
if($mybb->get_input('fid', MyBB::INPUT_INT)) { $where_sql .= " AND t.fid='".$mybb->get_input('fid', MyBB::INPUT_INT)."'"; } else if($mybb->get_input('fids')) { $fids = explode(',', $mybb->get_input('fids')); foreach($fids as $key => $fid) { $fids[$key] = (int)$fid; }
if(!empty($fids)) { $where_sql .= " AND t.fid IN (".implode(',', $fids).")"; } }
$unsearchforums = get_unsearchable_forums(); if($unsearchforums) { $where_sql .= " AND t.fid NOT IN ($unsearchforums)"; } $inactiveforums = get_inactive_forums(); if($inactiveforums) { $where_sql .= " AND t.fid NOT IN ($inactiveforums)";
| { $where_sql .= "AND ((fid IN(".implode(',', $onlyusfids).") AND uid='{$mybb->user['uid']}') OR fid NOT IN(".implode(',', $onlyusfids)."))";
|
}
|
}
|
$permsql = ""; $onlyusfids = array();
// Check group permissions if we can't view threads not started by us $group_permissions = forum_permissions(); foreach($group_permissions as $fid => $forum_permissions) { if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1) { $onlyusfids[] = $fid; } } if(!empty($onlyusfids))
| $tids = ''; $comma = ''; $query = $db->simple_select("threads", "tid", $where_sql); while($tid = $db->fetch_field($query, "tid"))
|
{
|
{
|
$where_sql .= "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";
| $tids .= $comma.$tid; $comma = ',';
|
}
|
}
|
|
|
$sid = md5(uniqid(microtime(), true)); $searcharray = array( "sid" => $db->escape_string($sid), "uid" => $mybb->user['uid'], "dateline" => TIME_NOW, "ipaddress" => $db->escape_binary($session->packedip),
|
$sid = md5(uniqid(microtime(), true)); $searcharray = array( "sid" => $db->escape_string($sid), "uid" => $mybb->user['uid'], "dateline" => TIME_NOW, "ipaddress" => $db->escape_binary($session->packedip),
|
"threads" => '',
| "threads" => $db->escape_string($tids),
|
"posts" => '', "resulttype" => "threads", "querycache" => $db->escape_string($where_sql),
| "posts" => '', "resulttype" => "threads", "querycache" => $db->escape_string($where_sql),
|