English (United Kingdom)
Jms Multi Site, formerly joomla multisite.
Create, share multiple joomla sites in few clicks !
Message
  • EU e-Privacy Directive

    This website uses cookies to manage authentication, navigation, and other functions. By using our website, you agree that we can place these types of cookies on your device.

    View e-Privacy Directive Documents

Welcome, Guest
Please Login or Register.    Lost Password?
Go to bottomPage: 12
TOPIC: Adding site_id to component
#6578
Adding site_id to component 13 Years, 2 Months ago Karma: 0
Hello,

Is the site_id a global information which i can add to any component to specify a path

eg. /users/site_id/.... ?

thanks,
Marcel
rotwildmarcy
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#6579
Re: Adding site_id to component 13 Years, 2 Months ago Karma: 54
If don't really understand the question and the relationship with a component.

If your question is relative to the setup of a slave site in "manage site" menu then you can use the keyword {site_id}.
If your question is relative to know how to get the site ID in a PHP code then you can use the "MULTISITES_ID" define variable. It is only filled for a slave site or does not exists when this is the master.
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#6583
Re: Adding site_id to component 13 Years, 2 Months ago Karma: 0
Hello,

thanks for your reply.

Let me explain what i want to do:

All my slave sites are using the same Master DB.

As i need to display different contact information for each site my plan was to modify the standard contact page file that it shows an individual php file which is saved in each slave directory. To specify the path i need the multisites_id.

Can this be done using the multisites_id plugin?

And is the multisites_id variable handled like normal variables?
(for example will echo $multisites_id work ?)

This might not be a big deal but for someone likne me (with more or less no php knowledge it's not so easy)

thanks !

Marcel
rotwildmarcy
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#6609
Re: Adding site_id to component 13 Years, 2 Months ago Karma: 54
When you are runing as a slave site you have the define value "MULTISITES_ID" that is setup with the Site ID.
When the define does not exists, this mean that you are on the master.
So you can echo the Site ID.

The plugin is used to perform a "Search / Replace" of a tag with the Site ID.
For example, you can use it to set the value of a "hidden" field with the "Site ID".
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#8318
Re: Adding site_id to component 12 Years, 6 Months ago Karma: 0
Hi there,

In several places I've tried to return $MULTISITES_ID (and variants like $multisites_id), and I can't seem to get it.

I'm looking to edit a plugin (Kunena discuss) to include the Site ID in its table to identify the origin of the content. How do I reference the appropriate variable in a plugin? Can you give a sample of the syntax?

Thanks!
phleum
Fresh Boarder
Posts: 13
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#8324
Re: Adding site_id to component 12 Years, 6 Months ago Karma: 54
This is NOT $MULTISITES_ID but MULTISITES_ID without the Dollar ($) sign.
This is not a variable but a define that is available everywhere when you are runing a slave site.

$site_id = defined( 'MULTISITES_ID') ? MULTISITES_ID : ':master_db:';
edwin2win
Moderator
Posts: 5370
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 12
get the latest posts directly to your desktop
2Win, Multisite(s) are trademarks of Edwin2Win.
Joomla