- Readme First! - Read and follow the rules, otherwise your posts will be closed
There are currently, 250 guest(s) and 0 member(s) that are online. You are Anonymous user. You can register for free by clicking here
Nuke Cops :: View topic - View newest post not working [ ]
Author
Message
mikept
Nuke Cadet
Joined: Feb 22, 2005
Posts: 7
Posted:
Thu Jun 30, 2005 7:32 am
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12482
Posted:
Thu Jun 30, 2005 8:16 am
JallaBalla
Captain
Joined: May 01, 2003
Posts: 310
Location: Oslo, Norway
Posted:
Thu Jun 30, 2005 8:26 am
I have the same problem, and here is what I have done:
- Installed a fresh installation of patched77
- imported old site content (success)
- upgraded to 2.0.16 and used the upgrade.php-forum file with success.
I have tried:
- empty all cookies
- restarted httpd on Fedora server
- altered domain from enemyoffline.com to www.enemyoffline.com and even blank
- renamed the cookie just to check I get the new ones (I do)
It works in IE, but not FireFox.
WHat I have noticed is that Firefox never gets this cookie: EOphpbb2mysql2_t
And the other cookies (EOphpbb2mysql2_data & EOphpbb2mysql2_sid ) dont appear unless I log in as admin and go to forumadmin.
All the cookies I see without logging into admin are "admin" "lang" and "resoultion".
_________________ JallaBalla
...a Paying customer of PHP-Nuke
8.0 / 2.20
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12482
Posted:
Thu Jun 30, 2005 10:47 am
JallaBalla
Captain
Joined: May 01, 2003
Posts: 310
Location: Oslo, Norway
Posted:
Thu Jun 30, 2005 10:53 am
JallaBalla wrote:
and even blank
_________________ JallaBalla
...a Paying customer of PHP-Nuke
8.0 / 2.20
mikept
Nuke Cadet
Joined: Feb 22, 2005
Posts: 7
Posted:
Fri Jul 01, 2005 2:09 am
Thx for all the replys
Evaders99 wrote:
I recommend upgrading your BBToNuke all the way to the latest 2.0.16
I'll try that but my forum has several code changes (and I don't remeber all of them ) so this will be a little hard because all the updates to 2.0.16 are to substitute files and not update code... but with a backup and lots of time (this will be the hard part) I think I can do it...
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12482
Posted:
Fri Jul 01, 2005 4:02 am
mikept
Nuke Cadet
Joined: Feb 22, 2005
Posts: 7
Posted:
Fri Jul 01, 2005 4:13 am
For those with this problem the solution is on 2.0.12 update.
If you want to solve this without update just do this on the /modules/Forums/viewtopic.php file.
-----
find
-----
Code:
//
// Find topic id if user requested a newer
// or older topic
//
if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
{
if ( $HTTP_GET_VARS['view'] == 'newest' )
{
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid']) )
{
$session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $HTTP_GET_VARS['sid'];
if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
{
$session_id = '';
}
if ( $session_id )
{
$sql = "SELECT p.post_id
FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_id = '$session_id'
AND u.user_id = s.session_user_id
AND p.topic_id = '$topic_id'
AND p.post_time >= u.user_lastvisit
ORDER BY p.post_time ASC
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit');
}
$post_id = $row['post_id'];
if (isset($HTTP_GET_VARS['sid']))
{
redirect(append_sid("viewtopic.$phpEx?sid=$session_id&" . POST_POST_URL . "=$post_id#$post_id", true));
}
else
{
redirect(append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true));
}
}
}
redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
}
else if ( $HTTP_GET_VARS['view'] == 'next' || $HTTP_GET_VARS['view'] == 'previous' )
{
$sql_condition = ( $HTTP_GET_VARS['view'] == 'next' ) ? '>' : '<';
$sql_ordering = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'ASC' : 'DESC';
$sql = "SELECT t.topic_id
FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2
WHERE
t2.topic_id = '$topic_id'
AND t.forum_id = t2.forum_id
AND t.topic_last_post_id $sql_condition t2.topic_last_post_id
ORDER BY t.topic_last_post_id $sql_ordering
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$topic_id = intval($row['topic_id']);
}
else
{
$message = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'No_newer_topics' : 'No_older_topics';
message_die(GENERAL_MESSAGE, $message);
}
}
}
--------------
replace with
--------------
Code:
//
// Find topic id if user requested a newer
// or older topic
//
if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
{
if ( $HTTP_GET_VARS['view'] == 'newest' )
{
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', $_SERVER['SERVER_SOFTWARE']) ) ? 'Refresh: 0; URL=' : 'Location: ';
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid']) )
{
$session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $HTTP_GET_VARS['sid'];
if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
{
$session_id = '';
}
if ( $session_id )
{
$sql = "SELECT p.post_id
FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_id = '$session_id'
AND u.user_id = s.session_user_id
AND p.topic_id = '$topic_id'
AND p.post_time >= u.user_lastvisit
ORDER BY p.post_time ASC
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit');
}
$post_id = $row['post_id'];
header($header_location . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true));
exit;
}
}
header($header_location . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
exit;
}
else if ( $HTTP_GET_VARS['view'] == 'next' || $HTTP_GET_VARS['view'] == 'previous' )
{
$sql_condition = ( $HTTP_GET_VARS['view'] == 'next' ) ? '>' : '<';
$sql_ordering = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'ASC' : 'DESC';
$sql = "SELECT t.topic_id
FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2
WHERE
t2.topic_id = '$topic_id'
AND t.forum_id = t2.forum_id
AND t.topic_last_post_id $sql_condition t2.topic_last_post_id
ORDER BY t.topic_last_post_id $sql_ordering
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$topic_id = intval($row['topic_id']);
}
else
{
$message = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'No_newer_topics' : 'No_older_topics';
message_die(GENERAL_MESSAGE, $message);
}
}
}
That solved the problem.... thx for all your help
JallaBalla
Captain
Joined: May 01, 2003
Posts: 310
Location: Oslo, Norway
Posted:
Mon Jul 11, 2005 6:49 am
mikept wrote:
For those with this problem the solution is on 2.0.12 update.
If you want to solve this without update just do this on the /modules/Forums/viewtopic.php file.
-----
find
-----
Code:
//
// Find topic id if user requested a newer
// or older topic
//
if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
{
if ( $HTTP_GET_VARS['view'] == 'newest' )
{
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid']) )
{
$session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $HTTP_GET_VARS['sid'];
if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
{
$session_id = '';
}
if ( $session_id )
{
$sql = "SELECT p.post_id
FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_id = '$session_id'
AND u.user_id = s.session_user_id
AND p.topic_id = '$topic_id'
AND p.post_time >= u.user_lastvisit
ORDER BY p.post_time ASC
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit');
}
$post_id = $row['post_id'];
if (isset($HTTP_GET_VARS['sid']))
{
redirect(append_sid("viewtopic.$phpEx?sid=$session_id&" . POST_POST_URL . "=$post_id#$post_id", true));
}
else
{
redirect(append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true));
}
}
}
redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
}
else if ( $HTTP_GET_VARS['view'] == 'next' || $HTTP_GET_VARS['view'] == 'previous' )
{
$sql_condition = ( $HTTP_GET_VARS['view'] == 'next' ) ? '>' : '<';
$sql_ordering = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'ASC' : 'DESC';
$sql = "SELECT t.topic_id
FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2
WHERE
t2.topic_id = '$topic_id'
AND t.forum_id = t2.forum_id
AND t.topic_last_post_id $sql_condition t2.topic_last_post_id
ORDER BY t.topic_last_post_id $sql_ordering
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$topic_id = intval($row['topic_id']);
}
else
{
$message = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'No_newer_topics' : 'No_older_topics';
message_die(GENERAL_MESSAGE, $message);
}
}
}
--------------
replace with
--------------
Code:
//
// Find topic id if user requested a newer
// or older topic
//
if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
{
if ( $HTTP_GET_VARS['view'] == 'newest' )
{
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', $_SERVER['SERVER_SOFTWARE']) ) ? 'Refresh: 0; URL=' : 'Location: ';
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid']) )
{
$session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $HTTP_GET_VARS['sid'];
if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
{
$session_id = '';
}
if ( $session_id )
{
$sql = "SELECT p.post_id
FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_id = '$session_id'
AND u.user_id = s.session_user_id
AND p.topic_id = '$topic_id'
AND p.post_time >= u.user_lastvisit
ORDER BY p.post_time ASC
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit');
}
$post_id = $row['post_id'];
header($header_location . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true));
exit;
}
}
header($header_location . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
exit;
}
else if ( $HTTP_GET_VARS['view'] == 'next' || $HTTP_GET_VARS['view'] == 'previous' )
{
$sql_condition = ( $HTTP_GET_VARS['view'] == 'next' ) ? '>' : '<';
$sql_ordering = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'ASC' : 'DESC';
$sql = "SELECT t.topic_id
FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2
WHERE
t2.topic_id = '$topic_id'
AND t.forum_id = t2.forum_id
AND t.topic_last_post_id $sql_condition t2.topic_last_post_id
ORDER BY t.topic_last_post_id $sql_ordering
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain newer/older topic information", '', __LINE__, __FILE__, $sql);
}
if ( $row = $db->sql_fetchrow($result) )
{
$topic_id = intval($row['topic_id']);
}
else
{
$message = ( $HTTP_GET_VARS['view'] == 'next' ) ? 'No_newer_topics' : 'No_older_topics';
message_die(GENERAL_MESSAGE, $message);
}
}
}
That solved the problem.... thx for all your help
hmmm... i have to try that then....
_________________ JallaBalla
...a Paying customer of PHP-Nuke
8.0 / 2.20
JallaBalla
Captain
Joined: May 01, 2003
Posts: 310
Location: Oslo, Norway
Posted:
Mon Aug 15, 2005 2:44 am
nope....didnt help for me... My posts are still unread..... /BAH !!!!!
I GIVE UP, and hope 7.8 will fix this after released public
_________________ JallaBalla
...a Paying customer of PHP-Nuke
8.0 / 2.20
Evaders99
Site Admin
Joined: Aug 17, 2003
Posts: 12482
Posted:
Mon Aug 15, 2005 10:31 am
JallaBalla
Captain
Joined: May 01, 2003
Posts: 310
Location: Oslo, Norway
Posted:
Mon Aug 15, 2005 1:02 pm
JallaBalla wrote:
I have the same problem, and here is what I have done:
- Installed a fresh installation of patched77
- imported old site content (success)
- upgraded to 2.0.16 and used the upgrade.php-forum file with success.
I have tried:
- empty all cookies
- restarted httpd on Fedora server
- altered domain from enemyoffline.com to www.enemyoffline.com and even blank
- renamed the cookie just to check I get the new ones (I do)
It works in IE, but not FireFox.
WHat I have noticed is that Firefox never gets this cookie: EOphpbb2mysql2_t
And the other cookies (EOphpbb2mysql2_data & EOphpbb2mysql2_sid ) dont appear unless I log in as admin and go to forumadmin.
All the cookies I see without logging into admin are "admin" "lang" and "resoultion".
(sigh) Read the above.....
_________________ JallaBalla
...a Paying customer of PHP-Nuke
8.0 / 2.20
OSIRIS-ANBUIS
Nuke Cadet
Joined: Aug 19, 2005
Posts: 1
Posted:
Fri Aug 19, 2005 1:51 am
shmk
Corporal
Joined: Nov 07, 2003
Posts: 57
Posted:
Fri Sep 02, 2005 1:14 am
There is a php piece of code see when the phpbb cookie get reset ?
So if I can echo a string (or open a popup) when it is resetted, I can see if the cookie clearing is connected with some determined action and I can debug better...
xiaozhengmmm
Joined: Sep 23, 2014
Posts: 0
Posted:
Tue Sep 23, 2014 12:25 am
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum