176

(6 replies, posted in PunBB 1.2 troubleshooting)

FWIW, this is the part of install.php I was talking about:

<label><strong>Base URL</strong><br /><input type="text" name="req_base_url" value="http://<?php echo $_SERVER['SERVER_NAME'].str_replace('\\', '/', dirname($_SERVER['SCRIPT_NAME'])) ?>" size="60" maxlength="100" /><br /></label>

177

(6 replies, posted in PunBB 1.2 troubleshooting)

install.php has "http" by default, but it doesn't remove it if you put it there (neither does admin_options). I don't see any replacements in `confirm_referrer` either?

178

(4 replies, posted in PunBB 1.2 discussion)

Quite a few places? http://punbb.org/forums/viewforum.php?id=34

In the color scheme for your style (most likely the file inside the `style/imports` folder that ends in `_cs.css`), look for something like this:

div.blockpost h2 span.conr

180

(3 replies, posted in Feature requests)

deadram wrote:

just add in the option to turn it on/off in ./admin_options.php, and then punres it big_smile

I'm not changing it everywhere; If I wanted that, I'd just comment it out.

wobo wrote:

How do I do that? Seems that without this regeneration the changes are not visible.

You can delete the files from your cache folder manually, or grab the "Clear Cache" plugin from the downloads page.

Jérémie wrote:

Thanks. With what PunBB files included ? It's an external script, so I don't include anything from PunBB (but I can).

Well, I pulled most of that query from extern.php, but you should be fine with just including `include/common.php`.

183

(3 replies, posted in Feature requests)

I've used this before in a couple of instances where I didn't want relative dates (e.g. "Today" or "Yesterday"); Thought I'd post a few lines here to see if anyone thinks it's worth a few extra bytes.

function format_time($timestamp, $date_only = false, $date_relative = true)
{
    // rest of the function

    if ($date_relative)
    {
        if ($date == $today)
            $date = $lang_common['Today'];
        else if ($date == $yesterday)
            $date = $lang_common['Yesterday'];        
    }

    // rest of the function
}

184

(6 replies, posted in Feature requests)

Find the query in index.php?

// Print the categories and forums

?and remove the `WHERE` statement:

WHERE fp.read_forum IS NULL OR fp.read_forum=1

I didn't test it, but something like this should work:

$result = $db->query('SELECT t.last_post FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT 1') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
$last_post = format_time($db->result($result));

186

(51 replies, posted in News)

CReatiVe4w3 wrote:

A blog! I just realized that you're missing a comma after "unfortunately", too (from the 1.3 pics) -_-

Off topic: Isn't your comma misplaced? (j/k)

trevor wrote:

I swear I saw an example extension floating around here a while ago, but I can't seem to find it now.

Maybe you're thinking of the thread where the Private Message extension was mentioned.

See also:
http://dev.punbb.org/timeline
http://blog.punbb.org/

188

(3 replies, posted in General discussion)

wobo wrote:

Where is...
... the smilie list (important)
... the list of available bbc tags (important)

They are defined in include/parser.php and explained in help.php. If you want to show them on the post, edit, and message_send pages, then check out Easy BBCode.

wobo wrote:

Why do I get a "new posts" mark in ?

The current system is just based on the timestamp of your last visit. If you want to change this right now, you can check out the Mark topics as read mod. FYI, this behavior will be improved in the next major version.

wobo wrote:

How do I get Subforums? I searched the mod ressources but the only "subforum" mod was not available (download page showed 404).

The author posted a new link inside the dicussion topic.

189

(51 replies, posted in News)

Some parts of 1.3 may work or look differently than 1.2.

trucktime wrote:

Any idea why?

The `message()` occurs in login.php. All you did was change a link inside the message. You need to use a redirect instead (like Smartys said before).

if (!$authorized)
    redirect('index.php', $lang_login['Wrong user/pass'])

191

(12 replies, posted in Feature requests)

asbjornu, I didn't read much of what you said, but I thought of this:

http://img444.imageshack.us/img444/244/ … ionda5.png

Is that kind of what you're talking about? (If that makes any sense to you?)

