Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forumlar / Cotonti / General / Trouble with using same user table on two sites

using two or more domains to show unique content

singh336
#1 2009-05-05 16:39

Hey guys,

First I want to introduce my self here on the cotonti forums. I'm singh, I run the GOM-Team.com site which is powered by LDU 802 (lol) So you know why I'm here already.

I will be upgrading to sedito and then to cotonti (what a headache I can imagine!)

I have some questions first...

The biggest one is this..


Multiple domain names. can anyone suggest to me the best way to handle this...


The problem:

I want to have different domains , show different content when coming to the site. For example, typing in the main domain would show ALL the news posts.. but typing in another domain would show only news post from a certain category. This is what I need to do because we are expanding into other areas (other games to mod) and we want to make sure users dont get flooded with content they dont want to see, on the home page especially.

So does cotonti support this, if not, how can I figure this out ?

And if cotonti does support this great idea, then how deep does it go ? What are all the features with it ?


Thanks guys ! BTW this text editor is BADASS! really looking forward to having it on my site !




And link to my site http://street-legal-mods.com/

A quick question about upgrading also. When upgrading to sedito, how strict is the process ? Do i have to go and manually change each thing it says in the documentation on neocrome to do so? Or can I skip some steps here and there because I wont be staying with that version, I'll be going to cotonti before releasing it public ? Thanks !

EDIT: err lol my location says india, that is true, but im only here on vacation to visit some family , i actually live in NY , i am here for 6 months however :) but thats really cool that the location was auto detected and filled out, I hate when thousands of my members have no location specified in their profile.

<a href="http://www.streetlegalmods.com/">http://www.streetlegalmods.com/</a>

Bu konu singh336 tarafından düzenlendi(2014-12-10 21:41, 4 yıllar önce)
Lombi
#2 2009-05-05 16:54
Well what you could dois really simple. You stick all your sites into one database, effectively giving each one their own prefix (instead of ldu_ you do site1_ or something in this matter)

So then you share auth, users, pages, forum_topics, forum_sections, forum_posts which will make all the sites use them (same users across all sites, same pages and forums)

After that you just set each news setting as you want it and you're done.

I'm doing something similar myself (sets of three domains sharing the same pages, with different designs) so I can confirm this is fully working.

# singh336 : A quick question about upgrading also. When upgrading to sedito, how strict is the process ? Do i have to go and manually change each thing it says in the documentation on neocrome to do so? Or can I skip some steps here and there because I wont be staying with that version, I'll be going to cotonti before releasing it public ? Thanks !

First of all you run the ldu8xx to seditio 100 upgrade script. Then you run all upgrade scripts you can find that go to 12x. After you do that, you follow my video tutorials and you should be fine :)

What you will need to do however is apply the skin changes that were made from ldu to seditio. There's not many but you'll need to do them.
<a href="http://www.domenlo.com">Surreal Art</a>

Bu konu Lombi tarafından düzenlendi(2009-05-05 17:00, 9 yıllar önce)
singh336
#3 2009-05-05 17:02
Ok so it will involve doing something like that, is it best for me to upgrade to cotonti first and get everything working before trying to do this ? I mean it seems like I can do that at anytime ... just double checking.


And yea for upgrading, is there any steps I can skip or should I just do everything step by step

# Lombi :


First of all you run the ldu8xx to seditio 100 upgrade script. Then you run all upgrade scripts you can find that go to 12x. After you do that, you follow my video tutorials and you should be fine :)

What you will need to do however is apply the skin changes that were made from ldu to seditio. There's not many but you'll need to do them.


Ah ! ok sorry for asking the question twice lol I didnt see you edited your post, or maybe i asked before u edited i dont know, but thanks !
<a href="http://www.streetlegalmods.com/">http://www.streetlegalmods.com/</a>

Bu konu singh336 tarafından düzenlendi(2009-05-05 17:03, 9 yıllar önce)
Lombi
#4 2009-05-05 17:08
You should do everything step-by-step :)
<a href="http://www.domenlo.com">Surreal Art</a>
singh336
#5 2009-05-05 17:08
# Lombi : Well what you could dois really simple. You stick all your sites into one database, effectively giving each one their own prefix (instead of ldu_ you do site1_ or something in this matter)

So then you share auth, users, pages, forum_topics, forum_sections, forum_posts which will make all the sites use them (same users across all sites, same pages and forums)



I'll ask more about this later, I know the CMS will be able to red tables with th prefix u tell it to, but dont all the tables have to have the "same prefix"

