Vill ändra utseendet på: Attachment Mod

Frågor kring MODdar (modifikationer) för phpBB 2.0.x.

Moderatorer: Moderatorgrupp, Supportgrupp

Användarens profilbild
Holger
Support - Ledare
Support - Ledare
Inlägg: 6571
Blev medlem: 2004-06-09 09:32
Svar: 1

Inlägg av Holger »

pm:ar ...
Holger Gremminger
Ingen support via PM!
Användarens profilbild
WickeD
Extra aktiv medlem
Extra aktiv medlem
Inlägg: 979
Blev medlem: 2004-11-08 12:17
Svar: 0

Inlägg av WickeD »

Ja nu fungerat detta!

Man kanske skulle lära sig lite mer om Admin inställningarna i ACP´n så skulle det gå bättre :D

Tack holger för hjälpen!
Bästa hälsningar - Mikael Andersson

Välkommen till: http://www.bikersite.se - Träffpunkten för svenska bikers!
Användarens profilbild
WickeD
Extra aktiv medlem
Extra aktiv medlem
Inlägg: 979
Blev medlem: 2004-11-08 12:17
Svar: 0

Inlägg av WickeD »

Jag har en fundering till.

Jag skulle vilja ha bilderna liggandes horisontalt i stället för vertikalt.

Men jag vet inte vade jag ska ändra i koden nedan.


Jag förmodar att det är i denna:
viewtopic_attach_body.tpl

Kod: Markera allt

<!-- BEGIN attach -->
	<br /><br />
          
	<!-- BEGIN denyrow -->
	<table width="100" border="0" cellpadding="0" cellspacing="0" align="center">
	</table>
	<!-- END denyrow -->
	<!-- BEGIN cat_stream -->
	<table width="100" border="0" cellpadding="0" cellspacing="0" align="center">
	<tr>
		<th width="100%" colspan="3" align="center"><b><span class="gen">{postrow.attach.cat_stream.DOWNLOAD_NAME}</span></b></th>
	</tr>
	<tr>
		<td colspan="2" align="center"><br />
		<object id="wmp" classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,0,0" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject"> 
		<param name="FileName" value="{postrow.attach.cat_stream.U_DOWNLOAD_LINK}"> 
        <param name="ShowControls" value="1"> 
		<param name="ShowDisplay" value="0"> 
		<param name="ShowStatusBar" value="1"> 
		<param name="AutoSize" value="1"> 
		<param name="AutoStart" value="0"> 
		<param name="Visible" value="1"> 
		<param name="AnimationStart" value="0"> 
		<param name="Loop" value="0"> 
		<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows95/downloads/contents/wurecommended/s_wufeatured/mediaplayer/default.asp" src="{postrow.attach.cat_stream.U_DOWNLOAD_LINK}" name=MediaPlayer2 showcontrols=1 showdisplay=0 showstatusbar=1 autosize=1 autostart=0 visible=1 animationatstart=0 loop=0></embed> 
		</object> <br /><br />
		</td>
	</tr>
	</table>
	<!-- END cat_stream -->
	<!-- BEGIN cat_swf -->
	<table width="100" border="0" cellpadding="0" cellspacing="0" align="center">
	<tr>
		<td colspan="2" align="center"><br />
		<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="{postrow.attach.cat_swf.WIDTH}" height="{postrow.attach.cat_swf.HEIGHT}"> 
		<param name=movie value="{postrow.attach.cat_swf.U_DOWNLOAD_LINK}"> 
		<param name=loop value=1> 
		<param name=quality value=high> 
		<param name=scale value=noborder> 
		<param name=wmode value=transparent> 
		<param name=bgcolor value=#000000> 
		<embed src="{postrow.attach.cat_swf.U_DOWNLOAD_LINK}" loop=1 quality=high scale=noborder wmode=transparent bgcolor=#000000  width="{postrow.attach.cat_swf.WIDTH}" height="{postrow.attach.cat_swf.HEIGHT}" type="application/x-shockwave-flash" pluginspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed> 
		</object><br /><br />
		</td>
	</tr>
	</table>
	<!-- END cat_swf -->
	<!-- BEGIN cat_images -->
	<table width="100" border="0" cellpadding="0" cellspacing="0" align="center">

	<tr>
		<td colspan="2" class="forumline" align="center"><span class="postdetails"><a href="{postrow.attach.cat_images.IMG_SRC}"><img src="size.php?pic={postrow.attach.cat_images.IMG_SRC}" alt="{postrow.attach.cat_images.DOWNLOAD_NAME}" border="0" /><br>Klicka på bilden!<br></a></span></td>
	</tr>
	</table>
	<!-- END cat_images -->
	<!-- BEGIN cat_thumb_images -->
	<table width="100" border="0" cellpadding="3" cellspacing="1" class="forumline" align="center">
	<tr>
		<th width="100%" colspan="3" align="center"><b><span class="gen">{postrow.attach.cat_thumb_images.DOWNLOAD_NAME}</span></b></th>
	</tr>
	<tr>
		<td colspan="2" align="center"><br /><a href="{postrow.attach.cat_thumb_images.IMG_SRC}" target="_blank"><img src="{postrow.attach.cat_thumb_images.IMG_THUMB_SRC}" alt="{postrow.attach.cat_thumb_images.DOWNLOAD_NAME}" border="0" /></a><br /><br /></td>
	</tr>
	</table>
	<!-- END cat_thumb_images -->
	<!-- BEGIN attachrow -->
	<table width="100" border="0" cellpadding="3" cellspacing="1" class="forumline" align="center">
	<tr>
		<th width="100%" colspan="3" align="center"><b><span class="gen">{postrow.attach.attachrow.DOWNLOAD_NAME}</span></b></th>
	</tr>
	</table>
	
	<!-- END attachrow -->
	
<!-- END attach -->
Jag ska nog ta bort någon <br /> men jag vet inte vilken/vilka.

Det ser nu ut så här: http://www.bikersite.se/viewtopic.php?t=1099
Bästa hälsningar - Mikael Andersson

Välkommen till: http://www.bikersite.se - Träffpunkten för svenska bikers!
Användarens profilbild
Holger
Support - Ledare
Support - Ledare
Inlägg: 6571
Blev medlem: 2004-06-09 09:32
Svar: 1

Inlägg av Holger »

