Show
Ignore:
Timestamp:
04/24/08 21:16:21 (2 years ago)
Author:
bchoate
Message:

Updates to blog-side javascript regarding user state and permissions. BugId:79077,69644,67754,69814,79258,62643. Fixed declarations for conditional tags. BugId:79476. Display auth'd user nickname rather than name from comment object. BugId:79475

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/release-36/php/lib/MTViewer.php

    r1956 r2062  
    363363        if (!isset($args['format'])) $args['format'] = null; 
    364364        require_once("MTUtil.php"); 
    365         return format_ts($args['format'], $ts, $blog, isset($args['language']) ? $args['language'] : null); 
     365        $fds = format_ts($args['format'], $ts, $blog, isset($args['language']) ? $args['language'] : null); 
     366        if (isset($args['relative'])) { 
     367            if ($args['relative'] == 'js') { 
     368                preg_match('/(\d\d\d\d)[^\d]?(\d\d)[^\d]?(\d\d)[^\d]?(\d\d)[^\d]?(\d\d)[^\d]?(\d\d)/', $ts, $match); 
     369                list($xx, $y, $mo, $d, $h, $m, $s) = $match; 
     370                $mo--; 
     371                $js = <<<EOT 
     372<script type="text/javascript"> 
     373/* <![CDATA[ */ 
     374document.write(mtRelativeDate(new Date($y,$mo,$d,$h,$m,$s), '$fds')); 
     375/* ]]> */ 
     376</script><noscript>$fds</noscript> 
     377EOT; 
     378                return $js; 
     379            } 
     380        } 
     381        return $fds; 
    366382    } 
    367383