Dotclear

Changeset 873:f9ef04edef05 for inc/core


Ignore:
Timestamp:
08/14/12 15:43:05 (13 years ago)
Author:
Dsls <dsls@…>
Branch:
sexy
Message:

Turned db fetches into foreach, upgraded jquery

Location:
inc/core
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • inc/core/class.dc.blog.php

    r852 r873  
    8585               $this->settings = new dcSettings($this->core,$this->id); 
    8686                
    87                $this->themes_path = path::fullFromRoot($this->settings->system->themes_path,DC_ROOT); 
    88                $this->public_path = path::fullFromRoot($this->settings->system->public_path,DC_ROOT); 
     87               //$this->themes_path = path::fullFromRoot($this->settings->system->themes_path,DC_ROOT); 
     88               //$this->public_path = path::fullFromRoot($this->settings->system->public_path,DC_ROOT); 
    8989                
    9090               $this->post_status['-2'] = __('pending'); 
     
    359359          } 
    360360           
    361           $rs = $this->con->select($strReq); 
    362           $rs->core = $this->core; 
    363           $rs->extend('rsExtPost'); 
     361          $posts = $this->con->select($strReq); 
     362          $posts->core = $this->core; 
     363          $posts->extend('rsExtPost'); 
    364364           
    365365          # --BEHAVIOR-- coreBlogGetPosts 
    366           $this->core->callBehavior('coreBlogGetPosts',$rs); 
    367            
    368           return $rs; 
     366          $this->core->callBehavior('coreBlogGetPosts',$posts); 
     367           
     368          return $posts; 
    369369     } 
    370370      
     
    406406          } 
    407407           
    408           $rs = $this->getPosts($params); 
    409            
    410           if ($rs->isEmpty()) { 
     408          $posts = $this->getPosts($params); 
     409           
     410          if (count($posts) == 0) { 
    411411               return null; 
    412412          } 
    413413           
    414           return $rs; 
     414          return $posts; 
    415415     } 
    416416      
     
    578578          $limit; 
    579579           
    580           $rs = $this->con->select($strReq); 
    581           $rs->extend('rsExtDates'); 
    582           return $rs; 
     580          $dates = $this->con->select($strReq); 
     581          $dates->extend('rsExtDates'); 
     582          return $dates; 
    583583     } 
    584584      
     
    600600          { 
    601601               # Get ID 
    602                $rs = $this->con->select( 
     602               $max = $this->con->select( 
    603603                    'SELECT MAX(post_id) '. 
    604604                    'FROM '.$this->prefix.'post '  
    605605                    ); 
    606606                
    607                $cur->post_id = (integer) $rs->f(0) + 1; 
     607               $max = $max->current(); 
     608                
     609               $cur->post_id = (integer) $max->f(0) + 1; 
    608610               $cur->blog_id = (string) $this->id; 
    609611               $cur->post_creadt = date('Y-m-d H:i:s'); 
     
    683685                         "AND user_id = '".$this->con->escape($this->core->auth->userID())."' "; 
    684686                
    685                $rs = $this->con->select($strReq); 
    686                 
    687                if ($rs->isEmpty()) { 
     687               $posts = $this->con->select($strReq); 
     688                
     689               if (count($posts) == 0) { 
    688690                    throw new Exception(__('You are not allowed to edit this entry')); 
    689691               } 
     
    725727                         "AND user_id = '".$this->con->escape($this->core->auth->userID())."' "; 
    726728                
    727                $rs = $this->con->select($strReq); 
    728                 
    729                if ($rs->isEmpty()) { 
     729               $posts = $this->con->select($strReq); 
     730                
     731               if (count($posts) == 0) { 
    730732                    throw new Exception(__('You are not allowed to change this entry status')); 
    731733               } 
     
    758760                         "AND user_id = '".$this->con->escape($this->core->auth->userID())."' "; 
    759761                
    760                $rs = $this->con->select($strReq); 
    761                 
    762                if ($rs->isEmpty()) { 
     762               $posts = $this->con->select($strReq); 
     763                
     764               if (count($posts) == 0) { 
    763765                    throw new Exception(__('You are not allowed to mark this entry as selected')); 
    764766               } 
     
    803805                         "AND user_id = '".$this->con->escape($this->core->auth->userID())."' "; 
    804806                
    805                $rs = $this->con->select($strReq); 
    806                 
    807                if ($rs->isEmpty()) { 
     807               $posts = $this->con->select($strReq); 
     808                
     809               if (count($posts) == 0) { 
    808810                    throw new Exception(__('You are not allowed to delete this entry')); 
    809811               } 
     
    829831                    "AND blog_id = '".$this->con->escape($this->id)."' "; 
    830832           
    831           $rs = $this->con->select($strReq); 
     833          $posts = $this->con->select($strReq); 
    832834           
    833835          $now = dt::toUTC(time()); 
    834836          $to_change = new ArrayObject(); 
    835837 
    836           if ($rs->isEmpty()) { 
     838          if (count($posts) == 0) { 
    837839               return; 
    838840          } 
    839841           
    840           while ($rs->fetch()) 
     842          foreach ($posts as $post) 
    841843          { 
    842844               # Now timestamp with post timezone 
    843                $now_tz = $now + dt::getTimeOffset($rs->post_tz,$now); 
     845               $now_tz = $now + dt::getTimeOffset($post->post_tz,$now); 
    844846                
    845847               # Post timestamp 
    846                $post_ts = strtotime($rs->post_dt); 
     848               $post_ts = strtotime($post->post_dt); 
    847849                
    848850               # If now_tz >= post_ts, we publish the entry 
    849851               if ($now_tz >= $post_ts) { 
    850                     $to_change[] = (integer) $rs->post_id; 
     852                    $to_change[] = (integer) $post->post_id; 
    851853               } 
    852854          } 
     
    10401042                    'ORDER BY post_url DESC'; 
    10411043           
    1042           $rs = $this->con->select($strReq); 
    1043            
    1044           if (!$rs->isEmpty()) 
     1044          $urls = $this->con->select($strReq); 
     1045           
     1046          if (count($urls) > 0) 
    10451047          { 
    10461048               if ($this->con->driver() == 'mysql') { 
     
    10571059                         'ORDER BY post_url DESC '; 
    10581060                
    1059                $rs = $this->con->select($strReq); 
     1061               $urls = $this->con->select($strReq); 
    10601062               $a = array(); 
    1061                while ($rs->fetch()) { 
    1062                     $a[] = $rs->post_url; 
     1063               foreach ($urls as $u) { 
     1064                    $a[] = $u->post_url; 
    10631065               } 
    10641066                
  • inc/core/class.dc.core.php

    r852 r873  
    371371          { 
    372372               $strReq = 'SELECT module, version FROM '.$this->prefix.'version'; 
    373                $rs = $this->con->select($strReq); 
     373               $modules = $this->con->select($strReq); 
    374374                
    375                while ($rs->fetch()) { 
    376                     $this->versions[$rs->module] = $rs->version; 
     375               foreach ($modules as $m) { 
     376                    $this->versions[$m->module] = $m->version; 
    377377               } 
    378378          } 
     
    506506          } 
    507507           
    508           $rs = $this->con->select($strReq); 
    509           $rs->extend('rsExtUser'); 
    510           return $rs; 
     508          $users = $this->con->select($strReq); 
     509          $users->extend('rsExtUser'); 
     510          return $users; 
    511511     } 
    512512      
     
    569569           
    570570          # Updating all user's blogs 
    571           $rs = $this->con->select( 
     571          $blogs = $this->con->select( 
    572572               'SELECT DISTINCT(blog_id) FROM '.$this->prefix.'post '. 
    573573               "WHERE user_id = '".$this->con->escape($id)."' " 
    574574               ); 
    575575           
    576           while ($rs->fetch()) { 
    577                $b = new dcBlog($this,$rs->blog_id); 
     576          foreach ($blogs as $blog) { 
     577               $b = new dcBlog($this,$blog->blog_id); 
    578578               $b->triggerBlog(); 
    579579               unset($b); 
     
    598598          } 
    599599           
    600           $rs = $this->getUser($id); 
    601            
    602           if ($rs->nb_post > 0) { 
     600          $user = $this->getUser($id); 
     601           
     602          if ($user->nb_post > 0) { 
    603603               return; 
    604604          } 
     
    624624                    "WHERE user_id = '".$this->con->escape($id)."' "; 
    625625           
    626           $rs = $this->con->select($strReq); 
    627            
    628           return !$rs->isEmpty(); 
     626          $users = $this->con->select($strReq); 
     627           
     628          return (count($users) > 0); 
    629629     } 
    630630      
     
    649649                    "WHERE user_id = '".$this->con->escape($id)."' "; 
    650650           
    651           $rs = $this->con->select($strReq); 
     651          $blogs = $this->con->select($strReq); 
    652652           
    653653          $res = array(); 
    654654           
    655           while ($rs->fetch()) 
     655          foreach ($blogs as $blog) 
    656656          { 
    657                $res[$rs->blog_id] = array( 
    658                     'name' => $rs->blog_name, 
    659                     'url' => $rs->blog_url, 
    660                     'p' => $this->auth->parsePermissions($rs->permissions) 
     657               $res[$blog->blog_id] = array( 
     658                    'name' => $blog->blog_name, 
     659                    'url' => $blog->blog_url, 
     660                    'p' => $this->auth->parsePermissions($blog->permissions) 
    661661               ); 
    662662          } 
     
    829829          } 
    830830           
    831           $rs = $this->con->select($strReq); 
     831          $users = $this->con->select($strReq); 
    832832           
    833833          $res = array(); 
    834834           
    835           while ($rs->fetch()) 
     835          foreach ($users as $u) 
    836836          { 
    837                $res[$rs->user_id] = array( 
    838                     'name' => $rs->user_name, 
    839                     'firstname' => $rs->user_firstname, 
    840                     'displayname' => $rs->user_displayname, 
    841                     'super' => (boolean) $rs->user_super, 
    842                     'p' => $this->auth->parsePermissions($rs->permissions) 
     837               $res[$u->user_id] = array( 
     838                    'name' => $u->user_name, 
     839                    'firstname' => $u->user_firstname, 
     840                    'displayname' => $u->user_displayname, 
     841                    'super' => (boolean) $u->user_super, 
     842                    'p' => $this->auth->parsePermissions($u->permissions) 
    843843               ); 
    844844          } 
     
    10251025                    "WHERE blog_id = '".$this->con->escape($id)."' "; 
    10261026           
    1027           $rs = $this->con->select($strReq); 
    1028            
    1029           return !$rs->isEmpty(); 
     1027          $blogs = $this->con->select($strReq); 
     1028           
     1029          return (count($blogs) > 0); 
    10301030     } 
    10311031      
     
    12531253          $strReq = 'SELECT COUNT(post_id) '. 
    12541254                    'FROM '.$this->prefix.'post'; 
    1255           $rs = $this->con->select($strReq); 
    1256           $count = $rs->f(0); 
     1255          $count = $this->con->select($strReq); 
     1256          $count = $count->current(); 
     1257          $count = $count->f(0); 
    12571258           
    12581259          $strReq = 'SELECT post_id, post_title, post_excerpt_xhtml, post_content_xhtml '. 
     
    12631264          } 
    12641265           
    1265           $rs = $this->con->select($strReq,true); 
     1266          $posts = $this->con->select($strReq,true); 
    12661267           
    12671268          $cur = $this->con->openCursor($this->prefix.'post'); 
    12681269           
    1269           while ($rs->fetch()) 
     1270          foreach ($posts as $post) 
    12701271          { 
    1271                $words = $rs->post_title.' '. $rs->post_excerpt_xhtml.' '. 
    1272                $rs->post_content_xhtml; 
     1272               $words = $post->post_title.' '.    $post->post_excerpt_xhtml.' '. 
     1273               $post->post_content_xhtml; 
    12731274                
    12741275               $cur->post_words = implode(' ',text::splitWords($words)); 
    1275                $cur->update('WHERE post_id = '.(integer) $rs->post_id); 
     1276               $cur->update('WHERE post_id = '.(integer) $post->post_id); 
    12761277               $cur->clean(); 
    12771278          } 
  • inc/core/class.dc.meta.php

    r848 r873  
    198198                    'WHERE post_id = '.$post_id.' '; 
    199199           
    200           $rs = $this->con->select($strReq); 
     200          $rsmeta = $this->con->select($strReq); 
    201201           
    202202          $meta = array(); 
    203           while ($rs->fetch()) { 
    204                $meta[$rs->meta_type][] = $rs->meta_id; 
     203          foreach ($rsmeta as $r) { 
     204               $meta[$r->meta_type][] = $r->meta_id; 
    205205          } 
    206206           
     
    271271          if ($meta_id != null) 
    272272               $params['post_id'] = $post_id; 
    273           $rs = $this->getMetadata($params, false); 
    274           return $this->computeMetaStats($rs); 
     273          $meta = $this->getMetadata($params, false); 
     274          return $this->computeMetaStats($meta); 
    275275     } 
    276276      
     
    345345          } 
    346346           
    347           $rs = $this->con->select($strReq); 
    348           return $rs; 
     347          $meta = $this->con->select($strReq); 
     348          return $meta; 
    349349     } 
    350350      
     
    357357     @return   <b>record</b>  the enriched recordset 
    358358     */ 
    359      public function computeMetaStats($rs) { 
    360           $rs_static = $rs->toStatic(); 
     359     public function computeMetaStats($meta) { 
     360          $meta_static = $meta->toStatic(); 
    361361           
    362362          $max = array(); 
    363           while ($rs_static->fetch()) 
    364           { 
    365                $type = $rs_static->meta_type; 
     363          foreach ($meta_static as $m) 
     364          { 
     365               $type = $m->meta_type; 
    366366               if (!isset($max[$type])) { 
    367                     $max[$type] = $rs_static->count; 
     367                    $max[$type] = $m->count; 
    368368               } else { 
    369                     if ($rs_static->count > $max[$type]) { 
    370                          $max[$type] = $rs_static->count; 
     369                    if ($m->count > $max[$type]) { 
     370                         $max[$type] = $m->count; 
    371371                    } 
    372372               } 
    373373          } 
    374374           
    375           while ($rs_static->fetch()) 
    376           { 
    377                $rs_static->set('meta_id_lower',mb_strtolower($rs_static->meta_id)); 
    378                 
    379                $count = $rs_static->count; 
    380                $percent = ((integer) $rs_static->count) * 100 / $max[$rs_static->meta_type]; 
    381                 
    382                $rs_static->set('percent',(integer) round($percent)); 
    383                $rs_static->set('roundpercent',round($percent/10)*10); 
    384           } 
    385            
    386           return $rs_static; 
     375          foreach ($meta_static as $m) 
     376          { 
     377               $m->set('meta_id_lower',mb_strtolower($m->meta_id)); 
     378                
     379               $count = $m->count; 
     380               $percent = ((integer) $m->count) * 100 / $max[$m->meta_type]; 
     381                
     382               $m->set('percent',(integer) round($percent)); 
     383               $m->set('roundpercent',round($percent/10)*10); 
     384          } 
     385           
     386          return $meta_static; 
    387387     } 
    388388      
     
    487487          $to_update = $to_remove = array(); 
    488488           
    489           $rs = $this->con->select(sprintf($getReq,$this->con->escape($meta_id), 
     489          $meta = $this->con->select(sprintf($getReq,$this->con->escape($meta_id), 
    490490                                   $this->con->escape($type))); 
    491491           
    492           while ($rs->fetch()) { 
    493                $to_update[] = $rs->post_id; 
     492          foreach ($meta as $m) { 
     493               $to_update[] = $m->post_id; 
    494494          } 
    495495           
     
    498498          } 
    499499           
    500           $rs = $this->con->select(sprintf($getReq,$new_meta_id,$type)); 
    501           while ($rs->fetch()) { 
    502                if (in_array($rs->post_id,$to_update)) { 
    503                     $to_remove[] = $rs->post_id; 
    504                     unset($to_update[array_search($rs->post_id,$to_update)]); 
     500          $meta = $this->con->select(sprintf($getReq,$new_meta_id,$type)); 
     501          foreach ($meta as $m) { 
     502               if (in_array($m->post_id,$to_update)) { 
     503                    $to_remove[] = $m->post_id; 
     504                    unset($to_update[array_search($m->post_id,$to_update)]); 
    505505               } 
    506506          } 
     
    558558          } 
    559559           
    560           $rs = $this->con->select($strReq); 
    561            
    562           if ($rs->isEmpty()) return array(); 
     560          $posts = $this->con->select($strReq); 
     561           
     562          if (count($posts) == 0) return array(); 
    563563           
    564564          $ids = array(); 
    565           while ($rs->fetch()) { 
    566                $ids[] = $rs->post_id; 
     565          foreach ($posts as $p) { 
     566               $ids[] = $p->post_id; 
    567567          } 
    568568           
  • inc/core/class.dc.namespace.php

    r270 r873  
    4949     } 
    5050      
    51      private function getSettings($rs=null) 
     51     private function getSettings($settings=null) 
    5252     {     
    53           if ($rs == null) { 
     53          if ($settings == null) { 
    5454               $strReq = 'SELECT blog_id, setting_id, setting_value, '. 
    5555                         'setting_type, setting_label, setting_ns '. 
     
    6161           
    6262               try { 
    63                     $rs = $this->con->select($strReq); 
     63                    $settings = $this->con->select($strReq); 
    6464               } catch (Exception $e) { 
    6565                    trigger_error(__('Unable to retrieve settings:').' '.$this->con->error(), E_USER_ERROR); 
    6666               } 
    6767          } 
    68           while ($rs->fetch()) 
    69           { 
    70                if ($rs->f('setting_ns') != $this->ns){ 
     68          foreach ($settings as $s) 
     69          { 
     70               if ($s->f('setting_ns') != $this->ns){ 
    7171                    break; 
    7272               } 
    73                $id = trim($rs->f('setting_id')); 
    74                $value = $rs->f('setting_value'); 
    75                $type = $rs->f('setting_type'); 
     73               $id = trim($s->f('setting_id')); 
     74               $value = $s->f('setting_value'); 
     75               $type = $s->f('setting_type'); 
    7676                
    7777               if ($type == 'float' || $type == 'double') { 
     
    8383               settype($value,$type); 
    8484                
    85                $array = $rs->blog_id ? 'local' : 'global'; 
     85               $array = $s->blog_id ? 'local' : 'global'; 
    8686                
    8787               $this->{$array.'_settings'}[$id] = array( 
     
    8989                    'value' => $value, 
    9090                    'type' => $type, 
    91                     'label' => (string) $rs->f('setting_label'), 
    92                     'global' => $rs->blog_id == '' 
     91                    'label' => (string) $s->f('setting_label'), 
     92                    'global' => $s->blog_id == '' 
    9393               ); 
    9494          } 
  • inc/core/class.dc.workspace.php

    r147 r873  
    5353     } 
    5454      
    55      private function getPrefs($rs=null) 
     55     private function getPrefs($settings=null) 
    5656     {     
    57           if ($rs == null) { 
     57          if ($settings == null) { 
    5858               $strReq = 'SELECT user_id, pref_id, pref_value, '. 
    5959                         'pref_type, pref_label, pref_ws '. 
     
    6565           
    6666               try { 
    67                     $rs = $this->con->select($strReq); 
     67                    $settings = $this->con->select($strReq); 
    6868               } catch (Exception $e) { 
    6969                    throw $e; 
    7070               } 
    7171          } 
    72           while ($rs->fetch()) 
    73           { 
    74                if ($rs->f('pref_ws') != $this->ws){ 
     72          foreach ($settings as $s) 
     73          { 
     74               if ($s->f('pref_ws') != $this->ws){ 
    7575                    break; 
    7676               } 
    77                $id = trim($rs->f('pref_id')); 
    78                $value = $rs->f('pref_value'); 
    79                $type = $rs->f('pref_type'); 
     77               $id = trim($s->f('pref_id')); 
     78               $value = $s->f('pref_value'); 
     79               $type = $s->f('pref_type'); 
    8080                
    8181               if ($type == 'float' || $type == 'double') { 
     
    8787               settype($value,$type); 
    8888                
    89                $array = $rs->user_id ? 'local' : 'global'; 
     89               $array = $s->user_id ? 'local' : 'global'; 
    9090                
    9191               $this->{$array.'_prefs'}[$id] = array( 
     
    9393                    'value' => $value, 
    9494                    'type' => $type, 
    95                     'label' => (string) $rs->f('pref_label'), 
    96                     'global' => $rs->user_id == '' 
     95                    'label' => (string) $s->f('pref_label'), 
     96                    'global' => $s->user_id == '' 
    9797               ); 
    9898          } 
  • inc/core/class.dc.xmlrpc.php

    r852 r873  
    242242          $this->setUser($user,$pwd); 
    243243          $this->setBlog(); 
    244           $rs = $this->core->blog->getPosts(array( 
     244          $posts = $this->core->blog->getPosts(array( 
    245245               'post_id' => (integer) $post_id, 
    246246               'post_type' => $post_type 
    247247          )); 
    248248           
    249           if ($rs->isEmpty()) { 
     249          if (count($posts) == 0) { 
    250250               throw new Exception('This entry does not exist'); 
    251251          } 
    252252           
    253           return $rs; 
     253          return $posts; 
    254254     } 
    255255      
     
    494494           
    495495          $res = array(); 
    496           while ($posts->fetch()) 
     496          foreach ($posts as $p) 
    497497          { 
    498498               $tres = array(); 
    499499                
    500500               $tres['dateCreated'] = new xmlrpcDate($posts->getTS()); 
    501                $tres['userid'] = $posts->user_id; 
    502                $tres['postid'] = $posts->post_id; 
     501               $tres['userid'] = $p->user_id; 
     502               $tres['postid'] = $p->post_id; 
    503503                
    504504               if ($type == 'blogger') { 
    505                     $tres['content'] = $posts->post_content_xhtml; 
     505                    $tres['content'] = $p->post_content_xhtml; 
    506506               } 
    507507                
    508508               if ($type == 'mt' || $type == 'mw') { 
    509                     $tres['title'] = $posts->post_title; 
     509                    $tres['title'] = $p->post_title; 
    510510               } 
    511511                
    512512               if ($type == 'mw') { 
    513                     $tres['description'] = $posts->post_content_xhtml; 
    514                     $tres['link'] = $tres['permaLink'] = $posts->getURL(); 
    515                     $tres['mt_excerpt'] = $posts->post_excerpt_xhtml; 
     513                    $tres['description'] = $p->post_content_xhtml; 
     514                    $tres['link'] = $tres['permaLink'] = $p->getURL(); 
     515                    $tres['mt_excerpt'] = $p->post_excerpt_xhtml; 
    516516                    $tres['mt_text_more'] = ''; 
    517517                    $tres['mt_convert_breaks'] = ''; 
     
    714714           
    715715          $res = array(); 
    716           while ($posts->fetch()) 
     716          foreach ($posts as $post) 
    717717          { 
    718718               $tres = array( 
    719                     "dateCreated"            => new xmlrpcDate($posts->getTS()), 
    720                     "userid"                 => $posts->user_id, 
    721                     "page_id"                => $posts->post_id, 
    722                     "page_status"            => $this->translateWpStatus((integer) $posts->post_status), 
    723                     "description"            => $posts->post_content_xhtml, 
    724                     "title"                  => $posts->post_title, 
    725                     "link"                   => $posts->getURL(), 
    726                     "permaLink"              => $posts->getURL(), 
    727                     "excerpt"                => $posts->post_excerpt_xhtml, 
     719                    "dateCreated"            => new xmlrpcDate($post->getTS()), 
     720                    "userid"                 => $post->user_id, 
     721                    "page_id"                => $post->post_id, 
     722                    "page_status"            => $this->translateWpStatus((integer) $post->post_status), 
     723                    "description"            => $post->post_content_xhtml, 
     724                    "title"                  => $post->post_title, 
     725                    "link"                   => $post->getURL(), 
     726                    "permaLink"              => $post->getURL(), 
     727                    "excerpt"                => $post->post_excerpt_xhtml, 
    728728                    "text_more"              => '', 
    729                     "wp_slug"                => $posts->post_url, 
    730                     "wp_password"            => $posts->post_password, 
    731                     "wp_author"              => $posts->getAuthorCN(), 
     729                    "wp_slug"                => $post->post_url, 
     730                    "wp_password"            => $post->post_password, 
     731                    "wp_author"              => $post->getAuthorCN(), 
    732732                    "wp_page_parent_id"      => 0, 
    733733                    "wp_page_parent_title"   => '', 
    734                     "wp_page_order"          => $posts->post_position, 
    735                     "wp_author_id"           => $posts->user_id, 
    736                     "wp_author_display_name" => $posts->getAuthorCN(), 
    737                     "date_created_gmt"       => new xmlrpcDate(dt::iso8601($posts->getTS(),$posts->post_tz)), 
     734                    "wp_page_order"          => $post->post_position, 
     735                    "wp_author_id"           => $post->user_id, 
     736                    "wp_author_display_name" => $post->getAuthorCN(), 
     737                    "date_created_gmt"       => new xmlrpcDate(dt::iso8601($post->getTS(),$post->post_tz)), 
    738738                    "custom_fields"          => array(), 
    739739                    "wp_page_template"       => 'default' 
     
    790790          $this->setBlog(); 
    791791           
    792           $rs = $this->core->getBlogPermissions($this->core->blog->id); 
     792          $perms = $this->core->getBlogPermissions($this->core->blog->id); 
    793793          $res = array(); 
    794794           
    795           foreach($rs as $k => $v) 
     795          foreach($perms as $k => $v) 
    796796          { 
    797797               $res[] = array( 
     
    817817          $f_url = $this->core->blog->url. 
    818818               $this->core->url->getURLFor('tag_feed','%s'); 
    819           while ($tags->fetch()) 
     819          foreach ($tags as $tag) 
    820820          { 
    821821               $res[] = array( 
    822                     'tag_id'       => $tags->meta_id, 
    823                     'name'         => $tags->meta_id, 
    824                     'count'        => $tags->count, 
    825                     'slug'         => $tags->meta_id, 
    826                     'html_url'     => sprintf($url,$tags->meta_id), 
    827                     'rss_url'      => sprintf($f_url,$tags->meta_id) 
     822                    'tag_id'       => $tag->meta_id, 
     823                    'name'         => $tag->meta_id, 
     824                    'count'        => $tag->count, 
     825                    'slug'         => $tag->meta_id, 
     826                    'html_url'     => sprintf($url,$tag->meta_id), 
     827                    'rss_url'      => sprintf($f_url,$tag->meta_id) 
    828828               ); 
    829829          } 
Note: See TracChangeset for help on using the changeset viewer.

Sites map