Nej, du måste nog lägga switcharna (<!-- BEGIN blablabla) runt td-taggarna istället för runt table-taggarna.

Men det där kan jag inget om ... :oops:
Holger Gremminger
Ingen support via PM!
Användarens profilbild
WickeD
Extra aktiv medlem
Extra aktiv medlem
Inlägg: 979
Blev medlem: 2004-11-08 12:17
Svar: 0

Inlägg av WickeD »

Okej!

Det var synd.
Tråden blir så lång med många bilder.

Tack alla fall!
Bästa hälsningar - Mikael Andersson

Välkommen till: http://www.bikersite.se - Träffpunkten för svenska bikers!
Användarens profilbild
Holger
Support - Ledare
Support - Ledare
Inlägg: 6571
Blev medlem: 2004-06-09 09:32
Svar: 1

Inlägg av Holger »

Jo, men prova att flytta switcharna, det är de som utlöser upprepningen ...
Holger Gremminger
Ingen support via PM!
Användarens profilbild
WickeD
Extra aktiv medlem
Extra aktiv medlem
Inlägg: 979
Blev medlem: 2004-11-08 12:17
Svar: 0

Inlägg av WickeD »

Jag provade att flytta runt dom lite och det gjorde ingen skillnad alls.
Bästa hälsningar - Mikael Andersson

Välkommen till: http://www.bikersite.se - Träffpunkten för svenska bikers!
Användarens profilbild
Holger
Support - Ledare
Support - Ledare
Inlägg: 6571
Blev medlem: 2004-06-09 09:32
Svar: 1

Inlägg av Holger »

Prova att ändra

Kod: Markera allt

   <!-- BEGIN cat_thumb_images --> 
   <table width="100" border="0" cellpadding="3" cellspacing="1" class="forumline" align="center"> 
   <tr> 
      <th width="100%" colspan="3" align="center"><b><span class="gen">{postrow.attach.cat_thumb_images.DOWNLOAD_NAME}</span></b></th> 
   </tr> 
   <tr> 
      <td colspan="2" align="center"><br /><a href="{postrow.attach.cat_thumb_images.IMG_SRC}" target="_blank"><img src="{postrow.attach.cat_thumb_images.IMG_THUMB_SRC}" alt="{postrow.attach.cat_thumb_images.DOWNLOAD_NAME}" border="0" /></a><br /><br /></td> 
   </tr> 
   </table> 
   <!-- END cat_thumb_images --> 
till

Kod: Markera allt

   <!-- BEGIN cat_thumb_images --> 
   <table width="100" border="0" cellpadding="3" cellspacing="1" class="forumline" align="center"> 
   <tr> 
   <!-- BEGIN cat_thumb_images --> 
      <td colspan="2" align="center"><br /><a href="{postrow.attach.cat_thumb_images.IMG_SRC}" target="_blank"><img src="{postrow.attach.cat_thumb_images.IMG_THUMB_SRC}" alt="{postrow.attach.cat_thumb_images.DOWNLOAD_NAME}" border="0" /></a><br /><br /></td> 
   <!-- END cat_thumb_images -->
   </tr> 
   </table> 
   <!-- END cat_thumb_images --> 
bara för att se vad som händer ...
Holger Gremminger
Ingen support via PM!
Användarens profilbild
WickeD
Extra aktiv medlem
Extra aktiv medlem
Inlägg: 979
Blev medlem: 2004-11-08 12:17
Svar: 0

Inlägg av WickeD »

Det blev ingen skillnad alls av det.
Bästa hälsningar - Mikael Andersson

Välkommen till: http://www.bikersite.se - Träffpunkten för svenska bikers!
Användarens profilbild
Holger
Support - Ledare
Support - Ledare
Inlägg: 6571
Blev medlem: 2004-06-09 09:32
Svar: 1

Inlägg av Holger »

Hu?
Holger Gremminger
Ingen support via PM!
dallas
Extra aktiv medlem
Extra aktiv medlem
Inlägg: 196
Blev medlem: 2005-09-03 23:07
Svar: 0

Inlägg av dallas »

vet inte om det hjälper om du ändrar

Kod: Markera allt

<td colspan="2" align="center"><br /><a href="{postrow.attach.cat_thumb_images.IMG_SRC}" target="_blank"><img src="{postrow.attach.cat_thumb_images.IMG_THUMB_SRC}" alt="{postrow.attach.cat_thumb_images.DOWNLOAD_NAME}" border="0" /></a><br /><br /></td>
till

Kod: Markera allt

<td colspan="2" align="center"><br /><a href="{postrow.attach.cat_thumb_images.IMG_SRC}" target="_blank"><img src="{postrow.attach.cat_thumb_images.IMG_THUMB_SRC}" alt="{postrow.attach.cat_thumb_images.DOWNLOAD_NAME}" border="0" /></a></td>
annars är det nog i /attach_mod/displaying.php

du får in och kolla i

dallas
Användarens profilbild
Holger
Support - Ledare
Support - Ledare
Inlägg: 6571
Blev medlem: 2004-06-09 09:32
Svar: 1

Inlägg av Holger »

Du har rätt dallas, det kan vara lösningen! :D
Holger Gremminger
Ingen support via PM!
Användarens profilbild
WickeD
Extra aktiv medlem
Extra aktiv medlem
Inlägg: 979
Blev medlem: 2004-11-08 12:17
Svar: 0

Inlägg av WickeD »

Att byta ut den raden gjorde ingen skillnad heller.

Ska kolla i den fil du föreslog dallas.
Bästa hälsningar - Mikael Andersson

Välkommen till: http://www.bikersite.se - Träffpunkten för svenska bikers!
Användarens profilbild
WickeD
Extra aktiv medlem
Extra aktiv medlem
Inlägg: 979
Blev medlem: 2004-11-08 12:17
Svar: 0

Inlägg av WickeD »

Jag vet inte ens vart jag ska börja söka i denna fil:

Kod: Markera allt

<?php
/***************************************************************************
 *								displaying.php
 *                            -------------------
 *   begin                : Monday, Jul 15, 2002
 *   copyright            : (C) 2002 Meik Sievertsen
 *   email                : acyd.burn@gmx.de
 *
 *   $Id: displaying.php,v 1.50 2004/10/31 16:46:58 acydburn Exp $
 *
 *
 ***************************************************************************/

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

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

