Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
ghostgeek
Regular
Regular


Joined: Jan 14, 2005
Posts: 93

PostPosted: Sun Jan 30, 2005 1:23 pm Reply with quote

Hello,

Here is what I’m trying to accomplish… my site has a main Only registered users can see links on this board! Get registered or login! website. I’m wanting to set up several “sub domains” for different states – ca.domain.com, ny.domain.com etc etc…

What I’d like is for these “different” sites to all share the same database and files; user list, image folders, blocks, modules and so forth, but each sub domain has a screen layout of blocks that is unique to it. So each sub domain will share common data and files, but has its own admin panel.

I’ve read this guide on creating different PHP-Nuke sites with the same user base…
Only registered users can see links on this board! Get registered or login!

… which I think is close to what I’m looking for, but I don’t think its quite.

Is what I’m trying to do possible with PHPnuke?
 
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce


Joined:
Posts: 5661

PostPosted: Sun Jan 30, 2005 9:24 pm Reply with quote

no....karak sample is just for those that have just 1 database.
and what you are trying is to run several sites on one config file...
thats how it sounds anyway...

but why this...?...you like it the hardway?
just create 3 subdomains with 3 databases..
And use same logins for admins and database...
make them identical to design and make changes after that...
 
View user's profile Send private message
ghostgeek
PostPosted: Mon Jan 31, 2005 7:31 am Reply with quote

hitwalker wrote:
no....karak sample is just for those that have just 1 database.
and what you are trying is to run several sites on one config file...
thats how it sounds anyway...

but why this...?...you like it the hardway?
just create 3 subdomains with 3 databases..
And use same logins for admins and database...
make them identical to design and make changes after that...


I listed just three subdomains as an example. This will potentially grow to a different subdomain for each US state or MORE - thats at least FIFTY subdomains with FIFTY databases. Bang Head Hopefully you can now appreciate why I want to do this the "hard" way! Wink

Again, these subdomains will all be inner related; sharing common data, but I want each to have a unique appearance. Thanks! Smile
 
hitwalker
PostPosted: Mon Jan 31, 2005 7:49 am Reply with quote

well i dont think thats possible....not in a million years... Sad
 
sixonetonoffun
Spouse Contemplates Divorce


Joined: Jan 02, 2003
Posts: 2496

PostPosted: Mon Jan 31, 2005 9:36 am Reply with quote

It will take some work. But I think it can be done. The issues I see aren't really too bad.
The theme switching will probably have to be hard coded. Which would mean changing the function get_theme(); to select based on domain name and ignore default preferences.

You'll have to redirect all the subdomains to the domains directory "Park em there".
Code:


