Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help
Author Message
khizerk
New Member
New Member



Joined: Nov 18, 2007
Posts: 18

PostPosted: Sun Nov 18, 2007 2:25 am Reply with quote

As the topic says, I am trying to integrate a standalone phpBB installation with phpnuke. I don't wanna use bbtonuke since it no more has any mods being ported for it.

Ok so now, all I need to integrate is the logging in system.
My nuke is patched and nuke sentinel protected...so that produces some changes in index.php of Your_Account.

I want my nuke to pick up data from phpbb_users. So I tried changing the table from which data is picked from nuke_users to phpbb_users (both are same in their structure). But it just doesn't work.

I succeeded in making non-patched Your_Account to atleast log in, but in that case there was some problem with sessions/cookie with no modules recognizing me as logged in

Please help!
 
View user's profile Send private message
fkelly
Former Moderator in Good Standing



Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Sun Nov 18, 2007 7:42 am Reply with quote

My initial reaction is that, if you can make this work, we will be asking you for HELP rather than the other way around. I have never looked at a standalone PHPBB system but it is hard for me to understand how their users table could be identical to the Nuke users table. If I am not mistaken, when they did bbtonuke they took the PHPBB user fields and incorporated them into the Nuke user table, so the Nuke user table would be a superset. Correct me if I'm wrong about that. Much of the Nuke code expects a certain set of fields, in a certain order, in the users table and modifying that would be pretty difficult.
 
View user's profile Send private message Visit poster's website
khizerk







PostPosted: Sun Nov 18, 2007 11:58 am Reply with quote

Actually it has already been pulled off: [ Only registered users can see links on this board! Get registered or login! ]

I tried it quickly, well some parts are working some are not. Logging in from phpbb isn't working (I think its because of patches and maybe nuke sentinel, I don't remember exactly what they did to Your_Account, but they did change some things). What is working however is signing in from phpnuke (Your_Account) and then entering phpbb through cookies.
 
khizerk







PostPosted: Sun Nov 18, 2007 12:48 pm Reply with quote

Ok checked it in detail.
Basically two things aren't working.

1. Logging in using quick login box in phpbb (logging in through proper login page in phpbb works)

2. Logging in as admin in phpbb. It as usual asks me for re-authentication but then comes to "Illegal Operation"

Now I am going to cry!...I have been trying to get this thing to work for days now. Initially don't know why I thought I could make vbulletin integrate with phpnuke, got login to work but nothing else Very Happy

Then it comes to this Sad

-----------------------EDIT-----------------------
Ok some progress, I was stupid enough not to check index_body.tpl for coressponding changes. So there's only one thing that isn't working:
- Admin sign in in phpbb.
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sun Nov 18, 2007 1:05 pm Reply with quote

khizerk wrote:
I don't wanna use bbtonuke since it no more has any mods being ported for it.


I believe that [ Only registered users can see links on this board! Get registered or login! ] is still developing them. But, I have found that almost all of the phpbb mods work in nuke with very little, if any, changes. Obviously the more complicated ones will be more complicated in nuke but that would just stand to reason.


Last edited by Raven on Sun Nov 18, 2007 1:10 pm; edited 1 time in total 
View user's profile Send private message
khizerk







PostPosted: Sun Nov 18, 2007 1:08 pm Reply with quote

Yeah I agree with relation to easier mods, basically what forced me to change my mind was that I had been waiting and waiting for attachment mod 2.4.5 to be ported for bbtonuke 2.0.22. I think it must have been around 3-4 months now. Floppy at clan-themes told me initially that his friend was working on it. Then he said that it has been ported but with bugs. Then there was no reply and I don't really wan't to bother him again and again.

Actually phpbb standalone is working pretty well, just need to get over this admin problem.
 
Raven







PostPosted: Sun Nov 18, 2007 1:12 pm Reply with quote

See this post [ Only registered users can see links on this board! Get registered or login! ]
 
khizerk







PostPosted: Sun Nov 18, 2007 1:13 pm Reply with quote

Thanks Smile
 
khizerk







PostPosted: Tue Nov 20, 2007 7:59 am Reply with quote

I've successfully integrated standalone phpbb with phpnuke now! Very Happy
Finally I can use all phpbb mods (with just an addition of a variable when it comes to session management in them)
 
Raven







PostPosted: Tue Nov 20, 2007 8:05 am Reply with quote

I would be very interested to have a write-up on how you did the integration as opposed to the way it was done way back when Laughing Is it something that you would be willing to share?
 
khizerk







PostPosted: Tue Nov 20, 2007 9:00 am Reply with quote

I did this with bbtonuke running, so I needed all my data from there too, so there were some additional tweaks needed in the database than otherwise would be needed with a fresh forums install.
1. Rename all nuke_bb tables to nukebb_
2. Rename nuke_users to nukebb_users. Rename nuke_users_temp to nukebb_users_temp
3. Run this file after uploading it to the root of your server (to change join date to UNIXTIME):
Code:
<?php 


