We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

multisite issue - how to know what site is access the module?

Development and Programming

RyanMills's avatar
RyanMills
63 posts
16 years ago
RyanMills's avatar RyanMills

I have a standard install with the multi-site addon and I have a module I wrote to deal with navigation. Works great but I dont know how to set a flag for what site its on so it accesses the right table. Basically is there a var that’s set I can access in my module so I know what site the user is administering. Same thing with the plug-in is there a way to tell what site is using the plugin?

       
Lisa Wess's avatar
Lisa Wess
20,502 posts
16 years ago
Lisa Wess's avatar Lisa Wess

You need to code your module to be Multiple Site Manager aware; otherwise it will be the same across sites. I’d recommend looking at the fresh variables module as a starting point as that is one particular module that is MSM aware.

Moved to Modules: Technical Assistance since this is a coding issue for a custom module.

       
RyanMills's avatar
RyanMills
63 posts
16 years ago
RyanMills's avatar RyanMills

well that’s kind of what i’m asking, is there something that gets passed that shows what site is accessing the module. reviewing another modules code to guess how it knows could take a while. I just need some sort of flag or var that says what site is accessing it.

       
RyanMills's avatar
RyanMills
63 posts
16 years ago
RyanMills's avatar RyanMills

i believe the safe way to set what site your module is editing is to check,

$PREFS->core_ini['site_short_name'];

Been nice to get that instead of wasting my time going line by line of that module before I finally just did a var dump and found something to use.

Anyone know if this is a bad idea or if there is a better way?

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.