$handle = fopen ($link_tmp_name, 'w');
fwrite ($handle,
$name . NL. $mime_type . NL. $size . NL. $password . NL. $time .
- NL . $md5. NL . ($one_time_download ? 'O' : 'R') . NL . date ('U') .
+ NL . $md5. NL . ($one_time_download ? 'O' : 'R') . NL . time () .
NL . $ip . NL. $delete_link_code . NL . ($crypted ? 'C' : 'O'));
fclose ($handle);
$md5_link = substr(base_16_to_64 (md5_file ($link_tmp_name)), 0, $link_name_length);
if (!count ($a))
continue;
/* Delete transferts older than 1 hour. */
- if (date ('U') - $a['last_edited'] > 3600)
+ if (time () - $a['last_edited'] > 3600)
{
jirafeau_async_delete (basename ($node));
$count++;
str_replace (NL, '', trim ($filename)) . NL .
str_replace (NL, '', trim ($type)) . NL . $password . NL .
$time . NL . ($one_time ? 'O' : 'R') . NL . $ip . NL .
- date ('U') . NL . $code . NL);
+ time () . NL . $code . NL);
fclose ($handle);
return $ref . NL . $code ;
fwrite ($handle,
$a['file_name'] . NL. $a['mime_type'] . NL. $a['key'] . NL .
$a['time'] . NL . $a['onetime'] . NL . $a['ip'] . NL .
- date ('U') . NL . $code . NL);
+ time () . NL . $code . NL);
fclose ($handle);
return $code;
}
fwrite ($handle,
$a['file_name'] . NL . $a['mime_type'] . NL . $size . NL .
$a['key'] . NL . $a['time'] . NL . $md5 . NL . $a['onetime'] . NL .
- date ('U') . NL . $a['ip'] . NL . $delete_link_code . NL . ($crypted ? 'C' : 'O'));
+ time () . NL . $a['ip'] . NL . $delete_link_code . NL . ($crypted ? 'C' : 'O'));
fclose ($handle);
$md5_link = substr(base_16_to_64 (md5_file ($link_tmp_name)), 0, $link_name_length);
$l = s2p ("$md5_link");
fwrite ($handle,
$md5_password . NL .
$ip . NL .
- date ('U') . NL .
+ time () . NL .
$destination . NL);
fclose ($handle);
fwrite ($handle,
$p . NL .
$ip . NL .
- date ('U') . NL .
+ time () . NL .
$destination . NL);
fclose ($handle);
return 'Ok';
return 'Ok';
}
+/**
+ * Replace markers in templates.
+ *
+ * Available markers have the scheme "###MARKERNAME###".
+ *
+ * @param $content string Template text with markers
+ * @param $htmllinebreaks boolean Convert linebreaks to BR-Tags
+ * @return Template with replaced markers
+ */
+function
+jirafeau_replace_markers ($content, $htmllinebreaks = false)
+{
+ $patterns = array(
+ '/###ORGANISATION###/',
+ '/###CONTACTPERSON###/',
+ '/###WEBROOT###/'
+ );
+ $replacements = array(
+ $GLOBALS['cfg']['organisation'],
+ $GLOBALS['cfg']['contactperson'],
+ $GLOBALS['cfg']['web_root']
+ );
+ $content = preg_replace($patterns, $replacements, $content);
+
+ if (true === $htmllinebreaks) {
+ $content = nl2br($content);
+ }
+
+ return $content;
+}
\ No newline at end of file