Seite 1 von 1

neue row farbe einfügen

Verfasst: 25.10.2007 22:10
von Elvis
Hallo,
im Standart Style subSilver gibt es ja row1, row2. diese werden zb über

Code: Alles auswählen

$theme['td_color1'] : $theme['td_color2'];
bzw

Code: Alles auswählen

{postrow.ROW_CLASS}
eingefügt.

wie kann ich jetzt eine neue Farbe hhinzufügen damit ich diese verwenden kann zb als "{postrow.ROW_CLASS_ROW10}" ?

das ganze soll für die viewtopic sein.

Verfasst: 26.10.2007 17:57
von Boecki91
Hier mein Vorschlag:

Wie immer Back-Up machen, vorher.

FINDE

Code: Alles auswählen

	//
	// Again this will be handled by the templating
	// code at some point
	//
	$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
	$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
Das müsste die Stelle sein wo die Farben zugewiesen werden.

nu würde ich Folgendes machen:
ERSETZE MIT:

Code: Alles auswählen

	//
	// Again this will be handled by the templating
	// code at some point
	//

/*
Vorher:
	$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
	$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
*/
	// $ans = Anzahl der verschiedenen ROWs
	$ans = 4;
	if ( ($i % $ans) == 0 )
	{
		$row_color = $theme['td_color1'];
		$row_class = $theme['td_class1'];
	}
	elseif ( ($i % $ans) == 1 )
	{
		$row_color = $theme['td_color2'];
		$row_class = $theme['td_class2'];
	}
	elseif ( ($i % $ans) == 2 )
	{
		$row_color = $theme['td_color3'];
		$row_class = $theme['td_class3'];
	}
	elseif ( ($i % $ans) == 3 )
	{
		$row_color = $theme['td_color4'];
		$row_class = $theme['td_class4'];
	}
	// Ende der Änderung
IOch hoffe du hast das System verstanden, und es funktioniert...

Verfasst: 26.10.2007 23:16
von Elvis
mmhh verstanden halbwegs, auch wenn es jetzt etwas blöde klinkt aber kannste mir mal für diesen Code ein Beispiel geben ?

Code: Alles auswählen

//
	// Again this will be handled by the templating
	// code at some point
	//
	$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
	$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
	$row_class_rev = ($row_class == $theme['td_class1']) ? $theme['td_class2'] : $theme['td_class1'];
   
	$template->assign_block_vars('postrow', array(
		'ROW_COLOR' => '#' . $row_color,
		'ROW_CLASS' => $row_class,
		'ROW_CLASS_REV' => $row_class_rev,
Das >$row_class_rev < damit wechsel ich die farbe row1 und row2 abwechselnt.