[Snippet] EtogalExtenderSuiteV1(beta)
#1
Posted 12 July 2007 - 12:56 PM
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
Posted 19 July 2007 - 05:06 AM
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.
Edited by Cris D., 19 July 2007 - 09:34 AM.
#3
Posted 25 October 2007 - 09:21 PM
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
Posted 15 September 2008 - 11:13 PM
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
Posted 15 September 2008 - 11:47 PM
Edited by mikef, 16 September 2008 - 12:02 AM.
#6
Posted 16 September 2008 - 02:13 AM
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
Posted 16 September 2008 - 07:27 AM
By the way... love your collection of integrations you are creating! Awsome job darren!
Edited by Cris D., 16 September 2008 - 07:55 AM.
#8
Posted 16 September 2008 - 08:02 PM
By the way... love your collection of integrations you are creating! Awsome job darren!
thank you
you are correct, it was easier to use getimagesize to obtain the w/h...
#11
Posted 12 March 2009 - 07:15 AM
I have installed the Extender but i recive at error.
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
Posted 12 March 2009 - 08:43 AM
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
Posted 12 March 2009 - 02:13 PM
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
Posted 12 March 2009 - 03:01 PM
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.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),";
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
Posted 12 March 2009 - 07:18 PM
Also, are you on a hosted server or running in localhost mode on a WAMP server...???
#16
Posted 12 March 2009 - 09:02 PM
The first one is pointing to table etomite_etogal_shop_01 and the second is etomite_etogal_egExtender
The first's columns are: Color, Price, lable3, lable4, lable5, lable6 the second is lable1, lable2, lable3, lable4, lable5, lable6 So I'm guessing your snippet call has also changes from the first to the second.
It is too hard to diagnose when so many changes are being made at once, and if it then works, no-one knows what it was that fixed it. Errors like this can be caused by a single stray comma or missing space etc, so detail is important.
As Ralph asked earlier... Is this an etomite error message?
#17
Posted 13 March 2009 - 01:56 AM
Since my first post I have changed the call back to using the default table (egExtender) and the default labels. In my first try i made some changes, but since that didn't work I changed every thing back to default. (as found in the example)
I have not made any changes to the script at all. In the call I have removed "tableName=your_table_name". I have looked in SQL database for the tabels but I found neighter etomite_etogal_shop_01 or etomite_etogal_egExtender
In the database I found a table named etomite_etogal, so I guess that the EtoGal is working fine. (I know it is)
My call
[!EGextender?colnames=lable1,lable2,lable3,lable4,lable5,lable6!]
This is the full error massage when I am Loged in.
« Error »
Etomite encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed »
SQL: 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;
And the error massage when I am not Loged in.
« Error »
Etomite encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed »
SQL: SELECT * FROM `web297763`.etomite_etogal_egExtender WHERE id=1 ;
#18
Posted 13 March 2009 - 07:55 AM
1) Please provide your stats for:
php version,
SQL version,
PHPMyAdmin version,
Etomite version
Server type
2) Please attempt to create the table by copying and pasting the following code directly into your database:
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;and let me know if it was successfully created. If not, what was the error? This will determine whether it is a database issue or an etomite issue.
#19
Posted 13 March 2009 - 01:31 PM
#20
Posted 14 March 2009 - 01:50 PM
I really appreciate your help, Thanks.
1)
php version, 5.2.6
SQL version, Client API version - 5.0.51a
PHPMyAdmin version, 2.11.7.1
Etomite version, 1.1 Prelude
Server type, Apache 2.0 Handler
2)
I managed to run the SQL code as you suggested. It was a success. ;-)
Now it looks like that the Extender is working to some extension. (the default labels are not very useful)
I have trouble with the “manage file” function in Etomite. (but that I will fix later, I hope)
I have just installed PoMMo in a sub dir on the same server and the table creation went well. But I was running php in safe mode and I had to manually create the dir for PoMMo installation.
I don’t know if there is any relation between this and the SQL error.
Thomas N
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











