Old PunBB (1.2.21): http://punbb.informer.com/download/punbb-1.2.21.zip

Yes, you can. Go to Administration > Settings > Announcements on PunBB 1.3.*

202

(32 replies, posted in PunBB 1.3 extensions)

Mine is not an XML, it's a PHP file.

Here's an example of how you use 'extensions_info.php':

<?
include 'extensions_info.php';
?>
<table>
    <tr>
        <th>ID</th>
        <th>Title</th>
        <th>Version</th>
        <th>Description</th>
        <th>Author</th>
        <th>Min Version</th>
        <th>Max Tested on</th>
    </tr>
<?
foreach($extensions as $k=>$v):
?>
    <tr>
        <th><?=$v['id']?></th>
        <th><?=$v['title']?></th>
        <th><?=$v['version']?></th>
        <th><?=$v['description']?></th>
        <th><?=$v['author']?></th>
        <th><?=$v['minversion']?></th>
        <th><?=$v['maxtestedon']?></th>
    </tr>
<?
endforeach;
?>
</table>

and that's how it looks: http://home.garciat.org/test2.php

203

(32 replies, posted in PunBB 1.3 extensions)

Here's the script:

<?
function xml2array($xml)
{
    $xml_parser = xml_parser_create("UTF-8");
    xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0);
    xml_parser_set_option($xml_parser, XML_OPTION_SKIP_WHITE, 0);
    xml_parse_into_struct($xml_parser, $xml, $vals);
    xml_parser_free($xml_parser);
    
    foreach($vals as $elem)
    {
        if($elem['type'] == 'open')
        {
            $open[$elem['level']][$elem['tag']] = array();
            $prev[$elem['level']] = $elem['tag'];
        }
        elseif($elem['type'] == 'close' ||$elem['type'] == 'complete')
        {
            if($elem['level']==1)
                $array[$elem['tag']] = (isset($elem['value'])) ? $elem['value'] : (($elem['type'] == 'close') ? $open[$elem['level']][$elem['tag']] : '');
            else
                $open[$elem['level']-1][$prev[$elem['level']-1]][$elem['tag']] = (isset($elem['value'])) ? $elem['value'] : (($elem['type'] == 'close') ? $open[$elem['level']][$elem['tag']] : '');
        }
    }
    
    return $array;
}

$ext_url = 'http://punbb.informer.com/unofficial/punbb-1.3/extensions/';

$html = file_get_contents($ext_url);

if(preg_match_all('/<li><a[^>]+>([^\/]+)\/<\/a><\/li>/i', $html, $matches))
{
    foreach($matches[1] as $ext)
        if($manifest = file_get_contents($ext_url.$ext.'/manifest.xml'))
        {
            $xml = xml2array($manifest);
            unset($xml['extension']['note']);
            unset($xml['extension']['install']);
            unset($xml['extension']['uninstall']);
            unset($xml['extension']['hooks']);
            $extensions[$ext] = $xml['extension'];
        }
}

$fh = @fopen('extensions_info.php', 'wb');
fwrite($fh, '<?php'."\n\n".'$extensions = '.var_export($extensions, true).';'."\n\n".'?>');
fclose($fh);

it creates a file called 'extensions_info_{time()}.php' with all the info. You can then include that PHP file and you'll get all the info as an array.

Here's part of what the 'extensions_info_{time()}.php' file would be:

<?php

$extensions = array (
  'ajax' => 
  array (
    'id' => 'jsbase',
    'title' => 'JS basic framework',
    'version' => '1.0',
    'description' => 'Ads prototype to punbb and it creates some basic calls to display more info about all kinds of things in the forum',
    'author' => 'Maikel Punie',
    'minversion' => '1.3dev',
    'maxtestedon' => '1.3',
  ),
  'akismet' => 
  array (
    'id' => 'akismet',
    'title' => 'Akismet',
    'version' => '1.1',
    'description' => 'Integrates Akismet spam protection into the forum.',
    'author' => 'Garciat',
    'minversion' => '1.3',
    'maxtestedon' => '1.3',
  ),
 ... ETC ...

204

(32 replies, posted in PunBB 1.3 extensions)

I just made a script that will read the unofficial extensions directory and get you the version, author, etc. from the manifest.xml.

Now, I wouldn't know how to get the download links... because not everyone adds ZIPs to their extensions (as far as I know, I'm the only one that does).

The process takes some time because it downloads the whole manifest.xml and parses it, so I'd get the info, store it in a MySQL table and use that stored info to create the XML file that is parsed by that javascript thing. Then, whenever there's a new release you run the update process manually (or use PHP to create a pseudo-scheduled process and update it every 24 hours or so...)

Let me know if you want the script.

205

(32 replies, posted in PunBB 1.3 extensions)

How does it work? You input the info manually, or does it parse the manifest.xml or something like that?

206

(32 replies, posted in PunBB 1.3 extensions)

Really nice.

Lol, yeah. That was a long time ago... I was kinda nubby.

Updated to 1.0.1: Added online status and user title to the options.

Yes, of course.

anggiawan wrote:

I think it is better if extension hide the whole content but still show the title of topic, and let the bot has permission tp crawl the content

"Advanced" users can spoof their user-agent header.

Thanks a lot KeyDog! (Btw, your font size appears to be smaller than normal.)

By the default, PunBB lets you show either all the user's info or none. With this extension, you can decide what info to show separately.

You can change the options on Administration » Settings » Features

Download Link: http://punbb.informer.com/unofficial/pu … erinfo.zip

Screenshot:
http://arch.kimag.es/share/58612884.jpg

If you find any bugs or have any tips, please post them here.

Updates

  • 1.0.2: Fixed small markup bug. (Thanks to bingiman)

  • 1.0.1: Added online status and user title to the options.

  • 1.0.0: First release

I'll see what I can do after lunch smile

Sorry, I don't get what you're trying to say.

Oh. Yeah, I leave that at that size on purpose so the BBCode bar doesn't look weird, if you know what I mean.

216

(2 replies, posted in Discussions)

You can't really change the markup (which is XHTML-compliant), but you can change how it looks very easily with CSS (almost every element has its own class name and/or id).

217

(27 replies, posted in PunBB 1.3 additions)

Awesome post, good job.

KeyDog was building an extension just like that.

Fixed [1003]. Thanks.

I don't know if this will fix it, but try setting 'RewriteBase' to the base dir of you forum inside .htaccess (see the comment inside the file).

Rephrase, please?

Yes, your PunBB config file. (It will only work for your forum)

223

(4 replies, posted in PunBB 1.3 bug reports)

Hey! Are you back?

if (strstr( $_SERVER['HTTP_HOST'], 'www.' ) === false)
{
header('HTTP/1.1 301 Moved Permanently');
header('Location: http://www' . $_SERVER['REQUEST_URI']);
exit();
}

At the beginning of your config file, I guess.

Basically, only these two changes:
http://punbb.informer.com/trac/changeset/995
http://punbb.informer.com/trac/changeset/1002