I converted my website into a mobile layout and was given the following instructions .....
Login to your GoDaddy account from the GoDaddy home page.
2.
Hover over 'Hosting' and then click on the management option at the bottom right of the pop-up window.
3.
Open the control panel for the website you want to install the redirect on.
4.
Click on the FTP File Manager.
5.
Highlight the Index.html file then click the edit button at the top.
6.
Click on the HTML button in the window that pops up.
7.
Find the <head> tag of your website and click enter/return to create a new line.
8.
Click the copy code below so that you can insert it after the <head> tag.
This is supposed to redirect mobile phones to my mobile web page..... however, the coding for SMF seems to be more complex than regular web pages and I cannot find the <head> tag in the index.php file. Does anyone know where to put the redirect code in ?
index.template.php for the themes you want to do this with. Not sure of what code you will be inserting, but because you're working in PHP, just be careful of keeping the proper syntax. :)
<script src="http://static.dudamobile.com/DM_redirect.js" type="text/javascript"></script><script type="text/javascript">DM_redirect("http://mobile.dudamobile.com/site/boredbusinessmen");</script>
This is the coding I am supposed to put in, please speak in laments terms because I have almost no knowledge of coding.
I use Notepad++ to edit my site's files. Not sure what you use, but the steps here should work out. I am using the vanilla default theme as a reference.
Open index.template.php in the editor of your choice.
Find this:
<head>';
Replace it with this:
<head>
<script src="http://static.dudamobile.com/DM_redirect.js" type="text/javascript"></script>
<script type="text/javascript">DM_redirect("http://mobile.dudamobile.com/site/boredbusinessmen");</script>';
Upload and test it out. Make a backup of this file just in case anything goes sour.
After searching for the past few hrs this is the thread that is the closest to what I'm looking for. Using mobilized.com
I'm trying to do the same thing as Natetrig but I'm not having any luck. Everytime I try and add this to my "head" index.template.php for the theme I'm using, as you instructed my site crashes.
<head><script type="text/javascript">
var mobile_domain ="m.danstopnotch.net";
// Set to false to not redirect on iPad.
var ipad = true;
// Set to false to not redirect on other tablets (Android , BlackBerry, WebOS tablets).
var other_tablets = true;
document.write(unescape("%3Cscript src='"+location.protocol+"//s3.amazonaws.com/me.static/js/me.redirect.min.js' type='text/javascript'%3E%3C/script%3E"));
</script>';
Any help would be greatly appreciated
Richard
using SMF 2.0.2 | SMF © 2011, Simple Machines
PortaMx 1.45 | PortaMx © 2008-2011, PortaMx corp.
Looks like you don't understand the basic nature of how the echo() statement works.
echo must use single or double quotes to output any literal string. And it must end with a semi-colon.
example:
echo 'this will show on the page';
Or
echo "this will show on the page';
If you need to put a single quote in the middle of your string that you want to output you need to escape it like this:
echo 'this show\'s how to use single quotes';
Same exact thing if you are using double quotes.
The other thing you have wrong with your code is you have a <head> tag in it. SMF already has a <head> tag, so you only need to put your code somewhere between the open and closing <head></head> tags.
Make sure you are not inserting your code in the middle of another echo statement. They can span multiple lines. Look for the end of an echo statement and place your code in the proper place.
echo '
<script type="text/javascript">
var mobile_domain ="m.danstopnotch.net";
// Set to false to not redirect on iPad.
var ipad = true;
// Set to false to not redirect on other tablets (Android , BlackBerry, WebOS tablets).
var other_tablets = true;
document.write(unescape("%3Cscript src=\'"+location.protocol+"//s3.amazonaws.com/me.static/js/me.redirect.min.js\' type=\'text/javascript\'%3E%3C/script%3E"));
</script>';
Thank you so much... That worked perfectly.