phpBB Änderungen

Änderungen vorgenommen an phpBB zur Integration des „neuen“ Designs und der Botabwehr.

lib/tpl/proggen3_7/proggen.php

Diese Datei wird fast überall eingebunden und stellt die nötigen Funktionen um unter Anderem z.B. die NavLinks bzw das „Sie befinden sich hier“ (oben) zu generieren. Benötigte Funktionen/Variablen:

  • forum_navlinks: Gibt zurück String mit HTML für Navlinks (oben), erwartet: Array mit Arrays von je 2 Elementen (1. Link, 2. Linktext)
  • FIXME

forum/common.php

Bindet die proggen.php ein und macht sie so für alle Dateien, welche diese Datei einbinden verfügbar. (Wichtig)

if (!defined('IN_PHPBB'))
{
	exit;
}
 
$starttime = explode(' ', microtime());
$starttime = $starttime[1] + $starttime[0];
 
// Report all errors, except notices and deprecation messages
if (!defined('E_DEPRECATED'))
{
	define('E_DEPRECATED', 8192);
}
error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
 
/*
* Import proggen.org specific functions
*/
$PROGGEN_ORG_LIBRARY_PATH = '/lib/tpl/proggen3_7/';
require(dirname(__FILE__).'/../'.$PROGGEN_ORG_LIBRARY_PATH.'/proggen.php');
 
 
 