require_once("mainfile.php");
global $user_prefix,$db;

$months = array("abc","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");

$result = $db->sql_query("SELECT user_id, username, user_regdate FROM ".$user_prefix."_users");

echo "Fetching information for ".$db->sql_numrows($result)." users...<br><br>";

while($row = $db->sql_fetchrow($result)) {
        $date = $row['user_regdate'];
        $tmp = explode(" ",$date);
        $day = substr($tmp[1],0,2);
        $month = $tmp[0];
        while($month_name = current($months)) {
                if($month_name == $month) {
                        $month = key($months);
                }
                next($months);
        }
        reset($months);
        $year = $tmp[2];
        $unixdate = mktime(0,0,0,$month,$day,$year);
        echo "Converting regdate for ".$row['username']."...";
        $result2 = $db->sql_query("UPDATE ".$user_prefix."_users SET user_regdate=".$unixdate." WHERE user_id=".$row['user_id']);
        if(!$result2) {
                echo "<font color=\"#ff0000\"><b>Error!</b></font><br>";
        }
        else {
                echo "<font color=\"#00ff00\"><b>Success!</b></font><br>";
        }
}

?>

4. Install a phpBB2 installation in your server root (make sure you install it as a folder named phpBB2, unless you are planning to edit some of the edits need later on). I applied major mods like attachment mod before doing any further modification, but looking at what modification it needs, I am sure it can be applied afterwards too. I used EasyMod to apply the mods, and it worked like a charm

5. Edit config.php of nuke, set $user_prefix = "nukebb";

6. Edit nukebb_users:
- Change the user_id field from int(11) to mediumint(Cool and remove the autoincrement property.
- Change the Anonymous user to have a user_id of -1. (If there's no anonymous user added you will need to add one, since phpBB can't function properly without it)

7. Delete nukebb_config and rename phpbb_config to nukebb_config (I did this just incase there was any differences between bbtonuke config table and phpbb_config table, I am a lazy brat so I avoided comparing Very Happy)
- Now here, if you had applied mods to phpbb installation already, you would need to run all the sql queries that come with the mods again. Just change the table names in those sql queries from phpbb_xxxx to nukebb_xxx and remove any edits needed to phpbb_config, since they are already incorporated)

8. Now comes the part to do some edits. Obviously the edits might be different depending on your phpnuke, but I am using sentinel protected, patched nuke and it matched almost perfectly, any differences being in in this part: ($redirect == "" ))
Code:
#-----[ OPEN ]----------------------------------- 

#
modules/Your_Account/index.php

#
#-----[ FIND - THERE ARE 2 INSTANCES OF THIS]----
#
    $sql = "SELECT * FROM ".$prefix."_bbconfig";
    $result = $db->sql_query($sql);

#
#-----[ REPLACE BOTH INSTANCES WITH ]------------
#
    $sql = "SELECT * FROM ".$prefix."bb_config";
    $result = $db->sql_query($sql);

#
#-----[ FIND ]-----------------------------------
#
    $user_regdate = date("M d, Y");

#
#-----[ REPLACE WITH ]-----------------------------------
#
    $user_regdate = time();


#
#-----[ FIND ]-----------------------------------
#
    $db->sql_query("INSERT INTO ".$user_prefix."_users_temp (user_id, username, user_email, user_password, user_regdate, check_num, time) VALUES (NULL, '$username', '$user_email', '$new_password', '$user_regdate', '$check_num', '$time')");

#
#-----[ REPLACE WITH ]-----------------------------------
#
    $db->sql_query("INSERT INTO ".$user_prefix."_users_temp (user_id, username, user_email, user_password, user_regdate, check_num, time) VALUES (NULL, '$username', '$user_email', '$new_password', $user_regdate, '$check_num', '$time')");

#
#-----[ FIND ]-----------------------------------
#
     $db->sql_query("DELETE FROM ".$user_prefix."_users_temp WHERE time < $past");
     $sql = "SELECT * FROM ".$user_prefix."_users_temp WHERE username='$username' AND check_num='$check_num'";
     $result = $db->sql_query($sql);

#
#-----[ AFTER, ADD ]-----------------------------------
#
    $uid_result = $db->sql_query("SELECT MAX(user_id) AS total FROM ".$user_prefix."_users");
    $uid_row = $db->sql_fetchrow($uid_result);
    $user_id = $uid_row['total'] + 1;

#
#-----[ FIND ]-----------------------------------
#
        $db->sql_query("INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_password, user_avatar, user_regdate, user_lang) VALUES (NULL, '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', '$row[user_regdate]', '$language')");

#
#-----[ REPLACE WITH ]-----------------------------------
#
        $sql2 = "INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_password, user_avatar, user_regdate, user_lang) VALUES ('$user_id', '$row[username]', '$row[user_email]', '$row[user_password]', 'gallery/blank.gif', $row[user_regdate], '$language')";
        $db->sql_query($sql2);
 
