Advertisement:

Author Topic: Sharing Databases  (Read 6147 times)

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,647
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Sharing Databases
« on: March 18, 2008, 10:06:04 PM »
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.

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: Sharing Databases
« Reply #1 on: March 18, 2008, 10:11:08 PM »
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

Quote
Microsoft 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
     

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,647
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: Sharing Databases
« Reply #2 on: March 18, 2008, 10:14:41 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.

Offline SleePy

  • Site Team Lead
  • SMF Master
  • *
  • Posts: 30,321
  • Gender: Male
  • Thats his happy face.
    • jdarwood007 on GitHub
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: Sharing Databases
« Reply #3 on: March 18, 2008, 11:40:10 PM »
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
Code: [Select]
    $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
Support the SMF Support team!
Profiles:
GitHub

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: Sharing Databases
« Reply #4 on: March 19, 2008, 02:10:56 AM »
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

Quote
Microsoft 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
     

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,647
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: Sharing Databases
« Reply #5 on: March 19, 2008, 08:23:48 AM »
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.

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,647
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: Sharing Databases
« Reply #6 on: March 23, 2008, 10:11:29 PM »
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.