SuperUnknown wrote:Is it possible to display "news" on the portal page with the image ? (taken from the first attachment)
Something like in this example:
http://www.samanyolufanlari.com/index.php
But I'm using a subsilver based style.
thx
AFAIK in the PHPBB2 ezPortal that was realized by this part of code:
portal.php
Code: Select all
// Portal Attachment image by Crack
if ( defined('ATTACHMENTS_ON') && $fetchposts[$i]['post_attachment'] )
{
$attachments = get_attachments_from_post($fetchposts[$i]['post_id']);
foreach( $attachments as $attachment )
{
if( strpos($attachment['mimetype'], 'image') !== false )
{
if( intval($attach_config['allow_ftp_upload']) && !$attachment['thumbnail'] )
{
if( trim($attach_config['download_path']) == '' )
{
message_die(GENERAL_ERROR, 'Physical Download not possible with the current Attachment Setting');
}
$img_path = trim($attach_config['download_path']) . '/' . $attachment['physical_filename'];
}
else
{
$server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
$server_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['server_name']));
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : '';
$script_name = preg_replace('/^\/?(.*?)\/?$/', '/\1', trim($board_config['script_path']));
if ($script_name[strlen($script_name)] != '/')
{
$script_name .= '/';
}
$image_path = $server_protocol . $server_name . $server_port . $script_name . $upload_dir . '/'
. ( $attachment['thumbnail'] ? 'thumbs/t_' : '')
. $attachment['physical_filename'];
}
$img_size = array(200, 0); // szerokość, wysokość
if( $attachment['comment'] && preg_match('#(\d+)x(\d+)#', $attachment['comment'], $match) )
{
$img_size = array(intval($match[1]), intval($match[2]));
}
$img_size = ( $img_size[0] ? 'width="' . $img_size[0] . '" ' : '' )
. ( $img_size[1] ? 'heigh="' . $img_size[1] . '" ' : '' );
$image = '<img ' . $img_size . 'src="' . $image_path
. '" alt="' . htmlspecialchars($attachment['comment'])
. '" style="border:0px" />';
if( $attachment['thumbnail'] )
{
$image = '<a href="'. append_sid("download.$phpEx?id=".$attachment['attach_id'])
. '" target="_blank">' . $image . '</a>';
}
$template->assign_block_vars('fetchpost_row.image', array(
'IMAGE' => $image,
'COMMENT' => htmlspecialchars($attachment['comment']) )
);
break;
}
}
} // Attachment image end
portal_body.tpl
Code: Select all
{BEGIN_NEWS}
<table width="99%" cellspacing="1" cellpadding="1" border="0" align="center">
<tr>
<td>
{NEWS_HEADER}
<!-- BEGIN fetchpost_row -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<td class="catHead" height="25"><span class="genmed"><b>{fetchpost_row.TITLE}</b></span></td>
</tr>
<tr>
<td class="row2" align="left" height="24"><span class="gensmall">{L_POSTED}: <b>{fetchpost_row.POSTER}</b> @ {fetchpost_row.TIME}</span></td>
</tr>
<tr>
<td class="row1" align="left"><span class="gensmall" style="line-height:150%">
<!-- BEGIN image -->
<div style="float:left; border: 1px {T_TR_COLOR3} solid; margin:5px">{fetchpost_row.image.IMAGE}</div>
<!-- END image -->
{fetchpost_row.TEXT}<br /><br />
{fetchpost_row.OPEN}<a href="{fetchpost_row.U_READ_FULL}">{fetchpost_row.L_READ_FULL}</a>{fetchpost_row.CLOSE}
</span></td>
</tr>
<tr>
<td class="row3" align="left" height="24"><span class="gensmall">{L_COMMENTS}: {fetchpost_row.REPLIES} :: <a href="{fetchpost_row.U_VIEW_COMMENTS}">{L_VIEW_COMMENTS}</a> (<a href="{fetchpost_row.U_POST_COMMENT}">{L_POST_COMMENT}</a>)</span></td>
</tr>
</table>
<font size="1"><br /></font>
<!-- END fetch_post_row -->
</td>
</tr>
</table>
{END_NEWS}
It is possible to change this code for a working function in EasyPortal for PHPBB3 (subsilver)?
Additional interesting code can be find here (for example resizing):
http://4seven.kilu.de/phpbb3/index.php? ... 1024&h=768