Topic: how to create a page?

in punbb 1.2.xxxxxxxxx

we could create a static page like privacy.php

example code:

will there be such a thing for 1.3 ??

http://wiki.punres.org/Miniportal#New_page_template

<?php
 
define('PUN_ROOT', './');
define('PUN_QUIET_VISIT', 1);
require PUN_ROOT.'include/common.php';
 
//Set the page title here
$page_title = pun_htmlspecialchars($pun_config['o_board_title']) . ' / New page 1';
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';
require PUN_ROOT.'include/parser.php';
 
?>
        <div class="block">
            <h2><span>Box 1</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
 
require PUN_ROOT.'footer.php';
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 !!!

Re: how to create a page?

ok this is what i have created for a static page!

http://256studio.com/pun13/test.php

this is first draft!

Q

<?php
if (!defined('FORUM_ROOT'))
    define('FORUM_ROOT', './');
require FORUM_ROOT.'include/common.php';

($hook = get_hook('mi_start')) ? eval($hook) : null;

// Load the index.php language file
require FORUM_ROOT.'lang/'.$forum_user['language'].'/index.php';
//Set the page title here

define('FORUM_ALLOW_INDEX', 1);
define('FORUM_PAGE', 'index');
require FORUM_ROOT.'header.php';
 
?>



<div id="brd-main" class="main">

    <h1><span>Lorem ipsum</span></h1>

    <div class="main-head">
        <h2><span>Lorem ipsum</span></h2>
    </div>

    <div class="main-content frm">
        <div class="userbox">
          <div id="lipsum">
            <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec  ullamcorper massa varius mi. Quisque hendrerit feugiat massa. Aliquam  erat volutpat. Integer turpis lorem, consequat mollis, bibendum  placerat, rhoncus vel, nisl. In ac massa. Nam ut odio ac magna  tristique tempus. Aliquam ut nisl. Etiam nec risus. Sed rutrum laoreet  enim. Nullam ornare. </p>
            <p>Etiam aliquet gravida ligula. Nulla in purus in ligula aliquet  aliquet. Aliquam eros. Suspendisse eu nisi. Quisque convallis feugiat  velit. Aliquam vitae arcu. Cras laoreet venenatis arcu. Quisque eu  ligula at ligula viverra tristique. Praesent vulputate sapien non urna  porta rhoncus. Duis porta quam quis enim. Duis eu urna in eros  vestibulum ultricies. Donec consequat risus scelerisque lorem.  Suspendisse potenti. Nulla ut elit. Maecenas dapibus, magna vulputate  scelerisque ultricies, libero sapien lacinia ligula, eu dictum augue  nibh vitae risus. Suspendisse eleifend elementum arcu. </p>
            <p>Nullam dignissim, nunc et condimentum porta, neque eros blandit  nunc, vitae varius eros elit vitae nisi. Class aptent taciti sociosqu  ad litora torquent per conubia nostra, per inceptos himenaeos. Donec  nunc orci, consequat eu, cursus vitae, viverra quis, lorem. Nunc  scelerisque leo sit amet nibh aliquam interdum. Suspendisse neque nisi,  pretium posuere, venenatis sit amet, venenatis ac, sem. Quisque  ultrices tellus sed justo. Nunc non neque. Suspendisse malesuada tempor  tortor. Vivamus sed est. Maecenas pulvinar varius neque. Donec laoreet,  metus in congue eleifend, arcu tellus dictum nisi, vel vulputate nibh  orci vel mauris. </p>
            <p>Nunc sit amet sem. Sed bibendum eros eget libero. Integer  sollicitudin, tellus tincidunt fermentum tempus, nisl justo tempor  nisi, a faucibus turpis neque quis tellus. Quisque semper. Fusce  pulvinar. Maecenas ullamcorper aliquet neque. Sed libero tellus,  facilisis in, lacinia quis, posuere quis, dui. Donec gravida.  Suspendisse potenti. Mauris consectetuer bibendum ligula. </p>
            <p>Aliquam dictum quam at urna. Ut odio. Integer pharetra. Integer  vestibulum dui nec felis. Mauris rhoncus neque eu purus. Proin blandit  ligula sed lectus. Phasellus et eros lobortis magna condimentum  iaculis. Nam est. Nullam purus nisi, consequat non, molestie varius,  convallis in, purus. In laoreet facilisis lorem. Mauris nec mauris.  Fusce egestas, odio nec pellentesque suscipit, diam libero malesuada  dolor, sit amet facilisis odio dolor sed massa. Quisque eu leo  facilisis elit gravida venenatis. Maecenas fringilla velit et arcu.  Pellentesque at justo id odio congue tincidunt. Cras blandit pulvinar  odio. Vivamus id ipsum eget purus viverra consectetuer. Curabitur  condimentum purus id mauris. Lorem ipsum dolor sit amet, consectetuer  adipiscing elit. </p>
          </div>
        </div>
    </div>

</div>
<?php

($hook = get_hook('in_stats_end')) ? eval($hook) : null;

$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_stats -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_stats -->

require FORUM_ROOT.'footer.php';
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 !!!

Re: how to create a page?

This seems to be the simplest correct custom page template.

<?php

define('FORUM_ROOT', './');
require FORUM_ROOT.'include/common.php';

// Setup breadcrumbs
$forum_page['crumbs'] = array(
    array($forum_config['o_board_title'], forum_link($forum_url['index'])),
    'My Title' // Set up your page title here
);

define('FORUM_ALLOW_INDEX', 1);
define('FORUM_PAGE', 'my_page'); // Set up your page id here
require FORUM_ROOT.'header.php';

// START SUBST - <!-- forum_main -->
ob_start();

?>
<div id="brd-main" class="main">

    <h1><span>Lorem ipsum</span></h1>

    <div class="main-head">
        <h2><span>Lorem ipsum</span></h2>
    </div>

    <div class="main-content frm">
        <div class="userbox">
          <div id="lipsum">
            <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec  ullamcorper massa varius mi. Quisque hendrerit feugiat massa. Aliquam  erat volutpat. Integer turpis lorem, consequat mollis, bibendum  placerat, rhoncus vel, nisl. In ac massa. Nam ut odio ac magna  tristique tempus. Aliquam ut nisl. Etiam nec risus. Sed rutrum laoreet  enim. Nullam ornare. </p>
            <p>Etiam aliquet gravida ligula. Nulla in purus in ligula aliquet  aliquet. Aliquam eros. Suspendisse eu nisi. Quisque convallis feugiat  velit. Aliquam vitae arcu. Cras laoreet venenatis arcu. Quisque eu  ligula at ligula viverra tristique. Praesent vulputate sapien non urna  porta rhoncus. Duis porta quam quis enim. Duis eu urna in eros  vestibulum ultricies. Donec consequat risus scelerisque lorem.  Suspendisse potenti. Nulla ut elit. Maecenas dapibus, magna vulputate  scelerisque ultricies, libero sapien lacinia ligula, eu dictum augue  nibh vitae risus. Suspendisse eleifend elementum arcu. </p>
            <p>Nullam dignissim, nunc et condimentum porta, neque eros blandit  nunc, vitae varius eros elit vitae nisi. Class aptent taciti sociosqu  ad litora torquent per conubia nostra, per inceptos himenaeos. Donec  nunc orci, consequat eu, cursus vitae, viverra quis, lorem. Nunc  scelerisque leo sit amet nibh aliquam interdum. Suspendisse neque nisi,  pretium posuere, venenatis sit amet, venenatis ac, sem. Quisque  ultrices tellus sed justo. Nunc non neque. Suspendisse malesuada tempor  tortor. Vivamus sed est. Maecenas pulvinar varius neque. Donec laoreet,  metus in congue eleifend, arcu tellus dictum nisi, vel vulputate nibh  orci vel mauris. </p>
            <p>Nunc sit amet sem. Sed bibendum eros eget libero. Integer  sollicitudin, tellus tincidunt fermentum tempus, nisl justo tempor  nisi, a faucibus turpis neque quis tellus. Quisque semper. Fusce  pulvinar. Maecenas ullamcorper aliquet neque. Sed libero tellus,  facilisis in, lacinia quis, posuere quis, dui. Donec gravida.  Suspendisse potenti. Mauris consectetuer bibendum ligula. </p>
            <p>Aliquam dictum quam at urna. Ut odio. Integer pharetra. Integer  vestibulum dui nec felis. Mauris rhoncus neque eu purus. Proin blandit  ligula sed lectus. Phasellus et eros lobortis magna condimentum  iaculis. Nam est. Nullam purus nisi, consequat non, molestie varius,  convallis in, purus. In laoreet facilisis lorem. Mauris nec mauris.  Fusce egestas, odio nec pellentesque suscipit, diam libero malesuada  dolor, sit amet facilisis odio dolor sed massa. Quisque eu leo  facilisis elit gravida venenatis. Maecenas fringilla velit et arcu.  Pellentesque at justo id odio congue tincidunt. Cras blandit pulvinar  odio. Vivamus id ipsum eget purus viverra consectetuer. Curabitur  condimentum purus id mauris. Lorem ipsum dolor sit amet, consectetuer  adipiscing elit. </p>
          </div>
        </div>
    </div>

