Linking sidebar wigets to a specific user in gallery2 ?

eliz82

Joined: 2009-11-06
Posts: 71
Posted: Sat, 2010-03-13 19:23

Hello
I have integrated my Gallery 2.3.1 into the Wordpress 2.9.2 using the WPG2.3.0.7 . all seems to work perfect including URL rewrite (G2) and permalinks (WP). I put in my blog sidebar a widget that can show me the newest or random images.

however my Gallery 2 is a multiuser gallery (like 30 users and growing).

is that any way to show the newest images only for a specific user ?

 
eliz82

Joined: 2009-11-06
Posts: 71
Posted: Sun, 2010-04-11 08:49

i have found a different solution
i use a plugin who let you write php code in the sidebar http://wordpress.org/extend/plugins/php-code-widget/ and use the external image module of G2. http://codex.gallery2.org/Gallery2:How_To_Use_The_External_Image_Block_When_url_fopen_Is_Disabled

example of my code with (a G2 gallery included in phpBB forum):

<?php
$ch = curl_init();
$timeout = 5; // set to zero for no timeout
curl_setopt ($ch, CURLOPT_URL, 'http://www.site.com/forum/gallery2.php?g2_view=imageblock.External&g2_exactSize=100&g2_blocks=recentImage|recentImage&g2_itemId=5812&g2_linkTarget=_blank');
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
echo $file_contents;
?>

this code show the last 2 images in 100px of a specific user. the "5812" from the link is the number of the main album of that user.