Esempio n. 1
0
 /**
  * Replaces inline tags when showing a file
  *
  * @param string $text The text to perform the replacement upon
  * @param DH_Hole $hole The Hole object for the file we are displaying
  * @param DH_File $file The File object representing the file we are displaying
  * @return string The original text with any replacements made
  **/
 function tags_inline($text, $hole, $file)
 {
     $options = $this->get_options();
     $text = str_replace('$url$', $file->url($hole, '', $options['google']), $text);
     $text = str_replace('$size$', $file->bytes($file->filesize($hole)), $text);
     $text = str_replace('$desc$', $file->description, $text);
     $text = str_replace('$updated$', date(get_option('date_format'), $file->updated_at), $text);
     $text = str_replace('$hits$', number_format($file->hits), $text);
     $text = str_replace('$version$', $file->version, $text);
     $text = str_replace('$icon$', $file->icon($hole, $this->url(), $options['google']), $text);
     $text = str_replace('$svn$', $file->svn(), $text);
     $text = str_replace('$href$', $file->url_ref($hole), $text);
     $text = str_replace('$name$', $file->name(), $text);
     $text = str_replace('$iconref$', $file->icon_ref($this->url()), $text);
     $text = str_replace('$md5$', md5($file->file($hole)), $text);
     return $text;
 }