Etomite Community Forums: [Snippet] EtogalExtenderSuiteV1(beta) - Etomite Community Forums

Jump to content

Read Me

This forum is posted in automatically when a snippet is added to the library, or updated. Please use the snippet topic to discuss that snippet.
  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

[Snippet] EtogalExtenderSuiteV1(beta)

#1 User is offline   Cris D. 

  • Loves Etomite Forums!
  • PipPipPipPip
  • Group: Member
  • Posts: 1,076
  • Joined: 10-August 06
  • Gender:Not Telling

Posted 12 July 2007 - 12:56 PM

File Name: EtogalExtenderSuiteV1(beta)
File Submitter: Cris D.
File Submitted: 12 Jul 2007
File Updated: 19 Jul 2007
File Category: Images & Galleries

//Snippet EtogalExtender 1.3
//By Cris D. 12/7/07
//Use: When placed in the same page as etogal, it creates and shows additional fields displayed on the same page as an etogal //image.
//A new table can be added for each etogal gallery or use the default table name for all galleries.
//Table names and unlimited column names are added via the snippet call like this:
//[!EGextender?tableName=your_table_name&colnames=lable1,lable2,lable3,lable4,lable5,lable6!]
//If the default table is used, THE COLNAMES MUST BE IDENTICAL for each use of the snippet.
//Otherwise, a different table name and unique colnames can be set for every etogal gallery.
//Style used for the presentation of the additional info for the CSS: <table style="eg_addon">
//Future development: compare etogal and tableName to delete tableName rows that correspond to deleted etogal rows

##################### Snippet Configuration Here #######################

$etoPrefix="etomite_";//set this to the prefix of your etomite installation
$etogal=$etoPrefix."etogal";//set this to the name of your etogal installation
$defaultTableName="egExtender";//set the default table name here (optional)
$colan=" : ";//set this to the preferred divider between the field lable and the data,
//remove if just the etogal title and description are required.
//The rest happens from the snippet call: set the additional table names and colnames (as described above).

This snippet does the following:
For surfers, it just shows the additional data entered like EGPicInfo.

For Admin, once logged in, and zoomed to a single etogal picture, a new table and form is created that allows you to enter the data for surfers to see.

You can also use etogal in the normal way and edit the title and description and upload and delete pictures via the "Manage Pictures" button.

The snippet is well commented for customisation.

Instructions: 1) Install and populate Etogal. 2) Download this snippet and save it in your snippet library. 3) Call the snippet in the same page as etogal (include your tableName(optional) and colnames (required) parameters). That's it!

The snippet counts the number of colnames you put in the snippet call and automatically creates the table fields and form fields to enter and store the data.
CHANGELOG:
14/7/07 Changed the authentication method to make it more secure.
Updated file to fix a typo //(to comment out a comment regarding the changelog!).

Click here to download this file

#2 User is offline   Cris D. 

  • Loves Etomite Forums!
  • PipPipPipPip
  • Group: Member
  • Posts: 1,076
  • Joined: 10-August 06
  • Gender:Not Telling

Posted 19 July 2007 - 05:06 AM

Please note: If you download and install this snippet and get the error:

Quote

Parse error: syntax error, unexpected ':' in /home/www/your_site.com/index.php(506) : eval()'d code on line 11


I have re-uploaded the snippet twice but for some reason, the old snip is being returned with the typo. Just change the snippet line 11
CHANGELOG:14/7/07 Changed the authentication code to make it more secure.

to
//CHANGELOG:14/7/07 Changed the authentication code to make it more secure.

note the added "//".

Now I know this is simple, but could cause frustration for some if they new nothing :)

Note: It is relatively easy to change the table-based output to div-based output which means you can control the positioning of the add-on fields fairly easily.

Also, the default table column type is varchar 100, once the table has been created, you could change the column type with phpMyAdmin and keep the column name the same before you start entering data. This would be good to include things like timestamps, urls, binary etc. (some modifications may have to be made to the entry form and data handling section of the snippet).

For a live sample, fields beside the picture or fields above the picture. Be aware that you can not see the manager's form, just what the browsers see.

This post has been edited by Cris D.: 19 July 2007 - 09:34 AM


#3 User is offline   cathode 

  • Etomite Staff
  • Group: Staff
  • Posts: 654
  • Joined: 21-November 05
  • Location:Indiana, U.S.

Posted 25 October 2007 - 09:21 PM

Cris,
I finally tried this snippet- it works great and really opens up EtoGal to a wide variety of uses. Home listings, for instance would be simple now.

#4 User is offline   darren 

  • Likes Etomite Forums!
  • PipPip
  • Group: Member
  • Posts: 251
  • Joined: 23-May 07
  • Gender:Male
  • Location:Williams Bay
  • Interests:My Kids
    Flyfishing
    4-Wheeling
    Web Design

