Changeset 179
- Timestamp:
- 03/13/08 14:15:19 (16 years ago)
- Location:
- plugins/gallery
- Files:
-
- 1 added
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/gallery/_define.php
r170 r179 26 26 /* Description*/ "Image Gallery for Dotclear2", 27 27 /* Author */ "Bruno Hondelatte", 28 /* Version */ '0.2.1 1',28 /* Version */ '0.2.12', 29 29 /* Permissions */ 'usage,contentadmin' 30 30 ); -
plugins/gallery/_install.php
r165 r179 26 26 $installed_version = $core->getVersion('gallery'); 27 27 28 if (version_compare($installed_version,$this_version,'>=') && ($core->blog->settings->gallery_gallery_url_prefix !==null)) {28 if (version_compare($installed_version,$this_version,'>=')) { 29 29 return; 30 30 } 31 31 32 function defaultIfNotSet($value,$default) {33 if ($value === null)34 return $default;35 else36 return $value;37 }38 39 40 $galleries_url_prefix = defaultIfNotSet($core->blog->settings->gallery_galleries_url_prefix,'galleries');41 $gallery_url_prefix = defaultIfNotSet($core->blog->settings->gallery_gallery_url_prefix,'gallery');42 $image_url_prefix = defaultIfNotSet($core->blog->settings->gallery_image_url_prefix,'image');43 $images_url_prefix = defaultIfNotSet($core->blog->settings->gallery_images_url_prefix,'images');44 $browser_url_prefix = defaultIfNotSet($core->blog->settings->gallery_browser_url_prefix,'browser');45 $default_theme = defaultIfNotSet($core->blog->settings->gallery_default_theme,'default');46 $nb_images_per_page = defaultIfNotSet($core->blog->settings->gallery_nb_images_per_page,24);47 48 $core->blog->settings->setNamespace('gallery');49 $core->blog->settings->put('gallery_galleries_url_prefix',$galleries_url_prefix,'string','Gallery lists URL prefix');50 $core->blog->settings->put('gallery_gallery_url_prefix',$gallery_url_prefix,'string','Galleries URL prefix');51 $core->blog->settings->put('gallery_image_url_prefix',$image_url_prefix,'string','Images URL prefix');52 $core->blog->settings->put('gallery_images_url_prefix',$images_url_prefix,'string','Filtered Images URL prefix');53 $core->blog->settings->put('gallery_browser_url_prefix',$browser_url_prefix,'string','Browser URL prefix');54 $core->blog->settings->put('gallery_default_theme',$default_theme,'string','Default theme to use');55 $core->blog->settings->put('gallery_nb_images_per_page',$nb_images_per_page,'integer','Number of images per page');56 32 $core->setVersion('gallery',$this_version); 57 33 -
plugins/gallery/_prepend.php
r162 r179 36 36 $GLOBALS['core']->url->register('galitem',$core->blog->settings->gallery_image_url_prefix,'^' 37 37 .$core->blog->settings->gallery_image_url_prefix.'/(.+)$',array('urlGallery','image')); 38 /* RNot yes implemented 38 39 $GLOBALS['core']->url->register('images','images','^images/(.+)$',array('urlGallery','images')); 39 40 $GLOBALS['core']->url->register('browse','browse','^browser$',array('urlGallery','browse')); 40 41 */ 41 42 42 43 ?> -
plugins/gallery/_public.php
r169 r179 136 136 public static function GalleryEntries($attr,$content) 137 137 { 138 global $core; 138 139 $lastn = 0; 139 140 $sortby = 'post_dt'; … … 148 149 $p .= "\$params['limit'] = ".$lastn.";\n"; 149 150 } else { 150 $p .= "\$params['limit'] = \$core->blog->settings-> nb_post_per_page;\n";151 $p .= "\$params['limit'] = \$core->blog->settings->gallery_nb_galleries_per_page;\n"; 151 152 } 152 153 … … 154 155 $p .= "\$params['post_type'] = 'gal';\n"; 155 156 157 if (!isset($attr['sortby']) && !isset($attr['order']) && !isset($attr['orderbycat'])) { 158 $attr['sortby']=$core->blog->settings->gallery_galleries_sort; 159 $attr['order']=$core->blog->settings->gallery_galleries_order; 160 $attr['orderbycat']=$core->blog->settings->gallery_galleries_orderbycat?"yes":"no"; 161 } 156 162 if (isset($attr['category'])) { 157 163 $p .= "\$params['cat_url'] = '".addslashes($attr['category'])."';\n"; … … 169 175 $order = $attr['order']; 170 176 } 171 if (isset($attr['orderbycat']) ) {177 if (isset($attr['orderbycat']) && strtolower($attr['orderbycat'])=="yes") { 172 178 $p .= "\$params['order'] = 'C.cat_position asc, ".$sortby." ".$order."';\n"; 173 179 } else { … … 758 764 # Getting commenter informations from cookie 759 765 if (!empty($_COOKIE['comment_info'])) { 760 $c_cookie = unserialize($_COOKIE['comment_info']); 761 foreach ($c_cookie as $k => $v) { 762 $GLOBALS['_ctx']->comment_preview[$k] = $v; 763 } 764 $GLOBALS['_ctx']->comment_preview['remember'] = true; 766 $c_cookie = @unserialize($_COOKIE['comment_info']); 767 if (is_array($c_cookie)) { 768 foreach ($c_cookie as $k => $v) { 769 $GLOBALS['_ctx']->comment_preview[$k] = $v; 770 } 771 $GLOBALS['_ctx']->comment_preview['remember'] = true; 772 } 765 773 } 766 774 … … 965 973 # Getting commenter informations from cookie 966 974 if (!empty($_COOKIE['comment_info'])) { 967 $c_cookie = unserialize($_COOKIE['comment_info']); 968 foreach ($c_cookie as $k => $v) { 969 $GLOBALS['_ctx']->comment_preview[$k] = $v; 970 } 971 $GLOBALS['_ctx']->comment_preview['remember'] = true; 975 $c_cookie = @unserialize($_COOKIE['comment_info']); 976 if (is_array($c_cookie)) { 977 foreach ($c_cookie as $k => $v) { 978 $GLOBALS['_ctx']->comment_preview[$k] = $v; 979 } 980 $GLOBALS['_ctx']->comment_preview['remember'] = true; 981 } 972 982 } 973 983 -
plugins/gallery/class.dc.gallery.php
r168 r179 343 343 // Retrieve media items not associated to a image post in a given directory 344 344 function getMediaWithoutGalItems($media_dir) { 345 $strReq = 'SELECT M.media_id, M.media_dir, M.media_file, P.post_id '. 346 'FROM '.$this->core->prefix.'post_media PM '. 347 'JOIN '.$this->core->prefix.'post P ON (PM.post_id = P.post_id AND P.post_type=\'galitem\' '. 348 'AND P.blog_id = \''.$this->core->con->escape($this->core->blog->id).'\') '. 349 'RIGHT JOIN '.$this->core->prefix.'media M ON M.media_id = PM.media_id '. 350 'WHERE P.post_id IS NULL AND media_dir = \''.$this->con->escape($media_dir).'\''; 345 $strReq = 'SELECT M.media_id, M.media_dir, M.media_file '. 346 'FROM '.$this->core->prefix.'media M '. 347 'LEFT JOIN ('. 348 'SELECT PM.post_id,PM.media_id FROM '.$this->core->prefix.'post_media PM '. 349 'INNER JOIN '.$this->core->prefix.'post P '. 350 'ON PM.post_id = P.post_id '. 351 'AND P.blog_id = \''.$this->core->con->escape($this->core->blog->id).'\' '. 352 'AND P.post_type = \'galitem\') PM2 '. 353 'ON M.media_id = PM2.media_id '. 354 'WHERE PM2.post_id IS NULL AND media_dir = \''.$this->con->escape($media_dir).'\''; 351 355 $rs = $this->con->select($strReq); 352 356 return $rs; -
plugins/gallery/default-templates/default/galleries.html
r169 r179 12 12 </tpl:Categories> 13 13 14 <tpl:GalleryEntries sortby="date" order="desc" orderbycat="yes"no_content="1">14 <tpl:GalleryEntries no_content="1"> 15 15 <tpl:EntriesHeader> 16 16 <tpl:Pagination> … … 48 48 <h2>{{tpl:lang Galleries}}</h2> 49 49 </div> 50 <tpl:GalleryEntries sortby="date" order="desc" orderbycat="yes">50 <tpl:GalleryEntries> 51 51 <tpl:EntryIfNewCat> 52 52 <p class="day-date">{{tpl:EntryCategoryWithNull}}</p> -
plugins/gallery/gal.php
r162 r179 603 603 } 604 604 } // if canedit post 605 echo '<br/><p><a href="plugin.php?p=gallery&m=newitems" class="multi-part">'.__('Manage new items').'</a></p>'; 605 echo '<p><a href="plugin.php?p=gallery&m=newitems" class="multi-part">'.__('Manage new items').'</a></p>'; 606 echo '<p><a href="plugin.php?p=gallery&m=options" class="multi-part">'.__('Options').'</a></p>'; 606 607 ?> 607 608 -
plugins/gallery/gals.php
r162 r179 331 331 <?php 332 332 echo "</div>"; 333 echo '<br/><p><a href="plugin.php?p=gallery&m=items" class="multi-part">'.__('Images').'</a></p>'; 334 echo '<br/><p><a href="plugin.php?p=gallery&m=newitems" class="multi-part">'.__('Manage new items').'</a></p>'; 333 echo '<p><a href="plugin.php?p=gallery&m=items" class="multi-part">'.__('Images').'</a></p>'; 334 echo '<p><a href="plugin.php?p=gallery&m=newitems" class="multi-part">'.__('Manage new items').'</a></p>'; 335 echo '<p><a href="plugin.php?p=gallery&m=options" class="multi-part">'.__('Options').'</a></p>'; 335 336 ?> 336 337 </body> -
plugins/gallery/index.php
r162 r179 23 23 if (!defined('DC_CONTEXT_ADMIN')) { exit; } 24 24 25 if (!empty($_REQUEST['m'])) { 25 if (is_null($core->blog->settings->gallery_gallery_url_prefix)) { 26 require dirname(__FILE__).'/options.php'; 27 }elseif (!empty($_REQUEST['m'])) { 26 28 switch ($_REQUEST['m']) { 27 29 case 'gal' : … … 46 48 require dirname(__FILE__).'/item.php'; 47 49 break; 50 case 'options': 51 require dirname(__FILE__).'/options.php'; 52 break; 48 53 } 49 54 } else { -
plugins/gallery/item.php
r162 r179 456 456 457 457 } // if canedit post 458 echo '<br/><p><a href="plugin.php?p=gallery&m=newitems" class="multi-part">'.__('Manage new items').'</a></p>'; 458 echo '<p><a href="plugin.php?p=gallery&m=newitems" class="multi-part">'.__('Manage new items').'</a></p>'; 459 echo '<p><a href="plugin.php?p=gallery&m=options" class="multi-part">'.__('Options').'</a></p>'; 459 460 ?> 460 461 </body> -
plugins/gallery/items.php
r162 r179 407 407 ?> 408 408 </div> 409 <?php echo '<br/><p><a href="plugin.php?p=gallery&m=newitems" class="multi-part">'.__('Manage new items').'</a></p>';?> 409 <?php 410 echo '<p><a href="plugin.php?p=gallery&m=newitems" class="multi-part">'.__('Manage new items').'</a></p>'; 411 echo '<p><a href="plugin.php?p=gallery&m=options" class="multi-part">'.__('Options').'</a></p>'; 412 ?> 410 413 </body> 411 414 </html> -
plugins/gallery/locales/fr/main.po
r168 r179 6 6 7 7 #: _admin.php:27 8 #: _public.php:4 668 #: _public.php:487 9 9 #: _widgets.php:31 10 10 #: gal.php:440 … … 16 16 #: item.php:352 17 17 #: items.php:287 18 #: newitems.php:73 18 #: newitems.php:80 19 #: options.php:132 19 20 msgid "Galleries" 20 21 msgstr "Galeries" … … 31 32 32 33 #: _public.php:131 33 #: _public.php:5 0434 #: _public.php:525 34 35 msgid "No category" 35 36 msgstr "Sans catégorie" 36 37 37 #: _public.php:5 4538 #: _public.php:566 38 39 msgid "Random Image" 39 40 msgstr "Image aléatoire" 40 41 41 #: _public.php:5 6842 #: _public.php:589 42 43 #: _widgets.php:46 43 44 msgid "Last images" … … 86 87 #: item.php:332 87 88 #: items.php:288 88 #: newitems.php:74 89 #: newitems.php:81 90 #: options.php:133 89 91 msgid "Images" 90 92 msgstr "Images" … … 178 180 #: gals.php:334 179 181 #: item.php:458 180 #: items.php:409 181 #: newitems.php:75 182 #: items.php:410 183 #: newitems.php:82 184 #: options.php:134 182 185 msgid "Manage new items" 183 186 msgstr "Gestion des nouvelles images" … … 242 245 243 246 #: items.php:269 244 #: newitems.php:45 247 #: newitems.php:52 248 #: options.php:124 245 249 msgid "Gallery Items" 246 250 msgstr "Images" … … 255 259 256 260 #: items.php:305 257 #: newitems.php: 79261 #: newitems.php:86 258 262 msgid "Media dir:" 259 263 msgstr "Répertoire contenant les media" … … 267 271 msgstr "filtrée" 268 272 269 #: newitems.php:5 2273 #: newitems.php:59 270 274 msgid "Waiting..." 271 275 msgstr "En attente..." 272 276 273 #: newitems.php: 53277 #: newitems.php:60 274 278 msgid "%s entries found" 275 279 msgstr "%s entrées trouvées" 276 280 277 #: newitems.php: 54281 #: newitems.php:61 278 282 msgid "Create media" 279 283 msgstr "Création du media" 280 284 281 #: newitems.php: 55285 #: newitems.php:62 282 286 msgid "Create post for media" 283 287 msgstr "Création du billet pour le media" 284 288 285 #: newitems.php: 56289 #: newitems.php:63 286 290 msgid "Create thumbs for media" 287 291 msgstr "Création des miniatures pour le media" 288 292 289 #: newitems.php: 57293 #: newitems.php:64 290 294 msgid "Refresh gallery" 291 295 msgstr "Rafraîchissement de la galerie" 292 296 293 #: newitems.php:58 294 #: newitems.php:82 297 #: newitems.php:65 298 #: newitems.php:89 299 #: options.php:186 295 300 msgid "Delete orphan media" 296 301 msgstr "Supprimer les media orphelins" 297 302 298 #: newitems.php: 59303 #: newitems.php:66 299 304 msgid "Delete orphan items" 300 305 msgstr "Suppression des images orphelines" 301 306 302 #: newitems.php:6 0307 #: newitems.php:67 303 308 msgid "Fetch new media" 304 309 msgstr "Recherche des nouveaux media" 305 310 306 #: newitems.php:6 1311 #: newitems.php:68 307 312 msgid "Fetch media without post" 308 313 msgstr "Recherche des media sans billet associé" 309 314 310 #: newitems.php:6 2315 #: newitems.php:69 311 316 msgid "Fetch media without thumbnails" 312 317 msgstr "Recherche des media sans miniatures" 313 318 314 #: newitems.php: 63319 #: newitems.php:70 315 320 msgid "Retrieve galleries" 316 321 msgstr "Récupération des galeries" 317 322 318 #: newitems.php: 64323 #: newitems.php:71 319 324 msgid "Whole blog" 320 325 msgstr "Tout le blog" 321 326 322 #: newitems.php: 78327 #: newitems.php:85 323 328 msgid "New Items" 324 329 msgstr "Nouvelles images" 325 330 326 #: newitems.php:84 331 #: newitems.php:91 332 #: options.php:188 327 333 msgid "Delete orphan image-posts" 328 334 msgstr "Supprimer les billets-images orphelins" 329 335 330 #: newitems.php:86 336 #: newitems.php:93 337 #: options.php:190 331 338 msgid "Scan dir for new media" 332 339 msgstr "Rechercher les nouveaux media dans le répertoire" 333 340 334 #: newitems.php:88 341 #: newitems.php:95 342 #: options.php:192 335 343 msgid "Create image-posts for media in dir" 336 344 msgstr "Créer les billets-images pour les media dans le dossier" 337 345 338 #: newitems.php:90 346 #: newitems.php:97 347 #: options.php:194 339 348 msgid "Create missing thumbnails" 340 349 msgstr "Créer les miniatures manquantes" 341 350 342 #: newitems.php:9 1351 #: newitems.php:98 343 352 msgid "proceed" 344 353 msgstr "Soumettre" 345 354 346 #: newitems.php: 94355 #: newitems.php:101 347 356 msgid "Gallery mass update" 348 357 msgstr "Mise à jour en masse des galeries" 349 358 350 #: newitems.php: 95359 #: newitems.php:102 351 360 msgid "Update all galeries" 352 361 msgstr "Mettre à jour toutes les galeries" 353 362 354 #: newitems.php: 98363 #: newitems.php:105 355 364 msgid "Processing result" 356 365 msgstr "Résultat du traitement" 357 366 358 #: newitems.php:10 0367 #: newitems.php:107 359 368 msgid "Requests" 360 369 msgstr "Requêtes" 361 370 362 #: newitems.php:10 2371 #: newitems.php:109 363 372 msgid "Actions" 364 373 msgstr "Actions" 365 374 375 #: options.php:148 376 msgid "Plugin Activation" 377 msgstr "Activation du plugin" 378 379 #: options.php:151 380 msgid "The plugin cannot be enabled. Please check in your about:config that public_path points to an existing directory." 381 msgstr "Ce plugin ne peut pas être activé. Vérifiez que l'entrée public_path de votre about:config pointe vers un répertoire accessible" 382 383 #: options.php:153 384 msgid "The plugin is not enabled for this blog yet. Click below to enable it" 385 msgstr "Le plugin n'est pas activé pour ce blog. Cliquez ci-dessous pour l'activer." 386 387 #: options.php:154 388 msgid "Enable plugin" 389 msgstr "Activer le plugin" 390 391 #: options.php:162 392 msgid "General options" 393 msgstr "Options générales" 394 395 #: options.php:163 396 msgid "Number of galleries per page" 397 msgstr "Nombre de galeries par page" 398 399 #: options.php:166 400 msgid "Number of images per page" 401 msgstr "Nombre d'images par page" 402 403 #: options.php:169 404 msgid "Galleries list sort by" 405 msgstr "Critère de tri pour les listes de galeries" 406 407 #: options.php:172 408 msgid "Galleries list order" 409 msgstr "Send de tri pour les listes de galeries" 410 411 #: options.php:175 412 msgid "Group galeries by category" 413 msgstr "Regrouper les galeries par catégorie" 414 415 #: options.php:184 416 msgid "New Items default options" 417 msgstr "Options par défaut pour la gestion des nouvelles images" 418 419 #: options.php:201 420 msgid "Advanced options" 421 msgstr "Options avancées" 422 423 #: options.php:202 424 msgid "All the following values will define default URLs for gallery items" 425 msgstr "Les valeurs suivantes définissent les URLs par défaut pour les éléments de galeries" 426 427 #: options.php:203 428 msgid "Galleries URL prefix" 429 msgstr "Préfixe pour les URL de listes de galeries" 430 431 #: options.php:206 432 msgid "Gallery URL prefix" 433 msgstr "Préfixe pour les URL de galeries" 434 435 #: options.php:209 436 msgid "Image URL prefix" 437 msgstr "Préfixe pour les URL d'images" 438 366 439 msgid "next galleries" 367 440 msgstr "galeries suivantes" -
plugins/gallery/newitems.php
r168 r179 39 39 $create_posts = !empty($_REQUEST['create_posts']) ? $_REQUEST['create_posts'] : 0;; 40 40 41 $defaults=($core->blog->settings->gallery_new_items_default != null)?$core->blog->settings->gallery_new_items_default:"YYYYN"; 42 43 $c_delete_orphan_media=($defaults{0} == "Y"); 44 $c_delete_orphan_items=($defaults{1} == "Y"); 45 $c_scan_media=($defaults{2} == "Y"); 46 $c_create_posts=($defaults{3} == "Y"); 47 $c_create_thumbs=($defaults{4} == "Y"); 41 48 42 49 ?> … … 79 86 '<p><label class="classic">'.__('Media dir:'). 80 87 form::combo('media_dir',$dirs_combo,'').'</label></p> '. 81 '<p><label class="classic">'.form::checkbox('delete_orphan_media',1, 1).88 '<p><label class="classic">'.form::checkbox('delete_orphan_media',1,$c_delete_orphan_media). 82 89 __('Delete orphan media').'</label></p>'. 83 '<p><label class="classic">'.form::checkbox('delete_orphan_items',1, 1).90 '<p><label class="classic">'.form::checkbox('delete_orphan_items',1,$c_delete_orphan_items). 84 91 __('Delete orphan image-posts').'</label></p>'. 85 '<p><label class="classic">'.form::checkbox('scan_media',1, 1).92 '<p><label class="classic">'.form::checkbox('scan_media',1,$c_scan_media). 86 93 __('Scan dir for new media').'</label></p>'. 87 '<p><label class="classic">'.form::checkbox('create_posts',1, 1).94 '<p><label class="classic">'.form::checkbox('create_posts',1,$c_create_posts). 88 95 __('Create image-posts for media in dir').'</label></p> '. 89 '<p><label class="classic">'.form::checkbox('create_thumbs',1, 1).96 '<p><label class="classic">'.form::checkbox('create_thumbs',1,$c_create_thumbs). 90 97 __('Create missing thumbnails').'</label></p> '. 91 98 '<input type="button" id="proceed" value="'.__('proceed').'" />'. … … 103 110 echo '<table id="process"><tr class="keepme"><th>ID</th><th>Action</th><th>Status</th></tr></table>'; 104 111 echo '</fieldset>'; 112 113 echo '<p><a href="plugin.php?p=gallery&m=options" class="multi-part">'.__('Options').'</a></p>'; 105 114 ?> 106 115
Note: See TracChangeset
for help on using the changeset viewer.