[RC] Advanced Topic Type

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Poupoune
Former Team Member
Posts: 702
Joined: Sun Apr 18, 2004 4:04 pm
Location: In the stars... where you left me, and where I will wait for you... always...
Contact:

Post by Poupoune »

ekimN wrote: Nice mod.. got it to work on phpbb 2.0.10, however I don't think it works well with the Topic Cement mod. After installing the Advanced Topic type, I can't prioritze topics. Is there a fix with this? Thanks!

I'll try to see if I can fix that
holek wrote: Is this mod workin' with Global Announce MOD?

BTW: I've created polish version of this mod:
http://phpbb.pl/download.php?d=247

Click on: Pobierz

Yes, I tested and seems to be working fine.
Poupoune - http://www.poup.net
My styles : [ La courbe de tes yeux ] - [ Stars are for dying ] - [ Plenitude ] - [ genElectro ]
ultima528
Registered User
Posts: 100
Joined: Tue Apr 06, 2004 8:24 pm

Post by ultima528 »

Will you include these modifications for compliance with the other MODs in the next releases (like in a 'contrib' or 'extras' folder)? That would be great, and it would make it easier to update the information.

Again, great MOD, and I'm looking forward to it!
Poupoune
Former Team Member
Posts: 702
Joined: Sun Apr 18, 2004 4:04 pm
Location: In the stars... where you left me, and where I will wait for you... always...
Contact:

Post by Poupoune »

ultima528 wrote: Will you include these modifications for compliance with the other MODs in the next releases (like in a 'contrib' or 'extras' folder)? That would be great, and it would make it easier to update the information.

Again, great MOD, and I'm looking forward to it!

Thanks, I didn't thought about an "extra" folder but I'll think about it.
So far it works ( to verify though ) with : Split Topic Types, Cat Hierarchy, Global Announcement, PCP, Topic List.
Poupoune - http://www.poup.net
My styles : [ La courbe de tes yeux ] - [ Stars are for dying ] - [ Plenitude ] - [ genElectro ]
holek
Registered User
Posts: 47
Joined: Sat Aug 09, 2003 11:35 am
Location: Wroclaw, Poland
Contact:

Post by holek »

So, you include polish lang into next release?
P.S. Sorry for my horrible English :(
Messengers: [ Gadu-Gadu: 1658223 ]
My GTA VC Stats
Poupoune
Former Team Member
Posts: 702
Joined: Sun Apr 18, 2004 4:04 pm
Location: In the stars... where you left me, and where I will wait for you... always...
Contact:

Post by Poupoune »

holek wrote: So, you include polish lang into next release?

Of course, no problem :wink:
Anyone who may want translate this MOD in his own language is welcome :) .
I'll add all of that in the next update.
Poupoune - http://www.poup.net
My styles : [ La courbe de tes yeux ] - [ Stars are for dying ] - [ Plenitude ] - [ genElectro ]
TheoGB
Registered User
Posts: 5
Joined: Sun Sep 05, 2004 9:20 pm

Post by TheoGB »

Just like to say I like the look of this and will definitely try to install it. :D

Thanks a lot!

I would really like to see how far modification to topic types can go as ideally I would like to create an 'article' topic type such that a topic listing would actually appear like an article does on PHP-Nuke, et al

The best example would be the central column here:
http://www.dvddebate.com/modules.php?na ... s&column=1

So each topic that was of type article would have an abstract and a tumbnail image as its listing, instead of just the title. Does that make sense?
encryption
Registered User
Posts: 392
Joined: Tue Jul 08, 2003 2:07 pm
Contact:

Post by encryption »

Poupoune wrote: Here's for Split Topic Type by Ptirhiik compliance :
#
#-----[ OPEN ]----------------------------------------------
#

includes/functions_topic_list.php


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

