Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: search.php 5160 2010-08-01 09:46:26Z RyanGordon $
| * $Id: search.php 5765 2012-03-27 09:52:45Z Tomm $
|
*/
| */
|
Zeile 184 | Zeile 184 |
---|
ORDER BY pid, disporder ");
|
ORDER BY pid, disporder ");
|
$forumsread = unserialize($mybb->cookies['mybb']['forumread']);
| $forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
|
} else {
| } else {
|
Zeile 197 | Zeile 197 |
---|
ORDER BY pid, disporder "); }
|
ORDER BY pid, disporder "); }
|
|
|
while($forum = $db->fetch_array($query)) { if($mybb->user['uid'] == 0)
| while($forum = $db->fetch_array($query)) { if($mybb->user['uid'] == 0)
|
Zeile 243 | Zeile 244 |
---|
// Normal moderators $moderated_forums = '0'; while($forum = $db->fetch_array($query))
|
// Normal moderators $moderated_forums = '0'; while($forum = $db->fetch_array($query))
|
{
| {
|
$moderated_forums .= ','.$forum['fid']; } $unapproved_where = "(t.visible>0 OR (t.visible=0 AND t.fid IN ({$moderated_forums})))";
| $moderated_forums .= ','.$forum['fid']; } $unapproved_where = "(t.visible>0 OR (t.visible=0 AND t.fid IN ({$moderated_forums})))";
|
Zeile 270 | Zeile 271 |
---|
$search['threads'] = implode(",", $threads); } // No results.
|
$search['threads'] = implode(",", $threads); } // No results.
|
else { error($lang->error_nosearchresults); } $where_conditions = "t.tid IN (".$search['threads'].")"; }
| else { error($lang->error_nosearchresults); } $where_conditions = "t.tid IN (".$search['threads'].")"; }
|
// This search doesn't use a query cache, results stored in search table. else {
| // This search doesn't use a query cache, results stored in search table. else {
|
Zeile 288 | Zeile 289 |
---|
error($lang->error_nosearchresults); } $threadcount = $count['resultcount'];
|
error($lang->error_nosearchresults); } $threadcount = $count['resultcount'];
|
| } $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($forum_permissions['canonlyviewownthreads'] == 1) { $onlyusfids[] = $fid; } } if(!empty($onlyusfids)) { $permsql .= "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))"; } $unsearchforums = get_unsearchable_forums(); if($unsearchforums) { $permsql .= " AND t.fid NOT IN ($unsearchforums)"; } $inactiveforums = get_inactive_forums(); if($inactiveforums) { $permsql .= " AND t.fid NOT IN ($inactiveforums)";
|
} // Begin selecting matching threads, cache them.
| } // Begin selecting matching threads, cache them.
|
Zeile 302 | Zeile 331 |
---|
FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid) LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix)
|
FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid) LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix)
|
WHERE $where_conditions AND {$unapproved_where} AND t.closed NOT LIKE 'moved|%'
| WHERE $where_conditions AND {$unapproved_where} {$permsql} AND t.closed NOT LIKE 'moved|%'
|
ORDER BY $sortfield $order LIMIT $start, $perpage ");
| ORDER BY $sortfield $order LIMIT $start, $perpage ");
|
Zeile 416 | Zeile 445 |
---|
else { $last_read = $read_cutoff;
|
else { $last_read = $read_cutoff;
|
} } else
| } } else
|
{ $last_read = my_get_array_cookie("threadread", $thread['tid']); }
| { $last_read = my_get_array_cookie("threadread", $thread['tid']); }
|
Zeile 526 | Zeile 555 |
---|
}
// If this user is the author of the thread and it is not closed or they are a moderator, they can edit
|
}
// If this user is the author of the thread and it is not closed or they are a moderator, they can edit
|
if(($thread['uid'] == $mybb->user['uid'] && $thread['closed'] != 1 && $mybb->user['uid'] != 0 && $fpermissions[$thread['fid']]['caneditposts'] == 1) || is_moderator($fid, "caneditposts"))
| if(($thread['uid'] == $mybb->user['uid'] && $thread['closed'] != 1 && $mybb->user['uid'] != 0 && $fpermissions[$thread['fid']]['caneditposts'] == 1) || is_moderator($thread['fid'], "caneditposts"))
|
{ $inline_edit_class = "subject_editable"; }
| { $inline_edit_class = "subject_editable"; }
|
Zeile 566 | Zeile 595 |
---|
elseif($is_mod) { eval("\$inline_mod_checkbox = \"".$templates->get("search_results_threads_nocheck")."\";");
|
elseif($is_mod) { eval("\$inline_mod_checkbox = \"".$templates->get("search_results_threads_nocheck")."\";");
|
}
| }
|
$plugins->run_hooks("search_results_thread"); eval("\$results .= \"".$templates->get("search_results_threads_thread")."\";"); }
| $plugins->run_hooks("search_results_thread"); eval("\$results .= \"".$templates->get("search_results_threads_thread")."\";"); }
|
Zeile 714 | Zeile 743 |
---|
// And now we have our sanatized post list $search['posts'] = implode(',', array_keys($pids));
|
// And now we have our sanatized post list $search['posts'] = implode(',', array_keys($pids));
|
|
|
$tids = implode(",", array_keys($tids)); // Read threads
| $tids = implode(",", array_keys($tids)); // Read threads
|
Zeile 724 | Zeile 753 |
---|
while($readthread = $db->fetch_array($query)) { $readthreads[$readthread['tid']] = $readthread['dateline'];
|
while($readthread = $db->fetch_array($query)) { $readthreads[$readthread['tid']] = $readthread['dateline'];
|
}
| }
|
}
$dot_icon = array();
| }
$dot_icon = array();
|
Zeile 788 | Zeile 817 |
---|
$donenew = 0; $last_read = 0; $post['thread_lastread'] = $readthreads[$post['tid']];
|
$donenew = 0; $last_read = 0; $post['thread_lastread'] = $readthreads[$post['tid']];
|
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'] && $post['thread_lastpost'] > $forumread)
| if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid']) { $forum_read = $readforums[$post['fid']]; $read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($forum_read == 0 || $forum_read < $read_cutoff) { $forum_read = $read_cutoff; } } else { $forum_read = $forumsread[$post['fid']]; }
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'] && $post['thread_lastpost'] > $forum_read)
|
{ $cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($post['thread_lastpost'] > $cutoff)
| { $cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($post['thread_lastpost'] > $cutoff)
|
Zeile 813 | Zeile 858 |
---|
if(!$last_read) { $readcookie = $threadread = my_get_array_cookie("threadread", $post['tid']);
|
if(!$last_read) { $readcookie = $threadread = my_get_array_cookie("threadread", $post['tid']);
|
if($readcookie > $forumread)
| if($readcookie > $forum_read)
|
{ $last_read = $readcookie; }
|
{ $last_read = $readcookie; }
|
elseif($forumread > $mybb->user['lastvisit'])
| elseif($forum_read > $mybb->user['lastvisit'])
|
{
|
{
|
$last_read = $forumread;
| $last_read = $forum_read;
|
} else {
| } else {
|