26

(277 replies, posted in PunBB 1.2 discussion)

Greate Job, Rickard and Paul! there is a big change in style. I like it. by the way, how is the pronounciation of Rickard? rikard or richard?

thnaks, Sander D.

bobitt wrote:

MAN! i like this system.. cant you post the newer version (saw on site that it had been updated) with permission settings working?

Id be much pleased

I've uploaded the newer file. please download again. and I'm sorry for being late for development of my mod. I'm not a programmer nor the designer. I'm a mechanical engineer. so I'm limited in time. in Korea we have to work from monday to saturday. anyway thanks for loving my mod.

EDIT: Just overwrite the old files.

this code is for finding when you add some code and it causes problem. this code is not for every case as you know.

when at least login.php, admin_options.php, index.php is working you can turn on the debug mode even though you don't have to enable debug by editing the common.php. this code is for that case.

in common.php

1. find

while ($cur_config_item = $db->fetch_row($result))
    $pun_config[$cur_config_item[0]] = $cur_config_item[1];

2. after add

if (!defined('PUN_DEBUG') && $pun_config['o_debug_mode'] == '1')
    define('PUN_DEBUG', 1);

in admin_options.php

3. find

                    <tr>
                        <td class="punright" style="width: 35%"><b>Message</b><br>The message that will be displayed to users when the board is in maintenance mode. If left blank a default message will be used. This text will not be parsed like regular posts and thus may contain HTML.</td>
                        <td style="width: 65%"><textarea name="form[maintenance_message]" rows="5" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_maintenance_message']) ?></textarea></td>
                    </tr>
                </table>
            </td>
        </tr>

4. after add

        <tr>
            <td class="puncon1right" style="width: 140px; white-space: nowrap">Debug  </td>
            <td class="puncon2">
                <table class="punplain" cellpadding="6">
                    <tr>
                        <td class="punright" style="width: 35%"><a name="debug_mode"><b>Debug mode</b></a><br>When enabled, the board will turn on the debug mode. WARNING! Do not enble except when you are trying to find out codes that cause any problem.</td>
                        <td style="width: 65%"><input type="radio" class="puninput" name="form[debug_mode]" value="1"<?php if ($pun_config['o_debug_mode'] == '1') echo ' checked' ?>> Yes   <input type="radio" class="puninput" name="form[debug_mode]" value="0"<?php if ($pun_config['o_debug_mode'] == '0') echo ' checked' ?>> No</td>
                    </tr>
                </table>
            </td>
        </tr>

5. don't forget to execute the following sql:

insert into your_punbb_config values ( 'o_debug_mode', '0');

sometimes i hate changing code directly.

Suggestion:

1. I think group_id is nicer than group in forum table.

2. Current mod has an array value in groups table(members), I think it is more faster when we have an array value in users table(maybe groups or sth like). because forum numbers might not be more than that of users. smile

anyway. thanks. I appreciate your labor!

eeeeh. sorry there are some bugs in it. sooner or later I will upload new version again.

anyway thanks.

Edit : I've uploaded a patched file. please download again.

33

(9 replies, posted in PunBB 1.2 discussion)

Maybe php + fun + board... ;P

what i've done... fool me!

It's Swidish to me!@@

I've tested with phpMyAdmin and found the same result.

for example with phpMyAdmin I tested with the query "select id, message from punbb_posts where message like 'kundjänst';" and the result is no rows. interesting.

I see, thanks for your kind explaination.

I mean, parden if I say wrong, that the when we post an article, is it saved into mysql with swidish characters or something like "Tack f? ditt bes? p?Yahoo! Sverige" if the latter is right, then the character "?" is replaced with ' '(space) by search.php's noise match filter. then we cannot get proper information. I think we can check like this

