Page 8 of 34

Posted: Mon Apr 25, 2005 3:40 pm
by niekas
adiktd wrote: woo hoo
http://forums.adiktd.com/index.php


Good Job! .
8)

Posted: Mon Apr 25, 2005 3:56 pm
by Joerg4805
I did everything again and noticed, that this

Code: Select all

#-----[ FIND ]------------------------------------------------ 
 # 


                            if ( !empty($new_topic_data[$forum_id]) ) 
                            { 
                               $forum_last_post_time = 0; 

                               while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id]) ) 
                               { 
                                  if ( empty($tracking_topics[$check_topic_id]) ) 
                                  { 
                                     $unread_topics = true; 
                                     $forum_last_post_time = max($check_post_time, $forum_last_post_time); 

                                  } 
                                  else 
                                  { 
                                     if ( $tracking_topics[$check_topic_id] < $check_post_time ) 
                                     { 
                                        $unread_topics = true; 
                                        $forum_last_post_time = max($check_post_time, $forum_last_post_time); 
                                     } 
                                  } 
                               } 

                               if ( !empty($tracking_forums[$forum_id]) ) 
                               { 
                                  if ( $tracking_forums[$forum_id] > $forum_last_post_time ) 
                                  { 
                                     $unread_topics = false; 
                                  } 
                               } 

                               if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) ) 
                               { 
                                  if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time ) 
                                  { 
                                     $unread_topics = false; 
                                  } 
                               } 

                            } 


 # 
 #-----[ REPLACE WITH ]---------------------------------------- 
 # 

 $unread_topics=check_unread($forum_id); 

 # 
Is in front of the the part which has to be edited before, how can that be?
There are also two parts of it, in the beginning and nearly in the end so I don't know which one I have to replace.

After completing 2 or 3 times, I get another mesage :

Code: Select all

Parse error: parse error, unexpected T_STRING in /usr/export/www/vhosts/funnetwork/hosting/heartcore/germaniaforum/index.php on line 30
This is

Code: Select all

 if ( !empty($new_topic_data[$forum_id]) )
This is not my first mod, so I know what to do, but maybe I had a little bit fast on the first attempt. :wink:

Thanks for your help.

Posted: Mon Apr 25, 2005 4:00 pm
by Aldri
hello !!!

very nice mod, thanks, a bit hard to code the index.php but i finaly did it !

but i have a question, is there a way to have an image changing when there is new messages on the subforum ? (a sort of sub-forum new message image)

http://www.forumauberge.com/index.php

Posted: Mon Apr 25, 2005 4:06 pm
by niekas
Aldri wrote: hello !!!

very nice mod, thanks, a bit hard to code the index.php but i finaly did it !

but i have a question, is there a way to have an image changing when there is new messages on the subforum ? (a sort of sub-forum new message image)

http://www.forumauberge.com/index.php


It does have that functionality on index.php (little white icon changes to yellow). BTW i don't see any subforums - are they private?

It doesn't check for new posts of children forums when viewing parent forum [yet]. Hopefully next update.

Posted: Mon Apr 25, 2005 4:08 pm
by Joerg4805
Ok I finally got it, thanks!

Posted: Mon Apr 25, 2005 4:10 pm
by Aldri
hmmm yes one is private
the other one was private before (because some people didn't wanted to see the topics in it on the main forum, we had to do another forum and to hide it)
i will make it public now :)

and thanks for the color of the image, i didn't noticed ! i will change the color to make it more visible :)
or maybe make it flashing (in gif)


edit: it is public now

but i have a question for the new topic image
i see it on the index page, but not on the parent forum page
i mean here: http://www.forumauberge.com/viewforum.php?f=1
i don't see any image indicating if there is a new message on the sub-forum :)

Posted: Mon Apr 25, 2005 4:27 pm
by niekas
Aldri wrote: but i have a question for the new topic image
i see it on the index page, but not on the parent forum page
i mean here: http://www.forumauberge.com/viewforum.php?f=1
i don't see any image indicating if there is a new message on the sub-forum :)


It doesn't check new topics for children forums when viewing parent forum yet.

I'll try to get it done for next update.

Posted: Mon Apr 25, 2005 4:31 pm
by Aldri
yeah that would be really great

i think it should be done using this code

Code: Select all

$unread_topics = false; 
                           if ( $userdata['session_logged_in'] ) 
                           { 
                              if (check_unread($value['forum_id'])) 
                              { 
                                 $url_row2 = '&nbsp;<img src="' . $images['icon_minipost_new'] . '" border="0" alt="' . $lang['New_posts'] . '" title="' . $lang['New_posts'] . '" />'; 
                              } 
                              else 
                              { 
                                 $url_row2 = '&nbsp;<img src="' . $images['icon_minipost'] . '" border="0" alt="' . $lang['No_new_posts'] . '" title="' . $lang['No_new_posts'] . '" />'; 

                              } 
                           } 
                           else 
                           { 
                                 $url_row2 = '&nbsp;<img src="' . $images['icon_minipost'] . '" border="0" alt="' . $lang['No_new_posts'] . '" title="' . $lang['No_new_posts'] . '" />'; 
                           } 

                           $url_row2 .= '<a href="' . append_sid ('viewforum.php?f=' . $value['forum_id'] ) . '">' . $value['forum_name'] . '</a>' ; 
                           $list_of_attached = $list_of_attached . $url_row2 ; 
                           $a++; 
