radiohotforum
02-16-2009, 03:22 PM
Your my last resort
All I want is to make it ajax refresh every 30 seconds
heres the code I have edited to make the current refresh. I just want it to do a ajax or java refresh
//-- Refresh new posts search every 5 seconds
//-- Add:
if ($search_id == 'newposts')
{
meta_refresh(120, append_sid($phpbb_root_path . 'search.' . $phpEx, array('search_id' => 'newposts')));
}
//-- End Refresh new posts search every 5 seconds
$time_limit = time() - (7 * 86400);
if ($show_results == 'posts')
{
$sql = 'SELECT p.post_id
FROM ' . POSTS_TABLE . ' p
WHERE p.post_time > ' . $time_limit . "
$m_approve_fid_sql
" . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
$sql_sort";
$field = 'post_id';
}
else
{
$sql = 'SELECT t.topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE t.topic_last_post_time > ' . $time_limit . '
AND t.topic_moved_id = 0
' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . "
$sql_sort";
$field = 'topic_id';
}
if ($search_id == 'newposts')
{
$result = $db->sql_query_limit($sql, 31 - $start, $start);
}
else
{
// only return up to 1000 ids (the last one will be removed later)
$result = $db->sql_query_limit($sql, 1001 - $start, $start);
}
I need to add a ajax refresh where do I add it??
All I want is to make it ajax refresh every 30 seconds
heres the code I have edited to make the current refresh. I just want it to do a ajax or java refresh
//-- Refresh new posts search every 5 seconds
//-- Add:
if ($search_id == 'newposts')
{
meta_refresh(120, append_sid($phpbb_root_path . 'search.' . $phpEx, array('search_id' => 'newposts')));
}
//-- End Refresh new posts search every 5 seconds
$time_limit = time() - (7 * 86400);
if ($show_results == 'posts')
{
$sql = 'SELECT p.post_id
FROM ' . POSTS_TABLE . ' p
WHERE p.post_time > ' . $time_limit . "
$m_approve_fid_sql
" . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
$sql_sort";
$field = 'post_id';
}
else
{
$sql = 'SELECT t.topic_id
FROM ' . TOPICS_TABLE . ' t
WHERE t.topic_last_post_time > ' . $time_limit . '
AND t.topic_moved_id = 0
' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . "
$sql_sort";
$field = 'topic_id';
}
if ($search_id == 'newposts')
{
$result = $db->sql_query_limit($sql, 31 - $start, $start);
}
else
{
// only return up to 1000 ids (the last one will be removed later)
$result = $db->sql_query_limit($sql, 1001 - $start, $start);
}
I need to add a ajax refresh where do I add it??