Seite 1 von 1

Content defekte

Verfasst: Di 13. Jul 2004, 13:08
von andrej
Hallo,
ich arbeite gerade an einem Update meiner Webseite. Ich wollte z.B. auf der Startseite eine übersicht der 5 aktuellsten Forumbeiträge einblenden lassen. Ich habe auch soweit schon etwas zusammen geschrieben, und das Modul funktioniert so weit auch. Aber leider wird mein Content zerschossen, sobald ich dieses Modul ins Content einfüge. Kann mir vielleicht jemand helfen ?

Ach ja, das Modul wird in den Container 9 eingefügt.

Hier das Modul

Code: Alles auswählen

<table width="100%" border="0" cellspacing="0" cellpadding="0"> 
   <tr> 
      <td class="txtsp1"><center>Letzte Forum Themen...</center></td> 
   </tr> 
   <tr> 
      <td> 
      <?php 
$phpbb_root_path = 'd:/__www/forum/'; 
define ('IN_PHPBB', true); 
if (!file_exists($phpbb_root_path . 'extension.inc')) 
{ 
    die ('<tt><b>phpBB Fetch All:</b> 
          $phpbb_root_path is wrong and does not point to your forum.</tt>'); 
} 
include_once ($phpbb_root_path . 'extension.inc'); 
include_once ($phpbb_root_path . 'common.' . $phpEx); 
include_once ($phpbb_root_path . 'includes/bbcode.' . $phpEx); 
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/common.' . $phpEx); 
include_once ($phpbb_root_path . 'mods/phpbb_fetch_all/posts.' . $phpEx); 
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length); 
init_userprefs($userdata); 
$news = phpbb_fetch_posts(); 
phpbb_disconnect(); 
?> 
<?php 
for ($i = 0; $i < 5; $i++) { //Anzahl der ausgegebener Themen 
?> 
      </td> 
   </tr>    
     <tr> 
       <td class="grbfor"><a href="<?php echo append_sid('http://localhost/forum/viewtopic.php?t=' . $news[$i]['topic_id']); ?>"><?php echo $news[$i]['topic_title']; ?></a> 
      </td> 
     </tr> 
   <tr> 
      <td> 
<?php 
} 
?> 
      </td>    
   </tr> 
</table> 
<table width="100%" border="0" cellspacing="0" cellpadding="0"> 
  <tr> 
     <td class="grbfor" style="BORDER-BOTTOM: #C9C9C9 1px solid " height="1"><center>GERMAN ANGEL COMMUNITY</center></td> 
  </tr> 
</table>
Und mein Content

Code: Alles auswählen

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
	</head>

	<body bgcolor="#ffffff" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
			<tr>
				<td width="22"></td>
				<td width="21" background="images/layout/rL.gif"></td>
				<td class="tabR" width="1"></td>
				<td>
					<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
						<tr>
							<td>
								<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
									<tr>
										<td colspan="3"><img src="images/layout/gao6.jpg" alt="GERMAN&nbsp;ANGEL&nbsp;OWNERS" border="0"></td>
									</tr>
									<tr height="1">
										<td class="tabR" width="180" height="1"></td>
										<td class="tabR" width="1" height="1"></td>
										<td class="tabR" height="1"></td>
									</tr>
									<tr height="23">
										<td width="180" height="23"></td>
										<td class="tabR" width="1" height="23"></td>
										<td class="N1" height="23">
											<div align="right">CMS_CONTAINER[1]</div>
										</td>
									</tr>
									<tr height="1">
										<td class="tabR" width="180" height="1"></td>
										<td class="tabR" width="1" height="1"></td>
										<td class="tabR" height="1"></td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td>
								<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
									<tr>
										<td class="N2" valign="top" width="180">
											<div align="center">
												<table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td class="N2">CMS_CONTAINER[2]</td>
													</tr>
													<tr>
														<td class="N2">CMS_CONTAINER[3]</td>
													</tr>
													<tr>
														<td class="N2">CMS_CONTAINER[4]</td>
													</tr>
												</table>
												<br>
												<img src="images/layout/lgfl2.jpg" alt="GERMAN&nbsp;ANGEL&nbsp;OWNERS" height="130" width="89" border="0"></div>
										</td>
										<td class="tabR" width="1"></td>
										<td valign="top">
											<table width="100%" border="0" cellspacing="0" cellpadding="0">
												<tr>
													<td class="pfad">CMS_CONTAINER[12]</td>
												</tr>
											</table>
											<br>
											<br>
											<div align="center">
												<table width="96%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td class="txthead" colspan="2">CMS_CONTAINER[13]</td>
													</tr>
													<tr height="15">
														<td width="13" height="15"></td>
														<td height="15"></td>
													</tr>
													<tr>
														<td width="13"></td>
														<td class="txtsubhead">CMS_CONTAINER[14]</td>
													</tr>
													<tr height="25">
														<td width="13" height="25"></td>
														<td height="25"></td>
													</tr>
													<tr>
														<td class="txttext" colspan="2">CMS_CONTAINER[15]</td>
													</tr>
													<tr height="13">
														<td width="13" height="13"></td>
														<td height="13"></td>
													</tr>
													<tr>
														<td colspan="2">
															<table width="100%" border="0" cellspacing="0" cellpadding="0">
																<tr>
																	<td class="txtmake" width="180">CMS_CONTAINER[16]</td>
																	<td></td>
																	<td valign="top" class="txtlink" width="50">
																		<div align="right">
																			CMS_CONTAINER[17]</div>
																	</td>
																	<td valign="top" class="txtlink" width="50">
																		<div align="right">
																			CMS_CONTAINER[10]</div>
																	</td>
																</tr>
															</table>
														</td>
													</tr>
												</table>
												<br>
											</div>
										</td>
										<td class="tabR" width="1"></td>
										<td class="N2" valign="top" width="180">
											<table width="100%" border="0" cellspacing="0" cellpadding="0">
												<tr>
													<td class="N2">CMS_CONTAINER[6]</td>
												</tr>
												<tr>
													<td class="N2">CMS_CONTAINER[7]</td>
												</tr>
												<tr>
													<td class="N2">CMS_CONTAINER[8]</td>
												</tr>
												<tr>
													<td class="N2">CMS_CONTAINER[9]</td>
												</tr>
											</table>
										</td>
									</tr>
									<tr height="1">
										<td class="tabR" width="180" height="1"></td>
										<td class="tabR" width="1" height="1"></td>
										<td class="tabR" height="1"></td>
										<td class="tabR" width="1" height="1"></td>
										<td class="tabR" width="180" height="1">
											
										</td>
									</tr>
									<tr height="23">
										<td class="N2" width="180" height="23">
											<div align="center">CMS_CONTAINER[5]</div>
										</td>
										<td class="tabR" width="1" height="23"></td>
										<td class="txttext" height="23">
											<table width="100%" border="0" cellspacing="0" cellpadding="0">
												<tr>
													<td width="150">CMS_CONTAINER[18]</td>
													<td></td>
													<td width="30">CMS_CONTAINER[19]</td>
												</tr>
											</table>
										</td>
										<td class="tabR" width="1" height="23"></td>
										<td class="txtmake" width="180" height="23">
											<div align="center">CMS_CONTAINER[11]</div>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
				<td class="tabR" width="1"></td>
				<td width="20" background="images/layout/rR.gif"></td>
				<td width="22"></td>
			</tr>
		</table>
	</body>
</html>

Verfasst: Di 13. Jul 2004, 13:18
von emergence
ich würd mir eher den code ansehen den der phpBB teil einfügt...
das layout an sich ohne den eingebundenen code nutzt da nur zu einem gewissen grad und der sieht im dreamweaver korrekt aus...

Verfasst: Di 13. Jul 2004, 13:38
von andrej
Ok dann poste ich mal die Includeten Dateien:

Die wichtigsten Dateien sind wohl die common.php und die posts.php. Dort sind alle funktionen enthalten die zum anzeigen der Links notwendig sind.

Dank Dir auf jeden Fall im vorraus.

extension.inc

Code: Alles auswählen

<?php
if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
}
$phpEx = "php";
$starttime = 0;
?>
common.$phpEx

Code: Alles auswählen

<?php

$CFG['smilie_url'] = $phpbb_root_path . 'images/smiles';

//
// URL to your avatar directory without trailing slash.
//
// NOTE: THIS IS DEPRECATED SINCE VERSION 2.0.4 AND REMAINS HERE FOR
//       BACKWARD COMPATIBILITY ONLY. YOU DO NOT NEED THIS OPTION ANY
//       MORE SINCE IT WILL BE AUTOMATICALLY HANDLED BY
//       phpbb_avatar_image()
//

$CFG['avatar_url'] = $phpbb_root_path . 'images/avatars';

//
// URL to your avatar gallery directory without trailing slash.
//
// NOTE: THIS IS DEPRECATED SINCE VERSION 2.0.4 AND REMAINS HERE FOR
//       BACKWARD COMPATIBILITY ONLY. YOU DO NOT NEED THIS OPTION ANY
//       MORE SINCE IT WILL BE AUTOMATICALLY HANDLED BY
//       phpbb_avatar_image()
//

