Seite 1 von 1

Advanced Topic Type

Verfasst: 09.03.2005 13:50
von Marquee
Hallo,

ich habe arge Schwierigkeiten den o.g. Mod einzubauen...

Es scheint an 2 Punkten zu haken, einmal dass der Global Announce-Mod drin ist und einemal eine alte Version de Slpit-Mods.

Aber bereits beim Einbau hapert es :(

Ich hab versucht einzubauen, was einzubauen geht... ich würd mal sagen... 60% hab ich... aber 40% bleiben, wo ich Probleme hab :(

erstes Problem:

in der Anleitung steht (betrifft: funktions_post.php):

Code: Alles auswählen

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

$sql  =

#-----[ IN-LINE FIND ]----------------------------------------------
#

topic_type = $topic_type

#
#-----[ IN-LINE AFTER, ADD ]----------------------------------------------
#

 $topic_type_active
mir kommt es komisch vor, dass da kein Komma vor muss... oder zeigt sich hier wieder, dass ich keine Ahnung hab? *g*

zweites Problem:

lt. Anleitung muss ich dies (in der posting.php)

Code: Alles auswählen

//
// 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;
  }
}
gegen dies austauschen:

Code: Alles auswählen

// 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( $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>';
  }
  
  $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;
}
// END Advanced Topic Type MOD
bei mir sieht der Teil aber so aus:

Code: Alles auswählen

//
// 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( $is_auth['auth_globalannounce'] )

{

$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;';

}


	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;
	}
}
So wie ich das sehe, stört der global Announce Mod hier, oder?

Aber wie muss ich das anpassen?

drittes Problem:

diesmal betrifft es die viewforum.php

ich soll dies machen:

Code: Alles auswählen

#-----[ 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
bei mir sieht's aber so aus:

Code: Alles auswählen

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

Vielen Dank im voraus für Eure Hilfe...

Verfasst: 30.03.2005 09:30
von Zöllner
Hallo Maloon (oder Marquee?)

Zu deinem ersten Problem: Mir kam es auch komisch vor, dass da kein Komma hinkommt, und deshalb habe ich vorsorglich eins gesetzt und hatte auch prompt einen Fehler. Also Komma wieder raus und jetzt funktioniert alles.

Der Abschnitt sieht bei mir also so aus:

Code: Alles auswählen

"UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', news_id = $news_id, topic_type = $topic_type $topic_type_active " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";
Zu den anderen Problemen kann ich dir leider nicht helfen, aber da gibt es bestimmt Menschenkinder hier, die das können... ;-)

Herzliche Grüße,
MARC

Verfasst: 30.03.2005 10:47
von Marquee
Danke Marc :)

ich hatte das auch ohne Komma versucht... und tortzdem Fehlermeldungen :(

Es sind bei mir über 100 Mod's verbaut... sprich da passt irgendwas nicht... ich hab das aufgegeben :(

Trotzdem Danke nochmal :)

PS: Marquee war richtig.. hatte falsche Sig drin *g*