/*
* Remove variables created by register_globals from the global scope
* Thanks to Matt Kavanagh
*/
function deregister_globals()
{

forum/config.php

Enthält soweit ich das sehe Änderungen, die aber durch / für naums gemacht wurden (Datenbankpasswörter)

forum/cron.php

Keine Änderungen soweit ersichtlich.

forum/faq.php

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
 
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
 
$mode = request_var('mode', '');
 
$PROGGEN_ORG_NAVLINKS = array();
array_push($PROGGEN_ORG_NAVLINKS, array(append_sid("{$phpbb_root_path}index.$phpEx",false,true,$user->session_id),'Forum'));
array_push($PROGGEN_ORG_NAVLINKS,array(append_sid("{$phpbb_root_path}faq.$phpEx",false,true,$user->session_id)  ,'FAQ'));
$template->assign_var('PROGGEN_ORG_NAVLINKS',forum_navlinks($PROGGEN_ORG_NAVLINKS));
 
// Load the appropriate faq file
switch ($mode)
{

Zuerst wird ein Array angelegt, in welchem die Navlinks gespeichert werden (PROGGEN_ORG_NAVLINKS) Dort kommen für jeden Link ein Array mit 2 Elementen, das erste ist der Link, das zweite der Link-Text.

append_sid ist eine Funktion des Forums, die im Zweifelsfall (= eigentlich wenn Cookies deaktiviert, scheint es aber generell zu tun) eine Session ID (sid) an jede URL anhängt, damit der Benutzer nicht abgemeldet wird.

Aus diesem Array von Arrays macht die Funktion forum_navlinks (aus proggen.php) nun html Code zum Darstellen der Linkleiste. Dieser Code wird als String zurückgegeben, um im Template der TEMPLATE-Variablen PROGGEN_ORG_NAVLINKS zugewiesen zu werden. Wenn in einem Template (Layoutdatei) später also PROGGEN_ORG_NAVLINKS steht, wird dieser generierte String angezeigt.

forum/feep.php

Keine Änderungen meinerseits.

forum/index.php

$PROGGEN_ORG_NAVLINKS = array();
array_push($PROGGEN_ORG_NAVLINKS, array(append_sid("{$phpbb_root_path}index.$phpEx",false,true,$user->session_id),'Forum'));
$template->assign_var('PROGGEN_ORG_NAVLINKS',forum_navlinks($PROGGEN_ORG_NAVLINKS));
 
// Output page
page_header($user->lang['INDEX']);
 
$template->set_filenames(array(
	'body' => 'index_body.html')
);
 
page_footer();
 
?>

Selbes Spiel wie bei forum/faq.php. Generierung der Navlinks.

forum/mcp.php

$user->setup('mcp');
 
$PROGGEN_ORG_NAVLINKS = array();
array_push($PROGGEN_ORG_NAVLINKS, array(append_sid("{$phpbb_root_path}index.$phpEx",false,true,$user->session_id),'Forum'));
array_push($PROGGEN_ORG_NAVLINKS,array(append_sid("{$phpbb_root_path}mcp.$phpEx",false,true,$user->session_id)  ,'Moderation'));
$template->assign_var('PROGGEN_ORG_NAVLINKS',forum_navlinks($PROGGEN_ORG_NAVLINKS));
 
$module = new p_master();

(Am Anfang der Datei). Generiert NavLinks.

forum/memberlist.php

$group_id	= request_var('g', 0);
$topic_id	= request_var('t', 0);
 
$PROGGEN_ORG_NAVLINKS = array();
array_push($PROGGEN_ORG_NAVLINKS, array(append_sid("{$phpbb_root_path}index.$phpEx",false,true,$user->session_id),'Forum'));
array_push($PROGGEN_ORG_NAVLINKS,array(append_sid("{$phpbb_root_path}memberlist.$phpEx",false,true,$user->session_id)  ,'Mitglieder'));
$template->assign_var('PROGGEN_ORG_NAVLINKS',forum_navlinks($PROGGEN_ORG_NAVLINKS));
 
 
// Check our mode...

(Am Anfang der Datei) Generiert Navlinks.

forum/posting.php

Keine Änderungen soweit ersichtlich. Navlinks könnten auch hier generiert werden (theoretisch).

forum/report.php

Keine Änderungen soweit ersichtlich. Navlinks könnten auch hier generiert werden (theoretisch).

forum/search.php

$search_forum	= request_var('fid', array(0));
 
// We put login boxes for the case if search_id is egosearch or unreadposts
// because a guest should be able to log in even if guests search is not permitted
 
$PROGGEN_ORG_NAVLINKS = array();
array_push($PROGGEN_ORG_NAVLINKS, array(append_sid("{$phpbb_root_path}index.$phpEx",false,true,$user->session_id),'Forum'));
array_push($PROGGEN_ORG_NAVLINKS,array(append_sid("{$phpbb_root_path}search.$phpEx",false,true,$user->session_id)  ,'Suche'));
$template->assign_var('PROGGEN_ORG_NAVLINKS',forum_navlinks($PROGGEN_ORG_NAVLINKS));
 
// Egosearch is an author search
if ($search_id == 'egosearch')
{

(Am Anfang der Datei) Generiert Navlinks.

forum/style.php

Keine Änderungen soweit ersichtlich.

forum/ucp.php

// Setting a variable to let the style designer know where he is...
$template->assign_var('S_IN_UCP', true);
 
$PROGGEN_ORG_NAVLINKS = array();
array_push($PROGGEN_ORG_NAVLINKS, array(append_sid("{$phpbb_root_path}index.$phpEx",false,true,$user->session_id),'Forum'));
array_push($PROGGEN_ORG_NAVLINKS,array(append_sid("{$phpbb_root_path}ucp.$phpEx",false,true,$user->session_id)  ,'Pers. Bereich'));
$template->assign_var('PROGGEN_ORG_NAVLINKS',forum_navlinks($PROGGEN_ORG_NAVLINKS));
 
$module = new p_master();

(Am Anfang). Generiert Navlinks.

forum/viewforum.php

Keine Änderungen gefunden. FIXME Eigentlich müssten hier welche zu finden sein. FIXME Siehe functions_display.php

forum/viewonline.php

$user->setup('memberlist');
 
$PROGGEN_ORG_NAVLINKS = array();
array_push($PROGGEN_ORG_NAVLINKS, array(append_sid("{$phpbb_root_path}index.$phpEx",false,true,$user->session_id),'Forum'));
array_push($PROGGEN_ORG_NAVLINKS, array(append_sid("{$phpbb_root_path}viewonline.$phpEx",false,true,$user->session_id),'Wer ist Online?'));
$template->assign_var('PROGGEN_ORG_NAVLINKS',forum_navlinks( $PROGGEN_ORG_NAVLINKS));
 
// Get and set some variables

(Am Anfang) Generiert Navlinks.

forum/viewtopic.php

Keine Änderungen gefunden. FIXME siehe viewforum.php FIXME Siehe functions_display.php

forum/includes/auth.php

Definitiv keine Änderungen.

forum/includes/functions.php

SEHR wichtige Änderungen:

In Funktion page_header:

		'T_RANKS'				=> $config['ranks_path'],
		'T_UPLOAD'				=> $config['upload_path'],
 
		'SITE_LOGO_IMG'			=> $user->img('site_logo'),
 
		/*proggen.org*/
		'PROGGEN_ORG_HEADER'		=> forum_header($config['sitename'],$config['site_desc'],$page_title, $user),
		'PROGGEN_ORG_TOPBAR'		=> forum_topbar(
						$page_title,
						append_sid("{$phpbb_root_path}search.$phpEx",false,true, $user->session_id),
						array(
							array(append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unanswered',true, $user->session_id),'Unbeantwortet'),
							array(append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=newposts',true, $user->session_id),'Neu'),
							array(append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics',true, $user->session_id),'Aktiv')
						)),

Hier werden die Funktionen forum_header und forum_topbar aus proggen.php aufgerufen. FIXME

In Funktion page_footer:

	$PO_NOTBOT = !(!empty($user->data['is_bot']));
	$PO_LOGGEDIN = (($user->data['user_id'] != ANONYMOUS)) ? true : false;
	$PROGGEN_ORG_FOOTER_LINK_ARRAY = array();
	if(  $PO_NOTBOT   && $PO_LOGGEDIN )
	{
		array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY, array(append_sid("{$phpbb_root_path}ucp.$phpEx",true, $user->session_id),'Pers. Bereich'));
		if(($config['allow_privmsg'] && !empty($user->data['is_registered']) && ($auth->acl_get('u_readpm') || $auth->acl_get('u_sendpm'))))
		{
			array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY, array(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox',true, $user->session_id),'PN'));
		}
		if((!$config['load_search']) ? 0 : (isset($auth) ? ($auth->acl_get('u_search') && $auth->acl_getf_global('f_search')) : 1))
		{
			array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY, array(append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=egosearch',true, $user->session_id),'Eigene Beitraege'));
		}
		if(($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))) 
		{
			array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY, array(append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm',true, $user->session_id),'Restore Perm'));
		}
	}
	if (($auth->acl_get('a_') && !empty($user->data['is_registered'])))
	{
		array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY,array(append_sid("{$phpbb_root_path}adm/index.$phpEx", false, true, $user->session_id),'Adminbereich') );
	}
	if (($auth->acl_get('m_', $forum_id)) && $PO_LOGGEDIN && $PO_NOTBOT)
	{
		$PO_post_id	= request_var('p', 0);
		$PO_topic_id	= request_var('t', 0);
		$PO_forum_id	= request_var('f', 0);
		if ($PO_forum_id && $PO_topic_id && $PO_post_id)
		{
			array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY,array(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&t=$PO_topic_id&p=$PO_post_id",true, $user->session_id),'Moderation') );
		}elseif($PO_forum_id && $PO_topic_id)
		{
			array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY,array(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&t=$PO_topic_id",true, $user->session_id),'Moderation') );
		}elseif($PO_forum_id)
		{
			array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY,array(append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=forum_view&f=$PO_forum_id",true, $user->session_id),'Moderation') );
		}else
		{
			array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY,array(append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main', true, $user->session_id),'Moderation') );
		}
	}
 
 
	array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY,array(append_sid("{$phpbb_root_path}faq.$phpEx",false,true, $user->session_id),'FAQ'));
	if ( $PO_NOTBOT )
	{
		if((isset($auth)) ? $auth->acl_get('u_viewprofile') : 0)
		{
			array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY,array(append_sid("{$phpbb_root_path}memberlist.$phpEx",false,true, $user->session_id),'Mitglieder'));	
		}
	}
 
	// Generate logged in/logged out status
	if ($user->data['user_id'] != ANONYMOUS)
	{
		$u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=logout', true, $user->session_id);
	}
	else
	{
		$u_login_logout = append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login');
	}
 
 
	if ($PO_LOGGEDIN)
	{
		array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY,array($u_login_logout,'Abmelden'));
	} else
	{
		array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY,array($u_login_logout,'Anmelden'));
	}
 
 
	//not S_USER_LOGGED_IN and S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION)
	if ( !$PO_LOGGEDIN && ($config['require_activation'] != USER_ACTIVATION_DISABLE) )
	{
		array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY,array(append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),'Registrieren'));
	}
 
	if ($PO_NOTBOT)
	{
		array_push($PROGGEN_ORG_FOOTER_LINK_ARRAY,array(append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies', true, $user->session_id),'Cookies loeschen'));
	}
 
 
	$template->assign_vars(array(
		'DEBUG_OUTPUT'			=> (defined('DEBUG')) ? $debug_output : '',
		'TRANSLATION_INFO'		=> (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
		'PROGGEN_ORG_FOOTER'		=> forum_footer($PROGGEN_ORG_FOOTER_LINK_ARRAY, $user),
		'PROGGEN_ORG_SIDEBAR'		=> forum_sidebar($user->session_id,$user->data['username'], $forum_id ),
 
		'U_ACP' => ($auth->acl_get('a_') && !empty($user->data['is_registered'])) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", false, true, $user->session_id) : '')
	);

(Relativ am Anfang der Funktion) Erstellt ein Array um die Links zu speichern und füllt diese anschließend. Darauf hin wird es an forum_footer übergeben, welches daraus die Linkleiste (unten) generiert. Außerdem wird die Sidebar hier noch generiert. Die dabei enstehenden Strings mit HTML Code werden Template-Variablen zugewiesen um dann später an der richtigen Stelle im Layout zu stehen.

forum/include/functions_display.php

function generate_forum_nav(&$forum_data)
{
	global $db, $user, $template, $auth, $config;
	global $phpEx, $phpbb_root_path;
 
	if (!$auth->acl_get('f_list', $forum_data['forum_id']))
	{
		return;
	}
 
	// Get forum parents
	$forum_parents = get_forum_parents($forum_data);
 
	$PROGGEN_ORG_NAVLINKS = array();
	array_push($PROGGEN_ORG_NAVLINKS, array(append_sid("{$phpbb_root_path}index.$phpEx",false,true,$user->session_id),'Forum'));
 
	// Build navigation links
	if (!empty($forum_parents))
	{
		foreach ($forum_parents as $parent_forum_id => $parent_data)
		{
			list($parent_name, $parent_type) = array_values($parent_data);
 
			// Skip this parent if the user does not have the permission to view it
			if (!$auth->acl_get('f_list', $parent_forum_id))
			{
				continue;
			}
 
			$template->assign_block_vars('navlinks', array(
				'S_IS_CAT'		=> ($parent_type == FORUM_CAT) ? true : false,
				'S_IS_LINK'		=> ($parent_type == FORUM_LINK) ? true : false,
				'S_IS_POST'		=> ($parent_type == FORUM_POST) ? true : false,
				'FORUM_NAME'	=> $parent_name,
				'FORUM_ID'		=> $parent_forum_id,
				'U_VIEW_FORUM'	=> append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id))
			);
			array_push($PROGGEN_ORG_NAVLINKS , array(append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $parent_forum_id,true, $user->session_id),$parent_name,$parent_forum_id));
		}
	}
 
	$template->assign_block_vars('navlinks', array(
		'S_IS_CAT'		=> ($forum_data['forum_type'] == FORUM_CAT) ? true : false,
		'S_IS_LINK'		=> ($forum_data['forum_type'] == FORUM_LINK) ? true : false,
		'S_IS_POST'		=> ($forum_data['forum_type'] == FORUM_POST) ? true : false,
		'FORUM_NAME'	=> $forum_data['forum_name'],
		'FORUM_ID'		=> $forum_data['forum_id'],
		'U_VIEW_FORUM'	=> append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id']))
	);
	array_push($PROGGEN_ORG_NAVLINKS , array(append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_data['forum_id'],true, $user->session_id),$forum_data['forum_name'],$forum_data['forum_id']));
 
 
	$template->assign_vars(array('PROGGEN_ORG_NAVLINKS'	=> forum_navlinks($PROGGEN_ORG_NAVLINKS), ));
 
	$template->assign_vars(array(
		'FORUM_ID' 		=> $forum_data['forum_id'],
		'FORUM_NAME'	=> $forum_data['forum_name'],
		'FORUM_DESC'	=> generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options']),
 
		'S_ENABLE_FEEDS_FORUM'	=> ($config['feed_forum'] && $forum_data['forum_type'] == FORUM_POST && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $forum_data['forum_options'])) ? true : false,
	));
 
	return;
}

Generiert die Navlinks für viewforum (und viewtopic)!

forum/styles/prosilver/template/overall_header.html

Diese Datei enthält das Layout (in phpBB Sprache Template) für den Kopf der Seite. Sprich, diese Datei wird zu Beginn jeder Seite ausgegeben, nachdem die enthaltene TemplateAnweisungen abgearbeitet worden sind.

Wichtig hier sind die TemplateVariablen für Navlinks und Sidebar. Da die Sidebar NEBEN dem Body angezeigt werden soll, haben wir den gesamten Body in eine Tabelle verfrachtet. Diese Datei enthält nur den Beginn der Tabelle, das „Ende“ (</table>) kommt erst im Footer!

		</div>
		<!-- ENDIF -->
		{PROGGEN_ORG_TOPBAR}
		{PROGGEN_ORG_NAVLINKS}

(ca um Zeile 140)

<!- Wird im Moment nicht wirklich gebraucht ... also auskommentiert (im Quelltext von Firefox&Co NICHT sichtbar!->

(Zeile 153) Keine Ahnung, ich weiß, dass ich das eingefügt habe. Im Bereich darum herum sind Definitionen für die original Navlinks etc. Vermutlich habe ich die dadurch deaktiviert, dass im Template ein <!IF 0> (also if(false) ) steht.

<table class="menuandforum" cellspacing="0" cellpadding="0" border="0">
{PROGGEN_ORG_SIDEBAR}
 
<!- Proggen.org ->
<td style="vertical-align:top;padding-top:16px">
	<div id="page-body">
		<!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
		<div id="information" class="rules">
			<div class="inner"><span class="corners-top"><span></span></span>
				<strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED}
			<span class="corners-bottom"><span></span></span></div>
		</div>
		<!-- ENDIF -->

(Am Ende der Datei)

forum/styles/prosilver/template/overall_footer.html

	</div>
<!- f proggen.org sidebar ->
</td>
</tr>
</table>

Ende besagter Tabelle.

<div align=center>{S_TIMEZONE}</div>
 
<!-- IF 0 -->
 
	<div class="navbar">

Das IF ist vermutlich dazu dar, die üblichen Steuer/Navigationselemente zu deaktivieren.

<!-- ENDIF -->
 
	{PROGGEN_ORG_FOOTER}