PDA

View Full Version : Events with Prefix support


sebgoa
14.04.2004, 23:16
Hi everyone,
Is there a patch for the Events component to handle database prefix.
I installed two Mambo sites with two different prefix, but realized that Events did not support the #_ prefix !

Any hints ?

speedyG
15.04.2004, 11:56
Hi everyone,
Is there a patch for the Events component to handle database prefix.
I installed two Mambo sites with two different prefix, but realized that Events did not support the #_ prefix !

Any hints ?

To be honest I do not completely understand what you mean............I use Events as well and I have a beauty of a mos_event table in my DB.....Never ever heard about Events not supporting the _prefix............Must be a little mistake or misunderstanding here???

Now I have some questions to make things more clear about this problem:

1. Did you install mambo 2 x on a shared host using 1 data base?
2. How did you install the two sites.....Did you first installed the little hack as posted by Gayle which you can download here?
http://www.vd-tools.com/index.php?o...ownload&file=16
3. Did you read this discussion which you can find if you do a search on "table prefix" This discussion is very helpful
http://www.mambers.com/showthread.php?t=433&highlight=table+prefix
as well as
http://www.mambers.com/showthread.php?t=489&highlight=table+prefix

I hope this will help you

good luck

speedyG: :cool:

tonyskyday
15.04.2004, 16:15
the mos_ prefix is probably hardcoded into the componen, replace mos_ with #__ and it should accept your change prefix.

I'm assuming you are trying to have seperate installations, and not share any tables.

Does that help?

-Tony

speedyG
15.04.2004, 17:03
the mos_ prefix is probably hardcoded into the componen, replace mos_ with #__ and it should accept your change prefix.

I'm assuming you are trying to have seperate installations, and not share any tables.

Does that help?

-Tony

Hi Tony,

I first thought that my lack of coding knowledge would have been the reason for missing your obvious solution.............However the mos_ prefix is not hard-coded into the component as far as I can see. I did a search with Dreamweaver MX04 on each and every .php within events on mos_ and every search turned out negative. (in the front-end as well in admin)

so he is not able to change this.......

next once again I do have on my remote host this beautiful table mos_events......meaning upon installation this table was created.........
I therefore suspect as described that something went wrong in his installation that's why the questions....

regards

speedyG: :cool:

sebgoa
15.04.2004, 18:38
Hi guys, thanks for the replies.

Nothing went wrong in the install, I have two Mambo install sharing one database. Two differentiate content/components/modules on both sites I used the different prefix in the configuration.

TOnyskyday got what I meant, I was just wondering if there was a patch for it. I can easily modify the .xml install file, but there migth be several changes in the evetns.php file and so on.....


SpeedyG, the goal is to have : site1_mos_events table and site2_mos_events table

tonyskyday
15.04.2004, 19:34
I think the goal would be to end up with site1_events and site2_events.

For anyone reading this that doesn't understand: If you have two Mambo sites sharing one database, and you have the db prefix set in the Mambo config, then any components/modules that have a hardcoded mos_ prefix will break, but components that have the more-correct #__ prefix (we are talking about in the queries etcetera) will adobt the correct prefix for the site it is being installed on.

Anyway, looking at the files I have for EventsRC4, the only place that the mos_ prefix is hardcoded is the xml file. So, you are both right! :)

sebgoa
15.04.2004, 21:11
Hey..that was a quick one..just changed the xml file as follows:

<install>
<queries>
<query>DROP TABLE IF EXISTS `#__events`</query>
<query>CREATE TABLE `#__events` (
`id` int(12) NOT NULL auto_increment,
.....
</query>
</queries>
</install>
<uninstall>
<queries>
<query>DELETE FROM `#__events`</query>
<query>DROP TABLE `#__events`</query>
<query>DELETE FROM `#__categories` WHERE `section` LIKE '#__events'</query>
</queries>
</uninstall>

And it worked like a charm :)

thanks

speedyG
16.04.2004, 04:27
I think the goal would be to end up with site1_events and site2_events.

For anyone reading this that doesn't understand: If you have two Mambo sites sharing one database, and you have the db prefix set in the Mambo config, then any components/modules that have a hardcoded mos_ prefix will break, but components that have the more-correct #__ prefix (we are talking about in the queries etcetera) will adobt the correct prefix for the site it is being installed on.

Anyway, looking at the files I have for EventsRC4, the only place that the mos_ prefix is hardcoded is the xml file. So, you are both right! :)

LOL :: Did not look in the XML.............S*** only in the PHP's........1-0

accepted..... :O

speedy: :cool: