1 (edited by seva 2005-10-14 12:18)

Topic: Additional pages via misc.php

For example, let's make page with site history

Open admin_options.php

Find "$form['timeout_visit'] = intval($form['timeout_visit']);" (110 line roughly)
Add before it:

    if ($form['history_message'] != '')
        $form['history_message'] = pun_linebreaks($form['history_message']);
    else
    {
        $form['history_message'] = 'Enter your story here.';

        if ($form['history'] == '1')
            $form['history'] = '0';
    }

Now let's find (700 line roughly)

                                <tr>
                                    <th scope="row">Maintenance message</th>
                                    <td>
                                        <textarea name="form[maintenance_message]" rows="5" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_maintenance_message']) ?></textarea>
                                        <span>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.</span>
                                    </td>
                                </tr>

And enter after this:

                                <tr>
                                    <th scope="row">Use forum history</th>
                                    <td>
                                        <input type="radio" name="form[history]" value="1"<?php if ($pun_config['o_history'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong>   <input type="radio" name="form[history]" value="0"<?php if ($pun_config['o_history'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
                                        <span>When enabled, there will be History page.</span>
                                    </td>
                                </tr>
                                <tr>
                                    <th scope="row">History</th>
                                    <td>
                                        <textarea name="form[history_message]" rows="10" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_history_message']) ?></textarea>
                                        <span>Here you can enter any information. This text will not be parsed like regular posts and thus may contain HTML.</span>
                                    </td>
                                </tr>

Well done, now open misc.php
Find first :     "require PUN_ROOT.'footer.php'; }"
After it add:

else if ($action == 'history')
{
    // Load the language file
    require PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';

    $page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_common['Net history'];
    require PUN_ROOT.'header.php';

?>
<div class="block">
    <h2><span><?php echo $lang_common['Net history'] ?></span></h2>
    <div class="box">
        <div class="inbox">
            <p><?php echo $pun_config['o_history_message'] ?></p>
        </div>
    </div>
</div>
<?php
    require PUN_ROOT.'footer.php';
}

Ok.. now open lang/common.php and add

'Net history'     =>     'Net history',

Don't forget add extra fields to DB, gl
you'll can see your page  by url: http://yoursite.com/misc.php?action=history

Hmm... don't knock me if it's a bathos of stupidity

Hm... every pixel has it's own destiny