Inhaltsverzeichnis

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.
Benutzeravatar
Markus67
Ehrenadmin
Beiträge: 28346
Registriert: 12.01.2004 16:02
Wohnort: Neuss
Kontaktdaten:

Beitrag von Markus67 »

@andreas ....

Was hab ich schon gemacht .... du hast mal wieder ein Super-Teilchen gemoddet :-) Kompliment ...

Markus
Benutzeravatar
andreasOymann
Ehemaliges Teammitglied
Beiträge: 2392
Registriert: 10.06.2003 16:29
Wohnort: Hamminkeln
Kontaktdaten:

Beitrag von andreasOymann »

Schwabenpfeil! hat geschrieben:Perfekt!

Andreas, kannst Du mir noch kurz sagen welchen Teil ich wie abändern müsste, wenn beim klick auf eine Kategorie nicht zur index.php geleitet sondern die Kategorie auf/zugeklappt werden soll.

Ist natürlich reine geschmackssache, aber dann müsste der Besucher nicht "nur" auf den Ordner klicken sondern könnte auch auf den Namen der Kategorie klicken.

Gruß
Schwabenpfeil!
Hier ist die Version speziell für dich :wink: :

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
//

$t=$HTTP_GET_VARS['t']; 
$f=$HTTP_GET_VARS['f'];

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

echo "<table width='100%' cellspacing='2' cellpadding='2' border='0' align='center'>
  <tr> 
	<td align='left'><span class='nav'>Sitemap</span></td>
  </tr>
</table>";

echo "<center><a href='" . $PHP_SELF . "' class='nav'>Alles einklappen</a>&nbsp;&nbsp;<a href='" . $PHP_SELF . "?f=all&t=all' class='nav'>Alles ausklappen</a></center>";

echo "<table width='100%' class='forumline' border='0' cellspacing='0' cellpadding='0' align='center'>
<tr> 
	<td width='100%' valign='top' align='center'>
      <table width='100%' border='0' cellspacing='1' cellpadding='1'>";


