51

(3 replies, posted in PunBB 1.2 troubleshooting)

So what you want to use is <image></image> and not the  tags yes?

If so you need to look in your parser.php file.

52

(18 replies, posted in Feature requests)

if you want to allow people to use iframe on your forum they can add scripts on that site that e.g injects trojans or other things like that

Thats why you should have HTML disabled on the forum

Tried looking at that, but it didn't change anything when I edited it

I have a problem here..

I'm making private board that can only viewed if an admin has created an account for you.
But if I use this line on the index page:

if ($pun_user['is_guest'])
message('Private Board. <br /><a href="login.php">Login</a> or contact one of the Admins');

Then the index page gets the titel from the Calendar sad

and PUN_GUEST doesn't work now because of the new admin option I have on my forum.

http://test.saf-squad.co.uk/forum/

look at the title and then login with "demo" "demo" and see then

55

(12 replies, posted in PunBB 1.2 discussion)

Kyle_Katarn wrote:

Would it be possible (as many other forums do that) to check registration with a randomly generated text image that human user has to read and confirm ?
Thanks for this excellent work !

Well, you should try searching first tongue

Like here: http://www.punres.org/viewtopic.php?id=281

I have that one and a random question coming up when they register

I'm not sure this is what you are looking for but this is how I see the last online time for my users, but I have no idea where you want it. I placed mine in the userlist.php file

First open userlist.php

Find (around line 160)

$result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());

Replace with or add "u.userlist,"

$result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, u.last_visit, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());

