1 (edited by jacobswell 2004-08-10 06:17)

Topic: debug mode option

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.

Re: debug mode option

It's in the code for a reason. How would you enable it via the admin interface if the database is b0rked? :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: debug mode option

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.

Re: debug mode option

Ok ok :)

"Programming is like sex: one mistake and you have to support it for the rest of your life."