#
#-----[ FIND ]-----------------------------------
#
    $db->sql_query("DELETE FROM ".$prefix."_bbsessions WHERE session_user_id='$r_uid'");

#
#-----[ REPLACE WITH ]-----------------------------------
#
    $db->sql_query("DELETE FROM ".$prefix."bb_sessions WHERE session_user_id='$r_uid'");


#
#-----[ FIND ]-----------------------------------
#
        if ($pm_login != "") {
            Header("Location: modules.php?name=Private_Messages&file=index&folder=inbox");
            exit;
        }
        if ($redirect == "" ) {
            Header("Location: modules.php?name=Your_Account&amp;op=userinfo&amp;bypass=1&amp;username=$username");
        } else if ($mode == "") {
            Header("Location: forums.html?amp;file=$forward");
        } else if ($t !="")  {
            Header("Location: forums.html?amp;file=$forward&amp;mode=$mode&amp;t=$t");
        } else {
            Header("Location: forums.html?amp;file=$forward&amp;mode=$mode&amp;f=$f");
        }

#
#-----[ REPLACE WITH ]-----------------------------------
#
        if ($redirect == "" ) {
            Header("Location: modules.php?name=Your_Account&op=userinfo&bypass=1&username=$username");
        } 
        else if ($redirect == "phpBB") {
            Header("Location: /phpBB2/");
        }
        else if ($mode == "") {
            Header("Location: /phpBB2/$forward");
        } else if ($t !="")  {
            Header("Location: /phpBB2/$forward&amp;mode=$mode&amp;t=$t");
        } else {
            Header("Location: /phpBB2/$forward&amp;mode=$mode&amp;f=$f");
        }

#
#-----[ FIND ]-----------------------------------
#
    if ($redirect != "") {
        echo "<META HTTP-EQUIV=\"refresh\" content=\"3;URL=modules.php?name=$redirect\">";
    } else {
        echo "<META HTTP-EQUIV=\"refresh\" content=\"3;URL=/index.php\">";
    }

#
#-----[ REPLACE WITH ]-----------------------------------
#
    if($redirect == "phpBB") {
                echo "<META HTTP-EQUIV=\"refresh\" content=\"0;URL=/phpBB2/\">";
    }
    else {
            if ($redirect != "") {
                echo "<META HTTP-EQUIV=\"refresh\" content=\"3;URL=modules.php?name=$redirect\">";
            } else {
                echo "<META HTTP-EQUIV=\"refresh\" content=\"3;URL=/index.php\">";
            }
    }

#
#-----[ SAVE & CLOSE ]-----------------------------------
#
/modules/Your_Account/index.php



Code:
#-----[ OPEN ]----------------------------------- 

#
admin.php

#
#-----[ FIND ]-----------------------------------
#
$user_regdate = date("M d, Y");

#
#-----[ REPLACE WITH ]-----------------------------------
#
$user_regdate = time();

#
#-----[ FIND ]-----------------------------------
#
$sql = "INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_website, user_avatar, user_regdate, user_password, theme, commentmax, user_lang, user_dateformat) VALUES (NULL,'$name','$email','$url','$user_avatar','$user_regdate','$pwd','$Default_Theme','$commentlimit','english','D M d, Y g:i a')";

#
#-----[ REPLACE WITH ]-----------------------------------
#
$sql = "INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_website, user_avatar, user_regdate, user_password, theme, commentmax, user_lang, user_dateformat) VALUES (2,'$name','$email','$url','$user_avatar',$user_regdate,'$pwd','$Default_Theme','$commentlimit','english','D M d, Y g:i a')";

#
#-----[ FIND ]-----------------------------------
#
            $db->sql_query("INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_website, user_avatar, user_regdate, user_password, theme, commentmax, user_level, user_lang, user_dateformat) VALUES (NULL,'$name','$email','$url','$user_avatar','$user_regdate','$pwd','$Default_Theme','$commentlimit', '2', 'english','D M d, Y g:i a')");

#
#-----[ REPLACE WITH ]-----------------------------------
#
           $sql = "INSERT INTO ".$user_prefix."_users (user_id, username, user_email, user_website, user_avatar, user_regdate, user_password, theme, commentmax, user_lang, user_dateformat) VALUES (2,'$name','$email','$url','$user_avatar',$user_regdate,'$pwd','$Default_Theme','$commentlimit','english','D M d, Y g:i a')";
           $db->sql_query($sql);

#
#-----[ FIND ]-----------------------------------
#
    $curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";

#
#-----[ REPLACE WITH ]-----------------------------------
#
    $curDate2 = $month[0].$month[1].$month[2]." ".$mday." ".$year;

#
#-----[ FIND ]-----------------------------------
#
    $curDateP = "%".$premonth[0].$premonth[1].$premonth[2]."%".$preday."%".$preyear."%";

