+ Censorlist was extended - added replacement parametr
+ Fixed bug with DB Size in check_script.php + Deleted a lot of indexes in check_script_data.php + Deleted cache index and forum lastpost section in cache_index.php and cache_forum.php + Fixed other bugs in warnings + Fixed pagination in search.php + Replaced DSF logo to uForum logo + Moved differend elements in skin + Added "WHOIS" option in "Admin/Mod Pool" in view topic + Fixed bug in add warnings: couldn't add warn for admin/mod git-svn-id: https://svn.pioder.pl/uf-svn/uF@29 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
115
search.php
115
search.php
@@ -29,7 +29,7 @@ $default_skin = ViewSkinName();
|
||||
SessDelInvalid();
|
||||
SessRegister();
|
||||
SessDeleteOld();
|
||||
$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id ORDER BY `ptime`";
|
||||
/*$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id ORDER BY `ptime`";
|
||||
$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
@@ -44,11 +44,12 @@ $query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in f
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$count_topic[$result['t_id']]=$result['p_id'];
|
||||
}
|
||||
}*/
|
||||
if (!isset($_GET['content']))
|
||||
{
|
||||
header('Location: search.php?content=posts');
|
||||
}
|
||||
|
||||
//
|
||||
//generate output pages
|
||||
//
|
||||
@@ -60,24 +61,48 @@ else
|
||||
{
|
||||
$limiter = $forum_config['limit_ftid'];
|
||||
}
|
||||
if (isset($_GET['page'])&&($_GET['page']!=1))
|
||||
if ($_GET['content'] == 'userposts' || $_GET['content'] == 'lastposts')
|
||||
{
|
||||
if (!is_numeric($_GET['page']))
|
||||
if (isset($_GET['page'])&&($_GET['page']!=1))
|
||||
{
|
||||
die('Hacking attempt');
|
||||
if (!is_numeric($_GET['page']))
|
||||
{
|
||||
die('Hacking attempt');
|
||||
}
|
||||
$value = ($_GET['page']-1)*$limiter;
|
||||
$limit = 'LIMIT '.$value . ', '.$limiter;
|
||||
$page = $_GET['page'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$limit = 'LIMIT 0, '.$limiter;
|
||||
$page=1;
|
||||
}
|
||||
$value = ($_GET['page']-1)*$limiter;
|
||||
$limit = 'LIMIT '.$value . ', '.$limiter;
|
||||
$page = $_GET['page'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$limit = 'LIMIT 0, '.$limiter;
|
||||
$page=1;
|
||||
if (isset($_POST['page'])&&($_POST['page']!=1))
|
||||
{
|
||||
if (!is_numeric($_POST['page']))
|
||||
{
|
||||
die('Hacking attempt');
|
||||
}
|
||||
$value = ($_POST['page']-1)*$limiter;
|
||||
$limit = 'LIMIT '.$value . ', '.$limiter;
|
||||
$page = $_POST['page'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$limit = 'LIMIT 0, '.$limiter;
|
||||
$page=1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//end generating pages
|
||||
//
|
||||
|
||||
if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['content']=='userposts'))
|
||||
{
|
||||
$errors = true;
|
||||
@@ -88,10 +113,26 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
|
||||
if ($_SESSION['uid']>0)
|
||||
{
|
||||
$time = time()-129600;
|
||||
$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id WHERE lastpost_time>$time ORDER BY `sticky` DESC, `lastpost_time` DESC LIMIT 60;";
|
||||
$sql = "SELECT COUNT(`t_id`) as `cnt` FROM ".TOPICS_TABLE." WHERE lastpost_time>$time";
|
||||
$count = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain count amout of topics'));
|
||||
$count = $count['cnt'];
|
||||
$count = ceil($count / $limiter);
|
||||
if ($count==0)
|
||||
{
|
||||
$count +=1;
|
||||
}
|
||||
if(isset($_GET['page']) && ($_GET['page']>$count))
|
||||
{
|
||||
message_forum($lng['invalidpage'],'index.php');
|
||||
}
|
||||
$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".*, ".TOPICS_TABLE.".posts AS posts
|
||||
FROM ".TOPICS_TABLE."
|
||||
LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id
|
||||
WHERE lastpost_time>$time
|
||||
ORDER BY `sticky` DESC, `lastpost_time` DESC $limit";
|
||||
$errors = false;
|
||||
$window_title = $lng['showlast30posts'];
|
||||
$navigator_title = '</a>> <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['showlast30posts'];
|
||||
$window_title = $lng['showlastposts'];
|
||||
$navigator_title = '</a>> <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['showlastposts'];
|
||||
break;
|
||||
}
|
||||
else
|
||||
@@ -138,9 +179,13 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
|
||||
{
|
||||
$like_where .=' OR `text` LIKE \'%'.$keyword[$i].'%\'';
|
||||
}
|
||||
$sql = "SELECT COUNT(".TOPICS_TABLE.".t_id) as `count`, ".POSTS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".POSTS_TABLE." ON ".POSTS_TABLE.".t_id = ".TOPICS_TABLE.".t_id WHERE $like_where GROUP BY `t_id`";
|
||||
$count = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain count amout of topics'));
|
||||
$count = $count['count'];
|
||||
$sql = "SELECT ".POSTS_TABLE.".t_id, ".POSTS_TABLE.".text
|
||||
FROM ".TOPICS_TABLE."
|
||||
LEFT JOIN ".POSTS_TABLE." ON ".POSTS_TABLE.".t_id = ".TOPICS_TABLE.".t_id
|
||||
WHERE $like_where GROUP BY `t_id`";
|
||||
echo $sql;
|
||||
$count = DataBase::sql_query($sql,GENERAL,'Could not obtain count amout of topics');
|
||||
$count = DataBase::num_rows($count);//$count['count'];
|
||||
$count = ceil($count / $limiter);
|
||||
if ($count==0)
|
||||
{
|
||||
@@ -150,7 +195,13 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
|
||||
{
|
||||
message_forum($lng['invalidpage'],'index.php');
|
||||
}
|
||||
$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".*, ".POSTS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id LEFT JOIN ".POSTS_TABLE." ON ".POSTS_TABLE.".t_id = ".TOPICS_TABLE.".t_id WHERE $like_where ORDER BY `sticky` DESC, `lastpost_time` DESC $limit;";
|
||||
$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".*, ".POSTS_TABLE.".*, ".TOPICS_TABLE.".posts AS posts
|
||||
FROM ".TOPICS_TABLE."
|
||||
LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id
|
||||
LEFT JOIN ".POSTS_TABLE." ON ".POSTS_TABLE.".t_id = ".TOPICS_TABLE.".t_id
|
||||
WHERE $like_where
|
||||
ORDER BY `sticky` DESC, `lastpost_time` DESC $limit;";
|
||||
|
||||
$window_title = $lng['search_results'];
|
||||
$navigator_title = '</a>> <a href="'.$_SERVER['REQUEST_URI'].'" class="navigator">'.$lng['search_results'];
|
||||
$errors = false;
|
||||
@@ -187,12 +238,13 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
|
||||
{
|
||||
if (!in_array($record['t_id'], $isset_topics))
|
||||
{
|
||||
$last_post = explode(':', $record['lastpost']);
|
||||
$skin = array(
|
||||
't_id'=>$record['t_id'],
|
||||
'fname'=>($record['sticky']=='1') ? '<b>'.$lng['sticky'].'</b>'.$record['name'] : $record['name'],
|
||||
'author'=>Topic::TopicAuthor($record['author']),
|
||||
'new_post'=>Topic::LastPostImg(),
|
||||
'tposts'=>$count_topic[$record['t_id']],
|
||||
'tposts'=>$record['posts'],
|
||||
'lastpost'=>Topic::LastPostInTopic($record['t_id'])
|
||||
);
|
||||
include('./skins/'.$default_skin.'/forum_forum_add.tpl');
|
||||
@@ -204,20 +256,21 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
|
||||
{
|
||||
echo '<tr><td width="'.TABLES_WIDTH.'" colspan="10" height="19" class="fitem"><p class="fstandard" align="center">'.$lng['nopost'].'!</p></td></tr>';
|
||||
}
|
||||
if ($_GET['content']=='lastposts')
|
||||
{
|
||||
echo '</table>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$skin = array(
|
||||
'option_pages' => AddPages(),
|
||||
'lwith' => $lng['with'],
|
||||
'lpage' => $lng['page'],
|
||||
'lpages' => $count,
|
||||
$skin = array(
|
||||
'option_pages' => AddPages(),
|
||||
'lwith' => $lng['with'],
|
||||
'lpage' => $lng['page'],
|
||||
'lpages' => $count,
|
||||
);
|
||||
include('./skins/'.$default_skin.'/search_end_body.tpl');
|
||||
}
|
||||
|
||||
if ($_GET['content']=='posts')
|
||||
{
|
||||
$skin['keywords'] = $_POST['keywords'];
|
||||
}
|
||||
|
||||
include('./skins/'.$default_skin.'/search_end_body.tpl');
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user