101

Re: PunCMS

Ludo wrote:

I'm not able to customise too much.
I need a homepage like Gary made (http://dragonfighter.gary13579.info/cms.php)
Unfortunately, this home page was made for 1.2 dev so it's useless to got it.
I need a homepage which uses punbb forum style.

Ludo,

A page like that should be quite easy to make actually... All it would take is create a new .php file for the news page with the classes/tags you need, then create a simple admin plugin to change the settings etc.

I may look into it sometime soon, but I'm not sure that I'll need it if Connorhd releases his "mod" smile

102

Re: PunCMS

what you want is probably the miniportal rather than the cms, the good news is i'm making the miniportal before the cms

103

Re: PunCMS

CodeXP wrote:

Why not use the news generator plugin for that? It's perfect for the job [simple demo here] smile

that is a really layout you have.. i don't suppose there's a brief write-up anywhere about the mods/steps you took to get those features and that appearance on your forum?

104

Re: PunCMS

I would also like to know how you did for floating images?

Ludo,

105

Re: PunCMS

alicson wrote:
CodeXP wrote:

Why not use the news generator plugin for that? It's perfect for the job [simple demo here] smile

that is a really layout you have.. i don't suppose there's a brief write-up anywhere about the mods/steps you took to get those features and that appearance on your forum?

No, not really...but I'll most likely release the theme when I'm done with it (or at least a similar theme) so when that time comes you could always look at the source files smile The news feature is a combination of the 'news generator plugin' and my own simple .php script.

I'm considering adding more features as well wink

106

Re: PunCMS

Ludo wrote:

I would also like to know how you did for floating images?

Ludo,

Well, it's quite simple really ;)

Open include/parser.php

Find:

//
// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
//
function handle_img_tag($url, $is_signature = false)
{
    global $lang_common, $pun_config, $pun_user;

    $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>';

    if ($is_signature && $pun_user['show_img_sig'] != '0')
        $img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
    else if (!$is_signature && $pun_user['show_img'] != '0')
        $img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';

    return $img_tag;
}

After add:

function handle_img_tag_left($url, $is_signature = false)
{
    global $lang_common, $pun_config, $pun_user;

    $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>';

    if ($is_signature && $pun_user['show_img_sig'] != '0')
        $img_tag = '<img class="sigimage_left" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
    else if (!$is_signature && $pun_user['show_img'] != '0')
        $img_tag = '<img class="postimg_left" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';

    return $img_tag;
}

function handle_img_tag_right($url, $is_signature = false)
{
    global $lang_common, $pun_config, $pun_user;

    $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>';

    if ($is_signature && $pun_user['show_img_sig'] != '0')
        $img_tag = '<img class="sigimage_right" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
    else if (!$is_signature && $pun_user['show_img'] != '0')
        $img_tag = '<img class="postimg_right" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';

    return $img_tag;
}

Find:

$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $text);

After add:

$text = preg_replace('#\[img=left\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag_left(\'$1$3\')', $text);
$text = preg_replace('#\[img=right\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag_right(\'$1$3\')', $text);

Find (yes, there's two of them):

$text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\', true)', $text);

After add:

$text = preg_replace('#\[img=left\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag_left(\'$1$3\', true)', $text);
$text = preg_replace('#\[img=right\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag_right(\'$1$3\', true)', $text);

Open the CSS files you want to add the floating-images feature to.

Add:

IMG.postimg_left {float:left;margin:4px;clear:left}
IMG.postimg_right{float:right;margin:4px;clear:right}
IMG.sigimage_left{float:left;margin:4px;clear:left}
IMG.sigimage_right{float:right;margin:4px;clear:right}

Now all you have to do is type [ img = <left or right> ] <image url> [ / img ] (without the spaces of course ;))

Re: PunCMS

i vote CodeXP and Connorhd get together and bust out the much wanted PunCMS. i for one have learned alot from your posts CodeXP, thank you.     *thumbs*

~James
FluxBB - Less is more

108

Re: PunCMS

Ludo wrote:

I'm not able to customise too much.
I need a homepage like Gary made (http://dragonfighter.gary13579.info/cms.php)
Unfortunately, this home page was made for 1.2 dev so it's useless to got it.
I need a homepage which uses punbb forum style.

Ludo,

Can't you just use the punBB CSS style sheets?
I remember there being a post about it around here somewhere - Use the search.

All that is on that page is stuff from extern.php.
It's what I'm using on my front page.

109

Re: PunCMS

Dr.Jeckyl wrote:

i vote CodeXP and Connorhd get together and bust out the much wanted PunCMS. i for one have learned alot from your posts CodeXP, thank you.     *thumbs*

Always happy to be of assistance smile

I don't think I'm quite ready for a task of the dimensions we're talking about here just yet though... I'm still in the 'learning process' wink

110

Re: PunCMS

lol i'm still in the learning process but i'm gonna try anyway, but for now i got to release the poll mod, do the miniportal and chat mod then i think i'll get started on this although i have no idea how long it will take for me to get something out, hopefully once the project is started anyone will be able to help with either the main code, styles, or modules for it

111

Re: PunCMS

Connorhd wrote:

lol i'm still in the learning process but i'm gonna try anyway, but for now i got to release the poll mod, do the miniportal and chat mod then i think i'll get started on this although i have no idea how long it will take for me to get something out, hopefully once the project is started anyone will be able to help with either the main code, styles, or modules for it

I'd love to help, but considering that you seem to be a lot more experienced with PHP programming than I am I'm not sure I'd be of much use... I'm better at debugging than I am at the actual coding process wink

112

Re: PunCMS

Connohrd,

as you've released poll mod, does it mean that you're now working on miniportal?

Ludo,

113

Re: PunCMS

Yeh sort of i haven't done much on it yet, and i've actually given up the poll mod now since Mediator has started on a better one i would have the miniportal out by now but i need to use a different way of doing it cos of floats and clears with 1.2 sad

114

Re: PunCMS

Cool!
If you need advice for apperance I'm ok. Have you got a beta version of miniportal installed somewhere?

Ludo,

115 (edited by Ludo 2005-03-24 14:06)

Re: PunCMS

Code XP,

I just tried to make what you told me.

I modified parser.php. See it now:

<?php
/***********************************************************************

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  This file is part of PunBB.

  PunBB is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

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

// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
    exit;


// Here you can add additional smilies if you like (please note that you must escape singlequote and backslash)
$smiley_text = array(':)', '=)', ':|', '=|', ':(', '=(', ':D', '=D', ':o', ':O', ';)', ':/', ':P', ':lol:', ':mad:', ':rolleyes:', ':cool:');
$smiley_img = array('smile.png', 'smile.png', 'neutral.png', 'neutral.png', 'sad.png', 'sad.png', 'big_smile.png', 'big_smile.png', 'yikes.png', 'yikes.png', 'wink.png', 'hmm.png', 'tongue.png', 'lol.png', 'mad.png', 'roll.png', 'cool.png');

// Uncomment the next row if you add smilies that contain any of the characters &"'<>
//$smiley_text = array_map('pun_htmlspecialchars', $smiley_text);


//
// Make sure all BBCodes are lower case and do a little cleanup
//
function preparse_bbcode($text, &$errors, $is_signature = false)
{
    // Change all simple BBCodes to lower case
    $a = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]');
    $b = array('[b]', '[i]', '[u]', '[/b]', '[/i]', '[/u]');
    $text = str_replace($a, $b, $text);

    // Do the more complex BBCodes (and strip excessive whitespace)
    $a = array( '#\[url=(.*?)\]\s*#i',
                '#\[url\]\s*#i',
                '#\s*\[/url\]#i',
                '#\[email=(.*?)\]\s*#i',
                '#\[email\]\s*#i',
                '#\s*\[/email\]#i',
                '#\[img\]\s*(.*?)\s*\[/img\]#is',
                '#\[colou?r=(.*?)\](.*?)\[/colou?r\]#is');

    $b = array(    '[url=$1]',
                '[url]',
                '[/url]',
                '[email=$1]',
                '[email]',
                '[/email]',
                '[img]$1[/img]',
                '[color=$1]$2[/color]');

    if (!$is_signature)
    {
        // For non-signatures, we have to do the quote and code tags as well
        $a[] = '#\[quote=("|"|\'|)(.*?)\\1\]\s*#i';
        $a[] = '#\[quote\]\s*#i';
        $a[] = '#\s*\[/quote\]\s*#i';
        $a[] = '#\[code\][\r\n]*(.*?)\s*\[/code\]\s*#is';

        $b[] = '[quote=$1$2$1]';
        $b[] = '[quote]';
        $b[] = '[/quote]
'."\n";
        $b[] = 'code$1code'."\n";
    }

    // Run this baby!
    $text = preg_replace($a, $b, $text);

    if (!$is_signature)
    {
        $overflow = check_tag_order($text, $error);

        if ($error)
            // A BBCode error was spotted in check_tag_order()
            $errors[] = $error;
        else if ($overflow)
            // The quote depth level was too high, so we strip out the inner most quote(s)
            $text = substr($text, 0, $overflow[0]).substr($text, $overflow[1], (strlen($text) - $overflow[0]));
    }
    else
    {
        global $lang_prof_reg;

        if (preg_match('#\[quote=("|"|\'|)(.*)\\1\]|\[quote\]|\[/quote\]|\[code\]|\[/code\]#i', $text))
            message($lang_prof_reg['Signature quote/code']);
    }

    return trim($text);
}


//
// Parse text and make sure that code and [quote]syntax is correct
//
function check_tag_order($text, &$error)
{
    global $lang_common;

    // The maximum allowed quote depth
    $max_depth = 3;

    $cur_index = 0;
    $q_depth = 0;

    while (true)
    {
        // Look for regular code and quote tags
        $c_start = strpos($text, 'code');
        $c_end = strpos($text, 'code');
        $q_start = strpos($text, '[quote]');
        $q_end = strpos($text, '[/quote]
');

        // Look for [quote=username]style quote tags
        if (preg_match('#\[quote=("|"|\'|)(.*)\\1\]#sU', $text, $matches))
            $q2_start = strpos($text, $matches[0]);
        else
            $q2_start = 65536;

        // Deal with strpos() returning false when the string is not found
        // (65536 is one byte longer than the maximum post length)
        if ($c_start === false) $c_start = 65536;
        if ($c_end === false) $c_end = 65536;
        if ($q_start === false) $q_start = 65536;
        if ($q_end === false) $q_end = 65536;

        // If none of the strings were found
        if (min($c_start, $c_end, $q_start, $q_end, $q2_start) == 65536)
            break;

        // We are interested in the first quote (regardless of the type of quote)
        $q3_start = ($q_start < $q2_start) ? $q_start : $q2_start;

        // We found a [quote]or a [quote=username]if ($q3_start < min($q_end, $c_start, $c_end))
        {
            $step = ($q_start < $q2_start) ? 7 : strlen($matches[0]);

            $cur_index += $q3_start + $step;

            // Did we reach $max_depth?
            if ($q_depth == $max_depth)
                $overflow_begin = $cur_index - $step;

            ++$q_depth;
            $text = substr($text, $q3_start + $step);
        }

        // We found a[/quote]
else if ($q_end < min($q_start, $c_start, $c_end))
        {
            if ($q_depth == 0)
            {
                $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 1'];
                return;
            }

            $q_depth--;
            $cur_index += $q_end+8;

            // Did we reach $max_depth?
            if ($q_depth == $max_depth)
                $overflow_end = $cur_index;

            $text = substr($text, $q_end+8);
        }

        // We found a code
        else if ($c_start < min($c_end, $q_start, $q_end))
        {
            $tmp = strpos($text, 'code');
            if ($tmp === false)
            {
                $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 2'];
                return;
            }
            else
                $text = substr($text, $tmp+7);

            $cur_index += $tmp+7;
        }

        // We found a code (this shouldn't happen since we handle both start and end tag in the if clause above)
        else if ($c_end < min($c_start, $q_start, $q_end))
        {
            $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 3'];
            return;
        }
    }

    // If $q_depth <> 0 something is wrong with the quote syntax
    if ($q_depth)
    {
        $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 4'];
        return;
    }
    else if ($q_depth < 0)
    {
        $error = $lang_common['BBCode error'].' '.$lang_common['BBCode error 5'];
        return;
    }

    // If the quote depth level was higher than $max_depth we return the index for the
    // beginning and end of the part we should strip out
    if (isset($overflow_begin))
        return array($overflow_begin, $overflow_end);
    else
        return null;
}


//
// Split text into chunks ($inside contains all text inside $start and $end, and $outside contains all text outside)
//
function split_text($text, $start, $end)
{
    global $pun_config;

    $tokens = explode($start, $text);

    $outside[] = $tokens[0];

    $num_tokens = count($tokens);
    for ($i = 1; $i < $num_tokens; ++$i)
    {
        $temp = explode($end, $tokens[$i]);
        $inside[] = $temp[0];
        $outside[] = $temp[1];
    }

    if ($pun_config['o_indent_num_spaces'] != 8 && $start == 'code')
    {
        $spaces = str_repeat(' ', $pun_config['o_indent_num_spaces']);
        $inside = str_replace("\t", $spaces, $inside);
    }

    return array($inside, $outside);
}


//
// Truncate URL if longer than 55 characters (add http:// or ftp:// if missing)
//
function handle_url_tag($url, $link = '')
{
    global $pun_user;

    $full_url = str_replace(' ', '%20', $url);
    if (strpos($url, 'www.') === 0)            // If it starts with www, we add http://
        $full_url = 'http://'.$full_url;
    else if (strpos($url, 'ftp.') === 0)    // Else if it starts with ftp, we add ftp://
        $full_url = 'ftp://'.$full_url;
    else if (!preg_match('#^([a-z0-9]{3,6})://#', $url, $bah))     // Else if it doesn't start with abcdef://, we add http://
        $full_url = 'http://'.$full_url;

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

    return '<a href="'.$full_url.'">'.$link.'</a>';
}


//
// Turns an URL from the [img] tag into an <img> tag or a <a href...> tag
//
function handle_img_tag($url, $is_signature = false)
{
    global $lang_common, $pun_config, $pun_user;

    $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>';

    if ($is_signature && $pun_user['show_img_sig'] != '0')
        $img_tag = '<img class="sigimage" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
    else if (!$is_signature && $pun_user['show_img'] != '0')
        $img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';

    return $img_tag;
}

function handle_img_tag_left($url, $is_signature = false)
{
    global $lang_common, $pun_config, $pun_user;

    $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>';

    if ($is_signature && $pun_user['show_img_sig'] != '0')
        $img_tag = '<img class="sigimage_left" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
    else if (!$is_signature && $pun_user['show_img'] != '0')
        $img_tag = '<img class="postimg_left" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';

    return $img_tag;
}

function handle_img_tag_right($url, $is_signature = false)
{
    global $lang_common, $pun_config, $pun_user;

    $img_tag = '<a href="'.$url.'"><'.$lang_common['Image link'].'></a>';

    if ($is_signature && $pun_user['show_img_sig'] != '0')
        $img_tag = '<img class="sigimage_right" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
    else if (!$is_signature && $pun_user['show_img'] != '0')
        $img_tag = '<img class="postimg_right" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';

    return $img_tag;
}

//
// Convert BBCodes to their HTML equivalent
//
function do_bbcode($text)
{
    global $lang_common, $pun_user;

    $pattern = array('#\[b\](.*?)\[/b\]#s',
                     '#\[i\](.*?)\[/i\]#s',
                     '#\[u\](.*?)\[/u\]#s',
                     '#\[url\](.*?)\[/url\]#e',
                     '#\[url=(.*?)\](.*?)\[/url\]#e',
                     '#\[email\](.*?)\[/email\]#',
                     '#\[email=(.*?)\](.*?)\[/email\]#',
                     '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');

    $replace = array('<strong>$1</strong>',
                     '<em>$1</em>',
                     '<span class="bbu">$1</span>',
                     'handle_url_tag(\'$1\')',
                     'handle_url_tag(\'$1\', \'$2\')',
                     '<a href="mailto:$1">$1</a>',
                     '<a href="mailto:$1">$2</a>',
                     '<span style="color: $1">$2</span>');

    // This thing takes a while! :)
    $text = preg_replace($pattern, $replace, $text);

    if (strpos($text, 'quote') !== false)
    {
        $text = str_replace('[quote]', '</p><blockquote><div class="incqbox"><p>', $text);
        $text = preg_replace('#\[quote=("|"|\'|)(.*)\\1\]#seU', '"</p><blockquote><div class=\"incqbox\"><h4>".str_replace(\'[\', \'[\', \'$2\')." ".$lang_common[\'wrote\'].":</h4><p>"', $text);
        $text = preg_replace('#\[\/quote\]\s*#', '</p></div></blockquote><p>', $text);
    }

    return $text;
}


//
// Make hyperlinks clickable
//
function do_clickable($text)
{
    global $pun_user;

    $text = ' '.$text;

    $text = preg_replace('#([\s\(\)])(https?|ftp|news){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.handle_url_tag(\'$2://$3\')', $text);
    $text = preg_replace('#([\s\(\)])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^"\s\(\)<\[]*)?)#ie', '\'$1\'.handle_url_tag(\'$2.$3\', \'$2.$3\')', $text);

    return substr($text, 1);
}


//
// Convert a series of smilies to images
//
function do_smilies($text)
{
    global $smiley_text, $smiley_img;

    $text = ' '.$text.' ';

    $num_smilies = count($smiley_text);
    for ($i = 0; $i < $num_smilies; ++$i)
        $text = preg_replace("#(?<=.\W|\W.|^\W)".preg_quote($smiley_text[$i], '#')."(?=.\W|\W.|\W$)#m", '$1<img src="img/smilies/'.$smiley_img[$i].'" width="15" height="15" alt="'.substr($smiley_img[$i], 0, strrpos($smiley_img[$i], '.')).'" />$2', $text);

    return substr($text, 1, -1);
}


//
// Parse message text
//
function parse_message($text, $hide_smilies)
{
    global $pun_config, $lang_common, $pun_user;

    if ($pun_config['o_censoring'] == '1')
        $text = censor_words($text);

    // Convert applicable characters to HTML entities
    $text = pun_htmlspecialchars($text);

    // If the message contains a code tag we have to split it up (text within codecode shouldn't be touched)
    if (strpos($text, 'code') !== false && strpos($text, 'code') !== false)
    {
        list($inside, $outside) = split_text($text, 'code', 'code');
        $outside = array_map('ltrim', $outside);
        $text = implode('<">', $outside);
    }

    if ($pun_config['o_make_links'] == '1')
        $text = do_clickable($text);

    if ($pun_config['o_smilies'] == '1' && $pun_user['show_smilies'] == '1' && $hide_smilies == '0')
        $text = do_smilies($text);

    if ($pun_config['p_message_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
    {
        $text = do_bbcode($text);

        if ($pun_config['p_message_img_tag'] == '1')
        {
//            $text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\')', $text);
            $text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\')', $text);
                        $text = preg_replace('#\[img=left\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag_left(\'$1$3\')', $text);
                        $text = preg_replace('#\[img=right\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag_right(\'$1$3\')', $text);


        }
    }

    // Deal with newlines, tabs and multiple spaces
    $pattern = array("\n", "\t", '  ', '  ');
    $replace = array('<br />', '    ', '  ', '  ');
    $text = str_replace($pattern, $replace, $text);

    // If we split up the message before we have to concatenate it together again (code tags)
    if (isset($inside))
    {
        $outside = explode('<">', $text);
        $text = '';

        $num_tokens = count($outside);

        for ($i = 0; $i < $num_tokens; ++$i)
        {
            $text .= $outside[$i];
            if (isset($inside[$i]))
            {
                $num_lines = ((substr_count($inside[$i], "\n")) + 3) * 1.5;
                $height_str = ($num_lines > 35) ? '35em' : $num_lines.'em';
                $text .= '</p><div class="codebox"><div class="incqbox"><h4>'.$lang_common['Code'].':</h4><div class="scrollbox" style="height: '.$height_str.'"><pre>'.$inside[$i].'</pre></div></div></div><p>';
            }
        }
    }

    // Add paragraph tag around post, but make sure there are no empty paragraphs
    $text = str_replace('<p></p>', '', '<p>'.$text.'</p>');

    return $text;
}


//
// Parse signature text
//
function parse_signature($text)
{
    global $pun_config, $lang_common, $pun_user;

    if ($pun_config['o_censoring'] == '1')
        $text = censor_words($text);

    $text = pun_htmlspecialchars($text);

    if ($pun_config['o_make_links'] == '1')
        $text = do_clickable($text);

    if ($pun_config['o_smilies_sig'] == '1' && $pun_user['show_smilies'] != '0')
        $text = do_smilies($text);

    if ($pun_config['p_sig_bbcode'] == '1' && strpos($text, '[') !== false && strpos($text, ']') !== false)
    {
        $text = do_bbcode($text);

        if ($pun_config['p_sig_img_tag'] == '1')
        {
//            $text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\.(jpg|jpeg|png|gif)\[/img\]#e', 'handle_img_tag(\'$1$3.$4\', true)', $text);
            $text = preg_replace('#\[img\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag(\'$1$3\', true)', $text);
                        $text = preg_replace('#\[img=left\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag_left(\'$1$3\', true)', $text);
                        $text = preg_replace('#\[img=right\]((ht|f)tps?://)([^\s<"]*?)\[/img\]#e', 'handle_img_tag_right(\'$1$3\', true)', $text);



        }
    }

    // Deal with newlines, tabs and multiple spaces
    $pattern = array("\n", "\t", '  ', '  ');
    $replace = array('<br />', '    ', '  ', '  ');
    $text = str_replace($pattern, $replace, $text);

    return $text;
}

Note that for this code, I've been compelled to replace

 and

by code because punbb told me that there was bbcode problem in my message. If I had not do that, I could not have posted this message...

I've also added this in my .css:

IMG.postimg_left {float:left;margin:4px;clear:left}
IMG.postimg_right{float:right;margin:4px;clear:right}
IMG.sigimage_left{float:left;margin:4px;clear:left}
IMG.sigimage_right{float:right;margin:4px;clear:right}

The problem is that it does not work for me. See the result here http://www.pluriservices.net/forum/viewtopic.php?id=333

Have I made something wrong?

Ludo,

116

Re: PunCMS

I solved the problem alone... I had just forgotten to put */ in the css file...
Great work code xp. Maybe you could post it on punres if it is not done yet.


Ludo,

117

Re: PunCMS

Ludo wrote:

I solved the problem alone... I had just forgotten to put */ in the css file...
Great work code xp. Maybe you could post it on punres if it is not done yet.


Ludo,

Happy it worked out for you smile

Post it on punres? Well, I guess I could but is it really worth posting there? I mean, it's just a simple 'hack' smile

118

Re: PunCMS

post it in the hacks forum then? tongue

119

Re: PunCMS

So what is the status of this?

120

Re: PunCMS

waiting... i'll tell you when i start it wink

121 (edited by Ludo 2005-03-31 11:36)

Re: PunCMS

On mondayConnohrd told me "soon" ... smile for the miniportal

Ludo,

122

Re: PunCMS

Thats cool thanks.

123 (edited by Tobi 2005-07-16 16:53)

Re: PunCMS

No PunCMS so far I suppose?

I am looking for one, I've been going all the way across the net and back, I've read all the posts here related to cms and now I am much more confused than I was before.
Now what I want is a cms and I want punBB and it would be nice if one integrates into the other to a certain extend.
I do not want a blog. People seem to mix that up. Even the vendors of some of the blog sites I visited by accident because they said it was a CMS do. wink
I do not want anybody to post articles and comments except for the very few who are known to me and supposed to do this.
For me it should be more a stylewise framework and the possibility to have the layouts flexible.
This is one of the things a CMS does.
I did something similar in the past, it was for the online version of a newspaper.
But it looked totally ugly because I am not blessed with great designing skills so I thought Connors idea of taking the excellent CSS/designwork of PunBB into a cms is great.
But then again - how much has punBB to do with a cms?
Isn't it a bit like, say, integrating an electric toothbrush into a coffe machine?

So, Connor, are you still working on it or planning to work on it one happy day?
Will it be more than a blog system?
I mean, will it be be possible to have several different looking templates to chose from for an article, file management (downloadsectionwise I mean smile ) and the likes?
Including maybe a gallery / image stock for the writers?

Or is this all going to far and one has to make/take a CMS and try to make it look like PunBB or vice versa?
Hell, as you can see, all these CMS posts realy confused me.... smile

The German PunBB Site:
PunBB-forum.de

124

Re: PunCMS

my idea is to have a news/article system, a download system, gallery etc, and punbb, with lots of blocks so you could if you wanted use it for a blog, or for a different type of site

i did start working on it, i've just been really busy http://mypunbb.com/files2/CMS/ hopefully i'll get some time during the summer

all i've done so far is the blocks for the left and right get included from a cache file (i just made the cache file manually i haven't yet done the admin system that will make the cached file lol) plus the option to have a left and right bar or just the left bar (try going to a post and the right bar disappears)

atm the file cache_blocks.php looks like

<?php

define('PUN_BLOCKS_LOADED', 1);

$pun_rightblock = array (
    "latest_posts"
);

$pun_leftblock = array (
    "menu", "latest_posts"
);

and in the folder blocks i have
latest_posts.php and menu.php
just to give you an example of how menu.php is

<?php

$block_title = "Menu";
$block_content = '<p>Menu 1<br />Menu 2<br />Menu 3<br />Menu 4<br />Menu 5<br />Menu 6</p>';

?>

the block functions then put the two variables in the block, not sure if this is excatly how it will work but seems fine for the blocks atm

i'm also not sure how i'm going to do the modules, atm it requires mod_rewrite which allows it to have nice urls, however i might make it so that with mod_rewrite you get site.com/forum/ for the forum module and for the people without mod_rewrite it will still work if you do site.com/modules/forum/ with a slightly more complicated way of doing it

125

Re: PunCMS

Tobi,

Each application has it's place and function. A CMS or Blog is made to post stories on your front page, a forum is a natural for holding a conversation.

Rather than make Pun a CMS or a CMS into a forum, it's better to use the right tool for the job. As for a Blog not being a CMS, I beg to differ, I can make Nucleus look like anything I want.

Check out my sigs and see what we've done with Nucleus and PunBB, you'll be surprised.