Jump to content


Etogalgallery Snippet (now beta 2)


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

#1 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 30 April 2006 - 12:34 PM

Added to the download area is a preliminary beta for the EtoGalGallery snippet.

This uses the same approach as the etoGalThumb snippet for building output, but extends this to add the option of a full size display of one image. Work on converting this from my personal snippet (used for example in my floral gallery) to a more generic form is more complex than I thought, so this is more a demonstrator than the finished article, but feel free to download and try.

It includes two styles - style 1 is relatively simple, and will (I hope) work in most cases; style 'efikim' is roughly what I use (without some fancy URL generation) but is unlikely to work well for other installations (my image sizes are not the etogal default, and I use a fixed width page design that this fits into).

Important differences from etogalThumb:
the 'link' parameter is not used
'style' defaults to 1
if neither img nor gal are defined, gal is set to the document id.

At its simplest, just add the snippet to a page on which the etoGal11b2 snippet is installed, making sure that display=none is one of the parameters for the EtoGal11b2 snippet.

demos at style=1 and style=efikim


Suggestions for other display styles you'd like are welcome - this doesn't mean I'll write the styles, but t least I can consider what extra options I might need to add to the code to make them feaasible.

Edited by mikef, 30 April 2006 - 01:23 PM.


#2 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 11 May 2006 - 04:07 PM

Beta 2 is now available in the downloads, making several changes (improvements, I hope!), mainly in the thumbnails section.

Firstly, it now uses the same core code as EtoGalThumb for consistency, so you don't need to learn two different sets of replaceable strings and snippet parameters. There are some minor differences in defaullts though:
  • if no style is specified, the default is 0 (the same as EGThumb, not EGGallery beta 1)
  • if neither gal nor img are specified, gal defaults to the current page (rather than selecting every image)
  • count defaults to 9999 rather than 1 (one makes much less sense in this case!)
  • order_by defaults to 'gal_id,id' which will be correct in the majority of cases. Random makes no sense.
  • link is forced to the current page
  • addback is not used
In addition, one parameter is passed in the URL, pic, which specifies which image is shown as the main image.

Demos of its use are online at subpages of the EToGalGalleryPage on the Etogal test site.

This version is feature complete, and is not expected to change except for bug fixes.

#3 gp_etomite

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 13 May 2006 - 01:19 PM

mikef, on May 11 2006, 06:07 PM, said:

Beta 2 is now available in the downloads, making several changes (improvements, I hope!), mainly in the thumbnails section.


This version is feature complete, and is not expected to change except for bug fixes.

Hi Mike, can you write a simple installation guide?

Thanks!

gp

#4 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 13 May 2006 - 01:47 PM

gp_etomite, on May 13 2006, 02:19 PM, said:

Hi Mike, can you write a simple installation guide?

Thanks!

gp

first, read http://www.etomite.com/index.php?showtopic=4900
second, install EtoGal, described here.

get EtoGal working first

third install the EtoGalGallery snippet

The easiest way to use the EtoGalGallery snippet to start with is to use it on the same page as EtoGal is installed, making sure that the Etogal snippet display parameter is set to 'none' (ie called as [[EtoGal?display=none]]. The EtoGalGallery page on the etogal test site has links to pages showing some snippet calls and results where a different gallery page is used

Snippets are intalled using the Etomite mananger's resource manager, copying the contents of the files here into the snippet editor.

I hope that helps ...

#5 gp_etomite

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 13 May 2006 - 10:53 PM

mikef, on May 13 2006, 03:47 PM, said:

get EtoGal working first

third install the EtoGalGallery snippet

The easiest way to use the EtoGalGallery snippet to start with is to use it on the same page as EtoGal is installed, making sure that the Etogal snippet display parameter is set to 'none' (ie called as [[EtoGal?display=none]]. The EtoGalGallery page on the etogal test site has links to pages showing some snippet calls and results where a different gallery page is used

Mike, thanks a lot! I got the Etogal working now:
http://eto.marinersq.com/index.php?id=64

By the way, you said the Authenticate_visitor ispreferrable howver I couldn't get it work. I didn't change anyting in the snippet at all.

So in the above page, I inserted below parameters and it works.
[[EtoGal]]
[[EtomiteLoginOut?id=64!]

but what exactly do I do with "making sure that the Etogal snippet display parameter is set to 'none' (ie called as [[EtoGal?display=none]]" to make the EtoGal Gallery work

I tried below parameter on another page:
[[EtoGal?display=none]]
[[EtoGallery]]
[[EtomiteLoginOut?id=66!]

it's not working. http://eto.marinersq.com/index.php?id=66

Another question, since I will need many galleries showcasing products on their own pages, I understand I will have to have the EtomiteLoginOut set on a new page, when I do so, what ID should I put in the parameter so that I am able to login, manage/upload images to different galleries.
Sorry if this sounds a silly question.

I see I can manage galleries by setting up pages this way:
[[EtoGal]]
[[EtomiteLoginOut?id=64!]
http://eto.marinersq.com/index.php?id=64
and

[[EtoGal]]
[[EtomiteLoginOut?id=65!]
http://eto.marinersq.com/index.php?id=65

But I do no think this is the correct way to manage galleries.

Your help is greatly appreciated!

gb

#6 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 13 May 2006 - 11:21 PM

Glad you got the basic paart working at least!

gp_etomite, on May 13 2006, 11:53 PM, said:

I tried below parameter on another  page:
[[EtoGal?display=none]]
[[EtoGallery]]
[[EtomiteLoginOut?id=66!]
it's not working.  http://eto.marinersq.com/index.php?id=66
My guess is you haven't used the same name for the EtoGalGallery snippet when you installed it and on the page (probably should be EtoGalGallery on the page?) Note that the case must be right too. There's no sign of any of any HTML output from the EtoGalGallery snippet on the page.

Quote

Another question, since I will need many galleries showcasing products on their own pages, I understand I will have to have the EtomiteLoginOut set on a new page, when I do so, what ID should I put in the parameter so that I am able to login, manage/upload images to  different galleries.
Sorry if this sounds a silly question.

I see I can manage galleries by setting up pages this way:
[[EtoGal]]
[[EtomiteLoginOut?id=64!]
http://eto.marinersq.com/index.php?id=64
and

[[EtoGal]]
[[EtomiteLoginOut?id=65!]
http://eto.marinersq.com/index.php?id=65
Exactly how you handle login is your choice, and will vary depending on who you want to be able to login, and what pages they have write access to. Having said that, here's what I do:
On the lowermosswood site, I put the login snippet on a page in the repository, with a non-obvious alias (definitely NOT 'login'), and put that pages id as the destination parameter too. I have another snippet on that page that detects the id of the person who has logged in, and gives them a list of links back to the pages they have rights to edit. I think that's a good general approach when you have a few updaters, as you don't really want the login prompt appearing on the public pages unless a large number of visitors are going to have a legitimate reason to login.
I use a similar approach on the efikim site, though only I use it.

I would suggest posting in the authenticate_visitors thread about your problems using it, though, as the Etomite_LoginOut snippet lacks some features, and had a few 'quirks' (and is probably not really supported).

Edited by mikef, 13 May 2006 - 11:24 PM.


#7 gp_etomite

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 14 May 2006 - 03:37 AM

mikef, on May 14 2006, 01:21 AM, said:

On the lowermosswood site, I put the login snippet on a page in the repository, with a non-obvious alias (definitely NOT 'login'), and put that pages id as the destination parameter too. I have another snippet on that page that detects the id of the person who has logged in, and gives them a list of links back to the pages they have rights to edit. I think that's a good general approach when you have a few updaters, as you don't really want the login prompt appearing on the public pages unless a large number of visitors are going to have a legitimate reason to login.

Which snippet you use in conjuction with authenticate login?
Forgive my ignorant, I am still trying to figure how it work, do you mind to give a brief step by steup insturction?

mikef, on May 14 2006, 01:21 AM, said:

I would suggest posting in the authenticate_visitors thread about your problems using it, though, as the Etomite_LoginOut snippet lacks some features, and had a few 'quirks' (and is probably not really supported).

YAY! finally got it working. I don't know what I did wrong before. Tried re-downloading the snippet and it just works

Many thanks!

gp

#8 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 14 May 2006 - 11:08 AM

gp_etomite, on May 14 2006, 04:37 AM, said:

Which snippet you use in conjuction with authenticate login?
Forgive my ignorant,  I am still trying to figure how it work, do you mind to give a brief step by steup insturction?
For sites that are still using an early release candidate of Etomite 0.6.1 I use a modified form of EtomiteLoginOut. Once upgraded this will be replaced with authenticate_visitors.
The snippet to output the links to pages that are available is written specifically for that site, and would need to be redone for any other site. It looks something like this:
$userdetails=$etomite->userLoggedIn();
if($userdetails['id']) {
// someone is logged on
  $output=
"<br />The following pages are available for you:<br />
<h2>Enter News Items</h2>";
<a href='[~197~]' target='_blank'>Enter Wildlife Hospital News</a> <br />
<a href='[~198~]' target='_blank'>Enter Nature Reserve News</a><br />
<a href='[~199~]' target='_blank'>Enter Friends' News</a><br />
<br />I'll add the fundraising news pages to this list later, but this is already 'live'.<br />
<h2>Upload Images</h2>At the moment this is just a play area for you to see how the galleries work. These images won't appear on the site (unless I decide to move any of them to one of the real galleries). Please do add titles and descriptions, though.<br />
<a href='[~200~]' target='_blank'>Images playground</a><br />
if($_SESSION['shortname']=="fred") {
<h2>Just for fred</h2>
<a href='[~201~]' target='_blank'>Wildlife Hospital</a><br />
<a href='[~202~]' target='_blank'>Rehome animals</a><br />
<a href='[~203~]' target='_blank'>Sponsor our resident animals</a><br />
";
}

} else {
  $output="<br />Access for staff and authorised volunteers only<br />";
}
return $output;  

Have you checked yet that you have used exactly the same name for the EtoGalGallery snippet both when you saved it and when it is called from the page? It still looks as if you haven't, as there is nothing in the HTML from the EtoGalGallery snippet.

#9 gp_etomite

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 14 May 2006 - 03:44 PM

mikef, on May 14 2006, 01:08 PM, said:

For sites that are still using an early release candidate of Etomite 0.6.1 I use a modified form of EtomiteLoginOut. Once upgraded this will be replaced with authenticate_visitors.
The snippet to output the links to pages that are available is written specifically for that site, and would need to be redone for any other site. It looks something like this:
$userdetails=$etomite->userLoggedIn();
if($userdetails['id']) {
// someone is logged on
  $output=
"<br />The following pages are available for you:<br />
<h2>Enter News Items</h2>";
<a href='[~197~]' target='_blank'>Enter Wildlife Hospital News</a> <br />
<

Hi Mike, thank you again!!!!
Do you mind if I adapte  above snippet for the site I was building?

Quote

Have you checked yet that you have used exactly the same name for the EtoGalGallery snippet both when you saved it and when it is called from the page? It still looks as if you haven't, as there is nothing in the HTML from the EtoGalGallery snippet.

The authenticate visitor does work. I have it placed in the Repository folder for the time.
You can see it here:
http://eto.marinersq.com/index.php?id=113

Now I need to try to make the EtoGallery works, which I haven't a clue yet :unsure:

#10 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 14 May 2006 - 04:31 PM

You're welcome to use the code I posted. There aren't many other examples of using the logged-in user information published yet!

gp_etomite, on May 14 2006, 04:44 PM, said:

Now I need to try to make the EtoGallery works, which I haven't a clue yet  :unsure:
There was a hint in the section you quoted!

I called the snippet EtoGalGallery while you're referring to it as EtoGallery.
Are you sure you haven't given it one name when you created the snippet using the resource manager, and the other when you tried to call it from your page?

#11 gp_etomite

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 15 May 2006 - 03:36 AM

mikef, on May 14 2006, 06:31 PM, said:

There was a hint in the section you quoted!

I called the snippet EtoGalGallery while you're referring to it as EtoGallery.
Are you sure you haven't given it one name when you created the snippet using the resource manager, and the other when you tried to call it from your page?

Hi Mike, sorry for the confusing. I had the setup correct and the page was unpublished in the Repository folder It's just when I replied, my mind kept thinking "Etogallery".

So this is a working page and I presume it functions correctly!
This are the parameters:
[[EtoGal?display=none]]
[[EtoGalGallery]]

and the pages are here:
http://eto.marinersq.com/index.php?id=65,
and #id 64.

When I wrote I need to make 'etogallery' works, what I actually meant was to adapt your 'I have another snippet on that page that detects the id of the person who has logged in, and gives them a list of links back to the pages they have rights to edit."

This site will have over 60 pages (based on the old site) product gallery, there will be more pages to be added but my role is to setup the site properly and that it function well, so that someone in the company will do the update in the future, therefor it is important to have a page set up that links to all photo galleries with in the site.

Is the snippet you posted yesterday in the messsage the complete one? Somthing I can adapt to my need?

Thanks you again for your generous help

gp

#12 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 15 May 2006 - 09:21 AM

gp_etomite, on May 15 2006, 04:36 AM, said:

This site will have over 60 pages (based on the old site) product gallery, there will be more pages to be added but my role is to setup the site properly and that it function well, so that someone in the company will do the update in the future, therefor it is important to have a page set up that links to all photo galleries with in the site.

Is the snippet you posted yesterday in the messsage the complete one? Somthing I can adapt to my need?

Thanks you again for your generous help

gp
That snippet is all I have; it may not cover everything you need.

Glad to see you've got EtoGalGallery working!

#13 gp_etomite

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 16 May 2006 - 09:48 AM

mikef, on May 15 2006, 11:21 AM, said:

Glad to see you've got EtoGalGallery working!

Well, not quite :(

I just found out, I must be doing something wrong, or maybe something wrong with the snippet ( :rolleyes: )

First I tried adding images to other pages, it shows me this:
http://eto.marinersq.com/index.php?id=117

Further testing shows that the reason the id#64 and #65 are working because they were setup this way:

First placing below parameters to the page:
[!EtoGal!]
[[EtomiteLoginOut?id=118]]

saved the page, login , add image(s)

then replace above parameters to
[[EtoGal?display=none]]
[[EtoGalGallery]]

Any idea?

By the way, on this page, on forth and sixth row break.
http://eto.marinersq.com/index.php?id=59&pic=25
I couldn't find anything wrong in the snippet.

gp





Without the above setup, it shows this error:
http://eto.marinersq.com/index.php?id=58

#14 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 16 May 2006 - 10:45 AM

to have any chance of working out what is wrong, I need to know exactly what you've done to try adding images to other pages, and exactly what is (and was) on the pages that give an error.

The errors imply either that the file isn't there, is corrupt, or is the wrong format.

#15 gp_etomite

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 16 May 2006 - 11:30 AM

mikef, on May 16 2006, 12:45 PM, said:

to have any chance of working out what is wrong, I need to know exactly what you've done to try adding images to other pages, and exactly what is (and was) on the pages that give an error.

The errors imply either that the file isn't there, is corrupt, or is the wrong format.

I didn't do anything special. That two working pages were the result from the suggestion you made: get the Etogal working first. After I installed the authentication and EtoGalGallery snippets, I simply replaced the parameters to:
[[EtoGal?display=none]]
[[EtoGalGallery]]


Today I tried adding images (with above parameter added) to other pages which were added few days ago, but didn't test on EtoGal before, immediately it shows me the error message. I also tried adding a new untitled page (id#117) and it shows the same error message too. Page #59 (Aluminium Chair) was the result from new testing of following steps

first
[!EtoGal!]
[[EtomiteLoginOut?id=118]]

saved the page, login , add image(s)

then replace above parameters to
[[EtoGal?display=none]]
[[EtoGalGallery]]


If you are really curious, I can send you my login info, so that you can test it in person.

gp

#16 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 16 May 2006 - 11:58 AM

gp_etomite, on May 16 2006, 12:30 PM, said:

Today I tried adding images (with above parameter added)  to other pages which were added few days ago, but didn't test on EtoGal before, immediately it shows me the error message.
How are you trying to add images? You need EtoGal to do this.
Do you get the error message if you are logged in?
Do you get the error message if you are not logged in?

I haven't yet managed to duplicate the problem, despite trying deliberately to break it.

I have to go out now, but will have another look when I get back (4-5 hours from now)

#17 gp_etomite

    Etomite Forum Newbie

  • Member
  • 43 posts

Posted 16 May 2006 - 12:22 PM

mikef, on May 16 2006, 01:58 PM, said:

How are you trying to add images? You need EtoGal to do this.
Do you get the error message if you are logged in?
Do you get the error message if you are not logged in?

As soon as I added the
[[EtoGal?display=none]]
[[EtoGalGallery]]
and click save, it immediately gives me the error message from the preview in th manager, I didn't even try to launch the page.

You said I need EtoGal to add the images, exactly what it means? Yes I got the gallery working by install the EtoGal first and it's still working fine with the [[EtoGal]] in the page.

gp

#18 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 16 May 2006 - 04:53 PM

gp_etomite, on May 16 2006, 01:22 PM, said:

As soon as I added the
[[EtoGal?display=none]]
[[EtoGalGallery]]
and click save, it immediately gives me the error message from the preview in th manager, I didn't even try to launch the page.
I've tried creating pages with the above, and can't duplicate the problem, whether or not I am logged in to my site on the client side as well as the manager. If you want me to have a look at your site, can you PM me login details, please?

#19 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 16 May 2006 - 05:46 PM

gp_etomite, on May 16 2006, 10:48 AM, said:

By the way, on this page, on forth and sixth row break.
http://eto.marinersq.com/index.php?id=59&pic=25
I couldn't find anything wrong in the snippet.

Will be fixed in the next release :)

#20 mikef

    Loves Etomite Forums!

  • Member
  • PipPipPipPip
  • 1,551 posts

Posted 17 May 2006 - 11:29 AM

gp_etomite, on May 16 2006, 01:22 PM, said:

As soon as I added the
[[EtoGal?display=none]]
[[EtoGalGallery]]
and click save, it immediately gives me the error message from the preview in th manager, I didn't even try to launch the page.
gp
The next release will have a fix for this (which is caused by gp's server PHP configuration being more strict than mine). If anyone else is having this problem, either:
- temporarily remove the EtoGalGallery snippet call from the page, add an imge to the gallery for that page and reinstate the EtoGalGallery snippet
- or PM me for a patched version.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users