Posted 15 September 2008 - 11:13 PM

Cris,
could this be used to add and manage columns on the etomite_etogal table or does it have to be a new table. I just need to save height and width for each image so it's available in a snippet... either by hand or maybe on the fly, i don't know yet.

thanks,

#5 User is offline   mikef 

  • Loves Etomite Forums!
  • PipPipPipPip
  • Group: Member
  • Posts: 1,549
  • Joined: 30-August 05
  • Gender:Male
  • Location:Cheshire, UK
  • Interests:Photography, Gardening for Wildlife

Posted 15 September 2008 - 11:47 PM

Darren, if you're going to do a lot of these you might want to look at using styles in the EtoGalThumbs snippet, as it picks up width and height from the image files, and allows some flexibility in selecting which images/galleries to use. Its not just for putting thumbnails onto pages (though thats how it started). There's an example of generating an RSS feed with it, and one for the thickbox slideshow (or one of the similar slideshows), either in the code or the etogal subforum.

This post has been edited by mikef: 16 September 2008 - 12:02 AM


#6 User is offline   darren 

  • Likes Etomite Forums!
  • PipPip
  • Group: Member
  • Posts: 251
  • Joined: 23-May 07
  • Gender:Male
  • Location:Williams Bay
  • Interests:My Kids
    Flyfishing
    4-Wheeling
    Web Design

Posted 16 September 2008 - 02:13 AM

I like that snippet for some applications, even got a mootools scrolling thumbnail div integrated into it for a site. I'm just trying to get a batch of flash/etoGal integrations to have in my back pocket. This one in particular requires height and width to be set in the xml list so i'm just trying to see how that's going to work.

being able to present a flash photo gallery that a non-techical user can create and modify would, in my case, 'catch me up with the competition' so to speak. whether or not it is 'better' to use flash is another argument entirely :)

You and Cris have done an awesome job developing and extending etoGal, it's opened another dimension to what we can do with etomite. Thanks!

#7 User is offline   Cris D. 

  • Loves Etomite Forums!
  • PipPipPipPip
  • Group: Member
  • Posts: 1,076
  • Joined: 10-August 06
  • Gender:Not Telling

Posted 16 September 2008 - 07:27 AM

This stores data in a separate table, but they are cross-refrenced so the info is pulled from table 1 (etogal) and also from the corresponding row in table 2 (etogal_extender). It has it's limitations- I have not written a delete coresponding row code when an etogal image is deleted... Having said that, I think php would be a much better option for pulling image dimensions out to use as there are built-in php functions for this. [edit] To use this, you will have to look at building arrays for use in the XML code and looping through the results. etogal_multigals creates a simple array which can be extended with php code to add image width and height fields as well as mike f's etogalThumbs, but you could easily write your own using getIntTableRows and adding it to your XML snippet. [/edit]

By the way... love your collection of integrations you are creating! Awsome job darren!

This post has been edited by Cris D.: 16 September 2008 - 07:55 AM


#8 User is offline   darren 

  • Likes Etomite Forums!
  • PipPip
  • Group: Member
  • Posts: 251
  • Joined: 23-May 07
  • Gender:Male
  • Location:Williams Bay
  • Interests:My Kids
    Flyfishing
    4-Wheeling
    Web Design

Posted 16 September 2008 - 08:02 PM

View PostCris D., on Sep 16 2008, 01:27 AM, said:

By the way... love your collection of integrations you are creating! Awsome job darren!


thank you :D
you are correct, it was easier to use getimagesize to obtain the w/h...

#9 User is offline   cathode 

  • Etomite Staff
  • Group: Staff
  • Posts: 654
  • Joined: 21-November 05
  • Location:Indiana, U.S.

Posted 17 September 2008 - 02:00 AM

View Postdarren, on Sep 16 2008, 04:02 PM, said:

thank you :D
you are correct, it was easier to use getimagesize to obtain the w/h...


Looking great, fantastic work! Have you thought about converting some non-flash viewers, such as ibox?

#10 User is offline   darren 

  • Likes Etomite Forums!
  • PipPip
  • Group: Member
  • Posts: 251
  • Joined: 23-May 07
  • Gender:Male
  • Location:Williams Bay
  • Interests:My Kids
    Flyfishing
    4-Wheeling
    Web Design

Posted 17 September 2008 - 07:11 PM

View Postcathode, on Sep 16 2008, 08:00 PM, said:

Looking great, fantastic work! Have you thought about converting some non-flash viewers, such as ibox?


I'm working on something similar to that next, (lightbox slideshow) however i do have to 'work' every once in a while. :lol:

#11 User is offline   doolB 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 15
  • Joined: 30-August 07