192

(51 replies, posted in News)

Look at the tickets and keep an eye on the timeline.

193

(2 replies, posted in PunBB 1.2 discussion)

Try this: Batch User Register

194

(11 replies, posted in Programming)

deadram wrote:

a C/C++ coded irc server outputing html, or at the very least rss and keeping at least 1 year of archived chat logs

What happens when you're using multiple servers with hundreds or thousands of channels?

AP_Mass_PM.php

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

  Copyright (C) 2007  guardian34 (punbb@fmguy.com)

  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;

// Tell admin_loader.php that this is indeed a plugin and that it is loaded
define('PUN_PLUGIN_LOADED', 1);

// Load the language files
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/pms.php';
require_once PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';


if (isset($_POST['send']))
{
    $group = intval($_POST['group']);
    $subject = pun_trim($_POST['subject']);
    $message = pun_linebreaks(pun_trim($_POST['message']));
    $hide_smilies = (isset($_POST['hide_smilies'])) ? 1 : 0;

    // Check group
    if ($group < 0 || $group == 3)
        message('You didn\'t specify a valid group!');

    // Check subject
    if ($subject == '')
        message($lang_post['No subject']);
    else if (pun_strlen($subject) > 70)
        message($lang_post['Too long subject']);

    // Check message
    if ($message == '')
        message($lang_post['No message']);
    else if (strlen($message) > 65535)
        message($lang_post['Too long message']);

    // Validate BBCode syntax
    if ($pun_config['p_message_bbcode'] == '1' && strpos($message, '[') !== false && strpos($message, ']') !== false)
    {
        require PUN_ROOT.'include/parser.php';
        $message = preparse_bbcode($message, $errors);
    }
    if (isset($errors))
        message($errors[0]);


    // Get group members
    $where_sql = ($group != 0) ? 'group_id='.$group : 'id!=1';
    $result = $db->query('SELECT id, username FROM '.$db->prefix.'users WHERE '.$where_sql) or error('Unable to fetch group members', __FILE__, __LINE__, $db->error());
    if ($db->num_rows($result) == 0)
        message('No members found for group '.$group.'.');

    // Save a copy of the message for the sender
    if(isset($_POST['save_message']))
    {
        $db->query('INSERT INTO '.$db->prefix.'messages (owner, subject, message, sender, sender_id, sender_ip, smileys, showed, status, posted) VALUES(
            \''.$pun_user['id'].'\',
            \''.$db->escape($subject).'\',
            \''.$db->escape($message).'\',
            \''.$db->escape($user).'\',
            \''.$pun_user['id'].'\',
            \''.get_remote_address().'\',
            \''.$hide_smilies.'\',
            \'1\',
            \'1\',
            \''.time().'\'
        )') or error('Unable to save message', __FILE__, __LINE__, $db->error());
    }

    // Send messages
    while ($cur_user = $db->fetch_assoc($result))
    {
        $db->query('INSERT INTO '.$db->prefix.'messages (owner, subject, message, sender, sender_id, sender_ip, smileys, showed, status, posted) VALUES(
            \''.$cur_user['id'].'\',
            \''.$db->escape($subject).'\',
            \''.$db->escape($message).'\',
            \''.$db->escape($pun_user['username']).'\',
            \''.$pun_user['id'].'\',
            \''.get_remote_address().'\',
            \''.$hide_smilies.'\',
            \'0\',
            \'0\',
            \''.time().'\'
        )') or error('Unable to send message', __FILE__, __LINE__, $db->error());
    }

    redirect($_SERVER['REQUEST_URI'], 'Private messages sent');
}


// Display the admin navigation menu
generate_admin_menu($plugin);

