• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Profiles wont open?

Newbie Spellweaver
Joined
May 25, 2013
Messages
59
Reaction score
3
Hello,

Iv been trying to get Swift EMU working and i have bumped into a few issues!

When you click to view someones profile it does not open / show.

I have also tried Leensters edition however i still have the same issue.

I use Illumina CMS so it could be down to that but i currently use PlusEMU and the profiles work.

If anyone could help that would be fab :)

Thanks!
 
Newbie Spellweaver
Joined
May 25, 2013
Messages
59
Reaction score
3
Do you use mysql or mysqli?

You can also try this one by the way, could be that your account_created and last_online aren't integers/you're using a strict db.

PHP:
<?php
require_once 'required.php';
$query = mysql_query("SELECT * FROM users"); 
while($row = mysql_fetch_assoc($query)){ 
mysql_query("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive, id) VALUES ('" . $row["id"] . "', '0', '0', '1234', '1234', '0', '0', '0')") or die (mysql_error()); 
}
?>


Using Mysql

The database just remains empty when i do that and still no error just a white page
 
Upvote 0
Joined
Apr 24, 2013
Messages
1,685
Reaction score
1,135
Using Mysql

The database just remains empty when i do that and still no error just a white page
If you'll use this script, it will probably tell you the problem:
Code:
<?php
$username = "yourdbusername";
$password = "yourdbpassword";
$host = "localhost"; 
$database = "yourdbname";


$connect = mysql_connect($host, $username, $password);
$select = mysql_select_db($database, $connect);


if(!$connect || !$select){
	die("No database connection");
} else {
	$query = mysql_query("SELECT * FROM users");
	if (!$query){
		die("query wasn't successful");
	} else {
		while($row = mysql_fetch_assoc($query)){ 
			$query2 = mysql_query("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive, id) VALUES ('" . $row["id"] . "', '0', '0', '1234', '1234', '0', '0', '0')"); 
		}
		if (!$query2){
			echo "query2 wasn't succesful";
		} else {
			echo "Script was succesful";
		}
	}
}
?>
 
Upvote 0
Joined
Oct 11, 2012
Messages
544
Reaction score
143
I got mine working with RevCMS!
I edited the class.core and added this,

Code:
final public function getInfo()
{
  global $engine;
  return $engine->result("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive, id) VALUES ('" . $row["id"] . "', '0', '0', '1234', '1234', '0', '0', '0'");
}

Also for you're CMS.
You could put that script what Baas posted in a new php file and include it in the client?,
so when the user enters it will execute and insert there info into the user_info table.
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
May 25, 2013
Messages
59
Reaction score
3
If you'll use this script, it will probably tell you the problem:
Code:
<?php
$username = "yourdbusername";
$password = "yourdbpassword";
$host = "localhost"; 
$database = "yourdbname";


$connect = mysql_connect($host, $username, $password);
$select = mysql_select_db($database, $connect);


if(!$connect || !$select){
    die("No database connection");
} else {
    $query = mysql_query("SELECT * FROM users");
    if (!$query){
        die("query wasn't successful");
    } else {
        while($row = mysql_fetch_assoc($query)){ 
            $query2 = mysql_query("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive, id) VALUES ('" . $row["id"] . "', '0', '0', '1234', '1234', '0', '0', '0')"); 
        }
        if (!$query2){
            echo "query2 wasn't succesful";
        } else {
            echo "Script was succesful";
        }
    }
}
?>


It says query2 wasn't succesful.

Also thanks for your help so far :)


I got mine working with RevCMS!
I edited the class.core and added this,

Code:
final public function getInfo()
{
  global $engine;
  return $engine->result("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive, id) VALUES ('" . $row["id"] . "', '0', '0', '1234', '1234', '0', '0', '0'");
}

Also for you're CMS.
You could put that script what Baas posted in a new php file and include it in the client?,
so when the user enters it will execute and insert there info into the user_info table.

That code does not seem to work also.

Also yes that might be a good idea :p However the codes not working yet :p
 
Upvote 0
Joined
Apr 24, 2013
Messages
1,685
Reaction score
1,135
It says query2 wasn't succesful.

Also thanks for your help so far :)




That code does not seem to work also.

Also yes that might be a good idea :p However the codes not working yet :p
It should work now:
(I added a column id to query2, but that didn't seem to be in your user_info, that would've been the problem I think.)
Code:
<?php
$username = "yourdbusername";
$password = "yourdbpassword";
$host = "localhost"; 
$database = "yourdbname";


$connect = mysql_connect($host, $username, $password);
$select = mysql_select_db($database, $connect);


if(!$connect || !$select){
    die("No database connection");
} else {
    $query = mysql_query("SELECT * FROM users");
    if (!$query){
        die("query wasn't successful");
    } else {
        while($row = mysql_fetch_assoc($query)){ 
            $query2 = mysql_query("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('" . $row["id"] . "', '0', '0', '1234', '1234', '0', '0')"); 
        }
        if (!$query2){
            echo "query2 wasn't succesful";
        } else {
            echo "Script was succesful";
        }
    }
}
?>
 
