You are missing our premiere tool bar navigation system! Register and use it for FREE!

NukeCops  
•  Home •  Downloads •  Gallery •  Your Account •  Forums • 
Readme First
- Readme First! -

Read and follow the rules, otherwise your posts will be closed
Modules
· Home
· FAQ
· Buy a Theme
· Advertising
· AvantGo
· Bookmarks
· Columbia
· Community
· Donations
· Downloads
· Feedback
· Forums
· PHP-Nuke HOWTO
· Private Messages
· Search
· Statistics
· Stories Archive
· Submit News
· Surveys
· Theme Gallery
· Top
· Topics
· Your Account
Who's Online
There are currently, 249 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 - Jump To Latest Post icon not working [ ]
 Forum FAQ  •  Search  •   •  Memberlist  •  Usergroups   •  Register  •  Profile •    •  Log in to check your private messages  •  Log in

 
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
Author Message
GJSchaller
Corporal
Corporal


Joined: Aug 05, 2004
Posts: 62

Location: Valhalla, NY, USA

PostPosted: Thu Dec 02, 2004 11:33 am Reply with quoteBack to top

I just upgraded my Nuke 7.5 with BBtoNuke2.0.11. Within each Board, the little icon with the arrow next to a subject that takes you to the most recent post no longer works - it now takes you to a non-existant page.

On the main index, the arrows next to a board that take you to the most recent post within that board work normally.

Any idea how to fix this?

_________________
Geoffrey Schaller
Knight Realms, Technical Officer
http://www.knightrealms.com
Find all posts by GJSchallerView user's profileSend private messageSend e-mailVisit poster's website
GJSchaller
Corporal
Corporal


Joined: Aug 05, 2004
Posts: 62

Location: Valhalla, NY, USA

PostPosted: Fri Dec 03, 2004 6:35 am Reply with quoteBack to top

I think I found the bug...

In a Forum, when you are viewing a list of topics, there is a "Newest Post" icon on the left side of the topic that should link you to the newest post in that subject. When I hover on that Icon, I get the following URL:

http://www.knightrealms.com/modules.phpname=Forums&file=viewtopic&t=34000&view=newest

So far, so good.

Now, when I click on the icon, it takes me to the follwing URL:

http://www.knightrealms.com/modules/Forums/modules.php?name=Forums&file=viewtopic&p=35075#35075

NOTICE: The inclusion of /Forums/Modules in the URL - this is throwing it off.

I can't find where in the patch this is happening - I don't know phpBB that well.

What function / file controls looking up the newest post?

_________________
Geoffrey Schaller
Knight Realms, Technical Officer
http://www.knightrealms.com
Find all posts by GJSchallerView user's profileSend private messageSend e-mailVisit poster's website
GJSchaller
Corporal
Corporal


Joined: Aug 05, 2004
Posts: 62

Location: Valhalla, NY, USA

PostPosted: Fri Dec 03, 2004 7:12 am Reply with quoteBack to top

Arrrgh... it's something in viewtopic.php, I am guessing in here... I just can't find it.

The URL for the new post Icon appears fine - that takes you to a function that then redirects you to the actual post. The redirect function is what is going wrong, it's adding the /modules/Forums in there.

Here's the code... can anyone spot the error and tell me how to fix it?

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);
      }
   }
}

_________________
Geoffrey Schaller
Knight Realms, Technical Officer
http://www.knightrealms.com
Find all posts by GJSchallerView user's profileSend private messageSend e-mailVisit poster's website
raptorke
Nuke Soldier
Nuke Soldier


Joined: Oct 13, 2003
Posts: 14


PostPosted: Tue Jan 11, 2005 3:43 am Reply with quoteBack to top

having the same problem.
Anyone?
Find all posts by raptorkeView user's profileSend private messageVisit poster's website
GJSchaller
Corporal
Corporal


Joined: Aug 05, 2004
Posts: 62

Location: Valhalla, NY, USA

PostPosted: Tue Jan 11, 2005 3:45 am Reply with quoteBack to top

Sorry, I figured out what it was - I installed Approve_Membership and BBtoNuke211 at the same time, the BBtoNuke broke Approve Membership, which includes some forum edits.

They are supposed to fix AM to work with BBtoNuke, but in the meantime I've just replaced the one Forum file back to the AM version, and it seems to work fine.

_________________
Geoffrey Schaller
Knight Realms, Technical Officer
http://www.knightrealms.com
Find all posts by GJSchallerView user's profileSend private messageSend e-mailVisit poster's website
raptorke
Nuke Soldier
Nuke Soldier


Joined: Oct 13, 2003
Posts: 14


PostPosted: Tue Jan 11, 2005 3:57 am Reply with quoteBack to top

but i just upgraded to phpnuke 7.6, nothing else...
Find all posts by raptorkeView user's profileSend private messageVisit poster's website
Display posts from previous:      
Post new topic  Reply to topicprinter-friendly view
View previous topic Log in to check your private messages View next topic
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



Powered by phpBB © 2001, 2005 phpBB Group

Ported by Nuke Cops © 2003 www.nukecops.com
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::
Powered by TOGETHER TEAM srl ITALY http://www.togetherteam.it - DONDELEO E-COMMERCE http://www.DonDeLeo.com - TUTTISU E-COMMERCE http://www.tuttisu.it
Web site engine's code is Copyright © 2002 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.043 Seconds - 307 pages served in past 5 minutes. Nuke Cops Founded by Paul Laudanski (Zhen-Xjell)
:: FI Theme :: PHP-Nuke theme by coldblooded (www.nukemods.com) ::