Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2009
    Location
    Denmark <'3
    Posts
    44
    Thanks
    5
    Thanked 1 Time in 1 Post

    Need help PHP-fusion to PCPIN chat user convertion script!

    Hey all if there is anyone out that that know about PCPIN chat I would appreciate your help here I doubt that anyone would start to look into it's code just to help me here so I hope that if there is any who knows about it will assist me
    And before I start explaining SORRY FOR MY MESSY CODE! this is like hell reading sometimes because I just created this for a one time run ...

    okay then lets begin .. for some days I've been trying to convert users from a "PHP-fusion" database (A Open Source CMS system google it if you want to learn more) to the PCPIN chat Database but first of all every time I convert the users when I then load the chat login page it deletes them so I want to know what and where do I need to register stuff and is it possible just to load a couple of PCPIN's class files and call a function to create a user? I tried that but got a bunch of errors
    and I've tried to look through all their code but it is a bit overwhelming for me

    basic what I simply want is a way to create users manually.

    but this is what I got so far :

    PHP Code:
    <?php
    // Connect to MySQL server
    mysql_connect($mysql_host$mysql_username$mysql_password) or die('Error connecting to MySQL server: ' mysql_error());
    // Select database
    mysql_select_db($mysql_database) or die('Error selecting MySQL database: ' mysql_error());




    $q1 mysql_query("SELECT * FROM fusion_users");
    $usnm = array();
    $pass = array();
    $levl = array();
    $mail = array();
    $hima = array();
    $number 0;
    while(
    $row mysql_fetch_assoc($q1)):
    $usnm[$number] = $row['user_name'];
    $pass[$number] = $row['user_password'];
    $levl[$number] = $row['user_level'];
    $mail[$number] = $row['user_email'];
    $hima[$number] = $row['user_hide_email'];
    $number++;
    endwhile;
    $number $number 1;
    mysql_select_db($msdb2) or die('Error selecting MySQL database: ' mysql_error());


    while(
    $number >= 0):
    $isadmin = ($levl[$number] > 101 "y" "n");
    $newpass md5($pass[$number]);
    $color = ($isadmin == "y" "ff0000" "000000");
    $nickname "^" $color $usnm[$number];
    $naame $usnm[$number];

    $q mysql_query("INSERT INTO pcpin_user (login, password, email, hide_email, activated, is_admin, moderated_rooms, moderated_categories, banned_by, muted_users, password_new) VALUES('$usnm[$number]', '$pass[$number]', '$mail[$number]', '$hima[$number]', 'y', '$isadmin', '', '', '0', '', '$newpass')") or print("Convertion of user: '$usnm[$number]', failed: " mysql_error());
    $q3 mysql_query("SELECT * FROM pcpin_user WHERE login = '$naame'") or die(mysql_error());
    $row123 mysql_fetch_assoc($q3);
    $user_id $row123['id'];
    $q2 mysql_query("INSERT INTO pcpin_nickname (user_id, nickname, nickname_plain, `default`) VALUES('$user_id', '$nickname', '$usnm[$number]', 'y')") or print("&nbsp;&nbsp;&nbsp;Failed creating nick_name for user: '$usnm[$number]' : " mysql_error());
    if(
    $q && $q2){
        echo 
    "Convertion of user: $usnm[$number], was successfull";
    }

    echo 
    "<br />";
    $number--;
    endwhile;

    echo 
    "<br /><br />Convetion script end!";
    ?>
    Again sorry for the code
    (Ofcourse connection variables is declared before this code )

    Thanks !

  • #2
    New Coder
    Join Date
    Apr 2009
    Location
    Denmark <'3
    Posts
    44
    Thanks
    5
    Thanked 1 Time in 1 Post
    Got it resolved now but can't edit this thread by some reason ...

  • #3
    New to the CF scene
    Join Date
    Jun 2011
    Location
    denmark
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by diload View Post
    Got it resolved now but can't edit this thread by some reason ...
    and solution was? since i got the same problem


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •