Dotclear


Ignore:
Timestamp:
11/17/13 20:25:53 (12 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
2.6
Children:
2567:6c11245cbf04, 2568:61c67a7d17fa
Message:

Add some people in CREDITS, remove trailing spaces and tabs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/pages/_public.php

    r1674 r2566  
    3030               $_ctx =& $GLOBALS['_ctx']; 
    3131               $core =& $GLOBALS['core']; 
    32                 
     32 
    3333               $core->blog->withoutPassword(false); 
    34                 
     34 
    3535               $params = new ArrayObject(array( 
    3636                    'post_type' => 'page', 
    3737                    'post_url' => $args)); 
    38                 
     38 
    3939               $core->callBehavior('publicPagesBeforeGetPosts',$params,$args); 
    40                 
     40 
    4141               $_ctx->posts = $core->blog->getPosts($params); 
    42                 
     42 
    4343               $_ctx->comment_preview = new ArrayObject(); 
    4444               $_ctx->comment_preview['content'] = ''; 
     
    4949               $_ctx->comment_preview['preview'] = false; 
    5050               $_ctx->comment_preview['remember'] = false; 
    51                 
     51 
    5252               $core->blog->withoutPassword(true); 
    53                 
    54                 
     53 
     54 
    5555               if ($_ctx->posts->isEmpty()) 
    5656               { 
     
    6262                    $post_id = $_ctx->posts->post_id; 
    6363                    $post_password = $_ctx->posts->post_password; 
    64                      
     64 
    6565                    # Password protected entry 
    6666                    if ($post_password != '' && !$_ctx->preview) 
     
    7272                              $pwd_cookie = array(); 
    7373                         } 
    74                           
     74 
    7575                         # Check for match 
    7676                         if ((!empty($_POST['password']) && $_POST['password'] == $post_password) 
     
    8686                         } 
    8787                    } 
    88                      
     88 
    8989                    $post_comment = 
    9090                         isset($_POST['c_name']) && isset($_POST['c_mail']) && 
    9191                         isset($_POST['c_site']) && isset($_POST['c_content']) && 
    9292                         $_ctx->posts->commentsActive(); 
    93                      
     93 
    9494                    # Posting a comment 
    9595                    if ($post_comment) 
     
    103103                              exit; 
    104104                         } 
    105                           
     105 
    106106                         $name = $_POST['c_name']; 
    107107                         $mail = $_POST['c_mail']; 
     
    109109                         $content = $_POST['c_content']; 
    110110                         $preview = !empty($_POST['preview']); 
    111                           
     111 
    112112                         if ($content != '') 
    113113                         { 
     
    120120                              $content = $core->HTMLfilter($content); 
    121121                         } 
    122                           
     122 
    123123                         $_ctx->comment_preview['content'] = $content; 
    124124                         $_ctx->comment_preview['rawcontent'] = $_POST['c_content']; 
     
    126126                         $_ctx->comment_preview['mail'] = $mail; 
    127127                         $_ctx->comment_preview['site'] = $site; 
    128                           
     128 
    129129                         if ($preview) 
    130130                         { 
    131131                              # --BEHAVIOR-- publicBeforeCommentPreview 
    132132                              $core->callBehavior('publicBeforeCommentPreview',$_ctx->comment_preview); 
    133                                
     133 
    134134                              $_ctx->comment_preview['preview'] = true; 
    135135                         } 
     
    145145                              $cur->comment_status = $core->blog->settings->system->comments_pub ? 1 : -1; 
    146146                              $cur->comment_ip = http::realIP(); 
    147                                
     147 
    148148                              $redir = $_ctx->posts->getURL(); 
    149149                              $redir .= $core->blog->settings->system->url_scan == 'query_string' ? '&' : '?'; 
    150                                
     150 
    151151                              try 
    152152                              { 
     
    154154                                        throw new Exception(__('You must provide a valid email address.')); 
    155155                                   } 
    156                                     
     156 
    157157                                   # --BEHAVIOR-- publicBeforeCommentCreate 
    158158                                   $core->callBehavior('publicBeforeCommentCreate',$cur); 
    159                                    if ($cur->post_id) {                          
     159                                   if ($cur->post_id) { 
    160160                                        $comment_id = $core->blog->addComment($cur); 
    161                                     
     161 
    162162                                        # --BEHAVIOR-- publicAfterCommentCreate 
    163163                                        $core->callBehavior('publicAfterCommentCreate',$cur,$comment_id); 
    164164                                   } 
    165                                     
     165 
    166166                                   if ($cur->comment_status == 1) { 
    167167                                        $redir_arg = 'pub=1'; 
     
    169169                                        $redir_arg = 'pub=0'; 
    170170                                   } 
    171                                     
     171 
    172172                                   header('Location: '.$redir.$redir_arg); 
    173173                              } 
     
    179179                         } 
    180180                    } 
    181                      
     181 
    182182                    # The entry 
    183183                    if ($_ctx->posts->trackbacksActive()) { 
     
    189189          } 
    190190     } 
    191       
     191 
    192192     public static function pagespreview($args) 
    193193     { 
    194194          $core = $GLOBALS['core']; 
    195195          $_ctx = $GLOBALS['_ctx']; 
    196            
     196 
    197197          if (!preg_match('#^(.+?)/([0-9a-z]{40})/(.+?)$#',$args,$m)) { 
    198198               # The specified Preview URL is malformed. 
     
    223223     { 
    224224          global $core, $_ctx; 
    225            
     225 
    226226          if (($w->homeonly == 1 && $core->url->type != 'default') || 
    227227               ($w->homeonly == 2 && $core->url->type == 'default')) { 
    228228               return; 
    229229          } 
    230            
     230 
    231231          $params['post_type'] = 'page'; 
    232232          $params['limit'] = abs((integer) $w->limit); 
    233233          $params['no_content'] = true; 
    234234          $params['post_selected'] = false; 
    235            
     235 
    236236          $sort = $w->sortby; 
    237237          if (!in_array($sort,array('post_title','post_position','post_dt'))) { 
    238238               $sort = 'post_title'; 
    239239          } 
    240            
     240 
    241241          $order = $w->orderby; 
    242242          if ($order != 'asc') { 
     
    244244          } 
    245245          $params['order'] = $sort.' '.$order; 
    246            
     246 
    247247          $rs = $core->blog->getPosts($params); 
    248            
     248 
    249249          if ($rs->isEmpty()) { 
    250250               return; 
    251251          } 
    252            
     252 
    253253          $res = 
    254254          ($w->content_only ? '' : '<div class="pages'.($w->class ? ' '.html::escapeHTML($w->class) : '').'">'). 
    255255          ($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : ''). 
    256256          '<ul>'; 
    257            
     257 
    258258          while ($rs->fetch()) { 
    259259               $class = ''; 
     
    264264               html::escapeHTML($rs->post_title).'</a></li>'; 
    265265          } 
    266            
     266 
    267267          $res .= '</ul>'.($w->content_only ? '' : '</div>'); 
    268            
     268 
    269269          return $res; 
    270270     } 
    271271} 
    272 ?> 
Note: See TracChangeset for help on using the changeset viewer.

Sites map