Seite 1 von 1
Ezportal - Je nach Forum-Id unterschiedliche Fetchposts
Verfasst: 05.12.2007 14:04
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!
Verfasst: 05.12.2007 17:18
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