Advanced search  

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

Pages: [1]   Go Down

Author Topic: Coppermine/SMF Bridge: Auto create albums when registering in SMF  (Read 5380 times)

0 Members and 1 Guest are viewing this topic.

Steve-R

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 38

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


Code: [Select]
    $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


Code: [Select]
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...:)
Logged

Steve-R

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 38
Re: Coppermine/SMF Bridge: Auto create albums when registering in SMF
« Reply #1 on: January 18, 2008, 12:03:19 pm »

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

Steve
Logged

Nibbler

  • Guest
Re: Coppermine/SMF Bridge: Auto create albums when registering in SMF
« Reply #2 on: January 18, 2008, 01:36:51 pm »

Try asking at SMF. It's an SMF file you are changing.
Logged

Steve-R

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 38
Re: Coppermine/SMF Bridge: Auto create albums when registering in SMF
« Reply #3 on: January 18, 2008, 01:55:57 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...:)
Logged

Nibbler

  • Guest
Re: Coppermine/SMF Bridge: Auto create albums when registering in SMF
« Reply #4 on: January 18, 2008, 02:14:15 pm »

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

Code: [Select]
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.
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 15 queries.