Changeset 2809
- Timestamp:
- 12/20/10 22:36:17 (12 years ago)
- Location:
- plugins/snapme
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/snapme/_admin.php
r1799 r2809 22 22 # ***** END LICENSE BLOCK ***** 23 23 24 // Behaviors du Widget25 $core->addBehavior('initWidgets',array('snapMeBehaviors','init'));26 24 27 25 // Ajout du plugin dans le menu d'administration … … 30 28 $core->auth->check('snapme',$core->blog->id)); 31 29 32 class snapMeBehaviors33 {34 public static function init(&$w)35 {36 $w->create('snapme',__('SnapMe'),array('snapMeTpl','widget'));37 $w->snapme->setting('title',__('Title:'),__('SnapMe'),'text');38 $w->snapme->setting('display',__('Display :'),1,'combo',array(__('Last Snap') => 1, __('Random Snap') => 2));39 $w->snapme->setting('homeonly',__('Home page only'),1,'check');40 41 42 }43 }44 30 ?> -
plugins/snapme/_public.php
r2798 r2809 173 173 174 174 // Gestion de la page courrante 175 if (isset($GLOBALS["page"]) && ($GLOBALS["page"] != 0)){ 175 if (isset($_GET["page"]) && ($_GET["page"] != 0)){ 176 $current_page = $_GET["page"]; 177 } else if (isset($GLOBALS["page"]) && ($GLOBALS["page"] != 0)){ 176 178 $current_page = $GLOBALS["page"]; 177 179 } else { … … 185 187 186 188 // Calcul du nombre de pages 187 $nb_page = floor($rs_count->count / $nb_snap);189 $nb_page = ceil($rs_count->count / $nb_snap); 188 190 189 191 // Affichage des éléments … … 205 207 206 208 if ($k == $current_page) $buffer .="<strong>"; 207 $buffer .="<a href=".snapMeTpl::getUrl("snapme/gallery/".$k).">".$k."</a>"; 209 if (!defined('DC_CONTEXT_ADMIN')){ 210 $buffer .="<a href=".snapMeTpl::getUrl("snapme/gallery/".$k).">".$k."</a>"; 211 } else if (defined('DC_CONTEXT_ADMIN')){ 212 $buffer .="<a href=\"plugin.php?p=snapme&page=".$k."\">".$k."</a>"; 213 } 208 214 if ($k == $current_page) $buffer .="</strong>"; 209 215 … … 283 289 284 290 if ($k == $current_page) $buffer .="<strong>"; 285 $buffer .="<a href=".snapMeTpl::getUrl("snapme/gallery/".$k).">".$k."</a>"; 291 if (!defined('DC_CONTEXT_ADMIN')){ 292 $buffer .="<a href=".snapMeTpl::getUrl("snapme/gallery/".$k).">".$k."</a>"; 293 } else if (defined('DC_CONTEXT_ADMIN')){ 294 $buffer .="<a href=\"plugin.php?p=snapme&page=".$k."\">".$k."</a>"; 295 } 286 296 if ($k == $current_page) $buffer .="</strong>"; 287 297
Note: See TracChangeset
for help on using the changeset viewer.