6,651

(8 replies, posted in PunBB 1.2 discussion)

Except that's not the kind of thing 99% of people would want or need at any point, so it wouldn't get implemented like that tongue
But what you're suggesting is basically what I suggested, except you're having another variable be the prefix rather then hardcoding it into the files, which is fine as well

By "this site" I mean forums.punbb.org
I mean that I get a 404, versus on your site it loads the page tongue

Mmm, it sounds like it's your webhost manipulating something
ie: I can go to http://groningen-info.de/forum/viewforum and get the viewforum page, whereas if I go there for this site I get a 404

"Sorry sad, but once again, I really can't say that I understand what you're saying."
You add 2 columns to the topic table in your database: last edited time, last edited ID. When a post is edited, you set them. When you go to viewforum.php, you have it check not only the last posted time (which it already does) but the last edited time as well

"Does that mod achieve the desired effect with editing posts that I mentioned before?"
No, it simply makes the topic read icons get marked more accurately smile

"Ok, I see what you're saying now. My PHP isn't that good, and I'm not that familiar with PunBB's source or inner workings or anything, but anyway could I do something along these lines?:"
Kind of tongue
But if you did that, they would have moderation powers in all forums (including admin only forums!) tongue

"If that's possible, is there a file in /include or something (common.php? - I dunno, just guessing by the name) to which I could add the code? Or would I just have to add it individually to each file where it's needed (assuming that would work, of course)"
Nope, it has to be manually edited in each file (of course, you could change it so that they all include 1 file, and have that 1 file have the is_admmod stuff).

6,655

(67 replies, posted in News)

Nothing in the admin interface, or that would affect language files, was touched here tongue
I can see how you'd have an issue with, say, the changed files only package when a piece of the admin interface is updated, but in that case you should use patch or hdiff and manually update: a lot faster then redoing those strings smile

Now that I think about it, if you keep a "last edited" and "last edited post id" for each topic, you can check both: I was only thinking in terms of modding the code from what already existed.

Oh, and to explain #4 a little better
With a plain PunBB install, it's impossible to add another moderator group. However, if you edit the line in certain files for the variable $is_admmod (ie: edit.php, delete.php, viewforum.php, etc) so that another group matches it, you've "added" a group as moderators. You also have to make edits in profile.php so you can assign people in that user group to forums

4 isn't possible without editing every $is_admmod check and a couple others wink
3 is possible by commenting out the checkbox and changing

$edited_sql = (!isset($_POST['silent']) || !$is_admmod) ? $edited_sql = ', edited='.time().', edited_by=\''.$db->escape($pun_user['username']).'\'' : '';

to

$edited_sql = ', edited='.time().', edited_by=\''.$db->escape($pun_user['username']).'\'';

2. Is possible through moderate.php, they delete like normal topics

1. Is very difficult tongue

It is, especially for when they delete a whole thread tongue

badrad wrote:

But if they make a post, and I delete it, for all intensive purposes they haven't made it.