$CFG['avatar_gallery_url'] = $phpbb_root_path . 'images/avatars/gallery';

//
// When set to true the script will check postings and other
// things against the permissions of the user who views the
// script. If no permission for the particular action exists the
// script will not fetch and display the data.
//
// true  = enabled (default)
// false = disabled
//
// IMPORTANT: Using auth check will require these two lines in
//            your script to work properly:
//
// $userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
// init_userprefs($userdata);
//

$CFG['auth_check'] = true;
$CFG['time_zone'] = 0 * 3600;
$CFG['date_format'] = 'd.m.';
$CFG['time_format'] = 'H:i';
$CFG['on_error'] = 'die';
$CFG['redirect'] = '';
$CFG['debug'] = true;
$CFG['version'] = '2.0.10';
$CFG['auth_list'] = array();
$CFG['auth_called'] = false;

if (!defined('IN_PHPBB'))
{
	die ('hacking attempt');
}

###############################################################################
##                                                                           ##
## phpbb_raise_error()                                                       ##
## ------------------------------------------------------------------------- ##
## Produces an error message or redirects the browser to a given URL. You    ##
## can use this function for your entire site to ensure that all scripts     ##
## exits nicely on an error. The redirect option will forward the browser to ##
## another page which is very useful if (for example) the database is down   ##
## and you want to show a 'site offline' page automatically.                 ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     message                                                               ##
##                                                                           ##
##         The error message.                                                ##
##                                                                           ##
##     file                                                                  ##
##                                                                           ##
##         File name; use __FILE__ if you call this function from your own   ##
##         scripts.                                                          ##
##                                                                           ##
##     line                                                                  ##
##                                                                           ##
##         Line number; use __LINE__ if you call this function from your own ##
##         scripts.                                                          ##
##                                                                           ##
##     sql                                                                   ##
##                                                                           ##
##         SQL query string which will be print if $CFG['debug'] is set to   ##
##         true                                                              ##
##                                                                           ##
###############################################################################

function phpbb_raise_error($message = null, $file = null, $line = null,
	$sql = null)
{
	global $CFG;

	if ($CFG['debug'] and $sql)
	{
		$message .= '<br />&nbsp;<br />SQL: ' . $sql . '<br />&nbsp;<br />';
	}

	switch ($CFG['on_error'])
	{
		//
		// page redirect
		//

		case 'redirect':
			if ($CFG['redirect'])
			{
				header ('Location: ' . $CFG['redirect']);
			}
			else
			{
				$CFG['on_error'] = 'die';
				phpbb_raise_error($message, $file, $line, $sql);
			}
			break;

		//
		// phpBB's message_die()
		//

		case 'phpbb':
			message_die(GENERAL_MESSAGE,
				'<b>phpbb Fetch All error:</b> ' . $message, '',
				 __FILE__, __LINE__);
			break;

		//
		// PHP's die()
		//

		default:
			die('<tt><b>phpbb Fetch All error:</b> ' . $message . ' at '
				. $file . ':' . $line . '</tt>');
	}

	exit;
} // end func phpbb_raise_error

###############################################################################
##                                                                           ##
## phpbb_fetch_row()                                                         ##
## ------------------------------------------------------------------------- ##
## Performs a SQL database query and returns the result in a single array    ##
## like this                                                                 ##
##                                                                           ##
##     $result['field1']                                                     ##
##     $result['field2']                                                     ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     sql                                                                   ##
##                                                                           ##
##         the SQL statement                                                 ##
##                                                                           ##
###############################################################################

function phpbb_fetch_row($sql = null)
{
	global $db;

	if (!$sql)
	{
		return;
	}

	$query = phpbb_query($sql);

	$result = $db->sql_fetchrow($query);

	return $result;
} // end func phpbb_fetch_row

###############################################################################
##                                                                           ##
## phpbb_fetch_rows()                                                        ##
## ------------------------------------------------------------------------- ##
## Performs a SQL database query and returns the result in a multi-          ##
## dimensional array like this                                               ##
##                                                                           ##
##     $result[0]['field1']                                                  ##
##     $result[0]['field2']                                                  ##
##     $result[1]['field1']                                                  ##
##     $result[1]['field2']                                                  ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     sql                                                                   ##
##                                                                           ##
##         the SQL statement                                                 ##
##                                                                           ##
###############################################################################

function phpbb_fetch_rows($sql = null)
{
	global $db;

	if (!$sql)
	{
		return;
	}

	$query = phpbb_query($sql);

	$result = array();

	while ($row = $db->sql_fetchrow($query))
	{
		$result[] = $row;
	}

	return $result;
} // end func phpbb_fetch_rows

###############################################################################
##                                                                           ##
## phpbb_query()                                                             ##
## ------------------------------------------------------------------------- ##
## Executes a query through the phpBB DB API and returns the result. On an   ##
## error phpbb_raise_error() will be called so you can make your own error   ##
## handler with this.                                                        ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     sql                                                                   ##
##                                                                           ##
##         the SQL query statement                                           ##
##                                                                           ##
###############################################################################

function phpbb_query($sql = null)
{
	global $db;

	if (!$query = $db->sql_query($sql))
	{
		phpbb_raise_error('database query failed', __FILE__, __LINE__, $sql);
	}

	return $query;
} // end func phpbb_query

###############################################################################
##                                                                           ##
## phpbb_numrows()                                                           ##
## ------------------------------------------------------------------------- ##
## Returns the number of rows in the result of a query.                      ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     query                                                                 ##
##                                                                           ##
##         the DB handle to the query                                        ##
##                                                                           ##
###############################################################################

function phpbb_numrows($query = null)
{
	global $db;

	return $db->sql_numrows($query);
} // end func phpbb_numrows

###############################################################################
##                                                                           ##
## phpbb_disconnect()                                                        ##
## ------------------------------------------------------------------------- ##
## Disconnects from the database using the phpBB DB API.                     ##
##                                                                           ##
###############################################################################

function phpbb_disconnect()
{
	global $db;

	$db->sql_close();
} // end func phpbb_disconnect

###############################################################################
##                                                                           ##
## phpbb_parse_text()                                                        ##
## ------------------------------------------------------------------------- ##
## Parses text according to phpBB (BBCode, smilies, etc).                    ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     text                                                                  ##
##                                                                           ##
##         the text to be parsed                                             ##
##                                                                           ##
##     bbcode_uid                                                            ##
##                                                                           ##
##         bbcode identifier                                                 ##
##                                                                           ##
##     enable_smilies                                                        ##
##                                                                           ##
##         If true all smilies will be parsed with their icon                ##
##         otherwise you will only see the smilie code.                      ##
##                                                                           ##
##     hide_images                                                           ##
##                                                                           ##
##         If false all images will be left untouched otherwise all          ##
##         images will be replaced with the text in the next                 ##
##         parameter.                                                        ##
##                                                                           ##
##     replace_images                                                        ##
##                                                                           ##
##         text to replace images with                                       ##
##                                                                           ##
###############################################################################

function phpbb_parse_text($text = null,
	$bbcode_uid = null,
	$enable_smilies = true,
	$hide_images = false,
	$replace_images = '')
{
	global $CFG;

	if (!$text)
	{
		return;
	}

	//
	// remove slashes
	//

	stripslashes($text);

	//
	// remove images if requested
	//

	if ($hide_images)
	{
		if ($replace_images)
		{
			$replacement = '[url=\\1]' . $replace_images . '[/url]';
		}
		else
		{
			$replacement = '';
		}
		$text =
			preg_replace("#\[img:$bbcode_uid\](.*?)\[/img:$bbcode_uid\]#si",
				$replacement, $text);
	}

	//
	// parse bbcode
	//

	$text = bbencode_second_pass($text, $bbcode_uid);

	//
	// parse smilies if requested
	//

	if ($enable_smilies == 1)
	{
		$text = smilies_pass($text);

		//
		// need to overwrite the smilie path since we might not be within
		// the phpBB directory
		//

		$text = preg_replace("/images\/smiles/", $CFG['smilie_url'], $text);
	}

	//
	// parse url's
	//

	$text = make_clickable($text);

	//
	// change newlines to HTML
	//

	$text = str_replace("\n", "\n<br />\n", $text);

	return $text;
} // end func phpbb_parse_text

###############################################################################
##                                                                           ##
## phpbb_trim_text()                                                         ##
## ------------------------------------------------------------------------- ##
## This function can trim a text by number of characters or the first        ##
## appearence of a character combination.                                    ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     text                                                                  ##
##                                                                           ##
##         contains the text which should be trimmed                         ##
##                                                                           ##
##     is_trimmed                                                            ##
##                                                                           ##
##         will be false if no trimming has been done and true if the text   ##
##         has been trimmed                                                  ##
##                                                                           ##
##     character                                                             ##
##                                                                           ##
##         a character combination ('<br />')                                ##
##                                                                           ##
##     number                                                                ##
##                                                                           ##
##         a number of characters ('150')                                    ##
##                                                                           ##
##     words                                                                 ##
##                                                                           ##
##         a number of words ('5')                                           ##
##                                                                           ##
###############################################################################

function phpbb_trim_text(&$text,
	&$is_trimmed,
	$character = null,
	$number = 0,
	$words = 0)
{
	//
	// trim by character combination
	//

	if ($character != '' and eregi($character, $text))
	{
		$trimmed    = explode($character, $text);
		$text       = $trimmed[0];
		$is_trimmed = true;
	}

	//
	// trim by number
	//

	if ($number != 0 and strlen($text) > $number)
	{
		$text       = substr($text, 0, $number);
		$is_trimmed = true;
	}

	//
	// trim by words
	//

	if ($words != 0)
	{
		$exploded = explode(' ', $text);
		if (count($exploded) > $words)
		{
			$text = '';
			for ($i = 0; $i < $words; $i++)
			{
				$text .= $exploded[$i] . ' ';
			}
			$text = substr($text, 0, -1);
			$is_trimmed = true;
		}
	}

	return true;
} // end func phpbb_trim_text

###############################################################################
##                                                                           ##
## phpbb_span_pages()                                                        ##
## ------------------------------------------------------------------------- ##
## Calculates the span pages. Returns a string with all available pages like ##
##                                                                           ##
##     Goto page 1,2,3 Next                                                  ##
##                                                                           ##
## The 'goto page' is being set by your local language setup. The string is  ##
## being formatted and contains a link on the calling script (PHP_SELF).     ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     numrows                                                               ##
##                                                                           ##
##        number of rows of the result query                                 ##
##                                                                           ##
##     limit                                                                 ##
##                                                                           ##
##        number of entries to show on one page                              ##
##                                                                           ##
##     offset                                                                ##
##                                                                           ##
##        number of entry from which the output starts                       ##
##                                                                           ##
##     add_prevnext_text                                                     ##
##                                                                           ##
##        true  = adds the previous/next text                                ##
##        false = do not add it                                              ##
##                                                                           ##
###############################################################################

function phpbb_span_pages($numrows = 0,
	$limit = 0,
	$offset = 0,
	$add_prevnext_text = true)
{
	global $PHP_SELF;

	//
	// avoid a division by zero error from phpBB
	//

	if ($limit == 0)
	{
		$limit = 100;
	}

	//
	// do a little string replace to fix the original output of the phpBB
	// pagination function (replace '&' with '?')
	//

	$result = eregi_replace('&start',
	'start',
	generate_pagination($PHP_SELF . '?',
		$numrows,
		$limit,
		$offset,
		$add_prevnext_text));

	return $result;
} // end func phpbb_span_pages

###############################################################################
##                                                                           ##
## phpbb_get_auth_list()                                                     ##
## ------------------------------------------------------------------------- ##
## This function will fetch the list of forums which the user is able to     ##
## 'view'. The list will be saved within $CFG['auth_list'] so it is global   ##
## available for every function. This function will run only once to reduce  ##
## SQL queries.                                                              ##
##                                                                           ##
###############################################################################

function phpbb_get_auth_list()
{
	global $CFG, $userdata;

	if (!$CFG['auth_called'] and $CFG['auth_check'])
	{
		$is_auth = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata);

		while (list($k, $v) = each($is_auth))
		{
			if ($v['auth_view'])
			{
				$CFG['auth_list'][] = $k;
			}
		}

		$CFG['auth_called'] = true;
	}

	return true;
} // end func phpbb_get_auth_list

###############################################################################
##                                                                           ##
## phpbb_get_forum_list()                                                    ##
## ------------------------------------------------------------------------- ##
## This function will create a list of forums based on the forums passed as  ##
## a parameter and the forums which are in $CFG['auth_list']. Basically it   ##
## will filter the forums passed by against the allowed forums (if auth      ##
## check is enabled).                                                        ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     forum_id                                                              ##
##                                                                           ##
##         A single forums id or an array of multiple id's.                  ##
##                                                                           ##
###############################################################################

function phpbb_get_forum_list($forum_id = null)
{
	global $CFG;

	$result = '';

	if (!$forum_id and $CFG['auth_check'])
	{
		reset($CFG['auth_list']);

		while (list($k, $v) = each($CFG['auth_list']))
		{
			$result .= $v . ',';
		}

		if ($result)
		{
			$result = substr($result, 0, strlen($result) -1);
		}
	}

	if ($forum_id)
	{
		if (!is_array($forum_id))
		{
			if ($CFG['auth_check'])
			{
				if (in_array($forum_id, $CFG['auth_list']))
				{
					$result = $forum_id;
				}
			}
			else
			{
				$result = $forum_id;
			}
		}
		else
		{
			for ($i = 0; $i < count($forum_id); $i++)
			{
				if ($CFG['auth_check'])
				{
					if (in_array($forum_id[$i], $CFG['auth_list']))
					{
						$result .= $forum_id[$i] . ',';
					}
				}
				else
				{
					$result .= $forum_id[$i] . ',';
				}
			}
			if ($result)
			{
				$result = substr($result, 0, strlen($result) -1);
			}
		}
	}

	return $result;
} // end func phpbb_get_forum_list

###############################################################################
##                                                                           ##
## phpbb_avatar_image()                                                      ##
## ------------------------------------------------------------------------- ##
## This function will return a valid image URL for the user avatar.          ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     avatar_type                                                           ##
##                                                                           ##
##         Type of the avatar: uploaded, remote or gallery.                  ##
##                                                                           ##
##     avatar                                                                ##
##                                                                           ##
##         user avatar                                                       ##
##                                                                           ##
## EXAMPLE                                                                   ##
##                                                                           ##
##     echo phpbb_avatar_image($userdata['user_avatar_type'],                ##
##         $userdata['user_avatar']);                                        ##
##                                                                           ##
###############################################################################

function phpbb_avatar_image($avatar_type = null, $avatar = null)
{
	global $board_config, $phpbb_root_path;

	$image = '';

	switch($avatar_type)
	{
		case USER_AVATAR_UPLOAD:
			$image = ($board_config['allow_avatar_upload'])
				? '<img src="' . $phpbb_root_path
					. $board_config['avatar_path'] . '/' . $avatar
					. '" alt="" border="0" />'
				: '';
			break;
		case USER_AVATAR_REMOTE:
			$image = ($board_config['allow_avatar_remote'])
				? '<img src="' . $avatar . '" alt="" border="0" />' : '';
			break;
		case USER_AVATAR_GALLERY:
			$image = ($board_config['allow_avatar_local'])
				? '<img src="' . $phpbb_root_path .
					$board_config['avatar_gallery_path'] . '/' . $avatar
					. '" alt="" border="0" />'
				: '';
			break;
	}

	return $image;
} // end func phpbb_avatar_image

###############################################################################
##                                                                           ##
## phpbb_fetch_style()                                                       ##
## ------------------------------------------------------------------------- ##
## Fetches the template name from the user's settings. If board is set to    ##
## only one style, it will use the default.                                  ##
##                                                                           ##
## This function returns the template name e.g. 'subSilver'.                 ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     user_id                                                               ##
##                                                                           ##
##         the user's ID                                                     ##
##                                                                           ##
## EXAMPLE                                                                   ##
##                                                                           ##
##     $forum_style = phpbb_fetch_style($userdata['user_id']);               ##
##     echo 'The path to my templates is' . $phpbb_root_path;                ##
##     echo 'templates/' . $forum_style;                                     ##
##                                                                           ##
## AUTHOR                                                                    ##
##                                                                           ##
##     RyanThaDude29 <ryan@ryansmadhouse.com>                                ##
##     http://www.ryansmadhouse.com/                                         ##
##                                                                           ##
###############################################################################

function phpbb_fetch_style($user_id = null)
{
	global $userdata, $board_config, $phpbb_root_path;

	if ($board_config['override_user_style'])
	{
		$style = $board_config['default_style'];
	}
	else
	{
		if ($userdata['session_logged_in'])
		{
			$style = $userdata['user_style'];
		}
		else
		{
			$style = $board_config['default_style'];
		}
	}

	$sql = 'SELECT *
				FROM ' . THEMES_TABLE . '
				WHERE themes_id = ' . $style;
	$row = phpbb_fetch_row($sql);

	return $row['template_name'];
} // end func phpbb_fetch_style

?>
posts.$phpEx

Code: Alles auswählen

<?php
$CFG['posts_limit'] = 5;
$CFG['posts_order'] = 'p.post_time DESC';
$CFG['posts_hide_normal'] = false;
$CFG['posts_hide_sticky'] = false;
$CFG['posts_hide_announcements'] = false;
$CFG['posts_hide_locked'] = false;
$CFG['posts_hide_moved'] = false;
$CFG['posts_hide_polls'] = false;
$CFG['posts_hide_ranks'] = true;
$CFG['posts_hide_images'] = false;
$CFG['posts_replace_images'] = '[image]';
$CFG['posts_trim_text_character'] = '';
$CFG['posts_trim_text_number'] = 0;
$CFG['posts_trim_text_words'] = 0;
$CFG['posts_trim_title_number'] = 0;
$CFG['posts_date_offset_start'] = '';
$CFG['posts_date_offset_end'] = time();
$CFG['posts_search_string'] = '';
$CFG['posts_span_pages'] = false;