#
#-----[ REPLACE WITH ]-----------------------------------
#
    $curDateP = $premonth[0].$premonth[1].$premonth[2]." ".$preday." ".$preyear;


#
#-----[ FIND ]-----------------------------------
#
    $row3 = $db->sql_fetchrow($db->sql_query("SELECT COUNT(user_id) AS userCount from $user_prefix"._users." WHERE user_regdate LIKE '$curDate2'"));
    $userCount = $row3['userCount'];
    $row4 = $db->sql_fetchrow($db->sql_query("SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE user_regdate LIKE '$curDateP'"));
    $userCount2 = $row4['userCount'];

#
#-----[ REPLACE WITH ]-----------------------------------
#
    $sql = "SELECT COUNT(user_id) AS userCount from $user_prefix"._users." WHERE FROM_UNIXTIME(user_regdate,'%b %e %Y') LIKE '$curDate2'";
    $result = $db->sql_query($sql);
    $row3 = $db->sql_fetchrow($result);
    $userCount = $row[userCount];
    $sql = "SELECT COUNT(user_id) AS userCount FROM $user_prefix"._users." WHERE FROM_UNIXTIME(user_regdate,'%b %e %Y') LIKE '$curDateP'";
    $result = $db->sql_query($sql);
    $row4 = $db->sql_fetchrow($result);
    $userCount2 = $row[userCount];

#
#-----[ SAVE & CLOSE ]-----------------------------------
#
/admin.php


9. These are the changes required in phpBB 2.0.22. As you will see most of them deal with login and logout functions which affect any mods

Code:
#-----[ OPEN ]----------------------------------- 

#
phpBB2/admin/pagestart.php

#
#-----[ FIND ]-----------------------------------
#
 include($phpbb_root_path . 'common.'.$phpEx);
 
#
#-----[ AFTER, ADD ]-----------------------------------
#
global $nukeuser;

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_INDEX);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_INDEX,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/admin/page_header_admin.php

#
#-----[ FIND ]-----------------------------------
#
'S_LOGIN_ACTION' => append_sid('../login.'.$phpEx),

#
#-----[ REPLACE WITH ]-----------------------------------
#
'S_LOGIN_ACTION' => append_sid('/modules.'.$phpEx.'?name=Your_Account'),

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/common.php

#
#-----[ FIND ]-----------------------------------
#
 {
     die("Hacking attempt");
 }

#
#-----[ AFTER, ADD ]-----------------------------------
#
$user = $_COOKIE['user'];
$nukeuser = base64_decode($user);
 
#
#-----[ OPEN ]-----------------------------------
#
phpBB2/faq.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_FAQ);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_FAQ,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/groupcp.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_GROUPCP);

#
#-----[    REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_GROUPCP,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/includes/constants.php

#
#-----[ FIND ]-----------------------------------
#
define('DELETED', -1);
define('ANONYMOUS', -1);
                                                                                 
define('USER', 0);
define('ADMIN', 1);
define('MOD', 2);

#
#-----[ REPLACE WITH ]-----------------------------------
#
define('DELETED', -1);
define('ANONYMOUS', -1);
   
define('USER', 1);
define('ADMIN', 2);
define('MOD', 3);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/includes/functions.php

#
#-----[ FIND ]-----------------------------------
#
    global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links, $gen_simple_header, $images;

#
#-----[ REPLACE WITH ]-----------------------------------
#
    global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links, $gen_simple_header, $images,$user;

#
#-----[ FIND ]-----------------------------------
#
        $userdata = session_pagestart($user_ip, PAGE_INDEX);

#
#-----[ REPLACE WITH ]-----------------------------------
#
        $userdata = session_pagestart($user_ip, PAGE_INDEX, $nukeuser);

#
#-----[ FIND ]-----------------------------------
#
        // Behave as per HTTP/1.1 spec for others
        header('Location: ' . $server_protocol . $server_name . $server_port . $script_name . $url);
    exit;
 }
 
