Zeile 1 | Zeile 1 |
---|
<?php /** * MyBB 1.4
|
<?php /** * MyBB 1.4
|
* Copyright � 2008 MyBB Group, All Rights Reserved
| * Copyright © 2008 MyBB Group, All Rights Reserved
|
* * Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* * Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: search.php 4352 2009-04-18 22:25:55Z Tikitiki $
| * $Id: search.php 4505 2009-11-13 15:59:56Z Tomm $
|
*/
| */
|
Zeile 48 | Zeile 48 |
---|
$limitsql = ""; if(intval($mybb->settings['searchhardlimit']) > 0) {
|
$limitsql = ""; if(intval($mybb->settings['searchhardlimit']) > 0) {
|
$limitsql = "LIMIT ".intval($mybb->settings['searchhardlimit']);
| $limitsql = "ORDER BY t.dateline DESC LIMIT ".intval($mybb->settings['searchhardlimit']);
|
}
if($mybb->input['action'] == "results")
| }
if($mybb->input['action'] == "results")
|
Zeile 629 | Zeile 629 |
---|
$test_moderated_forums[$forum['fid']] = $forum['fid']; } $p_unapproved_where = "visible >= 0";
|
$test_moderated_forums[$forum['fid']] = $forum['fid']; } $p_unapproved_where = "visible >= 0";
|
$t_unapproved_where = "visible < 0 OR fid NOT IN ({$moderated_forums})";
| $t_unapproved_where = "visible < 0 AND fid NOT IN ({$moderated_forums})";
|
} else { // Normal users $p_unapproved_where = 'visible=1'; $t_unapproved_where = 'visible < 1';
|
} else { // Normal users $p_unapproved_where = 'visible=1'; $t_unapproved_where = 'visible < 1';
|
}
| }
$post_cache_options = array(); if(intval($mybb->settings['searchhardlimit']) > 0) { $post_cache_options['limit'] = intval($mybb->settings['searchhardlimit']); } if(strpos($sortfield, 'p.') !== false) { $post_cache_options['order_by'] = str_replace('p.', '', $sortfield); $post_cache_options['order_dir'] = $order; }
|
$tids = array(); $pids = array(); // Make sure the posts we're viewing we have permission to view.
|
$tids = array(); $pids = array(); // Make sure the posts we're viewing we have permission to view.
|
$query = $db->simple_select("posts", "pid, tid", "pid IN(".$db->escape_string($search['posts']).") AND {$p_unapproved_where} {$limitsql}");
| $query = $db->simple_select("posts", "pid, tid", "pid IN(".$db->escape_string($search['posts']).") AND {$p_unapproved_where}", $post_cache_options);
|
while($post = $db->fetch_array($query)) { $pids[$post['pid']] = $post['tid'];
| while($post = $db->fetch_array($query)) { $pids[$post['pid']] = $post['tid'];
|
Zeile 766 | Zeile 777 |
---|
{ $last_read = 1; }
|
{ $last_read = 1; }
|
}
| }
|
}
if($dot_icon[$post['tid']])
| }
if($dot_icon[$post['tid']])
|
Zeile 852 | Zeile 863 |
---|
if(my_strlen($post['message']) > 200) { $prev = my_substr($post['message'], 0, 200)."...";
|
if(my_strlen($post['message']) > 200) { $prev = my_substr($post['message'], 0, 200)."...";
|
}
| }
|
else { $prev = $post['message'];
| else { $prev = $post['message'];
|
Zeile 933 | Zeile 944 |
---|
$where_sql .= " AND fid NOT IN ($inactiveforums)"; }
|
$where_sql .= " AND fid NOT IN ($inactiveforums)"; }
|
| $options = array( 'order_by' => 'dateline', 'order_dir' => 'desc' );
// Do we have a hard search limit? if($mybb->settings['searchhardlimit'] > 0) { $options['limit'] = intval($mybb->settings['searchhardlimit']); }
|
$pids = ''; $comma = '';
|
$pids = ''; $comma = '';
|
$query = $db->simple_select("posts", "pid", "{$where_sql} {$limitsql}");
| $query = $db->simple_select("posts", "pid", "{$where_sql}", $options);
|
while($pid = $db->fetch_field($query, "pid")) { $pids .= $comma.$pid;
|
while($pid = $db->fetch_field($query, "pid")) { $pids .= $comma.$pid;
|
$comma = ',';
| $comma = ',';
|
} $tids = '';
| } $tids = '';
|
Zeile 949 | Zeile 971 |
---|
{ $tids .= $comma.$tid; $comma = ',';
|
{ $tids .= $comma.$tid; $comma = ',';
|
}
| }
|
$sid = md5(uniqid(microtime(), 1)); $searcharray = array( "sid" => $db->escape_string($sid),
| $sid = md5(uniqid(microtime(), 1)); $searcharray = array( "sid" => $db->escape_string($sid),
|
Zeile 981 | Zeile 1003 |
---|
{ $where_sql .= " AND fid NOT IN ($inactiveforums)"; }
|
{ $where_sql .= " AND fid NOT IN ($inactiveforums)"; }
|
| $options = array( 'order_by' => 'dateline', 'order_dir' => 'desc' );
// Do we have a hard search limit? if($mybb->settings['searchhardlimit'] > 0) { $options['limit'] = intval($mybb->settings['searchhardlimit']); }
|
$pids = ''; $comma = '';
|
$pids = ''; $comma = '';
|
$query = $db->simple_select("posts", "pid", "{$where_sql} {$limitsql}");
| $query = $db->simple_select("posts", "pid", "{$where_sql}", $options);
|
while($pid = $db->fetch_field($query, "pid")) { $pids .= $comma.$pid;
| while($pid = $db->fetch_field($query, "pid")) { $pids .= $comma.$pid;
|