Changeset 2317
- Timestamp:
- 06/07/10 03:55:49 (13 years ago)
- Location:
- plugins/dcQRcode
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dcQRcode/_define.php
r2036 r2317 17 17 /* Description*/ "Use QR code on your blog", 18 18 /* Author */ "JC Denis", 19 /* Version */ '0. 6.1',19 /* Version */ '0.7', 20 20 /* Permissions */ 'admin' 21 21 ); 22 /* date */ #2010 011922 /* date */ #2010606 23 23 ?> -
plugins/dcQRcode/_install.php
r2024 r2317 18 18 if (version_compare($old_version,$new_version,'>=')) return; 19 19 20 try { 21 # Is DC 2.1.5 ? 22 if (!version_compare(DC_VERSION,'2.1.5','>=')) { 23 24 throw new Exception('dcQRcode requires Dotclear 2.1.5'); 20 try 21 { 22 # Check DC version 23 if (version_compare(DC_VERSION,'2.2-beta','<')) 24 { 25 throw new Exception('dcQRcode requires Dotclear 2.2'); 25 26 } 27 26 28 # Database 27 29 $s = new dbStruct($core->con,$core->prefix); … … 35 37 ->index('idx_qrcode_blog_id','btree','blog_id') 36 38 ->index('idx_qrcode_type','btree','qrcode_type'); 37 39 38 40 $si = new dbStruct($core->con,$core->prefix); 39 41 $changes = $si->synchronize($s); 40 42 $s = null; 41 43 42 44 # Settings 43 $ s =& $core->blog->settings;44 $s ->setNameSpace('dcQRcode');45 $core->blog->settings->addNamespace('dcQRcode'); 46 $s = $core->blog->settings->dcQRcode; 45 47 $s->put('qrc_active',false,'boolean','Enable plugin',false,true); 46 48 $s->put('qrc_use_mebkm',true,'boolean','Use MEBKM anchor',false,true); … … 53 55 $s->put('qrc_api_ec_margin',1,'integer','',false,true); 54 56 $s->put('qrc_api_out_enc','UTF-8','string','',false,true); 55 $s->setNameSpace('system');56 57 57 58 # Version … … 60 61 return true; 61 62 } 62 catch (Exception $e) { 63 catch (Exception $e) 64 { 63 65 $core->error->add($e->getMessage()); 64 66 } -
plugins/dcQRcode/_prepend.php
r2024 r2317 14 14 15 15 global $__autoload, $core; 16 $core->blog->settings->addNamespace('dcQRcode'); 16 17 17 18 $__autoload['dcQRcode'] = dirname(__FILE__).'/inc/class.dc.qr.code.php'; … … 27 28 28 29 $find = false; 29 $custom = $core->blog->settings-> qrc_public_path;30 $custom = $core->blog->settings->dcQRcode->qrc_public_path; 30 31 $default = $core->blog->public_path; 31 32 32 33 # See if don't want cache 33 if (!$core->blog->settings->qrc_cache_use) { 34 if (!$core->blog->settings->dcQRcode->qrc_cache_use) 35 { 34 36 $qrc_cache_path = null; 35 37 } -
plugins/dcQRcode/_public.php
r2036 r2317 29 29 global $core; 30 30 31 if (!$core->blog->settings-> qrc_active) {31 if (!$core->blog->settings->dcQRcode->qrc_active) { 32 32 self::p404(); 33 33 return; … … 69 69 70 70 $_ctx->qrcode = new dcQRcode($core,QRC_CACHE_PATH); 71 $_ctx->qrcode->setSize($core->blog->settings-> qrc_img_size);72 $_ctx->qrcode->setParams('use_mebkm',$core->blog->settings-> qrc_use_mebkm);71 $_ctx->qrcode->setSize($core->blog->settings->dcQRcode->qrc_img_size); 72 $_ctx->qrcode->setParams('use_mebkm',$core->blog->settings->dcQRcode->qrc_use_mebkm); 73 73 } 74 74 … … 85 85 public static function publicEntryBehaviorContent($core,$_ctx,$place) 86 86 { 87 if (!$core->blog->settings-> qrc_active88 || $core->blog->settings-> qrc_bhv_entryplace != $place87 if (!$core->blog->settings->dcQRcode->qrc_active 88 || $core->blog->settings->dcQRcode->qrc_bhv_entryplace != $place 89 89 || !$_ctx->exists('posts') 90 90 || !in_array($_ctx->current_tpl,array('home.html','post.html','category.html','tag.html','archive_month.html')) 91 || !$core->blog->settings-> qrc_bhv_entrytplhome && $_ctx->current_tpl == 'home.html'92 || !$core->blog->settings-> qrc_bhv_entrytplpost && $_ctx->current_tpl == 'post.html'93 || !$core->blog->settings-> qrc_bhv_entrytplcategory && $_ctx->current_tpl == 'category.html'94 || !$core->blog->settings-> qrc_bhv_entrytpltag && $_ctx->current_tpl == 'tag.html'95 || !$core->blog->settings-> qrc_bhv_entrytplarchive && $_ctx->current_tpl == 'archive_month.html'91 || !$core->blog->settings->dcQRcode->qrc_bhv_entrytplhome && $_ctx->current_tpl == 'home.html' 92 || !$core->blog->settings->dcQRcode->qrc_bhv_entrytplpost && $_ctx->current_tpl == 'post.html' 93 || !$core->blog->settings->dcQRcode->qrc_bhv_entrytplcategory && $_ctx->current_tpl == 'category.html' 94 || !$core->blog->settings->dcQRcode->qrc_bhv_entrytpltag && $_ctx->current_tpl == 'tag.html' 95 || !$core->blog->settings->dcQRcode->qrc_bhv_entrytplarchive && $_ctx->current_tpl == 'archive_month.html' 96 96 ) return; 97 97 … … 114 114 global $core, $_ctx; 115 115 116 if (!$core->blog->settings-> qrc_active) return;116 if (!$core->blog->settings->dcQRcode->qrc_active) return; 117 117 118 118 $size = isset($attr['size']) ? (integer) $attr['size'] : 128; … … 134 134 "<?php if (\$_ctx->exists('posts')". 135 135 " && \$_ctx->posts->post_type == 'post'". 136 " && \$core->blog->settings-> qrc_active) { \n".136 " && \$core->blog->settings->dcQRcode->qrc_active) { \n". 137 137 "\$_ctx->qrcode->setType('URL'); ". 138 138 "\$title = \$core->blog->name.' - '.\$_ctx->posts->post_title; \n". … … 147 147 $res .= 148 148 "<?php if (\$_ctx->exists('categories')". 149 " && \$core->blog->settings-> qrc_active) { \n".149 " && \$core->blog->settings->dcQRcode->qrc_active) { \n". 150 150 "\$_ctx->qrcode->setType('URL'); ". 151 151 "\$title = \$core->blog->name.' - '.\$_ctx->categories->cat_title; \n". … … 160 160 $res .= 161 161 "<?php if (\$_ctx->exists('meta')". 162 " && \$core->blog->settings-> qrc_active) { \n".162 " && \$core->blog->settings->dcQRcode->qrc_active) { \n". 163 163 "\$_ctx->qrcode->setType('URL'); ". 164 "\$title = \$core->blog->name.' - '.\$_ctx->meta->me at_id; \n".164 "\$title = \$core->blog->name.' - '.\$_ctx->meta->meta_id; \n". 165 165 "\$url = \$core->blog->url.\$core->url->getBase('tag').'/'.\$_ctx->meta->meta_id; \n". 166 166 "\$id = \$_ctx->qrcode->encode(\$url,\$title); \n". … … 259 259 "</p>'; \n". 260 260 // regain standard settings 261 "\$_ctx->qrcode->setSize(\$core->blog->settings-> qrc_img_size); \n".262 "\$_ctx->qrcode->setParams('use_mebkm',\$core->blog->settings-> qrc_use_mebkm); \n".261 "\$_ctx->qrcode->setSize(\$core->blog->settings->dcQRcode->qrc_img_size); \n". 262 "\$_ctx->qrcode->setParams('use_mebkm',\$core->blog->settings->dcQRcode->qrc_use_mebkm); \n". 263 263 "unset(\$id); } ?> \n"; 264 264 … … 288 288 289 289 # plugin active 290 if (!$core->blog->settings-> qrc_active) return;290 if (!$core->blog->settings->dcQRcode->qrc_active) return; 291 291 292 292 # qrc class … … 294 294 $qrc->setSize($w->size); 295 295 $qrc->setType('URL'); 296 $qrc->setParams('use_mebkm',$ w->mebkm);296 $qrc->setParams('use_mebkm',$core->blog->settings->dcQRcode->qrc_use_mebkm); 297 297 298 298 $url = $core->blog->url; -
plugins/dcQRcode/inc/class.dc.qr.code.php
r2025 r2317 41 41 $this->cache_path = $cache_path; 42 42 43 if ($core->blog->settings->qrc_api_url) 44 $this->qrc_api_url = $core->blog->settings->qrc_api_url; 45 46 if ($core->blog->settings->qrc_api_ec_level) 47 $this->qrc_api_ec_level = $core->blog->settings->qrc_api_ec_level; 48 49 if ($core->blog->settings->qrc_api_ec_margin) 50 $this->qrc_api_ec_margin = $core->blog->settings->qrc_api_ec_margin; 51 52 if ($core->blog->settings->qrc_api_out_enc) 53 $this->qrc_api_out_enc = $core->blog->settings->qrc_api_out_enc; 43 if ($core->blog->settings->dcQRcode->qrc_api_url) 44 { 45 $this->qrc_api_url = $core->blog->settings->dcQRcode->qrc_api_url; 46 } 47 if ($core->blog->settings->dcQRcode->qrc_api_ec_level) 48 { 49 $this->qrc_api_ec_level = $core->blog->settings->dcQRcode->qrc_api_ec_level; 50 } 51 if ($core->blog->settings->dcQRcode->qrc_api_ec_margin) 52 { 53 $this->qrc_api_ec_margin = $core->blog->settings->dcQRcode->qrc_api_ec_margin; 54 } 55 if ($core->blog->settings->dcQRcode->qrc_api_out_enc) 56 { 57 $this->qrc_api_out_enc = $core->blog->settings->dcQRcode->qrc_api_out_enc; 58 } 54 59 } 55 60 -
plugins/dcQRcode/index.php
r2024 r2317 15 15 dcPage::check('admin'); 16 16 17 $s = & $core->blog->settings;17 $s = $core->blog->settings->dcQRcode; 18 18 19 19 $tab = isset($_REQUEST['tab']) ? $_REQUEST['tab'] : 'qrc_settings'; 20 20 $_REQUEST['nb_per_page'] = $s->qrc_nb_per_page; 21 if (!empty($_GET['nb']) && (integer) $_GET['nb'] > 0) { 21 if (!empty($_GET['nb']) && (integer) $_GET['nb'] > 0) 22 { 22 23 $_REQUEST['nb_per_page'] = (integer) $_GET['nb']; 23 24 } … … 53 54 try 54 55 { 55 $s->setNamespace('dcQRcode');56 56 $s->put('qrc_active',isset($_POST['qrc_active'])); 57 57 $s->put('qrc_use_mebkm',isset($_POST['qrc_use_mebkm'])); … … 75 75 $s->put('qrc_cache_path',$_POST['qrc_cache_path']); 76 76 } 77 $s->setNamespace('system');78 77 79 78 $qrc->cleanCache(); … … 236 235 <?php 237 236 238 if ($ core->blog->settings->qrc_active)237 if ($s->qrc_active) 239 238 { 240 239 dcQRcodeIndexLib::txtTab($core,$qrc); … … 256 255 ?> 257 256 <hr class="clear"/> 258 <p class="right"> 257 <p class="right"><a class="button" href="<?php echo $p_url;?>&t=qrc_settings"><?php echo __('Settings'); ?></a> - 259 258 dcQRcode - <?php echo $core->plugins->moduleInfo('dcQRcode','version'); ?> 260 259 <img alt="dcQRcode" src="index.php?pf=dcQRcode/icon.png" /> -
plugins/dcQRcode/release.txt
r2036 r2317 1 0.7 20100606 2 * Switched to DC 2.2 3 * Fixed use of MEBKM on widget 4 1 5 0.6.1 20100130 2 6 * Fixed URL decode before query database
Note: See TracChangeset
for help on using the changeset viewer.