cchost
[ class tree: cchost ] [ index: cchost ] [ all elements ]

Procedural File: cc-custom.php

Source Location: /cc-custom.php



Page Details:

CUSTOM TEMPLATE API

Methods here were designed to be called from phpTAL templates:

example:

<tal:block define="php: records = CC_quick_list('remix');" />




Tags:

filesource:  Source Code for this file








array_combine [line 526]

void array_combine( mixed $keys, mixed $values)



[ Top ]



CC_badcall [line 40]

void CC_badcall( mixed $to)



Tags:

deprecated:  


[ Top ]



CC_cache_query [line 348]

array &CC_cache_query( string $tags, [string $search_type = 'all'], [string $sort_on = ''], [string $order = ''], [integer $limit = ''], [boolean $with_menus = false], [boolean $with_remixes = false])

Fetch a list of records, cache if you have to or retrieve if you can

This function perform a query the first time it is called and cache the results. If a request is made for the exact same tags set then the query is retrieved from the cache. This is the fast version of CC_tag_query.

The cache is automatically cleared whenever a new file has been uploaded, or an old one has been deleted or modified in any way

Note that $with_menus and $with_remixes significantly slows down this call, even when cached.




Tags:

return:  An array of matching records
see:  CC_tag_query()


Parameters

string   $tags   Comma separated tags to limit query
string   $search_type   Valid types are 'all' or 'any' referring to how to treat multiple tags
string   $sort_on   Name of field to sort on (default is 'upload_date')
string   $order   Valid orders are 'ASC' or 'DESC' (default is 'DESC')
integer   $limit   Maximum number of records to cache/retrieve
boolean   $with_menus   true means include all commands possible in each record
boolean   $with_remixes   true means include total remix history in each record
[ Top ]



CC_count [line 79]

integer CC_count( mixed $obj)

Return a count of elements for the object or array



Tags:

return:  Count of elements or 0 if parameter is not an array or string


Parameters

mixed   $obj   Object or array to count
[ Top ]



CC_datefmt [line 128]

string CC_datefmt( string $date, string $fmt)

Format a date

Maps to: date(fmt,strtotime(date))




Tags:

return:  A formatted date string


Parameters

string   $date   A string representation of a date
string   $fmt   A PHP date() formatter
[ Top ]



CC_debug_dump [line 207]

void CC_debug_dump( mixed $obj)

Dump a variable to the screen

For debugging purposes you can use this method while testing to get the contents of any given thing.

NOTE: Calling this will halt all execution




Tags:

see:  CC_log_dump()


Parameters

mixed   $obj   Thing to dump to screen
[ Top ]



CC_get_config [line 267]

mixed CC_get_config( string $configName)

Return the values current stored in the configs tables



Tags:

return:  Raw config value as stored in db


Parameters

string   $configName   Name of settings (e.g. 'chart', 'licenses')
[ Top ]



CC_get_config_roots [line 389]

void CC_get_config_roots( )



[ Top ]



CC_get_details [line 502]

void &CC_get_details( mixed $upload_id, [mixed $menu = true])



[ Top ]



cc_get_value [line 517]

void cc_get_value( mixed $arr, mixed $key)



[ Top ]



CC_hot_playlists [line 484]

void CC_hot_playlists( )



[ Top ]



CC_ids_for_records [line 183]

string CC_ids_for_records( array &$records)

Return a semi-colon separated list of upload_ids for a set of records

This list of ids can then be used in URLs like streampage




Tags:

return:  A semi-colon separated list of upload_ids


Parameters

array   $records   An array of records to get ids for
[ Top ]



CC_lang [line 68]

string CC_lang( string $string)

Internationalize a string

