Habe alles zusammegefast in ein einzigem mod.
Die erstellung der neuen felder muss von hand gemacht werden und schrittweise.
Verbesserung , Ueberprüfung und Aenderungen sollten daher von jemand der mehr erfarung hat überbommen werden. Ich bin nur ein "newbe".
Code: Alles auswählen
##############################################################
## MOD Title: Extended_forum_infos
## MOD Author: (colorize mod) OXPUS < webmaster@oxpus.de > (Karsten Ude) http://www.oxpus.de
## MOD Author: upgrade and Compilation www.armuco.ch
## MOD Description: Gives admins the possibility to enter a color seperatly for each forumtitle.
## add also fields for: picture , url ,picture for url, and text for an url
## MOD Version: beta 1.0.0
##
## Installation Level: Easy
## Installation Time: 15 Minutes
## Files To Edit: 7
## index.php
## admin/admin_forums.php
## language/lang_english/lang_admin.php *not translated
## language/lang_german/lang_admin.php *not translated
## language/french_german/lang_admin.php *made
## templates/#yourtemplate#/index_body.tpl
## templates/#yourtemplate#/admin/forum_admin_body.tpl
## templates/#yourtemplate#/admin/forum_edit_body.tpl
##
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## database have to be made step by step for each field to be added.
## I'm just a beginner in SQL and php so if someone can make and a db_update.php and an easier SQL request
## it would be nice.
##
## If you have installed the Categories Hierarchy Mod, ONLY install the add-on!
##
##############################################################
## MOD History:
##
## 2005-07-12 - Version 1.0.0
## - First release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]--(step by step for each field) ----------------------------------------
#
ALTER TABLE phpbb_forums ADD COLUMN forum_color varchar(6) DEFAULT '' NOT NULL;
ALTER TABLE phpbb_forums ADD COLUMN forum_pict varchar(20) DEFAULT '' NOT NULL;
ALTER TABLE phpbb_forums ADD COLUMN forum_url varchar(80) DEFAULT '' NOT NULL;
ALTER TABLE phpbb_forums ADD COLUMN forum_upict varchar(80) DEFAULT '' NOT NULL;
ALTER TABLE phpbb_forums ADD COLUMN forum_utxt varchar(80) DEFAULT '' NOT NULL;
>Section suprimé
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
'FORUM_NAME' => $forum_data[$j]['forum_name'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'FORUM_COLOR' => ( $forum_data[$j]['forum_color'] != '' ) ? 'style="color: #'.$forum_data[$j]['forum_color'].'"' : '',
>fin Section suprimé
#
#-----[ OPEN ]------------------------------------------
#
admin/admin_forums.php
#
#-----[ FIND ]------------------------------------------
#
$forumdesc = $row['forum_desc'];
$forumstatus = $row['forum_status'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$forum_color = $row['forum_color'];
$forum_pict = $row['forum_pict'];
$forum_pict = $row['forum_url'];
$forum_pict = $row['forum_upict'];
$forum_pict = $row['forum_utxt'];
#
#-----[ FIND ]------------------------------------------
#
$forumdesc = '';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$forum_color = '';
$forum_pict = '';
$forum_url = '';
$forum_upict = '';
$forum_utxt = '';
#
#-----[ FIND ]------------------------------------------
#
$forumstatus == ( FORUM_LOCKED ) ? $forumlocked = "selected=\"selected\"" : $forumunlocked = "selected=\"selected\"";
#
#-----[ AFTER, ADD ]------------------------------------------
#
$forum_color = ( empty($forum_color) ) ? '' : $forum_color;
#
#-----[ FIND ]------------------------------------------
#
'L_FORUM_TITLE' => $l_title,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_FORUM_COLOR' => $lang['Forum_color'],
'L_FORUM_COLOR_EXPLAIN' => $lang['Forum_color_explain'],
'L_FORUM_PICT' => $lang['Forum_pict'],
'L_FORUM_URL' => $lang['Forum_url'],
'L_FORUM_UPICT' => $lang['Forum_upict'],
'L_FORUM_UTXT' => $lang['Forum_utxt'],
#
#-----[ FIND ]------------------------------------------
#
'FORUM_NAME' => $forumname,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'FORUM_COLOR' => $forum_color,
'FORUM_PICT' => $forum_pict,
'FORUM_URL' => $forum_url,
'FORUM_UPICT' => $forum_upict,
'FORUM_UTXT' => $forum_utxt,
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
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 ]------------------------------------------
#
, forum_name
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
,forum_color, forum_pict, forum_url, forum_upict, forum_utxt
#
#-----[ IN-LINE FIND ]------------------------------------------
#
'" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_color']) . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_pict']) . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_url']) . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_upict']) . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_utxt']) . "'
#
#-----[ 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_name = '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "'
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, forum_color = '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_color']) . "', forum_pict = '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_pict']) . "', forum_url = '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_url']) . "', forum_upict = '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_upict']) . "', forum_utxt = '" . str_replace("\'", "''", $HTTP_POST_VARS['forum_utxt']) . "'
#
#-----[ FIND ]------------------------------------------
#
'FORUM_NAME' => $forum_rows[$j]['forum_name'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'FORUM_COLOR' => ( $forum_rows[$j]['forum_color'] != '' ) ? 'style="color: #'.$forum_rows[$j]['forum_color'].'"' : '',
'FORUM_PICT' => $forum_rows[$j]['forum_pict'],
'FORUM_URL' => $forum_rows[$j]['forum_url'],
'FORUM_UPICT' => $forum_rows[$j]['forum_upict'],
'FORUM_UTXT' => $forum_rows[$j]['forum_utxt'],
#
#-----[ OPEN ]------------------------------------------
#
language/lang_french/lang_admin.php (translation not made )
#
#-----[ FIND ]------------------------------------------
#
$lang['Forum_edit_delete_explain'] = 'The form below will allow you to customize all the general board options. For User and Forum configurations use the related links on the left hand side';
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Forum_color'] = 'Set a color for the forum title';
$lang['Forum_color_explain'] = 'Leave this field blank to use the default color. Just enter the color number without leading \'#\'!';
$lang['Forum_url'] = 'additional Url for forum';
$lang['Forum_upict'] = 'Image for Url';
$lang['Forum_utxt'] = 'Text for Url';
# (french release)
$lang['Forum_color'] = 'Choix de la couleur du titre du forum';
$lang['Forum_color_explain'] = 'Laisser en blanc pour la couleur par défaut. Entrer le numéro de la couleur sans le signe \'#\' devant !';
$lang['Forum_pict'] = 'Choix d\'image pour le forum';
$lang['Forum_url'] = 'Lien supplémentaire pour le forum';
$lang['Forum_upict'] = 'Image du lien supplémentaire pour le forum';
$lang['Forum_utxt'] = 'Text du lien supplémentaire pour le forum';
#german release
$lang['Forum_color'] = 'Trage eine Farbe für den Forentitel ein.';
$lang['Forum_color_explain'] = 'Lass das Feld frei, um die Standardfarbe zu verwenden. Gib nur die Farbzahl ohne führende \'#\' ein!';
$lang['Forum_pict'] = 'Choix d\'image pour le forum';
$lang['Forum_url'] = 'Lien supplémentaire pour le forum';
$lang['Forum_upict'] = 'Image du lien supplémentaire pour le forum';
$lang['Forum_utxt'] = 'Text du lien supplémentaire pour le forum';
#
#-----[ OPEN ]------------------------------------------
#
templates/XXXyourtemplate/admin/forum_admin_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<td class="row2"><span class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}" target="_new">{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td>
#
#-----[ REPLACE WITH ]------------------------------------------
#
<td class="row2"><span {catrow.forumrow.FORUM_COLOR} class="gen"><a href="{catrow.forumrow.U_VIEWFORUM}" target="_new" {catrow.forumrow.FORUM_COLOR}>{catrow.forumrow.FORUM_NAME}</a></span><br /><span class="gensmall">{catrow.forumrow.FORUM_DESC}</span></td>
#
#-----[ OPEN ]------------------------------------------
#
templates/XXXyourtemplate/admin/forum_edit_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1">{L_FORUM_STATUS}</td>
<td class="row2"><select name="forumstatus">{S_STATUS_LIST}</select></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1" width="30%">{L_FORUM_COLOR}<br /><span class="gensmall">{L_FORUM_COLOR_EXPLAIN}</span></td>
<td class="row2"><input type="text" size="10" maxlength="6" name="forum_color" value="{FORUM_COLOR}" class="post" /></td>
</tr>
<tr>
<td class="row1" width="30%">{L_FORUM_PICT}<br /></td>
<td class="row2"><input type="text" size="20" maxlength="20" name="forum_pict" value="{FORUM_PICT}" class="post" /></td>
</tr>
<tr>
<td class="row1" width="30%">{L_FORUM_URL}<br /></td>
<td class="row2"><input type="text" size="20" maxlength="80" name="forum_url" value="{FORUM_URL}" class="post" /></td>
</tr>
<tr>
<td class="row1" width="30%">{L_FORUM_UPICT}<br /></td>
<td class="row2"><input type="text" size="20" maxlength="80" name="forum_upict" value="{FORUM_UPICT}" class="post" /></td>
</tr>
<tr>
<td class="row1" width="30%">{L_FORUM_UTXT}<br /></td>
<td class="row2"><input type="text" size="20" maxlength="80" name="forum_utxt" value="{FORUM_UTXT}" class="post" /></td>
</tr>
#How to use the new fields
#
#
#-----[ OPEN ]------------------------------------------
#
root/viewforum.php
#
#-----[ FIND ]------------------------------------------
#
'FORUM_NAME' => $forum_row['forum_name'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'FORUM_DESC' => $forum_row['forum_desc'],
'FORUM_COLOR' => $forum_row['forum_color'],
'FORUM_PICT' => $forum_row['forum_pict'],
'FORUM_URL' => $forum_row['forum_url'],
'FORUM_UPICT' => $forum_row['forum_upict'],
'FORUM_UTXT' => $forum_row['forum_utxt'],
#
#-----[ OPEN ]------------------------------------------
#
templates/xxxyourtemplate/viewforum_body.tpl
#
#-----[ Examples place somewere you want them ]------------------------------------------
# Color can be used for other text to.
<span class="maintitle" style="color:{FORUM_COLOR}" >{FORUM_NAME}</span><br />
#
<img src="templates/armuco1/images/{FORUM_PICT}" border="0" alt="{L_INDEX}" vspace="1" />
#
<a href="{FORUM_URL}"><img src="{FORUM_UPICT}" border="0" alt="{FORUM_UTXT}" /></a>
# or
<a href="{FORUM_URL}">{FORUM_UTXT}</a>
# if FORUM_DESC (forum description) is defind in viewforum.php , you can us it to somewhere.
{FORUM_DESC}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM