[SOLVED] how to get the thumbnail url of the resized pic on [photo.tpl] page
mexicoshaun
Joined: 2007-06-21
Posts: 15 |
![]() |
Hi all, would anyone be so kind as to consider this for me, re: valiant's comments here http://gallery.menalto.com/node/60319 [Grab hi-res pic and thumbnails URL's] We have G2 set up so that you must login to see full size/ resized images. I am trying to implement the facebook 'like' button and the 'open graph meta tags', specifically 'og:image', in order to tell facebook the url of the image to show on facebook user's timelines when they like the [photo.tpl] page. I can show the url of the actual item [ie the resized photo] with: - which works fine technically except that because facebook is not logged in to G2 it can't locate the image - so i really need to tell it the thumbnail location instead, as thumbnails are not protected. My modified function in theme.inc looks like: ==================================================================== function showPhotoPage(&$template, $item, $params) { /** if ($ret) { ============================================================================= and i have: <meta property="og:image" content="{g->url arg1='view=core.DownloadItem' arg2='itemId=`$theme.item.thumb.id`' forceFullUrl=true htmlEntities=false}" />, But the link appears as: rather than: For some reason it is not passing the item id correctly. Am I doing something wrong or is it an issue with versions? [the post i found was 5 years ago!] perhaps there is a different way to do this? Gallery URL = http://www.hen-night.org/main.php |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
use $theme.item.id instead of $theme.item.thumb.id -s |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Valiant's code is still valid for v2.3.2 except that you most likely already have "$theme =& $template->getVariableByReference('theme');" under your showPhotoPage function and should not add it again really. This is not critical though. Try copying and pasting this in directly ...
-- |
|
mexicoshaun
Joined: 2007-06-21
Posts: 15 |
![]() |
thanks guys, dayo, copying and pasting your code solved the problem, v grateful |
|