Coppermine/SMF Bridge: Auto create albums when registering in SMF Coppermine/SMF Bridge: Auto create albums when registering in SMF
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Coppermine/SMF Bridge: Auto create albums when registering in SMF

Started by Steve-R, January 13, 2008, 11:37:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Steve-R

I have seen there is a way of doing this when registering in Coppermine, by adding a line to register.php (CPG), but is there a way to do this in a bridged SMF/CPG when registering via SMF?

For auto-create albums when registering via coppermine..I have seen this.

Edit register.php, 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)

after, add



cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`) VALUES ('".addslashes($user_name)."')");


I've tried adding the last piece of code and variations into SMF's own register.php and so far although I have had no errors, it has not worked.

Can anyone help with this?

Many thanks.

Steve...:)

Steve-R

I'm guessing here, but someone must have this working. Can anyone help at all?

Steve

Nibbler


Steve-R

Quote from: Nibbler on January 18, 2008, 01:36:51 PM
Try asking at SMF. It's an SMF file you are changing.

Thats fair enough Nibbler, but wont they say its a coppermine album you trying to create..ask at Coppermine?

Hence why I asked in this bridging forum, figuring that someone might already have this working. I dont think there is a bridging area at SMF, least there was not two days ago.

However, I am trying to do this myself in the meantime.

Steve...:)

Nibbler

Just ask them how to run the query using the SMF db functions such that the $name gets replaced with the username.


INSERT INTO cpg_albums (`title`) VALUES ('$name')


Change the table name prefix to whatever you used, you can't use the variable outside of Coppermine.

If you have them in separate databases then it might be more complicated.