Changeset 1426
- Timestamp:
- 09/07/09 05:05:29 (14 years ago)
- Location:
- plugins/dcQRcode
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dcQRcode/_define.php
r1425 r1426 17 17 /* Description*/ "Use QR code on your blog", 18 18 /* Author */ "JC Denis", 19 /* Version */ '0. 1',19 /* Version */ '0.2', 20 20 /* Permissions */ 'admin' 21 21 ); -
plugins/dcQRcode/inc/class.dc.qr.code.php
r1425 r1426 105 105 $cur->qrcode_id = (integer) $this->id; 106 106 $cur->qrcode_data = (string) $this->data; 107 $cur->qrcode_size = ( string) $this->size;107 $cur->qrcode_size = (integer) $this->size; 108 108 109 109 $cur->insert(); … … 206 206 ); 207 207 208 $this->data = serialize($data);208 $this->data = base64_encode(serialize($data)); 209 209 } 210 210 … … 219 219 ); 220 220 221 $this->data = serialize($data);221 $this->data = base64_encode(serialize($data)); 222 222 } 223 223 # geo … … 230 230 ); 231 231 232 $this->data = serialize($data);232 $this->data = base64_encode(serialize($data)); 233 233 } 234 234 # market (Android) … … 240 240 ); 241 241 242 $this->data = serialize($data);242 $this->data = base64_encode(serialize($data)); 243 243 } 244 244 # iCAL … … 251 251 ); 252 252 253 $this->data = serialize($data); 253 $this->data = base64_encode(serialize($data)); 254 } 255 # i-appli (i-phone) 256 if ($this->type == 'IAPPLI' && $num_args < 1) 257 { 258 $data = array( 259 'url' => text::toUTF8($args[0]), 260 'cmd' => $args[1] 261 ); 262 for($i = 1; $i < $num_args +1; $i++) 263 { 264 $data['params'][] = $args[$i]; 265 } 266 267 $this->data = base64_encode(serialize($data)); 268 } 269 # preformed email 270 if ($this->type == 'MATMSG' && $num_args == 3) 271 { 272 $data = array( 273 'receiver' => $args[0], 274 'subject' => text::toUTF8($args[1]), 275 'message' => text::toUTF8($args[2]) 276 ); 277 278 $this->data = base64_encode(serialize($data)); 254 279 } 255 280 … … 269 294 if ($this->type == 'URL') 270 295 { 271 $data_array = unserialize( $this->data);296 $data_array = unserialize(base64_decode($this->data)); 272 297 273 298 if ($this->params['use_mebkm']) … … 286 311 if ($this->type == 'MECARD') 287 312 { 288 $data_array = unserialize( $this->data);313 $data_array = unserialize(base64_decode($this->data)); 289 314 290 315 $data = 'MECARD:'; … … 299 324 if ($this->type == 'GEO') 300 325 { 301 $data_array = unserialize( $this->data);326 $data_array = unserialize(base64_decode($this->data)); 302 327 303 328 $data = 'geo:'; … … 311 336 if ($this->type == 'MARKET') 312 337 { 313 $data_array = unserialize( $this->data);338 $data_array = unserialize(base64_decode($this->data)); 314 339 315 340 $data = 'market://search?q='; … … 323 348 if ($this->type == 'ICAL') 324 349 { 325 $data_array = unserialize( $this->data);350 $data_array = unserialize(base64_decode($this->data)); 326 351 327 352 $data = 'BEGIN:VEVENT'."\n"; … … 333 358 return $data; 334 359 } 360 # i-appli 361 if ($this->type == 'IAPPLI') 362 { 363 $data_array = unserialize(base64_decode($this->data)); 364 365 $data = 'LAPL:'; 366 $data .= 'ADFURL:'.$data_array['url'].';'; 367 $data .= 'CMD:'.$data_array['cmd'].';'; 368 foreach($data_array['params'] as $param) 369 { 370 $data .= 'PARAM:'.$param.';'; 371 } 372 $data .= ';'; 373 374 return $data; 375 } 376 # iCAL 377 if ($this->type == 'MATMSG') 378 { 379 $data_array = unserialize(base64_decode($this->data)); 380 381 $data = 'MATMSG:'; 382 $data .= 'TO:'.$data_array['receiver'].';'; 383 $data .= 'SUB:'.$data_array['subject'].';'; 384 $data .= 'BODY:'.$data_array['message'].';'; 385 $data .= ';'; 386 387 return $data; 388 } 335 389 336 390 -
plugins/dcQRcode/inc/lib.dc.qr.code.index.php
r1425 r1426 360 360 <?php 361 361 } 362 363 public static function iappliTab($core,$qrc) 364 { 365 $p = array('','','','','','','','','','','','','','','',''); 366 if (!isset($_POST['IAPPLI'])) $_POST['IAPPLI'] = array('','',$p,128); 367 368 if (!empty($_POST['create_iappli']) && !empty($_POST['IAPPLI'][0]) && !empty($_POST['IAPPLI'][1])) 369 { 370 try 371 { 372 $qrc->setType('IAPPLI'); 373 $qrc->setSize($_POST['IAPPLI'][3]); 374 $params = array(); 375 foreach($_POST['IAPPLI'][2] as $param) 376 { 377 if (!empty($param)) 378 { 379 $params[] = $param; 380 } 381 } 382 $returned_id['IAPPLI'] = $qrc->encode($_POST['IAPPLI'][0],$_POST['IAPPLI'][1],$params); 383 } 384 catch (Exception $e) 385 { 386 $core->error->add($e->getMessage()); 387 } 388 } 389 ?> 390 391 <div class="multi-part" id="qrc_create_iappli" title="<?php echo sprintf(__('Create %s QRcode'),'i-appli'); ?>"> 392 393 <?php if (isset($returned_id['IAPPLI'])) { ?> 394 395 <h2><?php echo __('QRcode successfully created'); ?></h2> 396 <p><?php echo $core->blog->url.$core->url->getBase('dcQRcodeImage').'/'.$returned_id['IAPPLI']; ?>.png</p> 397 <p><img alt="QR code" src="<?php echo $core->blog->url.$core->url->getBase('dcQRcodeImage').'/'.$returned_id['IAPPLI']; ?>.png" /></p> 398 399 <?php } ?> 400 401 <form method="post" action="plugin.php"> 402 403 <h2><?php echo __('Create a QR code'); ?></h2> 404 405 <p><label class="classic"> 406 <?php echo __('ADF URL:'); ?><br /> 407 <?php echo form::field(array('IAPPLI[0]'),60,255,$_POST['IAPPLI'][0]); ?> 408 </label></p> 409 410 <p><label class="classic"> 411 <?php echo __('Command:'); ?><br /> 412 <?php echo form::field(array('IAPPLI[1]'),60,255,$_POST['IAPPLI'][1]); ?> 413 </label></p> 414 415 <?php for($i = 0; $i < 16; $i++) { ?> 416 417 <p><label class="classic"> 418 <?php echo sprintf(__('Param %s'),($i+1)); ?><br /> 419 <?php echo form::field(array('IAPPLI[2]['.$i.']'),60,255,$_POST['IAPPLI'][2][$i]); ?> 420 </label></p> 421 422 <?php } ?> 423 <p class="form-note"><?php echo 424 __('Designates a text string to be set as the parameter sent to the i-appli to be activated. (1 to 255 bytes)').'<br />'. 425 __('The "name" and "value" are separated by a comma (,).').'<br />'. 426 __('16 parameters can be designated within a single LAPL: identifier.'); 427 ?></p> 428 429 <p><label class="classic"> 430 <?php echo __('Image size'); ?><br /> 431 <?php echo form::combo(array('IAPPLI[3]'),self::$combo_img_size,$_POST['IAPPLI'][3]); ?> 432 </label></p> 433 434 <p> 435 <input type="submit" name="create_iappli" value="<?php echo __('Create'); ?>" /> 436 <?php echo 437 form::hidden(array('p'),'dcQRcode'). 438 form::hidden(array('tab'),'qrc_create_iappli'). 439 $core->formNonce(); 440 ?> 441 </p> 442 </form> 443 </div> 444 445 <?php 446 } 447 448 public static function matmsgTab($core,$qrc) 449 { 450 if (!isset($_POST['MATMSG'])) $_POST['MATMSG'] = array('','','',128); 451 452 if (!empty($_POST['create_matmsg']) && !empty($_POST['MATMSG'][0]) && !empty($_POST['MATMSG'][1])) 453 { 454 try 455 { 456 $qrc->setType('MATMSG'); 457 $qrc->setSize($_POST['MATMSG'][3]); 458 $returned_id['MATMSG'] = $qrc->encode($_POST['MATMSG'][0],$_POST['MATMSG'][1],$_POST['MATMSG'][2]); 459 } 460 catch (Exception $e) 461 { 462 $core->error->add($e->getMessage()); 463 } 464 } 465 ?> 466 467 <div class="multi-part" id="qrc_create_matmsg" title="<?php echo sprintf(__('Create %s QRcode'),'MailTo'); ?>"> 468 469 <?php if (isset($returned_id['MATMSG'])) { ?> 470 471 <h2><?php echo __('QRcode successfully created'); ?></h2> 472 <p><?php echo $core->blog->url.$core->url->getBase('dcQRcodeImage').'/'.$returned_id['MATMSG']; ?>.png</p> 473 <p><img alt="QR code" src="<?php echo $core->blog->url.$core->url->getBase('dcQRcodeImage').'/'.$returned_id['MATMSG']; ?>.png" /></p> 474 475 <?php } ?> 476 477 <form method="post" action="plugin.php"> 478 479 <h2><?php echo __('Create a QR code'); ?></h2> 480 481 <p><label class="classic"> 482 <?php echo __('Receiver'); ?><br /> 483 <?php echo form::field(array('MATMSG[0]'),60,255,$_POST['MATMSG'][0]); ?> 484 </label></p> 485 486 <p><label class="classic"> 487 <?php echo __('Subject:'); ?><br /> 488 <?php echo form::field(array('MATMSG[1]'),60,255,$_POST['MATMSG'][1]); ?> 489 </label></p> 490 491 <p><label class="classic"> 492 <?php echo __('Message:'); ?><br /> 493 <?php echo form::field(array('MATMSG[2]'),60,255,$_POST['MATMSG'][2]); ?> 494 </label></p> 495 496 <p><label class="classic"> 497 <?php echo __('Image size'); ?><br /> 498 <?php echo form::combo(array('MATMSG[3]'),self::$combo_img_size,$_POST['MATMSG'][3]); ?> 499 </label></p> 500 501 <p> 502 <input type="submit" name="create_matmsg" value="<?php echo __('Create'); ?>" /> 503 <?php echo 504 form::hidden(array('p'),'dcQRcode'). 505 form::hidden(array('tab'),'qrc_create_matmsg'). 506 $core->formNonce(); 507 ?> 508 </p> 509 </form> 510 </div> 511 512 <?php 513 } 362 514 } 363 515 -
plugins/dcQRcode/index.php
r1425 r1426 214 214 dcQrCodeIndexLib::marketTab($core,$qrc); 215 215 dcQrCodeIndexLib::icalTab($core,$qrc); 216 dcQrCodeIndexLib::iappliTab($core,$qrc); 217 dcQrCodeIndexLib::matmsgTab($core,$qrc); 216 218 } 217 219 -
plugins/dcQRcode/locales/fr/main.lang.php
r1425 r1426 2 2 // Language: français 3 3 // Module: dcQRcode - 0.1 4 // Date: 2009-09-07 0 0:46:254 // Date: 2009-09-07 03:02:47 5 5 // Author: JC Denis, jcdenis@gdwd.com 6 6 // Translated with dcTranslater - 0.2.4 … … 15 15 $GLOBALS['__l10n']['Use MEBKM'] = 'Utiliser MEBKM'; 16 16 17 #inc/lib.dc.qr.code.index.php: 31417 #inc/lib.dc.qr.code.index.php:467 18 18 $GLOBALS['__l10n']['Create %s QRcode'] = 'Créer un %s QRcode'; 19 19 20 #inc/lib.dc.qr.code.index.php: 31820 #inc/lib.dc.qr.code.index.php:471 21 21 $GLOBALS['__l10n']['QRcode successfully created'] = 'QRcode créé avec succès'; 22 22 23 #inc/lib.dc.qr.code.index.php: 32623 #inc/lib.dc.qr.code.index.php:479 24 24 $GLOBALS['__l10n']['Create a QR code'] = 'Créer un QR code'; 25 25 … … 27 27 $GLOBALS['__l10n']['Image size'] = 'Taille de l\'image'; 28 28 29 #inc/lib.dc.qr.code.index.php:7 629 #inc/lib.dc.qr.code.index.php:77 30 30 $GLOBALS['__l10n']['Use MEBKM anchor'] = 'Utiliser la balise MEBKM'; 31 31 32 #inc/lib.dc.qr.code.index.php: 34932 #inc/lib.dc.qr.code.index.php:502 33 33 $GLOBALS['__l10n']['Create'] = 'Créer'; 34 34 35 #inc/lib.dc.qr.code.index.php:13 235 #inc/lib.dc.qr.code.index.php:133 36 36 $GLOBALS['__l10n']['Address:'] = 'Adresse :'; 37 37 38 #inc/lib.dc.qr.code.index.php:13 738 #inc/lib.dc.qr.code.index.php:138 39 39 $GLOBALS['__l10n']['Phone:'] = 'Téléphone :'; 40 40 41 #inc/lib.dc.qr.code.index.php: 19941 #inc/lib.dc.qr.code.index.php:200 42 42 $GLOBALS['__l10n']['Latitude:'] = 'Latitude :'; 43 43 44 #inc/lib.dc.qr.code.index.php:20 444 #inc/lib.dc.qr.code.index.php:205 45 45 $GLOBALS['__l10n']['Longitude:'] = 'Longitude :'; 46 46 47 #inc/lib.dc.qr.code.index.php:2 0947 #inc/lib.dc.qr.code.index.php:210 48 48 $GLOBALS['__l10n']['Altitude:'] = 'Altitude :'; 49 49 50 #inc/lib.dc.qr.code.index.php:26 850 #inc/lib.dc.qr.code.index.php:269 51 51 $GLOBALS['__l10n']['Publisher'] = 'Auteur'; 52 52 53 #inc/lib.dc.qr.code.index.php:26 853 #inc/lib.dc.qr.code.index.php:269 54 54 $GLOBALS['__l10n']['Package'] = 'Paquetage'; 55 55 56 #inc/lib.dc.qr.code.index.php:3 2956 #inc/lib.dc.qr.code.index.php:330 57 57 $GLOBALS['__l10n']['Summary'] = 'Résumé'; 58 58 59 #inc/lib.dc.qr.code.index.php:33 459 #inc/lib.dc.qr.code.index.php:335 60 60 $GLOBALS['__l10n']['Start date:'] = 'Date de début :'; 61 61 62 #inc/lib.dc.qr.code.index.php:3 3962 #inc/lib.dc.qr.code.index.php:340 63 63 $GLOBALS['__l10n']['End date:'] = 'Date de fin :'; 64 64 -
plugins/dcQRcode/locales/fr/main.po
r1425 r1426 1 1 # Language: français 2 2 # Module: dcQRcode - 0.1 3 # Date: 2009-09-07 0 0:46:263 # Date: 2009-09-07 03:02:47 4 4 # Author: JC Denis, jcdenis@gdwd.com 5 5 # Translated with dcTranslater - 0.2.4 … … 20 20 msgstr "Utiliser MEBKM" 21 21 22 #: inc/lib.dc.qr.code.index.php: 31422 #: inc/lib.dc.qr.code.index.php:467 23 23 msgid "Create %s QRcode" 24 24 msgstr "Créer un %s QRcode" 25 25 26 #: inc/lib.dc.qr.code.index.php: 31826 #: inc/lib.dc.qr.code.index.php:471 27 27 msgid "QRcode successfully created" 28 28 msgstr "QRcode créé avec succès" 29 29 30 #: inc/lib.dc.qr.code.index.php: 32630 #: inc/lib.dc.qr.code.index.php:479 31 31 msgid "Create a QR code" 32 32 msgstr "Créer un QR code" … … 36 36 msgstr "Taille de l'image" 37 37 38 #: inc/lib.dc.qr.code.index.php:7 638 #: inc/lib.dc.qr.code.index.php:77 39 39 msgid "Use MEBKM anchor" 40 40 msgstr "Utiliser la balise MEBKM" 41 41 42 #: inc/lib.dc.qr.code.index.php: 34942 #: inc/lib.dc.qr.code.index.php:502 43 43 msgid "Create" 44 44 msgstr "Créer" 45 45 46 #: inc/lib.dc.qr.code.index.php:13 246 #: inc/lib.dc.qr.code.index.php:133 47 47 msgid "Address:" 48 48 msgstr "Adresse :" 49 49 50 #: inc/lib.dc.qr.code.index.php:13 750 #: inc/lib.dc.qr.code.index.php:138 51 51 msgid "Phone:" 52 52 msgstr "Téléphone :" 53 53 54 #: inc/lib.dc.qr.code.index.php: 19954 #: inc/lib.dc.qr.code.index.php:200 55 55 msgid "Latitude:" 56 56 msgstr "Latitude :" 57 57 58 #: inc/lib.dc.qr.code.index.php:20 458 #: inc/lib.dc.qr.code.index.php:205 59 59 msgid "Longitude:" 60 60 msgstr "Longitude :" 61 61 62 #: inc/lib.dc.qr.code.index.php:2 0962 #: inc/lib.dc.qr.code.index.php:210 63 63 msgid "Altitude:" 64 64 msgstr "Altitude :" 65 65 66 #: inc/lib.dc.qr.code.index.php:26 866 #: inc/lib.dc.qr.code.index.php:269 67 67 msgid "Publisher" 68 68 msgstr "Auteur" 69 69 70 #: inc/lib.dc.qr.code.index.php:26 870 #: inc/lib.dc.qr.code.index.php:269 71 71 msgid "Package" 72 72 msgstr "Paquetage" 73 73 74 #: inc/lib.dc.qr.code.index.php:3 2974 #: inc/lib.dc.qr.code.index.php:330 75 75 msgid "Summary" 76 76 msgstr "Résumé" 77 77 78 #: inc/lib.dc.qr.code.index.php:33 478 #: inc/lib.dc.qr.code.index.php:335 79 79 msgid "Start date:" 80 80 msgstr "Date de début :" 81 81 82 #: inc/lib.dc.qr.code.index.php:3 3982 #: inc/lib.dc.qr.code.index.php:340 83 83 msgid "End date:" 84 84 msgstr "Date de fin :" -
plugins/dcQRcode/release.txt
r1425 r1426 1 0.2 20090907 2 * Fixed sql specialchars 3 * Added i-appli support 4 * Added preformed email support 5 1 6 0.1 20090907 2 7 * First lab release
Note: See TracChangeset
for help on using the changeset viewer.