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

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

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.