$allowed_extensions = array();
$display_categories = array();
$download_modes = array();
$upload_icons = array();
$attachments = array();

function display_compile_cache_clear($filename, $template_var)
{
	global $template;
	
	if (isset($template->cachedir))
	{
		$filename = str_replace($template->root, '', $filename);
		if (substr($filename, 0, 1) == '/')
		{
			$filename = substr($filename, 1, strlen($filename));
		}

		if (file_exists($template->cachedir . $filename . '.php'))
		{
			@unlink($template->cachedir . $filename . '.php');
		}
	}

	return;
}

// 
// Create needed arrays for Extension Assignments
//
function init_complete_extensions_data()
{
	global $db, $allowed_extensions, $display_categories, $download_modes, $upload_icons;

	$extension_informations = get_extension_informations();
	$allowed_extensions = array();

	for ($i = 0; $i < count($extension_informations); $i++)
	{
		$extension = strtolower(trim($extension_informations[$i]['extension']));
		$allowed_extensions[] = $extension;
		$display_categories[$extension] = intval($extension_informations[$i]['cat_id']);
		$download_modes[$extension] = intval($extension_informations[$i]['download_mode']);
		$upload_icons[$extension] = trim($extension_informations[$i]['upload_icon']);
	}
}

//
// Writing Data into plain Template Vars
//
function init_display_template($template_var, $replacement, $filename = 'viewtopic_attach_body.tpl')
{
	global $template;

	//
	// This function is adapted from the old template class
	// I wish i had the functions from the 2.2 one. :D (This class rocks, can't await to use it in Mods)
	//
	
	//
	// Handle Attachment Informations
	//
	if (!isset($template->uncompiled_code[$template_var]) && empty($template->uncompiled_code[$template_var]))
	{
		// If we don't have a file assigned to this handle, die.
		if (!isset($template->files[$template_var]))
		{
			die("Template->loadfile(): No file specified for handle $template_var");
		}

		$filename_2 = $template->files[$template_var];

		$str = implode("", @file($filename_2));
		if (empty($str))
		{
			die("Template->loadfile(): File $filename_2 for handle $template_var is empty");
		}

		$template->uncompiled_code[$template_var] = $str;
	}

	$complete_filename = $filename;
	if (substr($complete_filename, 0, 1) != '/')
	{
		$complete_filename = $template->root . '/' . $complete_filename;
	}

	if (!file_exists($complete_filename))
	{
		die("Template->make_filename(): Error - file $complete_filename does not exist");
	}

	$content = implode('', file($complete_filename));
	if (empty($content))
	{
		die('Template->loadfile(): File ' . $complete_filename . ' is empty');
	}

	// replace $replacement with uncompiled code in $filename
	$template->uncompiled_code[$template_var] = str_replace($replacement, $content, $template->uncompiled_code[$template_var]);

	//
	// Force Reload on cached version
	//
	display_compile_cache_clear($template->files[$template_var], $template_var);
}

//
// BEGIN ATTACHMENT DISPLAY IN POSTS
//

//
// Returns the image-tag for the topic image icon
//
function topic_attachment_image($switch_attachment)
{
	global $attach_config, $is_auth;

	if (intval($switch_attachment) == 0 || (!($is_auth['auth_download'] && $is_auth['auth_view'])) || intval($attach_config['disable_mod']) || $attach_config['topic_icon'] == '')
	{
		return '';
	}

	$image = '<img src="' . $attach_config['topic_icon'] . '" alt="" border="0" /> ';

	return $image;
}

//
// Display Attachments in Posts
//
function display_post_attachments($post_id, $switch_attachment)
{
	global $attach_config, $is_auth;
		
	if (intval($switch_attachment) == 0 || intval($attach_config['disable_mod']))
	{
		return;
	}

	if ($is_auth['auth_download'] && $is_auth['auth_view'])
	{
	display_attachments($post_id);
}
else
	{
		// Display Notice (attachment there but not having permissions to view it)
		// Not included because this would mean template and language file changes (at this stage this is not a wise step. ;))
	}
}
//
// Display Attachments in News
//
function display_news_attachments($post_id, $switch_attachment)
{
	global $attach_config, $is_auth;
		
	if ( (intval($switch_attachment) == 0) || (intval($attach_config['disable_mod'])) || (!( ($is_auth['auth_download']) && ($is_auth['auth_view']))) )
	{
		return;
	}

	display_portal_news_attachments($post_id);
}

//
// Generate the Display Assign File Link
//
/*
function display_assign_link($post_id)
{
	global $attach_config, $is_auth, $phpEx;

	$image = 'templates/subSilver/images/icon_mini_message.gif';

	if ( (intval($attach_config['disable_mod'])) || (!( ($is_auth['auth_download']) && ($is_auth['auth_view']))) )
	{
		return ('');
	}

	$temp_url = append_sid("assign_file.$phpEx?p=" . $post_id);
	$link = '<a href="' . $temp_url . '" target="_blank"><img src="' . $image . '" alt="Add File" title="Add File" border="0" /></a>';
	
	return ($link);
}
*/

//
// Initializes some templating variables for displaying Attachments in Posts
//
function init_display_post_attachments($switch_attachment, $article=array())
{
	global $attach_config, $db, $is_auth, $template, $lang, $postrow, $total_posts, $attachments, $forum_row, $forum_topic_data;

	if (empty($forum_topic_data) && !empty($forum_row))
	{
		$switch_attachment = $forum_row['topic_attachment'];
	}
	if ( !empty($article) && $switch_attachment == '' )
	{
		$switch_attachment = $article['topic_attachment'];
	}

	if ( count($article) == 0 )
	{
		if (intval($switch_attachment) == 0 || intval($attach_config['disable_mod']) || (!($is_auth['auth_download'] && $is_auth['auth_view'])))
		{
			return;
		}
	}

	$post_id_array = array();

	if ( count($article) == 0 )
	{
		for ($i = 0; $i < $total_posts; $i++)
		{
			if ($postrow[$i]['post_attachment'] == 1)
			{
				$post_id_array[] = $postrow[$i]['post_id'];
			}
		}
	}
	else
	{
		if ($article['post_attachment'] == 1)
		{
			$post_id_array[] = $article['post_id'];
		}
	}
	if (count($post_id_array) == 0)
	{
		return;
	}

	$rows = get_attachments_from_post($post_id_array);
	$num_rows = count($rows);

	if ($num_rows == 0)
	{
		return;
	}

	@reset($attachments);

	for ($i = 0; $i < $num_rows; $i++)
	{
		$attachments['_' . $rows[$i]['post_id']][] = $rows[$i];
	}

	if ( count($article) == 0 )
	{
		init_display_template('body', '{postrow.ATTACHMENTS}');
	}
	else
	{
		init_display_template('news', '{articles.ATTACHMENTS}', 'news_attach_body.tpl');
	}

	init_complete_extensions_data();

	$template->assign_vars(array(
		'L_POSTED_ATTACHMENTS' => $lang['Posted_attachments'],
		'L_KILOBYTE' => $lang['KB'])
	);
}

