Bloody wrote:

Thanks !! I think, I will not use this two mods together.
Your comments system please me.
Did you think, you can change your hack to integrated this punbb pluging ? smile

sorry I won't be making any more changes to this mod...lack of time

Smartys wrote:

update topics set last_poster_id=(select users.id from users where username=last_poster)

wow that seem really simple...I was thinking up complex loop ideas and crap...thanks, i'll give it a try and let you know how I get on

I have made the mod to reate mini avatars when someone uploads an avatar...and also created the new last_poster_id columns in the forums and topics tables.

I need some help populating those columns...it will need to be a one time left join with the users table on the usaneme...any ideas what the query might look like...might need some php in there too I think.

thanks, Nick

Bloody wrote:

Nickfzx, wink

Wordpress login and Punbb login must be the same or not ?
Have you see that thread to ? A wordpress plugin to manage punbb users by Wordpress.
http://punbb.org/forums/viewtopic.php?pid=99533
Could we use twice ? smile

my mod has no connection or reliance on the mod you refer to ... it stands up on its own.  My mod does not integrate the wordpress login system with punbb login system.  What it does is prevent people who are not logged into punbb from making a comment on a wordpress article and also when a logged in member does make a comment it grabs their punbb username and avatar so that it gives the illusion of a bridged system.

I am not sure about using the two mods together...give it a try if you need the functions of both smile   the more mods you do though the harder it's going to be to upgrade.

Smartys wrote:

Moved to Modifications
You'll want to work based off of the actual queries, not with fake queries. And you'll need to add a LEFT JOIN with the users table on the last_poster (which will be a slow join, it might be worthwhile to add a new column for the user ID of the last poster and populate that instead).

I thought about adding a new table...and this may be a better idea...but I will still need to populate this table for all the old (inactive topics)...so I will have to do this join at some point no matter what.

So I guess I would like help with an sql query to populate a newly created last_posters_id column  in the topics and forums table...by joining last_poster with username on the users table.

you know on forums.php and viewforum.php it says:

"last bost by <username>"

well I want to have it as "last post by <avatar><username>"

so it shows the user's avatar (if they have one) next to their username in forums.php and viewforum.php

I think it would really liven up the page a lot.  (i am going to use phpThumb to generate small (around 40x40 pixels) versions of avatars when people upload them)

So the username of the last poster in any given forum is stored in the column last_poster in forums table.

So to get the avatar all I need is the last_poster's ID.  To do this I think I need to LEFT JOIN with the users table on username like this:

LEFT JOIN forums ON users.username = forums.last_poster

But beyond that I am having difficulty.

I came up with this that doesn't really work:
SELECT users.id FROM users LEFT JOIN forums ON users.username = forums.last_poster

basically I am a little stuck at how to approach the query...any thoughts?


p.s.
As for the generating mini versions of avatars on the fly...I should be able to figure this one out on my own...I will post instructions once I have it working.

7

(26 replies, posted in PunBB 1.2 show off)

ah but now there is two pics...:)  the hope is that lot's of people will be online at once...and it will encourage people to stay online so they have more exposure...but maybe it won't work

I could change it to work from users online today maybe

8

(26 replies, posted in PunBB 1.2 show off)

Big upgrade to my site yesterday...uses 1.2.15 very modded.

Here is the link:
http://www.amateurillustrator.com/

the forums are actually at:
http://www.amateurillustrator.com/forums.php

yep it works I have it installed on 1.2.15

10

(1 replies, posted in PunBB 1.2 troubleshooting)

no worries on this one, I figured it out and is not required for me so I have commented out the corresponding code in post.php and header.php

11

(1 replies, posted in PunBB 1.2 troubleshooting)

hey,

I would like to know what this code is for in header.php

