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']);
        $form['history_message'] = 'Enter your story here.';

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

Now let's find (700 line roughly)

                                    <th scope="row">Maintenance message</th>
                                        <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>

And enter after this:

                                    <th scope="row">Use forum history</th>
                                        <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>
                                    <th scope="row">History</th>
                                        <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>

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>
    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