Dotclear

Changeset 2965


Ignore:
Timestamp:
02/21/11 03:11:03 (12 years ago)
Author:
JcDenis
Message:

dcLibIdentica 0.3

Location:
plugins/dcLibIdentica
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcLibIdentica/_define.php

    r2931 r2965  
    1717     /* Description*/         "Identica library for Dotclear's plugins", 
    1818     /* Author */             "JC Denis", 
    19      /* Version */            '0.1-beta2', 
     19     /* Version */            '0.3', 
    2020     /* Permissions */        'admin' 
    2121); 
    22      /* date */          #20110130 
     22     /* date */          #20110220 
    2323?> 
  • plugins/dcLibIdentica/inc/lib.social.sharer.srv.identica.php

    r2931 r2965  
    1616{ 
    1717     protected $part = 'sharer'; 
     18     protected $setting_ns = 'dcLibIdentica'; 
     19     protected $setting_id = 'soCialMe_sharer'; 
    1820      
    1921     protected $define = array( 
     
    2931     ); 
    3032      
    31      protected $config = array('via' => ''); 
     33     protected $config = array( 
     34          'via' => '' 
     35     ); 
    3236      
    3337     protected function init() 
    3438     { 
    35           $config = $this->core->blog->settings->dcLibIdentica->soCialMe_sharer; 
    36           $config = @unserialize(base64_decode($config)); 
    37           if (!is_array($config)) $config = array(); 
    38            
    39           $this->config = array_merge($this->config,$config); 
    40            
     39          $this->readSettings(); 
    4140          $this->available = true; 
    4241          return true; 
     
    5049               'via' => !empty($_POST['dcLibIdentica_soCialMe_via']) ? $_POST['dcLibIdentica_soCialMe_via'] : '' 
    5150          ); 
    52           $config = base64_encode(serialize($this->config)); 
    53            
    54           $this->core->blog->settings->dcLibIdentica->put('soCialMe_sharer',$config); 
     51          $this->writeSettings(); 
    5552     } 
    5653      
     
    7168     } 
    7269      
    73      private function parseContent($type,$record) 
     70     private function parseContent($type,$post) 
    7471     { 
    75           if (!$record || empty($record['title'])) return; 
     72          if (!$post || empty($post['title'])) return; 
    7673           
    77           $url = !empty($record['shorturl']) ? $record['shorturl'] : $record['url']; 
    78           $title = html::clean($record['title']); 
     74          $title = html::clean($post['title']); 
     75          $url = !empty($post['shorturl']) ? $post['shorturl'] : $post['url']; 
     76          $url = 'http://identi.ca//index.php?action=newnotice&status_textarea='.urlencode($title).' '.urlencode($url).(!empty($this->config['via']) ? ' '.$this->config['via'] : ''); 
    7977           
    80           return soCialMeUtils::preloadBox(soCialMeUtils::easyLink( 
    81                'http://identi.ca//index.php?action=newnotice&status_textarea='. 
    82                urlencode($title).' '.urlencode($url). 
    83                (!empty($this->config['via']) ? ' '.$this->config['via'] : ''), 
    84                $this->name, 
    85                $this->url.'pf=dcLibIdentica/inc/icons/identica-'.$type.'.png' 
    86           )); 
     78          $record[0] = array( 
     79               'service' => $this->id, 
     80               'source_name' => $this->name, 
     81               'source_url' => $this->home, 
     82               'source_icon' => $this->icon, 
     83               'preload' => true, 
     84               'title' => sprintf(__('Share on %s'),$this->name), 
     85               'avatar' => $this->url.'pf=dcLibIdentica/inc/icons/identica-'.$type.'.png', 
     86               'url' => $url 
     87          ); 
     88          return $record; 
    8789     } 
    8890      
    89      public function playIconContent($record) 
     91     public function playIconContent($post) 
    9092     { 
    91           return $this->parseContent('icon',$record); 
     93          return $this->parseContent('icon',$post); 
    9294     } 
    9395      
    94      public function playSmallContent($record) 
     96     public function playSmallContent($post) 
    9597     { 
    96           return $this->parseContent('small',$record); 
     98          return $this->parseContent('small',$post); 
    9799     } 
    98100} 
  • plugins/dcLibIdentica/inc/lib.social.writer.srv.identica.php

    r2931 r2965  
    140140               $params = array('status' => (string) $line); 
    141141                
     142               $this->log('Post','playXxxContent','status_update'); 
    142143               $this->oauth->post('statuses/update',$params); 
    143144          } 
  • plugins/dcLibIdentica/release.txt

    r2923 r2965  
     10.3 20110220 
     2 * Followed soCialMe new system 
     3 
    140.1-beta1 20110130 
    25 * First publis release of Identica libraries for Dotclear 
Note: See TracChangeset for help on using the changeset viewer.

Sites map