#
#-----[ AFTER, ADD ]-----------------------------------
#
function bblogin($nukeuser, $session_id) {
        global $nukeuser, $userdata, $user_ip, $session_length, $session_id, $db, $nuke_file_path;
        define("IN_LOGIN", true);
        $cookie = explode(":", $nukeuser);
        $nuid = $cookie[0];
        $sql = "SELECT s.*
                FROM " . SESSIONS_TABLE . " s
                WHERE s.session_id = '$session_id'
                AND s.session_ip = '$user_ip'";
        if ( !($result = $db->sql_query($sql)) )
        {
                message_die(CRITICAL_ERROR, 'Error doing DB query userdata row fetch : session_pagestar');
        }
        $logindata = $db->sql_fetchrow($result);

        if( $nuid != $logindata['session_user_id'] ) {
            $nusername = $cookie[1];
            $sql = "SELECT user_id, username, user_password, user_active, user_level
                    FROM ".USERS_TABLE."
                    WHERE username = '" . str_replace("\'", "''", $nusername) . "'";
            $result = $db->sql_query($sql);
            if(!$result) {
                message_die(GENERAL_ERROR, "Error in obtaining userdata : login", "", __LINE__, __FILE__, $sql);
            }
            $rowresult = $db->sql_fetchrow($result);
            $password = $cookie[2];
            if(count($rowresult) ) {
                if( $rowresult['user_level'] != ADMIN && $board_config['board_disable'] ) {
                    header("Location: " . append_sid("/phpBB2/index.php", true));
                } else {
                    if( $password == $rowresult['user_password'] && $rowresult['user_active'] ) {
                        $autologin = 0;
                        $userdata = session_begin($rowresult['user_id'], $user_ip, PAGE_INDEX, $session_length, FALSE, $autologin);
                        $session_id = $userdata['session_id'];
                        if(!$session_id ) {
                            message_die(CRITICAL_ERROR, "Couldn't start session : login", "", __LINE__, __FILE__);

                        } else {
                        }
                    } else {
                        $message = $lang['Error_login'] . "<br /><br />" . sprintf($lang['Click_return_login'], "<a href=\"" . append_sid("/phpBB2/login.php&amp;$redirect") . "\">", "</a> ") . "<br /><br />" .  sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("/phpBB2/index.php") . "\">", "</a> ");
                        message_die(GENERAL_MESSAGE, $message);
                    }
                }
            } else {
                $message = $lang['Error_login'] . "<br /><br />" . sprintf($lang['Click_return_login'], "<a href=\"" . append_sid("/phpBB2/login.php&amp;$redirect") . "\">", "</a> ") . "<br /><br />" .  sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("/phpBB2/index.php") . "\">", "</a> ");
                message_die(GENERAL_MESSAGE, $message);
            }
        }

}

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/includes/functions_post.php

#
#-----[ FIND ]-----------------------------------
#
        $userdata = session_pagestart($user_ip, $page_id);
#
#-----[ REPLACE WITH ]-----------------------------------
#
        $userdata = session_pagestart($user_ip, $page_id,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/includes/page_header.php

#
#-----[ FIND ]-----------------------------------
#
'S_LOGIN_ACTION' => append_sid('login.'.$phpEx),

#
#-----[ REPLACE WITH ]-----------------------------------
#
'S_LOGIN_ACTION' => append_sid('/modules.'.$phpEx.'?name=Your_Account'),

#
#-----[ FIND ]-----------------------------------
#
//
// Generate logged in/logged out status
//
if ( $userdata['session_logged_in'] )
{
    $u_login_logout = 'login.'.$phpEx.'?logout=true&amp;sid=' . $userdata['session_id'];
    $l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]';
}
else
{
    $u_login_logout = 'login.'.$phpEx;
    $l_login_logout = $lang['Login'];
}

#
#-----[ REPLACE WITH ]-----------------------------------
#
//
// Generate logged in/logged out status
//
if ( $userdata['session_logged_in'] )
{
        $u_login_logout = '/modules.php?name=Your_Account&op=logout&redirect=phpBB';
        $l_login_logout = $lang['Logout'];
        $l_user = "Hello, ".$userdata['username']."! "; 
}
else
{
        $u_login_logout = 'login.'.$phpEx.'?redirect=phpBB';
        $l_login_logout = $lang['Login'];
        $l_user = "<a class=\"phpnuke\" href=\"/modules.php?name=Your_Account&amp;op=new_user\">Create</a> an account";
}

#
#-----[ FIND ]-----------------------------------
#
    'L_USERNAME' => $lang['Username'],
     'L_PASSWORD' => $lang['Password'],
     'L_LOGIN_LOGOUT' => $l_login_logout,

#
#-----[ AFTER, ADD ]-----------------------------------
#
    'L_USER' => $l_user,

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/includes/page_tail.php

#
#-----[ FIND ]-----------------------------------
#
 //
 // Show the overall footer.
 //

#
#-----[ AFTER, ADD ]-----------------------------------
#
global $nukeuser;

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/includes/sessions.php

#
#-----[ FIND ]-----------------------------------
#
    $SID = 'sid=' . $session_id;

#
#-----[ REPLACE WITH ]-----------------------------------
#
    $SID = ( $sessionmethod == SESSION_METHOD_GET ) ? 'sid=' . $session_id : '';
 
#
#-----[ FIND ]-----------------------------------
#
function session_pagestart($user_ip, $thispage_id)

#
#-----[ REPLACE WITH ]-----------------------------------
#
function session_pagestart($user_ip, $thispage_id,$nukeuser)

#
#-----[ FIND ]-----------------------------------
#
    global $db, $lang, $board_config;

#
#-----[ REPLACE WITH ]-----------------------------------
#
    global $db, $lang, $board_config,$session_id;

