break-tag to the announcements of the ezPortal

Kleine Codeänderungen oder Mini-MODs
Keine Anfragen!!! -- No requests!!!

Moderator: Supporter

break-tag to the announcements of the ezPortal

Beitragvon AmigaLink » 16. Okt 2005 21:00

Code: Alles auswählen
#################################################################
## Mod Title:   Add a break-tag to the announcements of the ezPortal-Mod
## Mod Version:   0.2b
## Rev Date:   August, 14th, 2005
##
## Authors:   *Speedy* www.rwTools.de
##
## Description:   Adds a break-tag to the ezportal-news. Upon this tag a manual
##                break is executed, the news are stopped and the read-full is shown.
##        The [break] does not appear in read-full-mode, in the forum or as a button
##        next to the other bbcodes while posting
##
## Tested:      ezPortal
##
## Installation Level:   easy
## Installation Time:   1-5 Minutes
## Files To Edit:   3
##         portal.php
##         fetchposts.php
##         includes/bbcode.php
##
## Included Files:   no
##
#################################################################
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites
#################################################################
##
## Author Notes:
##
##   Mich störte immer der feste Wert wo die News umgebrochen wurden. Befindet
##   sich darin ein BBcode Tag oder etwas anderes, wird dies dann im Klartext
##   angezeigt und zerstört die Darstellung. Um diesem Problem entgegen zu treten.
##   Setzte ich die Newslänge auf 0, was jedoch den Nachteil hatte, dass die Newsanzeige
##   ziemlich lang wurde.
##
#################################################################
## Before Modifing The ezPortal MOD In Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
##
## Version History:
##
##   0.1 adding [break] tag to fetchposts.php
##   0.2 remove [break] tag in bbcode.php
##   0.2a updated install-text for standard ezPortal
##   0.2b made the install-text EM-compatible - no code changes whatsoever
##
#################################################################
## install.txt made by *Speedy*
#################################################################


#
#-----[ OPEN ]------------------------------------------
#
portal.php
#
#-----[ FIND ]------------------------------------------
#
$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], $CFG['news_length']);
#
#-----[ REPLACE WITH ]------------------------------------------
#
$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], $CFG['news_length'], 'true');
#
#-----[ FIND ]------------------------------------------
#
$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], 0);
#
#-----[ REPLACE WITH ]------------------------------------------
#
$fetchposts = phpbb_fetch_posts($CFG['news_forum'], $CFG['number_of_news'], 0, 'false');
#
#-----[ OPEN ]------------------------------------------
#
fetchposts.php
#
#-----[ FIND ]------------------------------------------
#
function phpbb_fetch_posts($forum_sql, $number_of_posts, $text_length)
#
#-----[ REPLACE WITH ]------------------------------------------
#
function phpbb_fetch_posts($forum_sql, $number_of_posts, $text_length, $bol_break)
#
#-----[ FIND ]------------------------------------------
#
         stripslashes($posts[$i]['post_text']);
#
#-----[ AFTER, ADD ]------------------------------------------
#
if (count(explode('[break]', $posts[$i]['post_text'])) == 2 && $bol_break == 'true'){

            $exp_news = explode('[break]', $posts[$i]['post_text']);
            $posts[$i]['post_text'] = $exp_news[0] . '...';
            $posts[$i]['post_text'] = bbencode_second_pass($posts[$i]['post_text'], $posts[$i]['bbcode_uid']);
            $posts[$i]['striped'] = 1;
           
         }
#
#-----[ FIND ]------------------------------------------
#
         if (($text_length == 0) or (strlen($posts[$i]['post_text']) <= $text_length))
#
#-----[ REPLACE WITH ]------------------------------------------
#
         elseif (($text_length == 0) or (strlen($posts[$i]['post_text']) <= $text_length))
#
#-----[ OPEN ]------------------------------------------
#
includes/bbcode.php
#
#-----[ FIND ]------------------------------------------
#
$text = " " . $text;
#
#-----[ AFTER, ADD ]------------------------------------------
#
$text = str_replace("[break]", "", $text);
// removing [break] tag in News

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Die deutsche Sprache ist Freeware, du kannst sie benutzen, ohne dafür zu bezahlen. Sie ist aber nicht Open Source, also darfst du sie nicht verändern, wie es dir gerade passt.
Benutzeravatar
AmigaLink
Administrator
 
Beiträge: 3987
Registriert: 11. Aug 2004 01:06
Wohnort: NRW

Zurück zu phpBB2 Snippets



Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 11 Gäste

cron