Jump to content

xymalf

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Everything posted by xymalf

  1. the code is taken straight from flickrs API page - I want to call the flickr url with a concaternating string with this information. What do i modify - please.
  2. <?php http://www.flickr.com/services/oauth/request_token ?oauth_nonce=89601180 &oauth_timestamp=1305583298 $oauth['flickr']['consumerkey']="1a2755a9a5a19904c7f5e661d85db657"; $oauth['flickr']['consumersecret']="4a325791b4936fe0"; $oauth['flickr']['requesttokenurl']="http://www.flickr.com/services/oauth/request_token"; $oauth['flickr']['accesstokenurl']="http://www.flickr.com/services/oauth/access_token"; $oauth['flickr']['authurl']="http://www.flickr.com/services/oauth/authorize"; &oauth_signature_method=HMAC-SHA1 &oauth_version=1.0 &oauth_callback=http:%3A%2F%2Fwww.xymalf.co.uk/flic/index.php ?> what is wrong in the above code
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <?php $link = mysqli_connect('217.174.253.', 'xymalf' , 'pocol'); if (!$link) { $output = 'unable to connect to database server.'; include 'output.html.php'; exit(); } if (!mysqli_select_db($link, 'xymalfco1')) { $output = 'unable to locate db'; include 'output.html.php'; exit(); } $output = 'connected.'; include 'output.html.php'; ?> </body> </html> I have managed to get an SQL connection. I need help with writing the callback eg application page. The above module is called connect.php I want the callback file to be index.php I want the index file to call the auth file auth(); connect to SQL not sure how I put the link code to module above. Then I want to store users tokens in the SQL database so my application recognizes them if they visit again. I want to display users flickrs photos and those of people he follows.
  4. http://www.flickr.com/services/api/auth.oauth.html I have keys and call back url set up. Also need to know how to store tokens onto a SQL database so application remembers user. I want to display all the users photos and those of people he folows.
  5. I want Flicr to callback to my page http://www.xymalf.co.uk/flic/index.php - i have set this up in flicr and got keys I want to Auth the user using auth(); Store token in a mySQL database so the application remembers them next time I want to display the users photo stream and those of people he follows. Also need to know how to do error detection because i can't seem to connect ot mySQL database. The site owner does not expalin what files you need to edit to get a fully working application. PhpFlickr already has some php program for connecting to SQL but i can't see anywhere inside it that it has database settings.
  6. hOW do i turn on the error reporting i am just a newbie.
  7. <?php if (isset($_GET['tag'])) { do_search($_GET['tag']); } else { ?> <form action="<?php echo $_SERVER['PHP_SELF']?>" method="get"> <p>Search for photos with the following tag: <input type="text" size="20" name="tag"/> <input type="submit" value="Go!"/></p> </form> <?php } ?> <?php # uses libcurl to return the response body of a GET request on $url function getResource($url){ $chandle = curl_init(); curl_setopt($chandle, CURLOPT_URL, $url); curl_setopt($chandle, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($chandle); curl_close($chandle); return $result; } function do_search($tag) { $tag = urlencode($tag); #insert your own Flickr API KEY here $api_key = "1a2755a9a5a19904c7f5e661d85db657"; $per_page="100"; $url = "http://api.flickr.com/services/rest/?method=flickr.photos.search&api_key={$api_key}&tags={$tag}&per_page={$per_page}"; $feed = getResource($url); $xml = simplexml_load_string($feed); print "<p>Total number of photos for {$tag}: {$xml->photos['total']}</p>"; # http://www.flickr.com/services/api/misc.urls.html # http://farm{farm-id}.static.flickr.com/{server-id}/{id}_{secret}.jpg foreach ($xml->photos->photo as $photo) { $title = $photo['title']; $farmid = $photo['farm']; $serverid = $photo['server']; $id = $photo['id']; $secret = $photo['secret']; $owner = $photo['owner']; $thumb_url = "http://farm{$farmid}.static.flickr.com/{$serverid}/{$id}_{$secret}_t.jpg"; $page_url = "http://www.flickr.com/photos/{$owner}/{$id}"; $image_html= "<a href='{$page_url}'><img alt='{$title}' src='{$thumb_url}'/></a>"; print "<p>$image_html</p>"; } } # do_search ?> I want to display 300 photos horizontally so they fill the web page - at the moment the script just displays 20 photos vertically.
  8. <?php require_once("phpFlickr.php"); $phpFlickrObj = new phpFlickr('1a2755a9a5a19904c7f5e661d85db657'); $user = $phpFlickrObj->people_findByUsername('stathisg'); $user_url = $phpFlickrObj->urls_getUserPhotos($user['id']); $photos = $phpFlickrObj->people_getPublicPhotos($user['id'], NULL, NULL, 4); foreach ($photos['photos']['photo'] as $photo) { echo '<a href="'.$user_url.$photo['id'].'" title="'.$photo['title'].' (on Flickr)" target="_blank">'; echo '<img alt="'.$photo['title'].'" src="'.$phpFlickrObj->buildPhotoURL($photo, "square").'" />'; echo '</a>'; } ?> I am using the above index.php file as my call back url from flickr when i try and run the code above all i see is a blank page - what is wrong? Also I want to connect to mySQL data base DEFINE ('DB_USER', 'xymalfco1'); DEFINE ('DB_PASSWORD', 'po'); DEFINE ('DB_HOST', '217.174.253.'); DEFINE ('DB_NAME', 'xymalfco1'); the above definitions don't seem to work. What I want to create is a page of the Flickr users photo's that are authorised by the Auth.php file and then displays the users and those people he follows photos.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.