1<?php 2/* 3* Copyright (c) e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt) 4* $Id: e_shortcode.php 12438 2011-12-05 15:12:56Z secretr $ 5* 6* Featurebox shortcode batch class - shortcodes available site-wide. ie. equivalent to multiple .sc files. 7*/ 8 9if (!defined('e107_INIT')) { exit; } 10 11/* 12// SEE e_shortcode.php instead. 13 14 15class gallery_shortcodes extends e_shortcode 16{ 17 18 public $total = 0; 19 public $amount = 3; 20 public $from = 0; 21 public $curCat = null; 22 23 function sc_gallery_caption($parm='') 24 { 25 $tp = e107::getParser(); 26 $text = "<a title='".$tp->toAttribute($this->var['media_caption'])."' href='".e107::getParser()->replaceConstants($this->var['media_url'],'abs')."' rel='lightbox[Gallery2]' >"; 27 $text .= $this->var['media_caption']; 28 $text .= "</a>"; 29 return $text; 30 } 31 32 function sc_gallery_thumb($parm='') 33 { 34 $tp = e107::getParser(); 35 $att = ($parm) ?$parm : 'aw=190&ah=150'; 36 $text = "<a title='".$tp->toAttribute($this->var['media_caption'])."' href='".e107::getParser()->replaceConstants($this->var['media_url'],'abs')."' rel='lightbox[Gallery]' >"; 37 $text .= "<img src='".e107::getParser()->thumbUrl($this->var['media_url'],$att)."' alt='' />"; 38 $text .= "</a>"; 39 return $text; 40 } 41 42 function sc_gallery_cat_title($parm='') 43 { 44 $tp = e107::getParser(); 45 $text = "<a href='".e_SELF."?cat=".$this->var['media_cat_category']."'>"; 46 $text .= $tp->toHTML($this->var['media_cat_title']); 47 $text .= "</a>"; 48 return $text; 49 } 50 51 function sc_gallery_cat_thumb($parm='') 52 { 53 $att = ($parm) ?$parm : 'aw=190&ah=150'; 54 $text = "<a href='".e_SELF."?cat=".$this->var['media_cat_category']."'>"; 55 $text .= "<img src='".e107::getParser()->thumbUrl($this->var['media_cat_image'],$att)."' alt='' />"; 56 $text .= "</a>"; 57 return $text; 58 } 59 60 function sc_gallery_nextprev($parm='') 61 { 62 $url = e_SELF."?cat=".$this->curCat."--AMP--frm=--FROM--"; 63 $parm = 'total='.$this->total.'&amount='.$this->amount.'¤t='.$this->from.'&url='.$url; // .'&url='.$url; 64 $text .= e107::getParser()->parseTemplate("{NEXTPREV=".$parm."}"); 65 return $text; 66 } 67 68 69} 70*/ 71