Seite 1 von 2

{catrow.forumrow.FORUM_ICON_IMG} als HG-Bild?

Verfasst: 01.10.2004 09:50
von grizzlibaer
Hi, hab mir den MOD "Forum Icon with ACP Control" installiert.
Funktioniert einwandfrei. Ich hab jetzt versucht das als Hintergrundbild einzubinden. Leider funktioniert das nicht. Nehme an es liegt erstens an den Klammern und zweitens das es keine img-Endung hat. Gibt es trotzdem eine Möglich das zu realisieren?

gruß
grizzli

PS: soll kein noremales HG-Bild sein, sondern würde dieses gerne für jedes Forum über das ACP einstellen

Verfasst: 01.10.2004 13:12
von Mungo
Wenn du den Mod schon installiert hast, dann versuch es mal so:

Code: Alles auswählen

# 
#-----[ OPEN ]------------------------------------------ 
#  
admin/admin_forums.php

# 
#-----[ FIND ]------------------------------------------ 
# 
					'FORUM_ICON_IMG' => ( $forum_rows[$j]['forum_icon'] ) ? '<img src="' . $phpbb_root_path . $forum_rows[$j]['forum_icon'] . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : '', // Forum Icon Mod

#
#-----[ REPLACE WITH ]------------------------------------------
#
          'FORUM_ICON_IMG' => ( $forum_rows[$j]['forum_icon'] ) ? $phpbb_root_path . $forum_rows[$j]['forum_icon'] : '', // Forum Icon Mod

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

# 
#-----[ FIND ]------------------------------------------ 
# 
								'FORUM_ICON_IMG' => ($icon) ? '<img src="' . $phpbb_root_path . $icon . '" alt="'.$forum_data[$j]['forum_name'].'" title="'.$forum_data[$j]['forum_name'].'" />' : '',	// Forum Icon Mod

#
#-----[ REPLACE WITH ]------------------------------------------
#
                'FORUM_ICON_IMG' => ($icon) ? $phpbb_root_path . $icon : '',	// Forum Icon Mod

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

# 
#-----[ FIND ]------------------------------------------ 
# 
	'FORUM_ICON_IMG' => ($forum_row['forum_icon']) ? '<img src="' . $phpbb_root_path . $forum_row['forum_icon'] . '" alt="'.$forum_row['forum_name'].'" title="'.$forum_row['forum_name'].'" />&nbsp;' : '',	// Forum Icon Mod Icon Mod

#
#-----[ REPLACE WITH ]------------------------------------------
#
'FORUM_ICON_IMG' => ($forum_row['forum_icon']) ? $phpbb_root_path . $forum_row['forum_icon'] : '',	// Forum Icon Mod Icon Mod

