So, servus.
Also ich hab mr da jetzt ein kleines Addon gebastelt, was auch prima funktioniert, nur leider einen kleinen Schönheitsfehler drin hat, aber dazu komm ich später.
Hier erstmal das Addon:
Code: Alles auswählen
##############################################################
## MOD Title: Index AddOn for Post Icons MOD
## MOD Author: Darezettl <darezettl> (Thomas Zettl) http://darezettl.de
## MOD Description: Shows Post Icons on the Forum Index
## MOD Version: 0.0.1
##
## Installation Level: easy
## Installation Time:
## Files To Edit: 2
## index.php
## templates/subSilver/index_body.tpl
## Included Files: n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ 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 MODs not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/downloads/
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]------------------------------------------
#
include($phpbb_root_path . 'common.'.$phpEx);
#
#-----[ AFTER, ADD ]------------------------------------------
#
include($phpbb_root_path . 'includes/def_icons.'. $phpEx);
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_icon, t.topic_title, t.topic_last_post_id " .
#
#-----[ IN-LINE FIND ]------------------------------------------
#
t.topic_title,
#
#-----[ BEFORE, ADD ]------------------------------------------
#
t.topic_icon,
#
#-----[ FIND ]------------------------------------------
#
$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$icon = get_icon_title($forum_data[$j]['topic_icon'], 1, $type);
#
#-----[ FIND ]------------------------------------------
#
'TOPICS' => $forum_data[$j]['forum_topics'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'ICON' => $icon,
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]------------------------------------------
#
{catrow.forumrow.LAST_POST}
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
{catrow.forumrow.ICON}
Gut, der Schönheitsfehler ist dass wenn man das Topic
kein Icon enthält, der Platz für das selbige im Index trotzdem "freigehalten" wird, im Gegensatz zu vBulletin.
Ich hab mal zwei Screenshots gemacht zur Verdeutlichung.
Auf den Screenhots seht ihr jeweils ein Topic mit -und eins ohne Topic Icon (im Index).
Screenshot von vBulletin:
Screenshot von meiner Lösung für phpBB:
Wie macht dem Script nun klar, dass wenn kein Icon ausgewählt wurde, der Platz nicht "freigehalten" werden braucht?