26

(38 replies, posted in PunBB 1.3 extensions)

Well, the sound should go of almost instantly. It all depends on the pulling frequency to sql. And that one is set to 5secs so max 5 secs.

Users shouldn't get logged out cause of the extension itself.

But if the "locks" directory underneath the extension isnt writable by php then all browsers will start to basically spit out requests to the server. Havn't put in fixes for this yet.

27

(38 replies, posted in PunBB 1.3 extensions)

Update: I introduced file locks very recently and that was really a big factor that made it possible to release it (no one wants to have all users polling the sql database every second...I didn't bother..). So when I introduced locks it didn't cross my mind that different groups needed different locks cause they can see different parts of the forum and get different updates. This is now fixed.

28

(38 replies, posted in PunBB 1.3 extensions)

Problem solved, had some collision with PunBB variables that I hadn't noticed.

29

(38 replies, posted in PunBB 1.3 extensions)

I havn't used subforums with msgFlow. Which extension do you use for subforums?

30

(38 replies, posted in PunBB 1.3 extensions)

This is extension is under active development. If you have any idea of improvements then just Yell!

Requirements:
- Running PunBB installation http://punbb.informer.com/
- Subdirectory for msgFlow locks have to be writeable by php (chmod 777)

Demo
- http://msgflow.avarice.se/index.php
There is currently alot of spambots on the site....

Usage:
When installed all users will get their index and viewforum page updated live and get notification with a beep sound and title change.

Upcoming features in priotized order:
1. Chrome notification support
2. Live update of active topics on Portal by Daris
3. Visible status with on/off toggle, mute (both with cookie, off as default)
4. Live update of "Currently online" users on index

Features implemented:
- Live update of index page
- Live update of viewforum page
- Live update of active topics page

How it works:
The extensions works as follows:
- User arrives to index or viewforum
- With long pulls JS will check if any changes have been done, currently the long pulls will last  280 seconds.
- Connection is done to extern.php where the first person that started to long pull locks a file and then pulls the database every fifth second. When a new post been posted php will return the new post and unlock the file so all other clients can check the database. This way only one client is constantly pulling from the database every fifth second.

Disclaimer:
I have personally used this extension for a very long time, I created it in February and had it running every since. I thought that after actually making mobileswitch and OxygenMobile public then I should make this baby public aswell.

I will keep this extension maintained purely based of interest from other forum managers. If you want this extension maintained then please "watch" the git repository on Github as long as you are using it. This will keep me motivated to continue to work on it and keep it in a state where it is easy to understand and used by others (otherwise it will fall underneath my ugly hacks priority list where it keeps in a state where my preferences are hardcoded).

Download msgFlow

31

(11 replies, posted in PunBB 1.3 additions)

The same as with my extension, I will keep this style maintained as well purely based of interest from other forum managers. If you want this style maintained then please "watch" the git repository on Github as long as you are using it.

This will keep me motivated to continue to work on it and keep it in a state where it is easy to understand and use by others (otherwise I won't be bothered to keep PunBB release quality on it).

32

(9 replies, posted in PunBB 1.3 extensions)

I will keep this extension maintained purely based of interest from other forum managers. If you want this extension maintained then please "watch" the git repository on Github as long as you are using it.

This will keep me motivated to continue to work on it and keep it in a state where it is easy to understand and use by others (otherwise it will fall underneath my ugly hacks priority list).

33

(9 replies, posted in PunBB 1.3 extensions)

Cheers, fixed it.

Note that this is a small extension until I finished the full one where I planned to give users the ability to set a specific style for mobile devices. Until then just poke me if any changes needs to be done.

Started to make some small modifications on Oxygen to make it viewable on mobile devices.

What it does right now:

Index:
- Page scaled
- Big touch surfaces with js

Viewforum:
- Page scaled
- Big touch surfaces with js

Viewtopic:
- Page scaled

Works great together with MobileSwitch extension

OxygenMobile Download

Feel free to give ideas or pointers.

Hey!

Wanted a mobile style for my small punbb forum. We got some activity so I feelt that it was time to put some effort in creating the style. To make it easier to use I just cooked together this extension to automagically switch to it if any user logged on with a mobile device.

Requirements:
- Running PunBB installation http://punbb.informer.com/
- Mobiletheme OxygenMobile

Usage:
Will switch to mobile style for mobile devices if currently used style exists in $STYLENAME$Mobile version. For example OxygenMobile will be used instead of Oxygen on a mobile device. If current style doesn't have a mobile version then mobileswitch will use OxygenMobile if it exists.

MobileSwitch Download

Feel free to give ideas or pointers.

36

(4 replies, posted in Programming)

Thanks for the forum software wink

37

(4 replies, posted in Programming)

To sanitize just change in the code to following:

# Get userinformation
cursor.execute(
    "SELECT username, password, salt from punbb_users WHERE username = '"
    + MySQLdb.escape(os.getenv("AUTHD_ACCOUNT")))

Enjoy!

38

(4 replies, posted in Programming)

I solved my problem.

I changed to pure-ftpd instead which have support for custom authentication modules. So I wrote a small script in python (easy to make in php aswell) that access my punbb installation and validate the user.

Go to Pure-ftpd Docs Authentication modules to read how this works and how to start pure-ftpd with the module.

Here is a simple example I managed to put together so far, you can make it more extensible by adding columns for own user directories, throttling, user size quota etc in database and then write an punbb extension to edit the settings with.

(do notice that this script is very simple and doesn't sanitize user input from ftp client!)

#!/usr/bin/python

import MySQLdb
import os
import hashlib

# Create connection to forum database
conn = MySQLdb.connect(
    host = "localhost",
    user = "dbuser",
    passwd = "dbpassword",
    db = "database")

# Create cursor
cursor = conn.cursor()

# Get userinformation
cursor.execute(
    "SELECT username, password, salt from punbb_users WHERE username = '"
    + os.getenv("AUTHD_ACCOUNT"))

# Fetch one row
row = cursor.fetchone()

# Make sure we got a row
if row != None:
    # Create hasher
    hashed_pwd = hashlib.sha1(os.getenv("AUTHD_PASSWORD")).hexdigest()
    hashed_pwd = hashlib.sha1(row[2] + hashed_pwd).hexdigest()

    if hashed_pwd == row[1]:
        # Logg in user
         print 'auth_ok:1'
         print 'uid:33'
         print 'gid:33'
         print 'dir:/var/www/public.hostname.com'
    else:
        # Password didn't match
        print 'auth_ok:0'
else:
    # Username not found
    print 'auth_ok:0'
print 'end'

cursor.close ()
conn.close ()

Yo!

I'm trying to figure out how to use the user information from punbb to give my users ftp access.

auth required pam_mysql.so user=vsftpd passwd=ftpdpass host=localhost db=vsftpd table=accounts usercolumn=username passwdcolumn=pass crypt=0
account required pam_mysql.so user=vsftpd passwd=ftpdpass host=localhost db=vsftpd table=accounts usercolumn=username passwdcolumn=pass crypt=0

The example pam configuration just fetches the user info from the database and uses plain passwords as configuration. You can also use shaX and md5 from the documentation I read so far.

The problem is that punbb stores salt in the user table, so for pam to be able to compare the passwords it needs to hash the user inputed password with the salt before comparing it to the password stored in the user table.

I wonder have anyone achieved to do this yet? Are there any other practical solutions for this? I could ofc write together a extension that stores an individual ftp password but it would really be sleak with the same password wink

Haha DokuWiki had it all built in. That was unexpected wink

Problem solved!

Yea I found the nifty extension for punbb + dokuwiki aswell big_smile

Thanks alot hcgtv

I can say that I like Dokuwiki. Its pretty small and neat. Thing is that I would like to use my users from punbb.... and the dokuwiki integration mod that Connorhd have done puts the wiki in the forum /.

Are there somekind of addon to dokuwiki as for Mediawiki to notice logged in members from the forum and automatically give them access?

Heya!

I'm working on a webpage atm that was needing a wiki software of some kind. So I started of installing the big whale Mediawiki. And ... well didnt come very much further than that.

Its big, complicated and I don't understand a thing.

Do anyone of you guys know a wiki software that is kind of punbb in the terms that its easy to modify?

Cheers!

Heya TheJurm!

If you check the forum files you will find something called "main.tpl" in "./include/template".
Poke around in that file alittle and I think you will discover very soon how it works. I put this together very fast.. dont know how the end result will be. But check it and edit as you like.


main.tpl example:

<html>
<head>
<title>SimplyCoding :: Index</title>
<link rel="stylesheet" type="text/css" href="css/css.css" />
</head>
<body>
<div align="center">
<table cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" id="header" height="103" valign="middle"><div align="left"><a href="index.html"><img border="0" alt="SimplyCoding" src="images/name.gif" /></a></div><div align="right"><img src="images/slogan.gif" border="0" /></div></td>
</tr>
<tr>
<td colspan="3" id="navigation" style="background-image: url('images/navigation.gif')">
<a href="index.htm">Link 1</a> 
<font color="#FFFFFF">|</font> <a href="index.htm#">Link 2</a> 

<font color="#FFFFFF">|</font> <a href="index.htm#">Link 3</a> 
<font color="#FFFFFF">|</font> <a href="index.htm#">Link 
4</a> <font color="#FFFFFF">|</font> <a href="index.htm#">Link 5</a> 
<font color="#FFFFFF">|</font> <a href="index.htm#">Link 6</a> 
<font color="#FFFFFF">|</font> <a href="index.htm#">Link 
7</a> 

<font color="#FFFFFF">|</font> <a href="index.htm#">Link 8</a> 
<font color="#FFFFFF">|</font> <a href="index.htm#">Link 9</a> 
<font color="#FFFFFF">|</font> <a href="index.htm#">Link 
10</a></td>
</tr>
<tr><td colspan="3" id="decoration" width="100%" height="48"></td></tr>
<tr><td width="15%" valign="top" height="325" bgcolor="#FFFFFF">This needs to be here</td>
<td width="70%" valign="top" height="100%" bgcolor="#FFFFFF"><blockquote><div> </div>
<div id="punwrap">
<div id="pun<pun_page>" class="pun">

<div id="brdheader" class="block">
    <div class="box">
        <div id="brdtitle" class="inbox">
            <pun_title>
            <pun_desc>
        </div>
        <pun_navlinks>
        <pun_status>
    </div>
</div>

<pun_announcement>

<pun_main>

<pun_footer>

</div>
</div>
</blockquote></td>
<td width="15" valign="top" height="325" bgcolor="#FFFFFF">This should be here</td>
</tr>
<tr>

<td colspan="3" id="footer"><center>Layout and Coding is Copyright © 2007-2008 Simply Coding <em>All Rights Reserved</em><br />All submissions are Copyrighted to their respective authors</center></td>
</tr>
</table>
</div>
</body>
</html>

Problem Solved!!!


So... I can't use variables that is called "user"..... hm.. what a pain in the xD

Thanks for all support Smartys!!! Greatly grateful!

my chat "ava_update.php" that is messing around...

<?php
if($ava_page['name'] != "shoutbox") {
    //H?mta tidpunkten som personen l?ste senast
    $db_users = $db->query("SELECT * FROM avarice_shoutbox_update WHERE id='".$pun_user['id']."'") or error('Unable to fetch the pages', __FILE__, __LINE__, $db->error());
    if($db->num_rows($db_users)) {
        while($user = $db->fetch_assoc($db_users)) {
            $lastcheck = strtotime($user["date"]);
        }
    } else {
        $lastcheck = date("Y-m-d G:i:s");
    }

    $updated = false;
    $db_messege = $db->query("SELECT * FROM avarice_shoutbox ORDER BY date desc") or error('Unable to fetch the pages', __FILE__, __LINE__, $db->error());

    //Kollar om det finns nya meddelanden i shoutboxen.
    if($db->num_rows($db_messege)) {
        while(($messege = $db->fetch_assoc($db_messege)) && (!$updated)) {
            if($lastcheck<strtotime($messege['date'])) {
                $updated = true;
            }
        }
    }
}
?>

So now I should perhaps tell why Im rerouting the errors wildly..

I have a navigation bar for my hole page.. so I have a loop that goes through all pages that is stored in the database and checks in their root folder ("../forum/", "../chat", etc) after a file that is called "ava_update.php". If the file exists it will get included and then I check a variable $updated if its true or not and then prints out a class to the link in the menu to highlight it if $updated==true.

So first I thought it was the ava_update.php file for the forum. But it wasnt and I didnt think about the chat page ava_update.php that was the real reason.

So its the chats "ava_update.php" and my "online list" files that is being included that causes my errors...

So... now Im starting to feel that I should have tried a bit harder before posting here... well well..

I commented out code totally wildly around on the site... and now I have succeded to state the previously posted code bugg free.

It works..  but when running the following I get the bugg:

        <div class="frame">
            <div class="topic">Online List</div>
            <div id="text">
                <ul>
<?php
$db_users = $db->query("SELECT * FROM forum_online Where idle=\"0\" ORDER BY ident") or error('Unable to fetch the pages', __FILE__, __LINE__, $db->error());

if($db->num_rows($db_users)) {
    while($user = $db->fetch_assoc($db_users)) {
        if($user['user_id']!="1") {
            echo "            <li>".$user['ident']."</li>\n";
        }
    }
}
?>
                </ul>
            </div>
        </div>

.. well that didnt post as a beauty.

Well what it does is that it gets the users logged in a prints it in a list... thats it.. and this is truely the error..somewhere here..

http://forum.avarice.se/

Something I can't understand is that .. if I comment out the code I previously posted.. or empty the hole file I get the error.... so I get the error as soon as I include that file.

But I'm able to include other files without any problem that resides on exactly the same spot with a minor difference in filename...

Oh and the files have the exactly same user/group and rights..

Smartys wrote:

Mmm, could you paste a copy of your code?

You get whatever you wan't Smartys.
But as fast as I don't include the previous code there are no problems.. so it should be there.. ^^