$resultc = mysql_query("SELECT * FROM " . CATEGORIES_TABLE . " ORDER BY cat_title"); 
while($rowc=  mysql_fetch_assoc($resultc)) 
{ 
	$countf = 0;
	$countna = 0;
	$resultcf = mysql_query("SELECT * FROM " . FORUMS_TABLE . " WHERE cat_id =" . $rowc["cat_id"] . " ORDER BY forum_name"); 
	while($rowcf=  mysql_fetch_assoc($resultcf)) 
	{ 
		$countf = $countf + 1;
		$is_auth_ary = array();
		$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $rowcf[]);
		if ((!$is_auth_ary[$rowcf['forum_id']]['auth_read']) or (!$is_auth_ary[$rowcf['forum_id']]['auth_view']))
		{
			$countna = $countna + 1;
		}
	}
	if ($countf <> $countna)
	{
		$actionc = (($f == $rowc["cat_id"]) || ($f == 'all')) ? "<a href='" . $PHP_SELF . "'><img src='images/icon_opened.gif' border='0' alt=' - '></a>" : "<a href='" . $PHP_SELF . "?f=" . $rowc["cat_id"] . "'><img src='images/icon_closed.gif' border='0' alt=' + '></a>";
		$actionc1 = (($f == $rowc["cat_id"]) || ($f == 'all')) ? "<a href='" . $PHP_SELF . "' class='nav'>" . $rowc["cat_title"] . "</a>" : "<a href='" . $PHP_SELF . "?f=" . $rowc["cat_id"] . "'class='nav'>" . $rowc["cat_title"] ."</a>";
		echo "<tr><td width='30' align='center' class='row1' nowrap='nowrap'><span class='gensmall'>&nbsp</span>" . $actionc . "<span class='gensmall'>&nbsp</span></td><td colspan='3' align='left' class='row1' width='100%'>" . $actionc1 . "</td></tr>"; 
	}
	if ( ($f == 'all') || ($f == $rowc["cat_id"]) )
	{	
		$resultf = mysql_query("SELECT * FROM " . FORUMS_TABLE . " WHERE cat_id =" . $rowc["cat_id"] . " ORDER BY forum_name"); 
		while($rowf=  mysql_fetch_assoc($resultf)) 
		{ 
			$is_auth_ary = array();
			$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $rowf[]);
			if ((!$is_auth_ary[$rowf['forum_id']]['auth_read']) or (!$is_auth_ary[$rowf['forum_id']]['auth_view']))
			{
				// nothing to do
			}
			else
			{
				$actionf = (($t == $rowf["forum_id"]) || ($t == 'all')) ? "<a href='" . $PHP_SELF . "?f=" .$rowc["cat_id"] . "'><img src='images/icon_opened.gif' border='0' alt=' - '></a>" : "<a href='" . $PHP_SELF . "?f=" . $rowc["cat_id"] . "&t=" . $rowf["forum_id"] . "'><img src='images/icon_closed.gif' border='0' alt=' + '></a>";
				$actionf1 = (($t == $rowf["forum_id"]) || ($t == 'all')) ? "<a href='" . $PHP_SELF . "?f=" .$rowc["cat_id"] . "' class='nav'>" . $rowf["forum_name"] . "</a>" : "<a href='" . $PHP_SELF . "?f=" . $rowc["cat_id"] . "&t=" . $rowf["forum_id"] . "' class='nav'>" . $rowf["forum_name"] . "</a>";
  		  		echo "<tr><td width='30' align='center' class='row1'><span class='gensmall'>|</span></td><td width='30' align='center' class='row1' nowrap='nowrap'><span class='gensmall'>&nbsp</span>" . $actionf . "<span class='gensmall'>&nbsp</span></td><td colspan='2' align='left' class='row1' width='100%'>" . $actionf1 . "<span class='gensmall'>" . " - " . $rowf["forum_desc"] . "</span></td></tr>"; 
				if ( ($t == 'all') || ($t == $rowf["forum_id"]) )
				{
					$resultt = mysql_query("SELECT * FROM " . TOPICS_TABLE . " WHERE forum_id=" . $rowf["forum_id"] . " ORDER BY topic_title"); 
					while($rowt=  mysql_fetch_assoc($resultt)) 
					{ 
   						echo "<tr><td width='30' align='center' class='row1'><span class='gensmall'>|</span></td><td width='30' align='center' class='row1'><span class='gensmall'>|</span></td><td width='30' align='center' class='row1' nowrap='nowrap'><span class='gensmall'>&nbsp;-&nbsp;</span></td><td align='left' class='row1' width='100%'><a href='viewtopic.php?t=" . $rowt["topic_id"] . "' class='nav'>" . $rowt["topic_title"] . "</a></td></tr>"; 
					}
				}	 
			}			
		}
	}	 
} 

echo "</table></td></tr></table>";

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

?> 
Zuletzt geändert von andreasOymann am 24.08.2004 04:57, insgesamt 1-mal geändert.
Kein Support per PN / Mail / ICQ / MSN ! Dafür gibt´s dieses Forum...
Schwabenpfeil!
Mitglied
Beiträge: 116
Registriert: 26.12.2002 23:27
Kontaktdaten:

Beitrag von Schwabenpfeil! »

Vielen Dank Andreas!
Ich bin wirklich tief beeindruckt!! [ externes Bild ]

Vielen herzlichen Dank für den perfekten Mod und Deine Hilfsbereitschaft!

Gruß
Schwabenpfeil!
Zuletzt geändert von Schwabenpfeil! am 29.04.2004 00:43, insgesamt 1-mal geändert.
Benutzeravatar
andreasOymann
Ehemaliges Teammitglied
Beiträge: 2392
Registriert: 10.06.2003 16:29
Wohnort: Hamminkeln
Kontaktdaten:

Beitrag von andreasOymann »

