PDA

View Full Version : Problem with snippets


MikeCaine
2nd of December 2006 (Sat), 06:03
Sorry if this has been covered before, I've manually searched for it but can find no previous mention of it.

I'd like to include snippets on the main index page of my site.

I've looked at snippetdemo.php and it works OK in the /gallery directory that my EE install is in

if I move it into the root directory it doesn't work. I've tried chaging the lines

@include("./snippets.php");

to

@include("./gallery/snippets.php");

but can't get it to work

Any ideas?

MikeCaine
2nd of December 2006 (Sat), 06:05
Gah! Typical, as soon as I post the answer comes to me

I had to make similar changes in snippets.php to include /gallery/ in the paths

MikeCaine
2nd of December 2006 (Sat), 06:43
Spoke too soon. I now can't get the links from the thumbnails to the actual photos working now.

Has anyone done this? How did they do it?

wkitty42
2nd of December 2006 (Sat), 13:36
i forget the exact line but there's a line that someone posted needed to be added to the snippets code somewhere around line 45 or possibly 80... anyway, the code line needed is to put in the proper url info to link to the photos from outside the gallery's root directory... i forget exactly where the post is but it was done within the last few weeks... do a search for "snippets" in these eE2 forums (using the search function in the right hand column header and not the one in the top bar)...

[time passes]

i found it here (http://photography-on-the.net/forum/showthread.php?t=234802&highlight=snippets) but i've not tried to use it to see if it is needed since i moved my gallery to its own domain... one day i might get wild and see about linking photos to my www domain and seeing how that cross domain coding might work...

MikeCaine
3rd of December 2006 (Sun), 08:18
Thanks, and thanks Dirk, for that. All is working fine now

segal3
8th of December 2006 (Fri), 03:49
Snippets doesn't seem to use the user-specific variable $thumbclass ($thumbclass = "ee_css_microthumb"; for example) - in snippets.php:

if ($viewas == "image") {
ee_print_thumbs($thumbarraylist,$thumbsize,"","",$thumbclass="ee_css_thumb",$linkclass="ee_css_thumb_link");
}

just uses "ee_css_thumb" no matter what...

Pekka
8th of December 2006 (Fri), 06:31
Snippets doesn't seem to use the user-specific variable $thumbclass ($thumbclass = "ee_css_microthumb"; for example) - in snippets.php:

if ($viewas == "image") {
ee_print_thumbs($thumbarraylist,$thumbsize,"","",$thumbclass="ee_css_thumb",$linkclass="ee_css_thumb_link");
}

just uses "ee_css_thumb" no matter what...

Well those are bugs (my copy paste without brain). Well spotted.

It might be easiest to change both those lines to

ee_print_thumbs($thumbarraylist,$thumbsize,"","",$s_snippet_thumbclass,$s_snippet_linkclass);

and then add to basecode/SETUP_settings.php lines

$s_snippet_thumbclass = "ee_css_thumb";
$s_snippet_linkclass = "ee_css_thumb_link";

as default values. If you define those variables before calling the snippet you can adjust them on the fly.