No, for all intents and purposes they made a post that you deleted tongue
There are plenty of reasons to delete posts, and not all of them (or even a majority) would be situations where you want post count to reflect the actual number of posts made. A good example for your side would be spam, but a good example for my side would be pruning old posts, or a user who deletes a whole thread (since they're the first poster), or a piece of data that was posted but that was deleted because it became out of date.

6,660

(4 replies, posted in PunBB 1.2 bug reports)

Localisation is correct smile

Main Entry: lo·cal·iza·tion
Variant: also British lo·cal·isa·tion /"lO-k&-l&-'zA-sh&n/

6,661

(7 replies, posted in Feature requests)

That was the GeoIP type stats I was talking about tongue

6,662

(7 replies, posted in PunBB 1.2 troubleshooting)

update users set language = 'Polish'

6,663

(7 replies, posted in PunBB 1.2 troubleshooting)

Meh, my mistake, use group_id instead of g_id tongue

So, like this:
UPDATE users SET group_id =1 WHERE id =2

6,664

(7 replies, posted in Feature requests)

Except that isn't in any standard format, and doesn't have to be a real location tongue
ie: Rickard's is set to 127.0.0.1
And I might list mine as NYC, USA and someone else might list theirs as New York City, and someone else might list theirs as NY NY tongue

6,665

(7 replies, posted in PunBB 1.2 troubleshooting)

yes, because you're missing the table name tongue
Like I said, replace prefix with the table prefix
So if the prefix for your tables is foo_ you would put foo_users as your table

6,666

(7 replies, posted in PunBB 1.2 troubleshooting)

Why not just create a new user and update their status in the profile page? tongue

Anyway, it's just a simple SQL query
UPDATE prefixusers set g_id = 1 where id = admin_id

replace prefix with the table prefix (or remove it if you have none)
replace admin_id with the id of the person you want to make admin

6,667

(7 replies, posted in Feature requests)

How, based on some kind of Geo IP stats?

6,668

(4 replies, posted in PunBB 1.2 bug reports)

Oh, and plus, the ban cache isn't extra code: it's already in common.php! tongue
Seriously, I would just add it: we use the cache in admin_options and admin_permissions, why not in ranks and bans as well?

I had debug mode on, and I saw this:

0.00073      SELECT g_id, g_title FROM foo_pun_groups WHERE g_id>3 ORDER BY g_title
0.00025     SELECT g_id, g_title FROM foo_pun_groups WHERE g_id>3 ORDER BY g_title
0.00065     SELECT g_id, g_title FROM foo_pun_groups ORDER BY g_id

Very... interesting

So I took a look at the code

The first call:

                                    <th scope="row">Base new group on<div><input type="submit" name="add_group" value=" Add " tabindex="2" /></div></th>
                                    <td>
                                        <select id="base_group" name="base_group" tabindex="1">
<?php

$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))
{
    if ($cur_group['g_id'] == $pun_config['o_default_user_group'])
        echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
    else
        echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
}

Second:

                                    <th scope="row">Default group<div><input type="submit" name="set_default_group" value=" Save " tabindex="4" /></div></th>
                                    <td>
                                        <select id="default_group" name="default_group" tabindex="3">
<?php

$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))
{
    if ($cur_group['g_id'] == $pun_config['o_default_user_group'])
        echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'" selected="selected">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
    else
        echo "\t\t\t\t\t\t\t\t\t\t\t".'<option value="'.$cur_group['g_id'].'">'.pun_htmlspecialchars($cur_group['g_title']).'</option>'."\n";
}

Third:

                        <legend>Edit/remove groups</legend>
                        <div class="infldset">
                            <p>The pre-defined groups Guests, Administrators, Moderators and Members cannot be removed. They can however be edited. Please note though, that in some groups, some options are unavailable (e.g. the <em>edit posts</em> permission for guests). Administrators always have full permissions.</p>
                            <table cellspacing="0">
<?php

