Jump to content
MakeWebGames

How to integrate SMF into any McCodes Package


sniko

Recommended Posts

How to integrate simple machine forums into any mccodes package

Addons

 

Requirements

  • Enough server space to host the software
  • (Optional) Able to create another database, with a separate database user; keeping things separate
  • + these....

 

Why use this?

  • Install awesome packages
  • Very easy to manage
  • Hardly no programming required
  • Probably ((don't quote me) much more secure than your current forums)
  • No need for users to register twice, data is copied into SMF on signup

 

What do I have to do?

Really, nothing, apart from the following;

If you chose to create another database, with a separate database user, do so.

Download simple machine forums into (preferable) a different directory, perhaps /forum and run the installer.

  1. Run the installer; http://www.game.com/forum
  2. Fill in the form appropriately
  3. Create your admin account
  4. Complete

 

Downfalls

  1. This method 'copies' the user details from register into the smf tables, so existing members won't be automatically signed up
  2. Preferably used on fresh installs

 

Instructions

Open up register.php, and find the section where is says "You've signed up, enjoy the game", then a query. Just before this, add;

(Code mucked up, or not showing? Click me)

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

 

....and you're all set ;)

When people sign up, they've been entered into SMF database, so they can just log in with their game details on SMF forum

 

Notes....

I chose SMF as it's fairly easy to use, and install, as well as being very flexible - granted, I haven't explored other forum software - don't gun me down, trolls.

Link to comment
Share on other sites

now if i wanted to use the IPB forums, would it be basically the same setup and in this line of code :

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

or do you think its a whole different setup

 

It will be the same techniques;

  • Opening a database connection
  • Encrypting/hashing the passcode
  • Inserting into dataase
  • Close database connection

 

You will have to find out how IPB forums encrypt/hash the passcodes, as it would have to be the same.

Link to comment
Share on other sites

It will be the same techniques;
  • Opening a database connection
  • Encrypting/hashing the passcode
  • Inserting into dataase
  • Close database connection

 

You will have to find out how IPB forums encrypt/hash the passcodes, as it would have to be the same.

 

Thanks Ill have to mess around with that

Link to comment
Share on other sites

i made a little cheesy script to take your current members get imported to the smf db.

its ugly but works so dont hate appreciate lol, but im sure some one will think of a nicer way and possibly share the wealth

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Im currently trying to work out a way to take something like cronus' announcement mod and make a new thread there but im hitting a little

snag on it creating a new thread instead of it adding to a current one

Edited by KyleMassacre
Link to comment
Share on other sites

What about if If my session is available for the game, making it available for the forums aswell, just an idea...

Also, will this support all versions of SMF?

KyleMassacre and I were discussing this on Skype. Perhaps it's something I'll venture into someday, as for now, I have no spare time.

Link to comment
Share on other sites

i made a little cheesy script to take your current members get imported to the smf db.

its ugly but works so dont hate appreciate lol, but im sure some one will think of a nicer way and possibly share the wealth

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Im currently trying to work out a way to take something like cronus' announcement mod and make a new thread there but im hitting a little

snag on it creating a new thread instead of it adding to a current one

Awesome. I've added a permalink into the original post.

Link to comment
Share on other sites

  • 3 weeks later...
  • 6 months later...

Sorry to update such an old thread, however, here's an addon to update the amount of players, and the latest members name (displayed in the statistics center, and info center)

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Then just call those functions as soon as someone signs up;

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

:)

Edited by sniko
Link to comment
Share on other sites

  • 3 weeks later...

hi

great topic, really helped me get started on integrating a better forum to our site. One question I have though is how could I make it so if someone changes their password in the forums, it updates on the main site. I've had a look but cant seem to find anywhere that would allow me to enter a query. It appears pretty easy to do the other way around (change on main site, update forum password) just struggling to do it from the forum side. I know this isnt something that people would really do anyway but theres bound to be one person that does it then says their locked out because it didn't update their main password.

 

thanks for any info you can give!

Link to comment
Share on other sites

hi

great topic, really helped me get started on integrating a better forum to our site. One question I have though is how could I make it so if someone changes their password in the forums, it updates on the main site. I've had a look but cant seem to find anywhere that would allow me to enter a query. It appears pretty easy to do the other way around (change on main site, update forum password) just struggling to do it from the forum side. I know this isnt something that people would really do anyway but theres bound to be one person that does it then says their locked out because it didn't update their main password.

 

thanks for any info you can give!

I've not actually done this. However, you will have to edit the forums source - I've not got access to the forums source at the moment, but it will be the same workaround;

  • Connect to your game database
  • Encrypt the passcode with the same encryption method used in vanilla signup
  • Update the passcode field in your game database
  • close database connection

 

:)

Link to comment
Share on other sites

well just like sniko stated you can open your connection to your other db like in the instructions above in the page(s) where the user will change his forum info like username/password. You are basically going to do the reverse of what you did to integrate the forum.

Now I'm not too sure if you can include your global funcs file in the smf page so you can keep your mysql class you currently use so its not different to run you commands, ex: $db->query() or just do mysqli if your not able to figure out the class structure smf uses to update the database, then you close your connection with your mc codes db

Link to comment
Share on other sites

thanks guys, working on it now.

I've had another issue aswell, because at the time of the new users being inserted into the smf tables, they dont have a userid defined yet, ive found that there's nothing solid linking the user details in the smf members table to the user details in the site users table. Is it just a case of starting with a fresh set of table so the ID's automatically match as people sign up. Sorry if I'm missing an obvious fix here.

Link to comment
Share on other sites

thanks guys, working on it now.

I've had another issue aswell, because at the time of the new users being inserted into the smf tables, they dont have a userid defined yet, ive found that there's nothing solid linking the user details in the smf members table to the user details in the site users table. Is it just a case of starting with a fresh set of table so the ID's automatically match as people sign up. Sorry if I'm missing an obvious fix here.

Have you used this? Using it (with a fresh install of SMF) will 'mirror' your games table to the SMF table.

  • Like 1
Link to comment
Share on other sites

Sorry to update such an old thread, however, here's an addon to update the amount of players, and the latest members name (displayed in the statistics center, and info center)

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Then just call those functions as soon as someone signs up;

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

:)

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

It's possible to do it like this aswell? or is that bad practice?

Link to comment
Share on other sites

well I believe (with out looking at the table structure) the they have an id in the forum table that is set to AI, so what you can do is use my code I posted above and import all users information over then the user id from the game and from the forum should match

  • Like 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...