void cache_file(
string
$html, string
$filename
)
|
|
writes a file to disk given it's content and the path.
Parameters:
|
string |
$html: |
content of the file |
|
string |
$filename: |
path to the file. |
void cache_ram_file(
string
$upload_target, string
$year, string
$month
)
|
|
caches a ram file to disk given a upload target, a year and a month.
Parameters:
|
string |
$upload_target: |
path to a realaudio/video file |
|
string |
$year: |
a given year in yyyy format |
|
string |
$month: |
a given year in mm format |
void cache_var(
mixed
$var, string
$var_name, string
$filename, [string
$prefix = '_LITERAL_'], bool
$force_var
)
|
|
Writes an array or other variable to disk, in a php-readable format
if the variable is an array with an element that is a string beginning with the value '_LITERAL_' or optional alternative unique prefix, then it will fix the output so that the variable remains unparsed
Parameters:
|
mixed |
$var: |
|
|
string |
$var_name: |
|
|
string |
$filename: |
|
|
string |
$prefix: |
|
|
bool |
$force_var: |
|
void check_file_path(
$string
$filename
)
|
|
this method will check if your filepath is ok (so no .. and stuff like that).
Parameters:
string clean(
string
$dirty_string
)
|
|
adds slashes to a string if get_magic_quotes_runtime isn't set
Parameters:
void cleanup_email(
mixed
$email
)
|
|
cleans up an email_address
void cleanup_filename(
mixed
$filename
)
|
|
cleans up the name of file
void cleanup_html_value(
mixed
$user_input
)
|
|
cleans up a value that is published as html
void cleanup_number(
mixed
$number
)
|
|
cleans up a number
void cleanup_pathname(
mixed
$pathname
)
|
|
cleans up the name of a path.
Removes dangerous HTML from data submitted via POST
Redefined in descendants as:
void cleanup_text_value(
mixed
$user_input
)
|
|
cleans up a value that is allowed to contain limited html (an article submitted as text/plain)
void cleanup_value(
mixed
$user_input
)
|
|
cleans up a value that should not contain any html at all (the normal procedure)
void clear_error_status(
)
|
|
Clears any existing error status
void clear_update_status(
)
|
|
Clears any existing update status
void create_dir_recursive(
string
$dir
)
|
|
creates a directory recursively
Parameters:
|
string |
$dir: |
the path of the directory to create |
void create_upload_dirs(
)
|
|
this will create the directories we move the article and uploaded files to if they don't exist yet
string display_error_status(
)
|
|
displays the error status.
string do_form(
string
$form_name, array
$options, [array
$match_array = array()], mixed
$match
)
|
|
calls the form we want to use in the publish process given it's name and various options.
Parameters:
|
string |
$form_name: |
string containing the name the form will have in the html. |
|
array |
$options: |
array containing the options we have to render for a given form. |
|
array |
$match_array: |
array containing all the matches (needed for checkbox and multiple forms). |
|
mixed |
$match: |
a string or an integer we can use to set selected="selected" in select forms. |
dumps a variable encapsulated in html
Parameters:
array get_allowed_text_tags(
)
|
|
returns {$link $allowed_text_tags}
string get_antispam_mail(
string
$email
)
|
|
returns an emailaddress with antispam blocks in.
Parameters:
Redefined in descendants as:
void get_cached_var(
string
$varname, [string
$filename = null]
)
|
|
Retrieve a cached variable from disk
Optional parameter $filename specifies the file path Defaults to looking for "{$varname}.inc" in SF_CACHE_PATH
Parameters:
|
string |
$varname: |
varname |
|
string |
$filename: |
filename |
returns an array of months from 01 to 12
returns an array of years for your calendar
Redefined in descendants as:
Returns true if there is an existing error
array list_directories(
string
$path
)
|
|
List the directories in the specified path
Parameters:
array list_files(
string
$path, [string
$filter = NULL]
)
|
|
Lists the files in the specified directory path
Matching the specified filter (simple string position match)
Parameters:
|
string |
$path: |
|
|
string |
$filter: |
|
string make_checkbox_form(
mixed
$checkbox_name, array
$options, mixed
$checked, string
$select_name, array
$match
)
|
|
renders a checkbox form given it's name, an array with options and an option-array to preselect
Parameters:
|
string |
$select_name: |
the name of the select form. |
|
array |
$options: |
an array contain all the <option ...> we'll need |
|
array |
$match: |
an array containing the options we want to preselect. |
string make_multiple_form(
string
$select_name, array
$options, array
$match
)
|
|
renders a multiple given it's name, an array with options and an option-array to preselect
Parameters:
|
string |
$select_name: |
the name of the select form. |
|
array |
$options: |
an array contain all the <option ...> we'll need |
|
array |
$match: |
an array containing the options we want to preselect. |
string make_select_form(
string
$select_name, array
$options, mixed
$match
)
|
|
renders a select form given it's name, an array with options and an option to preselect
Parameters:
|
string |
$select_name: |
the name of the select form. |
|
array |
$options: |
an array contain all the <option ...> we'll need |
|
mixed |
$match: |
a string/integer we want to match again to preselect that option. |
void make_video_thumbnail(
string
$filename, string
$mimetype
)
|
|
make a "video thumbnail" of a video uploads
NOTES: depends on ffmpeg only works on avi, mpeg and some mov
Parameters:
|
string |
$filename: |
|
|
string |
$mimetype: |
|
Information Tags:
mirrors your html files.
placed the method here since every Page based class extends from cache
mirrors your media files
placed method here since the media-file validation methods are here so it should be easy to get the array stored in cache_class somehow
void process_file_metadata(
string
$filename, string
$mimetype
)
|
|
gets metadata from media file headers and stores them
NOTES: right now, just works on audio files (ogg vorbis, mp3) also, depends upon PEAR's File_Ogg package (use "pear install File_Ogg" ... may also have to do "pear config-set preferred_state beta" )
TODO: sane rounding for the ogg metadata numbers get mp3 working actually store the metadata (in db table) pdf support (pdfinfo)
Parameters:
|
string |
$filename: |
|
|
string |
$mimetype: |
|
Information Tags:
process any uploads from a POST
mixed rel2abs(
mixed
$htmlstr
)
|
|
Replaces any relative links with absolute links
works on both hrefs and most img tags
Parameters:
void rel2absfield(
string
$fieldstr
)
|
|
Like rel2abs, replaces relative links with absolute links
works on a field containing the URL rather than expecting HTML code
Parameters:
string render_entities(
string
$html
)
|
|
strips tags and replaces <,> & ' out of a given html string by their htmlentities
Parameters:
|
string |
$html: |
html that needs to be cleaned a little. |
string render_protest_date(
string
$created
)
|
|
This creates the protest-style dates, like J18 given an input date-string.
Parameters:
|
string |
$created: |
string containing the date |
string render_var(
mixed
$var, string
$var_name, [string
$prefix = '_LITERAL_'], bool
$force_var
)
|
|
Renders an array or other variable into php code
if the variable is an array with an element that is a string beginning with the value '_LITERAL_' or optional alternative unique prefix, then it will fix the output so that the variable remains unparsed
by default we'll cache vars as under the $this->tkeys array so they are directly assigned to smarty. if the optional $force_var is set to 1, we'll cache the var under it's own name.
Parameters:
|
mixed |
$var: |
|
|
string |
$var_name: |
|
|
string |
$prefix: |
|
|
bool |
$force_var: |
|
string render_yearmonth_link(
string
$new_year, string
$new_month
)
|
|
returns a file path given a year and month
Parameters:
|
string |
$new_year: |
string containing the year in yyyy format |
|
string |
$new_month: |
string containing the month in mm format. |
void replace_rte_tags(
mixed
$user_input
)
|
|
startx: replaces ugly tags from rte editor
int set_date_from_smarty(
array
$date_array
)
|
|
sets a unix timestamp from a smarty date array
Parameters:
API Tags:
string set_mysql_date_from_smarty(
array
$date_array
)
|
|
sets a mysql datetime from a smarty date/time array
Parameters:
|
array |
$date_array: |
date_array |
API Tags:
void sf_error_log(
string
$error
)
|
|
logs an error. (don't know how it's used atm)
Parameters:
void update_error_status(
string
$update_string
)
|
|
Allows easy access to adding an update string
Parameters:
|
string |
$update_string: |
string containing the error. |
void update_status(
string
$update_string
)
|
|
Allows easy access to adding an update string
Parameters:
|
string |
$update_string: |
string containing the cachestatus |
bool validate_event_post(
)
|
|
does error checking for $_POST data for a posted event.
does error checking on $_POST data for an article or comment.
error checking for files submitted via POST
while here we orignally only did error checking for uploaded files, we now also will call the Image::validate_image() from here.