$result = $db->query('SELECT g_id, g_title FROM '.$db->prefix.'groups 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".'<tr><th scope="row"><a href="admin_groups.php?edit_group='.$cur_group['g_id'].'">Edit</a>'.(($cur_group['g_id'] > PUN_MEMBER) ? ' - <a href="admin_groups.php?del_group='.$cur_group['g_id'].'">Remove</a>' : '').'</th><td>'.pun_htmlspecialchars($cur_group['g_title']).'</td></tr>'."\n";

Now, couldn't all three queries be merged into one using the reset function and modifying the while loops for the ones that only want g_ids > 3?

Mmm, undo whatever you did to the cache.php file, that could be causing it
(And to be clear, I mean that thing that was supposed to make the stuff writable)

6,671

(7 replies, posted in PunBB 1.2 troubleshooting)

Well, is your main site going to be the forum index?

6,672

(7 replies, posted in PunBB 1.2 troubleshooting)

Really? (Check the bottom)
There isn't a reason I can think of to remove it, and especially not at least the linkback to PunBB.

6,673

(7 replies, posted in PunBB 1.2 troubleshooting)

GPL allows you to remove copyrights from the HTML (but not from the PHP source!) although it's really not a very nice thing to do. More info on that here

And on that note (this is untested btw, you'll have to tell me if you have problems: oh, and in the interest of saving some time I've "disabled" quickjump altogether, to save me having to rework the cache for it):
One "new" file (redone enough that I didn't do just line by line replacements):
include/cache.php

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

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  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;
    
//
// Generate the config cache PHP script
//
function generate_config_cache()
{
    global $pun_config, $db;

    // Get the forum config from the DB
    $result = $db->query('SELECT * FROM '.$db->prefix.'config', true) or error('Unable to fetch forum config', __FILE__, __LINE__, $db->error());
    while ($cur_config_item = $db->fetch_row($result))
        $pun_config[$cur_config_item[0]] = $cur_config_item[1];
}


//
// Generate the bans cache PHP script
//
function generate_bans_cache()
{
    global $pun_bans, $db;

    // Get the ban list from the DB
    $result = $db->query('SELECT * FROM '.$db->prefix.'bans', true) or error('Unable to fetch ban list', __FILE__, __LINE__, $db->error());
    
    $pun_bans = array();
    while ($cur_ban = $db->fetch_assoc($result))
        $pun_bans[] = $cur_ban;
}


//
// Generate the ranks cache PHP script
//
function generate_ranks_cache()
{
    global $pun_ranks, $db;

    // Get the rank list from the DB
    $result = $db->query('SELECT * FROM '.$db->prefix.'ranks ORDER BY min_posts', true) or error('Unable to fetch rank list', __FILE__, __LINE__, $db->error());

    $pun_ranks = array();
    while ($cur_rank = $db->fetch_assoc($result))
        $pun_ranks[] = $cur_rank;
}

And now for the edits!

include/common.php
FIND

// Load cached config
@include PUN_ROOT.'cache/cache_config.php';
if (!defined('PUN_CONFIG_LOADED'))
{
    require PUN_ROOT.'include/cache.php';
    generate_config_cache();
    require PUN_ROOT.'cache/cache_config.php';
}

REPLACE WITH

require PUN_ROOT.'include/cache.php';
generate_config_cache();

FIND

// Load cached bans
@include PUN_ROOT.'cache/cache_bans.php';
if (!defined('PUN_BANS_LOADED'))
{
    require_once PUN_ROOT.'include/cache.php';
    generate_bans_cache();
    require PUN_ROOT.'cache/cache_bans.php';
}

REPLACE WITH

require_once PUN_ROOT.'include/cache.php';
generate_bans_cache();

include/functions.php

FIND

    // If not already loaded in a previous call, load the cached ranks
    if ($pun_config['o_ranks'] == '1' && empty($pun_ranks))
    {
        @include PUN_ROOT.'cache/cache_ranks.php';
        if (!defined('PUN_RANKS_LOADED'))
        {
            require_once PUN_ROOT.'include/cache.php';
            generate_ranks_cache();
            require PUN_ROOT.'cache/cache_ranks.php';
        }
    }

REPLACE WITH

    // If not already loaded in a previous call, load the cached ranks
    if ($pun_config['o_ranks'] == '1' && empty($pun_ranks))
    {
        require_once PUN_ROOT.'include/cache.php';
        generate_ranks_cache();
    }

footer.php
FIND

    // Display the "Jump to" drop list
    if ($pun_config['o_quickjump'] == '1')

REPLACE WITH

    // Display the "Jump to" drop list
    if ($pun_config['o_quickjump'] == '1' && 1 == 2)
sportsguy wrote:

Sorry - that wasn't meant to be a post to spur you on...LOL

When folks are willing to help me with technical things I become quite patient... smile

lol, don't worry, I planned on doing it anyway tongue