Link 'problem' & about the forums
 
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> mxBB Modules -> mxBB Module: mx_tinies
View previous topic :: View next topic  
Author Message
Joge
Apprentice
Apprentice


Joined: 27 Mar 2005
Posts: 10

PostPosted: Thu Aug 25, 2005 2:20 pm    Post subject: Link 'problem' & about the forums Reply with quote

Is there any possibility to change the way how 'Tinies: View Topics' block works. When you click any link, it opens it in a new window. It would be nice if it could be opened in the very same window.

And secondly, I would simply love a feature where you could choose the forums where the topics are taken.

 
Back to top
View user's profile Send private message
Joge
Apprentice
Apprentice


Joined: 27 Mar 2005
Posts: 10

PostPosted: Thu Aug 25, 2005 2:30 pm    Post subject: Re: Link 'problem' & about the forums Reply with quote

Ok sorry.. I was a bit too quick and didn't tried all the links... The case with first 'problem' is solved, but how about the selecting system? 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Thu Aug 25, 2005 3:00 pm    Post subject: Re: Link 'problem' & about the forums Reply with quote

Do you mean the topics reported by the latest XXh links? If so, try the following:

OPEN: modules/mx_tinies/view_topics.php

FIND:
Code:
   $report_cond = ' AND p2.post_time > ' . ( time() - 86400 );

AFTER ADD:
Code:
   $report_cond .= " AND f.forum_id = #";

where # is the number of the forum of your choice.

You have to do above changes three times.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Joge
Apprentice
Apprentice


Joined: 27 Mar 2005
Posts: 10

PostPosted: Thu Aug 25, 2005 3:29 pm    Post subject: Re: Link 'problem' & about the forums Reply with quote

Thank you very much! It worked well. I replaced = with !=, easier like that, no need to list all 18 forums, 2 was enough Wink
And btw, thank you also for all those another great mods and troubleshooting. http://www.tiedeforum.net/portal/ thanks you!
 
Back to top
View user's profile Send private message
Joge
Apprentice
Apprentice


Joined: 27 Mar 2005
Posts: 10

PostPosted: Thu Aug 25, 2005 8:07 pm    Post subject: Re: Link 'problem' & about the forums Reply with quote

ERm.. uups Rolling Eyes

Yes, those and these too:
-Posts since last visit
-View unread posts

was in a hurry a bit... didn't read you msg carefull enough.
 
Back to top
View user's profile Send private message
Joge
Apprentice
Apprentice


Joined: 27 Mar 2005
Posts: 10

PostPosted: Mon Aug 29, 2005 11:52 am    Post subject: Re: Link 'problem' & about the forums Reply with quote

The problem is that it keeps counting between (x) where x is the number of posts. When you click on it, the list is empty.

So it does not list but it counts posts from unwanted forums. Anyone who could help?
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Mon Aug 29, 2005 12:18 pm    Post subject: Re: Link 'problem' & about the forums Reply with quote

The post count is computed in the welcome.php script. Probably you would have to filter for forums here as well.


.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Joge
Apprentice
Apprentice


Joined: 27 Mar 2005
Posts: 10

PostPosted: Mon Aug 29, 2005 12:30 pm    Post subject: Re: Link 'problem' & about the forums Reply with quote

Yep I have been fighting with it but I have some understanding problems with PHP if u understand what i mean Wink