ich schick dir mal meine Bankverbindung per PM :D :D :D
Kein Support per PN / Mail / ICQ / MSN ! Dafür gibt´s dieses Forum...
Schwabenpfeil!
Mitglied
Beiträge: 116
Registriert: 26.12.2002 23:27
Kontaktdaten:

Beitrag von Schwabenpfeil! »

Öhm, ich bin ein Schwabe! :D :D :D
mick666
Mitglied
Beiträge: 4
Registriert: 11.05.2004 11:46

Das Teil ist der Hammer

Beitrag von mick666 »

Echt Super. Genau das habe ich gesucht. GIbt es denn noch zusätzlich die Möglichkeit nicht alles anzuzeigen, sondern nur eine bestimmte Kategorie??
Benutzeravatar
andreasOymann
Ehemaliges Teammitglied
Beiträge: 2392
Registriert: 10.06.2003 16:29
Wohnort: Hamminkeln
Kontaktdaten:

Beitrag von andreasOymann »

fest eingestellt auf eine einzelne Kategorie ist kein Problem: ändere

Code: Alles auswählen

$resultc = mysql_query("SELECT * FROM " . CATEGORIES_TABLE . " ORDER BY cat_title"); 
in

Code: Alles auswählen

$resultc = mysql_query("SELECT * FROM " . CATEGORIES_TABLE . " WHERE cat_id = '1' ORDER BY cat_title"); 
Dabei ist "1" die ID der Kategorie.

Mit ner Auswahl ist es schon mehr Arbeit...
Kein Support per PN / Mail / ICQ / MSN ! Dafür gibt´s dieses Forum...
Benutzeravatar
Wuppi
Mitglied
Beiträge: 734
Registriert: 14.05.2002 23:04
Wohnort: Köln
Kontaktdaten:

Beitrag von Wuppi »

Hi


hab 2 Request und 1 Problem mit dem Mod ;)

Fang mit dem Problem an:
Ich hab beide Varianten (die letzen beiden hier im Thread, die normale und der "Sonderwunsch") zum testen. Egal bei welchen, wenn ich auf das + drücke, öffnet sich dieses zwar - für ne hunderstel sekunde seh ich auch die Foren dadrin, aber dann klappt es sofort wieder zu. Was stimmt hier nicht?

=> Lösung gefunden: php_flag register_globals on in die .htaccess rein und es klappt ... mal meinen Hoster ne mail schreiben, das er "register_globals = on" in die httpd.conf packen soll ... besser ist das.

Die Request:
Es soll besser sein, wenn auf einer Seite max. 80-100 Links zu finden sind (für Suchmaschinen). Dieses Limit hält der Mod nicht ein. Wäre es nicht möglich, die Threads auf mehrere Seiten zu splitten

Beispiel:
http://www.retriever-hilfe.de/forum/sitemap.php
* Aktionen
** Projekte [1] [2] [3] ...

Nächster Request: Unterstützung von Short-URLs (den Mod von larsneo) ... wie bastel ich diese darein? (short-URLs ist im Forum bei mir eingebaut)

Thx schonmal
Wuppi
Benutzeravatar
Wuppi
Mitglied
Beiträge: 734
Registriert: 14.05.2002 23:04
Wohnort: Köln
Kontaktdaten:

Beitrag von Wuppi »

Hi

soch nächstes Problem gelöst ... Short-URLs-Anzeige ... habs mir einfach gemacht: viewtopic.php?t= einfach durch ftopic ersetzt und dahinter noch nen .html

Code: Alles auswählen

  echo "<tr><td width='30' align='center' class='row1'><span class='gensmall'>|</span></td><td width='30' align='center' class='row1'><span class='gensmall'>|</span></td><td width='30' align='center' class='row1' nowrap='nowrap'><span class='gensmall'>&nbsp;-&nbsp;</span></td><td align='left' class='row1' width='100%'><a href='ftopic" . $rowt["topic_id"] . '.html'. "' class='nav'>" . $rowt["topic_title"] . "</a></td></tr>";
               }
            }   
         }         
      }
   }   
}

