Jcow Documentation>>

Jcow Development API

section_content(), section_close()

Print content to users.
Usage: section_content($content=''), section_close($title='')
Example:
section_content('Content in section One');
section_close('Title of section One');

section_content('Content in section Two');
section_content(',Another Content of section Two');
section_close('Title of section Two');
The above example will output:

Note: These two functions can only be used in Jcow Modules.
If you want to print content in template (themes/YOUR_THEME_FOLDER/page.tpl.php), you should use Echo directly.
Back to Top

client()

Usage: client($key='')
Returns: The value of the key of the current session user
FieldDescription
$keyAvailable keys: id, page_id, email, username, fullname, avatar, gender, birthday, birthmonth, birthyear, location.
var1~var7(customized member fields)
If Leave the $key blank, it will returns all fields as an array.
Example:
section_content(
	client('fullname')
);
Back to Top

t()

Making common works of UI translatable.
Usage: t($str, $att1 = '', $att2 = '', $att3 = '',$godb = 0)
Returns: translated string
FieldDescription
$strRequired - The string that need to be displayed.
$att1Optional - The 1st replacement.
$att2Optional - The 2nd replacement.
$att3Optional - The 3rd replacement.
$godbOptional - Make this "True" if this string is about to be imported to database.
Example 1:
section_content(
	t('Hello World')
	);
Example 2:
section_content(
	t('Hello {1}, Your username is: {2}',client('fullname'),client('username'))
	);
Back to Top

jcow_page_feed()

Publish streams/feeds to a Jcow Profile Page or Community Page.

Usage: jcow_page_feed($target_id, $args = array())
Returns: the published Stream ID
FieldDescription
$target_idRequired - The target page ID.
$args["message"]Required - The feed message.(less than 140 characters)
$args["link"]Optional - The URL of the link
$args["name"]Optional - The name/title of the link.
$args["description"]Optional - The description of the link.(less than 140 characters)
$args["thumbs"]Optional - Comma-separated Thumbnail urls.(3 urls for maximum)
Example 1:
jcow_page_feed(user_page_id($user['id']), array('message'=>'logged in');
Example 2:
jcow_page_feed($client['page']['id']), array('message'=>'logged in');
Back to Top

url()

Usage: url($uri='',$name = '',$target='')
Returns: A link with full path.
FieldDescription
$uriRequired - The URI of the link.
$nameOptional - The title of the link.
$targetOptional - Target window. Available values: _blank, _self, _top
Example 1:
url('blogs');
Returns: http://YOUR_SITE_URL/blogs

Example 2:
url('feed',t('news feed'));
Returns: <a href="http://YOUR_SITE_URL/feed">news feed</a>

Example 3:
url('http://google.com','google');
Returns: <a href="http://google.com">google</a>
Back to Top


Return to menu