[MOD] Integrate SMF with your CPG [CPG 1.4.X] Version 1.1 [MOD] Integrate SMF with your CPG [CPG 1.4.X] Version 1.1
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[MOD] Integrate SMF with your CPG [CPG 1.4.X] Version 1.1

Started by just_some_guy, August 21, 2007, 11:18:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

just_some_guy

Hello,

This version is the same but easier to install.

The goal I wanted to achieve when making this mod was to add a forum to my website and not lose all members when doing this. Most of you will say "That's easy just bridge it" Well, the downside of bridging in my case was losing all current members and user groups. Also when bridging your CPG with SMF the forum will become priority and when logging into the gallery you will start of at the forum.

This way, when logging in you use the CPG login as usual and your CPG simply has a link to the forum where the member can then sign in to the forum and post. With this mod any new registers will automatically become members of the forum. All current members will be transferred to the SMF forum and become members. All users will be "saved".

Easy Install:

1. - Download the attached file.
2. - Backup all files, folders and database.
3. - Upload the modified register.php to the root of your CPG.
4. - Upload install.php to the root of your website.
5. - Open www.yourwebsite.tld/install.php
6. - Input your MySql details and click "Run".
7. - Delete install.php.

Version 1.

This is the same mod but with out the installer.

Files that require editing: register.php and your database.

Let's start.

Step 1. Backup all files and the database – This is very important as you will be editing the database and if you make a mistake then you could risk losing all members, I can't stress how important it is to do this.

Step 2. Using a tool like phpmyadmin (this is what used) run the following query on the database. (Assuming that you kept the default table prefixes when installing SMF and CPG) if changed then you will have to edit the code to suit you. If you already have members in this table you will probably need to truncate it.
Query:

insert
  into smf_members
     ( memberName
     , passwd
     , emailAddress
     , realName )
select user_name
     , user_password
     , user_email
     , user_name
from cpg1411_users


This will copy all current users of CPG into SMF

When you transfer the users and your admin account on the SMF gets lost do this:

Open up table: smf_members table and find your admin username. And edit it so your ID_GROUP appears as 1. This is manually making your self an admin,


Step 3. Now we need to make all new registrations members of the SMF too. Open register.php and find:

$sql = "INSERT INTO {$CONFIG['TABLE_USERS']} ".
           "(user_regdate, user_active, user_actkey, user_name, user_password, user_email, user_profile1, user_profile2, user_profile3, user_profile4, user_profile5, user_profile6) ".
           "VALUES (NOW(), '$active', '$act_key', '" . addslashes($user_name) . "', '" . addslashes($encpassword) . "', '" . addslashes($email) . "', '$profile1', '$profile2', '$profile3', '$profile4', '$profile5', '$profile6')";
           
if ($CONFIG['log_mode'])
{
        log_write('New user "'.addslashes($user_name).'" created on '.date("F j, Y, g:i a"),CPG_ACCESS_LOG);
    }
         
    $result = cpg_db_query($sql);


And on the line after  "$result = cpg_db_query($sql);"

Add :

$sql= "INSERT INTO smf_members".
   "(memberName, passwd, emailAddress, realName) ".
   "VALUES ('" . addslashes($user_name) . "', '" . addslashes($encpassword) . "', '" . addslashes($email)."','" . addslashes($user_name) . "')" ;

$result = cpg_db_query($sql);


Obviously if you changed the default prefixes when you installed SMF and CMG then you will need to edit the above to suit you.

You will notice in the smf_members table there are many more columns. From what I have found these can be changed in the profile or automatically as the user uses the forum.

As with bridging the user may not show in the SMF memberlist.

All that's left is to do a test run it. I haven't tested making people moderators etc, but I think this can be done the same way as manually making your self an admin. You will need to find the number that a moderator corresponds with. (Example: Admin = 1 and Member = 0).

This is my first mod, hope you like it and it proves useful. It did for me!

1 known issue: If a user selects to hide their email address it appears as hidden in their profile but not in their post.

Demo:

Gallery: http://www.mysimtractor.com
Forum: http://www.mysimtractor.com/forum

Any bugs etc. please let me know.

Thanks to:
-Sami
-the devshed.com forums
-w3schools.com

for the help.

just_some_guy


Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

just_some_guy

Can you please move this to the mods section.

thanks,

just_some_guy
Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

just_some_guy

Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

just_some_guy

Here is the installer in spanish, this is not for the spanish version of SMF it is just the installer in spanish.

Hola,

Hablo Espanol tambien, aqui es el instalador en Espanol. Perro no es por Espanol SMF.
Lo siento por me mal Espanol, es mi segundo idioma.

just_some_guy

Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Joachim Müller

Quote from: just_some_guy on August 21, 2007, 11:18:32 PM
This version is the same but easier to install.
I guess you're refering to your other thread "[MOD] Integrate SMF with your CPG [CPG 1.4.X]"

To all who come across this thread, looking for a way to bridge Coppermine and SMF: this mod is not the recommended way to bridge both apps - what it does is moving the users existing in your coppermine gallery to SMF.

Quote from: just_some_guy on August 21, 2007, 11:19:17 PM
Can you please move this to the mods section.
As suggested in the other thread: I would have prefered it if someone would have reviewed the proposed mod before it gets moved to the mods section.
So here's a warning: use at your own risk! Report if everything worked as expected.

just_some_guy

I would appreciate all feedback, and please post any bugs etc.
Tambien, Hablo Español      PHP - Achieve Anything
"The Internet is becoming the town square for the global village of tomorrow. " - Bill Gates
Windows 7 Forums

Heroe

I read the thread and want to ask -
I searching exactly for script to import all my members from my gallery to my new installed forum SMF 2.0 RC2, if i understand GauGau correct this script will add the existing  users from coppermine to the forum ???

QuoteTo all who come across this thread, looking for a way to bridge Coppermine and SMF: this mod is not the recommended way to bridge both apps - what it does is moving the users existing in your coppermine gallery to SMF.