Canon Digital Photography Forums  

P.O.T.N. SUPPORT SHOP IS OPEN, check it out now!

Go Back   Canon Digital Photography Forums > Exhibit Engine > EE 2 Bugs
Register Rules FAQ Members List Search Today's Posts Mark Forums Read



Reply
 
Thread Tools Display Modes
Old 4th of October 2006 (Wed)   #1
gillyworld
Member
 
gillyworld's Avatar
 
Join Date: Jul 2003
Location: Bracknell UK
Posts: 246
Default snippets not working in EE2.0?

I use snippets in my home page which now doesn't work. I cant even get the snippetdemo.php to work. Heres what I get from snippetdemo

Exhibit Engine SNIPPETS demo


IMPORTANT SECURITY NOTE ABOUT SNIPPETS:
Depending on how your PHP was installed, snippets can be called from external sites, too. If you want to prohibit that, or restrict snippets to specific site(s), insert the line

if (trim($_SERVER["REMOTE_ADDR"]) != "127.0.0.1") { print "ip "; print $_SERVER["REMOTE_ADDR"] . " not allowed."; exit; }

(where 127.0.0.1 is the IP you want to allow, e.g. your server's real IP) to the beginning of the snippets.php after first <?php line . To allow several IP's, reuse that line of code.

NOTE that this method is not a foolproof because experienced hackers can forge IPs. If you need to ensure that snippets can not be called at all (for sake of resource usage and bandwidth), delete snippets.php from EE folder. If you want to ensure that only you can call the snippets, rename snippets.php to something that you know, e.g. HSJdkkdsk877823987321237871.php (it's an example, please don't use that!) and use that file.
Snippets work in EE 2.0 with public view only (no user login). 10 LATEST GALLERIES
$get = "latest_galleries";
$amount = "10";
$exhibition = "";
$thumbsize = "";
$viewas = "";
$includecategory = "";
$excludecategory = "";
$thumbclass = "";
$linkclass = "";
include("./snippets.php");


ip 86.129.220.185 not allowed.

Alan
__________________
To call someone incompetent is unfair to those of us who are....
gillyworld is offline   Reply With Quote
This ad block will go away when you log in as member
Old 4th of October 2006 (Wed)   #2
Pekka
El General Moderator
 
Pekka's Avatar
 
Join Date: Mar 2001
Location: Hellsinki, Finland
Posts: 14,083
Default Re: snippets not working in EE2.0?

It's the IP filter. In snippets.php remove lines

PHP Code:
if (trim(@$_SERVER["REMOTE_ADDR"]) != "127.0.0.1") {
    print 
"<br />ip ";
    print @
$_SERVER["REMOTE_ADDR"]  . " not allowed.";
    exit; 

Does this help?
__________________
This signature signifies my significance significantly
Photo Gallery

----------------------------
Pekka is offline   Reply With Quote
Old 4th of October 2006 (Wed)   #3
gillyworld
Member
 
gillyworld's Avatar
 
Join Date: Jul 2003
Location: Bracknell UK
Posts: 246
Default Re: snippets not working in EE2.0?

Quote:
Originally Posted by Pekka View Post
It's the IP filter. In snippets.php remove lines

PHP Code:
if (trim(@$_SERVER["REMOTE_ADDR"]) != "127.0.0.1") {
    print 
"<br />ip ";
    print @
$_SERVER["REMOTE_ADDR"]  . " not allowed.";
    exit; 

Does this help?
Yes, works fine now thanks Pekka. Hope your concert goes well!

Alan
__________________
To call someone incompetent is unfair to those of us who are....
gillyworld is offline   Reply With Quote
This ad block will go away when you log in as member
Old 4th of October 2006 (Wed)   #4
gillyworld
Member
 
gillyworld's Avatar
 
Join Date: Jul 2003
Location: Bracknell UK
Posts: 246
Default Re: snippets not working in EE2.0?

I may have been a bit hasty, snippets produces the thumbnails ok, but the links are wrong when you click on the thumbs. Can't quite figure out why.

A couple of other minor issues

1. IF you opt not to use a Photo frame around a picture, then the options to select small, medium or large images are hidden from view

2. My default picture size is medium, but the default displayed is always small. Where do I say what is the default? I thought it was in the Paths?

Alan
__________________
To call someone incompetent is unfair to those of us who are....
gillyworld is offline   Reply With Quote
Old 4th of October 2006 (Wed)   #5
Pekka
El General Moderator
 
Pekka's Avatar
 
Join Date: Mar 2001
Location: Hellsinki, Finland
Posts: 14,083
Default Re: snippets not working in EE2.0?

Quote:
Originally Posted by gillyworld View Post
I may have been a bit hasty, snippets produces the thumbnails ok, but the links are wrong when you click on the thumbs. Can't quite figure out why.
I'll look into that.

Quote:
A couple of other minor issues

1. IF you opt not to use a Photo frame around a picture, then the options to select small, medium or large images are hidden from view
This is purely a default template design choice. The size list by name ($sizemenu_text_html) is placed inside (or rather over) the frame DIV in default template. I like it that way it is not obtrusive, and I use passepartout frames. You can move it out from there, or use variable $sizemenu_html to print the old style dropdown menu anywhere.

Quote:
2. My default picture size is medium, but the default displayed is always small. Where do I say what is the default? I thought it was in the Paths?
Path editor default size selection is gone in EE 2. The default size is now chosen by pixels in basecode/SETUP_settings.php, and also explained there

PHP Code:
// default photo size served. Value is in pixels. 
// "800" means the default size is a photo where all sides are smaller than or equal to 800 pixels.
// "0" means smallest available
// "99999" means largest available
// THIS SETTING HAS NO EFFECT (RANDOM RESULT) UNLESS PHOTO SIZES ARE STORED IN DATABASE.
$s_default_size "0"
__________________
This signature signifies my significance significantly
Photo Gallery

----------------------------
Pekka is offline   Reply With Quote
Old 4th of October 2006 (Wed)   #6
wkitty42
Member
 
wkitty42's Avatar
 
Join Date: Jan 2004
Location: Central, North Carolina, USA
Posts: 399
Default Re: snippets not working in EE2.0?

Quote:
Originally Posted by gillyworld View Post
I use snippets in my home page which now doesn't work. I cant even get the snippetdemo.php to work. Heres what I get from snippetdemo

Exhibit Engine SNIPPETS demo


IMPORTANT SECURITY NOTE ABOUT SNIPPETS:
Depending on how your PHP was installed, snippets can be called from external sites, too. If you want to prohibit that, or restrict snippets to specific site(s), insert the line

if (trim($_SERVER["REMOTE_ADDR"]) != "127.0.0.1") { print "ip "; print $_SERVER["REMOTE_ADDR"] . " not allowed."; exit; }

(where 127.0.0.1 is the IP you want to allow, e.g. your server's real IP) to the beginning of the snippets.php after first <?php line . To allow several IP's, reuse that line of code.
eeewwwooo... is snippets not set up for "simple inclusion" as i did before with the v1.5 snippets stuff? i don't really like to have my server using up bandwidth back to itself for functions that can be better "served" internally...

[time passes]

in looking back at what i did here, i see that i took the ee_print_thumbs function and placed it into an include file and did a @require_once on it and there was a rather "large" mod/bugfix to handle a couple of special cases where $exhibition wasn't set properly plus a few other seemingly minor fixes... however, at this point, i'm not sure what, exactly, it was that i did to switch from "url_fopen" (is that right?) usage to simple local include usage...

in any case, since i've not yet gotten ee2 installed and i don't currently use snippets anywhere other than some demo and playing around stuff, i guess i won't worry about it too much until after i get things in place and have a working ee2 gallery

Last edited by wkitty42 : 4th of October 2006 (Wed) at 21:30.
wkitty42 is offline   Reply With Quote
Old 5th of October 2006 (Thu)   #7
gillyworld
Member
 
gillyworld's Avatar
 
Join Date: Jul 2003
Location: Bracknell UK
Posts: 246
Default Re: snippets not working in EE2.0?

[quote=Pekka;2077710]
Originally Posted by gillyworld
I may have been a bit hasty, snippets produces the thumbnails ok, but the links are wrong when you click on the thumbs. Can't quite figure out why.
I'll look into that.
quote]

The problem occurs when the page using snippets is not in the same directory as the snippets code. I think in 1.5 this used a parm set in misc settings.

Thanks

Alan
__________________
To call someone incompetent is unfair to those of us who are....
gillyworld is offline   Reply With Quote
Old 5th of October 2006 (Thu)   #8
wkitty42
Member
 
wkitty42's Avatar
 
Join Date: Jan 2004
Location: Central, North Carolina, USA
Posts: 399
Default Re: snippets not working in EE2.0?

Quote:
Originally Posted by gillyworld View Post
The problem occurs when the page using snippets is not in the same directory as the snippets code. I think in 1.5 this used a parm set in misc settings.
actually, the way i did it was to place it in the php shared libraries directory...

[time passes]

in my .htaccess file, i have something similar to the following

Code:
php_value include_path ".;\shared\includes;\www\exhibits"
the above line tells php to look in the current directory (the .), \shared\includes, and \www\exhibits on the current drive... i have the snippets code php files located in the "includes" directory...

this allows me to call that code from anywhere... of course, with exhibit engine, i also include the "prerequesite" (?) include paths so that the snippets libraries can also locate the ee data and code that they need to work properly...
wkitty42 is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding UDM4 to EE2 Pekka EE 2 Styles 15 7th of June 2008 (Sat) 13:24
Enhanced EE2 updater MMCM EE 2 Coding 0 6th of May 2007 (Sun) 08:46
EE2 Fresh Install SuperFly EE 2 Installation 21 8th of March 2007 (Thu) 20:07
EE2 Upload Problem Pete EE 2 Installation 1 5th of March 2007 (Mon) 03:58
EE2 Admin Logon UweB EE 2 Installation 17 15th of December 2006 (Fri) 18:14


All times are GMT -5. The time now is 23:13.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
This forum is not affiliated with Canon in any way and is run as a free user helpsite by Pekka Saarinen, Helsinki Finland. You will need to register in order to be able to post messages. Cookies are required for registering and posting. HTML in messages is not allowed, plain website addresses are automatically made active by the board.