//
// END ATTACHMENT DISPLAY IN POSTS
//

//
// BEGIN ATTACHMENT DISPLAY IN PM's
//

//
// Returns the image-tag for the PM image icon
//
function privmsgs_attachment_image($privmsg_id)
{
	global $attach_config, $userdata;

	$auth = ( $userdata['user_level'] == ADMIN ) ? 1 : intval($attach_config['allow_pm_attach']);
	
	if (!attachment_exists_db($privmsg_id, PAGE_PRIVMSGS) || !$auth || intval($attach_config['disable_mod']) || $attach_config['topic_icon'] == '')
	{
		return '';
	}

	$image = '<img src="' . $attach_config['topic_icon'] . '" alt="" border="0" /> ';

	return $image;
}

//
// Display Attachments in PM's
//
function display_pm_attachments($privmsgs_id, $switch_attachment)
{
	global $attach_config, $userdata, $template, $lang;
		
	if ( $userdata['user_level'] == ADMIN )
	{
		$auth_download = 1;
	}
	else
	{
		$auth_download = intval($attach_config['allow_pm_attach']);
	}

	if (intval($switch_attachment) == 0 || intval($attach_config['disable_mod']) || !$auth_download)
	{
		return;
	}

	display_attachments($privmsgs_id);
	
	$template->assign_block_vars('switch_attachments', array());
	$template->assign_vars(array(
		'L_DELETE_ATTACHMENTS' => $lang['Delete_attachments'])
	);
}

//
// Initializes some templating variables for displaying Attachments in Private Messages
//
function init_display_pm_attachments($switch_attachment)
{
	global $attach_config, $template, $userdata, $lang, $attachments, $privmsg;

	if ( $userdata['user_level'] == ADMIN )
	{
		$auth_download = 1;
	}
	else
	{
		$auth_download = intval($attach_config['allow_pm_attach']);
	}

	if (intval($switch_attachment) == 0 || intval($attach_config['disable_mod']) || !$auth_download)
	{
		return;
	}

	$privmsgs_id = $privmsg['privmsgs_id'];
	
	@reset($attachments);
	$attachments['_' . $privmsgs_id] = get_attachments_from_pm($privmsgs_id);

	if ( count($attachments['_' . $privmsgs_id]) == 0)
	{
		return;
	}

	$template->assign_block_vars('postrow', array());
		
	init_display_template('body', '{ATTACHMENTS}');

	init_complete_extensions_data();
	
	$template->assign_vars(array(
		'L_POSTED_ATTACHMENTS' => $lang['Posted_attachments'],
		'L_KILOBYTE' => $lang['KB'])
	);

	display_pm_attachments($privmsgs_id, $switch_attachment);
}

//
// END ATTACHMENT DISPLAY IN PM's
//

//
// BEGIN ATTACHMENT DISPLAY IN TOPIC REVIEW WINDOW
//

//
// Display Attachments in Review Window
//
function display_review_attachments($post_id, $switch_attachment, $is_auth)
{
	global $attach_config, $attachments;
		
	if (intval($switch_attachment) == 0 || intval($attach_config['disable_mod']) || (!($is_auth['auth_download'] && $is_auth['auth_view'])) || intval($attach_config['attachment_topic_review']) == 0)
	{
		return;
	}

	@reset($attachments);
	$attachments['_' . $post_id] = get_attachments_from_post($post_id);

	if ( count($attachments['_' . $post_id]) == 0)
	{
		return;
	}

	display_attachments($post_id);
}

//
// Initializes some templating variables for displaying Attachments in Review Topic Window
//
function init_display_review_attachments($is_auth)
{
	global $attach_config;

	if (intval($attach_config['disable_mod']) || (!($is_auth['auth_download'] && $is_auth['auth_view'])) || intval($attach_config['attachment_topic_review']) == 0)
	{
		return;
	}

	init_display_template('reviewbody', '{postrow.ATTACHMENTS}');

	init_complete_extensions_data();
	
}

//
// END ATTACHMENT DISPLAY IN TOPIC REVIEW WINDOW
//

