Zeile 707 | Zeile 707 |
---|
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 1303 | Zeile 1304 |
---|
} 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 1425 |
---|
"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 1463 |
---|
}
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 1492 |
---|
} } 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),
|