?>
    <div class="block">
        <h2><span>Mass Private Message - v1.0</span></h2>
        <div class="box">
            <div class="inbox">
                <form method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
                    <p>This plugin "sends" private messages to a group of users. (<em>Note:</em> Private message mod is required.)</p>
                </form>
            </div>
        </div>
    </div>

    <div class="blockform">
        <h2 class="block2"><span>Mass Private Message</span></h2>
        <div class="box">
            <form method="post" action="<?php echo $_SERVER['REQUEST_URI'] ?>">
                <div class="inform">
                    <fieldset>
                        <legend>Message</legend>
                        <div class="infldset">
                            <label><strong><?php echo $lang_pms['Send to'] ?></strong><br />
                                <select name="group">
                                    <option value="0" selected="selected">** All Users</option>
<?php
                                    // Get admin and moderator groups
                                    $result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id<'.PUN_GUEST.' ORDER BY g_id') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());                                    

                                    while ($cur_group = $db->fetch_assoc($result))
                                        echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";

                                    // Get other groups
                                    $result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups WHERE g_id>'.PUN_GUEST.' ORDER BY g_title') or error('Unable to fetch user group list', __FILE__, __LINE__, $db->error());

                                    while ($cur_group = $db->fetch_assoc($result))
                                        echo "\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";

?>                                </select><br />
                            </label>
                            
                            <label><strong><?php echo $lang_common['Subject'] ?></strong><br />
                            <input class="longinput" type="text" name="subject" value="" size="80" maxlength="70" style="width: 100%;" /><br /></label>
                            
                            <?php //require PUN_ROOT.'mod_easy_bbcode.php' ?>
                            
                            <label><strong><?php echo $lang_common['Message'] ?></strong><br />
                            <textarea name="message" rows="18" cols="95" style="width: 100%;"></textarea></label>
                            
                            <ul class="bblinks">
                                <li><a href="help.php#bbcode" onclick="window.open(this.href); return false;"><?php echo $lang_common['BBCode'] ?></a>: <?php echo ($pun_config['p_message_bbcode'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
                                <li><a href="help.php#img" onclick="window.open(this.href); return false;"><?php echo $lang_common['img tag'] ?></a>: <?php echo ($pun_config['p_message_img_tag'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
                                <li><a href="help.php#smilies" onclick="window.open(this.href); return false;"><?php echo $lang_common['Smilies'] ?></a>: <?php echo ($pun_config['o_smilies'] == '1') ? $lang_common['on'] : $lang_common['off']; ?></li>
                            </ul>
                        </div>
                    </fieldset>
                </div>
<?php
    $checkboxes = array();

    if ($pun_config['o_smilies'] == '1')
        $checkboxes[] = '<label><input type="checkbox" name="hide_smilies" value="1" />'.$lang_post['Hide smilies'];

    $checkboxes[] = '<label><input type="checkbox" name="save_message" value="1" />'.$lang_pms['Save message']; 

    if (!empty($checkboxes))
    {
?>                <div class="inform">
                     <fieldset>
                        <legend>Options</legend>
                        <div class="infldset">
                            <div class="infldset">
                                <div class="rbox">
                                    <?php echo implode('<br /></label>'."\n\t\t\t\t", $checkboxes).'<br /></label>'."\n" ?>
                                </div>
                            </div>
                        </div>
                    </fieldset>
                 </div>
<?php
    }
?>                <p class="submitend"><input type="submit" name="send" value="<?php echo $lang_pms['Send'] ?>" /></p>
            </form>
        </div>
    </div>

196

(124 replies, posted in PunBB 1.2 discussion)

Smartys wrote:

Either way, beside it not working on Apache 1.3.x, it seems quite good.

Is it still not working there? I was under the impression that this changeset dealt with the issue

Doesn't work for me on Apache/1.3.33.

197

(124 replies, posted in PunBB 1.2 discussion)

Jérémie wrote:

and with and without the topic (I don't know how it handle thread's topic edit).

I think it includes the id either way, and that's the only part used to find the right topic.

Rickard wrote:
Dr.Jeckyl wrote:

toggle able? tongue

Yes.

199

(4 replies, posted in Feature requests)

Yeah, what Smartys said.

PHP manual wrote:

Note: The order in which directory entries are returned by the read method is system-dependent.

200

(4 replies, posted in Feature requests)

Poomerio wrote:

Also, I want admins to be allowed to have a custom title whenever.

Admins already can.