You are not logged in.
- Topics: Active | Unanswered
#1 2010-02-26 04:37:25
- quaker
- Member

- From: USA
- Registered: 2008-05-09
- Posts: 80
- Website
frontpage portal for 1.4
I have started working on a portal page for 1.4.. I might have it done soon...hehe..
Q
My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!
Offline
#2 2010-02-26 04:48:57
- quaker
- Member

- From: USA
- Registered: 2008-05-09
- Posts: 80
- Website
Re: frontpage portal for 1.4
This is my Demo Site
http://huntsvillerocket.com/forum/index.php
Ok here goes..
1. Name this portal.tpl in the include/template!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<pun_language>" lang="<pun_language>" dir="<pun_content_direction>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
#left {
width: 140px;
float: left;
}
#main {
margin-left: 150px;
}
#container {
width: 100%;
float: right;
margin-left: -140px;
}
</style>
<pun_head>
</head>
<body>
<div id="punwrap">
<div id="pun<pun_page>" class="pun">
<div id="brdheader" class="block">
<div class="box">
<div id="brdtitle" class="inbox">
<pun_title>
<pun_desc>
</div>
<pun_navlinks>
<pun_status>
</div>
</div>
<div id="container">
<div id="main">
<pun_announcement>
<pun_main>
</div>
</div>
<div id="left">
<!-- block-->
<div class="block">
<h2><span>Junk</span></h2>
<div class="box">
<div class="inbox">
your code Here
</div>
</div>
</div>
<!-- block end-->
</div>
<div class="clearer"></div>
<pun_footer>
</div>
</div>
</body>
</html>2. Now open header.php and add after line 38.
else if (defined('PUN_PORTAL'))
{
if (file_exists(PUN_ROOT.'style/'.$pun_user['style'].'/portal.tpl'))
$tpl_file = PUN_ROOT.'style/'.$pun_user['style'].'/portal.tpl';
else
$tpl_file = PUN_ROOT.'include/template/portal.tpl';
}3. Now rename index.php to forum.php
4. Now open notepad and paste this into the file and save it to index.php *** please make sure you backup your index.php or rename a copy to index1.php***
<?php
define('PUN_PORTAL', 1);
define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
function pun_news($fid='', $show=15, $truncate=1)
{
global $lang_common, $db, $pun_config, $db_prefix;
$max_subject_length = 30;
$show_max_topics = 50;
$fid = intval($fid);
$order_by = 't.posted';
$forum_sql = '';
// Was a forum ID supplied?
if ( $fid ) $forum_sql = 'f.id='.$fid.' AND ';
$show = intval($show);
if ($show < 1 || $show > $show_max_topics)
$show = 15;
$saveddate="";
// Fetch $show topics
$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, f.id AS fid, f.forum_name FROM '.$db_prefix.'topics AS t INNER JOIN '.$db_prefix.'forums AS f ON t.forum_id=f.id WHERE f.id='.$fid.' AND t.moved_to IS NULL ORDER BY '.$order_by.' DESC') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
$show_count = 0;
if ( !$db->num_rows($result) ) return $output;
while ( ($show_count < $show) && ($cur_topic = $db->fetch_assoc($result)) ) {
$temp = '';
if ($pun_config['o_censoring'] == '1')
$cur_topic['subject'] = censor_words($cur_topic['subject']);
if (pun_strlen($cur_topic['subject']) > $max_subject_length)
$subject_truncated = trim(substr($cur_topic['subject'], 0, ($max_subject_length-5))).' ...';
else
$subject_truncated = $cur_topic['subject'];
$newsheading = '<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.pun_htmlspecialchars($subject_truncated).'</a> - <em>Posted by '.$cur_topic['poster'].' at '.date('h:i A', $cur_topic['posted']).'</em><br>';
// Group posts by date
$thisdate = date('l, d F Y', $cur_topic['posted']);
if ($thisdate != $saveddate)
{
if ($saveddate)
{
$temp .= "</div></div>";
}
$temp .= '<div class="block"><h2><span>'.$thisdate.'</span></h2><div class="box"><div class="inbox"><p>';
$saveddate = $thisdate;
}
else {
$temp .= '<div class="inbox"><p>';
}
$temp .= $newsheading.'</p><p>';
$id = $cur_topic['id'];
$msg = $db->query('SELECT id, poster, poster_id, poster_ip, poster_email, message, posted, edited, edited_by FROM '.$db_prefix.'posts WHERE topic_id='.$id.' LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
if ( !$db->num_rows($msg) ) continue;
$cur_post = $db->fetch_assoc($msg);
// Display first paragraph only (comment out next four lines to turn off)
if ($truncate == 1)
{
$paragraph = preg_split("/s*n+/", $cur_post['message']);
if (isset($paragraph[1])) {
$cur_post['message'] = $paragraph[0] . "...";
}
}
$cur_post['message'] = parse_message($cur_post['message'], 0);
$temp .= $cur_post['message'];
$temp .= "</p></div>";
if (isset($output)) {
$output .= $temp;
}
else {
$output = $temp;
}
++$show_count;
} // end of while
$output .= "</div></div>";
return $output;
}
?>
<div class="block">
<h2><span>Welcome</span></h2>
<div class="box">
<div class="inbox">
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent augue. Nulla facilisi. Fusce bibendum accumsan erat. Quisque sollicitudin mattis neque. Sed dapibus. Integer a lectus eu sem consequat pellentesque. Morbi rhoncus nulla. Duis adipiscing interdum velit. Fusce ante. Ut vitae enim sit amet magna sodales hendrerit. In sed tortor at sapien convallis eleifend. Proin mauris. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut metus. Cras ac arcu et arcu porttitor blandit. Nam vitae lectus eget mauris sollicitudin placerat. Suspendisse vestibulum. Donec varius libero. Duis velit tellus, euismod vitae, consequat sed, consectetuer ut, purus.
</p>
<p>
Praesent viverra venenatis magna. Etiam in dolor. Ut in justo ac nibh malesuada cursus. Duis urna arcu, aliquam vitae, consequat nec, tincidunt non, mi. Nunc lobortis. Nunc pharetra. Sed porttitor. Maecenas turpis tortor, blandit nec, dignissim in, porttitor eu, odio. In hac habitasse platea dictumst. Suspendisse augue odio, ornare a, elementum ac, tincidunt varius, orci. Nulla libero ante, hendrerit ac, consectetuer eu, sollicitudin et, eros. Duis sapien. Suspendisse ornare enim sit amet dui. Donec ullamcorper diam.
</p>
</div>
</div>
</div>
<?php
echo pun_news(1, 5, 0);
require PUN_ROOT.'footer.php';That should be simple enough and quick took me like 5 mins to figure out the new header codes.... and make it work...
Q
My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!
Offline
#3 2010-02-26 04:55:59
- quaker
- Member

- From: USA
- Registered: 2008-05-09
- Posts: 80
- Website
Re: frontpage portal for 1.4
ops and don't forget to put a link in the admin area to the forum
1 = <a href="forum.php">Forum</a> My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!
Offline
#4 2010-02-26 12:54:59
- Ledo
- Member

- Registered: 2008-05-10
- Posts: 215
Re: frontpage portal for 1.4
I will try it in the future. But i looked at demo. And it looks good.
Offline
#5 2010-02-26 14:49:31
- quaker
- Member

- From: USA
- Registered: 2008-05-09
- Posts: 80
- Website
Re: frontpage portal for 1.4
one thing that i have noticed.. i used an old index to create the frontpage. the truncate is not working.. any suggestion?
Q
My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!
Offline
#6 2010-02-26 15:33:26
- Rob2
- Member

- From: France
- Registered: 2008-05-28
- Posts: 22
- Website
Re: frontpage portal for 1.4
It seems to be much inspired from http://www.punbb.fr/aide/doku.php/miniportal... ![]()
Offline
#7 2010-02-26 16:30:31
- quaker
- Member

- From: USA
- Registered: 2008-05-09
- Posts: 80
- Website
Re: frontpage portal for 1.4
Rob2, I think that I would have to agree with you there....
Q
My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!
Offline
#8 2010-02-26 17:52:03
- Franz
- Lead developer

- From: Germany
- Registered: 2008-05-13
- Posts: 4,072
- Website
Re: frontpage portal for 1.4
It seems to be much inspired from http://www.punbb.fr/aide/doku.php/miniportal...
Which is inspired by the old PunRes Wiki entry, I believe ![]()
Offline
#9 2010-02-26 17:54:34
- quaker
- Member

- From: USA
- Registered: 2008-05-09
- Posts: 80
- Website
Re: frontpage portal for 1.4
lie, you are correct.. mark and i and a few other people created a monster of a frontpage mod..
My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!
Offline
#10 2010-02-27 00:50:44
- qie
- Member

- Registered: 2008-06-02
- Posts: 376
Offline
#11 2010-10-20 16:08:05
- IGuardian
- Member
- Registered: 2010-10-20
- Posts: 16
Re: frontpage portal for 1.4
Im getting a ton of errors in the tile bar:s
http://www.iguardians.co.uk/
And it dies if i try to add this bit:
else if (defined('PUN_PORTAL'))
{
if (file_exists(PUN_ROOT.'style/'.$pun_user['style'].'/portal.tpl'))
$tpl_file = PUN_ROOT.'style/'.$pun_user['style'].'/portal.tpl';
else
$tpl_file = PUN_ROOT.'include/template/portal.tpl';
}
atm whats there is just the index.php
Please help:s
Offline
#13 2010-10-20 16:59:14
- IGuardian
- Member
- Registered: 2010-10-20
- Posts: 16
Re: frontpage portal for 1.4
Parse error: syntax error, unexpected T_ELSE in /var/www/vhosts/iguardians.co.uk/httpdocs/header.php on line 39
Offline
#14 2010-10-20 21:18:20
- Franz
- Lead developer

- From: Germany
- Registered: 2008-05-13
- Posts: 4,072
- Website
Re: frontpage portal for 1.4
That means you added that block at the wrong position (probably not your fault, I guess the line numbers are off). Could you post the code, please (maybe 20+ lines around the position where you have to add that block - please mark it).
Offline
#15 2010-10-20 21:37:23
- IGuardian
- Member
- Registered: 2010-10-20
- Posts: 16
Re: frontpage portal for 1.4
My header.php:
http://pastebin.com/CwBDC6tv
and on the index page im getting:
<meta property="og:title" content="<br />
<b>Warning</b>: array_reverse() [<a href='function.array-reverse'>function.array-reverse</a>]: The argument should be an array in <b>/var/www/vhosts/iguardians.co.uk/httpdocs/include/functions.php</b> on line <b>547</b><br />
<br />
<b>Warning</b>: implode() [<a href='function.implode'>function.implode</a>]: Bad arguments. in <b>/var/www/vhosts/iguardians.co.uk/httpdocs/include/functions.php</b> on line <b>552</b><br />
"/>
<meta property="og:site_name" content="Internet Guardians"/>
<title><br />
<b>Warning</b>: array_reverse() [<a href='function.array-reverse'>function.array-reverse</a>]: The argument should be an array in <b>/var/www/vhosts/iguardians.co.uk/httpdocs/include/functions.php</b> on line <b>547</b><br />
<br />
<b>Warning</b>: implode() [<a href='function.implode'>function.implode</a>]: Bad arguments. in <b>/var/www/vhosts/iguardians.co.uk/httpdocs/include/functions.php</b> on line <b>552</b><br />
</title>
<link rel="stylesheet" type="text/css" href="style/Air.css" />
<!--[if lte IE 6]><script type="text/javascript" src="style/imports/minmax.js"></script><![endif]-->
<link rel="stylesheet" type="text/css" href="style/imports/pms.css" />
</head>
http://www.iguardians.co.uk/index.php
And thanks so far for your help, its appreciated.
Last edited by IGuardian (2010-10-20 21:38:20)
Offline
#16 2010-10-20 22:56:46
- MattF
- Member

- From: South Yorkshire, England
- Registered: 2008-05-06
- Posts: 1,230
- Website
Re: frontpage portal for 1.4
That's something to do with the generate_page_title() function, I believe. (Might be worthwhile posting a bug report thread on that matter too, as it should set a default). Not sure what will need altering in the script to keep that one happy. You might want to try this though:
http://gxcr.org/fluxbb/frontpage.txt
Example here:
http://gxcr.org/fluxbb/frontpage.php
There was a lot of unnecessary cruft in that original code. Still not perfect, (I'm a bit rusty with the Flux codebase), but that tidied version linked to above should be a bit perkier.
Last edited by MattF (2010-10-20 23:13:01)
Screw the chavs and God save the Queen!
Offline
#17 2010-10-21 11:52:03
- IGuardian
- Member
- Registered: 2010-10-20
- Posts: 16
Re: frontpage portal for 1.4
I posted the code from frontpage.txt into a file and named it testindex.php and i have the same problem:
Offline
#18 2010-10-21 12:53:17
- Titlefight
- Member
- Registered: 2010-09-26
- Posts: 24
Re: frontpage portal for 1.4
$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']));Try replacing what you have for $page_title with the above in your index.php file. This is what I use for my index in particular. I remember running into this problem as well.
Though, I'm not sure if I happened to change anything else in order to get it to function properly. Let me know what this line of code does for you.
Last edited by Titlefight (2010-10-21 12:54:36)
Offline
#19 2010-10-21 17:53:50
- MattF
- Member

- From: South Yorkshire, England
- Registered: 2008-05-06
- Posts: 1,230
- Website
Re: frontpage portal for 1.4
That sorts it cheers.
I've updated that textfile with Titlefight's change.
Screw the chavs and God save the Queen!
Offline
#20 2010-10-21 18:24:23
- IGuardian
- Member
- Registered: 2010-10-20
- Posts: 16
Re: frontpage portal for 1.4
the ton of errors in the tile bar is fixed after changing it to
$page_title = array(pun_htmlspecialchars($pun_config['o_board_title']));
however it still dies if i put this in:
else if (defined('PUN_PORTAL'))
{
if (file_exists(PUN_ROOT.'style/'.$pun_user['style'].'/portal.tpl'))
$tpl_file = PUN_ROOT.'style/'.$pun_user['style'].'/portal.tpl';
else
$tpl_file = PUN_ROOT.'include/template/portal.tpl';
}
it gives the following error:
Parse error: syntax error, unexpected T_ELSE in /var/www/vhosts/iguardians.co.uk/httpdocs/header.php on line 39
Current header.php file:
http://pastebin.com/cMMMvBJ1
Last edited by IGuardian (2010-10-21 18:25:53)
Offline
#21 2010-10-21 18:27:20
- Franz
- Lead developer

- From: Germany
- Registered: 2008-05-13
- Posts: 4,072
- Website
Offline
#22 2010-10-21 18:35:38
- IGuardian
- Member
- Registered: 2010-10-20
- Posts: 16
Re: frontpage portal for 1.4
now im getting:
Warning: file_get_contents() [function.file-get-contents]: Unable to access ./include/template/./include/template/portal.tpl in /var/www/vhosts/iguardians.co.uk/httpdocs/header.php on line 49
Warning: file_get_contents(./include/template/./include/template/portal.tpl) [function.file-get-contents]: failed to open stream: No such file or directory in /var/www/vhosts/iguardians.co.uk/httpdocs/header.php on line 49
But i have a portal.tpl file in /include/template/
Offline
#23 2010-10-22 00:27:01
- Mark
- Member
- From: Southport, Uk
- Registered: 2008-05-03
- Posts: 438
Re: frontpage portal for 1.4
but you dont have it in include/template/include/template which is where thats trying to get it from ![]()
Offline
#24 2010-10-22 12:07:56
- IGuardian
- Member
- Registered: 2010-10-20
- Posts: 16
Re: frontpage portal for 1.4
What bit of code do I need to change to get it to pull it from where all the tpl files are located (including the portal.tpl)
Offline