# 
#-----[ OPEN ]------------------------------------------ 
#  
templates/subSilver/admin/forum_admin_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
		<td class="row2"><span class="gen">{catrow.forumrow.FORUM_ICON_IMG}&nbsp;&nbsp;<a href="{catrow.forumrow.U_VIEWFORUM}" target="_new">{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td>

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
class="row2"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 
 style="background-image:url({catrow.forumrow.FORUM_ICON_IMG});"

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
{catrow.forumrow.FORUM_ICON_IMG}&nbsp;&nbsp;

# 
#-----[ DELETE ]------------------------------------------ 
#
{catrow.forumrow.FORUM_ICON_IMG}&nbsp;&nbsp;

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

# 
#-----[ FIND ]------------------------------------------ 
# 
	<th colspan="3" class="thCornerL" height="25" nowrap="nowrap">&nbsp;{L_FORUM}&nbsp;</th>

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
colspan="3"

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
colspan="2"

# 
#-----[ FIND ]------------------------------------------ 
#
	<td class="catLeft" colspan="3" height="28"><span class="cattitle"><a href="{catrow.U_VIEWCAT}" class="cattitle">{catrow.CAT_DESC}</a></span></td>

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
colspan="3"

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
colspan="2"

# 
#-----[ FIND ]------------------------------------------ 
#
  <!-- BEGIN forumrow -->
  <tr>

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
  <!-- BEGIN forumrow -->
  <tr style="background-image:url({catrow.forumrow.FORUM_ICON_IMG});">

# 
#-----[ FIND ]------------------------------------------ 
#
	<td class="row1" align="center" valign="middle" height="50">{catrow.forumrow.FORUM_ICON_IMG}</td>

# 
#-----[ DELETE ]------------------------------------------ 
#
	<td class="row1" align="center" valign="middle" height="50">{catrow.forumrow.FORUM_ICON_IMG}</td>

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

# 
#-----[ FIND ]------------------------------------------ 
# 
	  <td align="left" valign="bottom" colspan="2">{FORUM_ICON_IMG}<a class="maintitle" href="{U_VIEW_FORUM}">{FORUM_NAME}</a>

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
{FORUM_ICON_IMG}

# 
#-----[ DELETE ]------------------------------------------ 
# 
{FORUM_ICON_IMG}

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 

# EoM

Verfasst: 01.10.2004 14:37
von grizzlibaer
Vielen lieben Dank Mungo,

es klappt super :D

gruß
grizzli

Verfasst: 01.10.2004 17:27
von grizzlibaer
noch eine Frage:
gibt es da auch die Möglich ein eigenes HG-Bild für ein Posting zu machen?ala "{catrow.forumrow.FORUM_ICON_IMG}" ...

Meine damit die viewforum_body.tpl

gruß
grizzli

Verfasst: 01.10.2004 17:33
von Mungo
Also im "Forum 1" bzw. "Forum 2" sollen die Topics in der viewforum_body.tpl das gleiche Hintergrundbild haben, wie "Forum 1" bzw. "Forum 2" auf dem Index?

Verfasst: 01.10.2004 18:06
von grizzlibaer
jo kann sein, das hab ich nicht eingefügt (würde sonst echt komisch aussehen)

ich bräuchte unterschiedliche für die Postings, also nicht die die auf der Indexseite sind.
Oder anders gesagt. Genau die Funktion mit den HG-Bildern in der index_body bräuchte ich für die viewforum_body

Wird aber wohl nicht gehn oder?

gruß
grizzli

Verfasst: 07.10.2004 13:14
von Mungo
Sorry, dass ich erst jetzt antworte.
Ich hab mal den Mod angepasst. Hoffe ich hab nichts vergessen.

Code: Alles auswählen

# 
#-----[ SQL ]------------------------------------------ 
#
# Remember to change the table prefix used on your database
ALTER TABLE `phpbb_forums` ADD `topic_bg` VARCHAR( 255 ) default NULL;

# 
#-----[ OPEN ]------------------------------------------ 
# 
language/lang_english/lang_admin.php

# 
#-----[ FIND ]------------------------------------------ 
#
$lang['Forum_status'] = 'Forum status';

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
$lang['Topic_bg'] = 'Topic Background'; // Topic Background MOD

# 
#-----[ OPEN ]------------------------------------------ 
#  
admin/admin_forums.php

# 
#-----[ FIND ]------------------------------------------ 
# 
				$forumstatus = $row['forum_status'];


# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
				$topicbg = $row['topic_bg']; // Topic Background MOD

# 
#-----[ FIND ]------------------------------------------ 
# 
				$forumstatus = FORUM_UNLOCKED;

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
				$topicbg = ''; // Topic Background MOD

# 
#-----[ FIND ]------------------------------------------ 
# 
				'L_FORUM_STATUS' => $lang['Forum_status'],

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
				'L_TOPIC_BG' => $lang['Topic_bg'], // Topic Background MOD

# 
#-----[ FIND ]------------------------------------------ 
#
				'DESCRIPTION' => $forumdesc)

# 
#-----[ REPLACE WITH ]------------------------------------------ 
#
				'DESCRIPTION' => $forumdesc,
				'TOPIC_BG' => ( $topicbg ) ? $topicbg : '', // Topic Background MOD 
				'TOPIC_BG_DISPLAY' => ( $topicbg ) ? '<img src="' . $phpbb_root_path . $topicbg . '" />' : '' // Topic Background MOD 
				)

# 
#-----[ FIND ]------------------------------------------ 
#
			// There is no problem having duplicate forum names so we won't check for it.
			$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")

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

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

# 
#-----[ FIND ]------------------------------------------ 
#
				VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
, " . intval($HTTP_POST_VARS['forumstatus']) . "

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 
, '" . str_replace("\'", "''", $HTTP_POST_VARS['topicbg']) . "'

# 
#-----[ FIND ]------------------------------------------ 
#
			$sql = "UPDATE " . FORUMS_TABLE . "
				SET forum_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", forum_desc = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . ", prune_enable = " . intval($HTTP_POST_VARS['prune_enable']) . "
				WHERE forum_id = " . intval($HTTP_POST_VARS[POST_FORUM_URL]);
# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
, forum_status = " . intval($HTTP_POST_VARS['forumstatus']) . "

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 
, topic_bg = '" . str_replace("\'", "''", $HTTP_POST_VARS['topicbg']) . "'

# 
#-----[ FIND ]------------------------------------------ 
# 
					'FORUM_DESC' => $forum_rows[$j]['forum_desc'],

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
					'TOPIC_BG_IMG' => ( $forum_rows[$j]['topic_bg'] ) ? $phpbb_root_path . $forum_rows[$j]['topic_bg'] : '', // Topic Background MOD

# 
#-----[ OPEN ]------------------------------------------ 
#  
viewtopic.php

# 
#-----[ FIND ]------------------------------------------ 
# 
$sql = "SELECT t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments" . $count_sql . "

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
f.forum_status

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 
, f.topic_bg

# 
#-----[ FIND ]------------------------------------------ 
# 
$topic_id = intval($forum_topic_data['topic_id']);
$topic_time = $forum_topic_data['topic_time'];

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
$topic_bg = $forum_topic_data['topic_bg'];		// Topic Background MOD