// START SUBST - <body>
if (isset($focus_element))
{
    $tpl_main = str_replace('<body onload="', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus();', $tpl_main);
    $tpl_main = str_replace('<body>', '<body onload="document.getElementById(\''.$focus_element[0].'\').'.$focus_element[1].'.focus()">', $tpl_main);
}
// END SUBST - <body>

I can't seem to figure out what it does and it is causing a conflict with a piece of javascript I have included in my header.

It doesn't seem to make any noticeable difference if I remove it.

thanks

Nick

MrRoo wrote:

Woohoo!! Now if I can just get WP-punBB integration I would be set! Great job Veronica!!

by the way I have integrated punbb with wordpress comments system...so that people have to be logged into punbb to post comments on wordpress articles and their punbb avatar is shown next to thier comments.

see the link in my signature for instructions if this is useful to you

thanks for the quick response...I found a good solution just by messing with the code of punbbs date function (inspired by this post: http://punbb.org/forums/viewtopic.php?id=7436)


here is my code:

function format_time($timestamp, $date_only = false)
{
    global $pun_config, $lang_common, $pun_user;

    if (!$date_only)
        {
            $diff = time() - $timestamp;
            $rest = ($diff % 3600);
            $restdays = ($diff % 86400);
            $restweeks = ($diff % 604800);
            $weeks = ($diff - $restweeks) / 604800;
            $days = ($diff - $restdays) / 86400;
            $hours = ($diff - $rest) / 3600;
            $seconds = ($rest % 60);
            $minutes = ($rest - $seconds) / 60;
            if ($timestamp == '')
                return $lang_common['Never'];
            if($weeks > 1)
                return $date."$weeks weeks ago";
            elseif($days > 1)
                return $date."$days days ago";
            elseif($hours > 1)
                return $date."$hours hours ago";
            elseif ($hours == 1)
                return $date."1 hour, $minutes mins ago";
            elseif ($minutes == 0)
                return $date."$seconds seconds ago";
            elseif ($minutes == 1)
                return $date."1 minute ago";
            elseif ($seconds < 60)
                return $date."$minutes mins ago";
        }
        else{
            $diff = ($pun_user['timezone'] - $pun_config['o_server_timezone']) * 3600;
            $timestamp += $diff;
            $now = time();

            $date = date($pun_config['o_date_format'], $timestamp);
            $today = date($pun_config['o_date_format'], $now+$diff);
            $yesterday = date($pun_config['o_date_format'], $now+$diff-86400);

            return $date;
           }
}

I would really like this also...the link your supplied pogenwurst is now not working

Also since last year maybe someone has done this??

any help would be awesome smile

15

(98 replies, posted in News)

Just upgraded to 1.2.15 from 1.2.12

all my mods and plugins work great as before...just had to reinstall most of them.

Image upload

Award mod

Online today

Easy BB code

Private message mod

Punbb chatbox

elektra profile mod

And a few more I can't remember

ah ok thanks for your help

surely I can get register.php to do the same thing without header.php??

i want to stop the template file being wrapped around register.php and userlist.php

and the only way I can see todo this is to remove the include to header.php, but neither page will load up at all without header.php included.

any ideas?

So I would like to remove register.php and userlist.php outside of punbb to create a better integrated site.

Now moving the files out of the punbb directory is easy...I simply move them and then change the pun_root define and path to common.php and then run them and they seem to operate as before with little change.

However I want to remove the header.php include (or at least the main.tpl influence over these files) from both files and when I do that and refresh then I am presented with a blank screen.

How would I go about ridding register.php and userlist.php of their ties to main.tpl?


Thanks in advance smile

i may take a look at your bot hide mod

basically i often have around 100 guests online and only 1 or two members...so it looks a little strange and I would like to get the guests figure down to a more realistic figure.

hey thanks

...how up to date is the list of bots?  is there a place to get a updated list?

so I have now done this...took around 3 hours...I think I have made it so it is secure.

I have made it grab the avatars too which is cool.  So now you can comment on wordpress articles if you are logged into punbb or wordpress...if you are not logged in to wordpress or punbb you can't comment.

If you have an avatar in your punbb profile then it will be put next to your name in the comment, if you don't have an avatar then nothing will show.

if you are logged into wordpress and punbb at the same time then the wordpress user info is used and punbb is ignored.  As my members aren't allowed to login to wordpress (only punbb) this isn't a problem for me.

The affected files are:
wordpress/wp-comments-post.php
and
wordpress/wp-content/themes/YOUR_THEME/comments.php

Replace the 2 files:   (make sure to backup)
http://nickfranklin.googlepages.com/wp- … s-post.php
http://nickfranklin.googlepages.com/comments.php

To adapt this to your theme just see what I have done to my comments.php theme file and do the same to yours - I have commented all of my changes in both files with // CHANGED FOR PUNBB INTEGRATION or something similar so just do a search for PUNBB to see where I have made changes.

I have only tested this with wordpress 2.0.3, I am going to upgrade to 2.1 soon and I imagine it will still work fine.

Let me know what you think...cheers, Nick


edit:
I diddn't mention above that you have to include this code somewhere:

<?php
define('PUN_ROOT', '../punbb/');
include '../punbb/include/common.php';
global $pun_user;
?>

I put it near the top of my index.php wordpress theme file so that it is always there wherever I am in wordpress.

23

(0 replies, posted in PunBB 1.2 discussion)

it would be cool if there was a mod that allowed users to comment on each others profiles.  A little like myspace and facebook.  This sort of functionality is really popular on social networking sites.

Is there a mod already out there for punbb?, I couldn't find one.

i always have my guest counter at around 40 to 100 guests in last 15 mins...I know these are mostly robots as I use statcounter which uses javascript to measure visits and the figure should be around 10 to 20 guests.

Is there a way to not count in the search engines and crawling bots in the number of guests online figure?

no which thread should I use.  This thread or the ones on punres?