#
#-----[ FIND ]-----------------------------------
#
        $session_id = ( isset($HTTP_GET_VARS['sid']) ) ? $HTTP_GET_VARS['sid'] : '';
         $sessionmethod = SESSION_METHOD_GET;
     }

#
#-----[ AFTER, ADD ]-----------------------------------
#
        if ( ($nukeuser != "") && ($userdata['session_logged_in'] == "" )) {
                bblogin($nukeuser, $session_id);
        } else {
                $sessiondata = array();                 
        }

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/includes/topic_review.php

#
#-----[ FIND ]-----------------------------------
#
        $userdata = session_pagestart($user_ip, $forum_id);

#
#-----[ REPLACE WITH ]-----------------------------------
#
        $userdata = session_pagestart($user_ip, $forum_id,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/index.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_INDEX);

#
#-----[ REPLACE WITH ]-----------------------------------
#
global $nukeuser;
$userdata = session_pagestart($user_ip, PAGE_INDEX,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/login.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_LOGIN);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_LOGIN,$nukeuser);

#
#-----[ FIND ]-----------------------------------
#
$s_hidden_fields = '<input type="hidden" name="redirect" value="' . $forward_page . '" />';

#
#-----[ REPLACE WITH ]-----------------------------------
#
if($forward_page == "phpBB?") {
    $forward_page = "phpBB";
}

$s_hidden_fields = '<input type="hidden" name="op" value="login"><input type="hidden" name="redirect" value="' . $forward_page . '" />';

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/memberlist.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_VIEWMEMBERS);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_VIEWMEMBERS,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/modcp.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, $forum_id);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, $forum_id,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/posting.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_POSTING);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_POSTING,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/privmsg.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_PRIVMSGS);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_PRIVMSGS,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/profile.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_PROFILE);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_PROFILE,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/search.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_SEARCH);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_SEARCH,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/viewforum.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, $forum_id);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, $forum_id,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/viewonline.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_VIEWONLINE);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, PAGE_VIEWONLINE,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/viewtopic.php

#
#-----[ FIND ]-----------------------------------
#
$userdata = session_pagestart($user_ip, $forum_id);

#
#-----[ REPLACE WITH ]-----------------------------------
#
$userdata = session_pagestart($user_ip, $forum_id,$nukeuser);

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/templates/subSilver/index_body.tpl

#
#-----[ FIND ]-----------------------------------
#
<input type="submit" class="mainoption" name="login" value="{L_LOGIN}" /></td>

#
#-----[ AFTER, ADD ]-----------------------------------
#
<td><input type="hidden" name="redirect" value="phpBB" /><input type="hidden" name="op" value="login" /></td>

#
#-----[ OPEN ]-----------------------------------
#
phpBB2/templates/subSilver/login_body.tpl

#
#-----[ FIND SIMILAR ]---------------------------
#
<form action="{S_LOGIN_ACTION}" method="post">

#
#-----[ CONFIRM ]-----------------------------------
#
You MUST confirm that there is no "target="_top"" statement in this form tag. If there is, you MUST remove it.

#
#-----[ FIND SIMILAR ]---------------------------
#
<input type="password" name="user_password" size="25" maxlength="32" />

#
#-----[ CONFIRM ]-----------------------------------
#
You MUST confirm that the name of the "password" variable is "user_password".  If it is no "user_password", you MUST change it to "user_password".


#
#-----[ SAVE & CLOSE]-----------------------------------
#
All Files


10. Now edit phpbb config.php file. Change prefix from phpbb_ to nuke_bb

11. After applying this all, you will need to edit your index_body.tpl if your forum's theme provides quick login from the main index page. You'll need to:

Code:
# 

#-----[ FIND SIMILAR ]---------------------------
#
<input type="password" name="user_password" size="25" maxlength="32" />

#
#-----[ CONFIRM ]-----------------------------------
#
You MUST confirm that the name of the "password" variable is "user_password".  If it is no "user_password", you MUST change it to "user_password".

12. You might want to edit overall_header.tpl to replicate your phpnuke's header. For me it was fairly simple. I copied the html table from header.html (from my phpnuke theme) and paste it under the table in overall_header.tpl and updated the links to the .swf files)

13. After applying this mod, I wasn't able to login into the admin section of my forums, since phpBB asks for login again in that case. To avoid that:
Code:
############Open phpBB2/admin/pagestart.php############

############FIND#############
if (!$userdata['session_admin'])
{
   redirect(append_sid("login.$phpEx?redirect=admin/index.$phpEx&admin=1", true));
}
############Replace with############
/*if (!$userdata['session_admin'])
{
   redirect(append_sid("login.$phpEx?redirect=admin/index.$phpEx&admin=1", true));
}*/


This removes the requirement for second login. I intend to create my own little login page just to secure it a bit more

Ok, the edits are complete. Time for some notes:

1. If you haven't applied any mods and will apply them later, remember to change table names in the sql queries of the mods from phpbb_xxxx to nukebb_xxx)