$template->assign_block_vars($tpl . '.row', array(

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

if( $topic_real_type > POST_GLOBAL_ANNOUNCE )
{
for($j = 0; $j < count($row); $j++ )
{
if( intval($topic_rowset[$i]['topic_type'] - POST_ADD_TYPE) == $row[$j]['topic_type_order'] )
{
$sub_title = '<span style="color:#'. $row[$j]['topic_type_color'] .'">'. $row[$j]['topic_type_name'] .':</span> ';
}
}
}

A known issue is that when you select a topic type as normal topic type in the ACP, it is still split in viewforum. I'll correct that later :) .


That part appears 5 times in this file, can you be more specific as to where exactly it is located

-e-
encryption
Registered User
Posts: 392
Joined: Tue Jul 08, 2003 2:07 pm
Contact:

Post by encryption »

well I inserted the above code on "instinct" and it seemed to work, no errors so far... however, inspite of specifying an image for both post type and new post..... I cant get the icon to show up in the forum.... any ideas ?

-e-
encryption
Registered User
Posts: 392
Joined: Tue Jul 08, 2003 2:07 pm
Contact:

Post by encryption »

darn it, I just realized it broke the global announcement mod that was implemented on the forums too......

in posting.php

it asks to replace the following

Code: Select all

//
// Topic type selection
//
$topic_type_toggle = '';
if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) )
{
  $template->assign_block_vars('switch_type_toggle', array());

  if( $is_auth['auth_sticky'] )
  {
    $topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_STICKY . '"';
    if ( $post_data['topic_type'] == POST_STICKY || $topic_type == POST_STICKY )
    {
      $topic_type_toggle .= ' checked="checked"';
    }
    $topic_type_toggle .= ' /> ' . $lang['Post_Sticky'] . '&nbsp;&nbsp;';
  }

  if( $is_auth['auth_announce'] )
  {
    $topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_ANNOUNCE . '"';
    if ( $post_data['topic_type'] == POST_ANNOUNCE || $topic_type == POST_ANNOUNCE )
    {
      $topic_type_toggle .= ' checked="checked"';
    }
    $topic_type_toggle .= ' /> ' . $lang['Post_Announcement'] . '&nbsp;&nbsp;';
  }

  if ( $topic_type_toggle != '' )
  {
    $topic_type_toggle = $lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $lang['Post_Normal'] . '&nbsp;&nbsp;' . $topic_type_toggle;
  }
}

however my code is as follows

Code: Select all

//
// Topic type selection
//
$topic_type_toggle = '';
if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) )
{
	$template->assign_block_vars('switch_type_toggle', array());

	if( $is_auth['auth_sticky'] )
	{
		$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_STICKY . '"';
		if ( $post_data['topic_type'] == POST_STICKY || $topic_type == POST_STICKY )
		{
			$topic_type_toggle .= ' checked="checked"';
		}
		$topic_type_toggle .= ' /> ' . $lang['Post_Sticky'] . '&nbsp;&nbsp;';
	}

	if( $is_auth['auth_announce'] )
	{
		$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_ANNOUNCE . '"';
		if ( $post_data['topic_type'] == POST_ANNOUNCE || $topic_type == POST_ANNOUNCE )
		{
			$topic_type_toggle .= ' checked="checked"';
		}
		$topic_type_toggle .= ' /> ' . $lang['Post_Announcement'] . '&nbsp;&nbsp;';
	}
//-- mod : announces -------------------------------------------------------------------------------
//-- add
	if( $is_auth['auth_global_announce'] )
	{
		$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_GLOBAL_ANNOUNCE . '"';
		if ( $post_data['topic_type'] == POST_GLOBAL_ANNOUNCE || $topic_type == POST_GLOBAL_ANNOUNCE )
		{
			$topic_type_toggle .= ' checked="checked"';
		}
		$topic_type_toggle .= ' /> ' . $lang['Post_Global_Announcement'] . '&nbsp;&nbsp;';
	}
//-- fin mod : announces ---------------------------------------------------------------------------

	if ( $topic_type_toggle != '' )
	{
		$topic_type_toggle = $lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $lang['Post_Normal'] . '&nbsp;&nbsp;' . $topic_type_toggle;
	}
//-- mod : announces -------------------------------------------------------------------------------
//-- add
	if( $is_auth['auth_announce'] || $is_auth['auth_global_announce'])
	{
		if (empty($topic_announce_duration)) $topic_announce_duration = $post_data['topic_announce_duration'];
		$topic_type_toggle .= '<br />' . $lang['announcement_duration'] . ': <input type="post" size="3" name="topicduration" value="' . $topic_announce_duration . '" />&nbsp;' . $lang['Days'] . '<br /><span class="gensmall">(' . $lang['announcement_duration_explain'] . ')</span>';
	}
//-- fin mod : announces ---------------------------------------------------------------------------
}
any suggestions ?

-e-
Last edited by encryption on Thu Sep 30, 2004 11:14 am, edited 2 times in total.
Poupoune
Former Team Member
Posts: 702
Joined: Sun Apr 18, 2004 4:04 pm
Location: In the stars... where you left me, and where I will wait for you... always...
Contact:

Post by Poupoune »

Try this :

Code: Select all