This allows templates to put up a string and go through the language engine. Always use this when outputting user visible strings. (This doesn't really work yet, but use it anyway.)




Tags:

return:  Translated string


Parameters

string   $string   String to translate
[ Top ]



CC_log_dump [line 226]

void CC_log_dump( string $name, mixed $obj)

Dump a variable to the log file

For debugging purposes you dump the contents of a variable to the log file. This function with not halt execution of the program.




Tags:

see:  CC_debug_dump()


Parameters

string   $name   Name of object, this will be output to the log for easy identification
mixed   $obj   Thing to dump
[ Top ]



CC_pending_pool_remix [line 244]

array CC_pending_pool_remix( )

Returns a list of remote remixes waiting for admin approval

This applies to situation where your installation is a source pool for another site. That site has notified us that there has been a remix of our material. This method returns the pool item records of those remixes.




Tags:

return:  Array of remote pool remixes waiting for admin approval


[ Top ]



CC_query [line 148]

mixed CC_query( string $tablename, string $func, [string $module = ''])

Low level call to a CCTable derivation.

A very specialized way of calling specific, no paramter method on CCTable method




Tags:

return:  Return value of function
see:  CCConfigs::GetCOnfigRoots
see:  CCContests::GetOpenContests


Parameters

string   $tablename   Name of CCTable derivative
string   $func   Name of method to call
string   $module   Name of file to include with our new addhandler code
[ Top ]



cc_query_fmt [line 399]

void cc_query_fmt( mixed $qstring)



[ Top ]



CC_quick_list [line 281]

array &CC_quick_list( string $tag)

Return a list of 5 truncated records (the latest uploads) that match a given tag

This method return ONLY two colums: file_page_url and upload_short_name




Tags:

return:  An array of 5 truncated records


Parameters

string   $tag   a specific tag to search for
[ Top ]



CC_ratings_chart [line 168]

array CC_ratings_chart( integer $limit, [string $since = ''])

Get the records with the highest ratings as determined by admin

Admins can determine what gets returned here in the 'Manage Ratings' screens.




Tags:

return:  Records that are rated the highest


Parameters

integer   $limit   Max number of records to return
string   $since   Date string to use as cutoff
[ Top ]



CC_recent_playlists [line 478]

void CC_recent_playlists( )



[ Top ]



CC_recent_reviews [line 472]

void CC_recent_reviews( [mixed $limit = 5])



[ Top ]



CC_split_tags [line 52]

array CC_split_tags( string $tagstr)

Splits a comma separated string of tags into an array



Tags:

return:  Arrya of tags


Parameters

string   $tagstr   Comma separated string of tags
[ Top ]



CC_strchop [line 112]

string CC_strchop( string $str, integer $maxlen, [boolen $dochop = true])

Chop a string and append ellipse if over a given length.

The third parameter '$dochop' allows for runtime decisions about whether to chop or not. This is much faster than making the branch descision in phpTAL.




Tags:

return:  Chopped string


Parameters

string   $str   String to potentially chop
integer   $maxlen   Maximum number of characters before adding ellipse
boolen   $dochop   If false then maxlen is ignored and string is returned
[ Top ]



CC_tag_query [line 433]

array &CC_tag_query( string $tags, [string $search_type = 'all'], [string $sort_on = ''], [string $order = ''], [integer $limit = ''], [boolean $with_menus = false], [boolean $with_remixes = false])

Fetch a list of records

This is the (very) slow version of CC_cache_query. Try to use that instead if you can.

Note that $with_menus and $with_remixes significantly slows down this call, even when cached.




Tags:

return:  An array of matching records
see:  CC_cache_query()


Parameters

string   $tags   Comma separated tags to limit query
string   $search_type   Valid types are 'all' or 'any' referring to how to treat multiple tags
string   $sort_on   Name of field to sort on (default is 'upload_date')
string   $order   Valid orders are 'ASC' or 'DESC' (default is 'DESC')
integer   $limit   Maximum number of records to cache/retrieve
boolean   $with_menus   true means include all commands possible in each record
boolean   $with_remixes   true means include total remix history in each record
[ Top ]



cc_tcache_kill [line 308]

void cc_tcache_kill( )



Tags:

private:  


[ Top ]



CC_test [line 95]

boolean CC_test( mixed $obj)

Test for the existance of an object

phpTAL's exists() was not working consistantly and does not like empty objects so this function is designed to help with that.




Tags:

return:  Same as php's empty()


Parameters

mixed   $obj   Thing to test
[ Top ]



list_all_users [line 494]

void list_all_users( )



Tags:

deprecated:  
private:  


[ Top ]



Documentation generated on Sat, 17 Nov 2007 01:03:30 +0000 by phpDocumentor 1.3.0RC4