Messaging for Iphone

Messaging for Iphone

by Will Cunningham -
Number of replies: 6
I was trying to simplify the messaging for use on my Iphone but I have no idea what I am doing. If you download iwebkit from http://iwebkit.net/ you basically get the template for an Iphone page render. If I take the message/index.php file and insert it into the template all works very well. My probblem is if I am not logged in I need the login page in the Iphone format and I need the actual page for writing the message to do this.

If you insert this code into the header file of your theme it will redirect you to the correct mobile version. But I want this to be for all aspects of messaging and I can only redirect to one page.
Code:<script language=javascript>
<!--
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))
{
location.replace("iphone/home.html");
}
-->
</script>

Each page loads a header but I couldn't figure out how to implement it. Any help would be appreciated.



Average of ratings: -
In reply to Will Cunningham

Re: Messaging for Iphone

by Will Cunningham -
I figured out if in message/index.php if I add:

if (empty($CFG->messaging)) {
error("Messaging is disabled on this site");
}
This part:
if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') !== FALSE)

{header("Location: http://www.yoursite/moodle/message/mobile_index.php/");}

and then use the iwebkit template wrapped around message/index.php It works.

Got the Login to work too.

can't get the discussion one to work yet though.
In reply to Will Cunningham

Re: Messaging for Iphone

by Will Cunningham -
I was also able to remove the user images from the messaging index by editing the message/lib.php.

I still can't figure out how to do the discussion page though. I just can't seem to figure out where to place the redirect and maintain the id. Anyone out there want to lend me a hand?
In reply to Will Cunningham

Re: Messaging for Iphone

by Matt Gibson -
I've not done any iPhone development yet, so can't help much. I think you might have some more luck if you post in the general developer forum though. I'm sure someone with more experience than me can give you some guidance there.
In reply to Matt Gibson

Re: Messaging for Iphone

by Will Cunningham -
Thanks I'll try there.