Seite 1 von 6

Inhaltsverzeichnis

Verfasst: 28.03.2004 03:00
von Schwabenpfeil!
Hallo,

ich suche wie der Titel schon vermuten lässt, ein Inhaltsverzeichnis für das phpBB2.

Das Inhaltsverzeichnis soll aus jedem Forum alle Titel der einzelnen Themen auflisten. Gibt es hierfür vielleicht schon einen Mod?

Gruß
Schwabenpfeil!

Verfasst: 28.03.2004 21:42
von Mario Siebert
Vieleicht hilft dir das weiter: http://www.phpbb.com/phpBB/viewtopic.ph ... ap#1023680 :)

Grüße Mario

Verfasst: 28.03.2004 22:26
von Schwabenpfeil!
Vielen Dank, das kommt der Sache schon recht nahe.
Allerdings werden hier nur einfach alle Themen aufgelistet, ohne Sortierung.

Die Sortierung sollte in etwas so aussehen.


---> Kategorie A
------> Forum_1A
--------> Alle Beiträge aus Forum_1A

------> Forum_2A
--------> Alle Beiträge aus Forum_2A

---> Kategorie B
------> Forum_1B
--------> Alle Beiträge aus Forum_1B

------> Forum_2B
--------> Alle Beiträge aus Forum_2B

usw.
Oder wäre es möglich die vorhandene Sitemap entsp. umzuschreiben?
Verwendet habe ich den ersten Code aus Deinem Link. Die zweite Variante funktioniert leider nicht.

Gruß
Schwabenpfeil!

Verfasst: 27.04.2004 23:28
von Schwabenpfeil!
*nachobenschieb*

Hallo,

hat wirklich niemand einen Tipp für mich? :-?

Gruß
Schwabenpfeil!

Verfasst: 27.04.2004 23:34
von andreasOymann
ja, das geht! Verschachtel die drei Abfragen im obigen Link nach Kategorie, Forum und Topic ineinander...

Verfasst: 27.04.2004 23:41
von Schwabenpfeil!
Danke. Wenn Du mir nun noch genau sagen könntest WIE ich das machen muss. Meine PHP-Kentnisse reichen dafür nicht aus. :cry:

Gruß
Schwabenpfeil!

Verfasst: 27.04.2004 23:45
von andreasOymann
UNGETESTET:

Code: Alles auswählen

<?php 
/*************************************************************************** 
* Save this file as:   sitemap.php (or anything you like) 
* Version:      Friday, Oct 4, 2002 
* Email:      angus@phphacks.com 
* Purpose of hack:   Basically generates a list of topics and 
*      displays them with link to the topic. Goal 
*      is to provide search engines like Google 
*      with a static page of links to dynamic pages 
*      You should link to this page from your sites 
*      home page somewhere. 
* Demo:      http://www.aussiecelebs.com/forums/site_map.php 
* Tested on:   phpBB 2.01, 2.02 
* 
***************************************************************************/ 

/*************************************************************************** 
* 
* This program is free software; you can redistribute it and/or modify 
* it under the terms of the GNU General Public License as published by 
* the Free Software Foundation; either version 2 of the License, or 
* (at your option) any later version. 
* 
***************************************************************************/ 
?> 

<!-- Start header here. --> 

<html> 
<head> 
<meta http-equiv="content-language" content="de"> 
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> 
<title>overnet.org - overnet forum sitemap</title> 
<meta name="keywords" content="..."> 
<meta name="description" content="..."> 
</head> 
<h1>Overnet Forum Sitemap</h1> 

<!-- End Header --> 

<?php 

define('IN_PHPBB', true); 
$phpbb_root_path = './'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 

echo "<h2>Sitemap</h2>"; 

$resultc = mysql_query("SELECT cat_title, cat_id FROM phpbb_categories ORDER BY cat_title"); 
while($row=  mysql_fetch_assoc($resultc)) 
{ 
    echo "<a href='index.php?c=".$row["cat_id"]."'>".$row["cat_title"]."</a><br>"; 

	$resultf = mysql_query("SELECT forum_id, forum_name, forum_desc FROM phpbb_forums WHERE cat_id =" . $row["cat_id"] . " ORDER BY forum_name"); 
	while($row=  mysql_fetch_assoc($resultf)) 
	{ 
    	echo "&nbsp;&nbsp;<a href='viewforum.php?f=".$row["forum_id"]."'>".$row["forum_name"]."</a>"." - ". $row["forum_desc"] . "<br>"; 

		$resultt = mysql_query("SELECT topic_title, topic_id FROM phpbb_topics WHERE forum_id=" . $row["forum_id"] . " ORDER BY topic_title"); 
		while($row=  mysql_fetch_assoc($resultt)) 
		{ 
   			echo "&nbsp;&nbsp;&nbsp;&nbsp;<a href='viewtopic.php?t=".$row["topic_id"]."'>".$row["topic_title"]."</a><br>"; 
		} 
	} 
} 

