Portal kann nicht aufgerufen werden - allgemeiner Fehler

Fragen zur Bedienung von phpBB 3.0.x, Probleme bei der Benutzung und alle weiteren Fragen inkl. Update auf die neuste phpBB 3.0.14 Version
Forumsregeln
phpBB 3.0 hat das Ende seiner Lebenszeit überschritten
phpBB 3.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 3.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.
woidhex
Mitglied
Beiträge: 19
Registriert: 19.07.2012 13:02

Portal kann nicht aufgerufen werden - allgemeiner Fehler

Beitrag von woidhex »

Hallo,

ich bin ein wenig ratlos. Mein Forum läuft schon eine ganze Weile, bis dann gestern auf einmal diese Fehlermeldung kam:
Allgemeiner Fehler
SQL ERROR [ mysqli ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND in_message = 0 ORDER BY filetime DESC' at line 4 [1064]

SQL

SELECT * FROM phpbb_attachments WHERE post_msg_id = AND in_message = 0 ORDER BY filetime DESC

BACKTRACE


FILE: [ROOT]/includes/db/mysqli.php
LINE: 182
CALL: dbal->sql_error()

FILE: [ROOT]/portal/includes/functions.php
LINE: 283
CALL: dbal_mysqli->sql_query()

FILE: [ROOT]/portal/block/news.php
LINE: 30
CALL: phpbb_fetch_posts()

FILE: [ROOT]/portal.php
LINE: 132
CALL: include('[ROOT]/portal/block/news.php')
+


Fand leider nichts dazu hier in der Suche oder in den vorhanden Beiträgen, weswegen ich einen neuen Thread angefangen habe.

Wenn ich dann über die Index-Seite ins Forum gehw und dort auf 'Neue Beiträge' klicke, kommt eine weiße Seite, genauso wie beim Abschicken eines neuen Beitrages. Allerdings ist der Beitrag dann doch da.

(Zwischenzeitlich wird das Portal wieder angezeigt, aber auch von da aus kommt man nicht in die neuen Beiträge.)

Auf Nachfrage bei meinem Hoster wurde mir mitgeteilt, dass an den Servern nichts gemacht wurde. Daran kann es also auch nicht liegen.

Was kann ich tun, damit es wieder funzt? Ich bin ein bisschen hilflos - naja, auch ein bisschen computerplont vielleicht auch ;-)

Ich benutze die aktuelle Version von phpbb3 -3.0.10

Danke schon mal für euere hilfreichen und vorallem verständlichen Antworten.

lg woidhex

cpg
Mitglied
Beiträge: 418
Registriert: 24.11.2007 12:43
Kontaktdaten:

Re: Portal kann nicht aufgerufen werden - allgemeiner Fehler

Beitrag von cpg »

Moin,
Auf Nachfrage bei meinem Hoster wurde mir mitgeteilt, dass an den Servern nichts gemacht wurde. Daran kann es also auch nicht liegen.
Sieht aber in meinen Augen so aus, dass es mit der Verbindung zur Datenbank nicht klappt.
(Zwischenzeitlich wird das Portal wieder angezeigt, aber auch von da aus kommt man nicht in die neuen Beiträge.)
Auch das lässt mich vermuten, dass es doch eine Server-Störung sein könnte.

... oder hast Du irgendwelche Umbauten oder Verbesserungen vorgenommen?
Ist vielleicht der zur Verfügung stehende Webspace ausgeschöpft?

Gruß
CPG

woidhex
Mitglied
Beiträge: 19
Registriert: 19.07.2012 13:02

Re: Portal kann nicht aufgerufen werden - allgemeiner Fehler

Beitrag von woidhex »

Danke für die schnelle Antwort.

Nein, ich habe nichts am Forum gemacht seit dem Update vor Monaten.
Das Forum läuft seit 2006 eigentlich sehr stabil.

Speicherplatz hab ich auch noch genug auf dem Server, das dürfte nicht das Problem sein.

Wäre schön, wenn ihr doch noch Ideen habt.

cpg
Mitglied
Beiträge: 418
Registriert: 24.11.2007 12:43
Kontaktdaten:

Re: Portal kann nicht aufgerufen werden - allgemeiner Fehler

Beitrag von cpg »

Moin,

Du hast nach "Portal" gefragt...
bei der folgenden Seite gab es auch mal so ein Problem; die Lösung ist aber im Sande verlaufen oder wurde nicht veröffentlicht:

http://www.board3.de/viewtopic.php?f=8&t=5036

Dann habe ich hier noch etwas gefunden; vielleicht helfen Dir die Informationen etwas weiter:

http://www.phpbb.com/community/viewtopi ... &t=1561495


Nachtrag:
FILE: [ROOT]/portal/includes/functions.php
LINE: 283
CALL: dbal_mysqli->sql_query()

FILE: [ROOT]/portal/block/news.php
LINE: 30
CALL: phpbb_fetch_posts()
Deaktiviere doch mal einige von den Portal-Blöcken. Wie sieht es dann aus?

Viel Erfolg
Gruß
CPG

woidhex
Mitglied
Beiträge: 19
Registriert: 19.07.2012 13:02

Re: Portal kann nicht aufgerufen werden - allgemeiner Fehler

Beitrag von woidhex »

