PDA

View Full Version : Can I set it so that a member's gallery gets the url membername.websitedomain.com


greggh
April 6th, 2005, 01:28 PM
Is there a mod to do this already? Is it planned to have this feature included in a future version? I know I could manually go into webmin and manually give each member a subdomain and set it to redirect to the long php url that is generated. But I would like to have a way for a simple url membername.websitedomain.com to be automatically generated. Could something like this be done with mod-rewrite? Appreciate any info on this. Thanks.

Brian
April 6th, 2005, 01:30 PM
Currently there is not an option for this, or a hack that I am aware of.

Zachery
April 6th, 2005, 01:33 PM
You would need some incredible hacking and a grreat mod_rewrite...

greggh
April 6th, 2005, 01:36 PM
Currently there is not an option for this, or a hack that I am aware of.

Shucks. :( I know this isn't easy to do with php scripts but I hope a way can be found eventually. I really need this feature since I'm trying to do a site like fotolog.net and I know that those types of users would not tolerate having a very long cryptic php? domain as the url to their gallery homepage. Thanks for the info though.

Brainwrek
April 10th, 2005, 08:55 AM
I have been pulling my hair out looking for a portal that would do this as well. After searching for days, I still haven't figured out a solution. The link below looks like it could be promising though. Anyone know if it could be integrated with VBGallery?

http://www.photopostdev.com/showthread.php?t=630

Brainwrek
April 10th, 2005, 09:04 AM
OH...just thinking out loud... If it's too difficult to create a new subdomain for each member...is there any way to create a direct link to a user's gallery something like this:
http://www.domain.com/gallery/images/username

The current URL is like this:
http://www.domain.com/gallery/browseimages.php?c=46&userid=1

So with mod_rewrite it would be a snap to change 'browseimages.php' to simply 'images' ...but I don't know how to deal with the remaining variables...

greggh
April 10th, 2005, 11:57 AM
As Brainwreck posted, somebody posted a pretty short and simple bit of code that automically makes short easy www.membername.domain.com urls, it just needs dns wilcards enabled on the server. Couldn't code similar to this be used to do the same thing with vBadvanced Gallery...

//Normal (i.e. non-forwarding) URLs for your MAIN index page
$url="www.7thgencivic.com";
$redirecturls=array(1 => 'civicworld.com','7thgencivic.com','www.civicworld.com','civicnation.net','www.civicnation.net','civiczone.com','www.civiczone.com','2k1civic.com','www.2k1civic.com','2k2civic.com','www.2k2civic.com','www.8thgencivic.com','8thgencivic.com');
//Users URLs will end with... (remember the first dot!)
$usersurl=".7thgencivic.com";
$usergroup="8,6";

require_once("mainfile.php");
global $DB_site,$session;
$PHP_SELF = "modules.php";

//premium user redirect

///////Spot the users//////
$domain = $_SERVER['HTTP_HOST'];

foreach($redirecturls as $key => $value) {
//echo "Key: $key; Value: $value<br>\n<br>";
if ($domain==$value) {
header("Location: <a href="http://www.7thgencivic.com/" target="_blank">http://www.7thgencivic.com/</a>");
exit();
}
}

if ($domain!=$url) {
$who = substr($domain,0,strpos($domain,$usersurl));
$who = str_replace(".","",$who);
$doquery= $DB_site->query("SELECT userid FROM user WHERE ( username = '$who' AND ( usergroupid IN ( $usergroup ) OR premium = 1 ) AND photos = 1 );");
$result=$DB_site->fetch_array($doquery);

if ($result[userid]) {
header("Location: <a href="http://" target="_blank">http://</a>$url/memberrides/showgallery.php?stype=2&si=&cat=500&sort=1&ppuser=$result[userid]");
exit();
} else {
header("Location: <a href="http://www.7thgencivic.com/" target="_blank">http://www.7thgencivic.com/</a>");
exit();
}
}

//////////////////////////

//end premium user redirect

ASC
April 11th, 2005, 11:13 AM
Have you considered using your .htaccess file? Setup your member's gallery with a distinctive URL and then have it redirect to the actual location.

greggh
April 11th, 2005, 07:14 PM
Have you considered using your .htaccess file? Setup your member's gallery with a distinctive URL and then have it redirect to the actual location.

Yeah, but that mean setting each member's url manually.I'm trying to find an automated way to do this.

7thgencivic.com
July 15th, 2005, 10:11 PM
lol, just found this page from an MSN backlink.

anyway, it would be pretty easy to do with that code of mine that is posted above, just need to do some changes. I may do this when vb3.5 goes gold and I switch away from photopost to vBA Gallery. damn, I can't wait.

Brinnie
July 23rd, 2005, 12:34 AM
Yes, if this could be done, I'd be sold like... LAST WEEK!