//
// Topic type selection
//
$topic_type_toggle = '';
if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) )
{
  $template->assign_block_vars('switch_type_toggle', array());

  $topic_type_toggle .= '<select name="topictype">';
  
  $topic_type_toggle .= '<option value="'. POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' selected' : '' ) . '>'. $lang['Post_Normal'] .'</option>'; 

if( $is_auth['auth_sticky'] )
  {
    $topic_type_toggle .= '<option value="' . POST_STICKY . '"';
    if ( $post_data['topic_type'] == POST_STICKY || $topic_type == POST_STICKY )
    {
      $topic_type_toggle .= ' selected';
    }
    $topic_type_toggle .= '>'. $lang['Post_Sticky'] . '</option>';
  }

  if( $is_auth['auth_announce'] )
  {
    $topic_type_toggle .= '<option value="' . POST_ANNOUNCE . '"';
    if ( $post_data['topic_type'] == POST_ANNOUNCE || $topic_type == POST_ANNOUNCE )
    {
      $topic_type_toggle .= ' selected';
    }
    $topic_type_toggle .= '>'. $lang['Post_Announcement'] . '</option>';
  }
  
  //-- mod : announces -------------------------------------------------------------------------------
//-- add
   if( $is_auth['auth_global_announce'] )
   {
      $topic_type_toggle .= '<option value="' . POST_GLOBAL_ANNOUNCE . '"';
      if ( $post_data['topic_type'] == POST_GLOBAL_ANNOUNCE || $topic_type == POST_GLOBAL_ANNOUNCE )
      {
         $topic_type_toggle .= ' selected';
      }
      $topic_type_toggle .= ' /> ' . $lang['Post_Global_Announcement'] . '</option>';
   }
//-- fin mod : announces ---------------------------------------------------------------------------
  
  $sql_tt = "SELECT * FROM ". TOPIC_ADD_TYPE_TABLE ." ORDER BY topic_type_order DESC";
  $result_tt = $db->sql_query($sql_tt);
  while( $add_type = $db->sql_fetchrow($result_tt) )
  {
    if( ( ( $userdata['user_level'] >= $add_type['topic_type_auth'] && $add_type['topic_type_auth'] != ADMIN ) || $userdata['user_level'] == ADMIN ) && ( $add_type['topic_type_name'] != 'announce' && $add_type['topic_type_name'] != 'sticky' ) )
    {
      $topic_add_type = intval( $add_type['topic_type_order'] + POST_ADD_TYPE );
      $topic_type_toggle .= '<option value="' . $topic_add_type . '"';
      if ( $post_data['topic_type'] == $topic_add_type || $topic_type == $topic_add_type )
      {
        $topic_type_toggle .= ' selected';
      }
      $topic_type_toggle .= '>'. stripslashes($add_type['topic_type_name']) . '</option>';
    }  
  }  

  $topic_type_toggle .= '</select>';
  $topic_type_toggle = $lang['Post_topic_as'] . ': '. $topic_type_toggle;
  //-- mod : announces -------------------------------------------------------------------------------
//-- add
   if( $is_auth['auth_announce'] || $is_auth['auth_global_announce'])
   {
      if (empty($topic_announce_duration)) $topic_announce_duration = $post_data['topic_announce_duration'];
      $topic_type_toggle .= '<br />' . $lang['announcement_duration'] . ': <input type="post" size="3" name="topicduration" value="' . $topic_announce_duration . '" />&nbsp;' . $lang['Days'] . '<br /><span class="gensmall">(' . $lang['announcement_duration_explain'] . ')</span>';
   }
//-- fin mod : announces ---------------------------------------------------------------------------
}
// END Advanced Topic Type MOD
Poupoune - http://www.poup.net
My styles : [ La courbe de tes yeux ] - [ Stars are for dying ] - [ Plenitude ] - [ genElectro ]
MrDSL
Registered User
Posts: 283
Joined: Thu Jul 15, 2004 1:52 am
Contact:

Post by MrDSL »

I'll try that code edit tonite the other edit I have is with viewforum.php is

