Prova così
Codice PHP:
<?php
define('IN_ICYPHOENIX', true);
if (!defined('IP_ROOT_PATH')) define('IP_ROOT_PATH', './');
if (!defined('PHP_EXT')) define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1));
include(IP_ROOT_PATH . 'common.' . PHP_EXT);
include(IP_ROOT_PATH . 'language/lang_' . $board_config['default_lang'] . '/lang_banners.' . PHP_EXT);
// Start session management
$userdata = session_pagestart($user_ip);
init_userprefs($userdata);
// End session management
$template->set_filenames(array('body' => 'banners_body.tpl'));
$path_banners = './';
$path = $_SERVER['REQUEST_URI'];
switch($_GET['size']) {
default:
$select_size = $lang['Select_Size'];
message_die(GENERAL_MESSAGE, $select_size);
break;
case '120x60':
$dir = $path_banners . 'linkaci/120x60/';
$size_view = '120x60';
break;
case '88x31':
$dir = $path_banners . 'linkaci/88x31/';
$size_view = '88x31';
}
if ($_GET['size'] == '') {
$select_size = $lang['Select_Size'];
message_die(GENERAL_MESSAGE, $select_size);
}
elseif ($dir_handle = @opendir($dir) or die("Non riesco ad aprire $dir")) {
$T_ID=0;
while (false !== ($file = readdir($dir_handle))) {
if ($file != "." && $file != "..") {
$image = '<img src="' . $dir . $file . '" />';
$size_image = filesize($dir . $file);
$last_edit_file_time = filemtime($dir . $file);
$bbcode_code = '[url=' . $path . '][img]' . $dir . $file . '[/img][/url]';
$html_code = '<a href="' . $path . '" title="Making Art.org">' . $image . '</a>';
$direct_code = $dir . $file;
$template->assign_block_vars('image', array(
'SIZE_VIEW' => $size_view,
'SIZE_IMAGE' => $size_image,
'LAST_EDIT_FILE_TIME' => date("j/m/Y h:i", $last_edit_file_time),
'IMAGE' => $image,
'BBCODE_CODE' => $bbcode_code,
'HTML_CODE' => $html_code,
'DIRECT_CODE' => $direct_code,
'TEXTAREA_ID' => $T_ID
)
);
$T_ID++;
}
}
}
// Start output of page
$page_title = $size_view;
$meta_description = '';
$meta_keywords = '';
//define('SHOW_ONLINE', true);
include(IP_ROOT_PATH . 'includes/page_header.' . PHP_EXT);
//parse and build page
$template->pparse('body');
//include the phpBB footer
include(IP_ROOT_PATH . 'includes/page_tail.' . PHP_EXT);
?>
template
Codice:
{IMG_THL}{IMG_THC}
<!-- BEGIN image -->
<span class="forumlink">{image.SIZE_VIEW}</span>{IMG_THR}<table class="forumlinenb" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<table width="100%">
<tr>
<td align="center" width="50%">{image.IMAGE}</td>
<td align="left" width="50%">
<span class="generation">{image.SIZE_IMAGE} Byte<br />
Caricato il : {image.LAST_EDIT_FILE_TIME}</span><br />
</td>
</tr>
</table>
<table>
<tr align="left">
<td width="50"><label for="{image.TEXTAREA_ID}" class="post-details" style="cursor:pointer;" title="{L_SELECT_BANNER_CODE_HTML}"><b>HTML:</b></label></td>
<td width="100%">
<form name="select_all">
<textarea readonly="readonly" style="width:100%;height:30px;" name="{image.TEXTAREA_ID}" onClick="javascript:this.form.{image.TEXTAREA_ID}.focus();this.form.{image.TEXTAREA_ID}.select();" class="generation">{image.HTML_CODE}</textarea>
</form>
</td>
</tr>
<tr align="left">
<td width="50"><label for="{image.TEXTAREA_ID}" class="post-details" style="cursor:pointer;" title="{L_SELECT_BANNER_CODE_BBCODE}"><b>BBCode:</b></label></td>
<td width="100%">
<form name="select_all">
<textarea readonly="readonly" style="width:100%;height:30px;" name="{image.TEXTAREA_ID}" onClick="javascript:this.form.{image.TEXTAREA_ID}.focus();this.form.{image.TEXTAREA_ID}.select();" class="generation">{image.BBCODE_CODE}</textarea>
</form>
</td>
</tr>
<tr align="left">
<td width="50"><label for="{image.TEXTAREA_ID}" class="post-details" style="cursor:pointer;" title="{L_SELECT_BANNER_CODE_URL}"><b>Url:</b></label></td>
<td width="100%">
<form name="select_all">
<textarea readonly="readonly" style="width:100%;height:15px;" name="{image.TEXTAREA_ID}" onClick="javascript:this.form.{image.TEXTAREA_ID}.focus();this.form.{image.TEXTAREA_ID}.select();" class="generation">{image.DIRECT_CODE}</textarea>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- END image -->
{IMG_TFL}{IMG_TFC}{IMG_TFR}