empfehlung für last post topic gesucht

Probleme bei der regulären Arbeiten mit phpBB, Fragen zu Vorgehensweisen oder Funktionsweise sowie sonstige Fragen zu phpBB im Allgemeinen.
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.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
sidragon
Mitglied
Beiträge: 190
Registriert: 22.07.2002 07:25
Wohnort: Lohr am Main
Kontaktdaten:

Beitrag von sidragon »

*ggg* kein Problem :wink:
dann hab ich glaub ich nicht das richtige :D
Acid
Ehrenadmin
Beiträge: 12195
Registriert: 26.04.2001 02:00
Wohnort: Berlin

Beitrag von Acid »

..schreibt <?php include("path/recent.php"); ?> in die *.php, in die es eingebunden werden soll (path mit dem Pfad ergänzen, ka kompletter, reicht über- oder untergeordnetes Verzeichnis).

Ansonsten is die Frage wo ihr es einbinden wollt..

Code: Alles auswählen

* Installation: øto add the recent topics to a non-phpbb site (should be *.php)
 *                just include recent.php (<?php include("path/recent.php"); ?>)
 *                and copy recent_body.tpl to /templates/whatever
 *                or just use recent.php as a stand-alone (you can edit it of course)
Wenn jemand ´ne Idee hat, wie ma das verständlicher ausdrücken kann, nur raus damit.. :-?
CrossFarmer

last topic Mod

Beitrag von CrossFarmer »

Hier ist der Code, den ich in die "frische", also ursprüngliche index.php eingefügt habe. Bzw. in die vorhandene ..templates/subsilver/index_boy.tpl

Dann ins entsprechende Verzeichnis aufgespielt.
Es funktioniert einwandfrei, habe keine Fehler entdeckt.

Code: Alles auswählen

######################################################## 
## Mod Title:  last_topic_title_index	
## Mod Version: 1.0.0 
## Author:       Adam Ismay <admin@boardz.tk>
## Description:  Gives the topic title in the last post box
##			on index.
## 
## Installation Level:  fairly easy 
## Installation Time:   3-5 minutes
## Files To Edit:       index.php
##				templates/????/index_body.tpl
######################################################## 
## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites 
##############################################################
## Notes: Does not do anything on Postgres or Oracle. The topic
##		title is shortened to 25. This can be changed in the code
##		or you can add $board_config['topic_title_index_size'] = ??;
##		in the template config file which will override this
##		value. Topic titles are not displayed if the user does
##		not have the right to read the forum. The link goes to
##		the start of the topic, the existing link to last post is
##		unaffected.
#########################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
#########################################################



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

index.php 

# 
#----- [ FIND (line 156) ] ---- 
# 

			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
				FROM (( " . FORUMS_TABLE . " f
				LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
				LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
				ORDER BY f.cat_id, f.forum_order";


# 
#---- [ REPLACE WITH ] ---- 
# 

			$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_title, t.topic_id
				FROM ((( " . FORUMS_TABLE . " f
				LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
				LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_id = p.topic_id ) 
				LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
				ORDER BY f.cat_id, f.forum_order";

# 
# --- [ FIND (line 250) ] ---- 
# 

$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);

#
#-----[ REPLACE WITH ] -----
#

	$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);
    if (!isset($board_config['topic_title_index_size'])){
    	$board_config['topic_title_index_size'] = 25;  //Set this to size limit
    } 


# 
# --- [ FIND (line 430) ] ---- 
# 

'MODERATORS' => $moderator_list, 

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

								'LAST_TOPIC' => $is_auth_ary[$forum_data[$j]['forum_id']]['auth_read'] ? (strlen($forum_data[$j]['topic_title']) > $board_config['topic_title_index_size']) ? substr($forum_data[$j]['topic_title'], 0, ($board_config['topic_title_index_size'] - 2)) . "..." : $forum_data[$j]['topic_title'] : "",
								'U_LAST_TOPIC' => append_sid("viewtopic.$phpEx?"  . POST_TOPIC_URL . "=" . $forum_data[$j]['topic_id']), 

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

templates/subSilver/index_body.tpl

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

	<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>

#
#-----[ REPLACE WITH ]---------
#


	<td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall"><a href="{catrow.forumrow.U_LAST_TOPIC}">{catrow.forumrow.LAST_TOPIC}</a><br />{catrow.forumrow.LAST_POST}</span></td>

# 
#-----[ SAVE ALL FILES ]------------------------------------------ 
# 
# EoM 
Weiss nicht, ob es vollkommen falsch ist, aber anscheinend nicht, hab den Code auf phpbb.com gefunden, und nach Erstellerangaben funzts auch bei V 2.0.3, also bei mir geht´s auch. (Hab´auch 2.0.3)

Grüsse
CrossFarmer
Tyler
Mitglied
Beiträge: 117
Registriert: 21.10.2002 12:44

Beitrag von Tyler »

hast du mal einen link wo man sich diesen hack anschauen kann.
würde gerne mal sehen ob sich dann auch die breite der spalte "letzter beitrag" ändert.
Benutzeravatar
M@ster
Mitglied
Beiträge: 39
Registriert: 19.06.2002 15:19
Kontaktdaten:

Beitrag von M@ster »

Tyler hat geschrieben:hast du mal einen link wo man sich diesen hack anschauen kann.
Den würde ich auch gerne mal sehen. Evtl. ist das genau der Hack, den ich suche :wink:
Die Sollbruchstelle des Toilettenpapiers hat ihre Lösungsstruktur geändert.
Antworten

Zurück zu „phpBB 2.0: Administration, Benutzung und Betrieb“