...

View Full Version : Need help with Picup App Integration



mikeisflux
08-04-2012, 04:38 AM
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:


<!-- 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.

Inigoesdr
08-04-2012, 04:40 AM
This part is JavaScript and should not be in <?php tags:

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);

});

mikeisflux
08-04-2012, 04:46 AM
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

mikeisflux
08-04-2012, 05:17 AM
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.


<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?


<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.

mikeisflux
08-04-2012, 05:23 AM
ignore

mikeisflux
08-04-2012, 05:26 AM
ignore

mikeisflux
08-04-2012, 05:33 AM
ignore



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum