1

(17 replies, posted in PunBB 1.3 extensions)

chovy wrote:

Extremely long URLs -- don't know if this is a bug with the extension or gravatar itself:'


h ttp://www.gravatar.com/avatar/xxxxxxxxxxxxxxxx.jpg?r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60&r=g&s=60

I was able to fix this by changing the line:

            $output[$cur_user['id']] = 'http://www.gravatar.com/avatar/'.md5(strtolower($cur_user['email'])).'.jpg?'.implode("&", $get_vars);

        }

to:

            $output[$cur_user['id']] = 'http://www.gravatar.com/avatar/'.md5(strtolower($cur_user['email'])).'.jpg?'.implode("&", $get_vars);
            
            unset($get_vars);

        }

2

(1 replies, posted in PunBB 1.3 extensions)

Hi,

I read for v1.2 that there isn't functionality to disable the cache:
http://punbb.informer.com/forums/topic/ … ble-cache/

Is it still not possible to disable the hooks cache? While developing an extension, it would be nice not to have to delete the cache file each time I want to test a variation to my hook in the database.

Regards,
Eoin

3

(5 replies, posted in Discussions)

I'm very happy to report back that my simple (not complete) integration hook is working. It uses my own custom script to check if the user is logged in. If they are logged in through my site, I authenticate them directly.

<hook id="fn_cookie_login_start"><![CDATA[
    require_once($_SERVER['DOCUMENT_ROOT'].'/scripts/smarty.php');
    global $forum_config;
    if ($smarty->user->isLoggedIn()) // My login check.
    {
        global $forum_db, $forum_user;
        
        $query = array(
            'SELECT'    => 'u.*, g.*, o.logged, o.idle, o.csrf_token, o.prev_url',
            'FROM'        => 'users AS u',
            'JOINS'        => array(
                array(
                    'INNER JOIN'    => 'groups AS g',
                    'ON'            => 'g.g_id=u.group_id'
                ),
                array(
                    'LEFT JOIN'        => 'online AS o',
                    'ON'            => 'o.user_id=u.id'
                )
            )
        );

        // Get the user. I have their foreign_id which is their ID in
        // my main site. In the forum users database table, I have stored their site ID as foreign_id.
        $query['WHERE'] = 'u.foreign_id='.$forum_db->escape($smarty->user->getUserID());

        $result = $forum_db->query_build($query) or error(__FILE__, __LINE__);
        $forum_user = $forum_db->fetch_assoc($result);
        
        // Send a new, updated cookie with a new expiration timestamp
        $expire = (intval($cookie['expiration_time']) > $now + $forum_config['o_timeout_visit']) ? $now + 1209600 : $now + $forum_config['o_timeout_visit'];
        forum_setcookie($cookie_name, base64_encode($forum_user['id'].'|'.$forum_user['password'].'|'.$expire.'|'.sha1($forum_user['salt'].$forum_user['password'].forum_hash($expire, $forum_user['salt']))), $expire);

        $forum_user['is_guest'] = false;
        $forum_user['is_admmod'] = $forum_user['g_id'] == FORUM_ADMIN || $forum_user['g_moderator'] == '1';
    
        // From functions.php
        // Set a default language if the user selected language no longer exists
        if (!file_exists(FORUM_ROOT.'lang/'.$forum_user['language'].'/common.php'))
            $forum_user['language'] = $forum_config['o_default_lang'];

        // Set a default style if the user selected style no longer exists
        if (!file_exists(FORUM_ROOT.'style/'.$forum_user['style'].'/'.$forum_user['style'].'.php'))
            $forum_user['style'] = $forum_config['o_default_style'];

        if (!$forum_user['disp_topics'])
            $forum_user['disp_topics'] = $forum_config['o_disp_topics_default'];
        if (!$forum_user['disp_posts'])
            $forum_user['disp_posts'] = $forum_config['o_disp_posts_default'];

        // Check user has a valid date and time format
        if (!isset($forum_time_formats[$forum_user['time_format']]))
            $forum_user['time_format'] = 0;
        if (!isset($forum_date_formats[$forum_user['date_format']]))
            $forum_user['date_format'] = 0;
    }
    else
    {
        set_default_user();
    }
    return true;

    // TODOs
    // * If password, email, display name changed on my site then must update forum.
    // * If logout from forum, logout from main page: http://punbb.informer.com/forums/post/114252/#p114252
    // * Not sure about cookie expiration matching my site and the forum account.
]]></hook>

4

(5 replies, posted in Discussions)

Great, it sounds like I have some research to do during the weekend then smile

5

(5 replies, posted in Discussions)

Well, I haven't done it smile

I was wondering if people more familiar with PunBB thought such an integration would be viable?

6

(5 replies, posted in Discussions)

Hi,

currently my test PunBB forum has no login integration with the rest of my custom site. I added my site's header to it for visual integration. That might be the easiest way to keep it.

However, what's the viability in my customising PunBB as follow?

My site currently requires an email address to log in rather than a username, and there are non-unique display names.

What do you think is the viability for me to change PunBB to this degree:

* To modify PunBB to have a display name field. Use that display name beside people's posts, along with a gravatar identicon as their avatar.
* To automatically register a user in PunBB when they register under my site. Their forum username is actually their email.
* Integrate logins so that if a user is logged into my main site, they are also logged in to PunBB.
* Hide PunBB's login pages and get them to log in directly through my site.

Even if I managed to implement that, there would be difficulty in keeping PunBB up to date with official releases if the inner code was modified.

Thanks for opinions.

7

(2 replies, posted in Discussions)

Ok, I'll do that with the database.

To be clear, I only installed the anti-spam this week. The forum was completely open until then. I was running 1.3.2 before upgrading this week.

8

(0 replies, posted in Discussions)

Hi,

I got great tips here on setting the $base_url according to the server host:
http://punbb.informer.com/forums/topic/ … o-domains/

What I also need to do is set the interface language according to the domain. Where should I go changing this, any ideas?

BTW, I love the light nature of PunBB, after 8 years dealing with phpBB.

Eoin

9

(2 replies, posted in Discussions)

Hi,

for about 150 days my forum has been up on an non-promoted site, and has about 45,000 threads of spam smile

I have installed the official anti-spam extension, but I still need to completely delete the main forum.

When I try to prune message I get the message "Insane query, aborted". Is there a way to get around this, to complete empty the forum?

The assumption here is that I don't want to bother re-creating the database and setting up the site all over again.

Eoin

mattxb,

thanks for sharing that with us. How about the forum username display... did you change the forum's code to display their username from your site's main users table?

Eoin