RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > Third Party Contributions > Plug-Ins

For more information about the ads and why they're here, please see the FAQ
Reply
  #1  
Old 08-08-2007, 04:24 PM
Gus Gus is offline
Registered User
 
Join Date: Aug 2007
Posts: 9
Downloads: 0
Uploads: 0
Default Custom Logos and Welcome Text based on domain name.

Folks,

i've customised a few of the pages to allow me to display different welcome text and logos depending on which domain is being used in the URL; i have several domains running from a single roundcube instance and my customers now get their own custom logos when they login

If anyone is interested, i'll post the code changes.

Cheers

Gus
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 08-08-2007, 09:11 PM
Registered User
 
Join Date: Jul 2007
Posts: 38
Downloads: 1
Uploads: 0
Default Re: Custom Logos and Welcome Text based on domain name.

Yes, i am very interested.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 08-09-2007, 03:27 AM
Super Moderator
 
Join Date: Jun 2006
Posts: 431
Downloads: 0
Uploads: 0
Send a message via ICQ to skaero Send a message via AIM to skaero Send a message via MSN to skaero Send a message via Yahoo to skaero
Default Re: Custom Logos and Welcome Text based on domain name.

Yes this sounds great!
__________________
[size=8pt]SKaero.com <br />&nbsp; [/size]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 08-09-2007, 12:23 PM
Gus Gus is offline
Registered User
 
Join Date: Aug 2007
Posts: 9
Downloads: 0
Uploads: 0
Default Re: Custom Logos and Welcome Text based on domain name.

OK, there are 2 ways to do this.

The first way is to edit each of the files which contain the branding logos/text, these are:

main.inc.php - the welcome text and window titles.
login.html - the login logo
header.html - the logo in the top left of all screens after login.

Each file is edited to first check the domain via javascript, then pick an IMG or text to show based on the result.... but i've realised a far far better way.

Just do this.
(i have several domains named, webmail.domain1.com, webmail.domain2.com etc. All pointing to the the same virtual area on my hosting account, an all reference a single instance of roundcube, single mysql etc.)

Edit the main.inc.php file, and put the following at the start:

Code:
function getDomain() {
	$host=$_SERVER['HTTP_HOST'];
	$prefix='webmail';
	$arr=explode('.',$host);
	if ($arr[0]==$prefix) { unset($arr[0]); $host=implode('.',$arr); }
	else { $host=''; }
	return $host;
}
I've then added this:
Code:
$rcmail_config['username_domain'] = getDomain();
to allow my users to only use their ID and not the full email address.

then
Code:
// relative path to the skin folder
$rcmail_config['skin_path'] = 'skins/default/';
if (getDomain()=='domain1.com') { 
$rcmail_config['skin_path'] = 'skins/domain1'; }
if (getDomain()=='domain2.com') { 
$rcmail_config['skin_path'] = 'skins/domain2'; }
to force a skin based on the domain name.

then
Code:
// use this name to compose page titles
$rcmail_config['product_name'] = 'WebMail';
if (getDomain()=='domain1.com') { $rcmail_config['product_name']='domain1.com WebMail text'; }
if (getDomain()=='domain2.com') { $rcmail_config['product_name']='domain2.com WebMail text'; }
to change the welcome text at login based on the domain name.

and thats it.

let me know how you get on, it seems to work fine with my setup.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

For more information about the ads and why they're here, please see the FAQ

All times are GMT. The time now is 03:41 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright © 2006-2008 RoundCube Webmail Community