Ezportal - Je nach Forum-Id unterschiedliche Fetchposts

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
PhaD
Mitglied
Beiträge: 137
Registriert: 13.08.2006 19:06

Ezportal - Je nach Forum-Id unterschiedliche Fetchposts

Beitrag von PhaD »

Hallo phpbb.de!

Ich möchte eine Seite via Ezportal betreiben und News aus unterschiedlichen Foren im Portal posten, wobei jede News (grafisch) unterscheidbar sein soll, jenachdem aus welchem Forum sie stammt.

z.B. Eine News aus dem Bereich "Foto" und eine aus dem bereich "Video", beide werden auf dem Portal unterschiedlich dargestellt, also nur einfach eine andere Tabelle in der tpl, wenn das forum eine bestimmte id hat.

So kann ich News aus dem Bereich Foto, farblich oder auch durch ein Bild von den anderen News Differenzieren.
Dies sieht man heutzutage ja eigentlich bei jeder 2ten Seite, aber wie kann ich das bei phpbb2 machen ?

Vielen Dank für eure Hilfe!
PhaD
Mitglied
Beiträge: 137
Registriert: 13.08.2006 19:06

Beitrag von PhaD »

Code: Alles auswählen

##############################################################
## MOD Title: Category Images on front Page of ez-portal using announcements
## MOD Author: whoo <whoo@0ff.org> http://twocents.kuclan.com
## MOD Description: This Mod lets you have seperate images for announcements/news posts on your portal.php
##
##
##
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: ~3 minutes
## Files To Edit:
## templates/YOUR_TEMPLATE/portal_body.tpl
## portal.php
## fetchposts.php
##
## Included Files: n/a
##############################################################
## Author Notes:
##
##
##
## This Mod lets you have seperate images for announcements/news posts on your portal.php.
## Note, this works if you are using "news on portal" in ez-portal. The images MUST be named according to the forum_id
## So, if you want a seperate image for a news category thats forum_id is 12, the image MUST be called 12.gif.
## An image used for somemorenews category with a forum_id of 20 would need to be called 20.gif. The images need to be in
## your phpbb root dir.
##
## See my forum for a demo.
##
##############################################################
## MOD History:
##
## 2003-09-21 - Version 1.0.0.
## - Initial Release
##############################################################
## MOD Localisation:
##
## N/A
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
portal.php

#
#-----[ FIND ]------------------------------------------
#
$open_bracket = '';
$close_bracket = '';
$read_full = '';
}

$template->assign_block_vars('fetchpost_row', array(


#
#-----[ AFTER, ADD ]------------------------------------------
#
'NEWSIMG' => $fetchposts[$i]['forum_id'].".gif",


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

$i = intval($HTTP_GET_VARS['article']);

$template->assign_block_vars('fetchpost_row', array(


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

'NEWSIMG' => $fetchposts[$i]['forum_id'].".gif",

#
#-----[ OPEN ]------------------------------------------
#

templates/YOUR_TEMPLATE/portal_body.tpl

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

<!-- BEGIN fetchpost_row -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="25"><span class="genmed"><b>{L_ANNOUNCEMENT}: {fetchpost_row.TITLE}</b></span></td>
</tr>
<tr>
<td class="row2" align="left" height="24"><span class="gensmall">

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

<img src="{fetchpost_row.NEWSIMG}">

#-----[ OPEN ]------------------------------------------
#
fetchposts.php

#
#-----[ FIND ]------------------------------------------
#
// fetch all postings
//
$posts = array();
if ($row = $db->sql_fetchrow($result))
{
$i = 0;
do
{

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

$posts[$i]['forum_id'] = $row['forum_id'];

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
I try this one now
Antworten

Zurück zu „phpBB 2.0: Mod Support“