Results 1 to 15 of 15

Thread: City Template for Mobile (a kind of open source)

  1. #1
    Senior Member noonoo1's Avatar
    Join Date
    Jul 2007
    Location
    Wales, UK
    Posts
    3,261

    Default City Template for Mobile (a kind of open source)

    Hi all,

    I would like to offer a free mobile city template for anyone that wants to use on for there Geo .mobi's.

    I'm not a coder by any means, this particular project took me a few hours but i'm sure that it would have been a much quicker job for the professional's on this forum.

    It's a mashup of different code and a little of what i know, there is not much for the spiders to see but i'm hoping that we can add to this template to make a version2,3,4, etc.

    I'm hoping this will be a bit like an open source program and that the coders on this forum will contribute and make it better.

    So here is one of my templates at work, i hope you all like it? I'm only using 1 adsense slot at the moment but could change it to admob. I use a google api for this.

    Plymouth.mobi

    I'll add a download link to the zip file within the next hour or so.

    Andres are you able to make this a sticky maybe if all goes well?

    Please feel free to comment.

    Here is the download link: Programmer.mobi/citytemplate.zip
    Last edited by noonoo1; 12-31-2010 at 04:39 PM. Reason: Download link added
    ENOUGH SAID


    Mobile Web Search, forget google, bookmark... JUST.mobi

    Snowboards.mobi | Convert2.mobi | Caravans for Sale | VOTES.mobi

  2. #2
    Senior Member ChinaMobi's Avatar
    Join Date
    May 2010
    Posts
    1,593

    Default

    Good idea noonoo1. Very helpful as I can study the code on local search. As for plymouth.mobi, its index page fits well on my Android phone, but the other pages are much wider. Can you do something about the screen width?

  3. #3
    Mobility Regular ChineseDomain's Avatar
    Join Date
    Jul 2007
    Location
    China
    Posts
    638

    Default

    Great! I will try it for some Germany cities and China Cities

    Happy New Year!

  4. #4
    Senior Member noonoo1's Avatar
    Join Date
    Jul 2007
    Location
    Wales, UK
    Posts
    3,261

    Default

    Instructions to alter the code.

    Edit admob.php file with your own admob code or adsense code and save.

    Config.php

    This file is for global changes:
    $city="YourGeo"
    $region="YourGeoRegion"
    $api="YourApi" you can get your individual domain name Api here: http://code.google.com/apis/maps/signup.html
    Last edited by noonoo1; 01-01-2011 at 05:06 PM.

  5. #5
    Senior Member noonoo1's Avatar
    Join Date
    Jul 2007
    Location
    Wales, UK
    Posts
    3,261

    Default

    I looking to add geolocation to this local search script, it looks as though the part that generates the list is this bit of code.

    // Set the Local Search center point
    localSearch.setCenterPoint();

    I need to get lat,lng in the () here.

    Can anyone help?
    ENOUGH SAID


    Mobile Web Search, forget google, bookmark... JUST.mobi

    Snowboards.mobi | Convert2.mobi | Caravans for Sale | VOTES.mobi

  6. #6
    Senior Member andymoore's Avatar
    Join Date
    Aug 2008
    Posts
    1,612

    Default

    Is this any use?

    http://locationdetection.mobi/

    --

    Rather than having index.php show links to different files would it not be easier to manage if index had an array of search terms then rather than link to different files that all replicate code have it link back to the index with the search string and if the search string is set have it check the term is in the array and if so then build the JavaScript request from there.

    The logic:

    If search set and in array show search results
    Else build the list from the array

    Thoughts?

    Love the spirit of giving it away!

    Andy Moore
    i don't do tech / mobi anymore - why do something that annoys and stresses lol

    New: Most Minty Tooth Oil - GMO and fluoride free toothpaste alternative

    100% natural botanical extracts to whiten teeth, freshen breath and strengthen gums
    Used, recommended and sold by Harley Street private dentists

    My other websites:

    http://sellyoursongs.info/ - Sell Your Songs using Mobile Payments
    http://detectmobilebrowsers.mobi/ - Detect Mobile Browsers
    http://andymoore.info/m-commerce-php/ - M-Commerce PHP (sell stuff on the mobile web)
    http://locationdetection.mobi/ - Detect a mobile browser's latitude & longitude
    http://andymoore.info/mysql-lyrics-database/ - Half a million lyrics


  7. #7
    Senior Member andymoore's Avatar
    Join Date
    Aug 2008
    Posts
    1,612

    Default

    Rather than trying to explain something I thought a little code might help:

    PHP Code:
    <?php

    // clean all user input - trust nothing!
    foreach($_GET as $value => $get){
      
    $_GET[$value] = htmlentities(htmlspecialchars(strip_tags($get)));


    // build up an array of all the search terms and anchor texts
    $terms = array(
        
    'banks' => 'Banks',
        
    'cinema' => 'Cinemas'
    );

    // if there is no search value set we need to show the primary link list
    if(!isset($_GET['search'])){
        
    // go through every item in the terms array and build the page content
        
    foreach($terms as $term => $anchor){
            
    $page_content .= '<a href="?search='.$term.'">'.$anchor.'</a><br />';
        }
    }else{
        
    // do google javascript stuff here
        
    $page_content $_GET['search'];    
    }

    // header template stuff
    echo $page_content;
    // footer template stuff

    ?>


    You'll need to edit that so that it checks the search term is in the array otherwise folks could screw around with it.....
    Last edited by andymoore; 01-03-2011 at 08:24 AM.
    Andy Moore
    i don't do tech / mobi anymore - why do something that annoys and stresses lol

    New: Most Minty Tooth Oil - GMO and fluoride free toothpaste alternative

    100% natural botanical extracts to whiten teeth, freshen breath and strengthen gums
    Used, recommended and sold by Harley Street private dentists

    My other websites:

    http://sellyoursongs.info/ - Sell Your Songs using Mobile Payments
    http://detectmobilebrowsers.mobi/ - Detect Mobile Browsers
    http://andymoore.info/m-commerce-php/ - M-Commerce PHP (sell stuff on the mobile web)
    http://locationdetection.mobi/ - Detect a mobile browser's latitude & longitude
    http://andymoore.info/mysql-lyrics-database/ - Half a million lyrics


  8. #8
    Senior Member noonoo1's Avatar
    Join Date
    Jul 2007
    Location
    Wales, UK
    Posts
    3,261

    Default

    Hi Andy, tanks alot, looks a fair bit easier, i had a go at this but i need to play around with it a bit more.

    http://plymouth.mobi/index1.php
    ENOUGH SAID


    Mobile Web Search, forget google, bookmark... JUST.mobi

    Snowboards.mobi | Convert2.mobi | Caravans for Sale | VOTES.mobi

  9. #9
    Mobility Regular ChineseDomain's Avatar
    Join Date
    Jul 2007
    Location
    China
    Posts
    638

    Default

    One question, can this be done without JavaScript? My phone browser can't support the javascript, and I think there are much more mobiles can't support JavaScript.

  10. #10
    Senior Member andymoore's Avatar
    Join Date
    Aug 2008
    Posts
    1,612

    Default

    I wondered that too and found this http://code.google.com/apis/maps/doc...rch/index.html followed by this awesome brain food:

    http://developer.yahoo.com/search/lo...calSearch.html

    Andy Moore
    i don't do tech / mobi anymore - why do something that annoys and stresses lol

    New: Most Minty Tooth Oil - GMO and fluoride free toothpaste alternative

    100% natural botanical extracts to whiten teeth, freshen breath and strengthen gums
    Used, recommended and sold by Harley Street private dentists

    My other websites:

    http://sellyoursongs.info/ - Sell Your Songs using Mobile Payments
    http://detectmobilebrowsers.mobi/ - Detect Mobile Browsers
    http://andymoore.info/m-commerce-php/ - M-Commerce PHP (sell stuff on the mobile web)
    http://locationdetection.mobi/ - Detect a mobile browser's latitude & longitude
    http://andymoore.info/mysql-lyrics-database/ - Half a million lyrics


  11. #11
    Mobility Regular ChineseDomain's Avatar
    Join Date
    Jul 2007
    Location
    China
    Posts
    638

    Default

    Google local search API has max 8 results limitations.

  12. #12
    Senior Member noonoo1's Avatar
    Join Date
    Jul 2007
    Location
    Wales, UK
    Posts
    3,261

    Default

    Hi Max, have a look at this, hotrods.mobi/Boss

    I set the query to playboy as well as many other queries and the boss script spits out as much data as you want. At the moment the search is set for images, news and web.

  13. #13
    Mobility Regular ChineseDomain's Avatar
    Join Date
    Jul 2007
    Location
    China
    Posts
    638

    Default

    It seems it works with no limit for web search, but has maximum 8 limit for Local Search.

  14. #14
    Senior Member noonoo1's Avatar
    Join Date
    Jul 2007
    Location
    Wales, UK
    Posts
    3,261

    Default

    I did read in the google developer info you can have maximum of 32 results but that was for 4 pages, you have to add extra bit of code for adding pages.

    The Google Local Search API allows a maximum of 32 results on 4 pages. There is no way to get more than 32 results.

    Does this help?

    .gotoPage(page)

    After a search completes, a cursor property may become visible on the searcher option. This is a function of the number of search results available as well as the capabilities of the underlying searcher. If the cursor property is present, then this method allows you to fetch another bundle of search results. Applications specify which page by using the page argument. This value is then used to index the cursor.pages array which ultimately is used to compute the value of the &start url argument.

    page - supplies the page number of the results that the application wants. This value is range checked relative to the .cursor.pages property and no operation is performed if the page is out of range or if the underlying searcher does not have a cursor property.
    returns - n/a
    Last edited by noonoo1; 01-08-2011 at 01:51 PM.
    ENOUGH SAID


    Mobile Web Search, forget google, bookmark... JUST.mobi

    Snowboards.mobi | Convert2.mobi | Caravans for Sale | VOTES.mobi

  15. #15
    First time poster!
    Join Date
    Mar 2011
    Posts
    1

    Default i could not download it

    hi noonoo, is the source code available to download? greetings.

Similar Threads

  1. Android goes open source
    By Scandiman in forum News & Discussion
    Replies: 1
    Last Post: 10-22-2008, 05:28 PM
  2. Replies: 0
    Last Post: 10-01-2008, 03:30 PM
  3. Open source LBS
    By Scavenger in forum Mobile Web Development
    Replies: 0
    Last Post: 09-25-2008, 11:10 AM
  4. Replies: 0
    Last Post: 07-26-2008, 01:51 AM
  5. Open Source Symbian
    By Scavenger in forum Mobile Industry News
    Replies: 0
    Last Post: 06-26-2008, 06:00 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
A Yup.mobi Mobile Site
Mobile Dating