Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Aug 2012
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Need help with Picup App Integration

    Trying to follow the tutorial here: http://www.parorrey.com/tag/mobile-safari/

    This is how i put the code in at the very start of my page:

    Code:
    <!-- INCLUDE header.tpl -->
    <?php
    function checkMobileSafari() {
        if( preg_match( '/(iPod|iPhone|iPad)/', $_SERVER[ 'HTTP_USER_AGENT' ] ) ) {
            return true;
        } else {
            return false;
        }
    }
    ?>
    <?php
     if( checkMobileSafari() ) {
     
     echo  '<div class="info">It\'s Mobile Safari.</div>';
     
     echo '<script type="text/javascript" language="JavaScript" src="/js/prototype.js"></script>
            <script type="text/javascript" language="JavaScript" src="/js/picup.js"></script>';
     
    }
    ?>
    <?php
    var currentParams = {}
     
     
    document.observe('dom:loaded', function(){
     
      $(document.body).addClassName('iphone');
     
    	// We'll check the hash when the page loads in-case it was opened in a new page
    	// due to memory constraints
        Picup.checkHash();	
     
       // Set some starter params	
       currentParams = {
    	'callbackURL' 		: 'http://www.datethebasin.com/index.php?m=account_register',				
    	'referrername' 		: escape('App Name'),
    	'referrerfavicon' 	: escape('http://www.datethebasin.com/favicon.ico'),
    	'purpose'               : escape('Select your photo for the our App.'),
    	'debug' 		: 'false',
    	'returnThumbnailDataURL': 'true',
    	'thumbnailSize'         : '80'
    	  };
     
        Picup.convertFileInput($('photo'), currentParams);
     
    	});
    ?>
    Now the page is not loding could someone please help me out with the format? I'm sure I've got something in the wrong place somewhere.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    This part is JavaScript and should not be in <?php tags:
    Code:
    document.observe('dom:loaded', function(){
     
      $(document.body).addClassName('iphone');
     
    	// We'll check the hash when the page loads in-case it was opened in a new page
    	// due to memory constraints
        Picup.checkHash();	
     
       // Set some starter params	
       currentParams = {
    	'callbackURL' 		: 'http://www.datethebasin.com/index.php?m=account_register',				
    	'referrername' 		: escape('App Name'),
    	'referrerfavicon' 	: escape('http://www.datethebasin.com/favicon.ico'),
    	'purpose'               : escape('Select your photo for the our App.'),
    	'debug' 		: 'false',
    	'returnThumbnailDataURL': 'true',
    	'thumbnailSize'         : '80'
    	  };
     
        Picup.convertFileInput($('photo'), currentParams);
     
    	});

  • Users who have thanked Inigoesdr for this post:

    mikeisflux (08-04-2012)

  • #3
    New Coder
    Join Date
    Aug 2012
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Thank you so much. Knew it was a bonehead move of some sort. Can anyone with an iphone test if they are able to upload a picture now? The site address is http://www.datethebasin.com

  • #4
    New Coder
    Join Date
    Aug 2012
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Other issues

    the site im working on is datethebasin.com

    The site loads correctly now however when testing, when the upload function is clicked and the picture is upload the app 404's im guessing that's because the configuration info in the script here is wrong. Im guessing it is the callbackURL.

    Code:
    <script type="text/javascript"> 
    var currentParams = {}
     
     
    document.observe('dom:loaded', function(){
     
      $(document.body).addClassName('iphone');
     
    	// We'll check the hash when the page loads in-case it was opened in a new page
    	// due to memory constraints
        Picup.checkHash();	
     
       // Set some starter params	
       currentParams = {
    	'callbackURL' 		: 'http://www.datethebasin.com/index.php?m=account_register',				
    	'referrername' 		: escape('App Name'),
    	'referrerfavicon' 	: escape('http://www.datethebasin.com/favicon.ico'),
    	'purpose'               : escape('Select your photo for the our App.'),
    	'debug' 		: 'false',
    	'returnThumbnailDataURL': 'true',
    	'thumbnailSize'         : '80'
    	  };
     
        Picup.convertFileInput($('photo'), currentParams);
     
    	});
    </script>
    Also I'm using 2 upload buttons right now and I dont believe that will work because the second upload button for the iphone isnt connected to the database as it is not using the same id. However the id for the iphone app to work has to be "id="photo""

    Any ideas how i could just use one button and get this to function correctly?

    Code:
    <dt><label for="field_photo">{lang:"register","select_picture"} <!-- IF settings.require_registration_photo --><i>*</i><!-- ENDIF --></label></dt>
    <dd><input id="field_photo" type="file" name="photo" value="" class="text" /></dd>
    <p></p>
    <p>If on iPhone use button below</p>
    <dt><label for="image">Upload Image:</label></dt>
    <dd><input type="file" name="photo" id="photo"/></dd>
    Whoever can help me get this working right I will be willing to thank you via paypal.
    Last edited by mikeisflux; 08-04-2012 at 06:29 AM.

  • #5
    New Coder
    Join Date
    Aug 2012
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    ignore
    Last edited by mikeisflux; 08-04-2012 at 06:19 AM. Reason: posted too many times.

  • #6
    New Coder
    Join Date
    Aug 2012
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    ignore
    Last edited by mikeisflux; 08-04-2012 at 06:18 AM. Reason: posted too many times.

  • #7
    New Coder
    Join Date
    Aug 2012
    Posts
    21
    Thanks
    5
    Thanked 0 Times in 0 Posts
    ignore
    Last edited by mikeisflux; 08-04-2012 at 06:18 AM. Reason: posted too many times.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •