News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Sharing Databases

Started by Jade Elizabeth, March 18, 2008, 10:06:04 PM

Previous topic - Next topic

Jade Elizabeth

http://www.simplemachines.org/community/index.php?topic=16190.0 <that doesn't work anymore (for 2.0)...I need to share the members and membergroup tables for my forum. Both forums are in the database, with prefixes boo_ and smf_. I want those two smf_ tables to be used by the forum that uses boo_.

Can anyone help me?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

metallica48423

It is (or was) exactly the same, last I knew, since its generically changing part of the  .  I do this between the "blogs" board on my site and the main community.

The difference is you'd be looking for {db_prefix} (a constant rather than a variable)
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Jade Elizabeth

Quote from: metallica48423 on March 18, 2008, 10:11:08 PM
The difference is you'd be looking for {db_prefix} (a constant rather than a variable)

Grrr! Sleepy told me it was the same!
Thanks :D
* Alundra kisses Metallica's cheek in thanks :P
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

SleePy

Actually Metallica,

With 2.0 I think we can take a new route.

If this is done in the Subs-DbXXX.php files then a strtr replacement before the callback performs the {db_prefix} is done. Then we could simply search and replace quickly.

Something like this popped into my mine
    $database_prefix_replacements = array(
        '{db_prefix}members' => '~other_database~.smf_members',
    );
   
    $db_string = strtr($db_string, $database_prefix_replacements);


I will need time to test this out, but this could more easily be done than it could of in 1.1..
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

metallica48423

i had actually thought of something similar... i have never used the strtr function though so i was sort of at odds with figuring it out :P

Im all ears on this one especially if it makes it easier to integrate.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Jade Elizabeth

Did you still want the list of DB tables I wanted to share Sleepy?
How about the sources/theme folders, can I make them share those?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Jade Elizabeth

It works but as with before, on 1.1.4 the unread posts may not work right...I dunno why. Sometimes it does (Even with show all) sometimes it doesnt, according to my members complaints...

So I told em that since it's a smaller forum they shouldnt mind clicking the boards ;).

Oh wait, the ssi is broken again. I'm seriously thinking it's being broken my that tutorial...Because I checked it BEFORE doing anything, and it was fine :(
http://www.jades-world.com/boo/ssi_examples.shtml
http://www.jades-world.com/boo/ssi_examples.php
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Advertisement: