now, I use this code to open new windows, while still staying XHTML 1.0 STRICT valid, and maintaining accesibility even with JavaScript switched-off, or with pop-up blockers:

<script type='text/javascript'> 
<!--
function openwin(url) {
  if( window.open(url,'','left=0,top=0,scrollbars=yes,location=no,resizable=yes') ) 
    return false; 
  else 
    return true;
}
// -->
</script>

now, instead of target="_blank" you will use onclick="return openwin(this.href)"

Example?

<a href="..." onclick="return openwin(this.href)">Website</a>

Simple, easy to do, and fully accesible and valid... smile

ok, sounds reasonable (for not to confuse users)

oh, of course it works for edit.php, post.php and Quick Post as well...

I've released another mod for PunBB BLOG:CMS Edition, it adds buttons for bbCode and smilies, but, not as pictures, rather defined in CSS, also JavaScript code is greatly reduced to 2 (!) lines only, so, it is very fast smile

Example:
http://blogcms.sourceforge.net/skins/forum.bbcode.png

Download at:
http://sourceforge.net/project/showfile … _id=122110

Rickard wrote:

Also, I'm not too fond of the fact that you're releasing it as PunBB 1.1.8 BlogCMS Edition. That implies that it is built on PunBB 1.1.8 and there is no such version.

I understand, but I do NOT advertise this version anywhere, except for BLOG:CMS users. 1.1.8 is my internal numbering, core files are, of course, based on 1.1.4.

31

(6 replies, posted in PunBB 1.2 show off)

http://forum.blogcms.com/ running (heavily modified) PunBB 1.1.4

the forum is XHTML 1.0 STRICT valid and features very easy to modify CSS styles smile Included are also mods for export of latest RSS 2.0 feed of posts, and full-featured BACKUP / RESTORE function in admi interface.

PunBB mods for download here:
http://forum.blogcms.com/viewtopic.php?id=226

BLOG:CMS download:
http://blogcms.com/extra/download

BLOG:CMS is a personal weblog system, based on PHP/MySQL, while it is an online system, it is able to create static XHTML pages as well, thus being able to handle massive amounts of data. It comes also with 45 certified plugin, which enhance its main parser.

Paul wrote:

You will have to talk to Rickard about seeing his dev code.

btw, this might inpire you, this is a developer documentation for BLOG:CMS and its events for plugins:

http://blogcms.com/nucleus/documentatio … ugins.html

is something like that being done for PunBB?

well, if I'm offering PunBB BLOG:CMS edition to my users, don't you think I *am* very interested in where is PunBB going? Not to make untested 1.2 available for masses, just for myself to see it. Especially new interface / API for plugins.

BLOG:CMS has an excellent plugin API, it's parser calls 70 events to which plugins can subscribe.. It is an important concept.

So, to summarize, I'd appreciate a link to current 1.2, just for my internal purposes.

Paul wrote:

Absolutely not.

huh, why not? for GNU GPL system... wink all my mods, like backup/restore, RSS 2.0 of latest posts, XHTML 1.0 STRICT templates, etc. are available for immediate download..

as BLOG:CMS has quite a lot of users, I would expect PunBB developers to be interested in PunBB : BLOG:CMS connection . I've coded a plugin for BLOG:CMS which allows to create users from BLOG:CMS in PunBB automatically and expect quite a hit of PunBB new installations when mass-mailings will be sent to subscribers..

ok, I see, can I download somewhere this dev version?

Rickard wrote:

Why go with strict other than to improve "coolness factor"? Writing valid code is of course a must, but as far as I can see, the strict DTD doesn't add or improve on anything. Am I wrong?

yes, you are wrong.. some people may want to integrate their forum as a XML application, and XHTML 1.0 STRICT can do that, while Transitional cannot.. wink

anyway, 1.1.4 is HORRIBLE with CSS usage, don't get me wrong, it is a very nice and fast script, this is why I selected it for BLOG:CMS, but.. there are TONS of unnecessary presentational tags in PHP code..

You may want to consider using my, heavily adjusted, 1.1.8 version instead of 1.2, and migrate your own adjustments smile

it is an admin module already (admin_backup.php), just apply your styling..

see
http://forum.blogcms.com/viewtopic.php?id=226
for more info

Now, there is new plugin NP_PunBB available for BLOG:CMS.

NP_PunBB plugin allows to integrate BLOG:CMS and PunBB forum software. It will automatically create users in PunBB database which will register in BLOG:CMS, with the same username, real name, password and email!

In plugin Options, you will have to specify connection options for PunBB database. You can also transfer all existing BLOG:CMS users to PunBB database.

Note for NucleusCMS users: this plugin is NucleusCMS-compatible as well.

example's here:

http://forum.blogcms.com/rss.php

here it goes, only for MySQL though:

<?php

/***********************************************************************

  Copyright (C) 2004  Radek HULAN (http://hulan.info/)

  This file is part of PunBB.

************************************************************************/

$pun_root = './';
@include $pun_root.'config.php';

// If PUN isn't defined, config.php is missing or corrupt
if (!defined('PUN')) exit('The file \'config.php\' doesn\'t exist or is corrupt.');

// Disable error reporting for uninitialized variables
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// Turn off magic_quotes_runtime
set_magic_quotes_runtime(0);

// Attempt to load the common language file
@include $pun_root.'lang/'.$language.'/'.$language.'_common.php';
if (!isset($lang_common)) exit('There is no valid language pack \''.$language.'\' installed.');

// Load the functions and parser script
require $pun_root.'include/functions.php';
require $pun_root.'include/parser.php';

// Load DB abstraction layer and try to connect
require $pun_root.'include/dblayer/common_db.php';

// Get the forum config
$result = $db->query('SELECT * FROM '.$db->prefix.'config') or error('Unable to fetch forum config', __FILE__, __LINE__, $db->error());
while ($cur_config_item = $db->fetch_row($result)) $pun_config[$cur_config_item[0]] = $cur_config_item[1];

// Make sure we have permission to read the forums
if ($pun_config['p_guests_read'] == '0') exit('No permission');


// parse RSS
ob_start();

// make feed
putHeader();
$result = mysql_query("select p.id as id, ".
                      "       p.message as message, ".
                      "       p.posted as postposted,".
                      "       t.subject as subject ".
                      "from ".$db->prefix."posts as p, ".$db->prefix."topics as t ".
                      "where p.topic_id=t.id ".
                      "order by postposted desc ".
                      "limit 0,20"
                      );
while ($row = mysql_fetch_object($result)) putPost($row);
putEnd();

// get feed into $feed
$feed = ob_get_contents();
ob_end_clean();

// create ETAG (hash of feed)
$eTag = '"'.md5($feed).'"';
header('Etag: '.$eTag);

// compare Etag to what we got
if ($eTag == $_SERVER['HTTP_IF_NONE_MATCH']) {    
    header("HTTP/1.0 304 Not Modified");
    header('Content-Length: 0');
} else {
    // dump feed
  header ("Content-type: text/xml");
    echo $feed;
}


function encode_xml($data){
  return strip_tags(str_replace('</p>',"\n",str_replace('<br />',"\n",$data)));
}

function putHeader()
{   
    global $lang_common,$pun_config;
      echo '<'.'?xml version="1.0" encoding="'.$lang_common['lang_encoding'].'"?'.'>'."\n";
    echo "<rss version=\"2.0\">\n";
    echo "<channel>\n";
    echo "<title>".pun_htmlspecialchars($pun_config['o_board_title'])."</title>\n";
    echo "<link>".$pun_config['o_base_url']."</link>\n";
    echo "<description>".pun_htmlspecialchars($rss_description.' '.$pun_config['o_board_title'])."</description>\n";
    echo "<language>en</language>\n";
    echo "<docs>http://backend.userland.com/rss</docs>\n";
} 

function putPost($post) {
    global $pun_config;
    echo "<item>\n";
    echo "<title>".encode_xml($post->subject)."</title>\n";
    $link = $pun_config['o_base_url'].'/viewtopic.php?pid='.strval($post->id).'#'.strval($post->id);
    echo "<link>".encode_xml($link)."</link>\n";
    $data = "<![CDATA[Topic: ".parse_message($post->subject,0)."<br /><br />Message: ".parse_message($post->message,0)."<br /><br />Link: <a href='$link'>$link</a>]]>";
    echo "<description>".$data."</description>\n";
    echo "<pubDate>".strval(date("r",$post->postposted))."</pubDate>\n";
    echo "</item>\n";
}


function putEnd() {
    echo "</channel>\n";
    echo "</rss>\n";
} 


?>

caution: tested ONLY on MySQL db, not PostgreSQL

this mod will add one more screen to Admin Area, allowing to backup full PunBB DB and restore it automatically..

Screenshot:
http://blogcms.sourceforge.net/skins/forum.backup.png

Download at (punbb.1.1.5.blogcms.zip):
http://sourceforge.net/project/showfile … _id=122110

Jansson wrote:
sverrir wrote:

You could use little javascript combined with css to make a strictly validated site with pop up capabilities.
Let me know if you want me to dig it up for you.

Wouldn't there be a problem more and more webbrowsers blocking popups then?


not really, as popup blockers do NOT block windows opened by user action.. wink

ok, in that case, it's the *real problem* with phpBB -> PunBB conversion

45

(7 replies, posted in PunBB 1.2 bug reports)

well, ok, is there some CVS for PunBB? Moving over to sourceforge.net?

no, there is a bug... when I converted phpBB into PunBB, there was < sign converted as < -- BUT, when it is displayed, it is not displayed as <, but rather as <, because < gets converted into &lt;

here's the fix:

function pun_htmlspecialchars($str)
{
    $str = preg_replace('/&(?!#[0-9]+);/s', '&', $str);
    $str = str_replace(array('<', '>', '"'), array('<', '>', '"'), $str);
    return $str;
}

47

(7 replies, posted in PunBB 1.2 bug reports)

here's the fix:

function truncate_url($url, $link = '')
{
    global $cur_user;
    $full_url = $url;
    if ( (strpos($url, 'www.')!==false) && 
       (strpos($url, 'http://')===false) && 
       (strpos($url, 'https://')===false) && 
       (strpos($url, 'ftp://')===false)
  )
        $full_url = 'http://'.$full_url;
    else if (strpos($url, 'ftp.') !== false)
        $full_url = 'ftp://'.$full_url;

    // Ok, not very pretty :-)
    $link = ($link == '' || $link == $url) ? 
    ((strlen($url) > 55) ? substr($url, 0 , 39).' ... '.substr($url, -10) : $url) 
    : 
    stripslashes($link);

    // if ($cur_user['link_to_new_win'] == '0')
    return '<a href="'.$full_url.'">'.$link.'</a>';
}

48

(7 replies, posted in PunBB 1.2 bug reports)

parser.php completely messes-up https://url links.. ( https://sourceforge.net/project/showfil … _id=121144 )

I've made available whole mod for download, here's more info:

http://forum.blogcms.com/viewtopic.php?id=226

I've made available whole mod for download, here's more info:

http://forum.blogcms.com/viewtopic.php?id=226