echo " 

<!-- Start footer here. --> 

</body> 
</html> 

<!-- End footer --> 

"; 

?> 
Wenns klappt, gib mir mal bitte nen Link dahin...

EDIT 24:00 Uhr: Habe obigen Code nochmal geändert, so ist es wenigstens etwas übersichtlicher, aber noch lange nicht "phpBB-konform"...

nochmal EDIT 00:12: Habe es gerade getestet, läuft soweit, gefällt mir aber nicht... bei großen Boards gibt es eine ellenlange Liste, man müsste die Topics "einklappen" können. Mal sehen, vielleicht bau ich da mal was...

Verfasst: 28.04.2004 01:41
von Schwabenpfeil!
Hallo Andreas,

vielen Dank! Das ist schon richtig gut geworden!
In meinem Forum ( www.paules-pc-forum.de/phpBB2/ ) habe ich inzw. über 100.000 Beiträge, da würde es wohl in der Tat eine zu lange und unübersichtliche Liste werden. (Mal abgesehen von der Ladezeit/Traffic)

Einsetzen wollte ich das Inhaltsverzeichnis in einem zweiten Forum das als FAQ-Datenbank dient. ( www.paules-pc-forum.de/ppf2/sitemap.php )

Wenn man das ganze jetzt noch optisch an das Forum anpassen könnte und vielleicht tatsächlich die gewünschten Foren auf- und zuklappen könnte, dann wäre das Genial!

Gruß
Schwabenpfeil!

Verfasst: 28.04.2004 12:24
von andreasOymann
so, nun ist es zumindest optisch schonmal "phpBB-konform":

Code: Alles auswählen

<?php 
/*************************************************************************** 
* Save this file as:   sitemap.php  
* Version:      beta, still in development 
* Email:      webmaster@retriever-hilfe.de 
* Purpose of hack:   Basically generates a list of topics and 
*      displays them with link to the topic. 
*
* Tested on:   phpBB 2.0.8
* 
***************************************************************************/ 

/*************************************************************************** 
* 
* This program is free software; you can redistribute it and/or modify 
* it under the terms of the GNU General Public License as published by 
* the Free Software Foundation; either version 2 of the License, or 
* (at your option) any later version. 
* 
***************************************************************************/ 

define('IN_PHPBB', true); 
$phpbb_root_path = './'; 
include($phpbb_root_path . 'extension.inc'); 
include($phpbb_root_path . 'common.'.$phpEx); 

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

//
// Start output of page
//
define('SHOW_ONLINE', true);
$page_title = 'Sitemap';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);



echo "<h2>Sitemap</h2>"; 

$resultc = mysql_query("SELECT cat_title, cat_id FROM " . CATEGORIES_TABLE . " ORDER BY cat_title"); 
while($row=  mysql_fetch_assoc($resultc)) 
{ 
    echo "<a href='index.php?c=" . $row["cat_id"] . "' class='nav'>" . $row["cat_title"] . "</a><br>"; 

	$resultf = mysql_query("SELECT forum_id, forum_name, forum_desc FROM " . FORUMS_TABLE . " WHERE cat_id =" . $row["cat_id"] . " ORDER BY forum_name"); 
	while($row=  mysql_fetch_assoc($resultf)) 
	{ 
    	echo "&nbsp;&nbsp;&nbsp;<a href='viewforum.php?f=" . $row["forum_id"] . "' class='nav'>" . $row["forum_name"] . "</a><span class='gensmall'>" . " - " . $row["forum_desc"] . "</span><br>"; 

		$resultt = mysql_query("SELECT topic_title, topic_id FROM " . TOPICS_TABLE . " WHERE forum_id=" . $row["forum_id"] . " ORDER BY topic_title"); 
		while($row=  mysql_fetch_assoc($resultt)) 
		{ 
   			echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='viewtopic.php?t=" . $row["topic_id"] . "' class='nav'>" . $row["topic_title"] . "</a><br>"; 
		} 
	} 
} 

include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?> 

Verfasst: 28.04.2004 12:51
von thompson
habe auch die normale sitemap im einsatz.

wobei ich sagen muss, dass mir diese variante besser gefällt.

@schwabenpfeil

welchen mod hast du für die short-urls (mod rewrite) im Einsatz ? Kannst du hierzu mal einen link posten ?