Jump to content

Flickr script help please


bgbs

Recommended Posts

I found this cool script but I want it modified.

First the URL, I would like to point to my flickr account so that it can pull pictures from my set only. Right now it pulls any pics from flickrs using tags. I don't need tags.

Second thing is that all pics show up in one row, I would like to have Two columns three pics on each column. I dont know how to do that.

 

Any help would be appreciates since this sort of modifaction stuff is over my head.

 

Thanks ahead of time

Ben

 

<?php

$tags = "sea, sand, caribe, sunshine";

$imageNumber = 6;

 

 

function getFlickrRSS(){

global $tags, $ids;

 

$url = "http://api.flickr.com/services/feeds/photos_public.gne?format=rss2&tags=".$tags;

 

if ($fp = fopen($url, 'r')) {

$content = '';

 

while ($line = fread($fp, 1024)) {

$content .= $line;

}

}

 

return $content;

}

 

function getImages($rssContent){

global $imageNumber;

$before = '<media:thumbnail url="';

$after = '"';

$imageList = array();

 

$oldPos = 0;

$startPos=0;

 

do {

$oldPos = $startPos;

$startPos = strpos($rssContent,$before,$startPos) + strlen($before);

$endPos = strpos($rssContent,$after,$startPos);

$imageList[] = substr($rssContent,$startPos,$endPos-$startPos);

} while (($startPos > $oldPos) && (sizeof($imageList)<$imageNumber));

 

return $imageList;

}

 

$content = getFlickrRSS();

$imageList = getImages($content);

 

?>

Link to comment
https://forums.phpfreaks.com/topic/101443-flickr-script-help-please/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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