###############################################################################
## NO CHANGES NEEDED BELOW
###############################################################################

if (!defined('IN_PHPBB'))
{
	die('hacking attempt');
}

define('POSTS_FETCH_FIRST', 0);
define('POSTS_FETCH_LAST', 1);

$CFG['posts_span_pages_offset']  = 0;
$CFG['posts_span_pages_numrows'] = 0;
$CFG['posts_offset']             = 0;

###############################################################################
##                                                                           ##
## phpbb_fetch_posts()                                                       ##
## ------------------------------------------------------------------------- ##
## This function will fetch the first or the last posting from one or more   ##
## topics.                                                                   ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     forum_id                                                              ##
##                                                                           ##
##         Can be left blank to fetch from all forums or set to a single     ##
##         forums id to fetch that specific forum. To fetch from multiple    ##
##         forums you can parse an array to it.                              ##
##                                                                           ##
##     fetch_mode                                                            ##
##                                                                           ##
##         Set it to POSTS_FETCH_FIRST to fetch the first postings of a      ##
##         topic (i.e. the posts which started the topic) or set it to       ##
##         POSTS_FETCH_LAST to fetch the last postings of a topic.           ##
##                                                                           ##
## EXAMPLE                                                                   ##
##                                                                           ##
##     $news = phpbb_fetch_posts();                                          ##
##                                                                           ##
##     for ($i = 0; $i < count($news); $i++)                                 ##
##     {                                                                     ##
##         echo $news[$i]['topic_title'] . '<br>';                           ##
##     }                                                                     ##
##                                                                           ##
###############################################################################

function phpbb_fetch_posts($forum_id = null, $fetch_mode = POSTS_FETCH_FIRST)
{
	global $CFG, $userdata;

	//
	// sanity check for dates
	//

	if ($CFG['posts_date_offset_start'] >= $CFG['posts_date_offset_end'])
	{
		phpbb_raise_error('\'posts_date_offset_start\' has to be smaller '
			. 'than \'posts_date_offset_end\'');
	}

	//
	// create a list of forums with read permission
	// (only takes action when auth_check is enabled)
	//

	phpbb_get_auth_list();

	//
	// determine the forum list based on the user input
	// and/or permissions (depends on auth check)
	//

	$forum_list = phpbb_get_forum_list($forum_id);

	//
	// if read permissions do not allow us to fetch anything
	// we return nicely
	//

	if (!$forum_list and $CFG['auth_check'])
	{
		return;
	}

	$sql = 'SELECT f.*, p.*, pt.*, t.*, u.*';

	if (!$CFG['posts_hide_ranks'])
	{
		$sql .= ', r.*';
	}

	$sql .= '
				FROM ' . TOPICS_TABLE     . ' AS t,
					 ' . USERS_TABLE      . ' AS u,
					 ' . POSTS_TEXT_TABLE . ' AS pt,
					 ' . POSTS_TABLE      . ' AS p,
					 ' . FORUMS_TABLE     . ' AS f';

	if (!$CFG['posts_hide_ranks'])
	{
		$sql .= ', ' . RANKS_TABLE . ' AS r';
	}

	$sql .= '
				WHERE';

	if ($forum_list)
	{
		$sql .= ' t.forum_id IN (' . $forum_list . ') AND';
	}

	if ($fetch_mode == POSTS_FETCH_FIRST)
	{
		$sql .= ' t.topic_first_post_id = pt.post_id
					AND t.topic_first_post_id = p.post_id AND';
	}
	else
	{
		$sql .= ' t.topic_last_post_id = pt.post_id
					AND t.topic_last_post_id = p.post_id AND';
	}

	if ($CFG['posts_date_offset_start'])
	{
		$sql .= ' p.post_time >= ' . $CFG['posts_date_offset_start'] . ' AND';
	}

	if ($CFG['posts_date_offset_end'])
	{
		$sql .= ' p.post_time <= ' . $CFG['posts_date_offset_end'] . ' AND';
	}

	if ($CFG['posts_hide_normal'])
	{
		$sql .= ' t.topic_type <> 0 AND';
	}

	if ($CFG['posts_hide_sticky'])
	{
		$sql .= ' t.topic_type <> 1 AND';
	}

	if ($CFG['posts_hide_announcement'])
	{
		$sql .= ' t.topic_type <> 2 AND';
	}

	if ($CFG['posts_hide_locked'])
	{
		$sql .= ' t.topic_status <> 1 AND';
	}

	if ($CFG['posts_hide_moved'])
	{
		$sql .= ' t.topic_status <> 2 AND';
	}

	if ($CFG['posts_hide_polls'])
	{
		$sql .= ' t.topic_vote <> 1 AND';
	}

	if ($CFG['posts_search_string'])
	{
		$sql .= ' (' . $CFG['posts_search_string'] . ') AND';
	}

	$sql .= ' t.forum_id = f.forum_id AND';

	if (!$CFG['posts_hide_ranks'])
	{
		$sql .= ' r.rank_id = u.user_rank AND';
	}

	$sql .= ' u.user_id = p.poster_id';

	$sql .= ' ORDER BY ' . $CFG['posts_order'];

	if ($CFG['posts_span_pages'])
	{
		$CFG['posts_span_pages_numrows'] = phpbb_numrows(phpbb_query($sql));
		if ($CFG['posts_span_pages_offset'] > $CFG['posts_span_pages_numrows'])
		{
			$CFG['posts_span_pages_offset'] =
				 $CFG['posts_span_pages_numrows'] - 1;
		}
		$CFG['posts_offset'] = $CFG['posts_span_pages_offset'];
	}
	else
	{
		$CFG['posts_offset'] = 0;
	}

	if ($CFG['posts_limit'] != 0)
	{
		$sql .= ' LIMIT ' . $CFG['posts_offset'] . ',' . $CFG['posts_limit'];
	}

	$result = phpbb_fetch_rows($sql);

	if ($result)
	{
		$orig_word        = array();
		$replacement_word = array();
		obtain_word_list($orig_word, $replacement_word);

		for ($i = 0; $i < count($result); $i++)
		{
			$result[$i]['post_time']  =
				$result[$i]['post_time']  + $CFG['time_zone'];
			$result[$i]['topic_time'] =
				$result[$i]['topic_time'] + $CFG['time_zone'];

			$result[$i]['date']       =
				date($CFG['date_format'], $result[$i]['post_time']);
			$result[$i]['time']       =
				date($CFG['time_format'], $result[$i]['post_time']);

			$result[$i]['edit_date']  =
				date($CFG['date_format'], $result[$i]['post_edit_time']);
			$result[$i]['edit_time']  =
				date($CFG['time_format'], $result[$i]['post_edit_time']);

			$result[$i]['post_text']  = phpbb_parse_text(
				$result[$i]['post_text'],
				$result[$i]['bbcode_uid'],
				$result[$i]['enable_smilies'],
				$CFG['posts_hide_images'],
				$CFG['posts_replace_images']);

			if (count($orig_word))
			{
				$result[$i]['topic_title'] = preg_replace($orig_word,
					$replacement_word,
					$result[$i]['topic_title']);
				$result[$i]['post_text']   = preg_replace($orig_word,
					$replacement_word,
					$result[$i]['post_text']);
			}

			$result[$i]['trimmed'] = false;
			phpbb_trim_text($result[$i]['post_text'],
				$result[$i]['trimmed'],
				$CFG['posts_trim_text_character'],
				$CFG['posts_trim_text_number'],
				$CFG['posts_trim_text_words']);

			$result[$i]['topic_trimmed'] = false;
			phpbb_trim_text($result[$i]['topic_title'],
				$result[$i]['topic_trimmed'],
				'',
				$CFG['posts_trim_topic_number'],
				'');
		}
	}

	return $result;
} // end func phpbb_fetch_posts

###############################################################################
##                                                                           ##
## phpbb_fetch_topics()                                                      ##
## ------------------------------------------------------------------------- ##
## This function will fetch the first or the last posting from one or more   ##
## topics specified by topic id. The only difference to phpbb_fetch_posts()  ##
## is that this function will fetch by topic id instead of forum id.         ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     topic_id                                                              ##
##                                                                           ##
##         Can be left blank to fetch from all topicsor set to a single      ##
##         topic id to fetch that specific topic To fetch from multiple      ##
##         topics you can parse an array to it.                              ##
##                                                                           ##
##     fetch_mode                                                            ##
##                                                                           ##
##         Set it to POSTS_FETCH_FIRST to fetch the first postings of a      ##
##         topic (i.e. the posts which started the topic) or set it to       ##
##         POSTS_FETCH_LAST to fetch the last postings of a topic.           ##
##                                                                           ##
## EXAMPLE                                                                   ##
##                                                                           ##
##     $news = phpbb_fetch_topics();                                         ##
##                                                                           ##
##     for ($i = 0; $i < count($news); $i++)                                 ##
##     {                                                                     ##
##         echo $news[$i]['topic_title'] . '<br>';                           ##
##     }                                                                     ##
##                                                                           ##
###############################################################################

