1 (edited by shauninman 2005-09-21 17:37)

Topic: BBCode PHP Includes

##
##
##        Mod title:  BBCode PHP Includes
##
##      Mod version:  1.0
##   Works on PunBB:  1.2.7
##     Release date:  2005-09-21
##           Author:  Shaun Inman
##
##      Description:  This mod adds a [inc][/inc] BBCode tag which allows admins 
##                      to include PHP in posts. The PHP include has access to 
##                      $lang_common, $pun_user, $cur_post and should not output
##                      HTML directly. The result of the include should be returned as
##                      a string in the $return variable.
##
##   Affected files:  /include/parser.php
##
##       Affects DB:  No
##
##            Notes:  Just a quick hack that I implemented to include a custom 
##                      polling script. It's probably a terrible security hole and
##                      may not even work on your server configuration. I'm 
##                      documenting this for myself so I'll know which changes 
##                      to make when PunBB is next updated.
##                      
##                      Include paths are relative to the root of your site. eg:
##                      
##                              [inc]/includes/file.php[/inc]
##                      
##                      This mod is offered as-is. Use at your own risk.
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

I hacked this out real quick. It meets my needs, it may not meet yours. Feel free to modify it for the latter.

Download: http://www.punres.org/download.php?id=430

2

Re: BBCode PHP Includes

Tested and ... we can say it works smile
http://www.sortons.net/forum/viewtopic.php?id=5012

but it's very weird : the include is OUTSIDE of the post smile

the included file (not really beautiful code, but it's a quick test) http://www.sortons.net/agenda_forum.php

3 (edited by shauninman 2005-09-21 17:37)

Re: BBCode PHP Includes

shauninman wrote:

The PHP include [...] should not output HTML directly. The result of the include should be returned as a string in the $return variable.

4

Re: BBCode PHP Includes

Hum smile ... and is it possible to have "outpout" html ?