51

(99 replies, posted in PunBB 1.3 additions)

I'll do the italian translation.

52

(5 replies, posted in PunBB 1.3 troubleshooting)

My guess is: in common.php, on lines 360 and 382 there's a message function for ban, they both end with a true flag, which is probably echoed and therefore shown as the number 1.

Sweet, thanks a lot both of you.

I have problem now.

I'm trying to put the query into a function
so I have

$fid = some number
$result = $db->query('SELECT moderators FROM '.$db->prefix.'forums WHERE id = '.$fid) or die();
if($db->num_rows($result))
{
    while ($cur_forum = $db->fetch_assoc($result))
    {
        $mods_array = unserialize($cur_forum['moderators']);
        $moderators = array();

        while (list($mod_username) = @each($mods_array))
            $moderators[] = pun_htmlspecialchars($mod_username);

        $moderators = '<p>'.implode(', ', $moderators).'</p>'."\n";
    }
    echo $moderators;
}

And it works

but if I try to make it a function, like this:

function get_mods($fid)
{
    $result = $db->query('SELECT moderators FROM '.$db->prefix.'forums WHERE id = '.$fid) or die();
    if($db->num_rows($result))
    {
        while ($cur_forum = $db->fetch_assoc($result))
        {
            $mods_array = unserialize($cur_forum['moderators']);
            $moderators = array();

            while (list($mod_username) = @each($mods_array))
                $moderators[] = pun_htmlspecialchars($mod_username);

            $moderators = '<p>'.implode(', ', $moderators).'</p>'."\n";
        }
        echo $moderators;
    }
}

get_mods("some number");

I get this error

Fatal error: Call to a member function query() on a non-object in... etc.

Any hint?

Thanks svl.

How are the moderators' IDs stored for each forum?
Let's say I want to retrieve the moderators for forum with ID 10, where should I look at?

TIA.

57

(51 replies, posted in PunBB 1.2 discussion)

MySQL 5.0.44

58

(42 replies, posted in PunBB 1.2 show off)

I'm simply amazed, can't wait to see the final product, kudos to the dev team.

59

(9 replies, posted in PunBB 1.2 troubleshooting)

Link us your forums then.

Seems like your MySQL server is down or you've put wrong credentials in your config.php, can you access the database with phpmyadmin?

61

(23 replies, posted in Programming)

Out of curiosity, why don't you leave it up to users since opening in new window/tab is pretty easy?

62

(1 replies, posted in PunBB 1.2 troubleshooting)

Have a look here.

63

(23 replies, posted in Programming)

That breaks XHTML 1.1 strict validity, are you aware of that?

64

(26 replies, posted in PunBB 1.2 troubleshooting)

Once again I recommend to do it through CSS, it will be just one line in your base.css file and it will avoid source code alteration, which is handy if you have to update your forum.

65

(6 replies, posted in PunBB 1.2 troubleshooting)

I believe there's a typo here

$thisdate = date('l, d F Y', $cur_topic['postet']);

Change to

$thisdate = date('l, d F Y', $cur_topic['posted']);

66

(6 replies, posted in PunBB 1.2 troubleshooting)

There's probably an error in your code, can you post it?


Also by generating days in norwegian you mean Måndag instead of Monday and so on?

67

(26 replies, posted in PunBB 1.2 troubleshooting)

elbekko wrote:

Actually, isn't there an admin option to disable reporting?

I believe there's only an option to decide how to report (internal, email or both).

68

(26 replies, posted in PunBB 1.2 troubleshooting)

I'd still go for the CSS solution but it's just me.

69

(26 replies, posted in PunBB 1.2 troubleshooting)

In that case you need to both hide the link and remove the report function from misc.php (between line 164 and 262).

70

(26 replies, posted in PunBB 1.2 troubleshooting)

Exactly. Hiding through CSS or commenting out the code does the same, the function is still in but the CSS way is quicker.

71

(26 replies, posted in PunBB 1.2 troubleshooting)

At the end of your base.css stylesheet put this

ul li.postreport {display: none;}

72

(7 replies, posted in PunBB 1.2 troubleshooting)

Right, so instead of

if($pun_user['g_id'] == 1)

Put this

if($pun_user['g_id'] == 1 || $pun_user['g_id'] == 2)

73

(7 replies, posted in PunBB 1.2 troubleshooting)

Here's what I've done.
Note: line numbers might not match with the default userlist.php

Open userlist.php
line 67: <?php endif; ?>                    <label class="conl"><?php echo $lang_ul['User group']."\n" ?>
Change to 

<?php endif;


if($pun_user['g_id'] == 1)
{
?>        
                <label class="conl"><?php echo $lang_ul['User group']."\n" ?>

Go to line 84: <br /></label>

Add after:
<?php 
}
?>

This will show the usergroup dropdown menu to admins only.
Note: this will only hide the usergroup dropdown menu, it will be still possible to browse the usergroups by entering the query in the url but probably most of the users won't bother doing it.

74

(8 replies, posted in PunBB 1.2 troubleshooting)

This thread should be locked or moved to Troubleshooting since it's not a bug.

Why is it wrong? check this page source between lines 48 an 58, the code is perfectly tabbed.