Upvote 0
Joined
Oct 11, 2012
Messages
544
Reaction score
143
Wouldn't opening client.php

And finding
Code:
$db->real_query("UPDATE users SET ip_last = '" . $_SERVER["REMOTE_ADDR"] . "', auth_ticket = '" . $sso . "' WHERE id = '" . USER_ID . "'");

And then just below that add?
Code:
$db->real_query("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('" . $row["id"] . "', '0', '0', '1234', '1234', '0', '0')");

It could work, let me know if it does?
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
May 25, 2013
Messages
59
Reaction score
3
It should work now:
(I added a column id to query2, but that didn't seem to be in your user_info, that would've been the problem I think.)
Code:
<?php
$username = "yourdbusername";
$password = "yourdbpassword";
$host = "localhost"; 
$database = "yourdbname";


$connect = mysql_connect($host, $username, $password);
$select = mysql_select_db($database, $connect);


if(!$connect || !$select){
    die("No database connection");
} else {
    $query = mysql_query("SELECT * FROM users");
    if (!$query){
        die("query wasn't successful");
    } else {
        while($row = mysql_fetch_assoc($query)){ 
            $query2 = mysql_query("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('" . $row["id"] . "', '0', '0', '1234', '1234', '0', '0')"); 
        }
        if (!$query2){
            echo "query2 wasn't succesful";
        } else {
            echo "Script was succesful";
        }
    }
}
?>

Had some progress



its now created 5 pages of that :)

Wouldn't opening client.php

And finding
Code:
$db->real_query("UPDATE users SET ip_last = '" . $_SERVER["REMOTE_ADDR"] . "', auth_ticket = '" . $sso . "' WHERE id = '" . USER_ID . "'");

And then just below that add?
Code:
$db->real_query("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('" . $row["id"] . "', '0', '0', '1234', '1234', '0', '0')");

It could work, let me know if it does?

In the client.php? Don't forget I'm not using Revcms so the codes might be different m8
 
Upvote 0
Joined
Apr 24, 2013
Messages
1,685
Reaction score
1,135
Had some progress