//
// BEGIN DISPLAY ATTACHMENTS -> PREVIEW
//
function display_attachments_preview($attachment_list, $attachment_filesize_list, $attachment_filename_list, $attachment_comment_list, $attachment_extension_list, $attachment_thumbnail_list)
{
	global $attach_config, $is_auth, $allowed_extensions, $lang, $userdata, $display_categories, $upload_dir, $upload_icons, $template, $db, $theme;

	if (count($attachment_list) != 0)
	{
		init_display_template('preview', '{ATTACHMENTS}');
			
		init_complete_extensions_data();

		$template->assign_block_vars('postrow', array());
		$template->assign_block_vars('postrow.attach', array());
	
		$template->assign_vars(array(
			'T_BODY_TEXT' => '#'.$theme['body_text'],
			'T_TR_COLOR3' => '#'.$theme['tr_color3'])
		);

		for ($i = 0; $i < count($attachment_list); $i++)
		{
			$filename = $upload_dir . '/' . $attachment_list[$i];
			$thumb_filename = $upload_dir . '/' . THUMB_DIR . '/t_' . $attachment_list[$i];

			$filesize = $attachment_filesize_list[$i];
			$size_lang = ($filesize >= 1048576) ? $lang['MB'] : ( ($filesize >= 1024) ? $lang['KB'] : $lang['Bytes'] );
			if ($filesize >= 1048576)
			{
				$filesize = (round((round($filesize / 1048576 * 100) / 100), 2));
			}
			else if ($filesize >= 1024)
			{
				$filesize = (round((round($filesize / 1024 * 100) / 100), 2));
			}

			$display_name = $attachment_filename_list[$i];
			$comment = trim(htmlspecialchars(stripslashes($attachment_comment_list[$i])));
			$comment = str_replace("\n", '<br />', $comment);
			
			$extension = strtolower(trim($attachment_extension_list[$i]));

			$denied = false;

			//
			// Admin is allowed to view forbidden Attachments, but the error-message is displayed too to inform the Admin
			//
			if ( (!in_array($extension, $allowed_extensions)) )
			{
				$denied = true;

				$template->assign_block_vars('postrow.attach.denyrow', array(
					'L_DENIED' => sprintf($lang['Extension_disabled_after_posting'], $extension))
				);
			} 

			if (!$denied)
			{
				//
				// Some basic Template Vars
				//
				$template->assign_vars(array(
					'L_DESCRIPTION' => $lang['Description'],
					'L_DOWNLOAD' => $lang['Download'],
					'L_FILENAME' => $lang['File_name'],
					'L_FILESIZE' => $lang['Filesize'])
				);
		
				//
				// define category
				//
				$image = FALSE;
				$stream = FALSE;
				$swf = FALSE;
				$thumbnail = FALSE;
				$link = FALSE;

				if (intval($display_categories[$extension]) == STREAM_CAT)
				{
					$stream = TRUE;
				}
				else if (intval($display_categories[$extension]) == SWF_CAT)
				{
					$swf = TRUE;
				}
				else if ( (intval($display_categories[$extension]) == IMAGE_CAT) && (intval($attach_config['img_display_inlined'])) )
				{
					if ( (intval($attach_config['img_link_width']) != 0) || (intval($attach_config['img_link_height']) != 0) )
					{
						list($width, $height) = image_getdimension($filename);

						if ( ($width == 0) && ($height == 0) )
						{
							$image = TRUE;
						}
						else
						{
							if ( ($width <= intval($attach_config['img_link_width'])) && ($height <= intval($attach_config['img_link_height'])) )
							{
								$image = TRUE;
							}
						}
					}
					else
					{
						$image = TRUE;
					}
				}
			
				if ( (intval($display_categories[$extension]) == IMAGE_CAT) && (intval($attachment_thumbnail_list[$i]) == 1) )
				{
					$thumbnail = TRUE;
					$image = FALSE;
				}

				if ( (!$image) && (!$stream) && (!$swf) && (!$thumbnail) )
				{
					$link = TRUE;
				}

				if ($image)
				{
					//
					// Images
					//
					$template->assign_block_vars('postrow.attach.cat_images', array(
						'DOWNLOAD_NAME' => $display_name,
						'IMG_SRC' => $filename,
						'FILESIZE' => $filesize,
						'SIZE_VAR' => $size_lang,
						'COMMENT' => $comment,
						'L_DOWNLOADED_VIEWED' => $lang['Viewed'])
					);
				}
			
				if ($thumbnail)
				{
					//
					// Images, but display Thumbnail
					//
					$template->assign_block_vars('postrow.attach.cat_thumb_images', array(
						'DOWNLOAD_NAME' => $display_name,
						'IMG_SRC' => $filename,
						'IMG_THUMB_SRC' => $thumb_filename,
						'FILESIZE' => $filesize,
						'SIZE_VAR' => $size_lang,
						'COMMENT' => $comment,
						'L_DOWNLOADED_VIEWED' => $lang['Viewed'])
					);
				}

				if ($stream)
				{
					//
					// Streams
					//
					$template->assign_block_vars('postrow.attach.cat_stream', array(
						'U_DOWNLOAD_LINK' => $filename,
						'DOWNLOAD_NAME' => $display_name,
						'FILESIZE' => $filesize,
						'SIZE_VAR' => $size_lang,
						'COMMENT' => $comment,
						'L_DOWNLOADED_VIEWED' => $lang['Viewed'])
					);
				}
			
				if ($swf)
				{
					//
					// Macromedia Flash Files
					//
					list($width, $height) = swf_getdimension($filename);
					
					$template->assign_block_vars('postrow.attach.cat_swf', array(
						'U_DOWNLOAD_LINK' => $filename,
						'DOWNLOAD_NAME' => $display_name,
						'FILESIZE' => $filesize,
						'SIZE_VAR' => $size_lang,
						'COMMENT' => $comment,
						'L_DOWNLOADED_VIEWED' => $lang['Viewed'],
						'WIDTH' => $width,
						'HEIGHT' => $height)
					);
				}

				if ($link)
				{
					$upload_image = '';

					if ( ($attach_config['upload_img'] != '') && ($upload_icons[$extension] == '') )
					{
						$upload_image = '<img src="' . $attach_config['upload_img'] . '" alt="" border="0" />';
					}
					else if (trim($upload_icons[$extension]) != '')
					{
						$upload_image = '<img src="' . $upload_icons[$extension] . '" alt="" border="0" />';
					}

					$target_blank = 'target="_blank"';
					
					//
					// display attachment
					//
					$template->assign_block_vars('postrow.attach.attachrow', array(
						'U_DOWNLOAD_LINK' => $filename,
						'S_UPLOAD_IMAGE' => $upload_image,
						
						'DOWNLOAD_NAME' => $display_name,
						'FILESIZE' => $filesize,
						'SIZE_VAR' => $size_lang,
						'COMMENT' => $comment,
						'L_DOWNLOADED_VIEWED' => $lang['Downloaded'],
						'TARGET_BLANK' => $target_blank)
					);
				}
			}
		}
	}
}

//
// END DISPLAY ATTACHMENTS -> PREVIEW
//

