We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Oxwall on mobile phones | Forum

Topic location: Forum home » Support » General Questions
Keelan Leader
Keelan Dec 6 '11
Yes Michael then you can use free development sites that can coordinate feeds to create mobile apps etc :)
Amarnath Reddy
Amarnath Reddy Dec 10 '11
When can we expect a mobile version of oxwall that works best in all mobiles
jeo
jeo Dec 11 '11
that be great keelan can you tell me witch link i need to look for?
Khalid Shaikh
Khalid Shaikh Dec 12 '11
We are waiting for our oxwall team to develop mobile edition...but before that lets go through four easy steps to make your website mobile friendly....it might be a good idea to write a little tutorial about how to make your entire site more mobile-friendly without even touching your pages.

Step 1: Set up a domain mirror

If your site lives at www.oxwallsample.com, you’re going to want to set up a subdomain at m.oxwallsample.com. How you accomplish this is usually pretty straightforward but differs depending on your host. I use control panel to do the same, I can add subdomains effortlessly until I pass out from excitement. You want to set up your subdomain as a “mirror” of your main site, meaning the subdomain is really just pointing to your existing site.

Step 2: Create global_prepend file

The next thing we’re going to do is a create a PHP file which will be automatically prepended to every page of our site. Call this file something like "global_prepend.php" and throw it at the root of your server:

"codes for this file are as below"


<br />
<?php<br />
function callback($buffer) {<br />
    if ($_SERVER['SERVER_NAME'] == 'm.oxwallsample.com') {<br />
        $buffer = str_replace('http://www.oxwallsample.com', 'http://m.oxwallsample.com', $buffer);<br />
        $buffer = preg_replace('/[\n\r\t]+/', '', $buffer);<br />
        $buffer = preg_replace('/\s{2,}/', ' ', $buffer);<br />
            $buffer = preg_replace('/(<a[^>]*>)(<img[^>]+alt=")([^"]*)("[^>]*>)(<\/a>)/i', '$1$3$5<br />', $buffer);<br />
        $buffer = preg_replace('/(<link[^>]+rel="[^"]*stylesheet"[^>]*>|<img[^>]*>|style="[^"]*")|<script[^>]*>.*?<\/script>|<style[^>]*>.*?<\/style>|<!--.*?-->/i', '', $buffer);<br />
        $buffer = preg_replace('/<\/head>/i', '<meta name="robots" content="noindex, nofollow"></head>', $buffer);<br />
    }<br />
    return $buffer;<br />
}<br />
ob_start("callback");<br />
?>

This code uses a PHP function called ob_start() to read in your entire HTML source, run some rules on it, and then send the output to users’ web browsers… all in real time. The first "if" statement simply checks to see if the user is coming from our special “mobile” URL, and if so, runs seven replace statements on the code. Here’s what each line does:

  1. Changes all URLs to “mobile”-ized URLs.
  2. Strips all linefeeds, carriage returns, and tabs.
  3. Trims multiple spaces down to one (HTML doesn’t recognize more than one space in a row).
  4. Changes any anchored images with alt text to plain text anchors.
  5. Strips all stylesheets, images, inline styles, scripts, and comments
  6. Tells search engine robots not to index or crawl the mobile version of the site so as to not create duplicate listings.
Step 3: Create global_append file

Next, we need to create a tiny PHP file which will automatically get added to the end of every file on our site. This is the code that actually outputs the page to the browser. So the flow is like so: Suck code into buffer, siphon fat away, spit contents of buffer into browser.

The code for the global_append file is below. Call it something like "global_append.php" and throw it at the root of your server:

"codes for this file are as below"

<br />
<?php<br />
    ob_end_flush();<br />
?>
Step 4: Enable prepends and appends using .htaccess

If you don’t already have an .htaccess file at the root of your server, open up a new text file and add these lines to it:

php_value auto_prepend_file /localfilepath/global_prepend.php
php_value auto_append_file /localfilepath/global_append.php

Then save it to the root of your server with the filename ".htaccess". If you already have an .htaccess file, just add the above lines to it.

* Important Note: If you copy these two lines from your web browser, you might need to delete the carriage return and make your own. Sometimes a browser’s carriage return will cause your .htaccess file to fail (you’ll know immediately if it has failed because your site won’t come up).

Assuming your subdomain is live, you should now be able to hit your site in a web browser using the special mobile URL and see a nice, compact, imageless, styleless, scriptless version of your site.

ITao
ITao Dec 12 '11
@Khalid Shaikh Thanks, But after i do what you say i get this error: Parse error: syntax error, unexpected '>' in /home/socialm/public_html/global_prepend.php on line 2. My prepend looks exactly like yours except i changed all the oxwallsample.com links to my site's links Any idea?

Also, Earlier i got it so i could get on the site (past that) and the prepend code was above my site so everyone could see it?
The Forum post is edited by ITao Dec 12 '11
Khalid Shaikh
Khalid Shaikh Dec 14 '11
@ITao .... your subdomain should me mirror to your main site

Gerald Rusche
Gerald Rusche Dec 14 '11

Quote from aka_le_Mulder Most of the modern mobile browsers display Oxwall sites properly. And of course our team will develop a mobile edition soon because it is really important for a modern Internet users.

The only but important reason for mobile is the limited size on mobile phones. So i think it maybe could be a much better idea to invest in a technologie that will soon be a burner like css was a few years ago. I mean responsive webdesign. With a responsive template (here called theme) no special version is needed. Just rezise the side to any small display it should be used on.

I think on the actual theme, only the header needs a lot of work. The Rest should only be new stuctured.

Would like to get an example? Here are 50 examples
jeo
jeo Dec 14 '11
@Khalid Shaikh

I love the sound of making my site mobile, but could you explain in details on some of these steps?

Setp2: ware will i need to create this file at "global_prepend.php" on my cpanal?

and what do you mean by mirror? do you mean point m.domain.com to www.domain.com in the cpanal on parked domains?

Ashok Leader
Ashok Dec 14 '11
@Khalid Shaikh 

Good work with the hack. Definitively useful until a theme or a feature in core files could be developed

Can you please post it under 'Hacks' section and make a note to moderators to make it a sticky thread?

Thanks !
The Forum post is edited by Ashok Dec 14 '11
Martin
Martin Dec 14 '11
is there going to be an editable mobile app for oxwall?  I think it would be a very interesting idea.  I wish I knew more about programming or I would offer to help building an app. 
Eddie Hakan
Eddie Hakan Dec 16 '11
so far..  i can access oxwall pages from my mobile phone.. i'm using android os.. ;)
Pages: « 1 2
This topic is locked