2. In any mods that use session management in their files (for example download.php of attachment mod), you will need to:
Code:
########FIND SIMILAR#########

$userdata = session_pagestart($user_ip,
#####FOR EXAMPLE########
$userdata = session_pagestart($user_ip, PAGE_INDEX)
#######ADD INLINE, BEFORE ENDING BRACKET########
 ,$nukeuser
######BEFORE, ADD ($userdata = session_pagestart($user_ip, PAGE_INDEX)#######
global $nukeuser;


I am a noob as php as you can see, without any formal knowledge of the language. So, I am not a great tutor either Razz. I hope I haven't missed out anything...if someone wants I would be happy to upload my copy of the edited phpbb2
 
Raven







PostPosted: Tue Nov 20, 2007 10:33 am Reply with quote

Thank you for sharing this. I am making this a Sticky. If you or anyone else enhances it or fixes something later on please be sure to post it back here. :clap:
 
khizerk







PostPosted: Tue Nov 20, 2007 11:09 am Reply with quote

np, I will surely post anything else I do...if someone finds an error in the tutorial do notify....
 
fkelly







PostPosted: Tue Nov 20, 2007 6:28 pm Reply with quote

Wow. That is very impressive. Could we go back to the beginning a bit though in terms of objectives?

I take it you are trying to run a Nuke based system alongside a PHPBB system but have shared users? And you want to use the PHPBB users facilities rather than Nuke's?

If so, would you be using the PHPBB version of Your Account/Administration or Nuke's version? If a new user registers where would he/she be going? Would he be simulating the way a new user would register with PHPBB in standalone mode or would be he going thru Nuke Your Account? Likewise would a Nuke administrator be using PHPBB facilities or versions of Your Account?

This is very interesting. Especially reading the PHPBB3 glossies about where they are going, they seem to have all kind of users AND GROUPS facilities. If we could use these within Nuke and not have to reinvent it, it would be cool.
 
khizerk







PostPosted: Wed Nov 21, 2007 12:55 am Reply with quote

Yes I am running Phpnuke and Phpbb with shared users.

Basically, what this does is, this kind of makes phpbb login and logout system to use Your_Account for doing so.
For registration I can make it use any, that is phpbb or your_account registration, but ofcourse I would make it use phpbb's registration.

Likewise for user administration I can use both Nuke's and phpbb's. For stuff relating to downloads etc, I am ofcourse going to use nuke's administration (I am using EDL Downloads and am kinda stuck with it, I don't have the time to create a database converter for it to switch to some other system)

I haven't checked out phpbb3, it does 'look' better but I guess its still under development..and yeah, from security point of view to me it seems its always a good idea to be a little outdated, since see for phpnuke, exploit makers are now not concentrating on it Wink
But yeah it will be nice to see if the same thing can be done with it.
 
Raven







PostPosted: Wed Nov 21, 2007 1:00 am Reply with quote

How does the theming work between the two?
 
khizerk







PostPosted: Wed Nov 21, 2007 1:09 am Reply with quote

Well, you have to apply a theme for phpbb itself. Since I wasn't using my phpnuke's theme in bbtonuke anyway it wasn't much of a problem replicating the headers.

Let me show you. All I had to do to replicate the headers was to pick this section up from header.html of phpnuke's theme:
Code:
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="themes/BioLab/header/hm.jpg">

  <!--DWLayoutTable-->
  <tr>
    <td width="475" height="243" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr>
          <td width="475" height="180" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="475" height="180">
              <param name="movie" value="themes/BioLab/header/htl.swf">
              <param name="quality" value="high">
              <embed src="themes/BioLab/header/htl.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="475" height="180"></embed></object></td>
        </tr>
        <tr>
          <td height="41" valign="top"><img src="themes/BioLab/header/hbl.jpg" width="475" height="63"></td>
        </tr>
      </table></td>
    <td width="100%" valign="top"><img src="themes/BioLab/header/hm.jpg" width="2" height="243"></td>
    <td width="341" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr>
          <td width="341" height="180" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="341" height="180">
              <param name="movie" value="themes/BioLab/header/htr.swf">
              <param name="quality" value="high">
              <embed src="themes/BioLab/header/htr.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="341" height="180"></embed></object></td>
        </tr>
        <tr>
          <td height="63" valign="top"><img src="themes/BioLab/header/hbr.jpg" width="341" height="63"></td>
        </tr>
      </table></td>
  </tr>
</table>


And paste it in overall_header.tpl of my phpbb's theme:
Code:
<table width="{T_BODY_BACKGROUND}" cellspacing="0" cellpadding="0" border="0" align="center" id="maintable">


###PASTE TABLE HERE AND UPDATE THE LINKS TO IMAGES ETC###