Code: Select all


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

      if( $topic_type == POST_ANNOUNCE ) 
      { 
         $topic_type = $lang['Topic_Announcement'] . ' '; 
      } 
      else if( $topic_type == POST_STICKY ) 
      { 
         $topic_type = $lang['Topic_Sticky'] . ' '; 
      } 

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

    // BEGIN Advanced Topic Type MOD 
    if( $topic_type == POST_ANNOUNCE ) 
    { 
      $topic_type = '<font color="'. $announce_color .'">'. $lang['Topic_Announcement'] . ' </font>'; 
    } 
    else if( $topic_type == POST_STICKY ) 
    { 
      $topic_type = '<font color="'. $sticky_color .'">'. $lang['Topic_Sticky'] . ' </font>'; 
    } 
    else if( $topic_type > POST_GLOBAL_ANNOUNCE ) 
    { 
      for($j = 0; $j < count($row); $j++ ) 
      { 
        if( intval($topic_rowset[$i]['topic_type'] - POST_ADD_TYPE) == $row[$j]['topic_type_order'] ) 
        { 
          $topic_type = '<font color="#'. $row[$j]['topic_type_color'] .'">'. $row[$j]['topic_type_name'] .':</font> ';      
        } 
      }  
    } 
    // END Advanced Topic Type MOD 

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

         if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE ) 
         { 
            $folder = $images['folder_announce']; 
            $folder_new = $images['folder_announce_new']; 
         } 

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

      // BEGIN Advanced Topic Type MOD 
      else if( $topic_rowset[$i]['topic_type'] >= POST_ADD_TYPE ) 
      { 
        for($j = 0; $j < count($row); $j++ ) 
        { 
          if( intval($topic_rowset[$i]['topic_type'] - POST_ADD_TYPE) == $row[$j]['topic_type_order'] ) 
          { 
            $folder = $row[$j]['topic_type_image']; 
            $folder_new = $row[$j]['topic_type_image_new'];      
          } 
        }  
        if( $folder == '' && $folder_new == '') 
        {  
          $folder = $images['folder_topic_type']; 
            $folder_new = $images['folder_topic_type_new']; 
        } 
      } 
      // END Advanced Topic Type MOD
This is all taken out and moved to functions_topics_list.php because of the categories heirarchy mod I believe. Would you be able to tell me what I would have to edit in that file? It is located here

any help appreciated.
Poupoune
Former Team Member
Posts: 702
Joined: Sun Apr 18, 2004 4:04 pm
Location: In the stars... where you left me, and where I will wait for you... always...
Contact:

Post by Poupoune »

Try this
Poupoune - http://www.poup.net
My styles : [ La courbe de tes yeux ] - [ Stars are for dying ] - [ Plenitude ] - [ genElectro ]
MrDSL
Registered User
Posts: 283
Joined: Thu Jul 15, 2004 1:52 am
Contact:

Post by MrDSL »

I'll try that thanks.
Traiklin
Registered User
Posts: 94
Joined: Wed Dec 10, 2003 10:30 pm

Post by Traiklin »

How do I add in the global announcment mod?

I fallowed the instructions to install it and it doesn't show up on the what to post the topic as.
MrDSL
Registered User
Posts: 283
Joined: Thu Jul 15, 2004 1:52 am
Contact:

Post by MrDSL »

Ok followed all the extra instructions but I get a error anytime I try to post a sticky, announcement, global announcement or special type...

Code: Select all

Error in posting

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' topic_icon=0, topic_calendar_time = 0, topic_calendar_duration

UPDATE phpbb_topics SET topic_title = 'another test', topic_desc = '', news_id = 0, topic_type = 1, , topic_icon=0, topic_calendar_time = 0, topic_calendar_duration = 0, topic_announce_duration = 0, topic_calendar_repeat = '' WHERE topic_id = 3865

Line : 407
File : /forums/includes/functions_post.php

and here is the code for that file

Code: Select all

//-- modify
		$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_desc, topic_poster, topic_time, forum_id, news_id, topic_status, topic_type, topic_icon, topic_calendar_time, topic_calendar_duration, topic_announce_duration, topic_calendar_repeat, topic_vote) VALUES ('$post_subject', '$topic_desc', " . $userdata['user_id'] . ", $forcetime, $forum_id, $news_id, " . TOPIC_UNLOCKED . ", $topic_type, $post_icon, $topic_calendar_time, $topic_calendar_duration, " . intval($topic_announce_duration) . ", '$topic_calendar_repeat', $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_desc = '$topic_desc', news_id = $news_id, topic_type = $topic_type, $topic_type_active, topic_icon=$post_icon, topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration, topic_announce_duration = " . intval($topic_announce_duration) . "$extra, topic_calendar_repeat = '$topic_calendar_repeat'  " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";
//-- fin mod : post icon ---------------------------------------------------------------------------

I have no idea whats wrong cause the code is in there.
Post Reply

Return to “[2.0.x] MODs in Development”