I quess it is somewhere over here: welcome.php
Code:
//
// Get User Dependent Information...
//
if( $userdata['session_logged_in'] )
{
   $s_last_visit = create_date($board_config['default_dateformat'], $userdata['user_lastvisit'], $board_config['board_timezone']);

   if( $view_postcount )
   {
      $sql = 'SELECT t.topic_status, t.forum_id, t.topic_id, p2.post_time' .
         ' FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p, ' . POSTS_TABLE . ' p2' .
         ' WHERE p.post_id = t.topic_first_post_id' .
            ' AND p2.post_id = t.topic_last_post_id' .
            ' AND p2.post_time > ' . $userdata['user_lastvisit'] .
            ' AND t.forum_id IN (' . get_auth_forum() . ')';
      if( ($result = $db->sql_query($sql)) == TRUE )
      {
         $unread_posts = 0;
         $rowset = $db->sql_fetchrowset($result);

         $tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
         $tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();

         for( $i = 0; $i < count($rowset); $i++ )
         {
            if( $rowset[$i]['topic_status'] == TOPIC_MOVED )
            {
               continue;
            }
            if ( !empty($tracking_topics) || !empty($tracking_forums) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
            {
               $topic_id = $rowset[$i]['topic_id'];
               if( !empty($tracking_topics[$topic_id]) )
               {
                  if( $tracking_topics[$topic_id] > $row['post_time'] )
                  {
                     continue;
                  }
               }
               $forum_id = $rowset[$i]['forum_id'];
               if( !empty($tracking_forums[$forum_id]) )
               {
                  if( $tracking_forums[$forum_id] > $rowset[$i]['post_time'] )
                  {
                     continue;
                  }
               }
               if( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
               {
                  if( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $rowset[$i]['post_time'] )
                  {
                     continue;
                  }
               }
            }
            $unread_posts++;
         }
         $s_search_new = $lang['Posts_since_last_visit'].'&nbsp;('.count($rowset).')';
         $s_search_unread = $lang['Search_unread'].'&nbsp;('.$unread_posts.')';
      }
   }
   $template->assign_block_vars('welcome_user_logged_in', array());
   $template->assign_block_vars('welcome_user_admin_' . ($userdata['user_level'] == ADMIN ? 'on' : 'off'), array());
}
else
{
   $s_last_visit = '';
   $register_msg = sprintf($register_msg, '<a href="'.append_sid(PHPBB_URL.'profile.'.$phpEx.'?mode=register').'">', '</a>');
   $template->assign_block_vars('welcome_user_logged_out', array());
}
$user_link = ( $userdata['user_id'] != ANONYMOUS ) ?
   '<a href="' . append_sid(PHPBB_URL."profile.$phpEx?mode=editprofile&amp;".$userdata['user_id']).'">'.$userdata['username'].'</a>' :
   $lang['Guest'];

if( $report_page == 0 )
{
   $u_view_topics = $module_root_path.'view_topics.'.$phpEx.'?report_id=';
}
else
{
   $u_view_topics = PORTAL_URL.'index.'.$phpEx.'?page='.$report_page.'&amp;report_id=';
}
$u_unread = append_sid($u_view_topics.'unread');
$u_egostarted = append_sid($u_view_topics.'egostarted');
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Mon Aug 29, 2005 2:55 pm    Post subject: Re: Link 'problem' & about the forums Reply with quote

Try adding your own custom condition here:
Code:
      $sql = 'SELECT t.topic_status, t.forum_id, t.topic_id, p2.post_time' .
         ' FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p, ' . POSTS_TABLE . ' p2' .
         ' WHERE p.post_id = t.topic_first_post_id' .
            ' AND p2.post_id = t.topic_last_post_id' .
            ' AND p2.post_time > ' . $userdata['user_lastvisit'] .
            ' AND t.forum_id IN (' . get_auth_forum() . ')';

Maybe something like:
Code:
      $sql = 'SELECT t.topic_status, t.forum_id, t.topic_id, p2.post_time' .
         ' FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p, ' . POSTS_TABLE . ' p2' .
         ' WHERE p.post_id = t.topic_first_post_id' .
            ' AND p2.post_id = t.topic_last_post_id' .
            ' AND p2.post_time > ' . $userdata['user_lastvisit'] .
            ' AND t.forum_id <> # ' .
            ' AND t.forum_id IN (' . get_auth_forum() . ')';

Where # is the forum to filter. Both != and <> mean "not equal than".

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
Joge
Apprentice
Apprentice


Joined: 27 Mar 2005
Posts: 10

PostPosted: Mon Aug 29, 2005 5:39 pm    Post subject: Re: Link 'problem' & about the forums Reply with quote

/me shakes markus' hand Very Happy

Thanks dude! It worked.
 
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    phpMiX.org Forum Index -> mxBB Modules -> mxBB Module: mx_tinies All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
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
You cannot attach files in this forum
You can download files in this forum