| Cts_Common | |
| Author | Jaybill McCarthy |
| License | http://communit.as/docs/license |
| Static Methods | |
| getTimeZonesArray | TBD |
| calculateYearsOld | Calculates the number of years between a birthdate and now. |
| calculateAstroSign | Calculates a star sign based on a birth date. |
| getSignArray | Gets a list of astrological signs. |
| getSignBetween | TBD |
| br2nl | Converts XHTML <br /> tags to newline characters (chr 32). |
| makeParagraphs | TBD |
| sortDataSet | Sorts a set of data (multidimensional array). |
| makeTagString | TBD |
| makeTagArray | TBD |
| xyago | TBD |
| convertlinebreaks | TBD |
| quoteInto | TBD |
| pluralOrSingular | Takes a quantity and two noun forms and returns the noun form that suits the quantity. |
| getGenderArray | Gets a list of possible gender choices. |
| getUsStatesArray | Gets a list of states and territories of the United States. |
| get_timezone_offset | Calculates the offset from the origin timezone to the remote timezone in seconds. |
| dateDiffInDays | Calculates the number of days between two dates. |
| makeSeoFriendly | Makes a string suitable for use as an SEO-friendly URL. |
| makeDummyText | Generates latin text to the desired character length. |
| has | Check to see if an object/array contains a certain key. |
| getViewState | |
| vnsprintf | Acts just like PHP’s built-in vsprintf except it can use named keys. |
| urlFilter | Takes a URL and an array of various possible parameters and modified the URL as needed. |
static function calculateAstroSign( $timestamp )
Calculates a star sign based on a birth date. Yeah, I know. You probably won’t ever need this. One of our early clients did and it’s awesome code so we left it.
| timestamp | The birth date to calculate as a unix timestamp. |
The name of the star sign (string).
function sortDataSet( & $dataSet )
Sorts a set of data (multidimensional array).
| &$dataset | A multidimensional array (data set) to sort. Subsequent arguments follow the argument order of array_multisort(), except that you do not pass arrays to the function but keys (string!) of the columns not TBD |
sortDataSet(data set, column1[, mixed arg [, mixed ... [, array ...]]])
static function pluralOrSingular( $qty, $singular, $plural )
Takes a quantity and two noun forms and returns the noun form that suits the quantity. Useful when a dynamic quantity is used in a sentence, such as, “There are 2 users online.”
| qty | The quantity to compare. |
| singular | The singular noun form. |
| plural | The plural noun form. |
The singular or plural noun form, depending on the quantity given.
static function get_timezone_offset( $remote_tz, $origin_tz = null )
Calculates the offset from the origin timezone to the remote timezone in seconds.
| remote_tz | The remote time zone. |
| origin_tz (optional) | The origin time zone. Defaults to the server’s time zone. |
The number of seconds difference between the given time zones (integer).
static function urlFilter( $url, array $params = null )
Takes a URL and an array of various possible parameters and modified the URL as needed. For instance, if a locale_code is passed in, the code is added to the base of the URL. This method is only intended to filter local URLs and not any links to URLs outside the application.
| url | The URL to be filtered. |
| params | An array of optional params. Currently the only thing it recognizes is a key of ‘locale_code’. |
Returns: string
TBD
static function getTimeZonesArray( $choose_one = null )
Calculates the number of years between a birthdate and now.
static function calculateYearsOld( $timestamp )
Calculates a star sign based on a birth date.
static function calculateAstroSign( $timestamp )
Gets a list of astrological signs.
static function getSignArray()
TBD
static function getSignBetween( $sign, $colname = "birthday_day" )
Converts XHTML br / tags to newline characters (chr 32).
static function br2nl( $string )
TBD
static function makeParagraphs( $string )
Sorts a set of data (multidimensional array).
function sortDataSet( & $dataSet )
TBD
static function makeTagString( $tags )
TBD
static function makeTagArray( $tag_string )
TBD
static function xyago( $datefrom, $dateto = -1 )
TBD
static function convertlinebreaks( $text )
TBD
static function quoteInto( $text, $params )
Takes a quantity and two noun forms and returns the noun form that suits the quantity.
static function pluralOrSingular( $qty, $singular, $plural )
Gets a list of possible gender choices.
static function getGenderArray()
Gets a list of states and territories of the United States.
static function getUsStatesArray( $choose_one = null )
Calculates the offset from the origin timezone to the remote timezone in seconds.
static function get_timezone_offset( $remote_tz, $origin_tz = null )
Calculates the number of days between two dates.
static function dateDiffInDays( $pastdate, $futuredate )
Makes a string suitable for use as an SEO-friendly URL.
static function makeSeoFriendly( $value )
Generates latin text to the desired character length.
static function makeDummyText( $chars )
Check to see if an object/array contains a certain key.
static function has( $obj, $key )
static function getViewState( $session, $key, $default )
Acts just like PHP’s built-in vsprintf except it can use named keys.
static function vnsprintf( $format, array $data )
Takes a URL and an array of various possible parameters and modified the URL as needed.
static function urlFilter( $url, array $params = null )