function get_theme() {
    global $Default_Theme;
if($_SERVER['REQUEST_URI'] == 'ca.domain.com') {
$ThemeSel = 'ca_theme_name';
elseif($_SERVER['REQUEST_URI'] == 'ny.domain.com') {
$ThemeSel = 'ny_theme_name';
else{
$ThemeSel = '$Default_Theme';
}
return($ThemeSel);
}

Now this is not going to be blazing fast with 50 options but I don't see how to speed the process up a whole lot.

There are likely to be other issues but thats a start to this one.

_________________
[b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 
View user's profile Send private message
djmaze
Subject Matter Expert


Joined: May 15, 2004
Posts: 719
Location: http://tinyurl.com/5z8dmv

PostPosted: Mon Jan 31, 2005 9:40 am Reply with quote

It's possible with CPG Dragonfly which is almost at the first final.
We've made a list of issues involved with the setup that you want, and we already know how important they are Wink

For example create a account at Only registered users can see links on this board! Get registered or login! from there you can also login on the following websites:

- Only registered users can see links on this board! Get registered or login!
- Only registered users can see links on this board! Get registered or login!
- Only registered users can see links on this board! Get registered or login! & Only registered users can see links on this board! Get registered or login! (combined login, you login on sub-domain or main and are logged in on all at the same time)

issues:
- make your avatars (+ upload dir) shared
- PM's say you have a new message but actualy the new message is on a different sub-domain for example. (just turn it off and only allow on main site or something)

Also possible:
- use all core files from 1 directory by using the "BASEDIR" define to reduce the files that you have to maintain.

I think it's also possible with PHP-Nuke but will take some time and work
 
View user's profile Send private message Visit poster's website
sixonetonoffun
PostPosted: Mon Jan 31, 2005 9:47 am Reply with quote

Thats a great void to fill DJMaze I can see the obvious need for this especially with geographical based options like ghostgeek wishes to use. Fantastic to know someone is working towards resolving this long standing issue.
 
hitwalker
PostPosted: Mon Jan 31, 2005 10:38 am Reply with quote

thats the fun of replying ......lol
whenever I say it cant be done everybody starts to say it can be done...
then you might as well look into the future and the problems you can run into with upgrades...

so who's gonna write it for free ?
You DJmaze ?
and ehhh..."long standing issue"..?
That cant be right.....
How many people are realy looking for this?
But it can be funny.....you attack site A and automatically crash B and C ....
 
sixonetonoffun
PostPosted: Mon Jan 31, 2005 11:00 am Reply with quote

No one said it would be easy but it does sound like a fun project.

As for who is looking for it ? No clue but I do know there are many uses for such a feature or deviations of it.
Example of one deviation is postnuke.com Only registered users can see links on this board! Get registered or login! Only registered users can see links on this board! Get registered or login! Only registered users can see links on this board! Get registered or login! Only registered users can see links on this board! Get registered or login! Only registered users can see links on this board! Get registered or login! Only registered users can see links on this board! Get registered or login!

The potential is there to give unique info to users based on the url they are directed. Now just changing themes isn't a real accomplishment but it allows you to present things in a unique way. Now say you did it with your sites languages too this would allow for site graphics to be displayed in the users native language as well. I'm not saying this is the to die for feature at all but there is a niche there without a doubt.
en.example.com
es.example.com
or maybe something like
love.example.com
friendship.example.com
sex.example.com
religion.example.com
So on and so on. Now of course there are other ways to do this but people do like to use subdomains in this fashion I see it real often.

And I agree that for smaller examples it would be easy enough to only share users. But for a really large site there is really no point in duplicating the core files over and over again its a classic colosal waste of space.
 
hitwalker
PostPosted: Mon Jan 31, 2005 12:11 pm Reply with quote

well im just happy with a safe site .... Very Happy
 
djmaze
PostPosted: Mon Jan 31, 2005 1:23 pm Reply with quote

If you have 20 php-nuke's on 1 domain, how much of such users use different passwords for each database and admin.php ?

So if 1 site gets hacked, no doubt the other 19 will follow Very Happy

By using 1 core and 1 users database you reduce your fixing time drasticaly if you ever get hacked.
Also updating 1 core is faster then uploading 20.
I'm still struggling with the PM issues and a few others, but database sharing is easy so it definatly be there fully working soon.
I do Dragonfly, but whoever that wants to start it for php-nuke can nock on my door for help and support.

There's no way i gonna do it as i decided last year, but it never hurts to help Wink
 
hitwalker
PostPosted: Mon Jan 31, 2005 1:47 pm Reply with quote

well applause for you djmaze...
the fact that you are working on this ...does that mean nuke is finished and theres nothing to be improved?
Who benefits from this....?
 
djmaze
PostPosted: Mon Jan 31, 2005 2:19 pm Reply with quote

"IF" someone wants to built it for php-nuke then the php-nuke community has benefit from this.
For now, only the Dragonfly community has benefit of it when finnished (cos it isn't ready)

Hereby i offered my help to guide and support people who want to modify php-nuke and release for free.
 
hitwalker
PostPosted: Mon Jan 31, 2005 3:24 pm Reply with quote

yeah i know im just teasing a little bit...
but its just my opinion...personally i fail to see the use of it.
i do a lot of reading on forums and see a lot of requests by members here and there that arent answered.....and sometimes with great ideas....
so maybe its so that we pick an idea that we like to develop...and if not....we hope the topic dies slowly....
but like i said...its my opinion but you get shot for that these days... Twisted Evil
 
ghostgeek
PostPosted: Mon Jan 31, 2005 4:04 pm Reply with quote

hitwalker wrote:
yeah i know im just teasing a little bit...
but its just my opinion...personally i fail to see the use of it.
i do a lot of reading on forums and see a lot of requests by members here and there that arent answered.....and sometimes with great ideas....
so maybe its so that we pick an idea that we like to develop...and if not....we hope the topic dies slowly....
but like i said...its my opinion but you get shot for that these days... Twisted Evil


To each their own. I've tried to explain why I would benefit from a setup like this. Looks like some others see a benefit too. Your approach - seperate install for 50 sites... it also means disk space for 50 sites (which as I've explained is largely redundant data), upgrades and modifications for 50 sites etc etc... I don't know about you, but I personally don't have the time or resources for all that.

Quote:
...does that mean nuke is finished and theres nothing to be improved?


Show me ANY software product that is "finished" with nothing to improve. New features like this ARE "improvements" AFAIC.

But again, to each their own.

Thanks for the tips guys... I'll be giving these a try and report back. Smile
 
djmaze
PostPosted: Mon Jan 31, 2005 5:55 pm Reply with quote

If someone has a good idea which no-one wants to built he can offer money in return.
Then ofcourse he can do anything with it depending on the agreement with the developer.

It's all self explainatorial, if someone doesn't want to do it your screwed Laughing
 
ghostgeek
PostPosted: Tue Feb 01, 2005 5:05 pm Reply with quote

Quote:
You'll have to redirect all the subdomains to the domains directory "Park em there".


Not sure I follow you... are you saying I should create a sub directory off of my domains root called "domains" and have DNS point all the subdomains to "domain.com/domains" ? And I assume the below code goes in there, but what to call this file?


Quote:

Code:


function get_theme() {
    global $Default_Theme;
if($_SERVER['REQUEST_URI'] == 'ca.domain.com') {
$ThemeSel = 'ca_theme_name';
elseif($_SERVER['REQUEST_URI'] == 'ny.domain.com') {
$ThemeSel = 'ny_theme_name';
else{
$ThemeSel = '$Default_Theme';
}
return($ThemeSel);
}



Forgive my newbie-ness to this - I'm still learning! Smile

Now once I've done this, each subdomain will have its own theme, but be sharing common data. Thats getting there!

Now how might I create a custom home page with a different block layout for each?

Thanks again! Smile
 
sixonetonoffun
PostPosted: Thu Feb 03, 2005 7:03 am Reply with quote

Sorry the function is in mainfile.php
 
ghostgeek
PostPosted: Mon Feb 07, 2005 7:11 pm Reply with quote

OK this isn't working quite right. Here is the code for the get_theme fuction you provided...

Code:


function get_theme() {
    global $Default_Theme;
if($_SERVER['REQUEST_URI'] == 'ca.domain.com') {
$ThemeSel = 'ca_theme_name';
elseif($_SERVER['REQUEST_URI'] == 'ny.domain.com') {
$ThemeSel = 'ny_theme_name';
else{
$ThemeSel = '$Default_Theme';
}
return($ThemeSel);
}



Here is the code for the get_theme function from my sites mainfile.php...

Code:


function get_theme() {
    global $user, $cookie, $Default_Theme;
    if(is_user($user)) {
   $user = addslashes($user);
   $user2 = base64_decode($user);
   $t_cookie = explode(":", $user2);
   if($t_cookie[9]=="") $t_cookie[9]=$Default_Theme;
   if(isset($theme)) $t_cookie[9]=$theme;
   if(!$tfile=@opendir("themes/$t_cookie[9]")) {
       $ThemeSel = $Default_Theme;
   } else {
       $ThemeSel = $t_cookie[9];
   }
    } else {
   $ThemeSel = $Default_Theme;
    }
    return($ThemeSel);
}


I tried simply replacing it and it returned a blank white screen.

any idea what I should be replacing based on the above? YES - I have renamed the domain name correctly and the correct theme name in my actual mainfile.php

Thanks again! Smile
 
sixonetonoffun
PostPosted: Mon Feb 07, 2005 7:50 pm Reply with quote

Sorry missed a couple of things there it happens.

Try this once:
Code:


function get_theme() {
    global $Default_Theme;
if($_SERVER['SERVER_NAME'] == 'ca.domain.com') {
$ThemeSel = 'ca_theme_name';}
elseif($_SERVER['SERVER_NAME'] == 'ny.domain.com') {
$ThemeSel = 'ny_theme_name';}
else{
$ThemeSel = $Default_Theme;
}
return($ThemeSel);
}


Should at least not return a white page Razz
 
ghostgeek
PostPosted: Mon Feb 07, 2005 11:55 pm Reply with quote

Right you are - no blank page! Groovy

But no theme swap either... Bang Head

I've tried a couple of different themes for say tx.domain.com, but it keeps returning the default theme.

Even thought it might be a caching problem... so dumped the cache, closed out IE and restarted. No dice.

Hmmm... any other ideas?
 
sixonetonoffun
PostPosted: Tue Feb 08, 2005 7:16 am Reply with quote

Must be almost there lol.
Code:


function get_theme() {
    global $Default_Theme;
if(stristr($_SERVER['SERVER_NAME'], 'ca.domain.com')) {
$ThemeSel = 'ca_theme_name';}
elseif(stristr($_SERVER['SERVER_NAME'], 'ny.domain.com')) {
$ThemeSel = 'ny_theme_name';}
else{
$ThemeSel = $Default_Theme;
}
return($ThemeSel);
}


If that doesn't work try changing SERVER_NAME to REQUEST_URI.
 
djmaze
PostPosted: Tue Feb 08, 2005 10:55 am Reply with quote

six you probably ment HTTP_HOST

REQUEST_URI is only the index.php?* part
 
sixonetonoffun
PostPosted: Tue Feb 08, 2005 11:12 am Reply with quote

Uhg! Why did I ever give up drinking and broads. Weren't the cleanest hobbies but got me into less trouble.
 
ghostgeek
PostPosted: Tue Feb 08, 2005 10:38 pm Reply with quote

DING DING DING! We have a winner!!

Code:
function get_theme() { 

    global $Default_Theme;
if(stristr($_SERVER['HTTP_HOST'], 'ca.domain.com')) {
$ThemeSel = 'ca_theme_name';}
elseif(stristr($_SERVER['HTTP_HOST'], 'ny.domain.com')) {
$ThemeSel = 'ny_theme_name';}
else{
$ThemeSel = $Default_Theme;
}
return($ThemeSel);
}


Did the trick, yes indeedy! Thanks guys!!!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©