Hmmmm..... diese Links helfen mir so gar nicht weiter :(
Wie ich schon sagte, bin ich ein bisschen PC-blond :oops:

Das Portal wird nun wieder angezeigt, aber ich komm nicht mit 'Neue Beiträge' weiter.
Es kommt dann immer eine weiße Seite: Seite kann nicht angezeigt werden - Verbindungsprobleme 'blabla...'


Jetzt wollte ich eben einen Test-Account machen und beim Abschicken der Registrierung kam auch wieder die Fehlerseite, also die mit dem Verbindungsproblem. Beim Neuladen der Seite dann das:
Allgemeiner Fehler
SQL ERROR [ mysqli ]

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND in_message = 0 ORDER BY filetime DESC' at line 4 [1064]

Beim Laden der Seite ist ein SQL-Fehler aufgetreten. Bitte kontaktiere die Board-Administration, falls dieses Problem fortlaufend auftritt.

Langsam werden meine grauen Haare noch grauer...... :-?

Über die index.php komm ich aber wieder ins Forum und kann mich auch einloggen.
Allerdings funzen da aber auch nicht die Links zu den newposts
Ob es jetzt das Forum nur mir anzeigt? :roll:

Hier mal der Link zu meinem Forum

Bin für jede Hilfe dankbar :cry:

Benutzeravatar
BNa
Valued Contributor
Beiträge: 2641
Registriert: 12.04.2010 23:51
Kontaktdaten:

Re: Portal kann nicht aufgerufen werden - allgemeiner Fehler

Beitrag von BNa »

Verlinke mal diese drei Dateien

Code: Alles auswählen

portal/includes/functions.php
portal/block/news.php
portal.php
getrennt in das Pastebin https://www.phpbb.de/support/pastebin.php und verlinke diese drei dann hierher.

cpg
Mitglied
Beiträge: 418
Registriert: 24.11.2007 12:43
Kontaktdaten:

Re: Portal kann nicht aufgerufen werden - allgemeiner Fehler

Beitrag von cpg »

Moin,

ich bin über http://www.gartenplauderei.de/forum/index.php
zu Deinem Forum gekommen.

Du kommst doch in den Admin-Bereich Deines Forums?
Denn deaktiviere doch mal unter "Mods" "Portal" den News-Block.

Gruß
CPG

Benutzeravatar
BNa
Valued Contributor
Beiträge: 2641
Registriert: 12.04.2010 23:51
Kontaktdaten:

Re: Portal kann nicht aufgerufen werden - allgemeiner Fehler

Beitrag von BNa »

Versuch mal

Öffne

portal/includes/functions.php

Code: Alles auswählen

                $attachments = array();
                if( $config['allow_attachments'] )
                {
                        // Pull attachment data
                        $sql2 = 'SELECT *
                           FROM ' . ATTACHMENTS_TABLE . '
                           WHERE post_msg_id = '. $row['post_id'] .'
                           AND in_message = 0
                           ORDER BY filetime DESC';
                                   
                        $result2 = $db->sql_query($sql2);
 
                        while ($row2 = $db->sql_fetchrow($result2))
                        {
                           $attachments[] = $row2;
                        }
                        $db->sql_freeresult($result2);
                }
Ersetze mit

Code: Alles auswählen

                $attachments = array();
                if( $config['allow_attachments'] )
                {
                        
                       // Error prevent for an empty post_id                 
                       $row['post_id'] = (empty($row['post_id'])) ? 0 : $row['post_id'];
                        
                        // Pull attachment data
                        $sql2 = 'SELECT *
                           FROM ' . ATTACHMENTS_TABLE . '
                           WHERE post_msg_id = '. $row['post_id'] .'
                           AND in_message = 0
                           ORDER BY filetime DESC';
                                   
                        $result2 = $db->sql_query($sql2);
 
                        while ($row2 = $db->sql_fetchrow($result2))
                        {
                           $attachments[] = $row2;
                        }
                        $db->sql_freeresult($result2);
                }

woidhex
Mitglied
Beiträge: 19
Registriert: 19.07.2012 13:02

Re: Portal kann nicht aufgerufen werden - allgemeiner Fehler

Beitrag von woidhex »

Hi BNa, dann sind hier mal die drei Dateien:

portal/includes/functions.php

Code: Alles auswählen

<?php

/**
*
* @package - Board3portal
* @version $Id: functions.php 370 2008-09-10 17:24:23Z icedcold $
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/


if (!defined('IN_PHPBB'))
{
   exit;
}

include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);

// Get portal config
function obtain_portal_config()
{
	global $db, $cache;

	if (($portal_config = $cache->get('portal_config')) !== true)
	{
		$portal_config = $cached_portal_config = array();

		$sql = 'SELECT config_name, config_value
			FROM ' . PORTAL_CONFIG_TABLE;
		$result = $db->sql_query($sql);

		while ($row = $db->sql_fetchrow($result))
		{
			$cached_portal_config[$row['config_name']] = $row['config_value'];
			$portal_config[$row['config_name']] = $row['config_value'];
		}
		$db->sql_freeresult($result);

		$cache->put('portal_config', $cached_portal_config);
	}

	return $portal_config;
}

/**
* Set config value. Creates missing config entry.
*/
function set_portal_config($config_name, $config_value)
{
	global $db, $cache, $portal_config;

	$sql = 'UPDATE ' . PORTAL_CONFIG_TABLE . "
		SET config_value = '" . $db->sql_escape($config_value) . "'
		WHERE config_name = '" . $db->sql_escape($config_name) . "'";
	$db->sql_query($sql);

	if (!$db->sql_affectedrows() && !isset($portal_config[$config_name]))
	{
		$sql = 'INSERT INTO ' . PORTAL_CONFIG_TABLE . ' ' . $db->sql_build_array('INSERT', array(
			'config_name'	=> $config_name,
			'config_value'	=> $config_value));
		$db->sql_query($sql);
	}

	$portal_config[$config_name] = $config_value;
}

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

// fetch post for news & announce
function phpbb_fetch_posts($forum_from, $permissions, $number_of_posts, $text_length, $time, $type, $start = 0)
{
	global $db, $phpbb_root_path, $auth, $user, $bbcode_bitfield, $bbcode, $portal_config, $config;
	
	$posts = array();

	$post_time = ($time == 0) ? '' : 'AND t.topic_time > ' . (time() - $time * 86400);

	$forum_from = ( strpos($forum_from, ',') !== FALSE ) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());

	$str_where = '';
	
	$topic_icons = array(0);
	
	$have_icons = 0;

	if( $permissions == TRUE )
	{
		$disallow_access = array_unique(array_keys($auth->acl_getf('!f_read', true)));
	} else {
		$disallow_access = array();
	}
	
	$global_f = 0;
	
	if( sizeof($forum_from) )
	{
		$disallow_access = array_diff($forum_from, $disallow_access);		
		if( !sizeof($disallow_access) )
		{
			return array();
		}
		
		foreach( $disallow_access as $acc_id)
		{
			$acc_id = (int) $acc_id;
			$str_where .= "t.forum_id = $acc_id OR ";
			if( $type == 'announcements' && $global_f < 1 && $acc_id > 0 )
			{
				$global_f = $acc_id;
			}
		}
	}
	else
	{
		foreach( $disallow_access as $acc_id )
		{
			$acc_id = (int) $acc_id;
			$str_where .= "t.forum_id <> $acc_id AND ";
		}
	}
	
	switch( $type )
	{
		case "announcements":

			$topic_type = '(( t.topic_type = ' . POST_ANNOUNCE . ') OR ( t.topic_type = ' . POST_GLOBAL . '))';
			$str_where = ( strlen($str_where) > 0 ) ? 'AND (t.forum_id = 0 OR (' . trim(substr($str_where, 0, -4)) . '))' : '';
			$user_link = 't.topic_poster = u.user_id';
			$post_link = 't.topic_first_post_id = p.post_id';
			$topic_order = 't.topic_time DESC';

		break;
		case "news":

			$topic_type = 't.topic_type = ' . POST_NORMAL;
			$str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
			$user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
			$post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
			$topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;


		break;
		case "news_all":

			$topic_type = '( t.topic_type <> ' . POST_ANNOUNCE . ' ) AND ( t.topic_type <> ' . POST_GLOBAL . ')';
			$str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
			$user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
			$post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
			$topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;

		break;
	}
	
	if( $type == 'announcements' && $global_f < 1 )
	{
		$sql = 'SELECT
					forum_id
				FROM
					' . FORUMS_TABLE . '
				WHERE
					forum_type = ' . FORUM_POST . '
					' . str_replace('t.', '', $str_where) . '
				ORDER BY
					forum_id';
		$result = $db->sql_query_limit($sql, 1);
		
		
		
		$row = $db->sql_fetchrow($result);
		if( !sizeof( $row ) )
		{
			return array();
		}
		$global_f = $row['forum_id'];
		
	}
	
	$sql_array = array(
		'SELECT' => 't.forum_id,
			t.topic_id,
			t.topic_last_post_id,
			t.topic_last_post_time,
			t.topic_time,
			t.topic_title,
			t.topic_attachment,
			t.topic_views,
			t.poll_title,
			t.topic_replies,
			t.topic_replies_real,
			t.topic_poster,
			t.topic_type,
			t.topic_status,
			t.topic_last_poster_name,
			t.topic_last_poster_id,
			t.topic_last_poster_colour,
			t.icon_id,
			u.username,
			u.user_id,
			u.user_type,
			u.user_colour,
			p.post_id,
			p.poster_id,
			p.post_time,
			p.post_text,
			p.post_attachment,
			p.post_username,
			p.enable_smilies,
			p.enable_bbcode,
			p.enable_magic_url,
			p.bbcode_bitfield,
			p.bbcode_uid,
			f.forum_name,
			f.enable_icons',
			
		'FROM' => array(
			TOPICS_TABLE => 't',
		),
		
		'LEFT_JOIN' => array(
			array(
				'FROM' => array(USERS_TABLE => 'u'),
				'ON' => $user_link,
			),
			array(
				'FROM' => array(FORUMS_TABLE => 'f'),
				'ON' => 't.forum_id=f.forum_id',
			),
			array(
				'FROM' => array(POSTS_TABLE => 'p'),
				'ON' => $post_link,
			),
		),
		
		'WHERE' => $topic_type . '
				' . $post_time . '
				AND t.topic_status <> ' . ITEM_MOVED . '
				AND t.topic_approved = 1
				AND t.topic_moved_id = 0
				' . $str_where,
				
		'ORDER_BY' => $topic_order,	
	);
					
	$sql_array['LEFT_JOIN'][] = array('FROM' => array(TOPICS_POSTED_TABLE => 'tp'), 'ON' => 'tp.topic_id = t.topic_id AND tp.user_id = ' . $user->data['user_id']);
	$sql_array['SELECT'] .= ', tp.topic_posted';
					
	$sql = $db->sql_build_query('SELECT', $sql_array);

	if ($number_of_posts <> 0)
	{
		$result = $db->sql_query_limit($sql, $number_of_posts, $start);
	} else {
		$result = $db->sql_query($sql);
	}

	// Instantiate BBCode if need be
	if ($bbcode_bitfield !== '')
	{
		$phpEx = substr(strrchr(__FILE__, '.'), 1);
		include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
		$bbcode = new bbcode(base64_encode($bbcode_bitfield));
	}

	$i = 0;

	while ( $row = $db->sql_fetchrow($result) )
	{

		$attachments = array();
		if( $config['allow_attachments'] )
		{
			// Pull attachment data
			$sql2 = 'SELECT *
			   FROM ' . ATTACHMENTS_TABLE . '
			   WHERE post_msg_id = '. $row['post_id'] .'
			   AND in_message = 0
			   ORDER BY filetime DESC';
			            
			$result2 = $db->sql_query($sql2);

			while ($row2 = $db->sql_fetchrow($result2))
			{
			   $attachments[] = $row2;
			}
			$db->sql_freeresult($result2);
		}
		
		$posts[$i]['bbcode_uid'] = $row['bbcode_uid'];
		$len_check = $row['post_text'];
		$maxlen = $text_length;

		if (($text_length != 0) && (strlen($len_check) > $text_length))
		{
			$message = censor_text(get_sub_taged_string(str_replace("\n", '<br/> ', $row['post_text']), $row['bbcode_uid'], $maxlen));
			$posts[$i]['striped'] = true;
		}
		else 
		{
			$message = censor_text( str_replace("\n", '<br/> ', $row['post_text']) );
		}

		// Second parse bbcode here
		if ($row['bbcode_bitfield'])
		{
			$bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']);
		}
		if (!empty($attachments))
		{
		   parse_attachments($row['forum_id'], $message, $attachments, $update_count);
		}
		$message = smiley_text($message); // Always process smilies after parsing bbcodes
		
		if( $global_f < 1 )
		{				
			$global_f = $row['forum_id'];
		}
		
		$topic_icons[] = $row['enable_icons'];
		$have_icons = ( $row['icon_id'] > 0 ) ? 1 : $have_icons;
		
		$posts[$i] = array_merge($posts[$i], array(
			'post_text'				=> ap_validate($message),
			'topic_id'				=> $row['topic_id'],
			'topic_last_post_id'	=> $row['topic_last_post_id'],
			'topic_type'			=> $row['topic_type'],
			'topic_posted'			=> (isset($row['topic_posted']) && $row['topic_posted']) ? true : false,
			'icon_id'				=> $row['icon_id'],
			'topic_status'			=> $row['topic_status'],
			'forum_id'				=> $row['forum_id'],
			'topic_replies'			=> $row['topic_replies'],
			'topic_replies_real'	=> $row['topic_replies_real'],
			'topic_time'			=> $user->format_date($row['post_time']),
			'topic_last_post_time'	=> $row['topic_last_post_time'],
			'topic_title'			=> $row['topic_title'],
			'username'				=> $row['username'],
			'username_full'			=> get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $row['post_username']),
			'username_full_last'	=> get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour'], $row['topic_last_poster_name']),
			'user_id'				=> $row['user_id'],
			'user_type'				=> $row['user_type'],
			'user_colour'			=> $row['user_colour'],
			'poll'					=> ($row['poll_title']) ? true : false,
			'attachment'			=> ($row['topic_attachment']) ? true : false,
			'topic_views'			=> $row['topic_views'],
			'forum_name'			=> $row['forum_name'],
			'attachments'			=> (!empty($attachments)) ? $attachments : array(),
		));
		$posts['global_id'] = $global_f;
								
		$i++;
	}
	
	$posts['topic_icons'] = ( (max($topic_icons) > 0 ) && $have_icons ) ? true : false;

	$posts['topic_count'] = $i;
	
	if( $global_f < 1 )
	{
		return array();
	} else {
		return $posts;
	}
}

/**
* Censor title, return short title
*
* @param $title string title to censor
* @param $limit int short title character limit
*
*/
function character_limit(&$title, $limit = 0)
{
   $title = censor_text($title);
   if ($limit > 0)
   {
	  return (strlen(utf8_decode($title)) > $limit + 3) ? truncate_string($title, $limit) . '...' : $title;
   }
   else
   {
	  return $title;
   }
}

// Don't let them mess up the complete portal layout in cut messages and do some real AP magic

function is_valid_bbtag($str, $bbuid) {
  return (substr($str,0,1) == '[') && (strpos($str, ':'.$bbuid.']') > 0);
}

function get_end_bbtag($tag, $bbuid) {
  $etag = '';
  for($i=0;$i<strlen($tag);$i++) {
    if ($tag[$i] == '[') $etag .= $tag[$i] . '/';
    else if (($tag[$i] == '=') || ($tag[$i] == ':')) {
      if ($tag[1] == '*') $etag .= ':m:'.$bbuid.']';
      else if (strpos($tag, 'list')) $etag .= ':u:'.$bbuid.']';
      else $etag .= ':'.$bbuid.']';
      break;
    } else $etag .= $tag[$i];
  }

  return $etag;
}

function get_next_word($str) {
  $ret = '';
  for($i=0;$i<strlen($str);$i++) {
    switch ($str[$i]) {
      case ' ': //$ret .= ' '; break; break;
                return $ret . ' ';
      case '\\': 
        if ($str[$i+1] == 'n') return $ret . '\n';
      case '[': if ($i != 0) return $ret;
      default: $ret .= $str[$i];
    }    
  }
  return $ret;
}

function get_next_bbhtml_part($str) {
  $lim =  substr($str,0,strpos($str,'>')+1);
	return substr($str,0,strpos($str, $lim, strlen($lim))+strlen($lim));
}

function get_sub_taged_string($str, $bbuid, $maxlen) {
  $sl = $str;
  $ret = '';
  $ntext = '';
  $lret = '';
  $i = 0;
  $cnt = $maxlen;
  $last = '';
  $arr = array();

  while((strlen($ntext) < $cnt) && (strlen($sl) > 0)) {
    $sr = '';
    if (substr($sl, 0, 1) == '[') $sr = substr($sl,0,strpos($sl,']')+1);
    /* GESCHLOSSENE HTML-TAGS BEACHTEN */
    if (substr($sl, 0, 2) == '<!') {
			$sr = get_next_bbhtml_part($sl);
			$ret .= $sr;
		} else if (substr($sl, 0, 1) == '<') {
      	$sr = substr($sl,0,strpos($sl,'>')+1);
				$ret .= $sr;
    } else if (is_valid_bbtag($sr, $bbuid)) {
      if ($sr[1] == '/') {
        /* entfernt das endtag aus dem tag array */
        $tarr = array();
        $j = 0;
        foreach ($arr as $elem) {
          if (strcmp($elem[1],$sr) != 0) $tarr[$j++] = $elem;
        }
        $arr = $tarr;
      } else {
        $arr[$i][0] = $sr;
        $arr[$i++][1] = get_end_bbtag($sr, $bbuid);
      } 
      $ret .= $sr;
    } else {
      $sr = get_next_word($sl);
      $ret .= $sr;
      $ntext .= $sr;
      $last = $sr;
    }
    $sl = substr($sl, strlen($sr), strlen($sl)-strlen($sr));
  }

  $ret = trim($ret) . '...';

  $ap = '';
  foreach ($arr as $elem) {
     $ap = $elem[1] . $ap;
  }
  $ret .= $ap;

  return $ret;
}

function ap_validate($str) {
  $s = str_replace('<br />', '<br/>', $str);
  return str_replace('</li><br/>', '</li>', $s);
}

/**
* Pagination routine, generates archive number sequence
*/
    function generate_portal_pagination($base_url, $num_items, $per_page, $start_item, $type, $add_prevnext_text = false, $tpl_prefix = '')
    {
       global $template, $user;

       switch( $type )
       {
          case "announcements":
             $pagination_type = 'ap';
             $anker = '#a';
          break;
          case "news":
          case "news_all":
             $pagination_type = 'np';
             $anker = '#n';
          break;
       }
       
       // Make sure $per_page is a valid value
       $per_page = ($per_page <= 0) ? 1 : $per_page;

       $seperator = '<span class="page-sep">' . $user->lang['COMMA_SEPARATOR'] . '</span>';
       $total_pages = ceil($num_items / $per_page);

       if ($total_pages == 1 || !$num_items)
       {
          return false;
       }

       $on_page = floor($start_item / $per_page) + 1;
       $url_delim = (strpos($base_url, '?') === false) ? '?' : '&';

       $page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href="' . $base_url . $anker .'">1</a>';

       if ($total_pages > 5)
       {
          $start_cnt = min(max(1, $on_page - 4), $total_pages - 5);
          $end_cnt = max(min($total_pages, $on_page + 4), 6);

          $page_string .= ($start_cnt > 1) ? ' ... ' : $seperator;

          for ($i = $start_cnt + 1; $i < $end_cnt; $i++)
          {
             $page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($i - 1) * $per_page) . $anker . '">' . $i . '</a>';
             if ($i < $end_cnt - 1)
             {
                $page_string .= $seperator;
             }
          }

          $page_string .= ($end_cnt < $total_pages) ? ' ... ' : $seperator;
       }
       else
       {
          $page_string .= $seperator;

          for ($i = 2; $i < $total_pages; $i++)
          {
             $page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($i - 1) * $per_page) . $anker . '">' . $i . '</a>';
             if ($i < $total_pages)
             {
                $page_string .= $seperator;
             }
          }
       }

       $page_string .= ($on_page == $total_pages) ? '<strong>' . $total_pages . '</strong>' : '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($total_pages - 1) * $per_page) . $anker . '">' . $total_pages . '</a>';

       if ($add_prevnext_text)
       {
          if ($on_page != 1)
          {
             $page_string = '<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . (($on_page - 2) * $per_page) . $anker . '">' . $user->lang['PREVIOUS'] . '</a>&nbsp;&nbsp;' . $page_string;
          }

          if ($on_page != $total_pages)
          {
             $page_string .= '&nbsp;&nbsp;<a href="' . $base_url . "{$url_delim}" . $pagination_type . '=' . ($on_page * $per_page) . $anker . '">' . $user->lang['NEXT'] . '</a>';
          }
       }

       $template->assign_vars(array(
          $tpl_prefix . 'BASE_URL'      => $base_url,
          'A_' . $tpl_prefix . 'BASE_URL'   => addslashes($base_url),
          $tpl_prefix . 'PER_PAGE'      => $per_page,

          $tpl_prefix . 'PREVIOUS_PAGE'   => ($on_page == 1) ? '' : $base_url . "{$url_delim}" . $pagination_type . '=' . (($on_page - 2) * $per_page) . $anker,
          $tpl_prefix . 'NEXT_PAGE'      => ($on_page == $total_pages) ? '' : $base_url . "{$url_delim}" . $pagination_type . '=' . ($on_page * $per_page) . $anker,
          $tpl_prefix . 'TOTAL_PAGES'      => $total_pages,
       ));

       return $page_string;
    }

?>

portal/block/news.php

Code: Alles auswählen

<?php