echo "</table></td></tr></table>";
Das 2. Echo von oben ist das letzte echo in der sitemap.php

Jetzt fehlt also noch die Anzeige von Unterseiten - damit google vor lauter Links nicht schlecht wird und wieder geht ;)

Bis denne
Wuppi
Benutzeravatar
Wuppi
Mitglied
Beiträge: 734
Registriert: 14.05.2002 23:04
Wohnort: Köln
Kontaktdaten:

Beitrag von Wuppi »

Hi

hab das Sitemap etwas gemoddet - in hinblick auf SuMa-Kompatiblität (und damit nicht überall unterschiedliche URLs auftauchen - Short-URLs reichen *G*)

www.numismatikforum.de/fsitemap.html

Zudem hab ich die Tabelle an den Forenstandard angepasst und "Alle auf/zuklappen" entfernt (dadurch würden mehrere Hundert Links entstehen -> steht z.b. google nicht so drauf.)

Dann fang ich mal an ...
Grundlage für meine Modi: "Der Schwabenpfeil-Spezial-SiteMap-Mod" ;)
Vorraussetzung: Der Short-URL-Mod von larsneo ist bei euch funktionsfähig!

.htaccess wie folgt erweitern

Code: Alles auswählen

# Short-URLs sitemap.php
RewriteCond %{REQUEST_FILENAME} /fsitemap([0-9]*)-([0-9]*).*
RewriteRule (.*) /sitemap.php?f=%1&t=%2

RewriteCond %{REQUEST_FILENAME} /fsitemap([0-9]*)
RewriteRule (.*) /sitemap.php?f=%1
Und die sitemap.php wie folgt füllen:

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
//

$t=$HTTP_GET_VARS['t']; 
$f=$HTTP_GET_VARS['f'];

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

echo "<br><table width='100%' class='forumline' border='0' cellspacing='0' cellpadding='0' align='center'>
  <tr> 
    <th class='thCornerL'>Inhaltsverzeichnis</th>
  </tr>";

// nicht SuMa-Tauglich:
// echo "<center><a href='" . $PHP_SELF . "' class='nav'>Alles einklappen</a>&nbsp;&nbsp;<a href='" . $PHP_SELF . "?f=all&t=all' class='nav'>Alles ausklappen</a></center>";

echo "
<tr>
   <td width='100%' valign='top' align='center'>
      <table width='100%' border='0' cellspacing='1' cellpadding='1'>";


$resultc = mysql_query("SELECT * FROM " . CATEGORIES_TABLE . " ORDER BY cat_order");
while($rowc=  mysql_fetch_assoc($resultc))
{
   $countf = 0;
   $countna = 0;
   $resultcf = mysql_query("SELECT * FROM " . FORUMS_TABLE . " WHERE cat_id =" . $rowc["cat_id"] . " ORDER BY forum_order");
   while($rowcf=  mysql_fetch_assoc($resultcf))
   {
      $countf = $countf + 1;
      $is_auth_ary = array();
      $is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $rowcf[]);
      if ((!$is_auth_ary[$rowcf['forum_id']]['auth_read']) or (!$is_auth_ary[$rowcf['forum_id']]['auth_view']))
      {
         $countna = $countna + 1;
      }
   }
   if ($countf <> $countna)
   {
      $actionc = (($f == $rowc["cat_id"]) || ($f == 'all')) ? "<a href='fsitemap.html'><img src='images/icon_opened.gif' border='0' alt=' - '></a>" : "<a href='fsitemap".  $rowc["cat_id"] . '.html' . "'><img src='images/icon_closed.gif' border='0' alt=' + '></a>";
      $actionc1 = (($f == $rowc["cat_id"]) || ($f == 'all')) ? "<a href='fsitemap.html' class='nav'>" . $rowc["cat_title"] . "</a>" : "<a href='fsitemap".  $rowc["cat_id"] . '.html'. "'class='nav'>" . $rowc["cat_title"] ."</a>";
      echo "<tr><td width='30' align='center' class='row1' nowrap='nowrap'><span class='gensmall'>&nbsp</span>" . $actionc . "<span class='gensmall'>&nbsp</span></td><td colspan='3' align='left' class='row1' width='100%'>" . $actionc1 . "</td></tr>";
   }
   if ( ($f == 'all') || ($f == $rowc["cat_id"]) )
   {   
      $resultf = mysql_query("SELECT * FROM " . FORUMS_TABLE . " WHERE cat_id =" . $rowc["cat_id"] . " ORDER BY forum_order");
      while($rowf=  mysql_fetch_assoc($resultf))
      {
         $is_auth_ary = array();
         $is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $rowf[]);
         if ((!$is_auth_ary[$rowf['forum_id']]['auth_read']) or (!$is_auth_ary[$rowf['forum_id']]['auth_view']))
         {
            // nothing to do
         }
         else
         {
            $actionf = (($t == $rowf["forum_id"]) || ($t == 'all')) ? "<a href='fsitemap". $rowc["cat_id"] . '.html'. "'><img src='images/icon_opened.gif' border='0' alt=' - '></a>" : "<a href='fsitemap".  $rowc["cat_id"] . "-" . $rowf["forum_id"] . '.html'. "'><img src='images/icon_closed.gif' border='0' alt=' + '></a>";
            $actionf1 = (($t == $rowf["forum_id"]) || ($t == 'all')) ? "<a href='fsitemap". $rowc["cat_id"] . '.html'.  "' class='nav'>" . $rowf["forum_name"] . "</a>" : "<a href='fsitemap".  $rowc["cat_id"] . "-" . $rowf["forum_id"] . '.html'."' class='nav'>" . $rowf["forum_name"] . "</a>";
                echo "<tr><td width='30' align='center' class='row1'><span class='gensmall'>|</span></td><td width='30' align='center' class='row1' nowrap='nowrap'><span class='gensmall'>&nbsp</span>" . $actionf . "<span class='gensmall'>&nbsp</span></td><td colspan='2' align='left' class='row1' width='100%'>" . $actionf1 . "<span class='gensmall'>" . " - " . $rowf["forum_desc"] . "</span></td></tr>";
            if ( ($t == 'all') || ($t == $rowf["forum_id"]) )
            {
               $resultt = mysql_query("SELECT * FROM " . TOPICS_TABLE . " WHERE forum_id=" . $rowf["forum_id"] . " ORDER BY topic_time");
               while($rowt=  mysql_fetch_assoc($resultt))
               {
                     echo "<tr><td width='30' align='center' class='row1'><span class='gensmall'>|</span></td><td width='30' align='center' class='row1'><span class='gensmall'>|</span></td><td width='30' align='center' class='row1' nowrap='nowrap'><span class='gensmall'>&nbsp;-&nbsp;</span></td><td align='left' class='row1' width='100%'><a href='ftopic" . $rowt["topic_id"] . '.html'. "' class='nav'>" . $rowt["topic_title"] . "</a></td></tr>";
               }
            }   
         }         
      }
   }   
}

echo "</table></td></tr></table>";

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

?>
Wenn ihr da noch fehler findet, die sich rein auf meine Modifikation beziehen, sagt mir bescheid ... vielleicht hab ich irgendwo was vergessen ;)

Was jetzt noch fehlt - eine Links/Seite-Begrenzung! Optimal wären 80 Threads/Seite ... neben dem Forentitel müsste also 1-2-3-4-5-6-.... stehen .... Hier bekomm ich aber nur ne fuschlösung hin - die möchte ich euch (und meinem Hoster) ersparen - der code wäre so groß wie der ganze Mod ;) Also wer hier weiterhelfen kann - bitte! ;)

Bis denne
Wuppi
Antworten

Zurück zu „phpBB 2.0: Mod Support“