function phpbb_fetch_topics($topic_id = null, $fetch_mode = FETCH_MODE_FIRST)
{
	global $CFG, $userdata;

	$topic_list = '';

	if (!is_array($topic_id))
	{
		$topic_list = $topic_id;
	}
	else
	{
		for ($i = 0; $i < count($topic_id); $i++)
		{
			$topic_list .= $topic_id[$i] . ',';
		}

		if ($topic_list)
		{
			$topic_list = substr($topic_list, 0, strlen($topic_list) -1);
		}
	}

	$sql = 'SELECT f.*, p.*, pt.*, t.*, u.*';

	if (!$CFG['posts_hide_ranks'])
	{
		$sql .= ', r.*';
	}

	$sql .= '
				FROM ' . TOPICS_TABLE     . ' AS t,
					 ' . USERS_TABLE      . ' AS u,
					 ' . POSTS_TEXT_TABLE . ' AS pt,
					 ' . POSTS_TABLE      . ' AS p,
					 ' . FORUMS_TABLE     . ' AS f';

	if (!$CFG['posts_hide_ranks'])
	{
		$sql .= ', ' . RANKS_TABLE      . ' AS r';
	}

	$sql .= '
				WHERE u.user_id = p.poster_id AND';

	if ($topic_list)
	{
		$sql .= ' t.topic_id IN (' . $topic_list . ') AND';
	}

	if ($fetch_mode == FETCH_MODE_FIRST)
	{
		$sql .= ' t.topic_first_post_id = pt.post_id
					AND t.topic_first_post_id = p.post_id AND';
	}
	else
	{
		$sql .= ' t.topic_last_post_id = pt.post_id
					AND t.topic_last_post_id = p.post_id AND';
	}

	$sql .= ' t.forum_id = f.forum_id';

	if (!$CFG['posts_hide_ranks'])
	{
		$sql .= '
					AND r.rank_id = u.user_rank';
	}

	$result = phpbb_fetch_rows($sql);

	if ($result)
	{
		if ($CFG['auth_check'])
		{
			phpbb_get_auth_list();

			$authed = array();

			for ($i = 0; $i < count($result); $i++)
			{
				if (in_array($result[$i]['forum_id'], $CFG['auth_list']))
				{
					$authed[] = $result[$i];
				}
			}

			$result = $authed;
		}

		$orig_word = array();
		$replacement_word = array();
		obtain_word_list($orig_word, $replacement_word);

		for ($i = 0; $i < count($result); $i++)
		{
			$result[$i]['post_time']      =
				$result[$i]['post_time']      + $CFG['time_zone'];
			$result[$i]['topic_time']     =
				$result[$i]['topic_time']     + $CFG['time_zone'];
			$result[$i]['post_edit_time'] =
				$result[$i]['post_edit_time'] + $CFG['time_zone'];

			$result[$i]['date'] =
				date($CFG['date_format'], $result[$i]['post_time']);
			$result[$i]['time'] =
				date($CFG['time_format'], $result[$i]['post_time']);

			$result[$i]['edit_date'] =
				date($CFG['date_format'], $result[$i]['post_edit_time']);
			$result[$i]['edit_time'] =
				date($CFG['time_format'], $result[$i]['post_edit_time']);

			$result[$i]['post_text'] = phpbb_parse_text(
				$result[$i]['post_text'],
				$result[$i]['bbcode_uid'],
				$result[$i]['enable_smilies'],
				$CFG['posts_hide_images'],
				$CFG['posts_replace_images']);

			if (count($orig_word))
			{
				$result[$i]['topic_title'] = preg_replace($orig_word,
					$replacement_word,
					$result[$i]['topic_title']);
				$result[$i]['post_text'] = preg_replace($orig_word,
					$replacement_word,
					$result[$i]['post_text']);
			}

			$result[$i]['trimmed'] = false;
			phpbb_trim_text($result[$i]['post_text'],
				$result[$i]['trimmed'],
				$CFG['posts_trim_text_character'],
				$CFG['posts_trim_text_number'],
				$CFG['posts_trim_text_words']);

			$result[$i]['topic_trimmed'] = false;
			phpbb_trim_text($result[$i]['topic_title'],
				$result[$i]['topic_trimmed'],
				'',
				$CFG['posts_trim_topic_number'],
				'');
		}

		if (is_array($topic_id))
		{
			$sorted = array();

			for ($i = 0; $i < count($topic_id); $i++)
			{
				for ($j = 0; $j < count($result); $j++)
				{
					if ($topic_id[$i] == $result[$j]['topic_id'])
					{
						$sorted[] = $result[$j];
					}
				}
			}

			$result = $sorted;
		}
	}

	return $result;
} // end func phpbb_fetch_topics

###############################################################################
##                                                                           ##
## phpbb_fetch_new_posts()                                                   ##
## ------------------------------------------------------------------------- ##
## Fetches the number of new posts since the last visit.                     ##
##                                                                           ##
## EXAMPLE                                                                   ##
##                                                                           ##
##     $new_posts = phpbb_fetch_new_posts();                                 ##
##                                                                           ##
##     echo 'There are ' . $new_posts . ' new posts for you.';               ##
##                                                                           ##
###############################################################################

function phpbb_fetch_new_posts()
{
	global $userdata;

	$result['total'] = 0;

	if ($userdata['session_logged_in'])
	{
		$sql = 'SELECT COUNT(post_id) AS total
					FROM ' . POSTS_TABLE . '
					WHERE post_time >= ' . $userdata['user_lastvisit'];

		$result = phpbb_fetch_row($sql);
	}

	return $result;
}

###############################################################################
##                                                                           ##
## phpbb_fetch_thread()                                                      ##
## ------------------------------------------------------------------------- ##
## This function will fetch an entire thread by topic id.                    ##
##                                                                           ##
## PARAMETER                                                                 ##
##                                                                           ##
##     topic_id                                                              ##
##                                                                           ##
##         Must be set to a single topic id.                                 ##
##                                                                           ##
## EXAMPLE                                                                   ##
##                                                                           ##
##     $topic = phpbb_fetch_thread(1);                                       ##
##                                                                           ##
##     for ($i = 0; $i < count($topic); $i++)                                ##
##     {                                                                     ##
##         echo $topic[$i]['post_text'] . '<hr>';                            ##
##     }                                                                     ##
##                                                                           ##
###############################################################################

