Joomla, SJSB, and SMF – displaying different things on different sites

I use a wrapper (SJSB) to show my SMF forums on my Joomla site.

Tiny issue is that the text shows up quite small on the Joomla site. It’s alright for me, but if anyone’s got poor eyes, a tiny screen, or a high resolution, it’d be brutal. I could have changed the CSS to simply make it bigger, but the smaller size actually suits the site.

To compromise, I decided I’d give a link to go to the “full” forums (which has a normal, larger size). Now, both sites share the same code, which means that link would normally show up on both. “click here to go to [exact same site] if the text is too small” would be a little silly.

Luckily, I came up with a simple php solution. It goes like this:

if (($_SERVER[‘SERVER_NAME’]==“”)) {
echo ‘<span style=”font-size: 12px;”>Too small to read?</span><br />‘;
echo ‘<span style=”font-size: 12px;”><a href=”//”>Click here to go to the full-size forum!</a></span>‘;
} else {
echo ‘<span style=”font-size: 16px;”>You are visiting the FORUMS!</span><br />‘;
echo ‘<span style=”font-size: 16px;”><a href=”//”>Click here to go to the Website!</a></span>‘;

This basically compares the fields in orange. If they’re equal, it does the first section under if. Otherwise, it does the stuff under else. Pretty much anything related to the php code is in black. The html formatting is in purple, and what actually ends up on the screen is in blue. Note that I didn’t *need* an else section – I decided to put it there simply to make it easy for people to head back to the main site if they wanted to.

In this case, if you were on the site, you would see:

Too small to read?
Click here to go to the full-size forum!

If you were NOT on the site (for example, if you were on instead), you would see this:

You are visiting the FORUMS!
Click here to go to the Website!

Simple, yet elegant! A different message and font for each site.

I incidently used the same concept to show ads based on what site they were on.