Grafisch probleem met Advanced Links Mod
Geplaatst: 02 aug 2005, 23:02
Ik maak gebruik van deze mod:
De mod werkt gewoon goed, niets mis mee.
Op mijn portal komen de banners ook keurig voorbij:

Er zijn 6 kleine dingen die mij niet lukken om aan te passen:
links_js.php
portal_body.tpl
Code: Selecteer alles
## MOD Title: Advanced Links Mod
## MOD Author: stefan2k1 < sp@phpbb2.de > (Stefan Paulus) http://www.phpbb2.de
## CRLin (Demo 1: http://mail.dhjh.tcc.edu.tw/~gzqbyr/Hestia/links.php)
## (Demo 2: http://mail.dhjh.tcc.edu.tw/~gzqbyr/phpBB/links.php)
## MOD Description: Display links (with logo) on the forum index page.
## MOD Version: 1.2.2
Op mijn portal komen de banners ook keurig voorbij:
Er zijn 6 kleine dingen die mij niet lukken om aan te passen:
- de witte achtergrond moet 'row1' zijn
- ik wil de banners ook verticaal centreren
- waar kan ik de snelheid van rotatie instellen?
- op welke manier krijg ik de banners keurig over de lengte van de tabel verdeeld
- de ruimte tussen de url 'link' en de tabelrand is veel kleiner dan elders op de portal
- is het mogelijk om alleen 1 catagorie te laten zien?
Code: Selecteer alles
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={S_CONTENT_ENCODING}">
</head>
<body style="margin-top:0px;margin-left:0px;background-color:{T_BODY_BGCOLOR}">
<script language="JavaScript">
<!--
var linkrow = new Array({LINKS_LOGO});
var interval = {DISPLAY_INTERVAL};
var link_start = 0;
var link_num = {DISPLAY_LOGO_NUM};
document.write('<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center"><div id="links"></div></td></tr></table>');
function writeDiv(){
var link_innerHTML = '';
if(linkrow.length > link_num)
{
for(var i=0; i<link_num; i++)
{
link_innerHTML += linkrow[(i + link_start) % linkrow.length];
}
document.all.links.innerHTML=link_innerHTML;
(link_start < linkrow.length - 1) ? link_start ++ : link_start = 0;
setTimeout("writeDiv()",interval);
}
else
{
for(var j=0; j<linkrow.length; j++)
{
link_innerHTML += linkrow[j];
}
document.all.links.innerHTML=link_innerHTML;
}
}
writeDiv();
// -->
</script>
</body>
</html>
Code: Selecteer alles
define('IN_PHPBB', true);
$phpbb_root_path = "./";
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . "common.$phpEx");
//
// gzip_compression
//
$do_gzip_compress = FALSE;
if($board_config['gzip_compress'])
{
$phpver = phpversion();
if($phpver >= "4.0.4pl1")
{
if(extension_loaded("zlib"))
{
ob_start("ob_gzhandler");
}
}
else if($phpver > "4.0")
{
if(strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip'))
{
if(extension_loaded("zlib"))
{
$do_gzip_compress = TRUE;
ob_start();
ob_implicit_flush(0);
header("Content-Encoding: gzip");
}
}
}
}
header ("Cache-Control: no-store, no-cache, must-revalidate");
header ("Cache-Control: pre-check=0, post-check=0, max-age=0", false);
header ("Pragma: no-cache");
header ("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
$template->set_filenames(array(
'body' => "links_js_body.tpl"
));
//
// Grab data
//
$sql = "SELECT *
FROM ". LINK_CONFIG_TABLE;
if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Could not query Link config information", "", __LINE__, __FILE__, $sql);
}
while( $row = $db->sql_fetchrow($result) )
{
$link_config_name = $row['config_name'];
$link_config_value = $row['config_value'];
$link_config[$link_config_name] = $link_config_value;
$link_self_img = $link_config['site_logo'];
$site_logo_height = $link_config['height'];
$site_logo_width = $link_config['width'];
$display_interval = $link_config['display_interval'];
$display_logo_num = $link_config['display_logo_num'];
}
$sql = "SELECT link_id, link_title, link_logo_src
FROM " . LINKS_TABLE . "
WHERE link_active = 1
ORDER BY link_hits DESC";
// If failed just ignore
if( $result = $db->sql_query($sql) )
{
$links_logo = "";
while($row = $db->sql_fetchrow($result))
{
//if (empty($row['link_logo_src'])) $row['link_logo_src'] = 'images/logo_modelautoforumnl.gif';
if ($row['link_logo_src']) {
$links_logo .= ('\'<a href="' . append_sid("links.$phpEx?action=go&link_id=" . $row['link_id']) . '" target="_blank"><img src="' . $row['link_logo_src'] . '" alt="' . $row['link_title'] . '" width="' . $site_logo_width . '" height="' . $site_logo_height . '" border="0" /></a>\',' . "\n");
}
}
if ($links_logo) {
$links_logo = substr($links_logo, 0, -2);
$template->assign_vars(array(
'S_CONTENT_ENCODING' => $lang['ENCODING'],
'T_BODY_BGCOLOR' => '#'.$theme['td_color1'],
'DISPLAY_INTERVAL' => $display_interval,
'DISPLAY_LOGO_NUM' => $display_logo_num,
'LINKS_LOGO' => $links_logo
));
}
}
$template->pparse("body");
$db->sql_close();
//
// Compress buffered output if required
// and send to browser
//
if($do_gzip_compress)
{
//
// Borrowed from php.net!
//
$gzip_contents = ob_get_contents();
ob_end_clean();
$gzip_size = strlen($gzip_contents);
$gzip_crc = crc32($gzip_contents);
$gzip_contents = gzcompress($gzip_contents, 9);
$gzip_contents = substr($gzip_contents, 0, strlen($gzip_contents) - 4);
echo "\x1f\x8b\x08\x00\x00\x00\x00\x00";
echo $gzip_contents;
echo pack("V", $gzip_crc);
echo pack("V", $gzip_size);
}
exit;
Code: Selecteer alles
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="forumline">
<tr>
<th height=25 colspan="2" class="thHead">{L_LINKS}</th>
</tr>
<tr>
<td class="row1" nowrap="nowrap"><iframe marginwidth="0" marginheight="0" src="{U_LINKS_JS}" frameborder="0" scrolling="no" width="100%" height="70"></iframe></td>
</tr>
<tr>
<td class="row1" align="center"><span class="gensmall"><a href="{U_LINKS}"/>{L_LINKS}</a></span></td>
</tr>
</table>