251

(19 replies, posted in PunBB 1.3 discussion)

Basically, each PunBB file has hooks in key parts of the script, which allow you to modify how PunBB works. You start with a base 'manifest.xml' and just keep on adding hooks:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE extension SYSTEM "ext-1.0.dtd">

<extension engine="1.0">
    <id></id>
    <title></title>
    <version>1.0.0</version>
    <description></description>
    <author></author>
    <minversion>1.3</minversion>
    <maxtestedon>1.3.2</maxtestedon>
    
    <install>
        <![CDATA[
if(!defined('EXT_CUR_VERSION'))
{
    //Install code if extension is already installed (upgrading, etc.)
}
//Install code
        ]]>
    </install>
    
    <uninstall>
        <![CDATA[
//Uninstall code
        ]]>
    </uninstall>
    
    <hooks>
        <hook id="hook_name">
            <![CDATA[

            ]]>
        </hook>
    </hooks>
</extension>

To know which hooks to use, just browse through the PunBB files. Once the script reaches the part where it calls your hook, it simply executes all the code you put inside the <hook> element (eval() function restrictions apply, though).

As for the extension ID, just make sure it matches the folder in which you are placing the extension. Also, when your hook is executed, the following variable is passed to you:

$ext_info = array(
    'id'            => $id,
    'path'        => FORUM_ROOT.'extensions/'.$id,
    'url'            => $base_url.'/extensions/'.$id,
    'dependencies'    => array()
);

basically, all you need.

I hope this helped... I might've left some things out, so feel free to post any questions you have (as long as their not stupid nooby questions, in which case all I'll do is post a link to a PHP tutorial) smile

252

(22 replies, posted in PunBB 1.3 extensions)

I'll try.

Seriously dude? You wanted to set a variable AFTER you try to use it? This site helped me a lot when I started: http://tizag.com/

        <hook id="ft_about_end"><![CDATA[
$lang_common['Design by'] = 'Design by';
$tpl_temp = forum_trim(ob_get_contents());
ob_end_clean();
echo str_replace(array($lang_common['Powered by'],'<a href="http://punbb.informer.com/">PunBB</a>'), array($lang_common['Design by'],'<a href="http://keydogbb.info"><img src="'.$ext_info['path'].'/img/info.png" alt="PunBB" width="16" height="16" border="0"/></a>'), $tpl_temp);
        ]]></hook>

Then just try setting

$lang_common['Design by'] = 'Design by';

outside the file. (in your hook)

Does it say "It's not set" somewhere when you try it?

On the first post... http://punbb.informer.com/forums/post/119284/#p119284

if(!isset($lang_common['Design by'])) die("It's not set");

Put that somewhere on the hook.

You have to download it if there is a new version.

$show = '5'; //<--- Change this to how many active topics you want

define('FORUM_ROOT', '{replace_this}');

echo '<ul>';
echo file_get_contents(FORUM_ROOT . '/extern.php?show=' . $show);
echo '</ul>';

I still don't see where transparency is used in that specific page... I mean, there are no rounded corners...

Oh, I see...

263

(6 replies, posted in PunBB 1.3 additions)

KeyDog made a clean theme like that for 1.3.*, you should talk to him.

264

(6 replies, posted in PunBB 1.3 additions)

You should post a link to that theme.

But you can get rid of the white background?

266

(4 replies, posted in PunBB 1.3 discussion)

Good luck.

267

(4 replies, posted in PunBB 1.3 discussion)

If that migration tool works for 1.2.*, you can use it and then upgrade to 1.3.2.

268

(3 replies, posted in PunBB 1.3 extensions)

I have a fixed scripts.js, can someone try it on different browsers: http://snipplr.com/view/10983/punquote- … js--fixed/

It works for me on Firefox 3.0.5. All BBCodes are parsed correctly.

That's great!

270

(19 replies, posted in PunBB 1.3 discussion)

Hack.

271

(19 replies, posted in PunBB 1.3 discussion)

1.- No, there are not.

2.- What kind of integration? Users, posts, etc.

3.- You can make it an image.

The redirect page looks weird:

http://arch.kimag.es/share/83741541.jpg

273

(3 replies, posted in PunBB 1.3 extensions)

I'll try to fix that as soon as I get my local server up (I just reformatted), but I think it's too late already, so I'll do it tomorrow smile

274

(11 replies, posted in PunBB 1.3 additions)

I was talking to downliner smile

I'm assuming you're a girl... If not, that's weird...