Seite 1 von 1

Simple Wordwrap MOD

Verfasst: 13.07.2006 17:41
von warefare.net
Hi bin neu hier
Nunja auf meinen letzten account kann ich net mehr zugreifen
warum auch immer :x


Ich hab einen kleinen mod geschrieben, naja eher ein snippet weils nicht allzu viel ist und auch keine neuen dateien benötigt




Um was geht es in diesem Snippet?

Nunja mich hat es ein wenig gestört das ich meine tabellen nicht verkleinern konnte weil der content zu groß war. Nun kann man über das ACP bestimmte wordwraps festlegen, d.h. nach welchem Buchstaben der Inhalt umgebrochen werden soll z.B. für topic titel etc.
Als ausbau hat ich mir gedacht könnte man noch die Tabellengröße im adminbereich einstellen und für den download mod (der mir sehr gut gefällt) ein paar wordwraps einfügen.


Würde mich sehr freuen wenns einer mal ausprobiert und etwas feedback gibt und ggf. fehler meldet.



Code: Alles auswählen


###########################################################################
## MOD Title:                  Simple Wordwrap
## MOD Author:                 Oliver Steinmetz < admin@warefare.net > http://warefare.net/
## MOD Beschreibung:           This mod makes it possible to define the amount of letters 
##                             after a wordwrap occurs for certain (sometimes) very long 
##                             content that would break your tables (e.g. post content). 
##                             You can adjust the settings of the wordwrap so that you                                        ##                             can reduce the forum width (adjust table width in the                                          ##                             overall_header.tpl).     
##                             Adjust the wordwrap settings under "ACP" -> "Configuration" -> "WORDWRAP"                      ##   
## MOD Version: 1.0.0
##
## Installation Level:         easy
## Installation Time:          5 min
## Files To Edit:              
##                             - admin/admin_board.php                         
##                             - templates/YOUR_TEMPLATE_STYLE/admin/board_config_body.tpl
##                             - language/lang_english/lang_admin.php
##
##                             - templates/YOUR_TEMPLATE_STYLE/overallheader.tpl
##                             - templates/YOUR_TEMPLATE_STYLE/overall_footer.tpl
##                             - vieforum.php
##                             - index.php
##                             - vietopic.php
##
##
## Included Files: n/a
###########################################################################
## Author Notes:
##
## Mod optimized for phpBB2 2.0.21
## 
##
###########################################################################
## MOD History:                2006-07-13 - Version 1.0.0
##                             - First version of the MOD.
##
##########################################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##########################################################################################

#
#-----[ SQL ]--------------------------------------------------------------
# // Adjust table prefix please
INSERT INTO `phpbb_config` (`config_name`, `config_value`) VALUES ('wrapheadline','60');
INSERT INTO `phpbb_config` (`config_name`, `config_value`) VALUES ('wrapcategory','60');
INSERT INTO `phpbb_config` (`config_name`, `config_value`) VALUES ('wrapforum','60');
INSERT INTO `phpbb_config` (`config_name`, `config_value`) VALUES ('wrappost_title','40');
INSERT INTO `phpbb_config` (`config_name`, `config_value`) VALUES ('wrappost_title_vtopic','40');
INSERT INTO `phpbb_config` (`config_name`, `config_value`) VALUES ('wrappost_content','70');



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


#
#-----[ FIND ]-------------------------------------------------------------
#
"L_SITE_NAME" => $lang['Site_name'],

#
#-----[ AFTER, ADD ]-------------------------------------------------------------
#
        "L_WRAPHEADLINE" => $lang['wrapheadline'],
        "L_WRAPCATEGORY" => $lang['wrapcategory'],
        "L_WRAPFORUM" => $lang['wrapforum'],
        "L_WRAPPOST_TITLE" => $lang['wrappost_title'],
        "L_WRAPPOST_TITLE_VTOPIC" => $lang['wrappost_title_vtopic'],
        "L_WRAPPOST_CONTENT" => $lang['wrappost_content'],

#
#-----[ FIND ]-------------------------------------------------------------
#
"SITENAME" => $new['sitename'],

