
The mod itself seems to work fine, it's only this "move every topic with advanced type to the top of the forum" I don't like.
Any ideas?
Yes, I've got this mod working on my old forum.KE5EHI wrote: Cusrious to see if anyone has updated this mod yet with all of the fixes?
I second this. It seems we are all having the same problem with this MOD. It appears to be working fine but the topic names don't show up next to the posts.bamavamp wrote:This mod needs to be removed as no one is providing help for it anymore. I have had this mod installed, and everything shows correctly in acp--no error messages--however when I try to pick one of my new topic types when posting a message, it posts as a normal post instead of TIPS or whatever type I had chosen.
Code: Select all
$replies = $topic_rowset[$i]['topic_replies'];
$topic_type = $topic_rowset[$i]['topic_type'];
Code: Select all
// BEGIN Advanced Topic Type MOD
//////////////////////////////////////////////////////////////////////////////////////
// little bugfix by lugsciath - without any warranty //
// the bug is very easy: only sticky and announce will be counted - that´s the bug. //
// just do it without any borders and see: it works. //
//////////////////////////////////////////////////////////////////////////////////////
$sql = "SELECT * FROM ". TOPIC_ADD_TYPE_TABLE ."";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}
if( $topic_type == POST_ANNOUNCE )
{
$topic_type = '<span style="color:'. $announce_color .'">'. $lang['Topic_Announcement'] . ' </span>';
}
else if( $topic_type == POST_STICKY )
{
$topic_type = '<span style="color:'. $sticky_color .'">'. $lang['Topic_Sticky'] . ' </span>';
}
else if( $topic_type == POST_TITLE_LINK )
{
$topic_type = '<span style="color:'. $weblink_color .'">'. $lang['Topic_Weblink'] . ' </span>';
}
else if( $topic_type > POST_GLOBAL_ANNOUNCE)
{
while ($tt_row = $db->sql_fetchrow($result))
{
$row[] = $tt_row;
$topic_type_color = '#'.$tt_row['topic_type_color'];
$topic_type_name = '#'.$tt_row['topic_type_name'];
}
///////////////////// End Lugsciath
for($j = 0; $j < count($row); $j++ )
{
if( intval($topic_rowset[$i]['topic_type'] - POST_ADD_TYPE) == $row[$j]['topic_type_order'])
{
$topic_type ='<span style="color:#'. $row[$j]['topic_type_color'] .'">'. $row[$j]['topic_type_name'] .':</span>';
}
}
}
// END Advanced Topic Type MOD
Code: Select all
else if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED )
{
$folder = $images['folder_locked'];
$folder_new = $images['folder_locked_new'];
}
Code: Select all
// BEGIN Advanced Topic Type MOD
else if( $topic_rowset[$i]['topic_type'] >= POST_ADD_TYPE)
{
if( $row[$i]['topic_type_image'] != '' )
{
$folder = $row[$i]['topic_type_image'];
$folder_new = $row[$i]['topic_type_image_new'];
}
else
{
$folder = $images['folder_topic_type'];
$folder_new = $images['folder_topic_type_new'];
}
}
// END Advanced Topic Type MOD
Code: Select all
if ( $mode == 'editpost' && ( ( $is_auth['auth_delete'] && $post_data['last_post'] && ( !$post_data['has_poll'] || $post_data['edit_poll'] ) ) || $is_auth['auth_mod'] ) )
{
$template->assign_block_vars('switch_delete_checkbox', array());
}
Code: Select all
// BEGIN Advanced Topic Type MOD
//
// 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( ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD ) && $is_auth['auth_post'] )
{
$topic_type_toggle .= '<option value="' . POST_TITLE_LINK . '"';
if ( $post_data['topic_type'] == POST_TITLE_LINK || $topic_type == POST_TITLE_LINK )
{
$topic_type_toggle .= ' selected';
}
$topic_type_toggle .= '>'. $lang['Post_Weblink'] . '</option>';
}
//eingefügt von Mod , eigentlich nur radios gegen liste
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>';
}
Code: Select all
$topic_type ='<span style="color:#'. $row[$j]['topic_type_color'] .'">'. $row[$j]['topic_type_name'] .':</span>';
Code: Select all
if( $row[$j]['topic_type_image'] != '' )
{
$folder = $row[$j]['topic_type_image'];
$folder_new = $row[$j]['topic_type_image_new'];
}
else
{
$folder = $images['folder_topic_type'];
$folder_new = $images['folder_topic_type_new'];
}
Code: Select all
// BEGIN Advanced Topic Type MOD
else if( $topic_rowset[$i]['topic_type'] >= POST_ADD_TYPE)
{
if( $row[$i]['topic_type_image'] != '' )
{
$folder = $row[$i]['topic_type_image'];
$folder_new = $row[$i]['topic_type_image_new'];
}
else
{
$folder = $images['folder_topic_type'];
$folder_new = $images['folder_topic_type_new'];
}
Code: Select all
else if( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED )
{
$folder = $images['folder_locked'];
$folder_new = $images['folder_locked_new'];
}
else
Code: Select all
else
Code: Select all
else if( $topic_rowset[$i]['topic_type'] < POST_ADD_TYPE )
Code: Select all
if( $row['topic_type_image'] != '' )
{
$tt_image = $phpbb_root_path . $row['topic_type_image'] ;
}
[code]
replace it with
[code]
if( $row['topic_type_image'] != '' )
{
$tt_image = $row['topic_type_image'] ;
}
Code: Select all
// BEGIN Advanced Topic Type MOD
//////////////////////////////////////////////////////////////////////////////////////
// little bugfix by lugsciath - without any warranty //
// the bug is very easy: only sticky and announce will be counted - that´s the bug. //
// just do it without any borders and see: it works. //
//////////////////////////////////////////////////////////////////////////////////////
$sql = "SELECT * FROM ". TOPIC_ADD_TYPE_TABLE ."";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}
if( $topic_type == POST_ANNOUNCE )
{
$topic_type = '<span style="color:'. $announce_color .'">'. $lang['Topic_Announcement'] . ' </span>';
}
else if( $topic_type == POST_STICKY )
{
$topic_type = '<span style="color:'. $sticky_color .'">'. $lang['Topic_Sticky'] . ' </span>';
}
else if( $topic_type == POST_TITLE_LINK )
{
$topic_type = '<span style="color:'. $weblink_color .'">'. $lang['Topic_Weblink'] . ' </span>';
}
else if( $topic_type > POST_GLOBAL_ANNOUNCE)
{
while ($tt_row = $db->sql_fetchrow($result))
{
$row[] = $tt_row;
$topic_type_color = '#'.$tt_row['topic_type_color'];
$topic_type_name = '#'.$tt_row['topic_type_name'];
}
///////////////////// End Lugsciath
for($j = 0; $j < count($row); $j++ )
{
if( intval($topic_rowset[$i]['topic_type'] - POST_ADD_TYPE) == $row[$j]['topic_type_order'])
{
$topic_type ='<span style="color:#'. $row[$j]['topic_type_color'] .'">'. $row[$j]['topic_type_name'] .':</span>';
}
}
}
// END Advanced Topic Type MOD
Code: Select all
if( $topic_type == POST_ANNOUNCE )
{
$topic_type = '<span style="color:'. $announce_color .'">'. $lang['Topic_Announcement'] . ' </span>';
}
else if( $topic_type == POST_STICKY )
{
$topic_type = '<span style="color:'. $sticky_color .'">'. $lang['Topic_Sticky'] . ' </span>';
}
else if( $topic_type == POST_TITLE_LINK )
{
$topic_type = '<span style="color:'. $weblink_color .'">'. $lang['Topic_Weblink'] . ' </span>';
}
// BEGIN Advanced Topic Type MOD
//////////////////////////////////////////////////////////////////////////////////////
// little bugfix by lugsciath - without any warranty //
// the bug is very easy: only sticky and announce will be counted - that´s the bug. //
// just do it without any borders and see: it works. //
//////////////////////////////////////////////////////////////////////////////////////
// $sql = "SELECT * FROM ". TOPIC_ADD_TYPE_TABLE ." WHERE `topic_type_id` > '0';";
$sql = "SELECT * FROM ". TOPIC_ADD_TYPE_TABLE ."";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}
// else if( $topic_type > POST_GLOBAL_ANNOUNCE)
else if( $topic_type > POST_TITLE_LINK)
{
while ($tt_row = $db->sql_fetchrow($result))
{
$row[] = $tt_row;
$topic_type_color = '#'.$tt_row['topic_type_color'];
$topic_type_name = '#'.$tt_row['topic_type_name'];
}
///////////////////// End Lugsciath
for($j = 0; $j < count($row); $j++ )
{
if( intval($topic_rowset[$i]['topic_type'] - POST_ADD_TYPE) == $row[$j]['topic_type_order'])
{
$topic_type ='<span style="color:#'. $row[$j]['topic_type_color'] .'">'. $row[$j]['topic_type_name'] .':</span>';
/* // BEGIN Advanced Topic Type MOD
else if( $topic_rowset[$i]['topic_type'] >= POST_ADD_TYPE)
{
if( $row[$i]['topic_type_image'] != '' )
{
$folder = $row[$i]['topic_type_image'];
$folder_new = $row[$i]['topic_type_image_new'];
}
else
{
$folder = $images['folder_topic_type'];
$folder_new = $images['folder_topic_type_new'];
}
}
// END Advanced Topic Type MOD
*/
if( $row[$j]['topic_type_image'] != '' )
{
$folder = $row[$j]['topic_type_image'];
$folder_new = $row[$j]['topic_type_image_new'];
}
else
{
$folder = $images['folder_topic_type'];
$folder_new = $images['folder_topic_type_new'];
}
}
}
}
// END Advanced Topic Type MOD
Code: Select all
else
{
$topic_type = '';
}
Code: Select all
define('POST_TITLE_LINK', 99);
Code: Select all
define('POST_TITLE_LINK', 4);
Code: Select all
$all_topic_types = array(POST_NORMAL, POST_STICKY, POST_ANNOUNCE);
Code: Select all
$all_topic_types = array(POST_NORMAL, POST_STICKY, POST_ANNOUNCE, POST_TITLE_LINK, POST_GLOBAL_ANNOUNCE);
[code]
Code: Select all
$replies = $topic_rowset[$i]['topic_replies'];
$topic_type = $topic_rowset[$i]['topic_type'];
above should be single quotes at end of the line with no space between - shown in that way: ' '
if( $topic_type == '0')$topic_type = '';