Coppermine and Apache virtual hosts Coppermine and Apache virtual hosts
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Coppermine and Apache virtual hosts

Started by dquelhas, August 15, 2006, 02:36:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dquelhas

Hello, i would like to know if there is a way to, through virtual hosts, to redirect the visitor to the set of categories belonging to a specific user.
The idea is to have a subdomain to each member of the family, and, for instance, if someone accesses the subdomain dinis.emviagem.com it is redirected to my part of the gallery, and if someone accesses my wife's subdomain, ana.emviagem.com, goes to her part of the gallery, and so on.
I am hosting the website at home, with apache2, php5 and mysql5, so any changes in the server are possible.
Thanks in advance for any help.

Dinis

Nibbler

You wouldn't need to use virtual hosts. You'd just need to add some code into init.inc.php to see what subdomain the request went to and set the album/category accordingly.

dquelhas

Hello Nibbler,

if you could be a bit more precise, it would be great. I'm new to this and i need some guidance.  ???
How to i see what subdomain the request went to?
How do i set the album/category accordingly?
What code should i add to init.inc.php?

Thanks,

Dinis

Nibbler

Maybe add something like this at the end of the file.


$parts = explode('.', $_SERVER['HTTP_HOST']);
$subdomain = $parts[0];

$categories = array(
'dinis' => 3,
'ana' => 5,
);

if (isset($categories[$subdomain])) $_GET['cat'] = $categories[$subdomain];


You'd need to set the correct category numbers in the code.

dquelhas

Thank you Nibbler, it seems to be a good direction pointing towards what i need.
One more question: In the solution you gave me, it only allows me to have one category per user.
Do you think it is possible to retrieve all the categories belonging to a specific user id?  :)

Thank you once again,

Dinis


Nibbler

Not without modifying core code. Perhaps you could place all such categories under a master category for each user.

dquelhas

Nibbler, you are the men. Thank you very much. After i wrote the last post, i saw how imbecile the question was.
Thank you for your patience.

Regards,

Dinis