Procedural File: tce_functions_general.php
Source Location: /shared/code/tce_functions_general.php
Page Details:
General functions.
Tags:
F_check_unique [line 120]
bool F_check_unique(
string $table, string $where, [mixed $fieldname = FALSE], [mixed $fieldid = FALSE])
|
|
Check if specified fields are unique on table.
Tags:
Parameters
string |
$table |
table name |
string |
$where |
SQL where clause |
mixed |
$fieldname |
name of table column to check |
mixed |
$fieldid |
ID of table row to check |
F_compact_string [line 173]
converted F_compact_string(
string $string)
|
|
Remove the following characters: - "\t" (ASCII 9 (0x09)), a tab.
- "\n" (ASCII 10 (0x0A)), a new line (line feed)
- "\r" (ASCII 13 (0x0D)), a carriage return
- "\0" (ASCII 0 (0x00)), the NUL-byte
- "\x0B" (ASCII 11 (0x0B)), a vertical tab
Tags:
Parameters
string |
$string |
input string to convert |
F_count_rows [line 58]
number F_count_rows(
string $dbtable, [string $where = ''])
|
|
Count rows of the given table.
Tags:
Parameters
string |
$dbtable |
database table name |
string |
$where |
optional where SQL clause (including the WHERE keyword). |
F_db_getUTCoffset [line 385]
string F_db_getUTCoffset(
string $timezone)
|
|
Returns the UTC time offset yo be used with CONVERT_TZ function
Tags:
Parameters
string |
$timezone |
current user timezone |
F_empty_to_null [line 79]
string F_empty_to_null(
string $str)
|
|
Prepare field value for SQL query. Returns the quoted string if not empty, NULL otherwise.
Tags:
Parameters
string |
$str |
string to check. |
F_formatPdfPercentage [line 355]
string F_formatPdfPercentage(
float $num)
|
|
format a percentage number
Parameters
float |
$num |
number to be formatted |
F_formatPercentage [line 346]
formatted F_formatPercentage(
float $num)
|
|
Format a percentage number.
Tags:
Parameters
float |
$num |
number to be formatted |
F_formatXMLPercentage [line 365]
string F_formatXMLPercentage(
float $num)
|
|
format a percentage number for XML
Parameters
float |
$num |
number to be formatted |
F_getBoolean [line 105]
boolean F_getBoolean(
string $str)
|
|
Returns boolean value from string. This function is needed to get the right boolean value from boolean field returned by PostgreSQL query.
Tags:
Parameters
string |
$str |
string to check. |
F_getUTCoffset [line 374]
int F_getUTCoffset(
string $timezone)
|
|
Returns the UTC time offset in seconds
Tags:
Parameters
string |
$timezone |
current user timezone |
F_replace_angulars [line 183]
converted F_replace_angulars(
string $str)
|
|
Replace angular parenthesis with html equivalents (html entities).
Tags:
Parameters
string |
$str |
input string to convert |
F_substr_utf8 [line 195]
substring F_substr_utf8(
string $str, [int $start = 0], int $length)
|
|
Return part of a string removing remaining non-ASCII characters.
Parameters
string |
$str |
input string |
int |
$start |
substring start index |
int |
$length |
substring max lenght |
F_text_to_xml [line 212]
converted F_text_to_xml(
string $str)
|
|
Escape some special characters (< > &).
Tags:
Parameters
string |
$str |
input string to convert |
F_xml_to_text [line 222]
converted F_xml_to_text(
string $str)
|
|
Unescape some special characters (< > &).
Tags:
Parameters
string |
$str |
input string to convert |
F_zero_to_null [line 92]
string F_zero_to_null(
string $num)
|
|
Prepare field value for SQL query. Returns the num if different from zero, NULL otherwise.
Tags:
Parameters
string |
$num |
string to check. |
getIpAsInt [line 324]
int getIpAsInt(
string $ip)
|
|
Converts a string containing an IP address into its integer value.
Tags:
Parameters
string |
$ip |
IP address to convert. |
getIpAsString [line 336]
int getIpAsString(
string $ip)
|
|
Converts a string containing an IP address into its integer value and return string representation.
Tags:
Parameters
string |
$ip |
IP address to convert. |
getNormalizedIP [line 262]
string getNormalizedIP(
string $ip)
|
|
Convert all IP addresses to IPv6 expanded notation.
Tags:
Parameters
string |
$ip |
IP address to normalize. |
showRequiredField [line 232]
html showRequiredField(
[int $mode = 1])
|
|
Return a string containing an HTML acronym for required/not required fields.
Tags:
Parameters
int |
$mode |
field mode: 1=not required; 2=required. |
unhtmlentities [line 149]
converted unhtmlentities(
string $text_to_convert, [boolean $preserve_tagsign = FALSE])
|
|
Reverse function for htmlentities.
Tags:
Parameters
string |
$text_to_convert |
input string to convert |
boolean |
$preserve_tagsign |
if true preserve <> symbols, default=FALSE |
utrim [line 249]
string utrim(
string $txt)
|
|
Strip whitespace (or other characters) from the beginning and end of an UTF-8 string and replace the \xA0 with normal space.
Tags:
Parameters
string |
$txt |
The string that will be trimmed. |
|