but i don't know where i could insert it in viewforum.php lol
and i would replace the image icon_minipost by folder_new
i just need to know where i have to insert the code :P

Posted: Tue Apr 26, 2005 4:19 am
by yoeddy
Hey Cherokee,

How did you get the image to appear next to your sub-forums on viewforum? What's the code bro?

Posted: Tue Apr 26, 2005 5:20 am
by niekas
This is changelog from 1.0.3 to 1.0.4 (checks new subforum posts on viewforum.php)

Code: Select all

#
#-----[ OPEN ]------------------------------------------------
#
   index.php


#
#-----[ FIND ]------------------------------------------------
#

function check_unread($forum_id)
{
global $new_topic_data, $tracking_topics, $tracking_forums, $HTTP_COOKIE_VARS, $board_config;
   if ( !empty($new_topic_data[$forum_id]) )
   {
      $forum_last_post_time = 0;

      while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id]) )
      {
         if ( empty($tracking_topics[$check_topic_id]) )
         {
            $unread_topics = true;
            $forum_last_post_time = max($check_post_time, $forum_last_post_time);

         }
         else
         {
            if ( $tracking_topics[$check_topic_id] < $check_post_time )
            {
               $unread_topics = true;
               $forum_last_post_time = max($check_post_time, $forum_last_post_time);
            }
         }
      }

      if ( !empty($tracking_forums[$forum_id]) )
      {
         if ( $tracking_forums[$forum_id] > $forum_last_post_time )
         {
            $unread_topics = false;
         }
      }

      if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
      {
         if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time )
         {
            $unread_topics = false;
         }
      }

   }

return $unread_topics;

} 

#
#-----[ REPLACE WITH ]------------------------------------------
# 

//moved to functions.php (in other words delete this function from index.php)

#
#-----[ OPEN ]------------------------------------------------
#
   viewforum.php


#
#-----[ FIND ]------------------------------------------------
#

if ($attachments)
{

		//
		// Obtain a list of topic ids which contain
		// posts made since user last visited
		//
		
#
#-----[ AFTER, ADD ]------------------------------------------
# 


		if ( $userdata['session_logged_in'] )
		{
			$sql = "SELECT t.forum_id, t.topic_id, p.post_time
				FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
				WHERE p.post_id = t.topic_last_post_id
					AND p.post_time > " . $userdata['user_lastvisit'] . "
					AND t.topic_moved_id = 0";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql);
			}

			$new_topic_data = array();
			while( $topic_data = $db->sql_fetchrow($result) )
			{
				$new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time'];
			}
		}


