Dotclear

Changeset 1426


Ignore:
Timestamp:
09/07/09 05:05:29 (14 years ago)
Author:
JcDenis
Message:

dcQRcode 0.2:

  • Fixed sql specialchars
  • Added i-appli support
  • Added preformed email support
Location:
plugins/dcQRcode
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcQRcode/_define.php

    r1425 r1426  
    1717     /* Description*/         "Use QR code on your blog", 
    1818     /* Author */             "JC Denis", 
    19      /* Version */            '0.1', 
     19     /* Version */            '0.2', 
    2020     /* Permissions */        'admin' 
    2121); 
  • plugins/dcQRcode/inc/class.dc.qr.code.php

    r1425 r1426  
    105105               $cur->qrcode_id = (integer) $this->id; 
    106106               $cur->qrcode_data = (string) $this->data; 
    107                $cur->qrcode_size = (string) $this->size; 
     107               $cur->qrcode_size = (integer) $this->size; 
    108108 
    109109               $cur->insert(); 
     
    206206               ); 
    207207 
    208                $this->data = serialize($data); 
     208               $this->data = base64_encode(serialize($data)); 
    209209          } 
    210210           
     
    219219               ); 
    220220 
    221                $this->data = serialize($data); 
     221               $this->data = base64_encode(serialize($data)); 
    222222          } 
    223223          # geo 
     
    230230               ); 
    231231 
    232                $this->data = serialize($data); 
     232               $this->data = base64_encode(serialize($data)); 
    233233          } 
    234234          # market (Android) 
     
    240240               ); 
    241241 
    242                $this->data = serialize($data); 
     242               $this->data = base64_encode(serialize($data)); 
    243243          } 
    244244          # iCAL 
     
    251251               ); 
    252252 
    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)); 
    254279          } 
    255280 
     
    269294          if ($this->type == 'URL') 
    270295          { 
    271                $data_array = unserialize($this->data); 
     296               $data_array = unserialize(base64_decode($this->data)); 
    272297 
    273298               if ($this->params['use_mebkm']) 
     
    286311          if ($this->type == 'MECARD') 
    287312          { 
    288                $data_array = unserialize($this->data); 
     313               $data_array = unserialize(base64_decode($this->data)); 
    289314 
    290315               $data = 'MECARD:'; 
     
    299324          if ($this->type == 'GEO') 
    300325          { 
    301                $data_array = unserialize($this->data); 
     326               $data_array = unserialize(base64_decode($this->data)); 
    302327 
    303328               $data = 'geo:'; 
     
    311336          if ($this->type == 'MARKET') 
    312337          { 
    313                $data_array = unserialize($this->data); 
     338               $data_array = unserialize(base64_decode($this->data)); 
    314339 
    315340               $data = 'market://search?q='; 
     
    323348          if ($this->type == 'ICAL') 
    324349          { 
    325                $data_array = unserialize($this->data); 
     350               $data_array = unserialize(base64_decode($this->data)); 
    326351 
    327352               $data = 'BEGIN:VEVENT'."\n"; 
     
    333358               return $data; 
    334359          } 
     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          } 
    335389 
    336390 
  • plugins/dcQRcode/inc/lib.dc.qr.code.index.php

    r1425 r1426  
    360360          <?php 
    361361     } 
     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     } 
    362514} 
    363515 
  • plugins/dcQRcode/index.php

    r1425 r1426  
    214214     dcQrCodeIndexLib::marketTab($core,$qrc); 
    215215     dcQrCodeIndexLib::icalTab($core,$qrc); 
     216     dcQrCodeIndexLib::iappliTab($core,$qrc); 
     217     dcQrCodeIndexLib::matmsgTab($core,$qrc); 
    216218} 
    217219 
  • plugins/dcQRcode/locales/fr/main.lang.php

    r1425 r1426  
    22// Language: français  
    33// Module: dcQRcode - 0.1 
    4 // Date: 2009-09-07 00:46:25  
     4// Date: 2009-09-07 03:02:47  
    55// Author: JC Denis, jcdenis@gdwd.com 
    66// Translated with dcTranslater - 0.2.4  
     
    1515$GLOBALS['__l10n']['Use MEBKM'] = 'Utiliser MEBKM'; 
    1616 
    17 #inc/lib.dc.qr.code.index.php:314 
     17#inc/lib.dc.qr.code.index.php:467 
    1818$GLOBALS['__l10n']['Create %s QRcode'] = 'Créer un %s QRcode'; 
    1919 
    20 #inc/lib.dc.qr.code.index.php:318 
     20#inc/lib.dc.qr.code.index.php:471 
    2121$GLOBALS['__l10n']['QRcode successfully created'] = 'QRcode créé avec succès'; 
    2222 
    23 #inc/lib.dc.qr.code.index.php:326 
     23#inc/lib.dc.qr.code.index.php:479 
    2424$GLOBALS['__l10n']['Create a QR code'] = 'Créer un QR code'; 
    2525 
     
    2727$GLOBALS['__l10n']['Image size'] = 'Taille de l\'image'; 
    2828 
    29 #inc/lib.dc.qr.code.index.php:76 
     29#inc/lib.dc.qr.code.index.php:77 
    3030$GLOBALS['__l10n']['Use MEBKM anchor'] = 'Utiliser la balise MEBKM'; 
    3131 
    32 #inc/lib.dc.qr.code.index.php:349 
     32#inc/lib.dc.qr.code.index.php:502 
    3333$GLOBALS['__l10n']['Create'] = 'Créer'; 
    3434 
    35 #inc/lib.dc.qr.code.index.php:132 
     35#inc/lib.dc.qr.code.index.php:133 
    3636$GLOBALS['__l10n']['Address:'] = 'Adresse :'; 
    3737 
    38 #inc/lib.dc.qr.code.index.php:137 
     38#inc/lib.dc.qr.code.index.php:138 
    3939$GLOBALS['__l10n']['Phone:'] = 'Téléphone :'; 
    4040 
    41 #inc/lib.dc.qr.code.index.php:199 
     41#inc/lib.dc.qr.code.index.php:200 
    4242$GLOBALS['__l10n']['Latitude:'] = 'Latitude :'; 
    4343 
    44 #inc/lib.dc.qr.code.index.php:204 
     44#inc/lib.dc.qr.code.index.php:205 
    4545$GLOBALS['__l10n']['Longitude:'] = 'Longitude :'; 
    4646 
    47 #inc/lib.dc.qr.code.index.php:209 
     47#inc/lib.dc.qr.code.index.php:210 
    4848$GLOBALS['__l10n']['Altitude:'] = 'Altitude :'; 
    4949 
    50 #inc/lib.dc.qr.code.index.php:268 
     50#inc/lib.dc.qr.code.index.php:269 
    5151$GLOBALS['__l10n']['Publisher'] = 'Auteur'; 
    5252 
    53 #inc/lib.dc.qr.code.index.php:268 
     53#inc/lib.dc.qr.code.index.php:269 
    5454$GLOBALS['__l10n']['Package'] = 'Paquetage'; 
    5555 
    56 #inc/lib.dc.qr.code.index.php:329 
     56#inc/lib.dc.qr.code.index.php:330 
    5757$GLOBALS['__l10n']['Summary'] = 'Résumé'; 
    5858 
    59 #inc/lib.dc.qr.code.index.php:334 
     59#inc/lib.dc.qr.code.index.php:335 
    6060$GLOBALS['__l10n']['Start date:'] = 'Date de début :'; 
    6161 
    62 #inc/lib.dc.qr.code.index.php:339 
     62#inc/lib.dc.qr.code.index.php:340 
    6363$GLOBALS['__l10n']['End date:'] = 'Date de fin :'; 
    6464 
  • plugins/dcQRcode/locales/fr/main.po

    r1425 r1426  
    11# Language: français 
    22# Module: dcQRcode - 0.1 
    3 # Date: 2009-09-07 00:46:26 
     3# Date: 2009-09-07 03:02:47 
    44# Author: JC Denis, jcdenis@gdwd.com 
    55# Translated with dcTranslater - 0.2.4 
     
    2020msgstr "Utiliser MEBKM" 
    2121 
    22 #: inc/lib.dc.qr.code.index.php:314 
     22#: inc/lib.dc.qr.code.index.php:467 
    2323msgid "Create %s QRcode" 
    2424msgstr "Créer un %s QRcode" 
    2525 
    26 #: inc/lib.dc.qr.code.index.php:318 
     26#: inc/lib.dc.qr.code.index.php:471 
    2727msgid "QRcode successfully created" 
    2828msgstr "QRcode créé avec succès" 
    2929 
    30 #: inc/lib.dc.qr.code.index.php:326 
     30#: inc/lib.dc.qr.code.index.php:479 
    3131msgid "Create a QR code" 
    3232msgstr "Créer un QR code" 
     
    3636msgstr "Taille de l'image" 
    3737 
    38 #: inc/lib.dc.qr.code.index.php:76 
     38#: inc/lib.dc.qr.code.index.php:77 
    3939msgid "Use MEBKM anchor" 
    4040msgstr "Utiliser la balise MEBKM" 
    4141 
    42 #: inc/lib.dc.qr.code.index.php:349 
     42#: inc/lib.dc.qr.code.index.php:502 
    4343msgid "Create" 
    4444msgstr "Créer" 
    4545 
    46 #: inc/lib.dc.qr.code.index.php:132 
     46#: inc/lib.dc.qr.code.index.php:133 
    4747msgid "Address:" 
    4848msgstr "Adresse :" 
    4949 
    50 #: inc/lib.dc.qr.code.index.php:137 
     50#: inc/lib.dc.qr.code.index.php:138 
    5151msgid "Phone:" 
    5252msgstr "Téléphone :" 
    5353 
    54 #: inc/lib.dc.qr.code.index.php:199 
     54#: inc/lib.dc.qr.code.index.php:200 
    5555msgid "Latitude:" 
    5656msgstr "Latitude :" 
    5757 
    58 #: inc/lib.dc.qr.code.index.php:204 
     58#: inc/lib.dc.qr.code.index.php:205 
    5959msgid "Longitude:" 
    6060msgstr "Longitude :" 
    6161 
    62 #: inc/lib.dc.qr.code.index.php:209 
     62#: inc/lib.dc.qr.code.index.php:210 
    6363msgid "Altitude:" 
    6464msgstr "Altitude :" 
    6565 
    66 #: inc/lib.dc.qr.code.index.php:268 
     66#: inc/lib.dc.qr.code.index.php:269 
    6767msgid "Publisher" 
    6868msgstr "Auteur" 
    6969 
    70 #: inc/lib.dc.qr.code.index.php:268 
     70#: inc/lib.dc.qr.code.index.php:269 
    7171msgid "Package" 
    7272msgstr "Paquetage" 
    7373 
    74 #: inc/lib.dc.qr.code.index.php:329 
     74#: inc/lib.dc.qr.code.index.php:330 
    7575msgid "Summary" 
    7676msgstr "Résumé" 
    7777 
    78 #: inc/lib.dc.qr.code.index.php:334 
     78#: inc/lib.dc.qr.code.index.php:335 
    7979msgid "Start date:" 
    8080msgstr "Date de début :" 
    8181 
    82 #: inc/lib.dc.qr.code.index.php:339 
     82#: inc/lib.dc.qr.code.index.php:340 
    8383msgid "End date:" 
    8484msgstr "Date de fin :" 
  • plugins/dcQRcode/release.txt

    r1425 r1426  
     10.2 20090907 
     2 * Fixed sql specialchars 
     3 * Added i-appli support 
     4 * Added preformed email support 
     5 
    160.1 20090907 
    27 * First lab release 
Note: See TracChangeset for help on using the changeset viewer.

Sites map