Example #1
0
function do_asset_version($url, $source)
{
    $path = Asset::path($source);
    if ($path && strpos($path, '://') === false) {
        return $url . '?v=' . File::T($path);
    }
    return $url;
}
Example #2
0
 /**
  * ==========================================================================
  *  GET LIST OF COMMENT DETAIL(S)
  * ==========================================================================
  *
  * -- CODE: -----------------------------------------------------------------
  *
  *    var_dump(Get::commentExtract($input));
  *
  * --------------------------------------------------------------------------
  *
  */
 public static function commentExtract($input)
 {
     $FP = 'comment:';
     if (!$input) {
         return false;
     }
     $extension = File::E($input);
     $update = File::T($input);
     $update_date = !is_null($update) ? date('Y-m-d H:i:s', $update) : null;
     list($post, $id, $parent) = explode('_', File::N($input), 3);
     return array('path' => self::AMF($input, $FP, 'path'), 'time' => self::AMF(Date::format($id), $FP, 'time'), 'update_raw' => self::AMF($update, $FP, 'update_raw'), 'update' => self::AMF($update_date, $FP, 'update'), 'post' => self::AMF((int) Date::format($post, 'U'), $FP, 'post'), 'id' => self::AMF((int) Date::format($id, 'U'), $FP, 'id'), 'parent' => self::AMF($parent === '0000-00-00-00-00-00' ? null : (int) Date::format($parent, 'U'), $FP, 'parent'), 'state' => self::AMF($extension === 'txt' ? 'approved' : 'pending', $FP, 'state'));
 }
Example #3
0
 /**
  * ==========================================================================
  *  GET LIST OF RESPONSE DETAIL(S)
  * ==========================================================================
  *
  * -- CODE: -----------------------------------------------------------------
  *
  *    var_dump(Get::responseExtract($input));
  *
  * --------------------------------------------------------------------------
  *
  */
 public static function responseExtract($input, $FP = 'response:')
 {
     if (!$input) {
         return false;
     }
     $e = File::E($input);
     $update = File::T($input);
     $update_date = !is_null($update) ? date('Y-m-d H:i:s', $update) : null;
     list($post, $id, $parent) = explode('_', File::N($input), 3);
     return array('path' => Filter::colon($FP . 'path', $input, $input), 'time' => Filter::colon($FP . 'time', Date::format($id), $input), 'update_raw' => Filter::colon($FP . 'update_raw', $update, $input), 'update' => Filter::colon($FP . 'update', $update_date, $input), 'post' => Filter::colon($FP . 'post', (int) Date::format($post, 'U'), $input), 'id' => Filter::colon($FP . 'id', (int) Date::format($id, 'U'), $input), 'parent' => Filter::colon($FP . 'parent', $parent === '0000-00-00-00-00-00' ? null : (int) Date::format($parent, 'U'), $input), 'state' => Filter::colon($FP . 'state', Mecha::alter($e, array('txt' => 'approved', 'hold' => 'pending')), $input));
 }