Posted 12 March 2009 - 07:15 AM

Hi

I have installed the Extender but i recive at error.

Quote

CREATE TABLE`etomite_etogal_shop_01`(`ai` INT(100) NOT NULL AUTO_INCREMENT,`id` INT(100) NOT NULL,Colour VARCHAR (100),Price VARCHAR (100),lable3 VARCHAR (100),lable4 VARCHAR (100),lable5 VARCHAR (100),lable6 VARCHAR (100),PRIMARY KEY (`ai`),UNIQUE (`id`)) TYPE=myisam;


I don't know alot about SQL so I don't know where to start the debugging.

Can someone please help

Thanks
Thomas

#12 User is offline   Cris D. 

  • Loves Etomite Forums!
  • PipPipPipPip
  • Group: Member
  • Posts: 1,076
  • Joined: 10-August 06
  • Gender:Not Telling

Posted 12 March 2009 - 08:43 AM

It is a bit difficult to determine what is wrong with this with just the SQL error, the implementation is more important. Please answer:
1) Do you already have etogal installed and populated with images?
2) Are you placing this on the same page that has etogal added via a separate snippet?
3) Have you successfully added this to other pages yet?
4) Have you changed any of the table names for etogal or this snippet?
5) Please provide the snippet call you are using to attempt to add this to the page.

I do know that if you use a table name in the snippet call and attempt to re-use the same name with different columns it with new columns, you will get an error. It has been a long time since I have used this code and it amazes me when I look at it how amaturish the formatting and use of variables is... a bit of a walk down memory lane. But is should work.

The only other item that looks odd is the loss of back-ticks, you could also try changing line 70:
$sql.=$n." VARCHAR (100),";

with this:
$sql.="`".$n."` VARCHAR (100),";


#13 User is offline   Ralph 

  • Etomite Administrator
  • Group: Admin
  • Posts: 6,418
  • Joined: 01-July 04
  • Gender:Male
  • Location:Jamestown, NY USA
  • Interests:Computers, Camping, Hiking, Aviation

Posted 12 March 2009 - 02:13 PM

doolB, you posted the SQL statement but not the actual error message... What was the message itself...???

EDIT: After looking at the query it appears that some of the field/column names are not nested within backticks... While both with and without all of them having backticks works in my phpMyAdmin it may not work on all servers when sent via PHP/MySQL script...

#14 User is offline   doolB 

  • Etomite Forum Newbie
  • Group: Member
  • Posts: 15
  • Joined: 30-August 07

Posted 12 March 2009 - 03:01 PM

View PostCris D., on Mar 12 2009, 10:43 AM, said:

It is a bit difficult to determine what is wrong with this with just the SQL error, the implementation is more important. Please answer:
1) Do you already have etogal installed and populated with images?
2) Are you placing this on the same page that has etogal added via a separate snippet?
3) Have you successfully added this to other pages yet?
4) Have you changed any of the table names for etogal or this snippet?
5) Please provide the snippet call you are using to attempt to add this to the page.

I do know that if you use a table name in the snippet call and attempt to re-use the same name with different columns it with new columns, you will get an error. It has been a long time since I have used this code and it amazes me when I look at it how amaturish the formatting and use of variables is... a bit of a walk down memory lane. But is should work.

The only other item that looks odd is the loss of back-ticks, you could also try changing line 70:
$sql.=$n." VARCHAR (100),";


with this:
$sql.="`".$n."` VARCHAR (100),";

Thanks for using your time to help me with this. This codes are almost 2 years old, I guess that it takes a bit of digging. hehe.

For your quistions....
1) Yes
2) Yes
3) No
4) No
5) [!EGextender?colnames=lable1,lable2,lable3,lable4,lable5,lable6!]

I have made the change to line 70 and now I get this.
CREATE TABLE`etomite_etogal_egExtender`(`ai` INT(100) NOT NULL AUTO_INCREMENT,`id` INT(100) NOT NULL,`lable1` VARCHAR (100),`lable2` VARCHAR (100),`lable3` VARCHAR (100),`lable4` VARCHAR (100),`lable5` VARCHAR (100),`lable6` VARCHAR (100),PRIMARY KEY (`ai`),UNIQUE (`id`)) TYPE=myisam;

Thomas

#15 User is offline   Ralph 

  • Etomite Administrator
  • Group: Admin
  • Posts: 6,418
  • Joined: 01-July 04
  • Gender:Male
  • Location:Jamestown, NY USA
  • Interests:Computers, Camping, Hiking, Aviation

Posted 12 March 2009 - 07:18 PM

doolB, are you actually getting a MySQL error or just the query string...??? Either Etomite, PHP, or MySQL is going to throw an error if one is encountered...

Also, are you on a hosted server or running in localhost mode on a WAMP server...???

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users