for example if your telling the site to read the DB with a prefix of site1_ and some tables like the users and stuff dont have a prefix, will the site automatically see those and read them anywyas ?if so then it makes perfect sense how they can share the tables across sites, but otherwise not really sure..

Anyhow thats all I need to know for now, the rest i can figure out as I get there.. Thanks for the tips and I will be back shortly after i begin the upgrade process, I just pray to god I dont kill my DB i cant afford to loose that
<a href="http://www.streetlegalmods.com/">http://www.streetlegalmods.com/</a>

Bu konu singh336 tarafından düzenlendi(2009-05-05 17:12, 9 yıllar önce)
Lombi
#6 2009-05-05 17:16
It reads what you tell it to read :)

In your config file you can set the tables to be named anything. The first table could be xxx_auth and the second could be modz_bbcode. Doesnt really matter, as long as they exist.

What you're missing here is that this is not a db-wise prefix, it's on a table-basis. And the prefix is nothing more than a unique-fier.

Tip: to not lose your db make sure you back it up first and on every step.

<a href="http://www.domenlo.com">Surreal Art</a>

Bu konu Lombi tarafından düzenlendi(2009-05-05 17:17, 9 yıllar önce)
singh336
#7 2009-05-05 17:20
Yea backing up is the key, I guess I will shut my site down in maintaince mode, or copy the site and DB and upgrade that fully, when its ready transfer it over, but the DB may be out of date, so perhaps I should convert the DB again one last time before transfer ? I dont know I'll figure out what is easier for me


Now i understand, i'm sorry haha i didnt realize the tables in the config where listed like that, thats REALLY good... in that case I have no issues now to get this multi domain thing going !


Thanks for your help and most of all quick responses , love that !


My typing is screwed, but this laptop keyboard is not helping me lol u have to SLAM the keys to get them to register
<a href="http://www.streetlegalmods.com/">http://www.streetlegalmods.com/</a>
Dave
#8 2009-05-15 14:12
yo Singh :) sory for bumping this topic, but i know this kid for some time now :)]

once i was part of GOM-Team, and im still moderating it (sometimes)
Your advertisement here :-)

Cotonti Genoa based site: forgotten-garage.pl
singh336
#9 2011-05-17 03:39

Bumping (sorry its old)

 

Hey Dave, (dave_69) right? Good to see you here, I've spoken to you since tho.

 

Anyways I want to update this topic because I found it through some searches and realized it was left open without any solution.

 

 

 

I've upgraded (with some help of my admins) the site finall to contonti and wanted to say its a great system ! We are very happy with it !

 

 

http://www.streetlegalmods.com/

 

you can find it there.

 

I'm having an issue when accessing the domain from street-legal-mods.com and streetlegalmods.com and other domains... only the domain i wrote in the config.php will work correctly with the styling on the home page.

 

Any ideas how this can be fixed? is there a multi domain plugin ?

<a href="http://www.streetlegalmods.com/">http://www.streetlegalmods.com/</a>
Kort
#10 2011-05-17 05:50

Why not using domain redirects or modrewrite?

Seditio.by - создание сайтов, разработка плагинов и тем для Котонти
GHengeveld
#11 2011-05-17 14:03

Lombi's solution will work but sounds overkill to me because you're building separate sites with just some shared tables. I'd make all domains point to the same place (the main domain) and then use $_SERVER['HTTP_HOST'] in a plugin to determine which site was accessed and show your information based on that. This also allows for combined results (such as shared news categories that show on multiple sites). Lombi's solution can't do that (you'd have to publish the same article on every site).

singh336
#12 2011-05-18 02:30

Yeah, I'm not worried too much about it so much where its necessary to do what I said a few years ago. The idea is cool and  what you've explained should work great.

 

 

What I'm having trouble with now is this:

 

http://streetlegalmods.com/

 

now look at http://www.streetlegalmods.com/

and http://street-legal-mods.com/

 

only the http://www.streetlegalmods.com/ domain is working properly because of whats written in the config.php

Added 4 years later:

To avoid opening another topic, i'll post in this one again.

 

 

So I'm opening a second website along side streetlegalmods.com

 

the new website here streettuningevolutionmods.com

 

I want the two sites to share the users table, groups / ranks etc of course too.

 

What I did was define the prefix's in config.php and the two sites were using the same user table with correct ranks etc everything was fine.

However on the current running public site, something weird was happening.. when I was logged out I noticed that the recent items for example did not update.. it always said for example latest post "58 seconds ago" even if I reloaded the page again 5 minutes later.

 