</div>
<?php

$tpl_temp = trim(ob_get_contents());
$tpl_main = str_replace('<!-- forum_main -->', $tpl_temp, $tpl_main);
ob_end_clean();
// END SUBST - <!-- forum_main -->

require FORUM_ROOT.'footer.php';

?>
Carpe diem

Re: how to create a page?

wow.. i really like this version..haha..
specially the link breadcrumb.. sweet..

u da man...


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 !!!

Re: how to create a page?

can u explain this?

define('FORUM_PAGE', 'my_page'); // Set up your page id here

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 !!!

Re: how to create a page?

quaker wrote:

can u explain this?

define('FORUM_PAGE', 'my_page'); // Set up your page id here

Q

Here is page ID defined.
You can use it in your CSS for example you can define:

div #brd-my_page
{
color: red;
}

And this will be applied to your page only.

Similar way you can use this ID in your extensions.
In hd_head hook for example:

if (FORUM_PAGE == 'my_page')
$forum_head['js_my_ext_id'] = '<script type="text/javascript" src="'.$ext_info['url'].'/scripts.js"></script>';

Though for the last case you'd better use dynamic hook hd_my_page_head (hd_<FORUM_PAGE>_head) with code:

$forum_head['js_my_ext_id'] = '<script type="text/javascript" src="'.$ext_info['url'].'/scripts.js"></script>';

This will result the same effect.

Carpe diem

Re: how to create a page?

Hi how would you create an admin page .. would you use the same way?
i suppose you would have to add a line of code to include the admin navigation ?
and also to hide it from everyone apart from admin's ?

Andrew

Omeo.co.uk - [PunBB 1.3 RC]

Re: how to create a page?

this script is a static page only. if u need something like a portal look around in the ext. it has a page mod in it. that allow you to create pages like example page?id=3
etc..

what i wanted was to make a static page for different things.
this is my example my own gallery...
http://256studio.com/pun13/gallery.php

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 !!!

Re: how to create a page?

no no, not a portal.. im wanting to make a page that will be in with the admin pages... but also added as an extension.. i just dont know what the page needs for the admin menu ive been looking at other extensions with pages like this but they dont seem to be helping im just wondering if anyone knows the exact way to build this type of page

Omeo.co.uk - [PunBB 1.3 RC]

10

Re: how to create a page?

with 1.2 it is called custom page mod.

but with 1.3 it built in the portal mod.


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 !!!

Re: how to create a page?

mccallum wrote:

no no, not a portal.. im wanting to make a page that will be in with the admin pages... but also added as an extension.. i just dont know what the page needs for the admin menu ive been looking at other extensions with pages like this but they dont seem to be helping im just wondering if anyone knows the exact way to build this type of page

Try to look at how this is done in Pun Hook Navigator: http://punbb.informer.com/trac/browser/ … st.xml#L66

Carpe diem

Re: how to create a page?

ok thanks

Omeo.co.uk - [PunBB 1.3 RC]