Topic: problems with making a home page using punbb styles
Hi,
Thanks to Connohrd's excellent work (but not corresponding to what I want), I'm trying to make my home page looks like my punbb forum.
I've got several problems, so if somebody can help me... This is the page I'm building: http://www.pluriservices.net/test3.php
First problem:
I can't understand why there is no space between differents blocks, between Menu1 and Menu2 for example, and between every other blocks.
Second problem:
I've got a big problem with the navlink. My forum is installed in /forum. My home page is at the root. So the generated links in my home page are not correctly generated. I miss /forum in the generated links. Is there a simple solution to solve this?
Third problem:
I'm using floating images code that code xp wrote (http://punbb.org/forums/viewtopic.php?pid=37484#p37484). This code works good with ie. But with firefox, pictures are not well displayed. Have a look at the page, you'll see there is a problem.
Last problem:
The footer is not 100% width though I want it to be. Also, there is no space before the footer.
When I will have solved these problems (I hope I'll be able to), I will release the index page I build and the modifications I made.
This is the code of my page:
<?php
define('PUN_ROOT', 'forum/');
define('PUN_QUIET_VISIT', 1);
require ($_SERVER['HTTP_RACINE'] . '/forum/include/common.php');
$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
define('PUN_ALLOW_INDEX', 1);
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
exit;
// Send no-cache headers
header('Expires: Thu, 21 Jul 1977 07:30:00 GMT'); // When yours truly first set eyes on this world! :)
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); // For HTTP/1.0 compability
// Load the template
if (defined('PUN_ADMIN_CONSOLE'))
$tpl_main = file_get_contents($_SERVER['HTTP_RACINE'] . '/forum/include/template/admin.tpl');
else if (defined('PUN_HELP'))
$tpl_main = file_get_contents($_SERVER['HTTP_RACINE'] . '/forum/include/template/help.tpl');
else
$tpl_main = file_get_contents($_SERVER['HTTP_RACINE'] . '/forum/include/template/main.tpl');
// START SUBST - <pun_content_direction>
$tpl_main = str_replace('<pun_content_direction>', $lang_common['lang_direction'], $tpl_main);
// END SUBST - <pun_content_direction>
// START SUBST - <pun_char_encoding>
$tpl_main = str_replace('<pun_char_encoding>', $lang_common['lang_encoding'], $tpl_main);
// END SUBST - <pun_char_encoding>
// START SUBST - <pun_head>
ob_start();
// Is this a page that we want search index spiders to index?
if (!defined('PUN_ALLOW_INDEX'))
echo '<meta name="ROBOTS" content="NOINDEX, FOLLOW" />'."\n";
?>
<title>Pluriservices.net</title>
<link rel="stylesheet" type="text/css" href="http://www.pluriservices.net/forum/style/<?php echo $pun_user['style'].'.css'
?>" />
<?php
if (defined('PUN_ADMIN_CONSOLE'))
echo '<link rel="stylesheet" type="text/css"
href="http://www.pluriservices.net/forum/forum/style/imports/base_admin.css" />'."\n";
if (isset($destination_url))
echo '<meta http-equiv="refresh" content="'.$delay.';URL='.$destination.'" />'."\n";
else if (isset($required_fields))
{
// Output JavaScript to validate form (make sure required fields are filled out)
?>
<script type="text/javascript">
<!--
function process_form(the_form)
{
var element_names = new Object()
<?php
// Output a JavaScript array with localised field names
while (list($elem_orig, $elem_trans) = @each($required_fields))
echo "\t".'element_names["'.$elem_orig.'"] = "'.addslashes(str_replace(' ', ' ', $elem_trans)).'"'."\n";
?>
if (document.all || document.getElementById)
{
for (i = 0; i < the_form.length; ++i)
{
var elem = the_form.elements[i]
if (elem.name && elem.name.substring(0, 4) == "req_")
{
if (elem.type && (elem.type=="text" || elem.type=="textarea" || elem.type=="password" ||
elem.type=="file") && elem.value=='')
{
alert("\"" + element_names[elem.name] + "\" <?php echo $lang_common['required field']
?>")
elem.focus()
return false
}
}
}
}
return true
}
// -->
</script>
<?php
}
$user_agent = isset($_SERVER['HTTP_USER_AGENT']) ? strtolower($_SERVER['HTTP_USER_AGENT']) : '';
if (strpos($user_agent, 'msie') !== false && strpos($user_agent, 'windows') !== false && strpos($user_agent, 'opera') ===
false)
echo '<script type="text/javascript" src="style/imports/minmax.js"></script>';
$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<pun_head>', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <pun_head>
// START SUBST - <body>
if (isset($focus_element))
{
$tpl_main = str_replace('<body onload="', '<body
onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main);
$tpl_main = str_replace('<body>', '<body
onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus()">', $tpl_main);
}
// END SUBST - <body>
// START SUBST - <pun_page>
$tpl_main = str_replace('<pun_page>', basename($_SERVER['PHP_SELF'], '.php'), $tpl_main);
// END SUBST - <pun_title>
// START SUBST - <pun_title>
$tpl_main = str_replace('<pun_title>', '<h1><span>'.pun_htmlspecialchars($pun_config['o_board_title']).'</span></h1>',
$tpl_main);
// END SUBST - <pun_title>
// START SUBST - <pun_desc>
$tpl_main = str_replace('<pun_desc>', '<p><span>'.$pun_config['o_board_desc'].'</span></p>', $tpl_main);
// END SUBST - <pun_desc>
// START SUBST - <pun_navlinks>
$tpl_main = str_replace('<pun_navlinks>','<div id="brdmenu" class="inbox">'."\n\t\t\t".
generate_navlinks()."\n\t\t".'</div>', $tpl_main);
// END SUBST - <pun_navlinks>
// START SUBST - <pun_status>
if ($pun_user['is_guest'])
$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<p>'.$lang_common['Not logged
in'].'</p>'."\n\t\t".'</div>';
else
{
$tpl_temp = '<div id="brdwelcome" class="inbox">'."\n\t\t\t".'<ul
class="conl">'."\n\t\t\t\t".'<li>'.$lang_common['Logged in as'].'
<strong>'.pun_htmlspecialchars($pun_user['username']).'</strong></li>'."\n\t\t\t\t".'<li>'.$lang_common['Last visit'].':
'.format_time($pun_user['last_visit']).'</li>';
if ($pun_user['g_id'] < PUN_GUEST)
{
$result_header = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'reports WHERE zapped IS NULL') or
error('Unable to fetch reports info', __FILE__, __LINE__, $db->error());
if ($db->result($result_header))
$tpl_temp .= "\n\t\t\t\t".'<li class="reportlink"><strong><a href="admin_reports.php">There are new
reports</a></strong></li>';
if ($pun_config['o_maintenance'] == '1')
$tpl_temp .= "\n\t\t\t\t".'<li class="maintenancelink"><strong><a
href="admin_options.php#maintenance">Maintenance mode is enabled!</a></strong></li>';
}
if (in_array(basename($_SERVER['PHP_SELF']), array('index.php', 'search.php')))
$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<ul class="conr">'."\n\t\t\t\t".'<li><a
href="search.php?action=show_new">'.$lang_common['Show new posts'].'</a></li>'."\n\t\t\t\t".'<li><a
href="misc.php?action=markread">'.$lang_common['Mark all as read'].'</a></li>'."\n\t\t\t".'</ul>'."\n\t\t\t".'<div
class="clearer"></div>'."\n\t\t".'</div>';
else
$tpl_temp .= "\n\t\t\t".'</ul>'."\n\t\t\t".'<div class="clearer"></div>'."\n\t\t".'</div>';
}
$tpl_main = str_replace('<pun_status>', $tpl_temp, $tpl_main);
// END SUBST - <pun_status>
?>
<?php
// START SUBST - <pun_main>
ob_start();
define('PUN_HEADER', 1);
require PUN_ROOT.'include/parser.php';
?>
<div id="adminconsole" class="block2col">
<div id="adminmenu" class="blockmenu">
<h2><span>Menu 1</span></h2>
<div class="box">
<div class="inbox">
<ul>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
</ul>
</div>
</div>
<h2><span>Menu 2</span></h2>
<div class="box">
<div class="inbox">
<ul>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
<li><a href="Test">Test</a></li>
</ul>
</div>
</div>
</div>
<?php
include($_SERVER['HTTP_RACINE'] . '/forum/plugins/AMP_News_Generator/news.html');
?>
<?php
require PUN_ROOT.'footer.php';
?>
Thanks everybody for the help.
Ludo,