Then find (around line 168

                <tr>
                    <td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td>
                    <td class="tc2"><?php echo $user_title_field ?></td>
<?php if ($show_post_count): ?>                    <td class="tc3"><?php echo $user_data['num_posts'] ?></td>
<?php endif; ?>
                    <td class="tcr"><?php echo format_time($user_data['registered'], true) ?></td>
                </tr>

Replace with

                <tr>
                    <td class="tcl"><?php echo '<a href="profile.php?id='.$user_data['id'].'">'.pun_htmlspecialchars($user_data['username']).'</a>' ?></td>
                    <td class="tc2"><?php echo $user_title_field ?></td>
<?php if ($show_post_count): ?>                    <td class="tc3"><?php echo $user_data['num_posts'] ?></td>
<?php endif; ?>
                    <td class="tc1"><?php echo format_time($user_data['last_visit']) ?></td>
                    <td class="tc2"><?php echo format_time($user_data['registered'], true) ?></td>
                </tr>

Find (around line 147)

            <tr>
                <th class="tcl" scope="col"><?php echo $lang_common['Username'] ?></th>
                <th class="tc2" scope="col"><?php echo $lang_common['Title'] ?></th>
<?php if ($show_post_count): ?>                <th class="tc3" scope="col"><?php echo $lang_common['Posts'] ?></th>
<?php endif; ?>    
                <th class="tcr" scope="col"><?php echo $lang_common['Registered'] ?></th>
            </tr>

Replace with

            <tr>
                <th class="tcl" scope="col"><?php echo $lang_common['Username'] ?></th>
                <th class="tc2" scope="col"><?php echo $lang_common['Title'] ?></th>
<?php if ($show_post_count): ?>                <th class="tc3" scope="col"><?php echo $lang_common['Posts'] ?></th>
<?php endif; ?>    
                <th class="tc2" scope="col"><?php echo $lang_common['LastVisit'] ?></th>
                <th class="tcr" scope="col"><?php echo $lang_common['Registered'] ?></th>
            </tr>

Find

<option value="registered"<?php if ($sort_by == 'registered') echo ' selected="selected"' ?>><?php echo $lang_common['Registered'] ?></option>

After add

<option value="last_visit"<?php if ($sort_by == 'last_visit') echo ' selected="selected"' ?>><?php echo $lang_common['LastVisit'] ?></option>

Find

$sort_by = (!isset($_GET['sort_by']) || $_GET['sort_by'] != 'username' && $_GET['sort_by'] != 'registered' && ($_GET['sort_by'] != 'num_posts' || !$show_post_count)) ? 'username' : $_GET['sort_by'];

Replace with

$sort_by = (!isset($_GET['sort_by']) || $_GET['sort_by'] != 'username' && $_GET['sort_by'] != 'registered' && ($_GET['sort_by'] != 'last_visit' && ($_GET['sort_by'] != 'num_posts' || !$show_post_count))) ? 'username' : $_GET['sort_by'];

Now open /lang/yourlang/common.php
Search for Registered

'Registered'            =>    'Registered',

After that line add

'LastVisit'                =>    'Last Online',

Save Upload smile

Hope that this was something you were looking for smile

##
##
##   Mod title:  Moderator Menu Permissions 
##
##   Mod version:  1.0 
##   Works on PunBB:  1.2.* 
##   Release date:  15.08.2007 
##   Author:  PhaxeNor 
##
##      Description:  This mod will allow you to give more permissions to your mods
##
##       Affects DB:  Yes 
##
##   Affected files:  admin_categories.php 
##                    admin_forums.php 
##                    admin_options.php 
##                    admin_permissions.php
##                    admin_ranks.php 
##                    admin_prune.php
##                    include/common_admin.php 
##
##   Notes:  You should be careful about the permissions you set for the mod! 
##
##   DISCLAIMER:  Please note that 'mods' are not officially supported by
##                PunBB. Installation of this modification is done at your
##                own risk. Backup your forum database and any and all
##                applicable files before proceeding.
##

Download

This is my first release of anything that is about PHP so feedback would be nice thank you smile

58

(2 replies, posted in PunBB 1.2 troubleshooting)

Link to forum?

59

(2 replies, posted in PunBB 1.2 troubleshooting)

Have you been on Punres.org?

You can use PHP Include:

Punres Wiki wrote:

* Show the 15 most recently active topics from all forums: include('http://host.com/forums/extern.php?action=active');
* Show the 10 newest topics from forums with ID 5, 6 and 7: include('http://host.com/forums/extern.php?action=new&show=10&fid=5,6,7');
* Show users online: include('http://host.com/forums/extern.php?action=online');
* Show users online with full listing of users: include('http://host.com/forums/extern.php?action=online_full');
* Show board statistics: include('http://host.com/forums/extern.php?action=stats');

Punres Wiki

I would like to ask if I could get some with drop down menus for my forum.

Just like on this website: http://www.kntl.co.uk/  (mouse over the top links)

I found something on Dynamic Drive: http://www.dynamicdrive.com/dynamicinde … uindex.htm

But i'm not quite sure yet where to add all this stuff. Only know the HTML part on how to add, but not quite on php.

Any help would be very nice!

before we start I just want to say that I have minimal knowlage with php but I learn.

I have been trying to get a second Announcement to show on my website.
So far I have manage to get 2 announcements there. But if I disabled one, the other one gets removed too

An image just to show:
http://forums.saf-squad.co.uk/announcement.jpg

I started by inserting 2 new values to the punbb_config database.

INSERT INTO `punbb_config` ( `conf_name` , `conf_value` ) 
VALUES (
'o_announcement_saf', '0'
);
INSERT INTO `punbb_config` ( `conf_name` , `conf_value` ) 
VALUES (
'o_announcement_message_saf', '0'
);

then I went to the admin_options.php file.
and made a new line after this:

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

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

were I added this:

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

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

The admin Fieldset for the option

                    <fieldset>
                        <legend>SAF Announcement</legend>
                        <div class="infldset">
                            <table class="aligntop" cellspacing="0">
                                <tr>
                                    <th scope="row">Display announcement</th>
                                    <td>
                                        <input type="radio" name="form[announcement_saf]" value="1"<?php if ($pun_config['o_announcement_saf'] == '1') echo ' checked="checked"' ?> /> <strong>Yes</strong>   <input type="radio" name="form[announcement_saf]" value="0"<?php if ($pun_config['o_announcement_saf'] == '0') echo ' checked="checked"' ?> /> <strong>No</strong>
                                        <span>Enable this to display the below message in the forums.</span>
                                    </td>
                                </tr>
                                <tr>
                                    <th scope="row">Announcement message</th>
                                    <td>
                                        <textarea name="form[announcement_message_saf]" rows="5" cols="55"><?php echo pun_htmlspecialchars($pun_config['o_announcement_message_saf']) ?></textarea>
                                        <span>This text will not be parsed like regular posts and thus may contain HTML.</span>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </fieldset>

And then in the header.php I added this to tell the header to show message if 1

 if ($pun_config['o_announcement_saf'] == '1')

and the block to show the message

<div id="announce" class="block">
    <h2><span>SAF Member Announcement</span></h2>
    <div class="box">
        <div class="inbox">
            <div><?php echo $pun_config['o_announcement_message_saf'] ?></div>
        </div>
    </div>
</div>

I'm not sure what to do really.
Any help or links to mods that gets me a step closer helps me alot

Thanks,
PhaxeNor

Thank you, its working now smile

Just this page because I don't want guests to view a user profile.

I think I know why.. I added this line:

// mod: no guest view
if ($pun_user['is_guest'])
    message($lang_common['No permission']);

Because I didn't want guests to be able to view the user profile. But it looks like it has an effect on the Password change.

Here is the forum
http://forums.saf-squad.co.uk/

Will try clearing the chaches now.

Edit: After the chache clearing it still doesn't work

When I have recived the email and get the "Change Password" link

The password request works, but once I get the email and press the "http://site.com/profile.php?id=3&ac … y=xxxxxxxx" link and it opens up the brower, I just get an "You do not have permission to access this page." page.

I'm not sure where the fault or permission error is, but no guests that request a password is allowed to change it.

Realy need some help with this.

Thank You,
PhaxeNor

Manage to find it our with some help smile

I removed the code so that the mods won't show, and I over looked this:

    if ($cur_forum['moderators'] != '')
    {
        $mods_array = unserialize($cur_forum['moderators']);
        $moderators = array();

        while (list($mod_username, $mod_id) = @each($mods_array))
            $moderators[] = '<a href="profile.php?id='.$mod_id.'">'.pun_htmlspecialchars($mod_username).'</a>';

        
    }

So that fixed the Array problem smile
Thank you so much anyway.

PhaxeNor

I'm "kinda" new to php, so I need some help here.

I have this problem where I get the text "Array" after my Forum description that I don't want to have there.
When I go to the AdminCP and edit the forum from there it doesn't show on the description, it just show on the index page

http://phaxe.com/forum.JPG

I'm not sure what files to look on here, but I have looked on index.php, include/functions and include/common.php but can't find out where I need to edit.

Someone that can help me please?

Thank you,
PhaxeNor