#
#-----[ FIND ]------------------------------------------------
#


		if ( $value['forum_last_post_id'] )
		{
		
#
#-----[ BEFORE, ADD ]------------------------------------------
#

		if ( $value['forum_status'] == FORUM_LOCKED )
		{
			$folder_image = $images['forum_locked'];
			$folder_alt = $lang['Forum_locked'];
		}
		else
		{
			$unread_topics = false;
			if ( $userdata['session_logged_in'] )
			{
				$unread_topics=check_unread($value['forum_id']);
			}

			$folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum'];
			$folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts'];
		}


#
#-----[ FIND ]------------------------------------------------
#

				 $template->assign_block_vars ('switch_attached_list.switch_attached_present',
										 array
										 (

#
#-----[ AFTER, ADD ]------------------------------------------
# 

										'FORUM_FOLDER_IMG' => $folder_image,
										'L_FORUM_FOLDER_ALT' => $folder_alt,

#
#-----[ OPEN ]------------------------------------------------
#
   /templates/subSilver/viewforum_body.tpl


#
#-----[ FIND ]------------------------------------------------
#
   <!-- BEGIN switch_attached_list -->
   <br />
   <table width="100%" border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline">
     <tr>
      <th class="thCornerL" height="15" nowrap="nowrap">&nbsp;{switch_attached_list.L_ATTACHED_FORUM}&nbsp;</th>
      <th width="50" class="thTop" nowrap="nowrap">&nbsp;{switch_attached_list.L_ATTACHED_TOPICS}&nbsp;</th>
      <th width="50" class="thTop" nowrap="nowrap">&nbsp;{switch_attached_list.L_ATTACHED_POSTS}&nbsp;</th>
	  <th width="50" class="thTop" nowrap="nowrap">&nbsp;{switch_attached_list.L_LAST_POST}&nbsp;</th>
     </tr>
     <!-- BEGIN switch_attached_present -->
     <tr>
      <td class="row1" width="75%"><span class="forumlink">{switch_attached_list.switch_attached_present.FORUM_NAME}</span><span class="genmed">{switch_attached_list.switch_attached_present.FORUM_DESC}</span></td>
      <td class="row2" align="center" valign="middle"><span class="gensmall">{switch_attached_list.switch_attached_present.TOPICS}</span></td>
      <td class="row2" align="center" valign="middle"><span class="gensmall">{switch_attached_list.switch_attached_present.POSTS}</span></td>
	  <td class="row2" align="center" nowrap="nowrap" valign="middle"><span class="gensmall">{switch_attached_list.switch_attached_present.LAST_POST_ID}</span></td>
       </tr>
     <!-- END switch_attached_present -->
   </table>
   <br />
   <!-- END switch_attached_list -->


#
#-----[ REPLACE WITH ]------------------------------------------
# 

<!-- BEGIN switch_attached_list -->
   <br />
   <table width="100%" border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline">
     <tr>
		<th colspan="2" class="thCornerL" height="15" nowrap="nowrap">&nbsp;{switch_attached_list.L_ATTACHED_FORUM}&nbsp;</th>
		<th width="50" class="thTop" nowrap="nowrap">&nbsp;{switch_attached_list.L_ATTACHED_TOPICS}&nbsp;</th>
		<th width="50" class="thTop" nowrap="nowrap">&nbsp;{switch_attached_list.L_ATTACHED_POSTS}&nbsp;</th>
		<th width="50" class="thTop" nowrap="nowrap">&nbsp;{switch_attached_list.L_LAST_POST}&nbsp;</th>
     </tr>
	<!-- BEGIN switch_attached_present -->
	<tr>
		<td class="row1" align="center" valign="middle" height="38"><img src="{switch_attached_list.switch_attached_present.FORUM_FOLDER_IMG}" width="46" height="25" alt="{switch_attached_list.switch_attached_present.L_FORUM_FOLDER_ALT}" title="{switch_attached_list.switch_attached_present.L_FORUM_FOLDER_ALT}" /></td>
		<td class="row1" width="75%"><span class="forumlink">{switch_attached_list.switch_attached_present.FORUM_NAME}</span><span class="genmed">{switch_attached_list.switch_attached_present.FORUM_DESC}</span></td>
		<td class="row2" align="center" valign="middle"><span class="gensmall">{switch_attached_list.switch_attached_present.TOPICS}</span></td>
		<td class="row2" align="center" valign="middle"><span class="gensmall">{switch_attached_list.switch_attached_present.POSTS}</span></td>
		<td class="row2" align="center" nowrap="nowrap" valign="middle"><span class="gensmall">{switch_attached_list.switch_attached_present.LAST_POST_ID}</span></td>
	</tr>
	<!-- END switch_attached_present -->
   </table>
   <br />
<!-- END switch_attached_list -->

#
#-----[ OPEN ]------------------------------------------------
#
   /includes/functions.php


#
#-----[ FIND ]------------------------------------------------
#

function get_db_stat($mode)
{


#
#-----[ BEFORE, ADD ]------------------------------------------
#

function check_unread($forum_id)
{
global $new_topic_data, $tracking_topics, $tracking_forums, $HTTP_COOKIE_VARS, $board_config;
   if ( !empty($new_topic_data[$forum_id]) )
   {
      $forum_last_post_time = 0;

      while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id]) )
      {
         if ( empty($tracking_topics[$check_topic_id]) )
         {
            $unread_topics = true;
            $forum_last_post_time = max($check_post_time, $forum_last_post_time);

         }
         else
         {
            if ( $tracking_topics[$check_topic_id] < $check_post_time )
            {
               $unread_topics = true;
               $forum_last_post_time = max($check_post_time, $forum_last_post_time);
            }
         }
      }

      if ( !empty($tracking_forums[$forum_id]) )
      {
         if ( $tracking_forums[$forum_id] > $forum_last_post_time )
         {
            $unread_topics = false;
         }
      }

      if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) )
      {
         if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time )
         {
            $unread_topics = false;
         }
      }

   }

return $unread_topics;

} 
Let me know how it works 8)

Posted: Tue Apr 26, 2005 6:56 am
by Cyberpunk
it works fine for me...
Thanks :wink:

Posted: Tue Apr 26, 2005 7:03 am
by yoeddy
Man, I must have the beta 1 version running because I am missing a lot of stuff even off of the beta 2 on page one. Could we wrap up the entire thing into one package?

Posted: Tue Apr 26, 2005 7:05 am
by niekas
yoeddy wrote: Man, I must have the beta 1 version running because I am missing a lot of stuff even off of the beta 2 on page one. Could we wrap up the entire thing into one package?


Complete package is on page one.

Posted: Tue Apr 26, 2005 7:07 am
by niekas
Cyberpunk wrote: it works fine for me...
Thanks :wink:


It doesn't show topic titles. Did you customize it on purpose or this is how it installed?

I'm looking @ http://www.phoenixrpg.com/

Posted: Tue Apr 26, 2005 7:28 am
by yoeddy
niekas wrote:
yoeddy wrote:Man, I must have the beta 1 version running because I am missing a lot of stuff even off of the beta 2 on page one. Could we wrap up the entire thing into one package?


Complete package is on page one.


Everything up to this point is wrapped up in the code on page 1? I agree...I like how CyberPunks layout looks.