• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

{SUPPORT REQUEST} Php member_group sync with ipboards?

katos

Noble Member
(sorry if this is the wrong section!)

Unfortunately I could not think of a fitting title for what I am trying to achieve here, so hopefully the description below will make a little bit more sense.

Anyhoo, I basically have two databases: Forums and Application (for example) --> could I set it up so that Ipboards (forums) uses the account level shown in the Application DB to determine the group that the member should be placed in unless determined otherwise?
For example:
If Application(the db); member level(table column or whatever :p) = 1 THEN rank on forums: MEMBER
And have this rank display on the forums.

I could set up the groups on the forums and have the requirements chosen from the DB of application?? (in short, i suppose)

Make sense?

Kind regards,
Katos

(If this makes absolutely no sense at all then please feel free to post below and I will try to explain.)
 

katos

Noble Member
No, I have two seperate databases, and two seperate things. Lets look at it like this:

Auth
forums

I want the auth account levels to determine your rank on the forums. (The website is bridged (website uses auth))
for example :
account level 1 (VIP) --> rank VIP on forums given

Sorry if I am not being clear,
Katos
 

Tommy

Founder
No, I have two seperate databases, and two seperate things. Lets look at it like this:

Auth
forums

I want the auth account levels to determine your rank on the forums. (The website is bridged (website uses auth))
for example :


Sorry if I am not being clear,
Katos

Oh, why didn't you say that to begin with? XD

It's possible. What particular issues are you having with it? Really, all you'd need to do is make a query on your forum to get the level from the auth and go from there.
 

katos

Noble Member
Wasnt sure how to describe it Faded, i can't think straight at all today.

Really, all you'd need to do is make a query on your forum to get the level from the auth and go from there.

This is my main issue tbh, could you provide details for how to do this please?
 

Tommy

Founder
Wasnt sure how to describe it Faded, i can't think straight at all today.



This is my main issue tbh, could you provide details for how to do this please?

I'm not Faded! >.>

I'm not sure how IPB has their MySQL layout. Meaning, function names, etc..

Only thing I can point you toward is my own example on how to do it with PHP mysqli connection. This is how I would handle it:

I would add an option (required) * box for the user to supply their ingame account username. Then, I would query that to get his accountId and then query rbac_account_permissions table to get the permissionId to set the forum userId depending on their account level in game.

Code:
<?php
    session_start();

    $host = "127.0.0.1";
    $user = "root";
    $pass = "root";
	$db = "auth";
	
    $conn = mysqli_connect($host, $user, $pass);
    $mysqli = $conn;
    if (!$mysqli)
    {
        echo "Could not connect to server \n";
        trigger_error(mysqli_connect_error(), E_USER_ERROR);
    }

    $acctName = $_POST['OptionUserName'];
	$forumUserName = $_POST['ForumUserName'];
    $acctName = $mysqli->real_escape_string($acctName);
    $result = $mysqli->select_db($db);

    if (!$result)
    {
        echo "Failed!";
        trigger_error(mysqli_connect_errno(), E_USER_ERROR);
    }

    $sql = "SELECT id FROM auth.account WHERE username='$acctName'";
    $acctName = $mysqli->query($sql);
	
	$acctLevel = 0;
    $acctId = 0;

    if (!$acctName)
    {
        echo "Your supplied username could not be found..";
        return;
    }
    else
    {
        while ($row = mysqli_fetch_array($acctName)) // Doubt the while is needed
        {
		    $acctId = $row['id'];
        }
    }
	
	$sql = "SELECT permissionId FROM auth.rbac_account_permissions WHERE accountId='$acctId'";
	$authQuery = $mysqli->query($sql);
	
	if (!$authQuery)
	{
	    echo 'Could not find acctId..';
	    return;
	}
	else
	{
	    switch ($row['id'])
	    {
			case 192:
			   $acctLevel = 6; // Administrator
			   break;
			case 193:
			   $acctLevel = 5; // Gamemaster
			   break;
			case 194:
			   $acctLevel = 4; // Moderator
			   break;
			case 195:
			   $acctLevel = 1; // Member
			   break;
		}
		mysqli_query($conn, "UPDATE ipb.user SET group='$acctLevel' WHERE username='$forumUserName'");
    }
    $mysqli->close();
 

katos

Noble Member
Shit, proof I am currently wired on coffee, sorry TOMMY

Thanks for this, I shall pass it on to my developer and see what he can pull from this, much obliged. I will get back to you RE this. :)
 
Top