Cheers mate! I suspect it is working, but now I'm encountering a lovely error from flickpic.php (which I didn't encounter in my test run).
[Notice] Undefined variable: user
GET /
Line 12 in /home/mwgd/public_html/mysite/code/flickpic.php
Source
3 * randomFlickr.class.php usage sample
4 */
5
6 require_once('randomFlickr.class.php');
7
8 if ( !isset($_GET['imageUrl']) )
9 {
10 try
11 {
12 $x = new randomFlickr($user);
13 if ( $badge )
14 {
15 $x->setBadgeUrl($badge);
16 }
17 $x->fetch();
18 }
At no http://blog.kno.at/tools/one-random-photo-from-your-flickr-stream/ the author comments
In line 12 the randomFlickr-object is being created using a variable $user. This variable isn’t specified here, therefore will just be ignored. Then we check if a badge-url has been specified in $badge. If so, we change the object’s badge url according.
A few words about the fetch()-method. It will check if there’s a user id specified (the ugly flickr user-id string, that is, due the badges don’t seem to work with the usernames). If so, it uses the default badge-url for 1 random image and passes that user-id. Easy. If there’s no user specified, the badge-url will be used as-is.
But for some reason SS won't happily ignore it as he suggests? So as a stab in the dark, in Page.php I add
$user = 44137955;
But then the new error is this:
[Notice] Undefined offset: 0
GET /
Line 282 in /home/mwgd/public_html/mysite/code/randomFlickr.class.php
Source
273 $sBadge = $this->curlAccess($this->sBadgeUrl . ( $user ? "&user=$user" : '' ));
274 }
275 else
276 {
277 throw new Exception('allow_url_fopen disabled and CURL not found. Cannot access remote url '. $this->sBadgeUrl . ( $user ? "&user=$user" : '' ));
278 }
279
280 preg_match(self::REGEX_SRC, $sBadge, $matches);
281
282 $this->sSrc = $matches[0] . '.jpg';
283 $this->iId = $matches[1];
284
285 preg_match(self::REGEX_URL, $sBadge, $matches);
286 $this->sUrl = $matches[1];
287
288 preg_match(self::REGEX_TITLE, $sBadge, $matches);
Any ideas on this? (apologies if I'm missing anything obvious...and also don't worry if you can't be bothered with this troubleshooting!)