Hi SuperMAG,
Wonder if you use my source code or the original one?
Also have you activated the plugin (sorry this question might be silly for you, but most of the time it is silly issue).
Best Regards,
Tien (http://codeandmore.com).
1 2009-01-04 19:58
Re: WordPress PunBB Complete integration (35 replies, posted in PunBB 1.3 discussion)
2 2009-01-04 19:02
Re: WordPress PunBB Complete integration (35 replies, posted in PunBB 1.3 discussion)
I have a userdatabase on Punbb already. Is it possible for existing users to post on my Wordpress blog if I install this plug-in?
Hi VincentBroccoli,
This plugin is not yet covered that part, it just synced the WordPress user to punBB user database.
Best Regards,
Tien (http://codeandmore.com).
3 2009-01-03 16:22
Re: WordPress PunBB Complete integration (35 replies, posted in PunBB 1.3 discussion)
Hi lorenzo,
Do you mean post on punbb and it will post on WordPress, it would be possible but we have to modify or create some punbb code to do so.
On the Wordpress it is possible as well, by writing a plugin, may be it will be easier for you to rent some one to do it for you.
Best Regards,
Tien (http://codeandmore.com).
4 2008-12-26 17:45
Re: WordPress PunBB Complete integration (35 replies, posted in PunBB 1.3 discussion)
Hi SuperMAG,
Here installed one integration
http://wpandpunbb.codeandmore.com/
(login with admin / madman)
We will disable this one soon. Just to show you.
Best Regards,
Tien (http://codeandmore.com).
5 2008-12-26 16:11
Re: WordPress PunBB Complete integration (35 replies, posted in PunBB 1.3 discussion)
Hi SuperMAG,
We have never used fluxbb let us see what should be modified.
If any news I will post on this topic.
Best Regards,
Tien.
6 2008-12-26 13:59
Topic: WordPress PunBB Complete integration (35 replies, posted in PunBB 1.3 discussion)
Hi all,
We have wanted to integrate punBB with WordPress and found these
http://punbb.informer.com/forums/viewtopic.php?id=16433
http://www.rkblog.rk.edu.pl/w/p/punbb-a … on-plugin/
Most of credit goes to the creator, we just modified it to suit our need (in fact it was not working for us, but we have changed some code so it works). This is for WP 2.7, punBB 1.3 latest
Our new code follow
<?php
/*
Plugin Name: punBB integrator
Plugin URI: http://www.rkblog.rk.edu.pl
Description: Allows Wordpress to manager punBB users - login/logout/register/password change etc.
Version: 0.0.07.2008.01
Author: Riklaunim
Author URI: http://www.rkblog.rk.edu.pl
*/
add_action('profile_update', 'punbb_profile_update');
add_action('wp_logout', 'punbb_wp_logout');
add_action('wp_authenticate', 'punbb_wp_authenticate', 1, 2);
add_action('user_register', 'punbb_user_register');
add_action('activate_jl-punbb/jl-punbb.php', 'punbb_sync_tables');
define('PUNPATH', './forum'); // path to punbb folder
define('PUNPREFIX', 'pun'); // punBB table prefix
define('LANGUAGE', 'English'); // punBB language name, English, etc.
function forum_hash($str, $salt)
{
return sha1($salt.sha1($str));
}
function punbb_sync_tables()
{
global $wpdb;
// copy users from WP to punBB that doesn't have account on punBB
$q = $wpdb->get_results("SELECT * FROM ".$wpdb->users." WHERE user_login NOT IN (SELECT username FROM ".PUNPREFIX."users)");
foreach($q as $u)
{
// give forum admin to the WP admin.
IF($u->ID == 1)
{
$gid = 1;
}
else
{
$gid = 3;
}
$salt = md5(sha1(time().$u->user_login));
$salt = substr($salt, 0,11);
$wpdb->query('INSERT INTO '.PUNPREFIX.'users (username, group_id, password, email, email_setting, timezone, language, style, registered, registration_ip, last_visit, salt) VALUES(\''.$u->user_login.'\', '.$gid.', \'BRAK\', \''.$u->user_email.'\', 1, 1 , \''.LANGUAGE.'\', \'Oxygen\', '.time().', \''.strip_tags($_SERVER['REMOTE_ADDR']).'\', '.time().', \''.$salt.'\')');
}
// turn off emails for "dectivated" accounts on forum
$wpdb->query('UPDATE '.PUNPREFIX.'users SET email_setting = 2 WHERE username NOT IN (SELECT user_login FROM '.$wpdb->users.') AND id > 1');
}
function punbb_profile_update($id)
{
global $wpdb;
$wpuser = $wpdb->get_row("SELECT user_login, user_email FROM ".$wpdb->users." WHERE ID = ".$id." LIMIT 1");
$wpdb->query("UPDATE ".PUNPREFIX."users SET email='".$wpuser->user_email."' WHERE username = '".$wpuser->user_login."'");
}
function punbb_wp_logout()
{
include PUNPATH.'/config.php';
setcookie($cookie_name, NULL, time()-3600, '/', '', '0');
}
function punbb_wp_authenticate($user_login, $user_pass)
{
global $wpdb;
// wywołaj przy logowaniu jak masz dane
IF($user_login and $user_pass and strlen($user_login) > 1 and strlen($user_pass) > 1)
{
$wpuser = $wpdb->get_row("SELECT id,user_pass FROM ".$wpdb->users." WHERE user_login = '".mysql_real_escape_string($user_login)."' LIMIT 1");
if(wp_check_password($user_pass, $wpuser->user_pass, $wpuser->id))
{
$user = $wpdb->get_row("SELECT id, password, salt FROM ".PUNPREFIX."users WHERE username = '".mysql_real_escape_string($user_login)."' LIMIT 1");
include PUNPATH.'/config.php';
/*
punBB uses sha1, wordpress md5. We have to cheat a bit. If the sha1 hash-password in punBB is "BRAK" (look at punbb_user_register)
or it doesn't match sha1(password from good authentication) then we update it :)
*/
IF($user->password == 'BRAK' OR sha1($user_pass) != $user->password)
{
$wpdb->query("UPDATE ".PUNPREFIX."users SET password='".sha1($user_pass)."' WHERE username = '".mysql_real_escape_string($user_login)."'");
$user->password = sha1($user_pass);
}
$expire = time() + 31536000;
//here we can get many informations
$userInfoArray = $wpdb->get_row("SELECT id, group_id, password, salt FROM ".PUNPREFIX."users WHERE username='".mysql_real_escape_string($user_login)."'", "ARRAY_A");
$salt = $userInfoArray['salt'];
$form_password_hash = forum_hash($user_pass, $salt);
$base64 = base64_encode($user->id.'|'.$user->password.'|'.$expire.'|'.sha1($user->salt.$user->password.forum_hash($expire, $user->salt)));
if (version_compare(PHP_VERSION, '5.2.0', '>='))
{
setcookie($cookie_name, $base64, $expire, $cookie_path, $cookie_domain, $cookie_secure, true);
}
else
{
setcookie($cookie_name, $base64, $expire, $cookie_path.'; HttpOnly', $cookie_domain, $cookie_secure);
}
}
}
}
function punbb_user_register($id)
{
global $wpdb;
$wpuser = $wpdb->get_row("SELECT * FROM ".$wpdb->users." WHERE ID = ".$id." LIMIT 1");
$user = $wpdb->get_row("SELECT id FROM ".PUNPREFIX."users WHERE username = '".mysql_real_escape_string($wpuser->user_login)."' LIMIT 1");
// user already exists in punbb
IF($user->id)
{
$wpdb->query("UPDATE ".PUNPREFIX."users SET password='BRAK' WHERE username = '".mysql_real_escape_string($wpuser->user_login)."'");
}
// user does not exists
else
{
$salt = md5(sha1(time()));
$salt = substr($salt, 0,11);
$wpdb->query('INSERT INTO '.PUNPREFIX.'users (username, group_id, password, email, email_setting, timezone, language, style, registered, registration_ip, last_visit, salt) VALUES(\''.$wpuser->user_login.'\', 3, \'BRAK\', \''.$wpuser->user_email.'\', 1, 1 , \''.LANGUAGE.'\', \'Oxygen\', '.time().', \''.strip_tags($_SERVER['REMOTE_ADDR']).'\', '.time().',\''.$salt.'\')');
}
}
?>
Cheers if it helps anyone.
Best Regards,
Tien (http://codeandmore.com).