<tr>
   <td valign="top" class="content-row"><table border="0" width="100%" cellspacing="0" cellpadding="0" id="logotable">
   <tr>
      <td align="center" class="logorow1"><div class="logorow2"><a href="{U_INDEX}"><img src="templates/AcidTechBlood/images/logo_mid.gif" height="88" alt="{L_INDEX}" /></a></div></td>
   </tr>
   </table>
   <table border="0" width="100%" cellspacing="0" cellpadding="0" id="buttonstable">
   <tr>
      <td align="center" valign="middle" width="100%" id="header-buttons">
         <!-- BEGIN switch_user_logged_out -->
         <a href="http://discusspaper.mobilejunkies.net/Tutorials/Home.htm">Tutorials</a> •
         <a href="{U_REGISTER}">{L_REGISTER}</a> •
         <!-- END switch_user_logged_out -->
         <!-- BEGIN switch_user_logged_in -->
         <a href="http://discusspaper.mobilejunkies.net/Tutorials/Home.htm">Tutorials</a> •
         <a href="{U_PROFILE}">{L_PROFILE}</a> •
         <a href="{U_PRIVATEMSGS}">{L_PRIVATEMSGS}</a> •
         <!-- END switch_user_logged_in -->
         <a href="{U_SEARCH}">{L_SEARCH}</a> •
         <a href="{U_FAQ}">{L_FAQ}</a> •
         <a href="{U_MEMBERLIST}">{L_MEMBERLIST}</a> •
         <a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a>
      </td>
   </tr>
   </table>
   <table border="0" width="100%" cellspacing="0" cellpadding="0" class="content">
   <tr>
      <td class="content" valign="top">

   <!-- BEGIN switch_user_logged_in -->
   <center><div class="pm-{PRIVMSG_IMG}"><a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a></div></center>
   <!-- END switch_user_logged_in -->


I used the version of theme which extended to both sides of the page so I didn't have to put in the side borders.
 
khizerk







PostPosted: Wed Nov 21, 2007 1:12 am Reply with quote

If you want to see, you can check it here: [ Only registered users can see links on this board! Get registered or login! ]

Its the test site.
 
Raven







PostPosted: Wed Nov 21, 2007 1:19 am Reply with quote

Just tried it and I see no phpnuke system at all. The Your Account and Download links produce 404's
 
khizerk







PostPosted: Wed Nov 21, 2007 1:24 am Reply with quote

You talking about discusspaper?
If yes then you must be using the top .swf to access Your_Account and Downloads.

If you are then thats normal since I haven't fixed the .swf file yet. The .swf file is configured to link to /Your_Account relative to your current link. It will just require a couple of mins on Flash MX to fix this. I haven't put any linkup (I mean through buttons), between phpnuke and phpbb.....since that is basic and will do it when I work on the main site.

So to navigate between them currently you will have to use your url box.
To go to phpnuke: [ Only registered users can see links on this board! Get registered or login! ]
To go to linked phpbb: [ Only registered users can see links on this board! Get registered or login! ]
 
Raven







PostPosted: Wed Nov 21, 2007 1:34 am Reply with quote

I was just referring to the nuke home page. There is no link from the Forums back to the Home page that I saw. BTW, when I clicked the link to the Forums from the home page it produce the following error:

phpBB : Critical Error

Could not query config information

DEBUG MODE

SQL Error : 1146 Table 'discusspaper.nuke_bbconfig' doesn't exist

SELECT * FROM nuke_bbconfig

Line : 223
File : common.php


Please don't misunderstand. With what you have presented here raises the hope of many people so you will get feedback, for sure Smile
 
khizerk







PostPosted: Wed Nov 21, 2007 1:36 am Reply with quote

hehe, don't worry.
As I said, I haven't put any buttons between the two. The forums button on the homepage links to bbtonuke, the tables of which have been renamed to suit phpbb.

So as I said:
To go to phpnuke: [ Only registered users can see links on this board! Get registered or login! ]
To go to linked phpbb: [ Only registered users can see links on this board! Get registered or login! ]
 
khizerk







PostPosted: Wed Nov 21, 2007 2:30 am Reply with quote

Ok I have fixed the forums link in the left pane...it will link to phpBB2

I need to find my Flash MX DVD to fix the header Wink
 
Raven







PostPosted: Wed Nov 21, 2007 8:08 am Reply with quote

What I and probably everyone am most curious about is whether or not the administrative changes you make in one will carry over to the other as they do now. For instance, if you use phpbb to change its theme will *nuke get changed too, and visa-versa. Are the Forum profile and *nuke Your Account Info functions integrated so that a change in one changes the other?
 
khizerk







PostPosted: Wed Nov 21, 2007 1:42 pm Reply with quote

No, its an integration of only users system. Any changes made through nuke or phpbb regarding users will be applied to both, others wont.

Well, it was perfect for me because my phpnuke forums theme bugged the private messages system, so I used a phpbb theme on my bbtonuke anyway. But I am sure a bbtonuke theme can be replicated for phpbb too.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Post Installation Help

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©