Support Forums

user accounts and sub domains

This is a discussion on user accounts and sub domains within the Technical Support forums, part of the Technical Support Forums category; Hi all, Just wondering has anyone tried splitting the user accounts from the main database prefix Eg.. subdomain 1 = ...


Go Back   68 Classifieds Forums > Technical Support Forums > Technical Support

This topic is resolved.

If you have a similar issue that this thread does not address, open a new related support topic.

 
Thread Tools Display Modes
Old 05-03-2008, 09:13 AM   #1
Junior Member
 
 
Join Date: May 2008
Location: Wolverhampton, UK
Posts: 9
Rep Power: 0
ridcully is on a distinguished road
Question user accounts and sub domains

Hi all,

Just wondering has anyone tried splitting the user accounts from the main database prefix Eg..

subdomain 1 = sub1.mysite.com and this uses database called 'main' with a prefix 'root'.

subdomain 2 = sub2.mysite.com and this uses database called 'main' with a prefix 'sub2' but uses the user data from subdomain 1.

subdomain 3 = sub3.mysite.com and this uses database called 'main' with a prefix 'sub3' but uses the user data from subdomain 1.

Is this possible?
ridcully is offline  
Old 05-03-2008, 09:39 AM   #2
curmudgeon
 
Join Date: Mar 2006
Posts: 5,378
Rep Power: 135
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Im sure its possible. Right now database calls use a constant for the table prefix. This means that everywhere a call to the user table is made you would have to check the domain and alter the query accordingly.
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline  
Old 05-03-2008, 12:51 PM   #3
Junior Member
 
 
Join Date: May 2008
Location: Wolverhampton, UK
Posts: 9
Rep Power: 0
ridcully is on a distinguished road
Default

Thanks for the advice Lhotch

I've actually managed to do it
I have done it slightly different than what i have first thought. I am sharing everything from the main prefix apart from the listings and admin tables which are on there own prefix.

When your in any sub-domain's admin section if you alter anything common(Sections, billing packages etc)it alters every sub-domain. If you alter the settings in the 'main settings' (website address, email etc) it only alters for that sub-domain. Posting adverts on a sub-domain only posts the item on that sub-domain. The user can login using the same username on any sub-domain.

I do think it was too easy to do, so they are probably bugs that i haven't found yet. If it seams stable i shall post the solution to the mods forum.

Last edited by ridcully; 05-03-2008 at 12:53 PM. Reason: grammer.. lol
ridcully is offline  
Old 05-03-2008, 02:07 PM   #4
Junior Member
 
Join Date: Apr 2008
Posts: 15
Rep Power: 13
Kev is on a distinguished road
Default

So how did oyu manage to do this? Did you need a separate version of the script running in each folder? Then just editing the Main Settings? I would be very interested in trying it myself.
Kev is offline  
Old 05-03-2008, 02:40 PM   #5
Junior Member
 
 
Join Date: May 2008
Location: Wolverhampton, UK
Posts: 9
Rep Power: 0
ridcully is on a distinguished road
Default

Remember this has not been fully tested!!!

Well i created a sub-domain and did a normal install. Remember to use a different prefix when at the database setup
Deleted all the new database tables apart from 'admin' and any with the word 'listing' in the table name. (should leave you with 4 new tables)
copied the classifieds.php file from out of the root domain and replaced the one in the new sub-domain then added the following line..

Quote:
define("local_PREFIX","newprefix_"); //listings table prefix
In the Kernel folder...
in categories.php edit line 137.. replace PREFIX with local_PREFIX
in core.php edit line 27.. replace PREFIX with local_PREFIX
in listings.php do a search a replace of all 'PREFIX.'listings' with 'local_PREFIX.'listings'

In the admin folder...
in settingsmain.php edit line 21.. replace PREFIX with local_PREFIX

Job Done!!

Well i think thats all the changes i did.. remember this is not really tested and don't do it on a live site! ...testing wise all i have done is posted a few items.
ridcully is offline  
Old 05-03-2008, 05:34 PM   #6
Junior Member
 
Join Date: Apr 2008
Posts: 15
Rep Power: 13
Kev is on a distinguished road
Default

Very cool. Thanks for posting that.
Kev is offline  
Old 05-05-2008, 05:38 AM   #7
Junior Member
 
 
Join Date: May 2008
Location: Wolverhampton, UK
Posts: 9
Rep Power: 0
ridcully is on a distinguished road
Default

Quote:
Originally Posted by Kev
Very cool. Thanks for posting that.
No worries mate.
Please let me know how you get on with the tweek
__________________
Ridcully
www.job-hunt.co.uk - UK Job search site

v4.1.2 Developer
ridcully is offline  
Closed Thread

Thread Tools
Display Modes



All times are GMT -4. The time now is 05:23 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0