(5 replies, posted in Discussions)

well , i replaced the main files i edited the div based columns to be table based (yeah tabular data should stay in tables !!)
so its includes editing the main files , i can post the changed files if you ....
(applying rtl css to tables is much more simple)

esupergood wrote:

"the arhive is unknown format or damaged"
That's the message I get when trying to open the RAR file
any suggestions?
I've unzipped several other extensions this morning

i think your download is fucked some how , try diffrent browser
its hosted on amazon so i dont think there will be a problem

thewizardofbos wrote:

I have the option checked that guest can post. and that option is not even showing up. I think I am going to do a fresh install of punbb. I did change a few files. Nothing that should effect any of it. But would like to do it anyways.

just provide user & password and i will login

my guss is you have some js error

Can you post examples,  please.

here is an example to relative path problem


<?php print 'i am file1.php' ?>



require './file1.php'


now go to ssh and do

path/to/php -f /var/www/html/index.php

if you have done it , you will see he cant find file1.php

becouse execute dir is not the same as public_html dir
but if index.php will look like this
require FORM_ROOT.'file1.php'


the file will work without any problems

other methods is :


at top of the code ... might couse problems if i include the forum from other direcrtory

or you can use set_include_path but its have the same issue as chdir option.


the function add_user have

global ...... , $lang_register .........

but forum dont have lang_register at all......

thewizardofbos wrote:

I put the file in the extensions folder.
I installed it with the extensions in the admin panel.
punbb 1.3.4
mysql 5
php 5
I have changed the header and footer, but nothing that should effect the textarea.

can you please make forum that guests can post ? i want to check it out without register...

and 1 more thing

        $mail_message = str_replace('<base_url>', $base_url.'/', $mail_message);
        $mail_message = str_replace('<username>', $user_info['username'], $mail_message);
        $mail_message = str_replace('<activation_url>', str_replace('&amp;', '&', forum_link($forum_url['change_password_key'], array($new_uid, substr($user_info['activate_key'], 1, -1)))), $mail_message);
        $mail_message = str_replace('<board_mailer>', sprintf($lang_common['Forum mailer'], $forum_config['o_board_title']), $mail_message);

why to call str_replace each time ? just combine all of it togeder like :