function phpbb_fetch_thread($topic_id = null)
{
	global $CFG, $userdata;

	if (!$topic_id)
	{
		phpbb_raise_error('no topic id specified', __FILE__, __LINE__);
	}

	$sql = 'SELECT p.*, pt.*, u.*';

	if (!$CFG['posts_hide_ranks'])
	{
		$sql .= ', r.*';
	}

	$sql .= '
				FROM ' . USERS_TABLE      . ' AS u,
					 ' . POSTS_TEXT_TABLE . ' AS pt,
					 ' . POSTS_TABLE      . ' AS p';

	if (!$CFG['posts_hide_ranks'])
	{
		$sql .= ',
					 ' . RANKS_TABLE      . ' AS r';
	}

	$sql .= '
				WHERE p.topic_id = ' . $topic_id . '
					AND u.user_id  = p.poster_id
					AND pt.post_id = p.post_id
					AND u.user_id  = p.poster_id';

	if (!$CFG['posts_hide_ranks'])
	{
		$sql .= '
					AND r.rank_id = u.user_rank';
	}

	if ($CFG['posts_search_string'])
	{
		$sql .= '
					AND (' . $CFG['posts_search_string'] . ')';
	}

	$sql .= '
				ORDER BY ' . $CFG['posts_order'];

	if ($CFG['posts_span_pages'])
	{
		$CFG['posts_span_pages_numrows'] = phpbb_numrows(phpbb_query($sql));
		if ($CFG['posts_span_pages_offset'] > $CFG['posts_span_pages_numrows'])
		{
			$CFG['posts_span_pages_offset'] =
				$CFG['posts_span_pages_numrows'] - 1;
		}
		$CFG['posts_offset'] = $CFG['posts_span_pages_offset'];
	}
	else
	{
		$CFG['posts_offset'] = 0;
	}

	if ($CFG['posts_limit'] != 0)
	{
		$sql .= ' LIMIT ' . $CFG['posts_offset'] . ',' . $CFG['posts_limit'];
	}

	$result = phpbb_fetch_rows($sql);

	if ($result)
	{
		if ($CFG['auth_check'])
		{
			phpbb_get_auth_list();

			$authed = array();

			for ($i = 0; $i < count($result); $i++)
			{
				if (in_array($result[$i]['forum_id'], $CFG['auth_list']))
				{
					$authed[] = $result[$i];
				}
			}

			$result = $authed;
		}

		$orig_word = array();
		$replacement_word = array();
		obtain_word_list($orig_word, $replacement_word);

		for ($i = 0; $i < count($result); $i++)
		{
			$result[$i]['post_time']      =
				$result[$i]['post_time']      + $CFG['time_zone'];
			$result[$i]['topic_time']     =
				$result[$i]['topic_time']     + $CFG['time_zone'];
			$result[$i]['post_edit_time'] =
				$result[$i]['post_edit_time'] + $CFG['time_zone'];

			$result[$i]['date'] =
				date($CFG['date_format'], $result[$i]['post_time']);
			$result[$i]['time'] =
				date($CFG['time_format'], $result[$i]['post_time']);

			$result[$i]['edit_date'] =
				date($CFG['date_format'], $result[$i]['post_edit_time']);
			$result[$i]['edit_time'] =
				date($CFG['time_format'], $result[$i]['post_edit_time']);

			$result[$i]['post_text'] = phpbb_parse_text(
				$result[$i]['post_text'],
				$result[$i]['bbcode_uid'],
				$result[$i]['enable_smilies'],
				$CFG['posts_hide_images'],
				$CFG['posts_replace_images']);

			if (count($orig_word))
			{
				$result[$i]['topic_title'] = preg_replace($orig_word,
					$replacement_word,
					$result[$i]['topic_title']);
				$result[$i]['post_text'] = preg_replace($orig_word,
					$replacement_word,
					$result[$i]['post_text']);
			}

			$result[$i]['trimmed'] = false;
			phpbb_trim_text($result[$i]['post_text'],
				$result[$i]['trimmed'],
				$CFG['posts_trim_text_character'],
				$CFG['posts_trim_text_number'],
				$CFG['posts_trim_text_words']);

			$result[$i]['topic_trimmed'] = false;
			phpbb_trim_text($result[$i]['topic_title'],
				$result[$i]['topic_trimmed'],
				'',
				$CFG['posts_trim_topic_number'],
				'');
		}

		if (is_array($topic_id))
		{
			$sorted = array();

			for ($i = 0; $i < count($topic_id); $i++)
			{
				for ($j = 0; $j < count($result); $j++)
				{
					if ($topic_id[$i] == $result[$j]['topic_id'])
					{
						$sorted[] = $result[$j];
					}
				}
			}

			$result = $sorted;
		}
	}

	return $result;
} // end func phpbb_fetch_thread

###############################################################################
##                                                                           ##
## phpbb_fetch_newposts()                                                    ##
## ------------------------------------------------------------------------- ##
## This function will fetch new postings based on the user session. It's has ##
## the same results as the search.php?search_id=newposts script.             ##
##                                                                           ##
## EXAMPLE                                                                   ##
##                                                                           ##
##     $newposts = phpbb_fetch_newposts();                                   ##
##                                                                           ##
##     for ($i = 0; $i < count($newposts); $i++)                             ##
##     {                                                                     ##
##         echo $newposts[$i]['post_text'] . '<br>';                         ##
##     }                                                                     ##
##                                                                           ##
###############################################################################

function phpbb_fetch_newposts()
{
	global $CFG, $userdata;

	if (!$userdata['session_logged_in'])
	{
		return;
	}

	$sql = 'SELECT post_id
				FROM ' . POSTS_TABLE . '
				WHERE post_time >= ' . $userdata['user_lastvisit'];

	$result = phpbb_fetch_rows($sql);

	if (!$result)
	{
		return;
	}

	$search_ids = array();
	for ($i = 0; $i < count($result); $i++)
	{
		$search_ids[] = $result[$i]['post_id'];
	}

	$sql = 'SELECT topic_id
				FROM ' . POSTS_TABLE . '
				WHERE post_id IN (' . implode(', ', $search_ids) . ')
				GROUP BY topic_id
				ORDER BY post_time DESC';

	$result = phpbb_fetch_rows($sql);

	if (!$result)
	{
		return;
	}

	$topic_ids = array();
	for ($i = 0; $i < count($result); $i++)
	{
		$topic_ids[] = $result[$i]['topic_id'];
	}

	$result = phpbb_fetch_topics($topic_ids, POSTS_FETCH_LAST);

	return $result;
} // end func phpbb_fetch_newposts

?>

Verfasst: Di 13. Jul 2004, 13:46
von emergence
der php code nützt im dem fall nichts... abgesehen davon
ein durchsehen von phpBB code auf die schnelle wird dir wirklich niemand hier im forum abnehmen...

ich hab gemeint du sollst dir das resultierende html ansehen...
der phpBB code nutzt für anzeige html templates... entweder man ändert dort was... oder man umgibt bei deinem modul den code für phpBB mit einer table... und sieht sich dann das html wieder an...
warscheinlich wird ne tabelle zuviel oder zu wenig aufgemacht...

Verfasst: Di 13. Jul 2004, 13:53
von andrej
Danke für den Tipp, das mit dem phpbb code hast Du antürlich recht. Ich bin auch fasst irre geworden als ich das gesehenhabe.