//
// Assign Variables and Definitions based on the fetched Attachments - internal
// used by all displaying functions, the Data was collected before, it's only dependend on the template used. :)
// before this function is usable, init_display_attachments have to be called for specific pages (pm, posting, review etc...)
//
function display_attachments($post_id)
{
	global $template, $upload_dir, $userdata, $allowed_extensions, $display_categories, $download_modes, $db, $lang, $phpEx, $attachments, $upload_icons, $attach_config;

	$num_attachments = count($attachments['_' . $post_id]);
	
	if ($num_attachments == 0)
	{
		return;
	}

	$template->assign_block_vars('postrow.attach', array());
	
	for ($i = 0; $i < $num_attachments; $i++)
	{
		//
		// Some basic things...
		//
		$filename = $upload_dir . '/' . $attachments['_' . $post_id][$i]['physical_filename'];
		$thumbnail_filename = $upload_dir . '/' . THUMB_DIR . '/t_' . $attachments['_' . $post_id][$i]['physical_filename'];
	
		$upload_image = '';

		if ( ($attach_config['upload_img'] != '') && (trim($upload_icons[$attachments['_' . $post_id][$i]['extension']]) == '') )
		{
			$upload_image = '<img src="' . $attach_config['upload_img'] . '" alt="" border="0" />';
		}
		else if (trim($upload_icons[$attachments['_' . $post_id][$i]['extension']]) != '')
		{
			$upload_image = '<img src="' . $upload_icons[$attachments['_' . $post_id][$i]['extension']] . '" alt="" border="0" />';
		}
		
		$filesize = $attachments['_' . $post_id][$i]['filesize'];
		$size_lang = ($filesize >= 1048576) ? $lang['MB'] : ( ($filesize >= 1024) ? $lang['KB'] : $lang['Bytes'] );
		if ($filesize >= 1048576)
		{
			$filesize = (round((round($filesize / 1048576 * 100) / 100), 2));
		}
		else if ($filesize >= 1024)
		{
			$filesize = (round((round($filesize / 1024 * 100) / 100), 2));
		}

		$display_name = $attachments['_' . $post_id][$i]['real_filename']; 
		$comment = trim(htmlspecialchars(stripslashes($attachments['_' . $post_id][$i]['comment'])));
		$comment = str_replace("\n", '<br />', $comment);

		$attachments['_' . $post_id][$i]['extension'] = strtolower(trim($attachments['_' . $post_id][$i]['extension']));

		$denied = false;

		//
		// Admin is allowed to view forbidden Attachments, but the error-message is displayed too to inform the Admin
		//
		if ( (!in_array($attachments['_' . $post_id][$i]['extension'], $allowed_extensions)) )
		{
			$denied = true;

			$template->assign_block_vars('postrow.attach.denyrow', array(
				'L_DENIED' => sprintf($lang['Extension_disabled_after_posting'], $attachments['_' . $post_id][$i]['extension']))
			);
		} 

		if (!$denied)
		{
			//
			// Some basic Template Vars
			//
			$template->assign_vars(array(
				'L_DESCRIPTION' => $lang['Description'],
				'L_DOWNLOAD' => $lang['Download'],
				'L_FILENAME' => $lang['File_name'],
				'L_FILESIZE' => $lang['Filesize'])
			);
			
			//
			// define category
			//
			$image = FALSE;
			$stream = FALSE;
			$swf = FALSE;
			$thumbnail = FALSE;
			$link = FALSE;

			if (intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == STREAM_CAT)
			{
				$stream = TRUE;
			}
			else if (intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == SWF_CAT)
			{
				$swf = TRUE;
			}
			else if ( (intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT) && (intval($attach_config['img_display_inlined'])) )
			{
				if ( (intval($attach_config['img_link_width']) != 0) || (intval($attach_config['img_link_height']) != 0) )
				{
					list($width, $height) = image_getdimension($filename);

					if ( ($width == 0) && ($height == 0) )
					{
						$image = TRUE;
					}
					else
					{
						if ( ($width <= intval($attach_config['img_link_width'])) && ($height <= intval($attach_config['img_link_height'])) )
						{
							$image = TRUE;
						}
					}
				}
				else
				{
					$image = TRUE;
				}
			}
			
			if ( (intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT) && ($attachments['_' . $post_id][$i]['thumbnail'] == 1) )
			{
				$thumbnail = TRUE;
				$image = FALSE;
			}

			if ( (!$image) && (!$stream) && (!$swf) && (!$thumbnail) )
			{
				$link = TRUE;
			}

			if ($image)
			{
				//
				// Images
				// NOTE: If you want to use the download.php everytime an image is displayed inlined, replace the
				// Section between BEGIN and END with (Without the // of course):
				//	$img_source = append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']);
				//	$download_link = TRUE;
				// 
				//
				if ((intval($attach_config['allow_ftp_upload'])) && (trim($attach_config['download_path']) == ''))
				{
					$img_source = append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']);
					$download_link = TRUE;
				}
				else
				{
					$img_source = $filename;
					$download_link = FALSE;
				}

				$template->assign_block_vars('postrow.attach.cat_images', array(
					'DOWNLOAD_NAME' => $display_name,
					'S_UPLOAD_IMAGE' => $upload_image,

					'IMG_SRC' => $img_source,
					'FILESIZE' => $filesize,
					'SIZE_VAR' => $size_lang,
					'COMMENT' => $comment,
					'L_DOWNLOADED_VIEWED' => $lang['Viewed'],
					'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']))
				);

				//
				// Directly Viewed Image ... update the download count
				//
				if (!$download_link)
				{
					$sql = 'UPDATE ' . ATTACHMENTS_DESC_TABLE . ' 
					SET download_count = download_count + 1 
					WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
	
					if ( !($db->sql_query($sql)) )
					{
						message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count.', '', __LINE__, __FILE__, $sql);
					}
				}
			}
			
			if ($thumbnail)
			{
				//
				// Images, but display Thumbnail
				// NOTE: If you want to use the download.php everytime an thumnmail is displayed inlined, replace the
				// Section between BEGIN and END with (Without the // of course):
				//	$thumb_source = append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1');
				//
				if ( (intval($attach_config['allow_ftp_upload'])) && (trim($attach_config['download_path']) == '') )
				{
					$thumb_source = append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1');
				}
				else
				{
					$thumb_source = $thumbnail_filename;
				}
				
				$template->assign_block_vars('postrow.attach.cat_thumb_images', array(
					'DOWNLOAD_NAME' => $display_name,
					'S_UPLOAD_IMAGE' => $upload_image,

					'IMG_SRC' => append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']),
					'IMG_THUMB_SRC' => $thumb_source,
					'FILESIZE' => $filesize,
					'SIZE_VAR' => $size_lang,
					'COMMENT' => $comment,
					'L_DOWNLOADED_VIEWED' => $lang['Viewed'],
					'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']))
				);
			}

			if ($stream)
			{
				//
				// Streams
				//
				$template->assign_block_vars('postrow.attach.cat_stream', array(
					'U_DOWNLOAD_LINK' => $filename,
					'S_UPLOAD_IMAGE' => $upload_image,

//					'U_DOWNLOAD_LINK' => append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']),
					'DOWNLOAD_NAME' => $display_name,
					'FILESIZE' => $filesize,
					'SIZE_VAR' => $size_lang,
					'COMMENT' => $comment,
					'L_DOWNLOADED_VIEWED' => $lang['Viewed'],
					'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']))
				);

				//
				// Viewed/Heared File ... update the download count (download.php is not called here)
				//
				$sql = 'UPDATE ' . ATTACHMENTS_DESC_TABLE . ' 
				SET download_count = download_count + 1 
				WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
	
				if ( !($db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql);
				}
			}
			
			if ($swf)
			{
				//
				// Macromedia Flash Files
				//
				list($width, $height) = swf_getdimension($filename);
						
				$template->assign_block_vars('postrow.attach.cat_swf', array(
					'U_DOWNLOAD_LINK' => $filename,
					'S_UPLOAD_IMAGE' => $upload_image,

					'DOWNLOAD_NAME' => $display_name,
					'FILESIZE' => $filesize,
					'SIZE_VAR' => $size_lang,
					'COMMENT' => $comment,
					'L_DOWNLOADED_VIEWED' => $lang['Viewed'],
					'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']),
					'WIDTH' => $width,
					'HEIGHT' => $height)
				);

				//
				// Viewed/Heared File ... update the download count (download.php is not called here)
				//
				$sql = 'UPDATE ' . ATTACHMENTS_DESC_TABLE . ' 
				SET download_count = download_count + 1 
				WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
	
				if ( !($db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql);
				}
			}

			if ($link)
			{
				$target_blank = ( (intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT) ) ? 'target="_blank"' : '';

				//
				// display attachment
				//
				$template->assign_block_vars('postrow.attach.attachrow', array(
					'U_DOWNLOAD_LINK' => append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']),
					'S_UPLOAD_IMAGE' => $upload_image,
						
					'DOWNLOAD_NAME' => $display_name,
					'FILESIZE' => $filesize,
					'SIZE_VAR' => $size_lang,
					'COMMENT' => $comment,
					'TARGET_BLANK' => $target_blank,

					'L_DOWNLOADED_VIEWED' => $lang['Downloaded'],
					'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']))
				);
						
			}
		}
	}
}

