![]()  | 
  
    The Hubzilla
    
   | 
 
Channel related functions. More...
Functions | |
| identity_check_service_class ($account_id) | |
| Called when creating a new channel.  More... | |
| validate_channelname ($name) | |
| Determine if the channel name is allowed when creating a new channel.  More... | |
| create_sys_channel () | |
| Create a system channel - which has no account attached.  More... | |
| get_sys_channel () | |
| Returns the sys channel.  More... | |
| is_sys_channel ($channel_id) | |
| Checks if $channel_id is sys channel.  More... | |
| channel_total () | |
| Return the total number of channels on this site.  More... | |
| create_identity ($arr) | |
| Create a new channel.  More... | |
| change_channel_keys ($channel) | |
| channel_change_address ($channel, $new_address) | |
| set_default_login_identity ($account_id, $channel_id, $force=true) | |
| Set default channel to be used on login.  More... | |
| get_default_export_sections () | |
| Return an array with default list of sections to export.  More... | |
| identity_basic_export ($channel_id, $sections=null) | |
| Create an array representing the important channel information which would be necessary to create a nomadic identity clone. This includes most channel resources and connection information with the exception of content.  More... | |
| identity_export_year ($channel_id, $year, $month=0) | |
| Export items for a year, or a month of a year.  More... | |
| channel_export_items ($channel_id, $start, $finish) | |
| Export items within an arbitrary date range.  More... | |
| profile_load ($nickname, $profile= '') | |
| Loads a profile into the App structure.  More... | |
| profile_edit_menu ($uid) | |
| profile_sidebar ($profile, $block=0, $show_connect=true, $zcard=false) | |
| Formats a profile for display in the sidebar.  More... | |
| gender_icon ($gender) | |
| advanced_profile () | |
| get_my_url () | |
| get_my_address () | |
| zid_init () | |
| Add visitor's zid to our xchan and attempt authentication.  More... | |
| zat_init () | |
| If somebody arrives at our site using a zat, authenticate them.  More... | |
| get_theme_uid () | |
| Used from within PCSS themes to set theme parameters.  More... | |
| get_default_profile_photo ($size=300) | |
| Retrieves the path of the default_profile_photo for this system with the specified size.  More... | |
| is_foreigner ($s) | |
| Test whether a given identity is NOT a member of the Hubzilla.  More... | |
| is_member ($s) | |
| Test whether a given identity is a member of the Hubzilla.  More... | |
| get_online_status ($nick) | |
| Get chatpresence status for nick.  More... | |
| remote_online_status ($webbie) | |
| identity_selector () | |
| Return the parsed identity selector HTML template.  More... | |
| is_public_profile () | |
| get_profile_fields_basic ($filter=0) | |
| get_profile_fields_advanced ($filter=0) | |
| notifications_off ($channel_id) | |
| Clear notifyflags for a channel.  More... | |
| notifications_on ($channel_id, $value) | |
| get_channel_default_perms ($uid) | |
| profiles_build_sync ($channel_id, $send=true) | |
| auto_channel_create ($account_id) | |
| get_cover_photo ($channel_id, $format= 'bbcode', $res=PHOTO_RES_COVER_1200) | |
| get_zcard ($channel, $observer_hash= '', $args=array()) | |
| Return parsed HTML zcard template.  More... | |
| get_zcard_embed ($channel, $observer_hash= '', $args=array()) | |
| Return parsed HTML embed zcard template.  More... | |
| channelx_by_nick ($nick) | |
| Get a channel array from a channel nickname.  More... | |
| channelx_by_hash ($hash) | |
| Get a channel array by a channel_hash.  More... | |
| channelx_by_n ($id) | |
| Get a channel array by a channel ID.  More... | |
| channel_reddress ($channel) | |
| channel_manual_conv_update ($channel_id) | |
| Get manual channel conversation update config.  More... | |
| remote_login () | |
| Return parsed HTML remote_login template.  More... | |
| channel_store_lowlevel ($arr) | |
| profile_store_lowlevel ($arr) | |
| account_remove ($account_id, $local=true, $unset_session=true) | |
| channel_remove ($channel_id, $local=true, $unset_session=false) | |
| Removes a channel.  More... | |
| channel_remove_final ($channel_id) | |
| channel_codeallowed ($channel_id) | |
| This checks if a channel is allowed to publish executable code.  More... | |
| anon_identity_init ($reqvars) | |
| pchan_to_chan ($pchan) | |
| Create a channel array from proxy channel (pchan).  More... | |
Channel related functions.
| account_remove | ( | $account_id, | |
$local = true,  | 
        |||
$unset_session = true  | 
        |||
| ) | 
Included here for completeness, but this is a very dangerous operation. It is the caller's responsibility to confirm the requestor's intent and authorisation to do this.
| int | $account_id | |
| boolean | $local | (optional) default true | 
| boolean | $unset_session | (optional) default true | 
Referenced by Zotlabs\Module\Admin\Accounts\get(), Zotlabs\Module\Removeaccount\post(), and Zotlabs\Module\Admin\Accounts\post().
| advanced_profile | ( | ) | 
Referenced by Zotlabs\Module\Profile\get().
| anon_identity_init | ( | $reqvars | ) | 
Referenced by Zotlabs\Module\Item\post().
| auto_channel_create | ( | $account_id | ) | 
Referenced by account_allow(), account_approve(), and Zotlabs\Module\Register\post().
| change_channel_keys | ( | $channel | ) | 
| channel_change_address | ( | $channel, | |
| $new_address | |||
| ) | 
Referenced by Zotlabs\Module\Changeaddr\post().
| channel_codeallowed | ( | $channel_id | ) | 
This checks if a channel is allowed to publish executable code.
It is up to the caller to determine if the observer or local_channel is in fact the resource owner whose channel_id is being checked.
| int | $channel_id | 
Referenced by import_items(), import_webpage_element(), Zotlabs\Module\Attach\init(), mimetype_select(), and Zotlabs\Module\Getfile\post().
| channel_export_items | ( | $channel_id, | |
| $start, | |||
| $finish | |||
| ) | 
Export items within an arbitrary date range.
Date/time is in UTC.
| int | $channel_id | The channel ID | 
| string | $start | |
| string | $finish | 
| channel_manual_conv_update | ( | $channel_id | ) | 
Get manual channel conversation update config.
Check the channel config manual_conversation_update, if not set fall back to global system config, defaults to 1 if nothing set.
| int | $channel_id | 
Referenced by Zotlabs\Module\Pubstream\get(), Zotlabs\Module\Search\get(), Zotlabs\Module\Display\get(), Zotlabs\Module\Network\get(), Zotlabs\Module\Hq\get(), Zotlabs\Module\Channel\get(), and Zotlabs\Module\Settings\Display\get().
| channel_reddress | ( | $channel | ) | 
| array | $channel | 
Referenced by change_channel(), check_zotinfo(), create_conversation(), create_identity(), Zotlabs\Lib\SuperCurl\exec(), Zotlabs\Module\Fhublocs\get(), get_site_info(), get_zcard(), get_zcard_embed(), Zotlabs\Module\Import\import_account(), Zotlabs\Module\Magic\init(), Zotlabs\Module\Xrd\init(), local_dir_update(), Zotlabs\Module\Connect\post(), process_channel_sync_delivery(), process_delivery(), process_mail_delivery(), profile_load(), profile_sidebar(), and Zotlabs\Lib\Enotify\submit().
| channel_remove | ( | $channel_id, | |
$local = true,  | 
        |||
$unset_session = false  | 
        |||
| ) | 
Removes a channel.
| int | $channel_id | |
| boolean | $local | default true | 
| boolean | $unset_session | default false | 
Referenced by account_remove(), Zotlabs\Module\Admin\Channels\get(), Zotlabs\Module\Removeme\post(), and Zotlabs\Module\Admin\Channels\post().
| channel_remove_final | ( | $channel_id | ) | 
Referenced by Zotlabs\Daemon\Cron_weekly\run().
| channel_store_lowlevel | ( | $arr | ) | 
Referenced by create_identity().
| channel_total | ( | ) | 
Return the total number of channels on this site.
No filtering is performed except to check PAGE_REMOVED.
Referenced by zot_site_info().
| channelx_by_hash | ( | $hash | ) | 
Get a channel array by a channel_hash.
| string | $hash | 
Referenced by api_login(), Zotlabs\Module\Zfinger\init(), Zotlabs\Module\Cdav\init(), Zotlabs\Module\Dav\init(), Zotlabs\Module\Getfile\post(), Zotlabs\Module\Cdav\post(), Zotlabs\Daemon\Ratenotif\run(), and Zotlabs\Daemon\Onepoll\run().
| channelx_by_n | ( | $id | ) | 
Get a channel array by a channel ID.
| int | $id | A channel ID | 
Referenced by api_channel_stream(), api_file_export(), api_network_stream(), atoken_xchan(), attach_change_permissions(), attach_move(), channel_codeallowed(), channel_export_items(), Zotlabs\Lib\SuperCurl\exec(), Zotlabs\Module\Article_edit\get(), Zotlabs\Module\Card_edit\get(), Zotlabs\Module\Articles\get(), Zotlabs\Module\Cards\get(), handle_feed(), identity_export_year(), Zotlabs\Module\Home\init(), Zotlabs\Module\Photo\init(), mail_store(), menu_sync_packet(), Zotlabs\Access\PermissionRoles\new_custom_perms(), Zotlabs\Module\Oep\oep_display_reply(), Zotlabs\Module\Wall_upload\post(), Zotlabs\Module\Wall_attach\post(), Zotlabs\Daemon\Importfile\run(), Zotlabs\Daemon\Notifier\run(), Zotlabs\Widget\Wiki_list\widget(), Zotlabs\Widget\Cover_photo\widget(), Zotlabs\Widget\Zcard\widget(), and Zotlabs\Widget\Photo_albums\widget().
| channelx_by_nick | ( | $nick | ) | 
Get a channel array from a channel nickname.
| string | $nick | - A channel_address nickname | 
Referenced by account_verify_password(), Zotlabs\Widget\Wiki_pages\create_missing_page(), Zotlabs\Module\Wiki\get(), Zotlabs\Module\Cal\get(), Zotlabs\Module\Feed\init(), Zotlabs\Module\Ofeed\init(), Zotlabs\Module\Cal\init(), Zotlabs\Module\Photos\init(), Zotlabs\Module\Oep\oep_articles_reply(), Zotlabs\Module\Oep\oep_cards_reply(), Zotlabs\Module\Oep\oep_profile_reply(), Zotlabs\Module\File_upload\post(), Zotlabs\Module\Wall_upload\post(), Zotlabs\Module\Wall_attach\post(), Zotlabs\Module\Wiki\post(), Zotlabs\Widget\Cdav\widget(), and Zotlabs\Widget\Wiki_pages\widget().
| create_identity | ( | $arr | ) | 
Create a new channel.
Also creates the related xchan, hubloc, profile, and "self" abook records, and an empty "Friends" group/collection for the new channel.
| array | $arr | associative array with:
  | 