/**
*
* @package - Board3portal
* @version $Id: news.php 376 2008-09-20 21:18:46Z icedcold $
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

if (!defined('IN_PHPBB'))
{
   exit;
}

if (!defined('IN_PORTAL'))
{
   exit;
}

$news = request_var('news', -1);
$user->add_lang('viewforum');
$start = request_var('np', 0);
$start = ($start < 0) ? 0 : $start;

// Fetch news from portal/includes/functions.php with check if "read full" is requested.
$portal_news_length = ($news < 0) ? $portal_config['portal_news_length'] : 0;
$fetch_news = phpbb_fetch_posts($portal_config['portal_news_forum'], $portal_config['portal_news_permissions'], $portal_config['portal_number_of_news'], $portal_news_length, 0, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news', $start);


// Any news present? If not terminate it here.
if (sizeof($fetch_news) == 0)
{
	$template->assign_block_vars('news_row', array(
		'S_NO_TOPICS'	=> true,
		'S_NOT_LAST'	=> false,
	));
}
else
{
	// Count number of posts for news archive, considering if permission check is dis- or enabled.
	if ( $portal_config['portal_news_archive'] )
	{
		$permissions = $portal_config['portal_news_permissions'];
		$forum_from = $portal_config['portal_news_forum'];

		$forum_from = ( strpos($forum_from, ',') !== FALSE ) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());

		$str_where = '';

		if( $permissions == TRUE )
		{
			$disallow_access = array_unique(array_keys($auth->acl_getf('!f_read', true)));
		} else {
			$disallow_access = array();
		}
		
		if( sizeof($forum_from) )
		{
			$disallow_access = array_diff($forum_from, $disallow_access);		
			if( !sizeof($disallow_access) )
			{
				return array();
			}
			
			foreach( $disallow_access as $acc_id)
			{
				$acc_id = (int) $acc_id;
				$str_where .= "forum_id = $acc_id OR ";
			}
		}
		else
		{
			foreach( $disallow_access as $acc_id )
			{
				$acc_id = (int) $acc_id;
				$str_where .= "forum_id <> $acc_id AND ";
			}
		}

		$str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';

		$topic_type = ($portal_config['portal_show_all_news']) ? '( topic_type <> ' . POST_ANNOUNCE . ' ) AND ( topic_type <> ' . POST_GLOBAL . ')' : 'topic_type = ' . POST_NORMAL;

		$sql = 'SELECT COUNT(topic_id) AS num_topics
			FROM ' . TOPICS_TABLE . '
			WHERE ' . $topic_type . '
				AND topic_approved = 1
				AND topic_moved_id = 0
				' . $str_where;
			$result = $db->sql_query($sql);
			$total_news = (int) $db->sql_fetchfield('num_topics');
			$db->sql_freeresult($result);
	}

	if($news < 0)
	// Show the news overview
	{
		$count = $fetch_news['topic_count'];
		for ($i = 0; $i < $count; $i++)
		{
			if( isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true )
			{
				$open_bracket = '[ ';
				$close_bracket = ' ]';
				$read_full = $user->lang['READ_FULL'];
			}
			else
			{
				$open_bracket = '';
				$close_bracket = '';
				$read_full = '';
			}
			// unread?
			$forum_id = $fetch_news[$i]['forum_id'];
			$topic_id = $fetch_news[$i]['topic_id'];
			$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
			$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
			
			$read_full_url = (isset($_GET['np'])) ? 'np='. $start . '&news=' . $i . '#n' . $i : 'news=' . $i . '#n' . $i;
			$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
			if ( $portal_config['portal_news_archive'] )
			{
				$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $portal_config['portal_number_of_news'], $start, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
			}
			
				$replies = ($auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies'];
				$folder_img = $folder_alt = $topic_type = $folder = $folder_new = '';
				switch ($fetch_news[$i]['topic_type'])
				{
					case POST_STICKY:
						$folder = 'sticky_read';
						$folder_new = 'sticky_unread';
					break;
					case POST_ANNOUNCE:
						$folder = 'announce_read';
						$folder_new = 'announce_unread';
					break;
					default:
						$folder = 'topic_read';
						$folder_new = 'topic_unread';
					if ($config['hot_threshold'] && $replies >= $config['hot_threshold'] && $fetch_news[$i]['topic_status'] != ITEM_LOCKED)
						{
							$folder .= '_hot';
							$folder_new .= '_hot';
						}
					break;
				}
	
				if ($fetch_news[$i]['topic_status'] == ITEM_LOCKED)
				{
					$folder .= '_locked';
					$folder_new .= '_locked';
				}
				if ($fetch_news[$i]['topic_posted'])
				{
					$folder .= '_mine';
					$folder_new .= '_mine';
				}

				$folder_img = ($unread_topic) ? $folder_new : $folder;
				$folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($fetch_news[$i]['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');
				
				// Grab icons
				$icons = $cache->obtain_icons();
				$forum_data = $db->sql_fetchrow($result);
				$s_display_active = ($forum_data['forum_type'] == FORUM_CAT && ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false;
			
			$template->assign_block_vars('news_row', array(
				'ATTACH_ICON_IMG'	=> ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
				'FORUM_NAME'		=> ( $forum_id ) ? $fetch_news[$i]['forum_name'] : '',
				'TITLE'				=> $fetch_news[$i]['topic_title'],
				'POSTER'			=> $fetch_news[$i]['username'],
				'POSTER_FULL'		=> $fetch_news[$i]['username_full'],
				'USERNAME_FULL_LAST'	=> $fetch_news[$i]['username_full_last'],	
				'U_USER_PROFILE'	=> (($fetch_news[$i]['user_type'] == USER_NORMAL || $fetch_news[$i]['user_type'] == USER_FOUNDER) && $fetch_news[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news[$i]['user_id']) : '',
				'TIME'				=> $fetch_news[$i]['topic_time'],
				'LAST_POST_TIME'		=> $user->format_date($fetch_news[$i]['topic_last_post_time']),
				'TEXT'				=> $fetch_news[$i]['post_text'],
				'REPLIES'			=> $fetch_news[$i]['topic_replies'],
				'TOPIC_VIEWS'		=> $fetch_news[$i]['topic_views'],
				'N_ID'				=> $i,
				'TOPIC_FOLDER_IMG'		=> $user->img($folder_img, $folder_alt),
				'TOPIC_FOLDER_IMG_SRC'  => $user->img($folder_img, $folder_alt, false, '', 'src'),
				'TOPIC_FOLDER_IMG_ALT'  => $user->lang[$folder_alt],
				'TOPIC_ICON_IMG'		=> (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['img'] : '',
				'TOPIC_ICON_IMG_WIDTH'	=> (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['width'] : '',
				'TOPIC_ICON_IMG_HEIGHT'	=> (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['height'] : '',
				'FOLDER_IMG'			=> $user->img('topic_read', 'NO_NEW_POSTS'),
				'U_VIEWFORUM'		=> append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news[$i]['forum_id']),
				'U_LAST_COMMENTS'   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id'] . '&p=' . $fetch_news[$i]['topic_last_post_id'] . '#p' . $fetch_news[$i]['topic_last_post_id']),
				'U_VIEW_COMMENTS'	=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
				'U_VIEW_UNREAD'		=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id'] . '&view=unread#unread'),
				'U_POST_COMMENT'	=> append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
				'U_READ_FULL'		=> append_sid("{$phpbb_root_path}portal.$phpEx", $read_full_url),
				'L_READ_FULL'		=> $read_full,
				'OPEN'				=> $open_bracket,
				'CLOSE'				=> $close_bracket,
				'S_NOT_LAST'		=> ($i < sizeof($fetch_news) - 1) ? true : false,
				'S_POLL'			=> $fetch_news[$i]['poll'],
				'S_UNREAD_INFO'		=> $unread_topic,
				'PAGINATION'		=> topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
				'S_HAS_ATTACHMENTS'		=> (!empty($fetch_news[$i]['attachments'])) ? true : false,
			));
			
			if( !empty($fetch_news[$i]['attachments']) )
			{
				foreach ($fetch_news[$i]['attachments'] as $attachment)
				{
					$template->assign_block_vars('news_row.attachment', array(
						'DISPLAY_ATTACHMENT'	=> $attachment)
					);
				}
			}
			
			if ($portal_config['portal_number_of_news'] <> 0 && $portal_config['portal_news_archive'])
			{
				$template->assign_vars(array(
					'NP_PAGINATION'		=> $pagination,
					'TOTAL_NEWS'		=> ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
					'NP_PAGE_NUMBER'	=> on_page($total_news, $portal_config['portal_number_of_news'], $start))
				);
			}
		}
	}
	else
	// Show "read full" page
	{
		$i = $news;
		$forum_id = $fetch_news[$i]['forum_id'];
		$topic_id = $fetch_news[$i]['topic_id'];
		$topic_tracking_info = get_complete_topic_tracking($forum_id, $topic_id, $global_announce_list = false);
		$unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
		$open_bracket = '[ ';
		$close_bracket = ' ]';
		$read_full = $user->lang['BACK'];
				
		$read_full_url = (isset($_GET['np'])) ? append_sid("{$phpbb_root_path}portal.$phpEx", "np=$start#n$i") : append_sid("{$phpbb_root_path}portal.$phpEx#n$i");
		$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
		if ( $portal_config['portal_news_archive'] )
		{
			$pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $portal_config['portal_number_of_news'], $start, ($portal_config['portal_show_all_news']) ? 'news_all' : 'news');
		}

		$template->assign_block_vars('news_row', array(
			'ATTACH_ICON_IMG'	=> ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
			'FORUM_NAME'		=> ( $forum_id ) ? $fetch_news[$i]['forum_name'] : '',
			'TITLE'				=> $fetch_news[$i]['topic_title'],
			'POSTER'			=> $fetch_news[$i]['username'],
			'POSTER_FULL'		=> $fetch_news[$i]['username_full'],
			'TIME'				=> $fetch_news[$i]['topic_time'],
			'TEXT'				=> $fetch_news[$i]['post_text'],
			'REPLIES'			=> $fetch_news[$i]['topic_replies'],
			'TOPIC_VIEWS'		=> $fetch_news[$i]['topic_views'],
			'N_ID'				=> $i,
			'U_VIEWFORUM'		=> append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news[$i]['forum_id']),
			'U_LAST_COMMENTS'   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $fetch_news[$i]['topic_last_post_id'] . '#p' . $fetch_news[$i]['topic_last_post_id']),
			'U_VIEW_COMMENTS'	=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
			'U_POST_COMMENT'	=> append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
			'S_POLL'			=> $fetch_news[$i]['poll'],
			'S_UNREAD_INFO'		=> $unread_topic,
			'U_READ_FULL'      	=> $read_full_url,
			'L_READ_FULL'      	=> $read_full,      
			'OPEN'            	=> $open_bracket,
			'CLOSE'            	=> $close_bracket,
			'PAGINATION'		=> topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
			'S_HAS_ATTACHMENTS'		=> (!empty($fetch_news[$i]['attachments'])) ? true : false,
		));
		
		if( !empty($fetch_news[$i]['attachments']) )
		{
			foreach ($fetch_news[$i]['attachments'] as $attachment)
			{
				$template->assign_block_vars('news_row.attachment', array(
					'DISPLAY_ATTACHMENT'	=> $attachment)
				);
			}
		}
		
		if ($portal_config['portal_number_of_news'] <> 0 && $portal_config['portal_news_archive'])
		{
			$template->assign_vars(array(
				'NP_PAGINATION'		=> $pagination,
				'TOTAL_NEWS'		=> ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
				'NP_PAGE_NUMBER'	=> on_page($total_news, $portal_config['portal_number_of_news'], $start))
			);
		}
	}
}

$topic_icons = false;
if( isset($fetch_news['topic_icons']) )
{
	$topic_icons = true;
}

$template->assign_vars(array(
	'NEWEST_POST_IMG'			=> $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
	'READ_POST_IMG'				=> $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
	'GOTO_PAGE_IMG'				=> $user->img('icon_post_target', 'GOTO_PAGE'),
	'S_NEWEST_OR_FIRST'			=> ( $portal_config['portal_news_show_last'] ) ? $user->lang['JUMP_NEWEST'] : $user->lang['JUMP_FIRST'],
	'POSTED_BY_TEXT'			=> ( $portal_config['portal_news_show_last'] ) ? $user->lang['LAST_POST'] : $user->lang['POSTED'],
	'S_DISPLAY_NEWS'			=> true,
	'S_DISPLAY_NEWS_RVS'		=> ( $portal_config['portal_show_news_replies_views'] ) ? true : false,
	'S_TOPIC_ICONS'				=> $topic_icons,
));

?>

portal.php

Code: Alles auswählen

<?php

/**
*
* @package - Board3portal
* @version $Id: portal.php 325 2008-08-17 18:59:40Z kevin74 $
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/


define('IN_PHPBB', true);
define('IN_PORTAL', true);

$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';

$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'portal/includes/functions.'.$phpEx);

$portal_config = obtain_portal_config();

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/lang_portal');
$gallery_root_path = GALLERY_ROOT_PATH;
include($phpbb_root_path . $gallery_root_path . 'includes/functions_recent.' . $phpEx);
$display = array(
	'name'		=> true,
	'poster'	=> true,
	'time'		=> true,
	'views'		=> true,
	'ratings'	=> false,
	'comments'	=> false,
	'album'		=> true,
);
/**
* rows		numeric default 1,
* columns	numeric default 4,
* display	array,
* modes		string(recent|random|comment|!recent|!random|!comment|all), Exp: '!recent' means random + comment
*/
recent_gallery_images(1, 3, $display, 'all');
$load_center = true;