function display_portal_news_attachments($post_id)
{
	global $template, $upload_dir, $userdata, $allowed_extensions, $display_categories, $download_modes, $db, $lang, $phpEx, $attachments, $upload_icons, $attach_config;

	$num_attachments = count($attachments['_' . $post_id]);

	if ($num_attachments == 0)
	{
		return;
	}

	$template->assign_block_vars('articles.attach', array());
	
	for ($i = 0; $i < $num_attachments; $i++)
	{
		//
		// Some basic things...
		//
		$filename = $upload_dir . '/' . $attachments['_' . $post_id][$i]['physical_filename'];
		$thumbnail_filename = $upload_dir . '/' . THUMB_DIR . '/t_' . $attachments['_' . $post_id][$i]['physical_filename'];
	
		$upload_image = '';

		if ( ($attach_config['upload_img'] != '') && (trim($upload_icons[$attachments['_' . $post_id][$i]['extension']]) == '') )
		{
			$upload_image = '<img src="' . $attach_config['upload_img'] . '" alt="" border="0" />';
		}
		else if (trim($upload_icons[$attachments['_' . $post_id][$i]['extension']]) != '')
		{
			$upload_image = '<img src="' . $upload_icons[$attachments['_' . $post_id][$i]['extension']] . '" alt="" border="0" />';
		}
		
		$filesize = $attachments['_' . $post_id][$i]['filesize'];
		$size_lang = ($filesize >= 1048576) ? $lang['MB'] : ( ($filesize >= 1024) ? $lang['KB'] : $lang['Bytes'] );
		if ($filesize >= 1048576)
		{
			$filesize = (round((round($filesize / 1048576 * 100) / 100), 2));
		}
		else if ($filesize >= 1024)
		{
			$filesize = (round((round($filesize / 1024 * 100) / 100), 2));
		}

		$display_name = $attachments['_' . $post_id][$i]['real_filename']; 
		$comment = trim(htmlspecialchars(stripslashes($attachments['_' . $post_id][$i]['comment'])));
		$comment = str_replace("\n", '<br />', $comment);

		$attachments['_' . $post_id][$i]['extension'] = strtolower(trim($attachments['_' . $post_id][$i]['extension']));

		$denied = false;

		//
		// Admin is allowed to view forbidden Attachments, but the error-message is displayed too to inform the Admin
		//
		if ( (!in_array($attachments['_' . $post_id][$i]['extension'], $allowed_extensions)) )
		{
			$denied = true;

			$template->assign_block_vars('articles.attach.denyrow', array(
				'L_DENIED' => sprintf($lang['Extension_disabled_after_posting'], $attachments['_' . $post_id][$i]['extension']))
			);
		} 

		if (!$denied)
		{
			//
			// Some basic Template Vars
			//
			$template->assign_vars(array(
				'L_DESCRIPTION' => $lang['Description'],
				'L_DOWNLOAD' => $lang['Download'],
				'L_FILENAME' => $lang['File_name'],
				'L_FILESIZE' => $lang['Filesize'])
			);
			
			//
			// define category
			//
			$image = FALSE;
			$stream = FALSE;
			$swf = FALSE;
			$thumbnail = FALSE;
			$link = FALSE;

			if (intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == STREAM_CAT)
			{
				$stream = TRUE;
			}
			else if (intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == SWF_CAT)
			{
				$swf = TRUE;
			}
			else if ( (intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT) && (intval($attach_config['img_display_inlined'])) )
			{
				if ( (intval($attach_config['img_link_width']) != 0) || (intval($attach_config['img_link_height']) != 0) )
				{
					list($width, $height) = image_getdimension($filename);

					if ( ($width == 0) && ($height == 0) )
					{
						$image = TRUE;
					}
					else
					{
						if ( ($width <= intval($attach_config['img_link_width'])) && ($height <= intval($attach_config['img_link_height'])) )
						{
							$image = TRUE;
						}
					}
				}
				else
				{
					$image = TRUE;
				}
			}
			
			if ( (intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT) && ($attachments['_' . $post_id][$i]['thumbnail'] == 1) )
			{
				$thumbnail = TRUE;
				$image = FALSE;
			}

			if ( (!$image) && (!$stream) && (!$swf) && (!$thumbnail) )
			{
				$link = TRUE;
			}

			if ($image)
			{
				//
				// Images
				// NOTE: If you want to use the download.php everytime an image is displayed inlined, replace the
				// Section between BEGIN and END with (Without the // of course):
				//	$img_source = append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']);
				//	$download_link = TRUE;
				// 
				//
				if ((intval($attach_config['allow_ftp_upload'])) && (trim($attach_config['download_path']) == ''))
				{
					$img_source = append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']);
					$download_link = TRUE;
				}
				else
				{
					$img_source = $filename;
					$download_link = FALSE;
				}

				$template->assign_block_vars('articles.attach.cat_images', array(
					'DOWNLOAD_NAME' => $display_name,
					'S_UPLOAD_IMAGE' => $upload_image,

					'IMG_SRC' => $img_source,
					'FILESIZE' => $filesize,
					'SIZE_VAR' => $size_lang,
					'COMMENT' => $comment,
					'L_DOWNLOADED_VIEWED' => $lang['Viewed'],
					'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']))
				);

				//
				// Directly Viewed Image ... update the download count
				//
				if (!$download_link)
				{
					$sql = 'UPDATE ' . ATTACHMENTS_DESC_TABLE . ' 
					SET download_count = download_count + 1 
					WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
	
					if ( !($db->sql_query($sql)) )
					{
						message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count.', '', __LINE__, __FILE__, $sql);
					}
				}
			}
			
			if ($thumbnail)
			{
				//
				// Images, but display Thumbnail
				// NOTE: If you want to use the download.php everytime an thumnmail is displayed inlined, replace the
				// Section between BEGIN and END with (Without the // of course):
				//	$thumb_source = append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1');
				//
				if ( (intval($attach_config['allow_ftp_upload'])) && (trim($attach_config['download_path']) == '') )
				{
					$thumb_source = append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id'] . '&thumb=1');
				}
				else
				{
					$thumb_source = $thumbnail_filename;
				}
				
				$template->assign_block_vars('articles.attach.cat_thumb_images', array(
					'DOWNLOAD_NAME' => $display_name,
					'S_UPLOAD_IMAGE' => $upload_image,

					'IMG_SRC' => append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']),
					'IMG_THUMB_SRC' => $thumb_source,
					'FILESIZE' => $filesize,
					'SIZE_VAR' => $size_lang,
					'COMMENT' => $comment,
					'L_DOWNLOADED_VIEWED' => $lang['Viewed'],
					'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']))
				);
			}

			if ($stream)
			{
				//
				// Streams
				//
				$template->assign_block_vars('articles.attach.cat_stream', array(
					'U_DOWNLOAD_LINK' => $filename,
					'S_UPLOAD_IMAGE' => $upload_image,

//					'U_DOWNLOAD_LINK' => append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']),
					'DOWNLOAD_NAME' => $display_name,
					'FILESIZE' => $filesize,
					'SIZE_VAR' => $size_lang,
					'COMMENT' => $comment,
					'L_DOWNLOADED_VIEWED' => $lang['Viewed'],
					'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']))
				);

				//
				// Viewed/Heared File ... update the download count (download.php is not called here)
				//
				$sql = 'UPDATE ' . ATTACHMENTS_DESC_TABLE . ' 
				SET download_count = download_count + 1 
				WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
	
				if ( !($db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql);
				}
			}
			
			if ($swf)
			{
				//
				// Macromedia Flash Files
				//
				list($width, $height) = swf_getdimension($filename);
						
				$template->assign_block_vars('articles.attach.cat_swf', array(
					'U_DOWNLOAD_LINK' => $filename,
					'S_UPLOAD_IMAGE' => $upload_image,

					'DOWNLOAD_NAME' => $display_name,
					'FILESIZE' => $filesize,
					'SIZE_VAR' => $size_lang,
					'COMMENT' => $comment,
					'L_DOWNLOADED_VIEWED' => $lang['Viewed'],
					'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']),
					'WIDTH' => $width,
					'HEIGHT' => $height)
				);

				//
				// Viewed/Heared File ... update the download count (download.php is not called here)
				//
				$sql = 'UPDATE ' . ATTACHMENTS_DESC_TABLE . ' 
				SET download_count = download_count + 1 
				WHERE attach_id = ' . $attachments['_' . $post_id][$i]['attach_id'];
	
				if ( !($db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, 'Couldn\'t update attachment download count', '', __LINE__, __FILE__, $sql);
				}
			}

			if ($link)
			{
				$target_blank = ( (intval($display_categories[$attachments['_' . $post_id][$i]['extension']]) == IMAGE_CAT) ) ? 'target="_blank"' : '';

				//
				// display attachment
				//
				$template->assign_block_vars('articles.attach.attachrow', array(
					'U_DOWNLOAD_LINK' => append_sid('download.' . $phpEx . '?id=' . $attachments['_' . $post_id][$i]['attach_id']),
					'S_UPLOAD_IMAGE' => $upload_image,
						
					'DOWNLOAD_NAME' => $display_name,
					'FILESIZE' => $filesize,
					'SIZE_VAR' => $size_lang,
					'COMMENT' => $comment,
					'TARGET_BLANK' => $target_blank,

					'L_DOWNLOADED_VIEWED' => $lang['Downloaded'],
					'L_DOWNLOAD_COUNT' => sprintf($lang['Download_number'], $attachments['_' . $post_id][$i]['download_count']))
				);
						
			}
		}
	}
}

?>
Någon ide om vart jag ska kolla?
Bästa hälsningar - Mikael Andersson

Välkommen till: http://www.bikersite.se - Träffpunkten för svenska bikers!
dallas
Extra aktiv medlem
Extra aktiv medlem
Inlägg: 196
Blev medlem: 2005-09-03 23:07
Svar: 0

Inlägg av dallas »

jag sökte på

Kod: Markera allt

<br
där fanns två ställen, inte en aning om det hjälper med dom

dallas
Skriv svar

Vilka är online

Användare som besöker denna kategori: 2 och 0 gäster