Also ich habe nun mein fertiges Content angeschaut. In der Tat werden zuviel Tabelen generiert. Und der Code wird einfach abgeschnitten. Nun weiß ich aber wirklich nicht wo ich noch was drehen kann :(

Code: Alles auswählen

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
		<title>Willkommen bei den GERMAN ANGEL OWNERS der Paintball Community</title>
		<meta http-equiv="keywords" name="keywords" content="paintball,wdp,angel,angel v6,angel lcd,angel ir3,angel speed,angel 4,angel air,paintballs,gotcha,markierer,paint,sport,xtreme,extrem,warped,sportz,a.i.r.,air,extremesport,extrem sport,funsport,freizeitsport,freizeit,lauf,griff,angel faq,abgelbilder,angel bilder,angel testberichte,angeltestberichte,testberichte,angelreviews,angel reviews,angelreview,angelreview,angel test,angeltest,angel modelle,angelmodelle,modellübersicht,angel modellübersicht,tips und tricks,tipps und tricks,was ist paintball,cal 68,angelvideos,angel video,angelvideo,angel videos,angelforum,forum,cobra,angeltuner,angel tuner,paintball händler,paintballhändler,angelhanbücher,handbuch,angel handbuch,angelhandbuch,angel handbücher,spielfeld,turnier,action,sup air,supair,hyperball,speedball,wald,fun,neuling,team,nppl,psp,xball,xpball,angeltech,angel tech,angeltechs,angel techs,gewinnspiel,gewinnspiele,hp system,pressluft,hobby,paintball in deutschland,angelservice,angel service,angelwebseite,angel webseite,paintballwebseite,paintball webseite">
		<meta http-equiv="copyright" name="copyright" content="(C) Copyright 2002-2004 angel-owners.de">
		<meta http-equiv="expires" content="0">
  		<meta http-equiv="description" name="description" content="www.angel-owners.de - Die German Angel Owners verstehen sich als ein Anlaufpunkt für die Deutschsprachige Paintballscene, die sich für Produkte von WDP wie die 'Angel', 'Angel AIR' etc. begeistern.">
  		<meta http-equiv="author" name="author" content="Andrej Votteler">
  		<meta http-equiv="publisher"name="publisher" content="Andrej Votteler">
  		<meta http-equiv="creator" name="creator" content="Andrej Votteler">
  		<meta http-equiv="robots" name="robots" content="index,follow">
  		<meta http-equiv="audience" name="audience" content="alle">
		<meta http-equiv="revisit-after" name="revisit-after" content="2 weeks">
		<meta http-equiv="content-language" name="content-language" content="all">
		<link rel="stylesheet" type="text/css" href="css/gao.css">
			<SCRIPT type="text/javascript" language="Javascript">
				var text="(¯`·.¸¸.- German Angel Owners - angel-owners.de -.¸¸.·´¯)"
				var speed=150
				var x=0
				function t(){
				var a=text.substring(0,x)
				var b=text.substring(x,x+1).toUpperCase()
				var c=text.substring(x,x).toUpperCase()
				var d=text.substring(x+1,text.length)
				window.status=a+b+c+d
				if(x==text.length){x=0
				}else{x++
				}setTimeout("t()",speed)}t();
				//-->
			</SCRIPT>
	<meta name="generator" content="CMS Contenido 4.4.4">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

	<body bgcolor="#ffffff" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
			<tr>
				<td width="22"></td>
				<td width="21" background="images/layout/rL.gif"></td>
				<td class="tabR" width="1"></td>
				<td>
					<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
						<tr>
							<td>
								<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
									<tr>
										<td colspan="3"><img src="images/layout/gao6.jpg" alt="GERMAN&nbsp;ANGEL&nbsp;OWNERS" border="0"></td>
									</tr>
									<tr height="1">
										<td class="tabR" width="180" height="1"></td>
										<td class="tabR" width="1" height="1"></td>
										<td class="tabR" height="1"></td>
									</tr>
									<tr height="23">
										<td width="180" height="23"></td>
										<td class="tabR" width="1" height="23"></td>
										<td class="N1" height="23">
											<div align="right"><table cellpadding="0" cellspacing="0" border="0"><tr><td height="29" class="N1">
          <a class="N1" href="index.php?idcat=89">Home</a></td><td height="29" class="N1">
          <a class="N1" href="index.php?idcat=55">News</a></td><td height="29" class="N1">
          <a class="N1" href="index.php?idcat=48">Info</a></td><td height="29" class="N1">
          <a class="N1" href="index.php?idcat=49">Tech</a></td><td height="29" class="N1">
          <a class="N1" href="index.php?idcat=50">Service</a></td><td height="29" class="N1">
          <a class="N1" href="index.php?idcat=51">MMedia</a></td><td height="29" class="N1">
          <a class="N1" href="index.php?idcat=94">Shop</a></td><td height="29" class="N1">
          <a class="N1" href="index.php?idcat=52">Forum</a></td><td height="29" class="N1">
          <a class="N1" href="index.php?idcat=53">Links</a></td><td height="29" class="N1">
          <a class="N1" href="index.php?idcat=88">Support</a></td><td height="29" class="N1">
          <a class="N1" href="index.php?idcat=91">Kontakt</a></td></tr></table></div>
										</td>
									</tr>
									<tr height="1">
										<td class="tabR" width="180" height="1"></td>
										<td class="tabR" width="1" height="1"></td>
										<td class="tabR" height="1"></td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td>
								<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
									<tr>
										<td class="N2" valign="top" width="180">
											<div align="center">
												<table width="100%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td class="N2">
</td>
													</tr>
													<tr>
														<td class="N2"><table width="100%" border="0" cellspacing="0" cellpadding="0" height="10">
	<tr>
		<td width="100%" class="txtsp1">Suche</td>
	</tr>
	<tr> 
    <td class="N2"> 
<center><table width="100%" border="0" cellspacing="0" cellpadding="0"> 
<tr>
		<td class="suche" align="left">
		<form name='suche' method='POST' action='index.php?idcat=96&idart=104'> 
		<input type="text" size="14" class="feld" name="suche" value=""></td> 
		<td class="suche" align="left">
		<button name="s" type="submit" value="Suchen" size="2" style="width: 55px; height: 20px; color: black; border:#C9C9C9 1px solid; background-color:#EFEFEF;">suchen</button>
		</td>
	</FORM></tr> 
</table>
      </td> 
  </tr> 
  </table></td>
													</tr>
													<tr>
														<td class="N2"><table width="100%" cellpadding="0" cellspacing="0" style="width:100%">
		<tr>
		<td class="txtsp1">News</td>
	  </tr></table><table width="100%" cellpadding="0" cellspacing="0" style="width:100%">
	<tr>
		<td class='"nsthead"' colspan="2">
		</td>
	</tr>
	<tr><td colspan=2 class="nsthead"><a href="index.php?client=1&lang=1&idcat=83&idart=107" class="nsthead"><b>Neues Tutorial ist online - Thema: Technische Angel Basics<b></a></td></tr><tr height='"10"'>
		<td class='"nsthead"' height='"10"'></td>
		<td class='"nsthead"' height='"10"'></td>
	</tr>
	<tr>
		<td class="nstdate" width="50">Datum:</td>
		<td class="nstdate">02.07.04</td>
	</tr>

	<tr>
		<td class="nsttext" colspan=2><i> &nbsp;Heute möchten wir Dir ein neues Tutorial präsentieren. In diesem Tutorial werden die Basics einer Angel...</i></td>
	</tr>
	<tr>
		<td class='"nsthead"' colspan="2">
		</td>
	</tr>
	<tr><td colspan=2 class="nsthead"><a href="index.php?client=1&lang=1&idcat=83&idart=106" class="nsthead"><b>&nbsp;Provider Umzug<b></a></td></tr><tr height='"10"'>
		<td class='"nsthead"' height='"10"'></td>
		<td class='"nsthead"' height='"10"'></td>
	</tr>
	<tr>
		<td class="nstdate" width="50">Datum:</td>
		<td class="nstdate">25.06.04</td>
	</tr>

	<tr>
		<td class="nsttext" colspan=2><i> &nbsp;Die German Angel Owners sind auf einen anderen Server umgezogen. Dieses Mal wurde nicht am Provider...</i></td>
	</tr>
	<tr>
		<td class='"nsthead"' colspan="2">
		</td>
	</tr>
	<tr><td colspan=2 class="nsthead"><a href="index.php?client=1&lang=1&idcat=83&idart=102" class="nsthead"><b>Neues Tutorial ist online - Thema: HP Systeme und Regulatoren<b></a></td></tr><tr height='"10"'>
		<td class='"nsthead"' height='"10"'></td>
		<td class='"nsthead"' height='"10"'></td>
	</tr>
	<tr>
		<td class="nstdate" width="50">Datum:</td>
		<td class="nstdate">12.06.04</td>
	</tr>

	<tr>
		<td class="nsttext" colspan=2><i> Unsere Sammlung an Technischen Tutorials wächst fast jeden Tag. Diesmal wird das Thema HP Systeme und...</i></td>
	</tr></table> 

</td>
													</tr>
												</table>
												<br>
												<img src="images/layout/lgfl2.jpg" alt="GERMAN&nbsp;ANGEL&nbsp;OWNERS" height="130" width="89" border="0"></div>
										</td>
										<td class="tabR" width="1"></td>
										<td valign="top">
											<table width="100%" border="0" cellspacing="0" cellpadding="0">
												<tr>
													<td class="pfad"><span class="locationstring"><b></b></span><span class="locationstring">Home</span> 
</td>
												</tr>
											</table>
											<br>
											<br>
											<div align="center">
												<table width="96%" border="0" cellspacing="0" cellpadding="0">
													<tr>
														<td class="txthead" colspan="2">WILLKOMMEN</td>
													</tr>
													<tr height="15">
														<td width="13" height="15"></td>
														<td height="15"></td>
													</tr>
													<tr>
														<td width="13"></td>
														<td class="txtsubhead">&nbsp;Das deutsche Angel Paintballportal</td>
													</tr>
													<tr height="25">
														<td width="13" height="25"></td>
														<td height="25"></td>
													</tr>
													<tr>
														<td class="txttext" colspan="2"><P align=center><IMG height=130 alt="German Angel Owners" hspace=5 src="upload/bilder/home/index.jpg" width=350 align=middle vspace=5 border=1></P>
<P>Die angel-owners.de Webseite versteht sich als ein Anlaufpunkt für Personen, aus der deutschsprachigen Paintballgemeinde, die an Produkten von <A href="http://www.wdp.tv/" target=_blank>WDP</A> interessiert sind. Auf dieser Webseite werden Informationen, Tipps, Tricks und News über Produkte der Firma <A href="http://www.wdp.tv/" target=_blank>WDP</A> für die Öffentlichkeit bereitgestellt. Diese Webseite ist unabhängig von <A href="http://www.wdp.tv/" target=_blank>WDP</A>. Die Markensymbole, Bilder und Texte gehören ihrem jeweiligen Benutzer, und unterliegen dem allgemeinem weltweit gültigen Copyright. Die Verfasser von Beiträgen auf angel-owners.de sind haftbar für ihre Beiträge. Die Webseite angel-owners.de übernimmt keine Garantien und Gewährleistungen für die verfassten Berichte. Alle Berichte wurden nach bestem Wissen und Gewissen vom angel-owners.de Team zusammengestellt. Alle Angaben sind ohne Gewähr.</P></td>
													</tr>
													<tr height="13">
														<td width="13" height="13"></td>
														<td height="13"></td>
													</tr>
													<tr>
														<td colspan="2">
															<table width="100%" border="0" cellspacing="0" cellpadding="0">
																<tr>
																	<td class="txtmake" width="180"><table cellspacing="0" cellpadding="0" border="0">
			<tr valign="top">
				<td width="180"><font size="1" color="#777777" face="Verdana"><b>Verfasser:</b></font></td>
				<td colspan="6"><font size="1" color="#777777" face="Verdana"> Andrej Votteler </font></td>
			</tr>
			<tr>
				<td width="180"><font size="1" color="#777777" face="Verdana"><b>Stand:</b></font></td>
				<td width="12"><img src="images/tools/date.gif" alt="Datum" border="0"></td>
				<td><font size="1" color="#777777" face="Verdana"> 15.05.2004 </font></td>
				<td width="10"></td>
				<td width="12"><img src="images/tools/time.gif" alt="Zeit" border="0"></td>
				<td><font size="1" color="#777777" face="Verdana"> 04:15 </font></td>
			</tr>
		</table> 

</td>
																	<td></td>
																	<td valign="top" class="txtlink" width="50">
																		<div align="right">
																			Scroll UP
</div>
																	</td>
																	<td valign="top" class="txtlink" width="50">
																		<div align="right">
																			<a href="javascript:history.back()">zurück</a>
</div>
																	</td>
																</tr>
															</table>
														</td>
													</tr>
												</table>
												<br>
											</div>
										</td>
										<td class="tabR" width="1"></td>
										<td class="N2" valign="top" width="180">
											<table width="100%" border="0" cellspacing="0" cellpadding="0">
												<tr>
													<td class="N2"><div align="center">
		<table width="179" border="0" cellspacing="0" cellpadding="0" bgcolor="white" height="80">
			<tr height="20">
				<td class="txtsp1" height="20">
					<center>Unterst&uuml;tzt von ...</center>
				</td>
			</tr>
			<tr>
				<td class="txtsp2">
					<div align="center">
					<table width="179" border="0" cellspacing="0" cellpadding="0">
						<tr>
							<td>
									<div align="center">
										<a title="Unterst&uuml;ztzung des Projektes von ['Paintballdiscounter']" href="http://www.paintballdiscounter.de" target="_blank"><img src="images/sponsor/pbds.gif" alt="Dieses Projekt wird unterstützt von: Paintball Discounter - Der günstige Paintball Shop" border="0"></a></div>
								</td>
								<td width="8"></td>
								<td>
									<div align="center">
										<a title="Unterst&uuml;ztzung des Projektes von ['Maxs Sport']" href="http://www.maxs-sport.com" target="_blank"><img src="images/sponsor/maxs.gif" alt="Dieses Projekt wird unterst&uuml;tzt von: Maxs Sport - Der gr&ouml;&szlig;te Shop in Europa" border="0"></a></div>
								</td>
						</tr>
					</table>
				</div>
				</td>
			</tr>
		</table>
	</div>
</td>
												</tr>
												<tr>
													<td class="N2"><div align="center">
	<table width="179" border="0" cellspacing="0" cellpadding="0" bgcolor="white">
			<tr height="20"><td class="txtprs1" height="20"><center>Partnerseiten</center></td></tr>
			<tr height="45"><td class="txtprs2" height="60">
			
				<table width="179" border="0" cellspacing="0" cellpadding="0">
					<tr>
					<td>	<div align="center"><a href="http://www.paintball7.com/newspaper/d/html/modules.php?op=modload&name=TopSites&file=index&dts_page=in&dts_id=52" target="new"><img src="images/partner/p7.jpg" border="0" alt="Paintball7 Top 100 "></a></div>
						</td>
						<td>
						</td>
						<td>
							<div align="center">
									<a title="Paintball Tech Sites" href="http://pbhub.de/hex/in-8c.html" target="_blank"><img src="http://pbhub.de/hex/hex-8c.jpg" alt="Paintball Tech Sites" border="0" ismap></a></div>
						
						</td>
					</tr>
					
									</table>
			</td>
			</tr>
			
	</table>
</div>
</td>
												</tr>
												<tr>
													<td class="N2"><div align="center"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="white" height="80"> 
         <tr height="20"> 
            <td class="txtsp1" height="20"> 
               <center>Translate to...</center> 
            </td> 
         </tr> 
         <tr> 
            <td class="txtsp2"> 
               <div align="center"> 
                  <table width="75%" border="0" cellspacing="0" cellpadding="0"> 
                  <tr>
				  	<td> 
                    	<div align="center">
						<a href="http://fets3.freetranslation.com/?Sequence=core&Language=German%2FEnglish&Url=http://v115924.dd5426.kasserver.com/cms/index.php?client=1&changelang=3&parent=&subid=&idcat=47"
						</a><img src="images/translate/english.png" alt="english" border="0"></div> 
                     </td> 
                     <td width="8"></td> 
                     <td> 
                        <div align="center">
						<a href="http://babelfish.altavista.com/babelfish/urltrurl?lp=de_fr&tt=url&url=http://v115924.dd5426.kasserver.com/cms/index.php?client=1&changelang=1&parent=&subid=&idcat=47" 
                        </a><img src="images/translate/french.png" alt="france" border="0"></div> 
                     </td> 
                     <td width="8"></td> 
                     <td> 
                        <div align="center">
						<a href="http://fets3.freetranslation.com/?Sequence=core&Language=English%2FGerman&Url=http://v115924.dd5426.kasserver.com/cms/index.php?client=1&changelang=1&parent=&subid=&idcat=47" 
                        </a><img src="images/translate/german.png" alt="german" border="0"></div> 
                     </td>
				   </tr> 
               	   </table> 
               </div> 
            </td> 
         </tr> 
      </table> 
   </div></td>
												</tr>
												<tr>
													<td class="N2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td class="txtsp1"><center>Letzte Forum Themen...</center></td>
	</tr>
	<tr>
		<td>
				</td>
	</tr>	
  	<tr>
    	<td class="grbfor"><a href="http://localhost/forum/viewtopic.php?t=1036&sid=24b27ab400bad92b71f354b4270f796e">Dummes Ding mit dem Einloggen</a>
		</td>
  	</tr>
	<tr>
		<td>
		</td>
	</tr>	
  	<tr>
    	<td class="grbfor"><a href="http://localhost/forum/viewtopic.php?t=1035&sid=24b27ab400bad92b71f354b4270f796e">[NEWS] - US-Patent für FAT BOY PODS</a>
		</td>
  	</tr>
	<tr>
		<td>
		</td>
	</tr>	
  	<tr>
    	<td class="grbfor"><a href="http://localhost/forum/viewtopic.php?t=1034&sid=24b27ab400bad92b71f354b4270f796e">DEMON mit dem HALO</a>
		</td>
  	</tr>
	<tr>
		<td>
		</td>
	</tr>	
  	<tr>
    	<td class="grbfor"><a href="http://localhost/forum/viewtopic.php?t=1033&sid=24b27ab400bad92b71f354b4270f796e">Angel iR3 C&C</a>
		</td>
  	</tr>
	<tr>
		<td>
		</td>
	</tr>	
  	<tr>
    	<td class="grbfor"><a href="http://localhost/forum/viewtopic.php?t=1032&sid=24b27ab400bad92b71f354b4270f796e">[NEWS] - Der ultimative Bolttest</a>
		</td>
  	</tr>
	<tr>
		<td>
		</td>	
	</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
	  <td class="grbfor" style="BORDER-BOTTOM: #C9C9C9 1px solid " height="1"><center>GERMAN ANGEL COMMUNITY</center></td>
  </tr>
</table>


</td>
												</tr>
											</table>
										</td>
									</tr>
									<tr height="1">
										<td class="tabR" width="180" height="1"></td>
										<td class="tabR" width="1" height="1"></td>
										<td class="tabR" height="1"></td>
										<td class="tabR" width="1" height="1"></td>
										<td class="tabR" width="180" height="1">
											
										</td>
									</tr>
									<tr height="23">
										<td class="N2" width="180" height="23">
											<div align="center">

Verfasst: Di 13. Jul 2004, 14:01
von emergence
ähm check mal via phpmyadmin die tabelle con_code
das feld value sollte longtext sein falls nicht stell es auf das um...

Verfasst: Di 13. Jul 2004, 16:43
von andrej
Ok, hattest recht, habe es jetzt umgestellt, allerdings ohne ergebniss. Der Code wird leider immer noch abgehackt. Muss ich sonst noch etwas aktualisieren ?

Verfasst: Di 13. Jul 2004, 17:33
von emergence
häng im frontend bei deiner url mal &force=1 an...
der code für die con_code sollte dann für diese seite neu erstellt werden...
im besten fall funktioniert es dann...

ähm ist die seite im editor eigentlich auch unvollständig ?

Verfasst: Di 13. Jul 2004, 17:42
von andrej
hmm also dieses force funktioniert bei mir leider nicht.
wenn ich diese url so eingebe http://localhost/cms_gao444/cms/index.php&force=1

dann wird mir einfach angezeigt das die seite nicht geladen werden kann. em backend wird die webseite übringens auch nicht komplett geladen. sondern wird auch abgeschnitten. warscheinlich genau der bereich der nicht dargestellt wird.

Verfasst: Di 13. Jul 2004, 17:51
von emergence
der erste parameter wäre ?force=1 jeder weitere &force=1...

wenn du auf der seite mit dem phpBB code bist, müsstest du eine url wie
http://localhost/cms_gao444/cms/front_c ... t=1&lang=1 haben dort hängt du das &force=1 ran.

also so

http://localhost/cms_gao444/cms/front_c ... =1&force=1

Verfasst: Di 13. Jul 2004, 17:53
von emergence
andrej hat geschrieben:dann wird mir einfach angezeigt das die seite nicht geladen werden kann. em backend wird die webseite übringens auch nicht komplett geladen. sondern wird auch abgeschnitten. warscheinlich genau der bereich der nicht dargestellt wird.
okay dann check nochmal das nachfolgende modul...
eventuell ist es fehlerhaft oder unkonfiguriert und bring so nen fehler...