# 
#-----[ FIND ]------------------------------------------ 
# 
	'POST_IMG' => $post_img,
	'REPLY_IMG' => $reply_img,

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	'TOPIC_BG_IMG' => ($topic_bg) ? $phpbb_root_path . $topic_bg : '',	// Topic Background MOD

# 
#-----[ OPEN ]------------------------------------------ 
#  
templates/subSilver/admin/forum_edit_body.tpl

# 
#-----[ FIND ]------------------------------------------ 
# 
	<tr> 
	  <td class="row1">{L_FORUM_NAME}</td> 
	  <td class="row2"><input type="text" size="25" name="forumname" value="{FORUM_NAME}" class="post" /></td> 
	</tr> 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	<tr> 
	  <td class="row1">{L_TOPIC_BG}</td>
	  <td class="row2"><input type="text" size="35" name="topicbg" value="{TOPIC_BG}" class="post" />&nbsp;&nbsp;&nbsp;{TOPIC_BG_DISPLAY}</td>
	</tr>

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

# 
#-----[ FIND ]------------------------------------------ 
# 
	  <td width="150" align="left" valign="top" class="{postrow.ROW_CLASS}">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
class="{postrow.ROW_CLASS}"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 
 style="background-image: url({TOPIC_BG_IMG});"
 
# 
#-----[ FIND ]------------------------------------------ 
# 
		<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="top">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
class="{postrow.ROW_CLASS}"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 
 style="background-image: url({TOPIC_BG_IMG});"

# 
#-----[ FIND ]------------------------------------------ 
# 
		<td class="{postrow.ROW_CLASS}" width="150" align="left" valign="middle">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
class="{postrow.ROW_CLASS}"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 
 style="background-image: url({TOPIC_BG_IMG});"
 
# 
#-----[ FIND ]------------------------------------------ 
# 
		<td class="{postrow.ROW_CLASS}" width="100%" height="28" valign="bottom" nowrap="nowrap">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
class="{postrow.ROW_CLASS}"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
# 
 style="background-image: url({TOPIC_BG_IMG});"

# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 

# EoM

Verfasst: 08.10.2004 16:06
von grizzlibaer
vielen lieben Dank Mungo :)

bin grad dabei das zu machen, jetzt fällt mir grad eins auf:
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
- das soll nicht daür sein, sondern für die viewforum ....

kann ich statt dessen jetzt einfach die viewforum_body öffnen und da weitermachen?

gruß
grizzli

Verfasst: 09.10.2004 12:53
von Mungo
:oops: Sorry.

Du müsstest dann statt der viewtopic.php die viewforum.php wie folgt bearbeiten:

Code: Alles auswählen

viewforum.php

# 
#-----[ FIND ]------------------------------------------ 
# 
	'FORUM_NAME' => $forum_row['forum_name'],
	
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
	'TOPIC_BG_IMG' => ($forum_row['topic_bg']) ? $phpbb_root_path . $forum_row['topic_bg'] : '',	// Topic Background MOD
und die viewforum_body.tpl statt der viewtopic_body.tpl

Code: Alles auswählen

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

# 
#-----[ FIND ]------------------------------------------ 
#
<td class="row1" align="center" valign="middle" width="20">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
<td class="row1"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 style="background-image: url({TOPIC_BG_IMG});"
 
# 
#-----[ FIND ]------------------------------------------ 
#
<td class="row1" width="100%">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
<td class="row1"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 style="background-image: url({TOPIC_BG_IMG});"

# 
#-----[ FIND ]------------------------------------------ 
#
<td class="row2" align="center" valign="middle">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
<td class="row2"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 style="background-image: url({TOPIC_BG_IMG});"

# 
#-----[ FIND ]------------------------------------------ 
#
<td class="row3" align="center" valign="middle">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
<td class="row3"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 style="background-image: url({TOPIC_BG_IMG});" 

# 
#-----[ FIND ]------------------------------------------ 
#
<td class="row2" align="center" valign="middle">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
<td class="row2"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 style="background-image: url({TOPIC_BG_IMG});"
 
# 
#-----[ FIND ]------------------------------------------ 
#
<td class="row3Right" align="center" valign="middle" nowrap="nowrap">

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
#
<td class="row3Right"

# 
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
 style="background-image: url({TOPIC_BG_IMG});"

Verfasst: 09.10.2004 14:43
von grizzlibaer
SUPI :) - macht nichts, jetzt könnte ich ja auch die andere VErändern wenn ich möchte ;)

Jetzt hab ich ein Problem :( Ich bekomm im Adminbereich folgende Fehlermeldung:

Code: Alles auswählen

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /usr/local/www/.../..../www.domain.de/.../forum/admin/admin_forums.php on line 356
Line 356 in der admin_forums:

Code: Alles auswählen

'ICON' => ( $forumicon ) ? $forumicon : '', // Forum Icon MOD 
Ich kann da nichts ungewöhnliches finden. Die Zeile hab ich auch nicht geändert. :o

gruß
grizzli