adult channel setting
This commit is contained in:
parent
df8035344f
commit
cdfb5f9dc7
10
boot.php
10
boot.php
@ -177,13 +177,7 @@ define ( 'CLIENT_MODE_UPDATE', 0x0002);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* page/profile types
|
* Channel pageflags
|
||||||
*
|
|
||||||
* PAGE_NORMAL is a typical personal profile account
|
|
||||||
* PAGE_SOAPBOX automatically approves all friend requests as CONTACT_IS_SHARING, (readonly)
|
|
||||||
* PAGE_COMMUNITY automatically approves all friend requests as CONTACT_IS_SHARING, but with
|
|
||||||
* write access to wall and comments (no email and not included in page owner's ACL lists)
|
|
||||||
* PAGE_FREELOVE automatically approves all friend requests as full friends (CONTACT_IS_FRIEND).
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -193,6 +187,7 @@ define ( 'PAGE_AUTOCONNECT', 0x0002 );
|
|||||||
define ( 'PAGE_APPLICATION', 0x0004 );
|
define ( 'PAGE_APPLICATION', 0x0004 );
|
||||||
define ( 'PAGE_DIRECTORY_CHANNEL', 0x0008 ); // system channel used for directory synchronisation
|
define ( 'PAGE_DIRECTORY_CHANNEL', 0x0008 ); // system channel used for directory synchronisation
|
||||||
define ( 'PAGE_PREMIUM', 0x0010 );
|
define ( 'PAGE_PREMIUM', 0x0010 );
|
||||||
|
define ( 'PAGE_ADULT', 0x0020 );
|
||||||
|
|
||||||
define ( 'PAGE_REMOVED', 0x8000 );
|
define ( 'PAGE_REMOVED', 0x8000 );
|
||||||
|
|
||||||
@ -348,6 +343,7 @@ define ( 'HUBLOC_FLAGS_DELETED', 0x1000);
|
|||||||
define ( 'XCHAN_FLAGS_HIDDEN', 0x0001);
|
define ( 'XCHAN_FLAGS_HIDDEN', 0x0001);
|
||||||
define ( 'XCHAN_FLAGS_ORPHAN', 0x0002);
|
define ( 'XCHAN_FLAGS_ORPHAN', 0x0002);
|
||||||
define ( 'XCHAN_FLAGS_CENSORED', 0x0004);
|
define ( 'XCHAN_FLAGS_CENSORED', 0x0004);
|
||||||
|
define ( 'XCHAN_FLAGS_SELFCENSORED', 0x0008);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Traficlights for Administration of HubLoc
|
* Traficlights for Administration of HubLoc
|
||||||
|
@ -469,6 +469,11 @@ function import_xchan($arr) {
|
|||||||
else
|
else
|
||||||
$new_flags = $r[0]['xchan_flags'];
|
$new_flags = $r[0]['xchan_flags'];
|
||||||
|
|
||||||
|
$adult = (($r[0]['xchan_flags'] & XCHAN_FLAGS_SELFCENSORED) ? true : false);
|
||||||
|
$adult_changed = ((intval($adult) != intval($arr['adult_content'])) ? true : false);
|
||||||
|
if($adult_changed)
|
||||||
|
$new_flags = $new_flags ^ XCHAN_FLAGS_SELFCENSORED;
|
||||||
|
|
||||||
|
|
||||||
if(($r[0]['xchan_name_date'] != $arr['name_updated'])
|
if(($r[0]['xchan_name_date'] != $arr['name_updated'])
|
||||||
|| ($r[0]['xchan_connurl'] != $arr['connections_url'])
|
|| ($r[0]['xchan_connurl'] != $arr['connections_url'])
|
||||||
@ -511,6 +516,8 @@ function import_xchan($arr) {
|
|||||||
$new_flags = XCHAN_FLAGS_HIDDEN;
|
$new_flags = XCHAN_FLAGS_HIDDEN;
|
||||||
else
|
else
|
||||||
$new_flags = 0;
|
$new_flags = 0;
|
||||||
|
if($arr['adult_content'])
|
||||||
|
$new_flags |= XCHAN_FLAGS_SELFCENSORED;
|
||||||
|
|
||||||
$x = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_pubkey, xchan_photo_mimetype,
|
$x = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_pubkey, xchan_photo_mimetype,
|
||||||
xchan_photo_l, xchan_addr, xchan_url, xchan_connurl, xchan_follow, xchan_connpage, xchan_name, xchan_network, xchan_photo_date, xchan_name_date, xchan_flags)
|
xchan_photo_l, xchan_addr, xchan_url, xchan_connurl, xchan_follow, xchan_connpage, xchan_name, xchan_network, xchan_photo_date, xchan_name_date, xchan_flags)
|
||||||
|
@ -102,9 +102,9 @@ function dirsearch_content(&$a) {
|
|||||||
|
|
||||||
$logic = ((strlen($sql_extra)) ? 0 : 1);
|
$logic = ((strlen($sql_extra)) ? 0 : 1);
|
||||||
|
|
||||||
$safesql = (($safe > 0) ? " and not ( xchan_flags & " . intval(XCHAN_FLAGS_CENSORED) . " ) " : '');
|
$safesql = (($safe > 0) ? " and not ( xchan_flags & " . intval(XCHAN_FLAGS_CENSORED|XCHAN_FLAGS_SELFCENSORED) . " ) " : '');
|
||||||
if($safe < 0)
|
if($safe < 0)
|
||||||
$safesql = " and ( xchan_flags & " . intval(XCHAN_FLAGS_CENSORED) . " ) ";
|
$safesql = " and ( xchan_flags & " . intval(XCHAN_FLAGS_CENSORED|XCHAN_FLAGS_SELFCENSORED) . " ) ";
|
||||||
|
|
||||||
if($limit)
|
if($limit)
|
||||||
$qlimit = " LIMIT $limit ";
|
$qlimit = " LIMIT $limit ";
|
||||||
|
@ -361,7 +361,13 @@ function settings_post(&$a) {
|
|||||||
$post_newfriend = (($_POST['post_newfriend'] == 1) ? 1: 0);
|
$post_newfriend = (($_POST['post_newfriend'] == 1) ? 1: 0);
|
||||||
$post_joingroup = (($_POST['post_joingroup'] == 1) ? 1: 0);
|
$post_joingroup = (($_POST['post_joingroup'] == 1) ? 1: 0);
|
||||||
$post_profilechange = (($_POST['post_profilechange'] == 1) ? 1: 0);
|
$post_profilechange = (($_POST['post_profilechange'] == 1) ? 1: 0);
|
||||||
|
$adult = (($_POST['adult'] == 1) ? 1 : 0);
|
||||||
|
|
||||||
|
$channel = $a->get_channel();
|
||||||
|
$pageflags = $channel['channel_pageflags'];
|
||||||
|
$existing_adult = (($pageflags & PAGE_ADULT) ? 1 : 0);
|
||||||
|
if($adult != $existing_adult)
|
||||||
|
$pageflags = ($pageflags ^ PAGE_ADULT);
|
||||||
|
|
||||||
$arr = array();
|
$arr = array();
|
||||||
$arr['channel_r_stream'] = (($_POST['view_stream']) ? $_POST['view_stream'] : 0);
|
$arr['channel_r_stream'] = (($_POST['view_stream']) ? $_POST['view_stream'] : 0);
|
||||||
@ -518,8 +524,9 @@ function settings_post(&$a) {
|
|||||||
);
|
);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$r = q("update channel set channel_name = '%s', channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d where channel_id = %d limit 1",
|
$r = q("update channel set channel_name = '%s', channel_pageflags = %d, channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d where channel_id = %d limit 1",
|
||||||
dbesc($username),
|
dbesc($username),
|
||||||
|
intval($pageflags),
|
||||||
dbesc($timezone),
|
dbesc($timezone),
|
||||||
dbesc($defloc),
|
dbesc($defloc),
|
||||||
intval($notify),
|
intval($notify),
|
||||||
@ -929,6 +936,7 @@ function settings_content(&$a) {
|
|||||||
|
|
||||||
$maxreq = $channel['channel_max_friend_req'];
|
$maxreq = $channel['channel_max_friend_req'];
|
||||||
$expire = $channel['channel_expire_days'];
|
$expire = $channel['channel_expire_days'];
|
||||||
|
$adult_flag = intval($channel['channel_pageflags'] & PAGE_ADULT);
|
||||||
|
|
||||||
$blockwall = $a->user['blockwall'];
|
$blockwall = $a->user['blockwall'];
|
||||||
$unkmail = $a->user['unkmail'];
|
$unkmail = $a->user['unkmail'];
|
||||||
@ -1034,6 +1042,7 @@ function settings_content(&$a) {
|
|||||||
'$defloc' => array('defloc', t('Default Post Location:'), $defloc, ''),
|
'$defloc' => array('defloc', t('Default Post Location:'), $defloc, ''),
|
||||||
'$allowloc' => array('allow_location', t('Use Browser Location:'), ((get_pconfig(local_user(),'system','use_browser_location')) ? 1 : ''), ''),
|
'$allowloc' => array('allow_location', t('Use Browser Location:'), ((get_pconfig(local_user(),'system','use_browser_location')) ? 1 : ''), ''),
|
||||||
|
|
||||||
|
'$adult' => array('adult', t('Adult Content'), $adult_flag, t('This channel publishes adult content.')),
|
||||||
|
|
||||||
'$h_prv' => t('Security and Privacy Settings'),
|
'$h_prv' => t('Security and Privacy Settings'),
|
||||||
|
|
||||||
|
@ -72,8 +72,8 @@ function zfinger_init(&$a) {
|
|||||||
$id = $e['channel_id'];
|
$id = $e['channel_id'];
|
||||||
|
|
||||||
$special_channel = (($e['channel_pageflags'] & PAGE_PREMIUM) ? true : false);
|
$special_channel = (($e['channel_pageflags'] & PAGE_PREMIUM) ? true : false);
|
||||||
|
$adult_channel = (($e['channel_pageflags'] & PAGE_ADULT) ? true : false);
|
||||||
$searchable = (($e['channel_pageflags'] & PAGE_HIDDEN) ? false : true);
|
$searchable = (($e['channel_pageflags'] & PAGE_HIDDEN) ? false : true);
|
||||||
if($e['xchan_flags'] & XCHAN_FLAGS_HIDDEN)
|
if($e['xchan_flags'] & XCHAN_FLAGS_HIDDEN)
|
||||||
$searchable = false;
|
$searchable = false;
|
||||||
|
|
||||||
@ -136,7 +136,8 @@ function zfinger_init(&$a) {
|
|||||||
$ret['target'] = $ztarget;
|
$ret['target'] = $ztarget;
|
||||||
$ret['target_sig'] = $zsig;
|
$ret['target_sig'] = $zsig;
|
||||||
$ret['searchable'] = $searchable;
|
$ret['searchable'] = $searchable;
|
||||||
|
$ret['adult_content'] = $adult_channel;
|
||||||
|
|
||||||
|
|
||||||
// premium or other channel desiring some contact with potential followers before connecting.
|
// premium or other channel desiring some contact with potential followers before connecting.
|
||||||
// This is a template - %s will be replaced with the follow_url we discover for the return channel.
|
// This is a template - %s will be replaced with the follow_url we discover for the return channel.
|
||||||
|
@ -1 +1 @@
|
|||||||
2013-09-20.442
|
2013-09-22.444
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
{{include file="field_input.tpl" field=$defloc}}
|
{{include file="field_input.tpl" field=$defloc}}
|
||||||
{{include file="field_checkbox.tpl" field=$allowloc}}
|
{{include file="field_checkbox.tpl" field=$allowloc}}
|
||||||
|
|
||||||
|
{{include file="field_checkbox.tpl" field=$adult}}
|
||||||
|
|
||||||
<div class="settings-submit-wrapper" >
|
<div class="settings-submit-wrapper" >
|
||||||
<input type="submit" name="submit" class="settings-submit" value="{{$submit}}" />
|
<input type="submit" name="submit" class="settings-submit" value="{{$submit}}" />
|
||||||
|
Reference in New Issue
Block a user