$find = array('<base_url>','<username>','<activation_url>','<board_mailer>');
        $replace = array(
                str_replace('&amp;', '&', forum_link($forum_url['change_password_key'], array($new_uid, substr($user_info['activate_key'], 1, -1)))),
                sprintf($lang_common['Forum mailer'], $forum_config['o_board_title'])
        $mail_message = str_replace($find,$replace,$mail_message);

will require less resources from the server to run str_replace once then 5 times.

More on integration info

the function add_user should return $new_uid

this way we keen save the forum userid in our database

1 more thing you request for

function add_user($user_info, &$new_uid)

but when inserting query you dont push the $new_uid.

and if you request for new_uid why to ask only for variable ?

this way we cant do add_user($userinfo,0); or add_user($userinfo,null);

so the workaround is

$uid = null;

(and you igone $uid anyway so whats the point ? )

kmbxxx wrote:

rs324, Create New Topic and ext pun_tags the problem remained smile
May be add plugins autoresize is on ?
And add in top or bottom editor

<script type="text/javascript">
function toggleEditor(id) {
if (!tinyMCE.get(id))
tinyMCE.execCommand('mceAddControl', false, id);
tinyMCE.execCommand('mceRemoveControl', false, id);
<p><center><a href="javascript:toggleEditor('fld2');"><b>Add/Remove editor</b></a></center></p>

are you sure you used scripts.js i provieded ?
at this file i bind tinymce only to textarea[name=req_message] and textarea[signature]

and punbb tags is not one of them (at my board punbb_tags is input box and not textarea)

the first thing i learned on php that relative urls are bad

they never works as expect on diffrent options (include from other directories ,  running as cron , and can security risk if you dont handle included file checks)

here is 2 links hack that will make punbb much better


if (!defined('FORUM_ROOT'))
    define('FORUM_ROOT', './');

change to

if (!defined('FORUM_ROOT'))

and include/common.php

find :

if (!defined('FORUM_ROOT'))
    exit('The constant FORUM_ROOT must be defined and point to a valid PunBB installation root directory.');

change to :

if (!defined('FORUM_ROOT'))

this way , when i builld integration i dont need to care about forum_root define (and i saw some posts around that ppl got lost tring to figure out forum_root dir)

the point about __FILE__ is thats its allways return the currect working file .

few more points :

punbb allways uses '/' as DIRECTORY SEPARATOR this might couse some problems on some configuration of windows iis

the fix is very simple , use php language const : DIRECTORY_SEPARATOR

or if you want to make it simple , just put define('DS',DIRECTORY_SEPARATOR);
somewhere so we can all use it as

require FORUM_ROOT.'include'.DS.'file.php';

also i think its will be better to set few consts for development ( will help ext developers as well) for example


same for languages &&  other stuff that used alot at punbb

its not a really a bug , but its imporvment , for security and for code writing.

i hope i will get punbb developers comments as well.


Hi ,

im using MVC desgin pattren for my website

so each page on my website is executed via controller->function

no common.php is breaking out if you include it under function

i took plain php page and i wrote :



require FORUM_ROOT.'include/common.php';


the result was getting the currect user , and i can use add_user function to do integration

now , if i do this thing :

function test()



require FORUM_ROOT.'include/common.php';



im getting :

Fatal error: Call to a member function escape() on a non-object in ............\forums\include\functions.php on line 1353

quick check and i found the function is set_default_user() ,

and if we look a little bit better i found out that $forum_db is not a db constractor

so if i put the call to punbb its cant execute the db quries inside.

any idea how to slove it ?

problem sloved
just add to function

global $forum_url, $forum_db, $forum_user, $forum_config, $base_url,$lang_common;

and its will be ok.



(5 replies, posted in Discussions)

KeyDog wrote:

From a user standpoint (not developer) so my opinion:
If you can make a new css which is faster loading and doesn't require rewriting of the php files (core) - that would be great. Or is it necessary to change lots of php files?

well all div tags are writen inside the php files , i didnt change the php core function just update the display
example :

at search file i replaced :

<div class="main-item<?php echo $forum_page['item_style'] ?>">
            <span class="icon <?php echo implode(' ', $forum_page['item_status']) ?>"><!-- --></span>
            <div class="item-subject">
                <?php echo implode("\n\t\t\t\t", $forum_page['item_body']['subject'])."\n" ?>
            <ul class="item-info">
                <?php echo implode("\n\t\t\t\t", $forum_page['item_body']['info'])."\n" ?>


<table id="forum<?php echo $cur_forum['fid'] ?>" class="forum">
<td class="icon"><span class="icon <?php echo implode(' ', $forum_page['item_status']) ?>"><!-- --></span></td>
<td class="topic"><?php echo implode("\n\t\t\t\t", $forum_page['item_body']['subject'])."\n" ?></td>
<td class="postsinfo"><?php  print '<div>'.strip_tags($forum_page['item_body']['info']['replies']).'</div><div>'. strip_tags($forum_page['item_body']['info']['views']).'</div>'; ?></td>
<td class="lastpost"><?php print strip_tags($forum_page['item_body']['info']['lastpost'],'<a><span><strong>'); ?></td>

its looks like simple change but when its comes to rtl the support is automatic for tables
i just wrote few css lines which is by far , way more simple then the orginal.


(5 replies, posted in Discussions)

Well , if i got it right the main idea of punbb is to be simple , fast & strong

you made it on the server side very well (as far as i tested)

but why to make css so complex ? the desgin of punbb is very simple and dont require such complex css
if you just change the way you think a little

for example

/* Float Clearing

.brd .gen-content:after,
.brd .ct-box:after,
#brd-index .item-head:after,
#brd-index .main-item:after,
#brd-index ul.item-info:after,
.brd .frm-group:after,
.brd .mf-set:after,
.brd .sf-set:after,
.brd .mf-box:after,
.brd .sf-box:after,
.brd .mf-item:after,
.brd .txt-set:after,
.brd .txt-box:after,
.brd .frm-form label:after,
.brd fieldset:after,
.brd span.fld-input:after,
.brd .posthead:after,
.brd .postbody:after,
.brd .postfoot .post-options:after {
    content: "";
    display: block;
    font-size: 0;
    height: 0;
    line-height: 0.0;
    visibility: hidden;
    clear: both;

why not just do :

/* Float Clearing

.brd .clearfix:after {
    content: "";
    display: block;
    font-size: 0;
    height: 0;
    line-height: 0.0;
    visibility: hidden;
    clear: both;

and apply clearfix on each dom element you want

.brd .main-content .main-item li.info-lastpost cite

Tag key with 4 descendant selectors and Class overly qualified with tag

its way 2 much , you should make it simple

.brd .main-head .hn, .brd .main-foot .hn {
    font-size: 1.084em;
    padding-right: 10em;

why not to call is .category {} & .category h2 {}

will make css code much more simple

and here a quick review

http://punbb.informer.com/forums/style/ … Oxygen.css has 45 very inefficient rules, 108 inefficient rules, and 0 potentially inefficient uses of :hover out of 301 total rules.

this make loading slower
and also makes theme very hard hard to builld -> so there will be very few themes for punbb which will make punbb less popular

also 90% of code sets position:relative; which make you include special css file for IE 6 & IE 7
which is bad idea from the first place

and the last bad idea is to use div's for table data , just use table tag its will require less css hacks and will work better
and still will be XHTML Valid.

also making the forum to support rtl is impossible with this css , i ended up with rewriting all php files to replace div code to table and css change to support tables & rtl properties

i will be really happy to get developers comments.

New Version : 1.0.3

fetures added :

-  support for code & qoute block
-  support for punbb_pm extention
-  support for pun punbb_quick_reply extention
- support for wysiwyg editor at signature edit

bug fixes :

- liimt textarea replace for only message fields
- code cleanup

thats all

download new version here :



KeyDog wrote:

btw @ rs324; added the info to the official tinyMCE forum board (which runs PunBB 1.2 big_smile )
http://tinymce.moxiecode.com/punbb/view … hp?id=1323

thanks , i didnt knew about the tinymce forums topic , i will make an update to tinymce extention soon
to fix what kmbxxx said

edit :

i have a problem with qoute insdie a qoute (depth problem with js regex) roll

kmbxxx wrote:

after install not worked pun_quote, insert_nick_to_quickpost...

i guss this hacks uses javascript to update the textarea can you give me links to this extntions ? i will update mine to support them.

form the bottom of page ?

i dont want this text at my forums at all  roll


KeyDog wrote:

It's good if you keep it for download on your server aswell. I just upload to wiki for backup.
Numbering is just detail. Also it's good if you always keep the download link the same; so
http://rs324.s3.amazonaws.com/PunBB/punbb_wysiwyg.rar  instead of
http://rs324.s3.amazonaws.com/PunBB/pun … wyg0.2.rar
but that's up to you - maybe you want one light version and one full

Only thing I noticed "bug" wise, is that
- on left side there's a border
- it doesn't warn to turn off pun_bbcode (so one has both showing smile ) - but that's not a real bug
- and the smilies are there twice (indirectly via dropdown, then on second line all)

All functions are working as wanted for me in chrome - so I'm happy...

Also many other users have been wanting something like this, so your work is appreciated greatly

i will fix the downlod link smile

about the double of icons i puted them both so users will notice that there are 2 options

to remove the second line you just need to edit scripts.js
and set
theme_advanced_buttons2 : ""

if you want to remove the drop down button ,
find : ,rs324smilies at theme_advanced_buttons1
and remove it.

i like the wyiwyg extention (reminds the vbulletin wysiwyg)
make the textarea looks much better

about the warning , i have no-idea how to do that.

KeyDog wrote:

Just noticed small thing, you zipped and named the file so that when it's unpacked one needs to rename it otherwise there's mismatch between extension name and folder name
btw also added version number 1.0.2 instead of just 0.2 ...
uploaded it here:
http://punbb.informer.com/wiki/_media/p … _1_0_2.zip

i didnt wanted ppl think its version 0.1 so i just renamed the rar file
so i will edit the version number and upload it again

you put the extention at wiki pages , so its mean i can remove it from my server ?
btw , did you found any bugs ?
will you use it ?

KeyDog wrote:

Thanks a lot, just tried and even though directionality is set ltr the cursor always appears on right hand side... but great job on getting all those functions to work!

thats because editor.css file is set to rtl

if you want you can edit this file and setup what ever you want.

any way  i updated the file so you can re download.

New Version : 0.2

what has been changed ?

added support for left , right, center , justfiy text-aligns
added support for inlinde rtl & ltr text direction
added support for font color & background color
added support for orderd & unordered lists
Smilies  smile  smile

added 2 Options for smiles , as drop down button or as inline (at wysiwyg UI)

custom php functions for parsing bbcode.

fixed few bugs :

tinymce now loaded only on page with editor (last version loaded on every page)
all scripts are now on external file : scripts.js instead of inline writing.

to change plugin settings , just go to scripts.js and you can change skin or direction (ltr,rtl)  , or buttons appreance order
you can use multi-lang throw tinymce translation page

i have worked very hard on writing the tinymce JS plugins for custom bbcode  and to make it work right
i hope you will enjoy it.

download here

KeyDog wrote:

Ah, I see

BTW: You can set the style of admin area via profile settings of the admin... so if you set oxygen for board in general and "yourstlye" for admin - you'd achieve same result I imagine...
of course then anyone else could use that style aswell on your board....

sorry , thats not good enough i dont want my user to use other skins

here is the solution :

header.php line 177 just add :

$gen_elements['<!-- forum_url -->'] = $base_url;

and you can use <!-- forum_url --> in .tpl files

no ,
i want my board to use 1 theme , and admin skin to use other theme ,

so i decided to edit admin.tpl
and add there

<link rel="stylesheet" src="[FORUM_URL]/styles/oxygen/oxygen.css"/>

but i need the [FORUM_URL] to include this css files smile

rajuru wrote:

seems it is going to be a great extension

however, I got few issues:

  • Can you kindly make RTL and LTR configurable? Because, if we edit manifest.xml, it will loose the portability from future releases of your extension!
    if all the tinymce functions can't be implemented, then why to use it? isn't it better to use some other lightweight wysiwyg editor?

i think this is an extension that may need community attention! so after some progress, if you release it and maintain actively, we will also be able to contribute!

about your first point , im using the rtl version of this extntion , so there is not problem using it as rtl , to change 1 line of code is not such truble for the first version of this extention

usally its , rtl OR ltr and you will change this option only once , when you installing the extention,

any way when i will get punbb little better ill make an admin section to edit direction , buttons , theme of tinymce

if all the tinymce functions can't be implemented, then why to use it? isn't it better to use some other lightweight wysiwyg editor?

if your not loading all of plugins tinymce is very lightweight and came with out of box bbcode support , also its have great docs, so its easy to builld new extentions to it, and make it punbb function suppot , i need to builld custom js function for tinyMce

you have other extentions that not using tinymce , if you don't like tinymce you can try them (for example UBB Editor)


at the moment next stable release will include :
smilies support ,
code block support ,
lists support,
justify support

after that
few more features , and admin config zone

i want to add hard coded links to main.tpl or admin.tpl

link should be something like


how can i use boardurl inside .tpl file ?

i have tried <!-- forum_url --> with no luck ,
does any1 have idea ?


KeyDog wrote:

Thanks for those infos smile
Just noticed I run into trouble as soon as I use a lot of the other options

If I insert emotions into manifest and then use the smilies I get code in post instead of actual smilies, like this:


If I use background color I get

<span style="background-color: #ffcc00;">This is a test</span>

When I try lists with bullets I just get


etc....  and for numbered list I get



Guess one would have to add support to all those others via parser.php....?

hmm i didnt added all of tinymce functions becouse you need to write a special code for it ,
the idea is to write a code that works on tinymce because when you edit a document you need tinymce to understand the formating , so what i need to do is to write a special function for each of forum's bbcode options ,
i will use the parser to add some more function like [rtl][/rtl] [ltr][ltr][center] [right] [left] and stuff like that , also for the smilies , i need to check the checkbox of use smilies at edit mode before showing them on screen

the important idea is the basic function will work for the first version

btw ,
do you know how can i disable the caching of the hook ? (each edit of file i need to uninstall & reinstall the plugin) ?