#
#-----[ AFTER, ADD ]-------------------------------------------------------------
#
        "WRAPHEADLINE" => $new['wrapheadline'],
        "WRAPCATEGORY" => $new['wrapcategory'],
        "WRAPFORUM" => $new['wrapforum'],
        "WRAPPOST_TITLE" => $new['wrappost_title'],
        "WRAPPOST_TITLE_VTOPIC" => $new['wrappost_title_vtopic'],
        "WRAPPOST_CONTENT" => $new['wrappost_content'],









#
#-----[ OPEN ]-------------------------------------------------------------
#
templates/YOUR_TEMPLATE_STYLE/admin/board_config_body.tpl

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

<tr>
		<td class="row1">{L_SITE_NAME}<br /><span class="gensmall">{L_SITE_NAME_EXPLAIN}</span></td>
		<td class="row2"><input class="post" type="text" size="25" maxlength="100" name="sitename" 
                value="{SITENAME}" /></td>
</tr>
#
#-----[ AFTER, ADD ]-------------------------------------------------------------
#
<tr>
		<td class="row1">{L_WRAPHEADLINE}</td>
		<td class="row2"><input class="post" type="text" name="wrapheadline" size="3" maxlength="4"                                   value="{WRAPHEADLINE}" /></td>
</tr>

<tr>
		<td class="row1">{L_WRAPCATEGORY}</td>
		<td class="row2"><input class="post" type="text" name="wrapcategory" size="3" maxlength="4"                                   value="{WRAPCATEGORY}" /></td>
</tr>

<tr>
		<td class="row1">{L_WRAPFORUM}</td>
		<td class="row2"><input class="post" type="text" name="wrapforum" size="3" maxlength="4" 
                value="{WRAPFORUM}" /></td>
</tr>

<tr>
                <td class="row1">{L_WRAPPOST_TITLE}</td>
                <td class="row2"><input class="post" type="text" name="wrappost_title" size="3" maxlength="4"                                 value="{WRAPPOST_TITLE}" /></td>
</tr>
	
<tr>
                <td class="row1">{L_WRAPPOST_TITLE_VTOPIC}</td>
                <td class="row2"><input class="post" type="text" name="wrappost_title_vtopic" size="3" maxlength="4"                           value="{WRAPPOST_TITLE_VTOPIC}" /></td>
</tr>	

<tr>
                 <td class="row1">{L_WRAPPOST_CONTENT}</td>
                 <td class="row2"><input class="post" type="text" name="wrappost_content" size="3" maxlength="4"                               value="{WRAPPOST_CONTENT}" /></td>
</tr>








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

#
#-----[ FIND ]-------------------------------------------------------------
#
$lang['Site_name'] = 'Site name';

#
#-----[ AFTER, ADD ]-------------------------------------------------------------
#
$lang['wrapheadline'] = 'WORDWRAP Headline Index.php';
$lang['wrapcategory'] = 'WORDWRAP Forum Category Index.php';
$lang['wrapforum'] = 'WORDWRAP Forum Name Index.php';
$lang['wrappost_title'] = 'WORDWRAP Forum Post Title Viewforum.php';
$lang['wrappost_title_vtopic'] = 'WORDWRAP Forum Post Title ViewTopic.php';
$lang['wrappost_content'] = 'WORDWRAP Forum Post Content Viewtopic.php';







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

#
#-----[ FIND ]-------------------------------------------------------------
#
'MESSAGE' => $message,
#
#-----[ REPLACE WITH]-------------------------------------------------------------
#
'MESSAGE' => wordwrap($message, $board_config['wrappost_content'], "\n", 1),
#
#-----[ FIND ]-------------------------------------------------------------
#
'TOPIC_TITLE' => $topic_title,
#
#-----[ REPLACE WITH]-------------------------------------------------------------
#
'TOPIC_TITLE' => wordwrap($topic_title,$board_config['wrappost_title_vtopic'], "\n", 1),