1. find in search.php

                    // Filter out non-alphabetical chars
                    $noise_match = array('^', '$', '&', '(', ')', '<', '>', '`', '\'', '"', '|', ',', '@', '_', '?', '%', '~', '.', '[', ']', '{', '}', ':', '\\', '/', '=', '#', '\'', ';', '!', '?);
                    $noise_replace = array(' ', ' ', ' ', ' ', ' ', ' ', ' ', '',  '',   ' ', ' ', ' ', ' ', '',  ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '' ,  ' ', ' ', ' ', ' ',  ' ', ' ', ' ');
                    $keywords = str_replace($noise_match, $noise_replace, $keywords);

2. add this code after that

exit($keywords);

3. finally we can check how the $keywords is changed. I think all the "?" character is replaced with space if the latter case is right.

this is the example. Richard's signature is shown in notepad.exe as "Nice catch blanco ni?, but too bad your ass got saaaaaaaaaaaaaacked!".

it might be wrong but how about trying setting lang_multibyte true? My idea is other language except english is much like multibyte, and when you see the source of swidish website it might show you using ? and the "?" is in the noise match and is replaced ' '. so you will not lose anything if you try setting it true.

I wonder if it is working when lang_multibyte is set true...

a bug found in functions.php. so anyone who downloaded my code, download again please.

Yeah. My own effort and your code. so wanna give you thanks.

I cannot tell what kind of. because of my short english. I just made for my own use and my church homepage.

Wiki Document System plugin version 0.0.1

Timeline, MacroIndex is not finished.
only one macro is working : showActivePages

test it at http://jacobswell.nared.net/punbb/wiki.php

http://jacobswell.nared.net/upload/wikids.zip


study the code for I'm not a good explainer. in fact the code is not compacted. so it does not look nice.

How to install Wiki Document System plugin version 0.0.1


================================================
= locate following files into 'include' folder =
================================================
copy wikids folder and all the files in it into include folder

================================================
= locate following files into 'lang/en' folder =
================================================
en_wikids.php

================================================
= locate following files into your site folder =
================================================

wiki.php
install_wikids.php

========================
= add to en_common.php =
========================

'Documents'=>'Documents',





=====================================================
= open include/functions.php & edit like the following code =
=====================================================

//
// Generate the "navigator" that appears at the top of every page
//
function generate_navlinks()
{
    global $pun_config, $lang_common, $cookie, $cur_user;

    // Home and Userlist should always be displayed
    $links[] = '<a href="index.php">'.$lang_common['Home'].'</a>';
    if (isset($pun_config['o_wiki_plugin']) && $pun_config['o_wiki_plugin'] == '1')
        $links[] = '<a href="wiki.php">'.$lang_common['Documents'].'</a>';
    $links[] = '<a href="userlist.php">'.$lang_common['User list'].'</a>';





================================================
= execute install_wikids.php & delete the file =
================================================


=====================
= admin_options.php =
=====================
1. find
                    <tr>
                        <td class="punright" style="width: 35%"><b>GZip output</b><br>If enabled, PunBB will gzip the output sent to browsers. This will reduce bandwidth usage, but use a little more CPU. This feature requires that PHP is configured with zlib (--with-zlib). Note: If you already have the Apache module mod_gzip set up to compress PHP scripts, you should disable this feature.</td>
                        <td style="width: 65%"><input type="radio" class="puninput" name="form[gzip]" value="1"<?php if ($pun_config['o_gzip'] == '1') echo ' checked' ?>> Yes   <input type="radio" class="puninput" name="form[gzip]" value="0"<?php if ($pun_config['o_gzip'] == '0') echo ' checked' ?>> No</td>
                    </tr>
                </table>
            </td>
        </tr>

2. insert after

        <tr>
            <td class="puncon1right" style="width: 140px; white-space: nowrap">Plugin  </td>
            <td class="puncon2">
                <table class="punplain" cellpadding="6">
                    <tr>
                        <td class="punright" style="width: 35%"><b>Wiki Document System</b><br>Enable if you want to use Wiki Document System.</td>
                        <td style="width: 65%"><input type="radio" class="puninput" name="form[wiki_plugin]" value="1"<?php if ($pun_config['o_wiki_plugin'] == '1') echo ' checked' ?>> Yes   <input type="radio" class="puninput" name="form[wiki_plugin]" value="0"<?php if ($pun_config['o_wiki_plugin'] == '0') echo ' checked' ?>> No</td>
                    </tr>
                </table>
            </td>
        </tr>

http://jacobswell.nared.net/upload/bbcodeMOD1.0.2.rar

Maciek's code: version 1.0.2.

aha, sorry I just missed the following code...

$result = $db->query('SELECT status,owner FROM '.$db->prefix.'messages WHERE id='.$id) or error('Unable to get message status', __FILE__, __LINE__, $db->error());
    list($status, $owner) = $db->fetch_row($result);

I just assume the same code as usual.

sorry again.:)

46

(24 replies, posted in PunBB 1.2 bug reports)

Nice XuMiX!

preg_replace('#\[img\]((ht|f)tp://)([^\r\n\t<"\'\?&=]+\.(bmp|tif|jpg|jpeg|gif|png))\[/img\]#si', '<img src="$1$3".....

Chacmool!

if ($owner != $cur_user['id'])
        message($lang_common['No permission']);

if you add above code to message_list.php, you cannot read even your own message! need not to be added.

48

(6 replies, posted in PunBB 1.2 discussion)

Now you can test my Wiki Document System plugin just a little bit!
http://jacobswell.nared.net/punbb/wiki.php

I've tested whole thing. if we include a file which location is in under 2 or more folders, $tpl_main has no value. for ex.

<?php
/*
** Tests message() function
*/

$pun_root = './';

require $pun_root.'include/common.php';

$pun_title = 'PunBB - Tests message function';
require $pun_root.'header.php';

require $pun_root.'include/temp/temp/temp.php';

require $pun_root.'footer.php';
?>

temp/temp/temp.php

<?php
message('Do you see me?');
?>

but when we declare $tpl_main as global in message(), it's OK.

CreatePage.php is started like this. you can get the source by clicking above link

<?php
// default function
if ( $cookie['is_guest'] && $wiki_config['p_guests_read'] == '0' )
    message($lang_wiki['Login required']);

I had to spend so many hours to find out. I just thought it should come out. only to find that in message function $tpl_main is not defined. so I made it global. everything I expected displayed.