News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

call up another db and editing it

Started by Hot Rides, April 09, 2008, 09:22:45 AM

Previous topic - Next topic

Hot Rides

I want smf to access a bridged db( i.e. coppermine, ect.) and modify at registration or through the member profile.
Basiclly what Im asking is what code do I use to tell it to look in a different db for information.

And so you dont try to assume what i'm wrongly, The main thing Im wanting to do is have an album in coppermine created everytime a user registers. I have some parts of the code needed, but do not know how to access the coppermine db to add them or where at in the register.php to put the code.

Kindred

actually, I think that the native coppermine bridge to SMF will do this automatically....    if you have the correct setting in coppermine. (i.e. create an album for each user)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Hot Rides

ok, where in the file would I need to put the code so that it did it properly?

Kindred

I don't think you understand.

To the bets of my knowledge, you do not have to do anything to the code.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Hot Rides

my fault, it seems I have confused you. I am wanting the registration process to automatically create an album in coppermine with the username.

$catid = mysql_insert_id() + FIRST_USER_CAT;
cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`, `category`) VALUES ('".addslashes($user_name)."', $catid)");

This should be the code I need to put in or a slight variation

I need to know where to put it so that it executes properly, I think I have figured out how to get to the right value, table, db

Kindred

again...   as I said, I believe that the option already exists to do just that, native to coppermine.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Hot Rides

it is not, it has been brought up for use in next release, but there is no telling when a stable version will be released

Kindred

ah, strange.  I thought it was part of the standard functionality.
I know that several of the other galleries have this built in - Gallery2, for example.


as for where to put that code...   you'll have to ask over on the coppermine forums, since it really has nothing to do with SMF.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Hot Rides

the code has to be placed in the SMF pages because its a bridged setup. registration uses the smf pages

Kindred

while registration might use the SMF pages, user creation in Coppermine still is triggers/handled by the coppermine functions.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Hot Rides

but registering takes place soley in smf, none of it is done in cm. therefore code has to be place on the smf side to access and edit the coppermine database

Kindred

really?   I don't think so.

The bridge matches users between smf and coppermine, it doesn't replace one user system with the other.  While the registration might take place in SMF, there is some function which is triggered to create the same user in the coppermine user table...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Hot Rides

then there must be something weird with my install becasue it writes nothing to the coppermine user table only the smf user table

Kindred

hmmm....   Ok, I am going to have to step back, since it has been a while since I worked with Coppermine. The previous versions that I worked with used both smf and coppermine user tables.


Anyone more familiar with the current implementation care to comment?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

rsw686

The user automatically gets their gallery space, but they need to create an album to put the pictures they upload in. It seems to me that this is best as why would you want to name the album the same name as their gallery. The users are allowed multiple albums in their gallery.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

rsw686

Quote from: Hot Rides on April 09, 2008, 03:58:30 PM
then there must be something weird with my install becasue it writes nothing to the coppermine user table only the smf user table

It is not supposed to. The bridge reads the smf user table to see who is allowed. Why create a duplicate of this information. It uses the SSI.php file to deal with the login / logout.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Kindred

rsw...

it USED to maintain both tables...
(and all of the other bridges do so)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

rsw686

Quote from: Kindred on April 09, 2008, 04:59:00 PM
rsw...

it USED to maintain both tables...
(and all of the other bridges do so)

I didn't know that it used to. I have read through the coppermine bridge code as I modified mine and was just stating that from the code there it doesn't store anything in its own user table.

Yes most other bridges do but they are storing other user information. Since the coppermine bridge uses the smf group assignment it doesn't have anything else to store about the user.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Hot Rides

Quote from: rsw686 on April 09, 2008, 04:56:18 PM
The user automatically gets their gallery space, but they need to create an album to put the pictures they upload in. It seems to me that this is best as why would you want to name the album the same name as their gallery. The users are allowed multiple albums in their gallery.
I really dont care what the album name is, I just want one created at registration so the user doesnt have to create albums before uploading. I dont want them to have to think. Most people are to lazy to keep clicking until they figure it out.

Hot Rides

looks like Im gonna get no help for this. SMF says its a coppermine issue, Coppermine says its an smf issue, lol, its a both issue if you ask me.

The coding has to be done to SMF to tell it to access and edit the Coppermine DB.

Advertisement: