Jump to content


Easypeasygallery


  • You cannot reply to this topic
48 replies to this topic

#41 Nick_NP

    Etomite Forum Fan

  • Member
  • Pip
  • 72 posts

Posted 26 July 2005 - 08:46 PM

Nutter, on Jul 26 2005, 09:12 PM, said:

I wrote that snippet. :)  Well, hacked it anyway from a different sitemap snippet into outputting the right format. 

I had just found out about google's sitemap project and started writting my own snippet to do just that when I found yours :D
Have installed the snippet but haven't gone over it in detail yet!

Had a look at your site (btw; is this your own site? I do portraits too -> http://nickpearson.bizhat.com/index.php?id=33, website still being built!) and can't see where the mysterious "id=" is coming from...

Not sure if this will solve the problem, but it will make makeurl behave differently.

Go and edit the gallery snippet code and replace all these lines :
$link = $etomite->makeUrl( $id, '', $args );

...with this line :
$link = $etomite->makeUrl( $id, $etomite->documentObject['alias'], $args );

In the original snippet code this will be on lines 307, 319, 338, 417, 435, 502, 543 and 596.

Hope this works for you!

#42 clayman58

    Etomite Forum Newbie

  • Member
  • 1 posts

Posted 03 February 2006 - 08:17 PM

I am really new to Etomite...hence the basic question. Where do I copy your snippet to? What folder/file do I copy to?

Thanks my friend.

If it isn' too much trouble, could you send a copy of the answer to clayton058@hotmail.com

Thanks again.

#43 Dean

    Loves Etomite Forums!

  • Admin
  • 4,758 posts
  • Gender:Male

Posted 03 February 2006 - 08:19 PM

You need to read the Documentation, but as a quick answer, click Manage Resources and then press the add snippet text.

#44 PaulD

    Likes Etomite Forums!

  • Developers
  • PipPip
  • 398 posts
  • Gender:Male

Posted 07 July 2006 - 05:01 PM

Hi Nick_NP

Although you are not supporting EPG1 any more, is there an easy way to make the full size image appear in a new window. I have been looking for the line in the snippet but can't find it.

I returned to EPG1 because of it's simplicity. EPG2 is great but without a batch upload it can become quite tedious for some galleries where descriptions etc are not needed.

Thank you for your help,

Paul

PS I have tried inserting a target="_blank" in various places but I seem to break EPG all the time. I am sure I read somewhere how to do this although in my vague distant memory, so may be thinking of another gallery. Please help!

Edited by PaulD, 07 July 2006 - 06:16 PM.


#45 Nutter

    Likes Etomite Forums!

  • Member
  • PipPip
  • 216 posts

Posted 07 July 2006 - 08:00 PM

You could probably do it as a javascript pop-up. Something like...
$output .= "<a align=\"center\" href=\"".$path."?g_pic=".$i."&g_view=detail\" onClick=\"window.open('./".$directory."/fullsize/".$pic_list[$i]."');\"><img src="./'.$directory.'/thumbs/'.$pic_list[$i].'" width="100px" height="100px"/></a>';

This line is about 10 lines up from the bottom. I haven't tested this, and it may be way off because of all the escaped quotes, but it seems that it should work.

#46 PaulD

    Likes Etomite Forums!

  • Developers
  • PipPip
  • 398 posts
  • Gender:Male

Posted 08 July 2006 - 10:58 AM

Thanks for that. I tried it out but couldn't get it to work. The gallery that I had on the bottom of a page I have simply moved to a new page on it's own.

I will continue to try to get this to work but haven't the time right now. Thanks for the line of code though and I shall post it here if I get it to work.

Paul

#47 col

    Etomite Forum Newbie

  • Member
  • 1 posts

Posted 16 November 2006 - 07:47 PM

Hi - Im cant seem to get the full size images to display. It shows the thumbnails ok.
How does the gallery know how to look for them? Should they have the exact same name as the thumbnails
Thanks
Colin

#48 _rasel^

    Etomite Forum Fan

  • Member
  • Pip
  • 76 posts

Posted 15 October 2008 - 07:14 PM

This easy snippet doesn't work under Etomite Prelude 1.1, but I don't know why. When I create new gallery, than snippet return nothing. Galleries created in previous version of Etomite with same snippet work correctly. I thing, there is some problem with opendir() function... same problem I have with two different websites in different hostings.

Edited by _rasel^, 15 October 2008 - 07:15 PM.


#49 Alpha28

    Etomite Forum Newbie

  • Member
  • 1 posts

Posted 30 September 2011 - 08:50 AM

Modify snippet to make it work on php5.3
// Configuration variables ------------
if (!isset($pageid)) {$pageid = $etomite->documentIdentifier;}
$directory = "ressources/images_".$pageid;
$output = $directory;
if (file_exists($directory)) {
    $pics_per_row = 4;    // Number of thumbnails per row
    $rows_per_page = 3;   // Number of rows per page (set to 0 for all thumbnails on a single page)
    $nav_thumbs_top = true;	  // Set to true to display top nav bar on thumbnails pages
  
    $nav_thumbs_bot = true;	  // Same for the bottom nav bar
    $nav_detail_top = true;	  // Set to true to display top nav bar on details pages
    $nav_detail_bot = true;	  // Same for the bottom nav bar
// ------------------------------------
if (empty($g_pic))  $g_pic  = $_GET["g_pic"];
if (empty($g_view)) $g_view = $_GET["g_view"];
if (empty($g_page)) $g_page = $_GET["g_page"];
$id = $_GET['id'];
$path = empty($_SERVER["PATH_INFO"]) ? $_SERVER["PHP_SELF"] : $_SERVER["PATH_INFO"];
@$dirhandle = opendir( "$directory/thumbs" );
$pic_count = 0;
while( $file = readdir( $dirhandle ) )
{
   if (preg_match("/(gif|jpg|jpeg)$/",$file))
   {
	  $pic_list[$pic_count++] = $file;
   }
}
if ($pic_count==0) return "<p>D&#233;sol&#233;, aucune image disponible pour ce document.</p>";
$output = '';
$page_for_pic = 0;
$pics_per_page = $pics_per_row * $rows_per_page;
if ( ($g_pic >= $pic_count) || (empty($g_pic)) )
   $g_pic = 0;
else
   if ($pics_per_page!=0) $page_for_pic = (int)($g_pic / $pics_per_page);
if ($g_view=="detail") {
   // Display single picture block
   $next = $g_pic + $pic_count + 1; $next %= $pic_count;
   $prev = $g_pic + $pic_count - 1; $prev %= $pic_count;
   $output .= '<div id="EPG_detail_container">';
   if ($nav_detail_top)  {
	  $output .=    '<div id="EPG_text_container1">';
	  $output .=	   '<div id="EPG_text_sub_container1">';
	  $output .=		  '<a id="EPG_prev1" href="'.$path.'?id='.$id.'&g_pic='.$prev.'&g_view=detail"><img src=./assets/images/EPG_prev.gif />Precedente</a>';
	  $output .=		  '<a id="EPG_next1" href="'.$path.'?id='.$id.'&g_pic='.$next.'&g_view=detail">Suivante<img src=./assets/images/EPG_next.gif /></a>';
	  $output .=		  '<a id="EPG_back1" href="'.$path.'?id='.$id.'&g_view=thumbs&g_page='.$page_for_pic.'">[Toutes les Photos]</a>';
	  $output .=	   '</div>';
	  $output .=    '</div>';
   }
   $output .=    '<div id="EPG_image_container">';
   $output .=	   '<img id="EPG_image" src="'.$directory.'/large/'.$pic_list[$g_pic].'"><br />';
   $output .=    '</div>';
   if ($nav_detail_bot)  {
	  $output .=    '<div id="EPG_text_container2">';
	  $output .=	   '<div id="EPG_text_sub_container2">';
	  $output .=		  '<a id="EPG_prev2" href="'.$path.'?id='.$id.'&g_pic='.$prev.'&g_view=detail"><img src=./assets/images/EPG_prev.gif />Precedente</a>';
	  $output .=		  '<a id="EPG_next2" href="'.$path.'?id='.$id.'&g_pic='.$next.'&g_view=detail">Suivante<img src=./assets/images/EPG_next.gif /></a>';
	  $output .=		  '<a id="EPG_back2" href="'.$path.'?id='.$id.'&g_view=thumbs&g_page='.$page_for_pic.'">[Toutes les Photos]</a>';
	  $output .=	   '</div>';
	  $output .=    '</div>';
   }
   $output .= '</div>';
} else {
   // Display thumbnail block
   if ($rows_per_page!=0)
	  $pages = ceil($pic_count/$pics_per_page);
   else
	  $pages = 1;
   $nextpage = $pages + $g_page + 1 ; $nextpage %= $pages;
   $prevpage = $pages + $g_page - 1 ; $prevpage %= $pages;
   $output .= '<div id="EPG_thumbs_container">';
   if ( ($rows_per_page!=0) && ($pic_count>$pics_per_page) && ($nav_thumbs_top) )
   {
	  $output .= '<div id="EPG_prev-next_1">';
$output.= "id".$id;
	  $output .=    '<a id="EPG_prev1" href="'.$path.'?id='.$id.'&g_page='.$prevpage.'&g_view=thumbs"><img src=./assets/images/EPG_prev.gif />Precedente</a>';
	  $output .=    '<a id="EPG_next1" href="'.$path.'?id='.$id.'&g_page='.$nextpage.'&g_view=thumbs">Suivante<img src=./assets/images/EPG_next.gif /></a>';
	  $output .=    '<div id="EPG_pages_container1">';
	  $output .=	   '<div id="EPG_pages_sub_container1">';
	  for ($p=0;$p<$pages;$p++)
		 $output .=	   '<a class="'.($p!=$g_page?"EPG_pages":"EPG_pages_current").'" href="'.$path.'?id='.$id.'&g_page='.$p.'&g_view=thumbs">'.($p+1).'</a>&nbsp';
	  $output .=	   '</div>';
	  $output .=    '</div>';
	  $output .= '</div>';
   }
   $pstart = $g_page*$pics_per_page;
   $pend   = $pstart + $pics_per_page;
   if ($pend>$pic_count) $pend=$pic_count;
   $output .= '<table cellpadding="0" cellspacing="0" id="EPG_thumbs_table"><tr>';
   for ($i=$pstart;$i<$pend;$i++)
   {
	  if ( ($i%$pics_per_row==0) && ($i!=0) ) $output .= '</tr><tr>';
	  $output .= '<td style="width:'.(100/$pics_per_row).'%;">';
	  $output .= '<a align="center" href="'.$path.'?id='.$id.'&g_pic='.$i.'&g_view=detail"><img src="./'.$directory.'/thumbs/'.$pic_list[$i].'"/></a>';
	  $output .= '</td>';
   }
   $output .= '</tr></table>';
   if ( ($rows_per_page!=0) && ($pic_count>$pics_per_page) && ($nav_thumbs_bot) )
   {
	  $output .= '<div id="EPG_prev-next_2">';
	  $output .=    '<a id="EPG_prev2" href="'.$path.'?id='.$id.'&g_page='.$prevpage.'&g_view=thumbs"><img src=./assets/images/EPG_prev.gif />Precedente</a>';
	  $output .=    '<a id="EPG_next2" href="'.$path.'?id='.$id.'&g_page='.$nextpage.'&g_view=thumbs">Suivante<img src=./assets/images/EPG_next.gif /></a>';
	  $output .=    '<div id="EPG_pages_container2">';
	  $output .=	   '<div id="EPG_pages_sub_container2">';
	  for ($p=0;$p<$pages;$p++)
		 $output .=	   '<a class="'.($p!=$g_page?"EPG_pages":"EPG_pages_current").'" href="'.$path.'?id='.$id.'&g_page='.$p.'&g_view=thumbs">'.($p+1).'</a>&nbsp';
	  $output .=	   '</div>';
	  $output .=    '</div>';
	  $output .= '</div>';
   }
   $output .= '</div>';
}
} else {
   $output ="R&#233;pertoire du diaporama inexistant";
}
return $output;






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users