#
#-----[ OPEN ]-------------------------------------------------------------
#
viewforum.php
#
#-----[ FIND ]-------------------------------------------------------------
#
'TOPIC_TITLE' => $topic_title,
#
#-----[ REPLACE WITH ]-------------------------------------------------------------
#
'TOPIC_TITLE' =>  wordwrap($topic_title,$board_config['wrappost_title'], "\n", 1),







#
#-----[ OPEN ]-------------------------------------------------------------
#
index.php
#
#-----[ FIND ]-------------------------------------------------------------
#
'L_FORUM' => $lang['Forum'],
#
#-----[ REPLACE WITH ]-------------------------------------------------------------
#
'L_FORUM' => wordwrap($lang['Forum'], $board_config['wrapheadline'], "\n", 1),
#
#-----[ FIND ]-------------------------------------------------------------
#
'CAT_DESC' => $category_rows[$i]['cat_title'],
#
#-----[ REPLACE WITH ]-------------------------------------------------------------
#
'CAT_DESC' => wordwrap($category_rows[$i]['cat_title'], $board_config['wrapcategory'], "\n", 1),
#
#-----[ FIND ]-------------------------------------------------------------
#
'FORUM_NAME' => $forum_data[$j]['forum_name'],
#
#-----[ REPLACE WITH ]-------------------------------------------------------------
#
'FORUM_NAME' => wordwrap($forum_data[$j]['forum_name'],$board_config['wrapforum'], "\n", 1),







#
#-----[ OPEN ]-------------------------------------------------------------
#
templates/YOUR_TEMPLATE_STYLE/overall_header.tpl

#
#-----[ FIND ]-------------------------------------------------------------
#
<body bgcolor="{T_BODY_BGCOLOR}" text="{T_BODY_TEXT}" link="{T_BODY_LINK}" vlink="{T_BODY_VLINK}">
#
#-----[ BEFORE ADD ]-------------------------------------------------------------
#
<table width="80%" cellspacing="0" cellpadding="10" border="0" align="center">
<tr>
<td>

#
#-----[ NOTE ]-------------------------------------------------------------
#

Change the width of your table here (table width="80%") and adjust the wordwrap @ ACP 






#
#-----[ OPEN ]-------------------------------------------------------------
#
templates/YOUR_TEMPLATE_STYLE/verall_footer.tpl

#
#-----[ FIND ]-------------------------------------------------------------
#
<div align="center"><span class="copyright"><br />{ADMIN_LINK}<br />
#
#-----[ BEFORE ADD ]-------------------------------------------------------------
#
</td>
</tr>
</table>

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



Download:
http://warefare.net/SimpleWordwrapMOD/S ... %20MOD.rar

Verfasst: 17.07.2006 02:06
von warefare.net
hat keiner mal ausprobiert ? :o

Verfasst: 17.07.2006 16:58
von Underhill
Hier ich! <meld>

nachdem ich ihn erstmal EasyMOD Kompatibel gemacht habe (Quelltext gerne als PN) und auf einem Vanilla phpBB2.0.21 installiert habe, muss ich folgendes melden:

- Die Vorschau wird nicht veraendert
- Links werden auch umgebrochen

mehr habe ich auf die schnelle nicht getestet...

Tipp: Schau dir mal "meinen" MOD an:
http://www.underhill.de/downloads/phpbb ... hricht.txt
der in Kombination mit Chunk Long URLs:
http://www.phpbb.com/phpBB/viewtopic.php?t=362611
genau das gleiche macht (nur nicht gang so Komfortabel)...


Gruss
Underhill

Verfasst: 06.10.2006 16:48
von warefare.net
Hmm wow was ich ja ma total verwirrend find is das es phpbb.de und phpbb2.de gibt :x
ich lande immer auf phpbb2.de und google findet was ich hier gepostet habe auch nicht mehr !

naja egal also das mit dem chunk mod hört sich gut an, kann man ja dann drauf verweisen, dass man das auch einbauen sollte
werd das ganze wohl noch etwas erweitern, hab bei mir im forum auch noch das ganze für den download mod, da gibts nämlich einige dinge die zu lang werden können und alles verhauen
easymod hab ich noch nie benutzt, ich bau immer alles per hand ein
aber wäre wohl recht nützlich :>