Further if I logged in, and posted in minichat or forums topic with something, it would show.. but logged back out.. not changes seena nd my posts are not there.. and still it would say last post 58 seconds ago.

 

So what I did was clear disk and internal cache in admin panel of the main site, the two sites dont share same cache dbs, only the user and group related tabes.

 

Clearing the cache worked but it would happen again, only after i switched the DB tables of the second site back to cot_ prefix for example (current site is sed_) then it would work as usual and always update and not get "stuck"

 

why is it doing that ? should I share other tables too like the cache ?

 

I tried with and without auth table shared and i dont think it makes a difference.

 

On top of that I realized with the new site, I can't get forums to show up or page structure.. news works but not forums.

 

Any idea of how to do this the right way ?

Added 34 minutes later:

So what I have realized now with some testing is that

 

The two sites can use the same tables as long as both sites have CACHE set to FALSE in the config php, which really sucks, because I'de like to leave it on, but I do use cloudflare (currently paused until I finish the changes) so maybe it doesn't matter much ?

 

Now the only issue im having is being logged out from one site everytime I'm logged in the other...

I tried sharing the auth table and not sharing it with the two sites, not sure if that even makes a difference..

 

 

Added 1 days later:

okay well turns out I fixed a lot of things by testing.

 

 

I realized that the site id and the key DO have to be the same between both sites

 

i made my cookie domain on both sites to "streetlegalmods.com"

and it was working awesome, both sites can be logged on at once, or just on one site at a time, and they would not affect the other site.

 

 

NOW the big problem, logging on just does NOT work on the new site WHEN "remember me" is selected.. so im thinking something about cookie domain or path is wrong.

 

I have no idea what the cookie path should be set to, does that have anything to do with it possibly? and any ideas what it should be set as for example ?

Added 53 minutes later:

http://www.cotonti.com/forums?m=posts&q=2205

 

found this regarding my issue of not being able to login with remember me checked (not being able to set cookies)

 

deleted the "domain" from the new site in the administration panel and now it works.. just fine too.

 

 

so now some new problems, probably biggest issue right now is why I can't access the "rights" page on a forum for example general discussion:

 

when I click rights in admin panel for this section it tells me this..

 

and now when I try again it works, it was something like bad request parameters :S

 

 

I can't see the forums that I can see when logged into other accounts on the new site, weird. rights look correct too.

Added 4 minutes later:

fixed it by checking the "I" box for the rights under the users rank for that forum section.

 

 

strange... I don't even know what that colum stands for? lol

 

alright, keep pushing now.. can't create a new forum topic because the newspost.tpl is just messed up, maybe something changed i the update and using my old tpl is messing it up. text area is not parsing.

 

just shows "input_textarea_"

Added 58 minutes later:

Okay now my biggest problem, which seems to by my only major issue

 

[img]http://upload.streetlegalmods.com/images/2014/12/12/newtopic.png[/img]

 

 

the newtopic.tpl looks fine but i've replaced it with the default anyways...

 

in dreamweaver it tells me the javascript is wrong or something for the polls but not worried about that right now, even default tpl shows same error.

 

I recently updated to 9.17, maybe thats a reason ? but i've replaced all the system files again, extrafeilds / resources / forms etc

 

something must be wrong internally ? because input_textarea is nothing in the tpl, it is in the system files.. so why does it get stuck there ?

Added 32 seconds later:

http://upload.streetlegalmods.com/images/2014/12/12/newtopic.png

 

apparently html AND bbcodes aren't parasing here :S

Added 1 hours later:

I just want to say the problem seems to be with

 

 

forums.newtopic.php in the modules/forums/inc/ folder

 

the 9.17 version (6.8kb) is just not working for me, 

 

but in 9.15 or 9.16 version, its working fine...

Added 2 days later:

I finally got it working for the most part

 

 

for a person who isn't skilled in php / sql etc i have to say it was very difficult, but i did it. it was one problem after another though, one thing fix would create a bug somewhere else and so on and so on. I can't believe i overcame everything so far and have a working result. its amazing.

 

its too much to explain but if someone is doing the same they can feel free to contact me via the website streetlegalmods.com etc and I can help because lord knows these forums are dead. It's a shame too, brilliant CMF.

<a href="http://www.streetlegalmods.com/">http://www.streetlegalmods.com/</a>

Bu konu singh336 tarafından düzenlendi(2014-12-14 00:55, 3 yıllar önce)