if ( is_dir( $phpbb_root_path . 'install_portal/' ) === TRUE )
{
	if ( is_file( $phpbb_root_path . 'install_portal/install.'.$phpEx ) === TRUE )
	{
		include $phpbb_root_path . 'install_portal/install.'.$phpEx;

		if ( version_compare( $current_version, $portal_config['portal_version'], '<=' ) === TRUE )
		{
			$template->assign_vars(array(
				'S_DISPLAY_GENERAL'	=> true,
				'GEN_TITLE'				=> $user->lang['PORTAL_ERROR'],
				'GEN_MESSAGE'			=> sprintf( $user->lang['PORTAL_DELETE_DIR'], $phpbb_root_path . 'install_portal' )
			));
		}
		else
		{
			$template->assign_vars(array(
				'S_DISPLAY_GENERAL'	=> true,
				'GEN_TITLE'				=> $user->lang['PORTAL_UPDATE'],
				'GEN_MESSAGE'			=> sprintf( $user->lang['PORTAL_UPDATE_TEXT'], $phpbb_root_path . 'install_portal/install.'.$phpEx, $current_version )
			));
		}

		$load_center = false;
	}
}

if ( $load_center === TRUE )
{

	if ($portal_config['portal_forum_index']) 
	{ 
		display_forums('');

		$template->assign_vars(array(
		'FORUM_IMG'				=> $user->img('forum_read', 'NO_NEW_POSTS'),
		'FORUM_NEW_IMG'			=> $user->img('forum_unread', 'NEW_POSTS'),
		'FORUM_LOCKED_IMG'		=> $user->img('forum_read_locked', 'NO_NEW_POSTS_LOCKED'),
		'FORUM_NEW_LOCKED_IMG'	=> $user->img('forum_unread_locked', 'NO_NEW_POSTS_LOCKED'),
		'S_DISPLAY_PORTAL_FORUM_INDEX' => true,

		'U_MARK_FORUMS'		=> ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}index.$phpEx", 'mark=forums') : '',
		'U_MCP'				=> ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=front', true, $user->session_id) : '')
		);
	}

	if ($portal_config['portal_recent']) 
	{ 
		include($phpbb_root_path . 'portal/block/recent.'.$phpEx);
	}
	
	if ($portal_config['portal_wordgraph'])
	{
		include($phpbb_root_path . 'portal/block/wordgraph.'.$phpEx);
	}
	
	if ($portal_config['portal_poll_topic'])
	{
		include($phpbb_root_path . 'portal/block/poll.'.$phpEx);
	}
	
	if ($portal_config['portal_welcome'])
	{
		include($phpbb_root_path . 'portal/block/welcome.'.$phpEx);
	}
	
	if ($portal_config['portal_welcome_guest'])
	{
		$template->assign_vars(array(
			'S_DISPLAY_WELCOME_GUEST' => true,
		));
	}
	
	if ($portal_config['portal_announcements'])
	{
		include($phpbb_root_path . 'portal/block/announcements.'.$phpEx);
		$template->assign_vars(array(
			'S_ANNOUNCE_COMPACT' => ($portal_config['portal_announcements_style']) ? true : false,
		));
	}
	
	if ($portal_config['portal_news'])
	{
		include($phpbb_root_path . 'portal/block/news.'.$phpEx);
		$template->assign_vars(array(
			'S_NEWS_COMPACT' => ($portal_config['portal_news_style']) ? true : false,
		));
	}

	if ($portal_config['portal_custom_center'] or $portal_config['portal_custom_small'])
	{
		include($phpbb_root_path . 'portal/block/custom.'.$phpEx);
	}

	if ($config['load_online'] && $config['load_online_time'] && $portal_config['portal_whois_online'])
	{
		include($phpbb_root_path . 'portal/block/whois_online.'.$phpEx);
	}
}

// show login box and user menu

// only registered user see user menu
if ($user->data['is_registered'])
{
	include($phpbb_root_path . 'portal/block/user_menu.'.$phpEx);
}
else
{
	include($phpbb_root_path . 'portal/block/login_box.'.$phpEx);
}

if ($portal_config['portal_main_menu'])
{
	include($phpbb_root_path . 'portal/block/main_menu.'.$phpEx);
}

if ($portal_config['portal_user_menu'])
{
	$template->assign_vars(array(
		'S_DISPLAY_USERMENU' 	=> true,
	));
}

if ($portal_config['portal_birthdays'])
{
	include($phpbb_root_path . 'portal/block/birthday_list.'.$phpEx);
}

if ($portal_config['portal_search'])
{
	include($phpbb_root_path . 'portal/block/search.'.$phpEx);
}

if ($portal_config['portal_attachments'] && $config['allow_attachments'])
{
	include($phpbb_root_path . 'portal/block/attachments.'.$phpEx);
}

if ($portal_config['portal_advanced_stat'])
{
	include($phpbb_root_path . 'portal/block/statistics.'.$phpEx);
}

if ($portal_config['portal_minicalendar'])
{
	include($phpbb_root_path . 'portal/block/mini_cal.'.$phpEx);
}

if ($portal_config['portal_link_us'])
{
	include($phpbb_root_path . 'portal/block/link_us.'.$phpEx);
}

if ($portal_config['portal_leaders'] && $portal_config['portal_leaders_ext'])
{
	include($phpbb_root_path . 'portal/block/leaders_ext.'.$phpEx);
}
elseif ($portal_config['portal_leaders'])
{
	include($phpbb_root_path . 'portal/block/leaders.'.$phpEx);
}

if ($portal_config['portal_load_last_visited_bots'])
{
	include($phpbb_root_path . 'portal/block/latest_bots.'.$phpEx);
}

if ($portal_config['portal_top_posters'])
{
	include($phpbb_root_path . 'portal/block/top_posters.'.$phpEx);
}

if ($portal_config['portal_latest_members'])
{
	include($phpbb_root_path . 'portal/block/latest_members.'.$phpEx);
}

if ($portal_config['portal_random_member'])
{
	include($phpbb_root_path . 'portal/block/random_member.'.$phpEx);
}

if ($portal_config['portal_friends'])
{
	include($phpbb_root_path . 'portal/block/friends.'.$phpEx);
}

if ($portal_config['portal_change_style'])
{
	include($phpbb_root_path . 'portal/block/change_style.'.$phpEx);
}

if ($portal_config['portal_clock'])
{
	$template->assign_vars(array(
		'S_DISPLAY_CLOCK' => true,
	));
}

if ($portal_config['portal_links'])
{
	include($phpbb_root_path . 'portal/block/links.'.$phpEx);
}


if ($portal_config['portal_pay_s_block'] or ( $portal_config['portal_pay_c_block'] && $load_center === TRUE ) )
{
	include($phpbb_root_path . 'portal/block/donate.'.$phpEx);
}

$template->assign_vars(array(
	'PORTAL_LEFT_COLUMN' 	=> $portal_config['portal_left_column_width'],
	'PORTAL_RIGHT_COLUMN' 	=> $portal_config['portal_right_column_width'],
));

// output page
page_header($user->lang['PORTAL']);

$template->set_filenames(array(
	'body' => '/portal/portal_body.html'
));


make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));

page_footer();

?>


@CPG
Welchen News-Block? Da gibts nur aktuelle Themen oder aktuelle Beiträge. Meinst du da einen von den beiden?

Benutzeravatar
BNa
Valued Contributor
Beiträge: 2641
Registriert: 12.04.2010 23:51
Kontaktdaten:

Re: Portal kann nicht aufgerufen werden - allgemeiner Fehler

Beitrag von BNa »

Hab die Dateien schon im Pastebin gesehen, daher oben schon die mutmassliche Lösung.

Antworten

Zurück zu „[3.0.x] Administration, Benutzung und Betrieb“