Recent Topics

1 Oct 04, 2007 10:25    

This is an update on this old Dedicated About Page post http://forums.b2evolution.net/viewtopic.php?t=9140

In 2.0.1 this is a lot simpler.

1:Create your Custom PHP page.. ( Example page is _custom.php )
Save the file as _custom.php
EG:

<?php
   
   //Check page isn't being accessed directly
   if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
{
    //Show custom page
    ?>
<div id="bPosts">
Include your specific XHTML and content here....
</div>
 <?php
}
?> 

Upload your _custom.php file to the /skins directory

Now open /inc/skins/_skin.funcs.php and find..

// Default display handlers:
		$disp_handlers = array_merge( array(
            'disp_custom'   => '_custom.php',
				'disp_posts'    => '_posts.disp.php',
				'disp_single'   => '_single.disp.php',
				'disp_page'     => '_page.disp.php',
				'disp_arcdir'   => '_arcdir.php',
				'disp_catdir'   => '_catdir.disp.php',
				'disp_comments' => '_lastcomments.php',
				'disp_msgform'  => '_msgform.php',
				'disp_profile'  => '_profile.php',
				'disp_subs'     => '_subscriptions.php',
			), $params );


Simply add

'disp_custom'   => '_custom.php',


to the list ( as per the fist line in the above list ) and then access it as http://yoursite.com/index.php?disp=custom

I just added an _about.php to my current 2.0.1 installation
http://wow-factor.com/index.php?disp=about

2 Oct 04, 2007 16:15

Hi John. I use this approach on 1.10.2 .

But, with 2.0 having pages and posts, this hack doesn't this hack deprecated?

3 Oct 04, 2007 22:20

It may well be the case Walter. I havn't delved into Pages yet :)

4 Oct 04, 2007 22:52

If I select Page, I am still restricted to not being able to use Javascript etc etc when creating the Page/Post
...yes/no?

5 Oct 04, 2007 22:54

Yes, I think so.

But, in the CVS version of b2evolution there's a conf in _formatting.php:


$posts_allow_javascript = false;

I think that it will be possible in b2evo 2.0 final.

6 Oct 04, 2007 22:57

And there's anothers settings that are welcome:


# ONLY CHANGE THE FOLLOWING IF YOU KNOW WHAT YOU'RE DOING
$posts_allow_javascript = false;
$posts_allow_script_tags = false;
$posts_allow_iframes = false;
$posts_allow_objects = false;

# set this to true to allow id && style as core attributes for comments
# WARNING : This would allow spammers to post hidden content in comments
#           enable it at your own risk !
$comments_allow_css_tweaks = false;

This will permit us to easily embed google maps, slidshare and other contents that use tags like embed, iframe, and others.

7 Oct 04, 2007 22:58

Thanks for the info Walter... I look forward to Final :)

8 Oct 04, 2007 23:38

Hi,

Yabba is currently looking into the _formatting,php and yes, the things walter showed in this topic are under development. The goal is to make these settings available in backoffice. Furthermore there is a rewrite of the ugly code that's in the file at the moment. Having it cleaned up will enable us to determine what XHTML tags we allow our users to use.

Yabba is interested in your input, so please ask questions and tell him how you want it to turn out.

Good luck


Form is loading...