its now created 5 pages of that :)
Do you mean it has created 5 pages with the same id's or with different? If it created different id's, your profiles will now work. It isn't a good idea to add a query to your client, because it will slow down the page dramatically. If you want this to work when a users registers, you'll have to find the query where a user gets inserted in the DB(INSERT INTO users (blablabla)) and add this query under it:
Code:
mysql_query("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . USER ID . "','0','0','" . time(). "','" . time() . "','0','0')");
I don't know the correct syntax for your CMS, but it should be something like that.
 
Upvote 0
Newbie Spellweaver
Joined
May 25, 2013
Messages
59
Reaction score
3
Do you mean it has created 5 pages with the same id's or with different? If it created different id's, your profiles will now work. It isn't a good idea to add a query to your client, because it will slow down the page dramatically. If you want this to work when a users registers, you'll have to find the query where a user gets inserted in the DB(INSERT INTO users (blablabla)) and add this query under it:
Code:
mysql_query("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . USER ID . "','0','0','" . time(). "','" . time() . "','0','0')");
I don't know the correct syntax for your CMS, but it should be something like that.

Yeah its different IDS's :)

But how is the table going to update such as the time they logged in etc?

Do you mean it has created 5 pages with the same id's or with different? If it created different id's, your profiles will now work. It isn't a good idea to add a query to your client, because it will slow down the page dramatically. If you want this to work when a users registers, you'll have to find the query where a user gets inserted in the DB(INSERT INTO users (blablabla)) and add this query under it:
Code:
mysql_query("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . USER ID . "','0','0','" . time(). "','" . time() . "','0','0')");
I don't know the correct syntax for your CMS, but it should be something like that.

What file am i adding this to?
 
Upvote 0
Joined
Oct 11, 2012
Messages
544
Reaction score
143
You use, illuminacms which is MySQLi

So open you're client.php where your CMS is located.

Find this
Code:
$db->real_query("UPDATE users SET ip_last = '" . $_SERVER["REMOTE_ADDR"] . "', auth_ticket = '" . $sso . "' WHERE id = '" . USER_ID . "'");

And below it,
add this
Code:
$db->real_query("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('" . $row["id"] . "', '0', '0', '1234', '1234', '0', '0')");

Since, you're using SwfEmu the login_timestamp
should not be different just because it's a different CMS -_-

Note: The code may be wrong,
I'm not really use to MySQLi I use MySQL for all my side projects.
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
May 25, 2013
Messages
59
Reaction score
3
You use, illuminacms which is MySQLi

So open you're client.php where your CMS is located.

Find this
Code:
$db->real_query("UPDATE users SET ip_last = '" . $_SERVER["REMOTE_ADDR"] . "', auth_ticket = '" . $sso . "' WHERE id = '" . USER_ID . "'");

And below it,
add this
Code:
$db->real_query("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive) VALUES ('" . $row["id"] . "', '0', '0', '1234', '1234', '0', '0')");

Since, you're using SwfEmu the login_timestamp
should not be different just because it's a different CMS -_-

Note: The code may be wrong,
I'm not really use to MySQLi I use MySQL for all my side projects.

It's not setting the correct register date or user ID
 
Upvote 0
Newbie Spellweaver
Joined
Oct 22, 2011
Messages
26
Reaction score
1
Use this PHP script to add al your excisting users to user_info. (I haven't tested this by the way)
PHP:
<?php 
$query = mysql_query("SELECT id, account_created, last_online FROM users");  
while($row = mysql_fetch_assoc($query)){    
mysql_query("INSERT INTO user_info(user_id, bans, cautions, reg_timestamp, login_timestamp, cfhs, cfhs_abusive, id)    VALUES (" . $row["id"] . ", 0, 0, " . $row["account_created"] . ", " . $row["last_online"] . ", 0, 0, 0)") or die (mysql_error()); 
}
?>
If it worked, I can help you with adding future users to user_info. :)

Where does this go?
 
Upvote 0
Joined
Apr 24, 2013
Messages
1,685
Reaction score
1,135
illumina cms
Go to your wwwroot/htdocs > engine > classes > class_users.php
Find:
Code:
public function addUser($username, $passwordHash, $email, $rank, $figure, $sex, $motto, $homeroom) {
Change to:
Code:
		public function addUser($username, $passwordHash, $email, $rank, $figure, $sex, $motto, $homeroom, $id) {
			global $db, $core;
			if($this->stmt = $db->prepare("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,home_room,credits,activity_points,last_online,account_created,ip_last,ip_reg) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "', '" . $motto . "', '" . $homeroom . "','15000','1000','','" . date('d-M-Y') . "', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['REMOTE_ADDR']."')")) {
				$this->stmt = $db->prepare("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . $id . "','0','0','" . time(). "','" . time() . "','0','0')");
				$this->stmt->execute();
				$this->stmt->close();
			}
			else {
				$db->databaseError($db->error);
			}
		}
This should do the trick. (I'm not sure though, I'm not familiar with OOP)

Where does this go?
I'll quote my post for you:
Just make a new PHP file somewhere in your cms, include/require your database connection(or make one in that file) and open that PHP file in your internet browser. It will then execute the script or give an error. If it's correctly executed, all your users will be in user_info.

Just remember that you have to delete the file after it's correctly executed and all your users are in user_info.
 
Upvote 0
Newbie Spellweaver
Joined
Oct 22, 2011
Messages
26
Reaction score
1
Go to your wwwroot/htdocs > engine > classes > class_users.php
Find:
Code:
public function addUser($username, $passwordHash, $email, $rank, $figure, $sex, $motto, $homeroom) {
Change to:
Code:
		public function addUser($username, $passwordHash, $email, $rank, $figure, $sex, $motto, $homeroom, $id) {
			global $db, $core;
			if($this->stmt = $db->prepare("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,home_room,credits,activity_points,last_online,account_created,ip_last,ip_reg) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "', '" . $motto . "', '" . $homeroom . "','15000','1000','','" . date('d-M-Y') . "', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['REMOTE_ADDR']."')")) {
				$this->stmt = $db->prepare("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . $id . "','0','0','" . time(). "','" . time() . "','0','0')");
				$this->stmt->execute();
				$this->stmt->close();
			}
			else {
				$db->databaseError($db->error);
			}
		}
This should do the trick. (I'm not sure though, I'm not familiar with OOP)


I'll quote my post for you:

It gave me a server error, how do I know if it's been executed successfully?
 
Upvote 0
Newbie Spellweaver
Joined
May 25, 2013
Messages
59
Reaction score
3
Go to your wwwroot/htdocs > engine > classes > class_users.php
Find:
Code:
public function addUser($username, $passwordHash, $email, $rank, $figure, $sex, $motto, $homeroom) {
Change to:
Code:
        public function addUser($username, $passwordHash, $email, $rank, $figure, $sex, $motto, $homeroom, $id) {
            global $db, $core;
            if($this->stmt = $db->prepare("INSERT INTO users (username,password,mail,auth_ticket,rank,look,gender,motto,home_room,credits,activity_points,last_online,account_created,ip_last,ip_reg) VALUES ('" . $username . "','" . $passwordHash . "','" . $email . "','','" . $rank . "','" . $figure . "','" . $sex . "', '" . $motto . "', '" . $homeroom . "','15000','1000','','" . date('d-M-Y') . "', '".$_SERVER['REMOTE_ADDR']."', '".$_SERVER['REMOTE_ADDR']."')")) {
                $this->stmt = $db->prepare("INSERT INTO user_info (user_id,bans,cautions,reg_timestamp,login_timestamp,cfhs,cfhs_abusive) VALUES ('" . $id . "','0','0','" . time(). "','" . time() . "','0','0')");
                $this->stmt->execute();
                $this->stmt->close();
            }
            else {
                $db->databaseError($db->error);
            }
        }
This should do the trick. (I'm not sure though, I'm not familiar with OOP)


I'll quote my post for you:

All sorted now! Thanks for your help :)
 
Upvote 0
Back
Top