Referenced by auto_channel_create(), create_sys_channel(), and Zotlabs\Module\New_channel\post().
| create_sys_channel | ( | ) | 
Create a system channel - which has no account attached.
Referenced by check_config(), and Zotlabs\Module\Setup\what_next().
| gender_icon | ( | $gender | ) | 
Referenced by profile_sidebar().
| get_channel_default_perms | ( | $uid | ) | 
| get_cover_photo | ( | $channel_id, | |
$format = 'bbcode',  | 
        |||
$res = PHOTO_RES_COVER_1200  | 
        |||
| ) | 
Referenced by Zotlabs\Widget\Cover_photo\widget().
| get_default_export_sections | ( | ) | 
Return an array with default list of sections to export.
Referenced by api_export_basic(), identity_basic_export(), and Zotlabs\Module\Uexport\init().
| get_default_profile_photo | ( | $size = 300 | ) | 
Retrieves the path of the default_profile_photo for this system with the specified size.
| int | $size | (optional) default 300 one of (300, 80, 48) | 
Referenced by anon_identity_init(), Zotlabs\Lib\Apps\app_render(), Zotlabs\Lib\Apps\app_store(), Zotlabs\Lib\Apps\app_update(), atoken_xchan(), consume_feed(), feed_get_reshare(), Zotlabs\Module\Chatsvc\get(), import_xchan_photo(), Zotlabs\Module\Photo\init(), Zotlabs\Module\Ping\init(), Zotlabs\Lib\Apps\parse_app_description(), reflect_comment_store(), and xchan_store().
| get_my_address | ( | ) | 
Referenced by App\build_pagehead(), Zotlabs\Module\Rmagic\init(), zid(), and zid_init().
| get_online_status | ( | $nick | ) | 
Get chatpresence status for nick.
| string | $nick | 
Referenced by Zotlabs\Module\Online\init(), and profile_load().
| get_profile_fields_advanced | ( | $filter = 0 | ) | 
| get_profile_fields_basic | ( | $filter = 0 | ) | 
| get_sys_channel | ( | ) | 
Returns the sys channel.
Referenced by Zotlabs\Zot\Auth\__construct(), check_config(), copy_of_pubitem(), create_sys_channel(), design_tools(), drop_item(), Zotlabs\Module\React\get(), Zotlabs\Module\Viewsrc\get(), Zotlabs\Module\Pubstream\get(), Zotlabs\Module\Subthread\get(), Zotlabs\Module\Tagger\get(), Zotlabs\Module\Like\get(), Zotlabs\Module\Display\get(), Zotlabs\Module\Search\get(), Zotlabs\Module\Editblock\get(), Zotlabs\Module\Editlayout\get(), Zotlabs\Module\Layouts\get(), Zotlabs\Module\Editwebpage\get(), Zotlabs\Module\Blocks\get(), Zotlabs\Module\Webpages\get(), Zotlabs\Module\Hq\get(), Zotlabs\Module\Menu\get(), Zotlabs\Module\Mitem\get(), Zotlabs\Module\Item\get(), get_theme_uid(), Zotlabs\Module\Mitem\init(), Zotlabs\Module\Editblock\init(), Zotlabs\Module\Editlayout\init(), Zotlabs\Module\Layouts\init(), Zotlabs\Module\Zotfeed\init(), Zotlabs\Module\Menu\init(), Zotlabs\Module\Blocks\init(), Zotlabs\Module\Webpages\init(), Zotlabs\Module\Editwebpage\init(), Zotlabs\Module\Ping\init(), ping_site(), Zotlabs\Module\Menu\post(), Zotlabs\Module\Item\post(), Zotlabs\Module\Mitem\post(), public_recips(), Zotlabs\Daemon\Expire\run(), Zotlabs\Daemon\Externals\run(), Zotlabs\Daemon\Notifier\run(), store_doc_file(), website_portation_tools(), and zot_import().
| get_theme_uid | ( | ) | 
Used from within PCSS themes to set theme parameters.
If there's a puid request variable, that is the "page owner" and normally their theme settings take precedence; unless a local user sets the "always_my_theme" system pconfig, which means they don't want to see anybody else's theme settings except their own while on this site.
| get_zcard | ( | $channel, | |
$observer_hash = '',  | 
        |||
$args = array()  | 
        |||
| ) | 
Return parsed HTML zcard template.
| array | $channel | |
| string | $observer_hash | (optional) | 
| array | $args | (optional) | 
Referenced by Zotlabs\Widget\Zcard\widget().
| get_zcard_embed | ( | $channel, | |
$observer_hash = '',  | 
        |||
$args = array()  | 
        |||
| ) | 
Return parsed HTML embed zcard template.
| array | $channel | |
| string | $observer_hash | (optional) | 
| array | $args | (optional) | 
Referenced by Zotlabs\Module\Oep\oep_profile_reply().
| identity_basic_export | ( | $channel_id, | |
$sections = null  | 
        |||
| ) | 
Create an array representing the important channel information which would be necessary to create a nomadic identity clone. This includes most channel resources and connection information with the exception of content.
| int | $channel_id | Channel_id to export | 
| array | $sections | (optional) Which sections to include in the export, default see get_default_export_sections() | 
export three months of posts. If you want to export and import all posts you have to start with the first year and export/import them in ascending order.
Don't export linked resource items. we'll have to pull those out separately.
Referenced by api_export_basic(), and Zotlabs\Module\Uexport\init().
| identity_check_service_class | ( | $account_id | ) | 
Called when creating a new channel.
Checks the account's service class and number of current channels to determine whether creating a new channel is within the current service class constraints.
| int | $account_id | Account_id used for this request | 
Referenced by create_identity().
| identity_export_year | ( | $channel_id, | |
| $year, | |||
$month = 0  | 
        |||
| ) | 
Export items for a year, or a month of a year.
| int | $channel_id | The channel ID | 
| number | $year | YYYY | 
| number | $month | (optional) 0-12, default 0 complete year | 
Referenced by Zotlabs\Module\Uexport\init().
| identity_selector | ( | ) | 
Return the parsed identity selector HTML template.
| is_foreigner | ( | $s | ) | 
Test whether a given identity is NOT a member of the Hubzilla.
| string | $s | xchan_hash of the identity in question | 
Referenced by is_member(), scopes_sql(), and theme_attachments().
| is_member | ( | $s | ) | 
Test whether a given identity is a member of the Hubzilla.
| string | $s | xchan_hash of the identity in question | 
| is_public_profile | ( | ) | 
Referenced by Zotlabs\Lib\Apps\app_render(), and Zotlabs\Lib\Apps\parse_app_description().
| is_sys_channel | ( | $channel_id | ) | 
Checks if $channel_id is sys channel.
| int | $channel_id | 
Referenced by event_store_item(), Zotlabs\Module\Page\init(), profile_sidebar(), and zot_feed().
| notifications_off | ( | $channel_id | ) | 
Clear notifyflags for a channel.
Most likely during bulk import of content or other activity that is likely to generate huge amounts of undesired notifications.
| int | $channel_id | The channel to disable notifications for | 
Referenced by Zotlabs\Module\Import\import_account().
| notifications_on | ( | $channel_id, | |
| $value | |||
| ) | 
Referenced by Zotlabs\Module\Import\import_account().
| pchan_to_chan | ( | $pchan | ) | 
Create a channel array from proxy channel (pchan).
| array | $pchan | The proxy channel | 
Referenced by Zotlabs\Module\Wfinger\init().
| profile_edit_menu | ( | $uid | ) | 
Referenced by advanced_profile(), and profile_sidebar().
| profile_load | ( | $nickname, | |
$profile = ''  | 
        |||
| ) | 
Loads a profile into the App structure.
The function requires a writeable copy of the main App structure, and the nickname of a valid channel.
Permissions of the current observer are checked. If a restricted profile is available to the current observer, that will be loaded instead of the channel default profile.
The channel owner can set $profile to a valid profile_guid to preview that profile.
The channel default theme is also selected for use, unless over-riden elsewhere.
| string | $nickname | |
| string | $profile | 
Referenced by Zotlabs\Module\Achievements\get(), Zotlabs\Module\Hcard\init(), Zotlabs\Module\Viewconnections\init(), Zotlabs\Module\Common\init(), Zotlabs\Module\Block\init(), Zotlabs\Module\Layouts\init(), Zotlabs\Module\Page\init(), Zotlabs\Module\Profiles\init(), Zotlabs\Module\Profperm\init(), Zotlabs\Module\Editblock\init(), Zotlabs\Module\Editlayout\init(), Zotlabs\Module\Blocks\init(), Zotlabs\Module\Editwebpage\init(), Zotlabs\Module\Articles\init(), Zotlabs\Module\Cards\init(), Zotlabs\Module\Webpages\init(), Zotlabs\Module\Chat\init(), Zotlabs\Module\Cal\init(), Zotlabs\Module\Connect\init(), Zotlabs\Module\Profile\init(), Zotlabs\Module\Photos\init(), Zotlabs\Module\Wiki\init(), Zotlabs\Module\Channel\init(), Zotlabs\Module\Dav\init(), Zotlabs\Module\Cover_photo\init(), Zotlabs\Module\Snap\init(), Zotlabs\Module\Cloud\init(), Zotlabs\Module\Profile_photo\init(), and Zotlabs\Module\Profiles\post().
| profile_sidebar | ( | $profile, | |
$block = 0,  | 
        |||
$show_connect = true,  | 
        |||
$zcard = false  | 
        |||
| ) | 
Formats a profile for display in the sidebar.
It is very difficult to templatise the HTML completely because of all the conditional logic.
| array | $profile | |
| int | $block | |
| boolean | $show_connect | (optional) default true | 
| mixed | $zcard | (optional) default false | 
Referenced by Zotlabs\Widget\Fullprofile\widget(), Zotlabs\Widget\Shortprofile\widget(), and Zotlabs\Widget\Profile\widget().
| profile_store_lowlevel | ( | $arr | ) | 
Referenced by create_identity(), and Zotlabs\Module\Profiles\init().
| profiles_build_sync | ( | $channel_id, | |
$send = true  | 
        |||
| ) | 
Referenced by Zotlabs\Module\Profiles\init(), and Zotlabs\Module\Profile_photo\post().
| remote_login | ( | ) | 
Return parsed HTML remote_login template.
Referenced by nav().
| remote_online_status | ( | $webbie | ) | 
| string | $webbie | 
| set_default_login_identity | ( | $account_id, | |
| $channel_id, | |||
$force = true  | 
        |||
| ) | 
Set default channel to be used on login.
| int | $account_id | login account | 
| int | $channel_id | channel id to set as default for this account | 
| boolean | $force | (optional) default true
  | 
Referenced by create_identity(), and import_channel().
| validate_channelname | ( | $name | ) | 
Determine if the channel name is allowed when creating a new channel.
This action is pluggable. We're currently only checking for an empty name or one that exceeds our storage limit (191 chars). 191 chars is probably going to create a mess on some pages. Plugins can set additional policies such as full name requirements, character sets, multi-byte length, etc.
| string | $name | 
Referenced by auto_channel_create(), create_identity(), Zotlabs\Module\Settings\Channel\post(), and Zotlabs\Module\Profiles\post().
| zat_init | ( | ) | 
If somebody arrives at our site using a zat, authenticate them.
Referenced by Zotlabs\Web\WebServer\run().
| zid_init | ( | ) | 
Add visitor's zid to our xchan and attempt authentication.
If somebody arrives at our site using a zid, add their xchan to our DB if we don't have it already. And if they aren't already authenticated here, attempt reverse magic auth.
Referenced by Zotlabs\Web\WebServer\run().