Dotclear


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

Turned db fetches into foreach, upgraded jquery

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin/blogs.php

    r792 r873  
    6161try { 
    6262     $counter = $core->getBlogs($params,1); 
    63      $rs = $core->getBlogs($params); 
     63     $blogs = $core->getBlogs($params); 
    6464     $nb_blog = $counter->f(0); 
    6565} catch (Exception $e) { 
     
    139139          '</tr>'; 
    140140           
    141           while ($rs->fetch()) { 
    142                echo blogLine($rs); 
     141          foreach ($blogs as $blog) { 
     142               echo blogLine($blog); 
    143143          } 
    144144           
     
    151151dcPage::close(); 
    152152 
    153 function blogLine($rs) 
     153function blogLine($blog) 
    154154{ 
    155155     global $core; 
    156156      
    157      $blog_id = html::escapeHTML($rs->blog_id); 
     157     $blog_id = html::escapeHTML($blog->blog_id); 
    158158     $edit_link = ''; 
    159159      
     
    165165     } 
    166166      
    167      $img_status = $rs->blog_status == 1 ? 'check-on' : 'check-off'; 
    168      $txt_status = $GLOBALS['core']->getBlogStatus($rs->blog_status); 
     167     $img_status = $blog->blog_status == 1 ? 'check-on' : 'check-off'; 
     168     $txt_status = $GLOBALS['core']->getBlogStatus($blog->blog_status); 
    169169     $img_status = sprintf('<img src="images/%1$s.png" alt="%2$s" title="%2$s" />',$img_status,$txt_status); 
    170170     $offset = dt::getTimeOffset($core->auth->getInfo('user_tz')); 
    171      $blog_upddt = dt::str(__('%Y-%m-%d %H:%M'),strtotime($rs->blog_upddt) + $offset); 
     171     $blog_upddt = dt::str(__('%Y-%m-%d %H:%M'),strtotime($blog->blog_upddt) + $offset); 
    172172      
    173173     return 
    174174     '<tr class="line">'. 
    175      '<td class="maximal"><a href="index.php?switchblog='.$rs->blog_id.'" '. 
    176      'title="'.sprintf(__('Switch to blog %s'),$rs->blog_id).'">'. 
    177      html::escapeHTML($rs->blog_name).'</a></td>'. 
     175     '<td class="maximal"><a href="index.php?switchblog='.$blog->blog_id.'" '. 
     176     'title="'.sprintf(__('Switch to blog %s'),$blog->blog_id).'">'. 
     177     html::escapeHTML($blog->blog_name).'</a></td>'. 
    178178     '<td class="nowrap">'.$blog_upddt.'</td>'. 
    179      '<td class="nowrap">'.$core->countBlogPosts($rs->blog_id).'</td>'. 
     179     '<td class="nowrap">'.$core->countBlogPosts($blog->blog_id).'</td>'. 
    180180     '<td class="nowrap">'.$blog_id.'</td>'. 
    181181     '<td>'.$edit_link.'</td>'. 
Note: See TracChangeset for help on using the changeset viewer.

Sites map