Jcow Documentation>>
Usage: section_content($content=''), section_close($title='')
Example:
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
Returns: The value of the key of the current session user
Example:
Back to Top
Usage: t($str, $att1 = '', $att2 = '', $att3 = '',$godb = 0)
Returns: translated string
Example 1:
Example 2:
Back to Top
Returns: the published Stream ID
Example 1:
Example 2:
Back to Top
Returns: A link with full path.
Example 1:
Returns: http://YOUR_SITE_URL/blogs
Example 2:
Returns: <a href="http://YOUR_SITE_URL/feed">news feed</a>
Example 3:
Returns: <a href="http://google.com">google</a>
Back to Top
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');
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.
client()
Usage: client($key='')Returns: The value of the key of the current session user
Field | Description |
---|---|
$key | Available 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. |
section_content( client('fullname') );
t()
Making common works of UI translatable.Usage: t($str, $att1 = '', $att2 = '', $att3 = '',$godb = 0)
Returns: translated string
Field | Description |
---|---|
$str | Required - The string that need to be displayed. |
$att1 | Optional - The 1st replacement. |
$att2 | Optional - The 2nd replacement. |
$att3 | Optional - The 3rd replacement. |
$godb | Optional - Make this "True" if this string is about to be imported to database. |
section_content( t('Hello World') );
section_content( t('Hello {1}, Your username is: {2}',client('fullname'),client('username')) );
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
Field | Description |
---|---|
$target_id | Required - 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) |
jcow_page_feed(user_page_id($user['id']), array('message'=>'logged in');
jcow_page_feed($client['page']['id']), array('message'=>'logged in');
url()
Usage: url($uri='',$name = '',$target='')Returns: A link with full path.
Field | Description |
---|---|
$uri | Required - The URI of the link. |
$name | Optional - The title of the link. |
$target | Optional - Target window. Available values: _blank, _self, _top |
url('blogs');
Example 2:
url('feed',t('news feed'));
Example 3:
url('http://google.com','google');