Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Haakon Meland Eriksen 2015-07-29 22:04:07 +02:00
commit 98fa996b3f
97 changed files with 1434 additions and 1320 deletions

View file

@ -2009,7 +2009,6 @@ function load_pdl(&$a) {
if((! $s) && (($p = theme_include($n)) != ''))
$s = @file_get_contents($p);
if($s) {
comanche_parser($a, $s);
$a->pdl = $s;

View file

@ -2,26 +2,30 @@
Roadmap for $Projectname V3
*HZ = Hubzilla repository
Crypto
Convert E2EE to dynamic loading (on demand) using jQuery.getScript() [or other methods] to only load encryption libs when you require them. This should also support multiple encryption libraries (e.g. SJCL, others) triggered from the choice of algorithm and remain pluggable.
Diaspora
Convert core Diaspora federation code into a plugin. This presents a number of challenges since it touches and special cases a lot of core functionality.
Convert core Diaspora federation code into a plugin. This presents a number of challenges since it touches and special cases a lot of core functionality. (HZ - in progress)
Subscriptions and business models
Build enough into core(/addons) to generate income (or at least try and cover costs) out of the box
Build enough into core(/addons) to generate income (or at least try and cover costs) out of the box (in progress Habeas Codice)
Merge all uploads into common DAV interface
Separate photo albums from photos and turn them into file directories.
Upload everything direct to /store
If photo, generate thumbnails and image resources
Provide default upload folders with %y (and other?) macros for both photos and other file resources
Allow "media" (anything that we can generate a thumbnail for) in the Photos section (and show thumbnails in the Files section where possible)
Separate photo albums from photos and turn them into file directories. (HZ - done)
Upload everything direct to /store (HZ - done)
If photo, generate thumbnails and image resources (HZ - done)
Provide default upload folders with %y (and other?) macros for both photos and other file resources (HZ - done)
Allow "media" (anything that we can generate a thumbnail for) in the Photos section (and show thumbnails in the Files section where possible) (HZ - done)
Resolve the "every photo has an item" confusion, perhaps every file should also - but only if we can explain it and separate them conceptually.
Migration tools
Friendica importer
Diaspora importer
Diaspora importer (channel and connection import done, conversations and photos still in progress and waiting for support from Diaspora)
Webpage design UI improvements
If practical, separate "conversation" sub-themes from overall themes so one can choose different conversation and content layouts within a base theme.

View file

@ -10,8 +10,8 @@ We need much more than this, but here are areas where developers can help. Pleas
[li]Infinite scroll improvements (i.e. embedded page links) see http://scrollsample.appspot.com/items
[li]Finish the anti-spam bayesian engine[/li]
[li]implement an email permission denied bounce message from the sys channel[/li]
[li]provide a way for xchans with a certain network type to upgrade (unknown to rss, rss to statusnet, friendica-over-diaspora to friendica, for instance) based on new knowledge and/or hubzilla ability[/li]
[li]If DAV folders exist, add an option to the Settings page to set a default folder for attachment uploads.[/li]
[li]provide a way for xchans with a certain network type to upgrade (unknown to rss, rss to statusnet, friendica-over-diaspora to friendica, for instance) based on new knowledge and/or redmatrix ability[/li]
[li](done - HZ) If DAV folders exist, add an option to the Settings page to set a default folder for attachment uploads.[/li]
[li]Integrate the "open site" list with the register page[/li]
[li]implement oembed provider interface[/li]
[li]refactor the oembed client interface so that we can safely sandbox remote content[/li]
@ -21,27 +21,27 @@ We need much more than this, but here are areas where developers can help. Pleas
[li]restricted access OAuth clients[/li]
[li](Advanced) create a UI for building Comanche pages[/li]
[li](less advanced) create a way to preview Comanche results on a preview page while editing on another page[/li]
[li]Extend WebDAV to provide desktop access to photo albums[/li]
[li](done - HZ) Extend WebDAV to provide desktop access to photo albums[/li]
[li]External post connectors - create standard interface[/li]
[li]External post connectors, add popular services[/li]
[li]service classes - provide a pluggable subscription payment gateway for premium accounts[/li]
[li]service classes - account overview page showing resources consumed by channel. With special consideration this page can also be accessed at a meta level by the site admin to drill down on problematic accounts/channels.[/li]
[li]Events module - fix permissions on events, and provide JS translation support for the calendar overview; integrate with calDAV[/li]
[li](in progress Habeas Codice) service classes - provide a pluggable subscription payment gateway for premium accounts[/li]
[li](in progress Habeas Codice) service classes - account overview page showing resources consumed by channel. With special consideration this page can also be accessed at a meta level by the site admin to drill down on problematic accounts/channels.[/li]
[li]Events module - fix permissions on events, and provide JS translation support for the calendar overview (done); integrate with calDAV[/li]
[li]Uploads - integrate #^[url=https://github.com/blueimp/jQuery-File-Upload]https://github.com/blueimp/jQuery-File-Upload[/url][/li]
[li]Import/export - include events, things, etc.[/li]
[li]API extensions, for Twitter API - search, friending, threading. For Red API, lots of stuff[/li]
[li]OAuth permission extensions[/li]
[li]Import channel from Diaspora/Friendica[/li]
[li]Import channel from Diaspora/Friendica (Diaspora partially done)[/li]
[li]MediaGoblin photo "crosspost" connector[/li]
[li]Create management page/UI for extensible profile fields[/li]
[li]Create interface to include/exclude and re-order standard profile fields[/li]
[li]Provide a mechanism to share page design elements in posts (just like apps)[/li]
[li]Provide a mechanism to share page design elements in posts (just like apps) (done)[/li]
[li]App taxonomy[/li]
[li]Customisable App collection pages[/li]
[li]replace the tinymce visual editor and/or make the visual editor pluggable and responsive to different output formats. We probably want library/bbedit for bbcode. This needs a fair bit of work to catch up with our "enhanced bbcode", but start with images, links, bold and highlight and work from there.[/li]
[li]Photos module - turn photos into normal conversations and fix tagging[/li]
[li]Create mobile clients for the top platforms - which involves extending the API so that we can do stuff far beyond the current crop of Twitter/Statusnet clients. Ditto for mobile themes. We can probably use something like the Friendica Android app as a base to start from.[/li]
[li]Implement owned and exchangeable "things".[/li]
[li](in progress Habeas Codice) Implement owned and exchangeable "things".[/li]
[li]Family Account creation - using service classes (an account holder can create a certain number of sub-accounts which are all tied to their subscription - if the subscription lapses they all go away).[/li]
[li]Put mod_admin under Comanche[/li]

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

View file

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View file

Before

Width:  |  Height:  |  Size: 910 B

After

Width:  |  Height:  |  Size: 910 B

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

Before

Width:  |  Height:  |  Size: 8.3 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

View file

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View file

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

View file

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View file

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

@ -331,6 +331,24 @@ function channel_remove($channel_id, $local = true, $unset_session=true) {
dbesc(datetime_convert()),
intval($channel_id)
);
// if this was the default channel, set another one as default
if($a->account['account_default_channel'] == $channel_id) {
$r = q("select channel_id from channel where channel_account_id = %d and channel_removed = 0 limit 1",
intval($a->account['account_id']),
intval(PAGE_REMOVED));
if ($r) {
$rr = q("update account set account_default_channel = %d where account_id = %d",
intval($r[0]['channel_id']),
intval($a->account['account_id']));
logger("Default channel deleted, changing default to channel_id " . $r[0]['channel_id']);
}
else {
$rr = q("update account set account_default_channel = 0 where account_id = %d",
intval($r[0]['channel_id']),
intval($a->account['account_id']));
}
}
$r = q("update hubloc set hubloc_deleted = 1 where hubloc_hash = '%s' and hubloc_url = '%s' ",
dbesc($channel['channel_hash']),

View file

@ -391,13 +391,18 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$hash = (($arr && $arr['hash']) ? $arr['hash'] : null);
$upload_path = (($arr && $arr['directory']) ? $arr['directory'] : '');
// logger('arr: ' . print_r($arr,true));
logger('arr: ' . print_r($arr,true));
if(! perm_is_allowed($channel_id,get_observer_hash(), 'write_storage')) {
$ret['message'] = t('Permission denied.');
return $ret;
}
$str_group_allow = perms2str($arr['group_allow']);
$str_contact_allow = perms2str($arr['contact_allow']);
$str_group_deny = perms2str($arr['group_deny']);
$str_contact_deny = perms2str($arr['contact_deny']);
// The 'update' option sets db values without uploading a new attachment
// 'replace' replaces the existing uploaded data
@ -473,14 +478,13 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
}
$darr = array('pathname' => $pathname);
if($arr && array_key_exists('allow_cid',$arr))
$darr['allow_cid'] = $arr['allow_cid'];
if($arr && array_key_exists('allow_gid',$arr))
$darr['allow_gid'] = $arr['allow_gid'];
if($arr && array_key_exists('deny_cid',$arr))
$darr['deny_cid'] = $arr['deny_cid'];
if($arr && array_key_exists('deny_gid',$arr))
$darr['deny_gid'] = $arr['deny_gid'];
// if we need to create a directory, use the channel default permissions.
$darr['allow_cid'] = $channel['allow_cid'];
$darr['allow_gid'] = $channel['allow_gid'];
$darr['deny_cid'] = $channel['deny_cid'];
$darr['deny_gid'] = $channel['deny_gid'];
if($pathname) {
@ -652,9 +656,9 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
dbesc($created),
dbesc($created),
dbesc(($arr && array_key_exists('allow_cid',$arr)) ? $arr['allow_cid'] : $str_contact_allow),
dbesc(($arr && array_key_exists('allow_gid',$arr)) ? $arr['allow_gid'] : ''),
dbesc(($arr && array_key_exists('deny_cid',$arr)) ? $arr['deny_cid'] : ''),
dbesc(($arr && array_key_exists('deny_gid',$arr)) ? $arr['deny_gid'] : '')
dbesc(($arr && array_key_exists('allow_gid',$arr)) ? $arr['allow_gid'] : $str_group_allow),
dbesc(($arr && array_key_exists('deny_cid',$arr)) ? $arr['deny_cid'] : $str_contact_deny),
dbesc(($arr && array_key_exists('deny_gid',$arr)) ? $arr['deny_gid'] : $str_group_deny)
);
}
@ -662,6 +666,12 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
$args = array( 'source' => $source, 'visible' => 0, 'resource_id' => $hash, 'album' => basename($pathname), 'os_path' => $os_basepath . $os_relpath, 'filename' => $filename, 'getimagesize' => $gis);
if($arr['contact_allow'])
$args['contact_allow'] = $arr['contact_allow'];
if($arr['group_allow'])
$args['group_allow'] = $arr['group_allow'];
if($arr['contact_deny'])
$args['contact_deny'] = $arr['contact_deny'];
if($arr['group_deny'])
$args['group_deny'] = $arr['group_deny'];
$p = photo_upload($channel,get_app()->get_observer(),$args);
if($p['success']) {
$ret['body'] = $p['body'];

View file

@ -174,10 +174,14 @@ function bb_parse_app($match) {
function bb_parse_element($match) {
$j = json_decode(base64url_decode($match[1]),true);
if ($j) {
if ($j && local_channel()) {
$text = sprintf( t('Install %s element: '), translate_design_element($j['type'])) . $j['pagetitle'];
$o = EOL . '<a href="#" onclick="importElement(\'' . $match[1] . '\'); return false;" >' . $text . '</a>' . EOL;
}
else {
$text = sprintf( t('This post contains an installable %s element, however you lack permissions to install it on this site.' ), translate_design_element($j['type'])) . $j['pagetitle'];
$o = EOL . $text . EOL;
}
return $o;
}

View file

@ -284,6 +284,11 @@ function comanche_widget($name, $text) {
if(file_exists('widget/' . trim($name) . '.php'))
require_once('widget/' . trim($name) . '.php');
else {
$theme_widget = 'widget_' . trim($name) . '.php';
if(theme_include($theme_widget))
require_once(theme_include($theme_widget));
}
$func = 'widget_' . trim($name);
if (function_exists($func))

View file

@ -5,7 +5,7 @@ function contact_profile_assign($current) {
$o = '';
$o .= "<select id=\"contact-profile-selector\" name=\"profile_assign\" />\r\n";
$o .= "<select id=\"contact-profile-selector\" name=\"profile_assign\" class=\"form-control\"/>\r\n";
$r = q("SELECT profile_guid, profile_name FROM `profile` WHERE `uid` = %d",
intval($_SESSION['uid']));

View file

@ -79,7 +79,8 @@ function categories_widget($baseurl,$selected = '') {
where item.uid = %d
and term.uid = item.uid
and term.type = %d
and item.author_xchan = '%s'
and item.owner_xchan = '%s'
and item.item_wall = 1
$item_normal
order by term.term asc",
intval($a->profile['profile_uid']),

View file

@ -1168,7 +1168,7 @@ function status_editor($a, $x, $popup = false) {
'$pagetitle' => (x($x,'pagetitle') ? $x['pagetitle'] : ''),
'$id_select' => $id_select,
'$id_seltext' => t('Post as'),
'$writefiles' => (perm_is_allowed($x['profile_uid'], get_observer_hash(), 'post_photos') || perm_is_allowed($x['profile_uid'], get_observer_hash(), 'write_storage')),
'$writefiles' => perm_is_allowed($x['profile_uid'], get_observer_hash(), 'write_storage'),
'$bold' => t('Bold'),
'$italic' => t('Italic'),
'$underline' => t('Underline'),
@ -1377,7 +1377,8 @@ function render_location_default($item) {
function prepare_page($item) {
$a = get_app();
$naked = ((get_pconfig($item['uid'],'system','nakedpage')) ? 1 : 0);
$naked = 1;
// $naked = ((get_pconfig($item['uid'],'system','nakedpage')) ? 1 : 0);
$observer = $a->get_observer();
//240 chars is the longest we can have before we start hitting problems with suhosin sites
$preview = substr(urlencode($item['body']), 0, 240);
@ -1586,7 +1587,7 @@ function profile_tabs($a, $is_owner = false, $nickname = null){
'id' => 'profile-tab',
);
}
if ($p['view_photos']) {
if ($p['view_storage']) {
$tabs[] = array(
'label' => t('Photos'),
'url' => $a->get_baseurl() . '/photos/' . $nickname,
@ -1594,8 +1595,6 @@ function profile_tabs($a, $is_owner = false, $nickname = null){
'title' => t('Photo Albums'),
'id' => 'photo-tab',
);
}
if ($p['view_storage']) {
$tabs[] = array(
'label' => t('Files'),
'url' => $a->get_baseurl() . '/cloud/' . $nickname . ((get_observer_hash()) ? '' : '?f=&davguest=1'),

View file

@ -329,6 +329,7 @@ function diaspora_get_contact_by_handle($uid,$handle) {
function find_diaspora_person_by_handle($handle) {
$person = false;
$refresh = false;
if(diaspora_is_blacklisted($handle))
return false;
@ -339,9 +340,13 @@ function find_diaspora_person_by_handle($handle) {
if($r) {
$person = $r[0];
logger('find_diaspora_person_by handle: in cache ' . print_r($r,true), LOGGER_DATA);
if($person['xchan_name_date'] < datetime_convert('UTC','UTC', 'now - 1 month')) {
logger('Updating Diaspora cached record for ' . $handle);
$refresh = true;
}
}
if(! $person) {
if((! $person) || ($refresh)) {
// try webfinger. Make sure to distinguish between diaspora,
// hubzilla w/diaspora protocol and friendica w/diaspora protocol.
@ -349,7 +354,7 @@ function find_diaspora_person_by_handle($handle) {
$result = discover_by_webbie($handle);
if($result) {
$r = q("select * from xchan where xchan_addr = '%s' limit 1",
dbesc($handle)
dbesc(str_replace('acct:','',$handle))
);
if($r) {
$person = $r[0];
@ -1003,6 +1008,11 @@ function diaspora_post($importer,$xml,$msg) {
return 202;
}
if(! is_importable($datarray,$contact)) {
logger('diaspora_post: filtering this author.');
return 202;
}
$result = item_store($datarray);
return;

View file

@ -72,33 +72,20 @@ function check_upstream_directory() {
set_config('system', 'directory_server', '');
}
function get_globaldir_setting($observer) {
if($observer)
$globaldir = get_xconfig($observer,'directory','globaldir');
else
$globaldir = ((array_key_exists('globaldir',$_SESSION)) ? intval($_SESSION['globaldir']) : false);
if($globaldir === false)
$globaldir = get_config('directory','globaldir');
return $globaldir;
}
function get_safemode_setting($observer) {
function get_directory_setting($observer, $setting) {
if ($observer)
$safe_mode = get_xconfig($observer,'directory','safe_mode');
$ret = get_xconfig($observer, 'directory', $setting);
else
$safe_mode = ((array_key_exists('safemode',$_SESSION)) ? intval($_SESSION['safemode']) : false);
$ret = ((array_key_exists($setting,$_SESSION)) ? intval($_SESSION[$setting]) : false);
if($safe_mode === false)
$safe_mode = get_config('directory','safe_mode');
if($ret === false)
$ret = get_config('directory', $setting);
if($safe_mode === false)
$safe_mode = 1;
if($setting == 'safemode' && $ret === false)
$ret = 1;
return $safe_mode;
return $ret;
}
/**
@ -110,49 +97,37 @@ function dir_sort_links() {
$observer = get_observer_hash();
$safe_mode = get_safemode_setting($observer);
$globaldir = get_globaldir_setting($observer);
$safe_mode = get_directory_setting($observer, 'safemode');
$globaldir = get_directory_setting($observer, 'globaldir');
$pubforums = get_directory_setting($observer, 'pubforums');
// Build urls without order and pubforums so it's easy to tack on the changed value
// Probably there's an easier way to do this
$directory_sort_order = get_config('system','directory_sort_order');
if(! $directory_sort_order)
$directory_sort_order = 'date';
$current_order = (($_REQUEST['order']) ? $_REQUEST['order'] : $directory_sort_order);
$suggest = (($_REQUEST['suggest']) ? '&suggest=' . $_REQUEST['suggest'] : '');
$url = 'directory?f=';
$tmp = array_merge($_GET,$_POST);
unset($tmp['order']);
unset($tmp['q']);
unset($tmp['f']);
$sorturl = $url . http_build_query($tmp);
$tmp = array_merge($_GET,$_POST);
unset($tmp['suggest']);
unset($tmp['pubforums']);
unset($tmp['global']);
unset($tmp['safe']);
unset($tmp['q']);
unset($tmp['f']);
$forumsurl = $url . http_build_query($tmp);
$forumsurl = $url . http_build_query($tmp) . $suggest;
$o = replace_macros(get_markup_template('dir_sort_links.tpl'), array(
'$header' => t('Directory Options'),
'$normal' => t('Alphabetic'),
'$reverse' => t('Reverse Alphabetic'),
'$date' => t('Newest to Oldest'),
'$reversedate' => t('Oldest to Newest'),
'$sort' => t('Sort'),
'$selected_sort' => $current_order,
'$sorturl' => $sorturl,
'$forumsurl' => $forumsurl,
'$safemode' => array('safemode', t('Safe Mode'),$safe_mode,'','',' onchange=\'window.location.href="' . $forumsurl . '&safe="+(this.checked ? 1 : 0)\''),
'$pubforums' => array('pubforums', t('Public Forums Only'),(x($_REQUEST,'pubforums') ? $_REQUEST['pubforums'] : ''),'','',' onchange=\'window.location.href="' . $forumsurl . '&pubforums="+(this.checked ? 1 : 0)\''),
'$globaldir' => array('globaldir', t('This Website Only'), 1-intval($globaldir),'','',' onchange=\'window.location.href="' . $forumsurl . '&global="+(this.checked ? 0 : 1)\''),
'$safemode' => array('safemode', t('Safe Mode'),$safe_mode,'',array(t('No'), t('Yes')),' onchange=\'window.location.href="' . $forumsurl . '&safe="+(this.checked ? 1 : 0)\''),
'$pubforums' => array('pubforums', t('Public Forums Only'),$pubforums,'',array(t('No'), t('Yes')),' onchange=\'window.location.href="' . $forumsurl . '&pubforums="+(this.checked ? 1 : 0)\''),
'$globaldir' => array('globaldir', t('This Website Only'), 1-intval($globaldir),'',array(t('No'), t('Yes')),' onchange=\'window.location.href="' . $forumsurl . '&global="+(this.checked ? 0 : 1)\''),
));
return $o;

View file

@ -90,6 +90,7 @@ function format_event_ical($ev) {
$o .= "\nLOCATION:" . format_ical_text($ev['location']);
if($ev['description'])
$o .= "\nDESCRIPTION:" . format_ical_text($ev['description']);
$o .= "\nUID:" . $ev['event_hash'] ;
$o .= "\nEND:VEVENT\n";
return $o;
@ -100,7 +101,7 @@ function format_ical_text($s) {
require_once('include/bbcode.php');
require_once('include/html2plain.php');
return(wordwrap(html2plain(bbcode($s)),72,"\n ",true));
return(wordwrap(str_replace(',','\\,',html2plain(bbcode($s))),72,"\n ",true));
}
@ -208,6 +209,7 @@ function event_store_event($arr) {
$arr['type'] = (($arr['type']) ? $arr['type'] : 'event' );
$arr['event_xchan'] = (($arr['event_xchan']) ? $arr['event_xchan'] : '');
// Existing event being modified
if($arr['id'] || $arr['event_hash']) {
@ -275,7 +277,11 @@ function event_store_event($arr) {
// New event. Store it.
$hash = random_string();
if(array_key_exists('external_id',$arr))
$hash = $arr['external_id'];
else
$hash = random_string();
$r = q("INSERT INTO event ( uid,aid,event_xchan,event_hash,created,edited,start,finish,summary,description,location,type,
adjust,nofinish,allow_cid,allow_gid,deny_cid,deny_gid)
@ -364,6 +370,84 @@ function event_addtocal($item_id, $uid) {
}
function parse_ical_file($f,$uid) {
require_once('library/ical.php');
$ical = new ICal($f);
if($ical) {
$events = $ical->events();
if($events) {
foreach($events as $ev) {
logger('event parsed: ' . print_r($ev,true), LOGGER_ALL);
event_import_ical($ev,$uid);
}
}
return true;
}
return false;
}
function event_import_ical($ical, $uid) {
$c = q("select * from channel where channel_id = %d limit 1",
intval($uid)
);
if(! $c)
return false;
$channel = $c[0];
$ev = array();
if($ical['CREATED'])
$ev['created'] = datetime_convert('UTC','UTC',$ical['CREATED']);
if($ical['LAST-MODIFIED'])
$ev['edited'] = datetime_convert('UTC','UTC',$ical['LAST-MODIFIED']);
if($ical['LOCATION'])
$ev['location'] = $ical['LOCATION'];
if($ical['DESCRIPTION'])
$ev['description'] = $ical['DESCRIPTION'];
if($ical['SUMMARY'])
$ev['summary'] = $ical['SUMMARY'];
if($ical['DTEND'])
$ev['finish'] = datetime_convert('UTC','UTC', $ical['DTEND']);
else
$ev['nofinish'] = 1;
$ev['start'] = datetime_convert('UTC','UTC',$ical['DTSTART']);
if(substr($ical['DTSTART'],-1) === 'Z')
$ev['adjust'] = 1;
if($ical['UID']) {
$r = q("SELECT * FROM event WHERE event_hash = '%s' AND uid = %d LIMIT 1",
dbesc($ical['UID']),
intval($arr['uid'])
);
if($r)
$ev['event_hash'] = $ical['UID'];
else
$ev['external_id'] = $ical['UID'];
}
if($ical['SUMMARY'] && $ical['DTSTART']) {
$ev['event_xchan'] = $channel['channel_hash'];
$ev['uid'] = $channel['channel_id'];
$ev['account'] = $channel['channel_account_id'];
$ev['private'] = 1;
logger('storing event: ' . print_r($ev,true), LOGGER_ALL);
$event = event_store_event($ev);
if($event) {
$item_id = event_store_item($ev,$event);
return true;
}
}
return false;
}
function event_store_item($arr, $event) {
require_once('include/datetime.php');

View file

@ -583,8 +583,14 @@ function identity_basic_export($channel_id, $items = false) {
/** @warning this may run into memory limits on smaller systems */
$r = q("select * from item where item_wall = 1 and item_deleted = 0 and uid = %d",
intval($channel_id)
/** export one year 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.
*/
$r = q("select * from item where item_wall = 1 and item_deleted = 0 and uid = %d and created > %s - INTERVAL %s",
intval($channel_id),
db_utcnow(),
db_quoteinterval('1 YEAR')
);
if($r) {
$ret['item'] = array();
@ -598,6 +604,32 @@ function identity_basic_export($channel_id, $items = false) {
}
function identity_export_year($channel_id,$year) {
if(! $year)
return array();
$ret = array();
$mindate = datetime_convert('UTC','UTC',$year . '-01-01 00:00:00');
$maxdate = datetime_convert('UTC','UTC',$year+1 . '-01-01 00:00:00');
$r = q("select * from item where item_wall = 1 and item_deleted = 0 and uid = %d and created >= '%s' and created < '%s' ",
intval($channel_id),
dbesc($mindate),
dbesc($maxdate)
);
if($r) {
$ret['item'] = array();
xchan_query($r);
$r = fetch_post_tags($r,true);
foreach($r as $rr)
$ret['item'][] = encode_item($rr,true);
}
return $ret;
}
/**
* @brief Loads a profile into the App structure.
*
@ -1360,10 +1392,10 @@ function get_theme_uid() {
* with the specified size.
*
* @param int $size
* one of (175, 80, 48)
* one of (300, 80, 48)
* @returns string
*/
function get_default_profile_photo($size = 175) {
function get_default_profile_photo($size = 300) {
$scheme = get_config('system','default_profile_photo');
if(! $scheme)
$scheme = 'rainbow_man';

View file

@ -1282,10 +1282,12 @@ function encode_item($item,$mirror = false) {
if($item['diaspora_meta']) {
$z = json_decode($item['diaspora_meta'],true);
if($z) {
if(array_key_exists('iv',$z))
if(is_array($z) && array_key_exists('iv',$z))
$x['diaspora_signature'] = crypto_unencapsulate($z,$key);
else
$x['diaspora_signature'] = $z;
if(! is_array($z))
logger('encode_item: diaspora meta is not an array: ' . print_r($z,true));
}
}
logger('encode_item: ' . print_r($x,true), LOGGER_DATA);
@ -2685,11 +2687,12 @@ function item_store_update($arr,$allow_exec = false) {
return $ret;
}
$r = q("delete from term where oid = %d and otype = %d",
intval($orig_post_id),
intval(TERM_OBJ_POST)
);
if(is_array($terms)) {
$r = q("delete from term where oid = %d and otype = %d",
intval($orig_post_id),
intval(TERM_OBJ_POST)
);
foreach($terms as $t) {
q("insert into term (uid,oid,otype,type,term,url)
values(%d,%d,%d,%d,'%s','%s') ",
@ -2701,7 +2704,6 @@ function item_store_update($arr,$allow_exec = false) {
dbesc($t['url'])
);
}
$arr['term'] = $terms;
}
@ -3374,14 +3376,18 @@ function post_is_importable($item,$abook) {
if(! $item)
return false;
if((! $abook['abook_incl']) && (! $abook['abook_excl']))
if(! ($abook['abook_incl'] || $abook['abook_excl']))
return true;
require_once('include/html2plain.php');
$text = prepare_text($item['body'],$item['mimetype']);
$text = html2plain($text);
$lang = null;
if((strpos($abook['abook_incl'],'lang=') !== false) || (strpos($abook['abook_excl'],'lang=') !== false)) {
$lang = detect_language($text);
}
$tags = ((count($item['term'])) ? $item['term'] : false);
// exclude always has priority
@ -3398,6 +3404,8 @@ function post_is_importable($item,$abook) {
}
elseif((strpos($word,'/') === 0) && preg_match($word,$body))
return false;
elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0))
return false;
elseif(stristr($text,$word) !== false)
return false;
}
@ -3415,6 +3423,8 @@ function post_is_importable($item,$abook) {
}
elseif((strpos($word,'/') === 0) && preg_match($word,$body))
return true;
elseif((strpos($word,'lang=') === 0) && ($lang) && (strcasecmp($lang,trim(substr($word,5))) == 0))
return true;
elseif(stristr($text,$word) !== false)
return true;
}
@ -3755,6 +3765,10 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
$author['owner_avatar'] = $contact['thumb'];
}
if(! is_importable($datarray,$contact))
continue;
logger('consume_feed: author ' . print_r($author,true),LOGGER_DEBUG);
logger('consume_feed: ' . print_r($datarray,true),LOGGER_DATA);
@ -4389,7 +4403,6 @@ function first_post_date($uid,$wall = false) {
$r = q("select id, created from item
where uid = %d and id = parent $item_normal $wall_sql
order by created asc limit 1",
intval(ITEM_VISIBLE),
intval($uid)
);

View file

@ -531,7 +531,7 @@ function avatar_img($email) {
$avatar = array();
$a = get_app();
$avatar['size'] = 175;
$avatar['size'] = 300;
$avatar['email'] = $email;
$avatar['url'] = '';
$avatar['success'] = false;
@ -1135,9 +1135,27 @@ function discover_by_webbie($webbie) {
}
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($webbie)
dbesc($addr)
);
if(! $r) {
/**
*
* Diaspora communications are notoriously unreliable and receiving profile update messages (indeed any messages)
* are pretty much random luck. We'll check the timestamp of the xchan_name_date at a higher level and refresh
* this record once a month; because if you miss a profile update message and they update their profile photo or name
* you're otherwise stuck with stale info until they change their profile again - which could be years from now.
*
*/
if($r) {
$r = q("update xchan set xchan_name = '%s', xchan_network = '%s', xchan_name_date = '%s' where xchan_hash = '%s' limit 1",
dbesc($vcard['fn']),
dbesc($network),
dbesc(datetime_convert()),
dbesc($addr)
);
}
else {
$r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_pubkey, xchan_addr, xchan_url, xchan_name, xchan_network, xchan_instance_url, xchan_name_date ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
dbesc($addr),

View file

@ -25,9 +25,8 @@ function get_perms() {
// Read only permissions
'view_stream' => array('channel_r_stream', intval(PERMS_R_STREAM), true, t('Can view my normal stream and posts'), ''),
'view_profile' => array('channel_r_profile', intval(PERMS_R_PROFILE), true, t('Can view my default channel profile'), ''),
'view_photos' => array('channel_r_photos', intval(PERMS_R_PHOTOS), true, t('Can view my photo albums'), ''),
'view_contacts' => array('channel_r_abook', intval(PERMS_R_ABOOK), true, t('Can view my connections'), ''),
'view_storage' => array('channel_r_storage', intval(PERMS_R_STORAGE), true, t('Can view my file storage'), ''),
'view_storage' => array('channel_r_storage', intval(PERMS_R_STORAGE), true, t('Can view my file storage and photos'), ''),
'view_pages' => array('channel_r_pages', intval(PERMS_R_PAGES), true, t('Can view my webpages'), ''),
// Write permissions
@ -35,12 +34,11 @@ function get_perms() {
'post_wall' => array('channel_w_wall', intval(PERMS_W_WALL), false, t('Can post on my channel page ("wall")'), ''),
'post_comments' => array('channel_w_comment', intval(PERMS_W_COMMENT), false, t('Can comment on or like my posts'), ''),
'post_mail' => array('channel_w_mail', intval(PERMS_W_MAIL), false, t('Can send me private mail messages'), ''),
'post_photos' => array('channel_w_photos', intval(PERMS_W_PHOTOS), false, t('Can post photos to my photo albums'), ''),
'post_like' => array('channel_w_like', intval(PERMS_W_LIKE), false, t('Can like/dislike stuff'), t('Profiles and things other than posts/comments')),
'tag_deliver' => array('channel_w_tagwall', intval(PERMS_W_TAGWALL), false, t('Can forward to all my channel contacts via post @mentions'), t('Advanced - useful for creating group forum channels')),
'chat' => array('channel_w_chat', intval(PERMS_W_CHAT), false, t('Can chat with me (when available)'), t('')),
'write_storage' => array('channel_w_storage', intval(PERMS_W_STORAGE), false, t('Can write to my file storage'), ''),
'write_storage' => array('channel_w_storage', intval(PERMS_W_STORAGE), false, t('Can write to my file storage and photos'), ''),
'write_pages' => array('channel_w_pages', intval(PERMS_W_PAGES), false, t('Can edit my webpages'), ''),
'republish' => array('channel_a_republish', intval(PERMS_A_REPUBLISH), false, t('Can source my public posts in derived channels'), t('Somewhat advanced - very useful in open communities')),
@ -496,7 +494,6 @@ function site_default_perms() {
$typical = array(
'view_stream' => PERMS_PUBLIC,
'view_profile' => PERMS_PUBLIC,
'view_photos' => PERMS_PUBLIC,
'view_contacts' => PERMS_PUBLIC,
'view_storage' => PERMS_PUBLIC,
'view_pages' => PERMS_PUBLIC,
@ -504,7 +501,6 @@ function site_default_perms() {
'post_wall' => PERMS_SPECIFIC,
'post_comments' => PERMS_SPECIFIC,
'post_mail' => PERMS_SPECIFIC,
'post_photos' => PERMS_SPECIFIC,
'tag_deliver' => PERMS_SPECIFIC,
'chat' => PERMS_SPECIFIC,
'write_storage' => PERMS_SPECIFIC,
@ -554,22 +550,20 @@ function get_role_perms($role) {
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = true;
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE;
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE;
$ret['channel_r_stream'] = PERMS_PUBLIC;
$ret['channel_r_profile'] = PERMS_PUBLIC;
$ret['channel_r_photos'] = PERMS_PUBLIC;
$ret['channel_r_abook'] = PERMS_PUBLIC;
$ret['channel_w_stream'] = PERMS_SPECIFIC;
$ret['channel_w_wall'] = PERMS_SPECIFIC;
$ret['channel_w_tagwall'] = PERMS_SPECIFIC;
$ret['channel_w_comment'] = PERMS_SPECIFIC;
$ret['channel_w_mail'] = PERMS_SPECIFIC;
$ret['channel_w_photos'] = PERMS_SPECIFIC;
$ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = PERMS_SPECIFIC;
$ret['channel_r_storage'] = PERMS_PUBLIC;
@ -586,22 +580,20 @@ function get_role_perms($role) {
$ret['default_collection'] = true;
$ret['directory_publish'] = true;
$ret['online'] = true;
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE;
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE;
$ret['channel_r_stream'] = PERMS_PUBLIC;
$ret['channel_r_profile'] = PERMS_PUBLIC;
$ret['channel_r_photos'] = PERMS_PUBLIC;
$ret['channel_r_abook'] = PERMS_PUBLIC;
$ret['channel_w_stream'] = PERMS_SPECIFIC;
$ret['channel_w_wall'] = PERMS_SPECIFIC;
$ret['channel_w_tagwall'] = PERMS_SPECIFIC;
$ret['channel_w_comment'] = PERMS_SPECIFIC;
$ret['channel_w_mail'] = PERMS_SPECIFIC;
$ret['channel_w_photos'] = PERMS_SPECIFIC;
$ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = PERMS_SPECIFIC;
$ret['channel_r_storage'] = PERMS_PUBLIC;
@ -618,22 +610,20 @@ function get_role_perms($role) {
$ret['default_collection'] = true;
$ret['directory_publish'] = false;
$ret['online'] = false;
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE;
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE;
$ret['channel_r_stream'] = PERMS_PUBLIC;
$ret['channel_r_profile'] = PERMS_PUBLIC;
$ret['channel_r_photos'] = PERMS_PUBLIC;
$ret['channel_r_abook'] = PERMS_SPECIFIC;
$ret['channel_w_stream'] = PERMS_SPECIFIC;
$ret['channel_w_wall'] = PERMS_SPECIFIC;
$ret['channel_w_tagwall'] = PERMS_SPECIFIC;
$ret['channel_w_comment'] = PERMS_SPECIFIC;
$ret['channel_w_mail'] = PERMS_SPECIFIC;
$ret['channel_w_photos'] = PERMS_SPECIFIC;
$ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = PERMS_SPECIFIC;
$ret['channel_r_storage'] = PERMS_PUBLIC;
@ -650,22 +640,20 @@ function get_role_perms($role) {
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE|PERMS_W_TAGWALL;
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE|PERMS_W_TAGWALL;
$ret['channel_r_stream'] = PERMS_PUBLIC;
$ret['channel_r_profile'] = PERMS_PUBLIC;
$ret['channel_r_photos'] = PERMS_PUBLIC;
$ret['channel_r_abook'] = PERMS_PUBLIC;
$ret['channel_w_stream'] = PERMS_SPECIFIC;
$ret['channel_w_wall'] = PERMS_SPECIFIC;
$ret['channel_w_tagwall'] = PERMS_SPECIFIC;
$ret['channel_w_comment'] = PERMS_SPECIFIC;
$ret['channel_w_mail'] = PERMS_SPECIFIC;
$ret['channel_w_photos'] = PERMS_SPECIFIC;
$ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = PERMS_SPECIFIC;
$ret['channel_r_storage'] = PERMS_PUBLIC;
@ -682,22 +670,20 @@ function get_role_perms($role) {
$ret['default_collection'] = true;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE|PERMS_W_TAGWALL;
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE|PERMS_W_TAGWALL;
$ret['channel_r_stream'] = PERMS_PUBLIC;
$ret['channel_r_profile'] = PERMS_PUBLIC;
$ret['channel_r_photos'] = PERMS_PUBLIC;
$ret['channel_r_abook'] = PERMS_PUBLIC;
$ret['channel_w_stream'] = PERMS_SPECIFIC;
$ret['channel_w_wall'] = PERMS_SPECIFIC;
$ret['channel_w_tagwall'] = PERMS_SPECIFIC;
$ret['channel_w_comment'] = PERMS_SPECIFIC;
$ret['channel_w_mail'] = PERMS_SPECIFIC;
$ret['channel_w_photos'] = PERMS_SPECIFIC;
$ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = PERMS_SPECIFIC;
$ret['channel_r_storage'] = PERMS_PUBLIC;
@ -714,22 +700,20 @@ function get_role_perms($role) {
$ret['default_collection'] = true;
$ret['directory_publish'] = false;
$ret['online'] = false;
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE;
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILEPERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE;
$ret['channel_r_stream'] = PERMS_PUBLIC;
$ret['channel_r_profile'] = PERMS_SPECIFIC;
$ret['channel_r_photos'] = PERMS_SPECIFIC;
$ret['channel_r_abook'] = PERMS_SPECIFIC;
$ret['channel_w_stream'] = PERMS_SPECIFIC;
$ret['channel_w_wall'] = PERMS_SPECIFIC;
$ret['channel_w_tagwall'] = PERMS_SPECIFIC;
$ret['channel_w_comment'] = PERMS_SPECIFIC;
$ret['channel_w_mail'] = PERMS_SPECIFIC;
$ret['channel_w_photos'] = PERMS_SPECIFIC;
$ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = PERMS_SPECIFIC;
$ret['channel_r_storage'] = PERMS_SPECIFIC;
@ -746,22 +730,20 @@ function get_role_perms($role) {
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE;
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE;
$ret['channel_r_stream'] = PERMS_PUBLIC;
$ret['channel_r_profile'] = PERMS_PUBLIC;
$ret['channel_r_photos'] = PERMS_PUBLIC;
$ret['channel_r_abook'] = PERMS_PUBLIC;
$ret['channel_w_stream'] = PERMS_SPECIFIC;
$ret['channel_w_wall'] = PERMS_SPECIFIC;
$ret['channel_w_tagwall'] = PERMS_SPECIFIC;
$ret['channel_w_comment'] = PERMS_SPECIFIC;
$ret['channel_w_mail'] = PERMS_SPECIFIC;
$ret['channel_w_photos'] = PERMS_SPECIFIC;
$ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = PERMS_SPECIFIC;
$ret['channel_r_storage'] = PERMS_PUBLIC;
@ -778,22 +760,20 @@ function get_role_perms($role) {
$ret['default_collection'] = true;
$ret['directory_publish'] = false;
$ret['online'] = false;
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE;
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_W_LIKE;
$ret['channel_r_stream'] = PERMS_PUBLIC;
$ret['channel_r_profile'] = PERMS_PUBLIC;
$ret['channel_r_photos'] = PERMS_PUBLIC;
$ret['channel_r_abook'] = PERMS_PUBLIC;
$ret['channel_w_stream'] = PERMS_SPECIFIC;
$ret['channel_w_wall'] = PERMS_SPECIFIC;
$ret['channel_w_tagwall'] = PERMS_SPECIFIC;
$ret['channel_w_comment'] = PERMS_SPECIFIC;
$ret['channel_w_mail'] = PERMS_SPECIFIC;
$ret['channel_w_photos'] = PERMS_SPECIFIC;
$ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = PERMS_SPECIFIC;
$ret['channel_r_storage'] = PERMS_PUBLIC;
@ -810,20 +790,18 @@ function get_role_perms($role) {
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE;
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_R_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE;
$ret['channel_r_stream'] = PERMS_PUBLIC;
$ret['channel_r_profile'] = PERMS_PUBLIC;
$ret['channel_r_photos'] = PERMS_PUBLIC;
$ret['channel_r_abook'] = PERMS_PUBLIC;
$ret['channel_w_stream'] = PERMS_SPECIFIC;
$ret['channel_w_wall'] = PERMS_SPECIFIC;
$ret['channel_w_tagwall'] = PERMS_SPECIFIC;
$ret['channel_w_comment'] = PERMS_SPECIFIC;
$ret['channel_w_mail'] = PERMS_SPECIFIC;
$ret['channel_w_photos'] = PERMS_SPECIFIC;
$ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = PERMS_SPECIFIC;
$ret['channel_r_storage'] = PERMS_PUBLIC;
@ -840,22 +818,20 @@ function get_role_perms($role) {
$ret['default_collection'] = false;
$ret['directory_publish'] = true;
$ret['online'] = false;
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_follow'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_W_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE|PERMS_W_TAGWALL;
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK
$ret['perms_accept'] = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_ABOOK
|PERMS_W_STREAM|PERMS_W_WALL|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT
|PERMS_R_STORAGE|PERMS_W_STORAGE|PERMS_R_PAGES|PERMS_A_REPUBLISH|PERMS_W_LIKE|PERMS_W_TAGWALL;
$ret['channel_r_stream'] = PERMS_PUBLIC;
$ret['channel_r_profile'] = PERMS_PUBLIC;
$ret['channel_r_photos'] = PERMS_PUBLIC;
$ret['channel_r_abook'] = PERMS_PUBLIC;
$ret['channel_w_stream'] = PERMS_SPECIFIC;
$ret['channel_w_wall'] = PERMS_SPECIFIC;
$ret['channel_w_tagwall'] = PERMS_SPECIFIC;
$ret['channel_w_comment'] = PERMS_SPECIFIC;
$ret['channel_w_mail'] = PERMS_SPECIFIC;
$ret['channel_w_photos'] = PERMS_SPECIFIC;
$ret['channel_w_chat'] = PERMS_SPECIFIC;
$ret['channel_a_delegate'] = PERMS_SPECIFIC;
$ret['channel_r_storage'] = PERMS_PUBLIC;

View file

@ -605,16 +605,16 @@ function import_profile_photo($photo,$xchan,$thing = false) {
if(($width / $height) > 1.2) {
// crop out the sides
$margin = $width - $height;
$img->cropImage(175,($margin / 2),0,$height,$height);
$img->cropImage(300,($margin / 2),0,$height,$height);
}
elseif(($height / $width) > 1.2) {
// crop out the bottom
$margin = $height - $width;
$img->cropImage(175,0,0,$width,$width);
$img->cropImage(300,0,0,$width,$width);
}
else {
$img->scaleImageSquare(175);
$img->scaleImageSquare(300);
}
}
@ -681,7 +681,7 @@ function import_channel_photo($photo,$type,$aid,$uid) {
$img = photo_factory($photo, $type);
if($img->is_valid()) {
$img->scaleImageSquare(175);
$img->scaleImageSquare(300);
$p = array('aid' => $aid, 'uid' => $uid, 'resource_id' => $hash, 'filename' => $filename, 'album' => t('Profile Photos'), 'photo_usage' => PHOTO_PROFILE, 'scale' => 4);

View file

@ -22,7 +22,7 @@ function photo_upload($channel, $observer, $args) {
$channel_id = $channel['channel_id'];
$account_id = $channel['channel_account_id'];
if(! perm_is_allowed($channel_id, $observer['xchan_hash'], 'post_photos')) {
if(! perm_is_allowed($channel_id, $observer['xchan_hash'], 'write_storage')) {
$ret['message'] = t('Permission denied.');
return $ret;
}
@ -313,7 +313,7 @@ function photo_upload($channel, $observer, $args) {
*
* @param array $channel
* @param array $observer
* @return bool|array false if no view_photos permission or an array
* @return bool|array false if no view_storage permission or an array
* * success (bool)
* * albums (array)
*/
@ -322,7 +322,7 @@ function photos_albums_list($channel, $observer) {
$channel_id = $channel['channel_id'];
$observer_xchan = (($observer) ? $observer['xchan_hash'] : '');
if(! perm_is_allowed($channel_id, $observer_xchan, 'view_photos'))
if(! perm_is_allowed($channel_id, $observer_xchan, 'view_storage'))
return false;
/** @FIXME create a permissions SQL which works on arbitrary observers and channels, regardless of login or web status */
@ -378,7 +378,7 @@ function photos_album_widget($channelx,$observer,$albums = null) {
'$title' => t('Photo Albums'),
'$albums' => $albums['albums'],
'$baseurl' => z_root(),
'$upload' => ((perm_is_allowed($channelx['channel_id'],(($observer) ? $observer['xchan_hash'] : ''),'post_photos'))
'$upload' => ((perm_is_allowed($channelx['channel_id'],(($observer) ? $observer['xchan_hash'] : ''),'write_storage'))
? t('Upload New Photos') : '')
));
}
@ -399,7 +399,7 @@ function photos_list_photos($channel, $observer, $album = '') {
$channel_id = $channel['channel_id'];
$observer_xchan = (($observer) ? $observer['xchan_hash'] : '');
if(! perm_is_allowed($channel_id,$observer_xchan,'view_photos'))
if(! perm_is_allowed($channel_id,$observer_xchan,'view_storage'))
return false;
$sql_extra = permissions_sql($channel_id);

View file

@ -418,6 +418,9 @@ function stream_perms_api_uids($perms = NULL, $limit = 0, $rand = 0 ) {
$str .= intval($rr);
}
}
else
$str = "''";
logger('stream_perms_api_uids: ' . $str, LOGGER_DEBUG);
return $str;
@ -448,6 +451,9 @@ function stream_perms_xchans($perms = NULL ) {
$str .= "'" . dbesc($rr) . "'";
}
}
else
$str = "''";
logger('stream_perms_xchans: ' . $str, LOGGER_DEBUG);
return $str;

View file

@ -101,7 +101,7 @@ function format_term_for_display($term) {
// Tag cloud functions - need to be adpated to this database format
function tagadelic($uid, $count = 0, $authors = '', $flags = 0, $restrict = 0, $type = TERM_HASHTAG) {
function tagadelic($uid, $count = 0, $authors = '', $owner = '', $flags = 0, $restrict = 0, $type = TERM_HASHTAG) {
require_once('include/security.php');
@ -124,6 +124,11 @@ function tagadelic($uid, $count = 0, $authors = '', $flags = 0, $restrict = 0, $
$sql_options .= " and author_xchan in (" . implode(',',$authors) . ") ";
}
if($owner) {
$sql_options .= " and owner_xchan = '" . dbesc($owner) . "' ";
}
// Fetch tags
$r = q("select term, count(term) as total from term left join item on term.oid = item.id
where term.uid = %d and term.type = %d
@ -215,10 +220,10 @@ function dir_tagadelic($count = 0) {
}
function tagblock($link,$uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$type = TERM_HASHTAG) {
function tagblock($link,$uid,$count = 0,$authors = '',$owner = '', $flags = 0,$restrict = 0,$type = TERM_HASHTAG) {
$o = '';
$r = tagadelic($uid,$count,$authors,$flags,$restrict,$type);
$r = tagadelic($uid,$count,$authors,$owner, $flags,$restrict,$type);
if($r) {
$o = '<div class="tagblock widget"><h3>' . t('Tags') . '</h3><div class="tags" align="center">';
@ -232,10 +237,10 @@ function tagblock($link,$uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$
}
function wtagblock($uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$type = TERM_HASHTAG) {
function wtagblock($uid,$count = 0,$authors = '',$owner = '', $flags = 0,$restrict = 0,$type = TERM_HASHTAG) {
$o = '';
$r = tagadelic($uid,$count,$authors,$flags,$restrict,$type);
$r = tagadelic($uid,$count,$authors,$owner, $flags,$restrict,$type);
if($r) {
$c = q("select channel_address from channel where channel_id = %d limit 1",
@ -253,10 +258,10 @@ function wtagblock($uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$type
}
function catblock($uid,$count = 0,$authors = '',$flags = 0,$restrict = 0,$type = TERM_CATEGORY) {
function catblock($uid,$count = 0,$authors = '',$owner = '', $flags = 0,$restrict = 0,$type = TERM_CATEGORY) {
$o = '';
$r = tagadelic($uid,$count,$authors,$flags,$restrict,$type);
$r = tagadelic($uid,$count,$authors,$owner,$flags,$restrict,$type);
if($r) {
$c = q("select channel_address from channel where channel_id = %d limit 1",
@ -278,7 +283,7 @@ function dir_tagblock($link,$r) {
$o = '';
$observer = get_observer_hash();
if(! get_globaldir_setting($observer))
if(! get_directory_setting($observer, 'globaldir'))
return $o;
@ -409,4 +414,4 @@ function get_things($profile_hash,$uid) {
//logger('things: ' . print_r($sorted_things,true));
return $sorted_things;
}
}

View file

@ -807,7 +807,7 @@ function contact_block() {
$shown = get_pconfig($a->profile['uid'],'system','display_friend_count');
if($shown === false)
$shown = 24;
$shown = 25;
if($shown == 0)
return;
@ -1448,7 +1448,7 @@ function prepare_body(&$item,$attach = false) {
// else {
call_hooks('prepare_body_init', $item);
// unobscure($item);
$s = prepare_text($item['body'],$item['mimetype'], true);
$s = prepare_text($item['body'],$item['mimetype'], false);
// }
$prep_arr = array('item' => $item, 'html' => $s);

View file

@ -29,7 +29,7 @@ function widget_tagcloud($args) {
$type = TERM_CATEGORY;
// FIXME there exists no $authors variable
$r = tagadelic($uid, $count, $authors, $flags, ITEM_TYPE_WEBPAGE, $type);
$r = tagadelic($uid, $count, $authors, $owner, $flags, ITEM_TYPE_WEBPAGE, $type);
if($r) {
$o = '<div class="tagblock widget"><h3>' . t('Categories') . '</h3><div class="tags" align="center">';
@ -132,7 +132,7 @@ function widget_suggestions($arr) {
'profile' => $rr['xchan_url'],
'name' => $rr['xchan_name'],
'photo' => $rr['xchan_photo_m'],
'ignlnk' => z_root() . '/suggest?ignore=' . $rr['xchan_hash'],
'ignlnk' => z_root() . '/directory?ignore=' . $rr['xchan_hash'],
'conntxt' => t('Connect'),
'connlnk' => $connlnk,
'ignore' => t('Ignore/Hide')
@ -380,6 +380,7 @@ function widget_categories($arr) {
$srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl);
return categories_widget($srchurl, $cat);
}
function widget_tagcloud_wall($arr) {
@ -392,7 +393,7 @@ function widget_tagcloud_wall($arr) {
$limit = ((array_key_exists('limit', $arr)) ? intval($arr['limit']) : 50);
if(feature_enabled($a->profile['profile_uid'], 'tagadelic'))
return wtagblock($a->profile['profile_uid'], $limit, $a->profile['channel_hash'], 'wall');
return wtagblock($a->profile['profile_uid'], $limit, '', $a->profile['channel_hash'], 'wall');
return '';
}
@ -407,7 +408,7 @@ function widget_catcloud_wall($arr) {
$limit = ((array_key_exists('limit',$arr)) ? intval($arr['limit']) : 50);
return catblock($a->profile['profile_uid'], $limit, $a->profile['channel_hash'], 'wall');
return catblock($a->profile['profile_uid'], $limit, '', $a->profile['channel_hash'], 'wall');
}
@ -604,7 +605,7 @@ function widget_photo_albums($arr) {
if(! $a->profile['profile_uid'])
return '';
$channelx = channelx_by_n($a->profile['profile_uid']);
if((! $channelx) || (! perm_is_allowed($a->profile['profile_uid'], get_observer_hash(), 'view_photos')))
if((! $channelx) || (! perm_is_allowed($a->profile['profile_uid'], get_observer_hash(), 'view_storage')))
return '';
require_once('include/photos.php');
@ -903,7 +904,7 @@ function widget_random_block($arr) {
item_type = %d $sql_options order by $randfunc limit 1",
intval($channel_id),
dbesc('%' . $contains . '%'),
intval(ITEM_TYPE_BUILDBLOCK)
intval(ITEM_TYPE_BLOCK)
);
if($r) {

View file

@ -566,7 +566,7 @@ function zot_gethub($arr) {
}
/**
* @brief Registers an unknown hup.
* @brief Registers an unknown hub.
*
* A communication has been received which has an unknown (to us) sender.
* Perform discovery based on our calculated hash of the sender at the
@ -1088,11 +1088,19 @@ function zot_import($arr, $sender_url) {
logger('specific recipients');
$recip_arr = array();
foreach($i['notify']['recipients'] as $recip) {
$recip_arr[] = make_xchan_hash($recip['guid'],$recip['guid_sig']);
if(is_array($recip)) {
$recip_arr[] = make_xchan_hash($recip['guid'],$recip['guid_sig']);
}
}
stringify_array_elms($recip_arr);
$recips = implode(',',$recip_arr);
$r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " ) and channel_removed = 0 ");
$r = false;
if($recip_arr) {
stringify_array_elms($recip_arr);
$recips = implode(',',$recip_arr);
$r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " )
and channel_removed = 0 ");
}
if(! $r) {
logger('recips: no recipients on this site');
continue;
@ -1248,7 +1256,8 @@ function public_recips($msg) {
$include_sys = false;
if($msg['message']['type'] === 'activity') {
$include_sys = true;
if(! get_config('system','disable_discover_tab'))
$include_sys = true;
$col = 'channel_w_stream';
$field = PERMS_W_STREAM;
if(array_key_exists('flags',$msg['message']) && in_array('thread_parent', $msg['message']['flags'])) {
@ -2852,6 +2861,11 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
}
if(array_key_exists('channel',$arr) && is_array($arr['channel']) && count($arr['channel'])) {
if(array_key_exists('channel_page_flags',$arr['channel']) && intval($arr['channel']['channel_pageflags'])) {
$arr['channel']['channel_removed'] = (($arr['channel']['channel_pageflags'] & 0x8000) ? 1 : 0);
$arr['channel']['channel_system'] = (($arr['channel']['channel_pageflags'] & 0x1000) ? 1 : 0);
}
$disallowed = array('channel_id','channel_account_id','channel_primary','channel_prvkey', 'channel_address', 'channel_notifyflags');
$clean = array();
@ -2883,28 +2897,20 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
$total_feeds ++;
}
$disallowed = array('abook_id','abook_account','abook_channel');
$disallowed = array('abook_id','abook_account','abook_channel','abook_rating','abook_rating_text');
foreach($arr['abook'] as $abook) {
if(! array_key_exists('abook_blocked',$abook)) {
// convert from redmatrix
if($abook['abook_flags'] & 0x0001)
$abook['abook_blocked'] = 1;
if($abook['abook_flags'] & 0x0002)
$abook['abook_ignored'] = 1;
if($abook['abook_flags'] & 0x0004)
$abook['abook_hidden'] = 1;
if($abook['abook_flags'] & 0x0008)
$abook['abook_archived'] = 1;
if($abook['abook_flags'] & 0x0010)
$abook['abook_pending'] = 1;
if($abook['abook_flags'] & 0x0020)
$abook['abook_unconnected'] = 1;
if($abook['abook_flags'] & 0x0080)
$abook['abook_self'] = 1;
if($abook['abook_flags'] & 0x0100)
$abook['abook_feed'] = 1;
$abook['abook_blocked'] = (($abook['abook_flags'] & 0x0001) ? 1 : 0);
$abook['abook_ignored'] = (($abook['abook_flags'] & 0x0002) ? 1 : 0);
$abook['abook_hidden'] = (($abook['abook_flags'] & 0x0004) ? 1 : 0);
$abook['abook_archived'] = (($abook['abook_flags'] & 0x0008) ? 1 : 0);
$abook['abook_pending'] = (($abook['abook_flags'] & 0x0010) ? 1 : 0);
$abook['abook_unconnected'] = (($abook['abook_flags'] & 0x0020) ? 1 : 0);
$abook['abook_self'] = (($abook['abook_flags'] & 0x0080) ? 1 : 0);
$abook['abook_feed'] = (($abook['abook_flags'] & 0x0100) ? 1 : 0);
}
$clean = array();
@ -3165,7 +3171,7 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
}
if(count($clean)) {
foreach($clean as $k => $v) {
$r = dbq("UPDATE profile set " . dbesc($k) . " = '" . dbesc($v)
$r = dbq("UPDATE profile set `" . dbesc($k) . "` = '" . dbesc($v)
. "' where profile_guid = '" . dbesc($profile['profile_guid']) . "' and uid = " . intval($channel['channel_id']));
}
}

View file

@ -195,6 +195,17 @@ if(strlen($a->module)) {
}
}
/**
* This provides a place for plugins to register module handlers which don't otherwise exist on the system.
* If the plugin sets 'installed' to true we won't throw a 404 error for the specified module even if
* there is no specific module file or matching plugin name.
* The plugin should catch at least one of the module hooks for this URL.
*/
$x = array('module' => $a->module, 'installed' => false);
call_hooks('module_loaded', $x);
if($x['installed'])
$a->module_loaded = true;
/**
* The URL provided does not resolve to a valid module.

View file

@ -53,7 +53,7 @@ function block_content(&$a) {
item_type = %d $sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
intval(ITEM_TYPE_BUILDBLOCK)
intval(ITEM_TYPE_BLOCK)
);
if(! $r) {
@ -65,7 +65,7 @@ function block_content(&$a) {
item_type = %d $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
intval(ITEM_TYPE_BUILDBLOCK)
intval(ITEM_TYPE_BLOCK)
);
if($x) {
// Yes, it's there. You just aren't allowed to see it.

View file

@ -84,7 +84,7 @@ function blocks_content(&$a) {
}
$x = array(
'webpage' => ITEM_TYPE_BUILDBLOCK,
'webpage' => ITEM_TYPE_BLOCK,
'is_owner' => true,
'nickname' => $a->profile['channel_address'],
'lockstate' => (($channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
@ -110,7 +110,7 @@ function blocks_content(&$a) {
$r = q("select iid, sid, mid, title, body, mimetype, created, edited from item_id left join item on item_id.iid = item.id
where item_id.uid = %d and service = 'BUILDBLOCK' and item_type = %d order by item.created desc",
intval($owner),
intval(ITEM_TYPE_BUILDBLOCK)
intval(ITEM_TYPE_BLOCK)
);
$pages = null;

View file

@ -175,7 +175,7 @@ function channel_content(&$a, $update = 0, $load = false) {
left join abook on ( item.owner_xchan = abook.abook_xchan $abook_uids )
WHERE uid = %d $item_normal
AND item_wall = 1 AND item_unseen = 1
AND (abook.blocked = 0 or abook.abook_flags is null)
AND (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra
ORDER BY created DESC",
intval($a->profile['profile_uid'])

View file

@ -130,7 +130,6 @@ function connedit_post(&$a) {
}
}
$abook_flags = $orig_record[0]['abook_flags'];
$new_friend = false;
if(! $is_self) {
@ -144,7 +143,6 @@ function connedit_post(&$a) {
dbesc($orig_record[0]['abook_xchan'])
);
if($z) {
$record = $z[0]['xlink_id'];
$w = q("update xlink set xlink_rating = '%d', xlink_rating_text = '%s', xlink_sig = '%s', xlink_updated = '%s'
@ -192,6 +190,7 @@ function connedit_post(&$a) {
}
}
$abook_pending = $new_friend ? 0 : $orig_record[0]['abook_pending'];
$r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_pending = %d,
abook_incl = '%s', abook_excl = '%s'
@ -199,7 +198,7 @@ function connedit_post(&$a) {
dbesc($profile_id),
intval($abook_my_perms),
intval($closeness),
intval(1 - intval($new_friend)),
intval($abook_pending),
dbesc($abook_incl),
dbesc($abook_excl),
intval($contact_id),
@ -398,9 +397,6 @@ function connedit_content(&$a) {
if($cmd === 'block') {
if(abook_toggle_flag($orig_record[0],ABOOK_FLAG_BLOCKED)) {
info((intval($orig_record[0]['abook_blocked'])
? t('Channel has been unblocked')
: t('Channel has been blocked')) . EOL );
connedit_clone($a);
}
else
@ -410,9 +406,6 @@ function connedit_content(&$a) {
if($cmd === 'ignore') {
if(abook_toggle_flag($orig_record[0],ABOOK_FLAG_IGNORED)) {
info((intval($orig_record[0]['abook_ignored'])
? t('Channel has been unignored')
: t('Channel has been ignored')) . EOL );
connedit_clone($a);
}
else
@ -422,9 +415,6 @@ function connedit_content(&$a) {
if($cmd === 'archive') {
if(abook_toggle_flag($orig_record[0],ABOOK_FLAG_ARCHIVED)) {
info((intval($orig_record[0]['abook_archived'])
? t('Channel has been unarchived')
: t('Channel has been archived')) . EOL );
connedit_clone($a);
}
else
@ -434,9 +424,6 @@ function connedit_content(&$a) {
if($cmd === 'hide') {
if(abook_toggle_flag($orig_record[0],ABOOK_FLAG_HIDDEN)) {
info((intval($orig_record[0]['abook_hidden'])
? t('Channel has been unhidden')
: t('Channel has been hidden')) . EOL );
connedit_clone($a);
}
else
@ -450,9 +437,6 @@ function connedit_content(&$a) {
if($cmd === 'approve') {
if(intval($orig_record[0]['abook_pending'])) {
if(abook_toggle_flag($orig_record[0],ABOOK_FLAG_PENDING)) {
info((intval($orig_record[0]['abook_pending'])
? t('Channel has been approved')
: t('Channel has been unapproved')) . EOL );
connedit_clone($a);
}
else
@ -493,59 +477,62 @@ function connedit_content(&$a) {
$contact_id = $a->poi['abook_id'];
$contact = $a->poi;
$buttons = array(
$tabs = array(
array(
'view' => array(
'label' => t('View Profile'),
'url' => chanlink_cid($contact['abook_id']),
'sel' => '',
'title' => sprintf( t('View %s\'s profile'), $contact['xchan_name']),
),
array(
'refresh' => array(
'label' => t('Refresh Permissions'),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/refresh',
'sel' => '',
'title' => t('Fetch updated permissions'),
),
array(
'recent' => array(
'label' => t('Recent Activity'),
'url' => $a->get_baseurl(true) . '/network/?f=&cid=' . $contact['abook_id'],
'sel' => '',
'title' => t('View recent posts and comments'),
)
);
),
$buttons = array(
array(
'block' => array(
'label' => (intval($contact['abook_blocked']) ? t('Unblock') : t('Block')),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/block',
'sel' => (intval($contact['abook_blocked']) ? 'active' : ''),
'title' => t('Block (or Unblock) all communications with this connection'),
'info' => (intval($contact['abook_blocked']) ? t('This connection is blocked!') : ''),
),
array(
'ignore' => array(
'label' => (intval($contact['abook_ignored']) ? t('Unignore') : t('Ignore')),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/ignore',
'sel' => (intval($contact['abook_ignored']) ? 'active' : ''),
'title' => t('Ignore (or Unignore) all inbound communications from this connection'),
'info' => (intval($contact['abook_ignored']) ? t('This connection is ignored!') : ''),
),
array(
'archive' => array(
'label' => (intval($contact['abook_archived']) ? t('Unarchive') : t('Archive')),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/archive',
'sel' => (intval($contact['abook_archived']) ? 'active' : ''),
'title' => t('Archive (or Unarchive) this connection - mark channel dead but keep content'),
'info' => (intval($contact['abook_archived']) ? t('This connection is archived!') : ''),
),
array(
'hide' => array(
'label' => (intval($contact['abook_hidden']) ? t('Unhide') : t('Hide')),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/hide',
'sel' => (intval($contact['abook_hidden']) ? 'active' : ''),
'title' => t('Hide or Unhide this connection from your other connections'),
'info' => (intval($contact['abook_hidden']) ? t('This connection is hidden!') : ''),
),
array(
'delete' => array(
'label' => t('Delete'),
'url' => $a->get_baseurl(true) . '/connedit/' . $contact['abook_id'] . '/drop',
'sel' => '',
@ -556,18 +543,9 @@ function connedit_content(&$a) {
$self = false;
if(! intval($contact['abook_self'])) {
$tab_tpl = get_markup_template('common_tabs.tpl');
$t = replace_macros($tab_tpl, array('$tabs'=>$tabs));
}
else
if(intval($contact['abook_self']))
$self = true;
$a->page['htmlhead'] .= replace_macros(get_markup_template('contact_head.tpl'), array(
'$baseurl' => $a->get_baseurl(true),
'$editselect' => $editselect
));
require_once('include/contact_selectors.php');
$tpl = get_markup_template("abook_edit.tpl");
@ -616,7 +594,6 @@ function connedit_content(&$a) {
$rating_text = $xl[0]['xlink_rating_text'];
}
$poco_rating = get_config('system','poco_rating_enable');
// if unset default to enabled
@ -640,101 +617,78 @@ function connedit_content(&$a) {
$global_perms = get_perms();
$existing = get_all_perms(local_channel(),$contact['abook_xchan']);
$unapproved = array('pending', t('Approve this connection'), '', t('Accept connection to allow communication'));
$unapproved = array('pending', t('Approve this connection'), '', t('Accept connection to allow communication'), array(t('No'),('Yes')));
$multiprofs = ((feature_enabled(local_channel(),'multi_profiles')) ? true : false);
if($slide && !$multiprofs)
$affinity = t('Set Affinity');
if(!$slide && $multiprofs)
$affinity = t('Set Profile');
if($slide && $multiprofs)
$affinity = t('Set Affinity & Profile');
foreach($global_perms as $k => $v) {
$thisperm = (($contact['abook_my_perms'] & $v[1]) ? "1" : '');
$checkinherited = ((($channel[$v[0]]) && ($channel[$v[0]] != PERMS_SPECIFIC)) ? "1" : '');
// For auto permissions (when $self is true) we don't want to look at existing
// permissions because they are enabled for the channel owner
if((! $self) && ($existing[$k]))
$thisperm = "1";
$perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),$thisperm, $v[1], (($channel[$v[0]] == PERMS_SPECIFIC || $self) ? '' : '1'), $v[4]);
$perms[] = array('perms_' . $k, $v[3], (($contact['abook_their_perms'] & $v[1]) ? "1" : ""),$thisperm, $v[1], (($channel[$v[0]] == PERMS_SPECIFIC) ? '' : '1'), $v[4], $checkinherited);
}
$o .= replace_macros($tpl,array(
'$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connections: settings for %s'),$contact['xchan_name'])),
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), ''),
'$header' => (($self) ? t('Connection Default Permissions') : sprintf( t('Connection: %s'),$contact['xchan_name'])),
'$autoperms' => array('autoperms',t('Apply these permissions automatically'), ((get_pconfig(local_channel(),'system','autoperms')) ? 1 : 0), 'Connection requests will be approved without your interaction', array(t('No'),('Yes'))),
'$addr' => $contact['xchan_addr'],
'$addr_text' => t('This connection\'s address is'),
'$notself' => (($self) ? '' : '1'),
'$self' => (($self) ? '1' : ''),
'$autolbl' => t('Apply the permissions indicated on this page to all new connections.'),
'$autolbl' => t('The permissions indicated on this page will be applied to all new connections.'),
'$buttons' => (($self) ? '' : $buttons),
'$viewprof' => t('View Profile'),
'$clickme' => t('Click to open/close'),
'$lbl_slider' => t('Slide to adjust your degree of friendship'),
'$lbl_rating' => t('Rating (this information is public)'),
'$lbl_rating_txt' => t('Optionally explain your rating (this information is public)'),
'$lbl_rating' => t('Rating'),
'$lbl_rating_label' => t('Slide to adjust your rating'),
'$lbl_rating_txt' => t('Optionally explain your rating'),
'$connfilter' => feature_enabled(local_channel(),'connfilter'),
'$connfilter_label' => t('Custom Filter'),
'$incl' => array('abook_incl',t('Only import posts with this text'), $contact['abook_incl'],t('words one per line or #tags or /patterns/, leave blank to import all posts')),
'$excl' => array('abook_excl',t('Do not import posts with this text'), $contact['abook_excl'],t('words one per line or #tags or /patterns/, leave blank to import all posts')),
'$rating_text' => array('rating_text', t('Optionally explain your rating (this information is public)'),$rating_text,''),
'$rating_text' => array('rating_text', t('Optionally explain your rating'),$rating_text,''),
'$rating_info' => t('This information is public!'),
'$rating' => $rating,
'$rating_val' => $rating_val,
'$slide' => $slide,
'$tabs' => $t,
'$tab_str' => $tab_str,
'$perms_step1' => t('Default permissions for your channel type have (just) been applied. They have not yet been submitted. Please review the permissions on this page and make any desired changes at this time. This new connection may <em>not</em> be able to communicate with you until you submit this page, which will install and apply the selected permissions.'),
'$affinity' => $affinity,
'$pending_label' => t('Connection Pending Approval'),
'$pending_modal_title' => t('Connection Request'),
'$pending_modal_body' => sprintf(t('(%s) would like to connect with you. Please approve this connection to allow communication.'), $contact['xchan_addr']),
'$pending_modal_approve' => t('Approve'),
'$pending_modal_dismiss' => t('Approve Later'),
'$is_pending' => (intval($contact['abook_pending']) ? 1 : ''),
'$unapproved' => $unapproved,
'$inherited' => t('inherited'),
'$approve' => t('Approve this connection'),
'$noperms' => (($contact['abook_my_perms']) ? false : true),
'$no_perms' => (((! $self) && (! $contact['abook_my_perms'])) ? t('Connection has no individual permissions!') : ''),
'$noperm_desc' => (((! $self) && (! $contact['abook_my_perms'])) ? t('This may be appropriate based on your <a href="settings">privacy settings</a>, though you may wish to review the "Advanced Permissions".') : ''),
'$submit' => t('Submit'),
'$lbl_vis1' => t('Profile Visibility'),
'$lbl_vis2' => sprintf( t('Please choose the profile you would like to display to %s when viewing your profile securely.'), $contact['xchan_name']),
'$lbl_info1' => t('Contact Information / Notes'),
'$infedit' => t('Edit contact notes'),
'$close' => $contact['abook_closeness'],
'$them' => t('Their Settings'),
'$me' => t('My Settings'),
'$perms' => $perms,
'$perms_new' => t('Default permissions for this channel type have (just) been applied. They have <em>not</em> been saved and there are currently no stored default permissions. Please review/edit the applied settings and click [Submit] to finalize.'),
'$clear' => t('Clear/Disable Automatic Permissions'),
'$forum' => t('Forum Members'),
'$soapbox' => t('Soapbox'),
'$full' => t('Full Sharing (typical social network permissions)'),
'$cautious' => t('Cautious Sharing '),
'$follow' => t('Follow Only'),
'$permlbl' => t('Individual Permissions'),
'$permnote' => t('Some permissions may be inherited from your channel <a href="settings">privacy settings</a>, which have higher priority than individual settings. Changing those inherited settings on this page will have no effect.'),
'$advanced' => t('Advanced Permissions'),
'$quick' => t('Simple Permissions (select one and submit)'),
'$common_link' => $a->get_baseurl(true) . '/common/loc/' . local_channel() . '/' . $contact['id'],
'$all_friends' => $all_friends,
'$relation_text' => $relation_text,
'$visit' => sprintf( t('Visit %s\'s profile - %s'),$contact['xchan_name'],$contact['xchan_url']),
'$blockunblock' => t('Block/Unblock contact'),
'$ignorecont' => t('Ignore contact'),
'$lblcrepair' => t("Repair URL settings"),
'$lblrecent' => t('View conversations'),
'$lblsuggest' => $lblsuggest,
'$delete' => t('Delete contact'),
'$poll_interval' => contact_poll_interval($contact['priority'],(! $poll_enabled)),
'$poll_enabled' => $poll_enabled,
'$permnote' => t('Some permissions may be inherited from your channel\'s <a href="settings"><strong>privacy settings</strong></a>, which have higher priority than individual settings. You can <strong>not</strong> change those settings here.'),
'$permnote_self' => t('Some permissions may be inherited from your channel\'s <a href="settings"><strong>privacy settings</strong></a>, which have higher priority than individual settings. You can change those settings here but they wont have any impact unless the inherited setting changes.'),
'$lastupdtext' => t('Last update:'),
'$lost_contact' => $lost_contact,
'$updpub' => t('Update public posts'),
'$last_update' => relative_date($contact['abook_connected']),
'$udnow' => t('Update now'),
'$profile_select' => contact_profile_assign($contact['abook_profile']),
'$multiprofs' => feature_enabled(local_channel(),'multi_profiles'),
'$multiprofs' => $multiprofs,
'$contact_id' => $contact['abook_id'],
'$block_text' => (($contact['blocked']) ? t('Unblock') : t('Block') ),
'$ignore_text' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
'$blocked' => (($contact['blocked']) ? t('Currently blocked') : ''),
'$ignored' => (($contact['readonly']) ? t('Currently ignored') : ''),
'$archived' => (($contact['archive']) ? t('Currently archived') : ''),
'$pending' => (($contact['archive']) ? t('Currently pending') : ''),
'$name' => $contact['name'],
'$alt_text' => $alt_text,
'$url' => $url
'$name' => $contact['xchan_name'],
));

View file

@ -19,6 +19,7 @@ function directory_init(&$a) {
$observer = get_observer_hash();
$global_changed = false;
$safe_changed = false;
$pubforums_changed = false;
if(array_key_exists('global',$_REQUEST)) {
$globaldir = intval($_REQUEST['global']);
@ -28,7 +29,7 @@ function directory_init(&$a) {
$_SESSION['globaldir'] = $globaldir;
if($observer)
set_xconfig($observer,'directory','globaldir',$globaldir);
}
}
if(array_key_exists('safe',$_REQUEST)) {
$safemode = intval($_REQUEST['safe']);
@ -37,9 +38,19 @@ function directory_init(&$a) {
if($safe_changed) {
$_SESSION['safemode'] = $safemode;
if($observer)
set_xconfig($observer,'directory','safe_mode',$safemode);
}
set_xconfig($observer,'directory','safemode',$safemode);
}
if(array_key_exists('pubforums',$_REQUEST)) {
$pubforums = intval($_REQUEST['pubforums']);
$pubforums_changed = true;
}
if($pubforums_changed) {
$_SESSION['pubforums'] = $pubforums;
if($observer)
set_xconfig($observer,'directory','pubforums',$pubforums);
}
}
function directory_content(&$a) {
@ -51,18 +62,14 @@ function directory_content(&$a) {
$observer = get_observer_hash();
$globaldir = get_globaldir_setting($observer);
$globaldir = get_directory_setting($observer, 'globaldir');
// override your personal global search pref if we're doing a navbar search of the directory
if(intval($_REQUEST['navsearch']))
$globaldir = 1;
$safe_mode = get_safemode_setting($observer);
$safe_mode = get_directory_setting($observer, 'safemode');
$pubforums = null;
if(array_key_exists('pubforums',$_REQUEST))
$pubforums = intval($_REQUEST['pubforums']);
if(! $pubforums)
$pubforums = null;
$pubforums = get_directory_setting($observer, 'pubforums');
$o = '';
nav_set_selected('directory');
@ -375,7 +382,13 @@ function directory_content(&$a) {
'$entries' => $entries,
'$dirlbl' => $suggest ? t('Channel Suggestions') : $dirtitle,
'$submit' => t('Find'),
'$next' => alt_pager($a,$j['records'], t('next page'), t('previous page'))
'$next' => alt_pager($a,$j['records'], t('next page'), t('previous page')),
'$sort' => t('Sort options'),
'$normal' => t('Alphabetic'),
'$reverse' => t('Reverse Alphabetic'),
'$date' => t('Newest to Oldest'),
'$reversedate' => t('Oldest to Newest'),
'$suggest' => $suggest ? '&suggest=1' : ''
));

View file

@ -52,6 +52,7 @@ function display_content(&$a, $update = 0, $load = false) {
'deny_gid' => $channel['channel_deny_gid']
);
$x = array(
'is_owner' => true,
'allow_location' => ((intval(get_pconfig($channel['channel_id'],'system','use_browser_location'))) ? '1' : ''),
@ -63,10 +64,13 @@ function display_content(&$a, $update = 0, $load = false) {
'bang' => '',
'visitor' => true,
'profile_uid' => local_channel(),
'return_path' => 'channel/' . $channel['channel_address']
'return_path' => 'channel/' . $channel['channel_address'],
'expanded' => true
);
$o = '<div id="jot-popup">';
$o .= status_editor($a,$x);
$o .= '</div>';
}

View file

@ -108,12 +108,6 @@ function editblock_content(&$a) {
else
$mimeselect = mimetype_select($itm[0]['uid'],$mimetype);
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit Block'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id']
));
$a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array(
'$baseurl' => $a->get_baseurl(),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
@ -133,17 +127,17 @@ function editblock_content(&$a) {
$rp = 'blocks/' . $channel['channel_address'];
$o .= replace_macros($tpl,array(
$editor = replace_macros($tpl,array(
'$return_path' => $rp,
'$action' => 'item',
'$webpage' => ITEM_TYPE_BUILDBLOCK,
'$webpage' => ITEM_TYPE_BLOCK,
'$share' => t('Edit'),
'$bold' => t('Bold'),
'$italic' => t('Italic'),
'$underline' => t('Underline'),
'$quote' => t('Quote'),
'$code' => t('Code'),
'$writefiles' => (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage')),
'$writefiles' => perm_is_allowed($owner, get_observer_hash(), 'write_storage'),
'$upload' => t('Upload photo'),
'$attach' => t('Attach file'),
'$weblink' => t('Insert web link'),
@ -181,6 +175,13 @@ function editblock_content(&$a) {
'$expires' => t('Set expiration date'),
));
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit Block'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
'$editor' => $editor
));
return $o;
}

View file

@ -101,12 +101,6 @@ function editlayout_content(&$a) {
$layout_title = $item_id[0]['sid'];
$plaintext = true;
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit Layout'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id']
));
$a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array(
'$baseurl' => $a->get_baseurl(),
@ -132,7 +126,7 @@ function editlayout_content(&$a) {
$rp = 'layouts/' . $which;
$o .= replace_macros($tpl,array(
$editor = replace_macros($tpl,array(
'$return_path' => $rp,
'$action' => 'item',
'$webpage' => ITEM_TYPE_PDL,
@ -178,6 +172,14 @@ function editlayout_content(&$a) {
'$expires' => t('Set expiration date'),
));
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit Layout'),
'$delete' => ((($itm[0]['author_xchan'] === $ob_hash) || ($itm[0]['owner_xchan'] === $ob_hash)) ? t('Delete') : false),
'$id' => $itm[0]['id'],
'$editor' => $editor
));
return $o;
}

View file

@ -38,11 +38,6 @@ function editpost_content(&$a) {
$channel = $a->get_channel();
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit post')
));
$a->page['htmlhead'] .= replace_macros(get_markup_template('jot-header.tpl'), array(
'$baseurl' => $a->get_baseurl(),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
@ -53,8 +48,6 @@ function editpost_content(&$a) {
'$confirmdelete' => t('Delete item?'),
));
if(intval($itm[0]['item_obscured'])) {
$key = get_config('system','prvkey');
if($itm[0]['title'])
@ -107,7 +100,7 @@ function editpost_content(&$a) {
$cipher = 'aes256';
$o .= replace_macros($tpl,array(
$editor = replace_macros($tpl,array(
'$return_path' => $_SESSION['return_url'],
'$action' => 'item',
'$share' => t('Edit'),
@ -161,6 +154,11 @@ function editpost_content(&$a) {
'$expiryModalCANCEL' => t('Cancel'),
));
$o .= replace_macros(get_markup_template('edpost_head.tpl'), array(
'$title' => t('Edit post'),
'$editor' => $editor
));
return $o;
}

View file

@ -165,15 +165,12 @@ function editwebpage_content(&$a) {
$rp = 'webpages/' . $which;
logger('canwrite: ' . (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage')));
$editor = replace_macros($tpl,array(
'$return_path' => $rp,
'$webpage' => ITEM_TYPE_WEBPAGE,
'$placeholdpagetitle' => t('Page link title'),
'$pagetitle' => $page_title,
'$writefiles' => (perm_is_allowed($owner, get_observer_hash(), 'post_photos') || perm_is_allowed($owner, get_observer_hash(), 'write_storage')),
'$writefiles' => perm_is_allowed($owner, get_observer_hash(), 'write_storage'),
'$action' => 'item',
'$share' => t('Edit'),
'$bold' => t('Bold'),

View file

@ -13,6 +13,20 @@ function events_post(&$a) {
if(! local_channel())
return;
if(($_FILES) && array_key_exists('userfile',$_FILES) && intval($_FILES['userfile']['size'])) {
$src = $_FILES['userfile']['tmp_name'];
if($src) {
$result = parse_ical_file($src,local_channel());
if($result)
info( t('Calendar entries imported.') . EOL);
else
notice( t('No calendar entries found.') . EOL);
@unlink($src);
}
goaway(z_root() . '/events');
}
$event_id = ((x($_POST,'event_id')) ? intval($_POST['event_id']) : 0);
$event_hash = ((x($_POST,'event_hash')) ? $_POST['event_hash'] : '');
@ -148,10 +162,9 @@ function events_post(&$a) {
}
}
else {
// Note: do not set `private` field for self-only events. It will
// keep even you from seeing them!
$str_contact_allow = '<' . $channel['channel_hash'] . '>';
$str_group_allow = $str_contact_deny = $str_group_deny = '';
$private_event = true;
}
}
@ -451,6 +464,7 @@ function events_content(&$a) {
if($export) {
header('Content-type: text/calendar');
header('content-disposition: attachment; filename="' . t('calendar') . '-' . $channel['channel_address'] . '.ics"' );
echo ical_wrapper($r);
killme();
}
@ -477,8 +491,8 @@ function events_content(&$a) {
'$export' => array($a->get_baseurl()."/events/$y/$m/export",t('Export'),'',''),
'$calendar' => cal($y,$m,$links, ' eventcal'),
'$events' => $events,
'$upload' => t('Upload'),
'$submit' => t('Submit')
));
if (x($_GET,'id')){ echo $o; killme(); }

View file

@ -36,6 +36,9 @@ function import_post(&$a) {
$filesize = intval($_FILES['filename']['size']);
$filetype = $_FILES['filename']['type'];
$completed = ((array_key_exists('import_step',$_SESSION)) ? intval($_SESSION['import_step']) : 0);
if($completed)
logger('saved import step: ' . $_SESSION['import_step']);
if($src) {
@ -114,360 +117,430 @@ function import_post(&$a) {
// import channel
$channel = $data['channel'];
if(array_key_exists('channel',$data)) {
$channel = $data['channel'];
if(! array_key_exists('channel_system',$channel)) {
$channel['channel_system'] = (($channel['channel_pageflags'] & 0x1000) ? 1 : 0);
$channel['channel_removed'] = (($channel['channel_pageflags'] & 0x8000) ? 1 : 0);
}
if($completed < 1) {
$r = q("select * from channel where (channel_guid = '%s' or channel_hash = '%s' or channel_address = '%s' ) limit 1",
dbesc($channel['channel_guid']),
dbesc($channel['channel_hash']),
dbesc($channel['channel_address'])
);
if(! array_key_exists('channel_system',$channel)) {
$channel['channel_system'] = (($channel['channel_pageflags'] & 0x1000) ? 1 : 0);
$channel['channel_removed'] = (($channel['channel_pageflags'] & 0x8000) ? 1 : 0);
}
// We should probably also verify the hash
$r = q("select * from channel where (channel_guid = '%s' or channel_hash = '%s' or channel_address = '%s' ) limit 1",
dbesc($channel['channel_guid']),
dbesc($channel['channel_hash']),
dbesc($channel['channel_address'])
);
if($r) {
if($r[0]['channel_guid'] === $channel['channel_guid'] || $r[0]['channel_hash'] === $channel['channel_hash']) {
logger('mod_import: duplicate channel. ', print_r($channel,true));
notice( t('Cannot create a duplicate channel identifier on this system. Import failed.') . EOL);
return;
}
else {
// try at most ten times to generate a unique address.
$x = 0;
$found_unique = false;
do {
$tmp = $channel['channel_address'] . mt_rand(1000,9999);
$r = q("select * from channel where channel_address = '%s' limit 1",
dbesc($tmp)
);
if(! $r) {
$channel['channel_address'] = $tmp;
$found_unique = true;
break;
// We should probably also verify the hash
if($r) {
if($r[0]['channel_guid'] === $channel['channel_guid'] || $r[0]['channel_hash'] === $channel['channel_hash']) {
logger('mod_import: duplicate channel. ', print_r($channel,true));
notice( t('Cannot create a duplicate channel identifier on this system. Import failed.') . EOL);
return;
}
$x ++;
} while ($x < 10);
if(! $found_unique) {
logger('mod_import: duplicate channel. randomisation failed.', print_r($channel,true));
notice( t('Unable to create a unique channel address. Import failed.') . EOL);
else {
// try at most ten times to generate a unique address.
$x = 0;
$found_unique = false;
do {
$tmp = $channel['channel_address'] . mt_rand(1000,9999);
$r = q("select * from channel where channel_address = '%s' limit 1",
dbesc($tmp)
);
if(! $r) {
$channel['channel_address'] = $tmp;
$found_unique = true;
break;
}
$x ++;
} while ($x < 10);
if(! $found_unique) {
logger('mod_import: duplicate channel. randomisation failed.', print_r($channel,true));
notice( t('Unable to create a unique channel address. Import failed.') . EOL);
return;
}
}
}
unset($channel['channel_id']);
$channel['channel_account_id'] = get_account_id();
$channel['channel_primary'] = (($seize) ? 1 : 0);
dbesc_array($channel);
$r = dbq("INSERT INTO channel (`"
. implode("`, `", array_keys($channel))
. "`) VALUES ('"
. implode("', '", array_values($channel))
. "')" );
if(! $r) {
logger('mod_import: channel clone failed. ', print_r($channel,true));
notice( t('Channel clone failed. Import failed.') . EOL);
return;
}
}
}
unset($channel['channel_id']);
$channel['channel_account_id'] = get_account_id();
$channel['channel_primary'] = (($seize) ? 1 : 0);
dbesc_array($channel);
$r = dbq("INSERT INTO channel (`"
. implode("`, `", array_keys($channel))
. "`) VALUES ('"
. implode("', '", array_values($channel))
. "')" );
if(! $r) {
logger('mod_import: channel clone failed. ', print_r($channel,true));
notice( t('Channel clone failed. Import failed.') . EOL);
return;
}
$r = q("select * from channel where channel_account_id = %d and channel_guid = '%s' limit 1",
intval(get_account_id()),
$channel['channel_guid'] // Already dbesc'd
);
if(! $r) {
logger('mod_import: channel not found. ', print_r($channel,true));
notice( t('Cloned channel not found. Import failed.') . EOL);
return;
}
// reset
$channel = $r[0];
set_default_login_identity(get_account_id(),$channel['channel_id'],false);
$configs = $data['config'];
if($configs) {
foreach($configs as $config) {
unset($config['id']);
$config['uid'] = $channel['channel_id'];
dbesc_array($config);
$r = dbq("INSERT INTO pconfig (`"
. implode("`, `", array_keys($config))
. "`) VALUES ('"
. implode("', '", array_values($config))
. "')" );
}
}
if($data['photo']) {
require_once('include/photo/photo_driver.php');
import_channel_photo(base64url_decode($data['photo']['data']),$data['photo']['type'],get_account_id(),$channel['channel_id']);
}
$profiles = $data['profile'];
if($profiles) {
foreach($profiles as $profile) {
unset($profile['id']);
$profile['aid'] = get_account_id();
$profile['uid'] = $channel['channel_id'];
// we are going to reset all profile photos to the original
// somebody will have to fix this later and put all the applicable photos into the export
$profile['photo'] = z_root() . '/photo/profile/l/' . $channel['channel_id'];
$profile['thumb'] = z_root() . '/photo/profile/m/' . $channel['channel_id'];
dbesc_array($profile);
$r = dbq("INSERT INTO profile (`"
. implode("`, `", array_keys($profile))
. "`) VALUES ('"
. implode("', '", array_values($profile))
. "')" );
}
}
$hublocs = $data['hubloc'];
if($hublocs) {
foreach($hublocs as $hubloc) {
if(! array_key_exists('hubloc_primary',$hublocs)) {
$hubloc['hubloc_primary'] = (($hubloc['hubloc_flags'] & 0x0001) ? 1 : 0);
$hubloc['hubloc_orphancheck'] = (($hubloc['hubloc_flags'] & 0x0004) ? 1 : 0);
$hubloc['hubloc_error'] = (($hubloc['hubloc_status'] & 0x0003) ? 1 : 0);
$hubloc['hubloc_deleted'] = (($hubloc['hubloc_flags'] & 0x1000) ? 1 : 0);
}
$arr = array(
'guid' => $hubloc['hubloc_guid'],
'guid_sig' => $hubloc['guid_sig'],
'url' => $hubloc['hubloc_url'],
'url_sig' => $hubloc['hubloc_url_sig']
$r = q("select * from channel where channel_account_id = %d and channel_guid = '%s' limit 1",
intval(get_account_id()),
$channel['channel_guid'] // Already dbesc'd
);
if(($hubloc['hubloc_hash'] === $channel['channel_hash']) && intval($hubloc['hubloc_primary']) && ($seize))
$hubloc['hubloc_primary'] = 0;
if(! zot_gethub($arr)) {
unset($hubloc['hubloc_id']);
dbesc_array($hubloc);
$r = dbq("INSERT INTO hubloc (`"
. implode("`, `", array_keys($hubloc))
. "`) VALUES ('"
. implode("', '", array_values($hubloc))
. "')" );
if(! $r) {
logger('mod_import: channel not found. ', print_r($channel,true));
notice( t('Cloned channel not found. Import failed.') . EOL);
return;
}
// reset
$channel = $r[0];
set_default_login_identity(get_account_id(),$channel['channel_id'],false);
logger('import step 1');
$_SESSION['import_step'] = 1;
ref_session_write(session_id(), serialize($_SESSION));
}
}
else {
$r = q("select * from channel where channel_account_id = %d and channel_guid = '%s' limit 1",
intval(get_account_id()),
dbesc($channel['channel_guid'])
);
if($r)
$channel = $r[0];
else {
logger('mod_import: channel not found. ', print_r($channel,true));
notice( t('Cloned channel not found. Import failed.') . EOL);
return;
}
}
// create new hubloc for the new channel at this site
if($completed < 2) {
$r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_network, hubloc_primary,
hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey )
values ( '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s' )",
dbesc($channel['channel_guid']),
dbesc($channel['channel_guid_sig']),
dbesc($channel['channel_hash']),
dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()),
dbesc('zot'),
intval(($seize) ? 1 : 0),
dbesc(z_root()),
dbesc(base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey']))),
dbesc(get_app()->get_hostname()),
dbesc(z_root() . '/post'),
dbesc(get_config('system','pubkey'))
);
$configs = $data['config'];
if($configs) {
foreach($configs as $config) {
unset($config['id']);
$config['uid'] = $channel['channel_id'];
dbesc_array($config);
$r = dbq("INSERT INTO pconfig (`"
. implode("`, `", array_keys($config))
. "`) VALUES ('"
. implode("', '", array_values($config))
. "')" );
}
}
logger('import step 2');
$_SESSION['import_step'] = 2;
ref_session_write(session_id(), serialize($_SESSION));
}
// reset the original primary hubloc if it is being seized
if($seize)
$r = q("update hubloc set hubloc_primary = 0 where hubloc_primary = 1 and hubloc_hash = '%s' and hubloc_url != '%s' ",
dbesc($channel['channel_hash']),
dbesc(z_root())
);
// import xchans and contact photos
if($seize) {
if($completed < 3) {
// replace any existing xchan we may have on this site if we're seizing control
if($data['photo']) {
require_once('include/photo/photo_driver.php');
import_channel_photo(base64url_decode($data['photo']['data']),$data['photo']['type'],get_account_id(),$channel['channel_id']);
}
$r = q("delete from xchan where xchan_hash = '%s'",
dbesc($channel['channel_hash'])
);
$profiles = $data['profile'];
if($profiles) {
foreach($profiles as $profile) {
unset($profile['id']);
$profile['aid'] = get_account_id();
$profile['uid'] = $channel['channel_id'];
$r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_pubkey, xchan_photo_l, xchan_photo_m, xchan_photo_s, xchan_addr, xchan_url, xchan_follow, xchan_connurl, xchan_name, xchan_network, xchan_photo_date, xchan_name_date, xchan_hidden, xchan_orphan, xchan_censored, xchan_selfcensored, xchan_system, xchan_pubforum, xchan_deleted ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, %d, %d, %d )",
dbesc($channel['channel_hash']),
// we are going to reset all profile photos to the original
// somebody will have to fix this later and put all the applicable photos into the export
$profile['photo'] = z_root() . '/photo/profile/l/' . $channel['channel_id'];
$profile['thumb'] = z_root() . '/photo/profile/m/' . $channel['channel_id'];
dbesc_array($profile);
$r = dbq("INSERT INTO profile (`"
. implode("`, `", array_keys($profile))
. "`) VALUES ('"
. implode("', '", array_values($profile))
. "')" );
}
}
logger('import step 3');
$_SESSION['import_step'] = 3;
ref_session_write(session_id(), serialize($_SESSION));
}
if($completed < 4) {
$hublocs = $data['hubloc'];
if($hublocs) {
foreach($hublocs as $hubloc) {
if(! array_key_exists('hubloc_primary',$hublocs)) {
$hubloc['hubloc_primary'] = (($hubloc['hubloc_flags'] & 0x0001) ? 1 : 0);
$hubloc['hubloc_orphancheck'] = (($hubloc['hubloc_flags'] & 0x0004) ? 1 : 0);
$hubloc['hubloc_error'] = (($hubloc['hubloc_status'] & 0x0003) ? 1 : 0);
$hubloc['hubloc_deleted'] = (($hubloc['hubloc_flags'] & 0x1000) ? 1 : 0);
}
$arr = array(
'guid' => $hubloc['hubloc_guid'],
'guid_sig' => $hubloc['guid_sig'],
'url' => $hubloc['hubloc_url'],
'url_sig' => $hubloc['hubloc_url_sig']
);
if(($hubloc['hubloc_hash'] === $channel['channel_hash']) && intval($hubloc['hubloc_primary']) && ($seize))
$hubloc['hubloc_primary'] = 0;
if(! zot_gethub($arr)) {
unset($hubloc['hubloc_id']);
dbesc_array($hubloc);
$r = dbq("INSERT INTO hubloc (`"
. implode("`, `", array_keys($hubloc))
. "`) VALUES ('"
. implode("', '", array_values($hubloc))
. "')" );
}
}
}
logger('import step 4');
$_SESSION['import_step'] = 4;
ref_session_write(session_id(), serialize($_SESSION));
}
if($completed < 5) {
// create new hubloc for the new channel at this site
$r = q("insert into hubloc ( hubloc_guid, hubloc_guid_sig, hubloc_hash, hubloc_addr, hubloc_network, hubloc_primary,
hubloc_url, hubloc_url_sig, hubloc_host, hubloc_callback, hubloc_sitekey )
values ( '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', '%s' )",
dbesc($channel['channel_guid']),
dbesc($channel['channel_guid_sig']),
dbesc($channel['channel_pubkey']),
dbesc($a->get_baseurl() . "/photo/profile/l/" . $channel['channel_id']),
dbesc($a->get_baseurl() . "/photo/profile/m/" . $channel['channel_id']),
dbesc($a->get_baseurl() . "/photo/profile/s/" . $channel['channel_id']),
dbesc($channel['channel_hash']),
dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()),
dbesc(z_root() . '/channel/' . $channel['channel_address']),
dbesc(z_root() . '/follow?f=&url=%s'),
dbesc(z_root() . '/poco/' . $channel['channel_address']),
dbesc($channel['channel_name']),
dbesc('zot'),
dbesc(datetime_convert()),
dbesc(datetime_convert()),
0,0,0,0,0,0,0
intval(($seize) ? 1 : 0),
dbesc(z_root()),
dbesc(base64url_encode(rsa_sign(z_root(),$channel['channel_prvkey']))),
dbesc(get_app()->get_hostname()),
dbesc(z_root() . '/post'),
dbesc(get_config('system','pubkey'))
);
// reset the original primary hubloc if it is being seized
if($seize) {
$r = q("update hubloc set hubloc_primary = 0 where hubloc_primary = 1 and hubloc_hash = '%s' and hubloc_url != '%s' ",
dbesc($channel['channel_hash']),
dbesc(z_root())
);
}
logger('import step 5');
$_SESSION['import_step'] = 5;
ref_session_write(session_id(), serialize($_SESSION));
}
if($completed < 6) {
// import xchans and contact photos
if($seize) {
// replace any existing xchan we may have on this site if we're seizing control
$r = q("delete from xchan where xchan_hash = '%s'",
dbesc($channel['channel_hash'])
);
$r = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_pubkey, xchan_photo_l, xchan_photo_m, xchan_photo_s, xchan_addr, xchan_url, xchan_follow, xchan_connurl, xchan_name, xchan_network, xchan_photo_date, xchan_name_date, xchan_hidden, xchan_orphan, xchan_censored, xchan_selfcensored, xchan_system, xchan_pubforum, xchan_deleted ) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, %d, %d, %d )",
dbesc($channel['channel_hash']),
dbesc($channel['channel_guid']),
dbesc($channel['channel_guid_sig']),
dbesc($channel['channel_pubkey']),
dbesc($a->get_baseurl() . "/photo/profile/l/" . $channel['channel_id']),
dbesc($a->get_baseurl() . "/photo/profile/m/" . $channel['channel_id']),
dbesc($a->get_baseurl() . "/photo/profile/s/" . $channel['channel_id']),
dbesc($channel['channel_address'] . '@' . get_app()->get_hostname()),
dbesc(z_root() . '/channel/' . $channel['channel_address']),
dbesc(z_root() . '/follow?f=&url=%s'),
dbesc(z_root() . '/poco/' . $channel['channel_address']),
dbesc($channel['channel_name']),
dbesc('zot'),
dbesc(datetime_convert()),
dbesc(datetime_convert()),
0,0,0,0,0,0,0
);
}
logger('import step 6');
$_SESSION['import_step'] = 6;
ref_session_write(session_id(), serialize($_SESSION));
}
$xchans = $data['xchan'];
if($xchans) {
foreach($xchans as $xchan) {
if(! array_key_exists('xchan_hidden',$xchan)) {
$xchan['xchan_hidden'] = (($xchan['xchan_flags'] & 0x0001) ? 1 : 0);
$xchan['xchan_orphan'] = (($xchan['xchan_flags'] & 0x0002) ? 1 : 0);
$xchan['xchan_censored'] = (($xchan['xchan_flags'] & 0x0004) ? 1 : 0);
$xchan['xchan_selfcensored'] = (($xchan['xchan_flags'] & 0x0008) ? 1 : 0);
$xchan['xchan_system'] = (($xchan['xchan_flags'] & 0x0010) ? 1 : 0);
$xchan['xchan_pubforum'] = (($xchan['xchan_flags'] & 0x0020) ? 1 : 0);
$xchan['xchan_deleted'] = (($xchan['xchan_flags'] & 0x1000) ? 1 : 0);
}
if($completed < 7) {
$r = q("select xchan_hash from xchan where xchan_hash = '%s' limit 1",
dbesc($xchan['xchan_hash'])
);
if($r)
continue;
$xchans = $data['xchan'];
if($xchans) {
foreach($xchans as $xchan) {
if(! array_key_exists('xchan_hidden',$xchan)) {
$xchan['xchan_hidden'] = (($xchan['xchan_flags'] & 0x0001) ? 1 : 0);
$xchan['xchan_orphan'] = (($xchan['xchan_flags'] & 0x0002) ? 1 : 0);
$xchan['xchan_censored'] = (($xchan['xchan_flags'] & 0x0004) ? 1 : 0);
$xchan['xchan_selfcensored'] = (($xchan['xchan_flags'] & 0x0008) ? 1 : 0);
$xchan['xchan_system'] = (($xchan['xchan_flags'] & 0x0010) ? 1 : 0);
$xchan['xchan_pubforum'] = (($xchan['xchan_flags'] & 0x0020) ? 1 : 0);
$xchan['xchan_deleted'] = (($xchan['xchan_flags'] & 0x1000) ? 1 : 0);
}
dbesc_array($xchan);
$r = q("select xchan_hash from xchan where xchan_hash = '%s' limit 1",
dbesc($xchan['xchan_hash'])
);
if($r)
continue;
dbesc_array($xchan);
$r = dbq("INSERT INTO xchan (`"
. implode("`, `", array_keys($xchan))
. "`) VALUES ('"
. implode("', '", array_values($xchan))
. "')" );
$r = dbq("INSERT INTO xchan (`"
. implode("`, `", array_keys($xchan))
. "`) VALUES ('"
. implode("', '", array_values($xchan))
. "')" );
require_once('include/photo/photo_driver.php');
$photos = import_profile_photo($xchan['xchan_photo_l'],$xchan['xchan_hash']);
if($photos[4])
$photodate = NULL_DATE;
else
$photodate = $xchan['xchan_photo_date'];
require_once('include/photo/photo_driver.php');
$photos = import_profile_photo($xchan['xchan_photo_l'],$xchan['xchan_hash']);
if($photos[4])
$photodate = NULL_DATE;
else
$photodate = $xchan['xchan_photo_date'];
$r = q("update xchan set xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s', xchan_photo_date = '%s'
where xchan_hash = '%s'",
dbesc($photos[0]),
dbesc($photos[1]),
dbesc($photos[2]),
dbesc($photos[3]),
dbesc($photodate),
dbesc($xchan['xchan_hash'])
);
$r = q("update xchan set xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s', xchan_photo_date = '%s'
where xchan_hash = '%s'",
dbesc($photos[0]),
dbesc($photos[1]),
dbesc($photos[2]),
dbesc($photos[3]),
dbesc($photodate),
dbesc($xchan['xchan_hash'])
);
}
}
logger('import step 7');
$_SESSION['import_step'] = 7;
ref_session_write(session_id(), serialize($_SESSION));
}
// FIXME - ensure we have an xchan if somebody is trying to pull a fast one
$friends = 0;
$feeds = 0;
// import contacts
$abooks = $data['abook'];
if($abooks) {
foreach($abooks as $abook) {
if($max_friends !== false && $friends > $max_friends)
continue;
if($max_feeds !== false && intval($abook['abook_feed']) && ($feeds > $max_feeds))
continue;
if($completed < 8) {
$friends = 0;
$feeds = 0;
unset($abook['abook_id']);
$abook['abook_account'] = get_account_id();
$abook['abook_channel'] = $channel['channel_id'];
if(! array_key_exists('abook_blocked',$abook)) {
$abook['abook_blocked'] = (($abook['abook_flags'] & 0x0001 ) ? 1 : 0);
$abook['abook_ignored'] = (($abook['abook_flags'] & 0x0002 ) ? 1 : 0);
$abook['abook_hidden'] = (($abook['abook_flags'] & 0x0004 ) ? 1 : 0);
$abook['abook_archived'] = (($abook['abook_flags'] & 0x0008 ) ? 1 : 0);
$abook['abook_pending'] = (($abook['abook_flags'] & 0x0010 ) ? 1 : 0);
$abook['abook_unconnected'] = (($abook['abook_flags'] & 0x0020 ) ? 1 : 0);
$abook['abook_self'] = (($abook['abook_flags'] & 0x0080 ) ? 1 : 0);
$abook['abook_feed'] = (($abook['abook_flags'] & 0x0100 ) ? 1 : 0);
// import contacts
$abooks = $data['abook'];
if($abooks) {
foreach($abooks as $abook) {
if($max_friends !== false && $friends > $max_friends)
continue;
if($max_feeds !== false && intval($abook['abook_feed']) && ($feeds > $max_feeds))
continue;
unset($abook['abook_id']);
unset($abook['abook_rating']);
unset($abook['abook_rating_text']);
$abook['abook_account'] = get_account_id();
$abook['abook_channel'] = $channel['channel_id'];
if(! array_key_exists('abook_blocked',$abook)) {
$abook['abook_blocked'] = (($abook['abook_flags'] & 0x0001 ) ? 1 : 0);
$abook['abook_ignored'] = (($abook['abook_flags'] & 0x0002 ) ? 1 : 0);
$abook['abook_hidden'] = (($abook['abook_flags'] & 0x0004 ) ? 1 : 0);
$abook['abook_archived'] = (($abook['abook_flags'] & 0x0008 ) ? 1 : 0);
$abook['abook_pending'] = (($abook['abook_flags'] & 0x0010 ) ? 1 : 0);
$abook['abook_unconnected'] = (($abook['abook_flags'] & 0x0020 ) ? 1 : 0);
$abook['abook_self'] = (($abook['abook_flags'] & 0x0080 ) ? 1 : 0);
$abook['abook_feed'] = (($abook['abook_flags'] & 0x0100 ) ? 1 : 0);
}
if($abook['abook_self']) {
$role = get_pconfig($channel['channel_id'],'system','permissions_role');
if(($role === 'forum') || ($abook['abook_my_perms'] & PERMS_W_TAGWALL)) {
q("update xchan set xchan_pubforum = 1 where xchan_hash = '%s' ",
dbesc($abook['abook_xchan'])
);
}
}
dbesc_array($abook);
$r = dbq("INSERT INTO abook (`"
. implode("`, `", array_keys($abook))
. "`) VALUES ('"
. implode("', '", array_values($abook))
. "')" );
$friends ++;
if(intval($abook['abook_feed']))
$feeds ++;
}
}
logger('import step 8');
$_SESSION['import_step'] = 8;
ref_session_write(session_id(), serialize($_SESSION));
}
if($abook['abook_self']) {
$role = get_pconfig($channel['channel_id'],'system','permissions_role');
if(($role === 'forum') || ($abook['abook_my_perms'] & PERMS_W_TAGWALL)) {
q("update xchan set xchan_pubforum = 1 where xchan_hash = '%s' ",
dbesc($abook['abook_xchan'])
);
if($completed < 9) {
$groups = $data['group'];
if($groups) {
$saved = array();
foreach($groups as $group) {
$saved[$group['hash']] = array('old' => $group['id']);
unset($group['id']);
$group['uid'] = $channel['channel_id'];
dbesc_array($group);
$r = dbq("INSERT INTO groups (`"
. implode("`, `", array_keys($group))
. "`) VALUES ('"
. implode("', '", array_values($group))
. "')" );
}
$r = q("select * from `groups` where uid = %d",
intval($channel['channel_id'])
);
if($r) {
foreach($r as $rr) {
$saved[$rr['hash']]['new'] = $rr['id'];
}
}
dbesc_array($abook);
$r = dbq("INSERT INTO abook (`"
. implode("`, `", array_keys($abook))
. "`) VALUES ('"
. implode("', '", array_values($abook))
. "')" );
$friends ++;
if(intval($abook['abook_feed']))
$feeds ++;
}
}
$groups = $data['group'];
if($groups) {
$saved = array();
foreach($groups as $group) {
$saved[$group['hash']] = array('old' => $group['id']);
unset($group['id']);
$group['uid'] = $channel['channel_id'];
dbesc_array($group);
$r = dbq("INSERT INTO groups (`"
. implode("`, `", array_keys($group))
. "`) VALUES ('"
. implode("', '", array_values($group))
. "')" );
}
$r = q("select * from `groups` where uid = %d",
intval($channel['channel_id'])
);
if($r) {
foreach($r as $rr) {
$saved[$rr['hash']]['new'] = $rr['id'];
$group_members = $data['group_member'];
if($group_members) {
foreach($group_members as $group_member) {
unset($group_member['id']);
$group_member['uid'] = $channel['channel_id'];
foreach($saved as $x) {
if($x['old'] == $group_member['gid'])
$group_member['gid'] = $x['new'];
}
dbesc_array($group_member);
$r = dbq("INSERT INTO group_member (`"
. implode("`, `", array_keys($group_member))
. "`) VALUES ('"
. implode("', '", array_values($group_member))
. "')" );
}
}
}
$group_members = $data['group_member'];
if($groups_members) {
foreach($group_members as $group_member) {
unset($group_member['id']);
$group_member['uid'] = $channel['channel_id'];
foreach($saved as $x) {
if($x['old'] == $group_member['gid'])
$group_member['gid'] = $x['new'];
}
dbesc_array($group_member);
$r = dbq("INSERT INTO group_member (`"
. implode("`, `", array_keys($group_member))
. "`) VALUES ('"
. implode("', '", array_values($group_member))
. "')" );
}
logger('import step 9');
$_SESSION['import_step'] = 9;
ref_session_write(session_id(), serialize($_SESSION));
}
$saved_notification_flags = notifications_off($channel['channel_id']);
@ -544,6 +617,7 @@ function import_post(&$a) {
change_channel($channel['channel_id']);
unset($_SESSION['import_step']);
goaway(z_root() . '/network' );
}

View file

@ -242,8 +242,8 @@ function like_content(&$a) {
// get the item. Allow linked photos (which are normally hidden) to be liked
$r = q("SELECT * FROM item WHERE id = %d
and item_blocked = 0 and item_moderated = 0 and item_spam = 0
and item_deleted = 0 and item_unpublished = 0 and item_delayed_publish = 0 LIMIT 1",
and item_type = 0 and item_deleted = 0 and item_unpublished = 0
and item_delayed = 0 and item_pending_remove = 0 and item_blocked = 0 LIMIT 1",
intval($item_id)
);

View file

@ -137,7 +137,9 @@ function menu_content(&$a) {
$o = replace_macros(get_markup_template('menuedit.tpl'), array(
'$header' => t('Edit Menu'),
'$sys' => $a->is_sys,
'$menu_id' => intval(argv(1)),
'$menu_edit_link' => 'mitem/' . intval(argv(1)) . (($a->is_sys) ? '?f=&sys=1' : ''),
'$hintedit' => t('Add or remove entries to this menu'),
'$editcontents' => t('Edit menu contents'),
'$menu_name' => array('menu_name', t('Menu name'), $m['menu_name'], t('Must be unique, only seen by you'), '*'),

View file

@ -44,9 +44,6 @@ function mitem_post(&$a) {
if(! $a->data['menu'])
return;
$channel = $a->get_channel();
if(!$_REQUEST['mitem_desc'] || !$_REQUEST['mitem_link']) {
notice( t('Unable to create element.') . EOL);
return;
@ -90,9 +87,6 @@ function mitem_post(&$a) {
}
}
@ -167,7 +161,8 @@ function mitem_content(&$a) {
'$submit_more' => t('Submit and continue'),
'$display' => $display,
'$lockstate' => $lockstate,
'$menu_names' => $menu_names
'$menu_names' => $menu_names,
'$sys' => $a->is_sys
));
$o .= replace_macros(get_markup_template('mitemlist.tpl'),array(

View file

@ -123,7 +123,7 @@ function photo_init(&$a) {
);
if($r) {
$allowed = (($r[0]['uid']) ? perm_is_allowed($r[0]['uid'],$observer_xchan,'view_photos') : true);
$allowed = (($r[0]['uid']) ? perm_is_allowed($r[0]['uid'],$observer_xchan,'view_storage') : true);
$sql_extra = permissions_sql($r[0]['uid']);

View file

@ -63,7 +63,7 @@ function photos_post(&$a) {
$page_owner_uid = $a->data['channel']['channel_id'];
if(perm_is_allowed($page_owner_uid,get_observer_hash(),'post_photos'))
if(perm_is_allowed($page_owner_uid,get_observer_hash(),'write_storage'))
$can_post = true;
if(! $can_post) {
@ -495,8 +495,8 @@ function photos_content(&$a) {
$observer = $a->get_observer();
$can_post = perm_is_allowed($owner_uid,$observer['xchan_hash'],'post_photos');
$can_view = perm_is_allowed($owner_uid,$observer['xchan_hash'],'view_photos');
$can_post = perm_is_allowed($owner_uid,$observer['xchan_hash'],'write_storage');
$can_view = perm_is_allowed($owner_uid,$observer['xchan_hash'],'view_storage');
if(! $can_view) {
notice( t('Access to this item is restricted.') . EOL);

View file

@ -135,7 +135,7 @@ function profile_photo_post(&$a) {
$im = photo_factory($base_image['data'], $base_image['type']);
if($im->is_valid()) {
$im->cropImage(175,$srcX,$srcY,$srcW,$srcH);
$im->cropImage(300,$srcX,$srcY,$srcW,$srcH);
$aid = get_account_id();
@ -412,7 +412,7 @@ function profile_photo_crop_ui_head(&$a, $ph, $hash, $smallest){
$width = $ph->getWidth();
$height = $ph->getHeight();
if($width < 175 || $height < 175) {
if($width < 300 || $height < 300) {
$ph->scaleImageUp(200);
$width = $ph->getWidth();
$height = $ph->getHeight();

View file

@ -729,6 +729,6 @@ function what_next() {
."<p>".t('IMPORTANT: You will need to [manually] setup a scheduled task for the poller.')
.t('Please see the file "install/INSTALL.txt".')
."</p><p>"
.t("Go to your new Red node <a href='$baseurl/register'>registration page</a> and register as new user. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.")
.t("Go to your new hub <a href='$baseurl/register'>registration page</a> and register as new member. Remember to use the same email you have entered as administrator email. This will allow you to enter the site admin panel.")
."</p>";
}

View file

@ -9,9 +9,17 @@ function uexport_init(&$a) {
require_once('include/identity.php');
header('content-type: application/octet_stream');
header('content-disposition: attachment; filename="' . $channel['channel_address'] . '.json"' );
if(argc() > 1 && intval(argv(1)) > 1900) {
$year = intval(argv(1));
}
header('content-type: application/octet_stream');
header('content-disposition: attachment; filename="' . $channel['channel_address'] . (($year) ? '-' . $year : '') . '.json"' );
if($year) {
echo json_encode(identity_export_year(local_channel(),$year));
killme();
}
if(argc() > 1 && argv(1) === 'basic') {
echo json_encode(identity_basic_export(local_channel()));
@ -34,7 +42,9 @@ function uexport_content(&$a) {
'$basictitle' => t('Export Channel'),
'$basic' => t('Export your basic channel information to a small file. This acts as a backup of your connections, permissions, profile and basic data, which can be used to import your data to a new hub, but does not contain your content.'),
'$fulltitle' => t('Export Content'),
'$full' => t('Export your channel information and all the content to a JSON backup. This backs up all of your connections, permissions, profile data and all of your content, but is generally not suitable for importing a channel to a new hub as this file may be VERY large. Please be patient - it may take several minutes for this download to begin.')
'$full' => t('Export your channel information and all the content to a JSON backup. This backs up all of your connections, permissions, profile data and the last year of posts. This file may be VERY large. Please be patient - it may take several minutes for this download to begin.'),
'$by_year' => t('Export your posts from a given year.'),
));
return $o;
}

View file

@ -1,4 +1,4 @@
#!/bin/sh -f
#!/bin/bash -f
if [ $# -ne 2 ]; then
echo usage: $0 repo_url nickname

View file

@ -1,4 +1,4 @@
#!/bin/sh -f
#!/bin/bash -f
if [ $# -ne 2 ]; then

View file

@ -1,4 +1,4 @@
#!/bin/sh -f
#!/bin/bash -f
if [ $# -ne 2 ]; then
echo usage: $0 repo_url nickname

View file

@ -1,4 +1,4 @@
#!/bin/sh -f
#!/bin/bash -f
if [ $# -ne 1 ]; then
echo usage: $0 repository

View file

@ -1,4 +1,4 @@
#!/bin/sh -f
#!/bin/bash -f
if [ $# -ne 1 ]; then

View file

@ -1,4 +1,4 @@
#!/bin/sh -f
#!/bin/bash -f
if [ $# -ne 1 ]; then
echo usage: $0 repository

View file

@ -1 +1 @@
2015-07-06.1085
2015-07-27.1106

View file

@ -196,10 +196,6 @@ a.wall-item-name-link {
filter:alpha(opacity=100);
}
.wall-item-wrapper-end {
clear: both;
}
.shared_header {
margin-bottom: 20px;
}

View file

@ -17,12 +17,25 @@ main {
aside {
display: table-cell;
vertical-align: top;
padding: 65px 7px 0px 7px;
padding: 80px 7px 0px 7px;
}
section {
width: 100%;
display: table-cell;
vertical-align: top;
padding: 65px 7px 200px 7px;
padding: 80px 7px 200px 7px;
}
@media screen and (max-width: 767px) {
section {
padding: 65px 7px 200px 7px;
}
aside#region_1 {
padding: 65px 7px 0px 7px;
}
}

View file

@ -1,188 +1,18 @@
.field_abook_help {
color: #000;
}
.abook-them {
padding: 5px;
text-align: center;
}
.abook-them,
.abook-me {
padding: 5px 5px 5px 15px;
text-align: center;
}
.acheckbox {
margin-bottom: 5px !important;
}
.abook-pending-contact, .abook-autotext {
background: orange;
font-weight: bold;
margin: 10px;
padding: 20px 5px 10px;
}
.abook-perms-msg {
background: orange;
font-weight: bold;
margin: 10px;
padding: 20px 5px 10px;
.slider {
position: relative;
left: 1%;
padding-bottom: 15px;
}
.abook-permschange {
#perms-tool-table {
width: 100%;
}
.abook-perms-steps {
float: left;
width: 200px;
height: 210px;
background: orange;
font-weight: bold;
margin: 10px;
padding: 20px 5px 10px;
}
.abook-permssave {
margin-left: 10px;
clear: both;
}
#contact-slider {
width: 600px !important;
}
#rating-slider {
width: 600px !important;
}
#rating-text {
width: 400px;
height: 60px;
}
.abook-edit-them, .abook-edit-me {
float: left;
margin-left: 10px;
margin-right: 10px;
}
.field_abook_help {
float: left;
}
#contacts-main {
margin-top: 20px;
margin-bottom: 20px;
}
#contact-edit-wrapper {
margin-top: 10px;
}
#contact-edit-banner-name {
font-size: 1.4em;
font-weight: bold;
}
#contact-edit-poll-wrapper {
margin-top: 15px;
}
#contact-edit-poll-text {
margin-top: 15px;
margin-bottom: 5px;
}
#contact-edit-update-now {
margin-top: 15px;
}
#contact-edit-links{
clear: both;
}
#contact-edit-links ul {
list-style: none;
list-style-type: none;
margin-left: 0px;
padding-left: 0px;
}
#contact-edit-links li {
margin-top: 5px;
}
#contact-edit-drop-link {
float: right;
margin-right: 20px;
}
#contact-edit-nav-end {
clear: both;
}
#contact-edit-wrapper {
width: 100%;
}
#contact-edit-end {
clear: both;
margin-top: 15px;
}
#contact-profile-selector {
width: 175px;
margin-left: 175px;
}
.contact-edit-submit {
margin-top: 20px;
}
.contact-entry-wrapper {
float: left;
width: 120px;
height: 120px;
padding: 10px;
}
#contacts-search {
font-size: 1em;
width: 300px;
}
#contacts-search-end {
margin-bottom: 10px;
}
.contact-entry-photo-end {
clear: both;
}
.contact-entry-name {
float: left;
margin-left: 0px;
margin-right: 10px;
width: 120px;
overflow: hidden;
}
.contact-entry-end {
clear: both;
}
#abook-advanced-panel, #abook-advanced {
opacity: 0.3;
filter:alpha(opacity=30);
}
#abook-advanced-panel:hover, #abook-advanced:hover {
opacity: 1.0;
filter:alpha(opacity=100);
}
#abook-advanced {
margin-top: 15px;
#perms-tool-table td {
vertical-align: top;
}

3
view/css/mod_display.css Normal file
View file

@ -0,0 +1,3 @@
#jot-popup {
display: none;
}

View file

@ -39,7 +39,7 @@
padding: 5px;
width: 100%;
resize: vertical;
height: 150px;
height: 250px;
}
/* saved searches */

View file

@ -1,23 +1,12 @@
function abook_perms_msg() {
// $('.abook-permsmsg').show();
// $('.abook-permschange').html(aStr['permschange']);
// $('.abook-permssave').show();
}
function abook_perms_new() {
// $('.abook-permsnew').show();
// $('.abook-permssave').show();
}
$(document).ready(function() {
$('form').areYouSure({'addRemoveFieldsMarksDirty':true, 'message': aStr['leavethispage'] }); // Warn user about unsaved settings
if(typeof(after_following) !== 'undefined' && after_following) {
if(typeof(connectDefaultShare) !== 'undefined')
connectDefaultShare();
else
connectFullShare();
abook_perms_new();
}
$('#id_pending').click(function() {
@ -25,16 +14,10 @@ $(document).ready(function() {
connectDefaultShare();
else
connectFullShare();
abook_perms_new();
});
// $('.abook-edit-me').click(function() {
// abook_perms_msg();
// });
});
function connectFullShare() {
$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
@ -42,7 +25,6 @@ function connectFullShare() {
});
$('#me_id_perms_view_stream').attr('checked','checked');
$('#me_id_perms_view_profile').attr('checked','checked');
$('#me_id_perms_view_photos').attr('checked','checked');
$('#me_id_perms_view_contacts').attr('checked','checked');
$('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_view_pages').attr('checked','checked');
@ -54,85 +36,4 @@ function connectFullShare() {
$('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_republish').attr('checked','checked');
$('#me_id_perms_post_like').attr('checked','checked');
// abook_perms_msg();
}
function connectCautiousShare() {
$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
$(this).removeAttr('checked');
});
$('#me_id_perms_view_stream').attr('checked','checked');
$('#me_id_perms_view_profile').attr('checked','checked');
$('#me_id_perms_view_photos').attr('checked','checked');
$('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_view_pages').attr('checked','checked');
$('#me_id_perms_send_stream').attr('checked','checked');
$('#me_id_perms_post_comments').attr('checked','checked');
$('#me_id_perms_post_mail').attr('checked','checked');
$('#me_id_perms_post_like').attr('checked','checked');
// abook_perms_msg();
}
function connectForum() {
$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
$(this).removeAttr('checked');
});
$('#me_id_perms_view_stream').attr('checked','checked');
$('#me_id_perms_view_profile').attr('checked','checked');
$('#me_id_perms_view_photos').attr('checked','checked');
$('#me_id_perms_view_contacts').attr('checked','checked');
$('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_view_pages').attr('checked','checked');
$('#me_id_perms_send_stream').attr('checked','checked');
$('#me_id_perms_post_wall').attr('checked','checked');
$('#me_id_perms_post_comments').attr('checked','checked');
$('#me_id_perms_post_mail').attr('checked','checked');
$('#me_id_perms_tag_deliver').attr('checked','checked');
$('#me_id_perms_republish').attr('checked','checked');
$('#me_id_perms_post_like').attr('checked','checked');
// abook_perms_msg();
}
function connectClear() {
$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
$(this).removeAttr('checked');
});
// abook_perms_msg();
}
function connectSoapBox() {
$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
$(this).removeAttr('checked');
});
$('#me_id_perms_view_stream').attr('checked','checked');
$('#me_id_perms_view_profile').attr('checked','checked');
$('#me_id_perms_view_photos').attr('checked','checked');
$('#me_id_perms_view_contacts').attr('checked','checked');
$('#me_id_perms_view_storage').attr('checked','checked');
$('#me_id_perms_view_pages').attr('checked','checked');
// abook_perms_msg();
}
function connectFollowOnly() {
$('.abook-edit-me').each(function() {
if(! $(this).is(':disabled'))
$(this).removeAttr('checked');
});
$('#me_id_perms_send_stream').attr('checked','checked');
// abook_perms_msg();
}

View file

@ -46,7 +46,6 @@ function channel_privacy_macro(n) {
if(n == 0) {
$('#id_view_stream option').eq(0).attr('selected','selected');
$('#id_view_profile option').eq(0).attr('selected','selected');
$('#id_view_photos option').eq(0).attr('selected','selected');
$('#id_view_contacts option').eq(0).attr('selected','selected');
$('#id_view_storage option').eq(0).attr('selected','selected');
$('#id_view_pages option').eq(0).attr('selected','selected');
@ -54,7 +53,6 @@ function channel_privacy_macro(n) {
$('#id_post_wall option').eq(0).attr('selected','selected');
$('#id_post_comments option').eq(0).attr('selected','selected');
$('#id_post_mail option').eq(0).attr('selected','selected');
$('#id_post_photos option').eq(0).attr('selected','selected');
$('#id_tag_deliver option').eq(0).attr('selected','selected');
$('#id_chat option').eq(0).attr('selected','selected');
$('#id_write_storage option').eq(0).attr('selected','selected');
@ -69,7 +67,6 @@ function channel_privacy_macro(n) {
if(n == 1) {
$('#id_view_stream option').eq(1).attr('selected','selected');
$('#id_view_profile option').eq(1).attr('selected','selected');
$('#id_view_photos option').eq(1).attr('selected','selected');
$('#id_view_contacts option').eq(1).attr('selected','selected');
$('#id_view_storage option').eq(1).attr('selected','selected');
$('#id_view_pages option').eq(1).attr('selected','selected');
@ -77,7 +74,6 @@ function channel_privacy_macro(n) {
$('#id_post_wall option').eq(1).attr('selected','selected');
$('#id_post_comments option').eq(1).attr('selected','selected');
$('#id_post_mail option').eq(1).attr('selected','selected');
$('#id_post_photos option').eq(1).attr('selected','selected');
$('#id_tag_deliver option').eq(1).attr('selected','selected');
$('#id_chat option').eq(1).attr('selected','selected');
$('#id_write_storage option').eq(1).attr('selected','selected');
@ -92,7 +88,6 @@ function channel_privacy_macro(n) {
if(n == 2) {
$('#id_view_stream option').eq(7).attr('selected','selected');
$('#id_view_profile option').eq(7).attr('selected','selected');
$('#id_view_photos option').eq(7).attr('selected','selected');
$('#id_view_contacts option').eq(7).attr('selected','selected');
$('#id_view_storage option').eq(7).attr('selected','selected');
$('#id_view_pages option').eq(7).attr('selected','selected');
@ -100,7 +95,6 @@ function channel_privacy_macro(n) {
$('#id_post_wall option').eq(1).attr('selected','selected');
$('#id_post_comments option').eq(2).attr('selected','selected');
$('#id_post_mail option').eq(1).attr('selected','selected');
$('#id_post_photos option').eq(0).attr('selected','selected');
$('#id_tag_deliver option').eq(1).attr('selected','selected');
$('#id_chat option').eq(1).attr('selected','selected');
$('#id_write_storage option').eq(0).attr('selected','selected');
@ -115,7 +109,6 @@ function channel_privacy_macro(n) {
if(n == 3) {
$('#id_view_stream option').eq(7).attr('selected','selected');
$('#id_view_profile option').eq(7).attr('selected','selected');
$('#id_view_photos option').eq(7).attr('selected','selected');
$('#id_view_contacts option').eq(7).attr('selected','selected');
$('#id_view_storage option').eq(7).attr('selected','selected');
$('#id_view_pages option').eq(7).attr('selected','selected');
@ -123,7 +116,6 @@ function channel_privacy_macro(n) {
$('#id_post_wall option').eq(5).attr('selected','selected');
$('#id_post_comments option').eq(5).attr('selected','selected');
$('#id_post_mail option').eq(5).attr('selected','selected');
$('#id_post_photos option').eq(2).attr('selected','selected');
$('#id_tag_deliver option').eq(1).attr('selected','selected');
$('#id_chat option').eq(5).attr('selected','selected');
$('#id_write_storage option').eq(2).attr('selected','selected');

View file

@ -264,12 +264,20 @@ footer {
}
/*TODO: we should use one class for all this. */
/*
.group-selected, .fileas-selected, .categories-selected, .search-selected, .active {
color: #444 !important;
text-decoration: none !important;
.group-selected,
.fileas-selected,
.categories-selected,
.search-selected,
.active,
.group-selected:hover,
.fileas-selected:hover,
.categories-selected:hover,
.search-selected:hover,
.active:hover {
color: $font_colour;
}
*/
.fileas-all {
text-decoration: none !important;
@ -347,7 +355,8 @@ footer {
word-wrap: break-word;
}
.vcard dl {
.vcard dl,
.vcard .title {
margin-top: 10px;
margin-bottom: 0px;
}
@ -406,13 +415,19 @@ footer {
#profile-photo-wrapper img {
padding: 10px;
width: 197px;
height: 197px;
width: 100%;
height: 100%;
max-width: 300px;
max-height: 300px;
}
#profile-photo-wrapper {
margin-top: 10px;
width: 251px;
height: 251px;
margin-top: -10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: $radiuspx;
}
@ -504,7 +519,6 @@ footer {
display: block;
}
.pager {
padding: 10px;
text-align: center;
@ -570,10 +584,6 @@ footer {
margin-left: 5px;
}
.photo {
border: 1px solid #AAAAAA;
}
.photo-top-photo, .photo-album-photo {
/* padding: 10px;
max-width: 300px;
@ -704,8 +714,8 @@ a.rateme, div.rateme {
.contact-block-div {
float: left;
width: 49px;
height: 49px;
width: 50px;
height: 50px;
}
.contact-block-textdiv {
float: left;
@ -720,8 +730,8 @@ a.rateme, div.rateme {
float: left;
}
.contact-block-img {
width:47px;
height:47px;
width:48px;
height:48px;
}
#tag-remove {
@ -741,8 +751,8 @@ a.rateme, div.rateme {
}
.wall-item-conv {
margin-top: 5px;
margin-bottom: 25px;
padding-top: 5px;
padding-bottom: 10px;
}
@ -1274,12 +1284,6 @@ div.jGrowl div.jGrowl-notification {
text-align: center;
}
#contact-slider {
position: relative;
left: 5%;
width: 90%;
}
a.rconnect, a.rateme, div.rateme {
color: $nav_active_icon_colour;
text-decoration: none;
@ -1587,8 +1591,8 @@ img.mail-list-sender-photo {
}
.jothidden > input {
border: 1px solid $bgcolour;
background-color: $bgcolour;
border: 1px solid transparent;
background-color: transparent;
}
.jothidden > input:hover,
.jothidden > input:focus {
@ -1922,7 +1926,7 @@ nav .dropdown-menu {
.section-content-wrapper .section-content-warning-wrapper,
.section-content-tools-wrapper .section-content-danger-wrapper,
.section-content-wrapper .section-content-danger-wrapper {
margin-bottom: 0px;
margin-bottom: 10px;
border-radius: $radiuspx;
}
@ -1932,12 +1936,14 @@ nav .dropdown-menu {
background-color: $comment_item_colour;
border-bottom-left-radius: $radiuspx;
border-bottom-right-radius: $radiuspx;
word-wrap: break-word;
}
.section-content-wrapper-np {
background-color: $comment_item_colour;
border-bottom-left-radius: $radiuspx;
border-bottom-right-radius: $radiuspx;
word-wrap: break-word;
}
[id^="cloud-index-"]:hover td,
@ -1953,6 +1959,10 @@ nav .dropdown-menu {
background-color: $item_colour;
}
#perms-tool-table .highlight:hover {
background-color: $item_colour;
}
nav ul li .undefined,
nav ul li .notify-seen,
nav ul li .notify-unseen
@ -2107,6 +2117,7 @@ nav .badge.mail-update:hover {
}
@media screen and (max-width: 767px) {
aside#region_1 {
background: rgba(0, 0, 0, .1);
border-right: 1px solid $nav_bd;
@ -2285,4 +2296,3 @@ nav .badge.mail-update:hover {
.channels_ckbx, .pending_ckbx, .users_ckbx {
margin-top: -5px !important;
}

View file

@ -7,7 +7,7 @@ $(document).ready(function() {
if( $('#css3-calc').width() == 10) {
$(window).resize(function() {
if($(window).width() < 767) {
$('main').css('width', $(window).width() + 231 );
$('main').css('width', $(window).width() + 285 );
} else {
$('main').css('width', '100%' );
}

View file

@ -154,7 +154,7 @@ if(file_exists('view/theme/redbasic/css/style.css')) {
$x = file_get_contents('view/theme/redbasic/css/style.css');
$aside_width = 231;
$aside_width = 285;
// left aside and right aside are is 231px + converse width
if($converse_center) {

View file

@ -16,12 +16,7 @@
background-color: #fff;
}
#redbasic_converse_center_container {
display: none;
}
.wall-item-conv {
margin-bottom: 10px;
margin-top: 10px;
margin-left: 10px;
padding-top: 10px;
padding-left: 10px;
}

View file

@ -46,7 +46,7 @@ if (! $radius)
if (! $shadow)
$shadow = "0";
if (! $converse_width)
$converse_width = "676";
$converse_width = "790";
if(! $top_photo)
$top_photo = '48px';
if(! $comment_indent)
@ -61,5 +61,3 @@ else {
$nav_float_min_opacity = (float) $nav_min_opacity;
$nav_percent_min_opacity = (int) 100 * $nav_min_opacity;
}
$converse_center = "1";

View file

@ -1,140 +1,223 @@
<div class="generic-content-wrapper-styled">
<h2>{{$header}}</h2>
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
{{if $notself}}
<div class="dropdown pull-right">
<button id="connection-dropdown" class="btn btn-default btn-xs" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="icon-caret-down"></i>
</button>
<ul class="dropdown-menu" aria-labelledby="dLabel">
<li><a href="{{$buttons.view.url}}" title="{{$buttons.view.title}}">{{$buttons.view.label}}</a></li>
<li><a href="{{$buttons.recent.url}}" title="{{$buttons.recent.title}}">{{$buttons.recent.label}}</a></li>
<li class="divider"></li>
<li><a href="#" title="{{$buttons.refresh.title}}" onclick="window.location.href='{{$buttons.refresh.url}}'; return false;">{{$buttons.refresh.label}}</a></li>
<li><a href="#" title="{{$buttons.block.title}}" onclick="window.location.href='{{$buttons.block.url}}'; return false;">{{$buttons.block.label}}</a></li>
<li><a href="#" title="{{$buttons.ignore.title}}" onclick="window.location.href='{{$buttons.ignore.url}}'; return false;">{{$buttons.ignore.label}}</a></li>
<li><a href="#" title="{{$buttons.archive.title}}" onclick="window.location.href='{{$buttons.archive.url}}'; return false;">{{$buttons.archive.label}}</a></li>
<li><a href="#" title="{{$buttons.hide.title}}" onclick="window.location.href='{{$buttons.hide.url}}'; return false;">{{$buttons.hide.label}}</a></li>
<li><a href="#" title="{{$buttons.delete.title}}" onclick="window.location.href='{{$buttons.delete.url}}'; return false;">{{$buttons.delete.label}}</a></li>
</ul>
</div>
{{/if}}
<h2>{{$header}}</h2>
</div>
<div class="section-content-wrapper-np">
{{if $notself}}
{{foreach $buttons as $b}}
{{if $b.info}}
<div class="section-content-danger-wrapper">
<div>
{{$b.info}}
</div>
</div>
{{/if}}
{{/foreach}}
<div class="section-content-info-wrapper">
<div>
{{$addr_text}} <strong>'{{$addr}}'</strong>
</div>
{{if $last_update}}
<div>
{{$lastupdtext}} {{$last_update}}
</div>
{{/if}}
</div>
{{/if}}
<h3>{{$addr}}</h3>
<form id="abook-edit-form" action="connedit/{{$contact_id}}" method="post" >
{{if $notself}}
<div id="connection-flag-tabs">
{{$tabs}}
</div>
<div id="connection-edit-buttons">
{{foreach $buttons as $b }}
<button class="btn btn-sm btn-default" title="{{$b.title}}" onclick="window.location.href='{{$b.url}}'; return false;">{{$b.label}}</button>
{{/foreach}}
{{/if}}
<div id="contact-edit-wrapper">
<form id="abook-edit-form" action="connedit/{{$contact_id}}" method="post" >
<div class="abook-permsnew" style="display: none;">
<div class="abook-perms-msg">{{$perms_step1}}</div>
</div>
<div class="abook-permsmsg" style="display: none;">
<div class="abook-perms-msg">{{$perms_new}}</div>
</div>
<div class="abook-permssave" style="display: none;">
<input class="contact-edit-submit" type="submit" name="done" value="{{$submit}}" />
</div>
{{if $last_update}}
{{$lastupdtext}} {{$last_update}}
{{/if}}
{{if $is_pending}}
<div class="abook-pending-contact">
{{include file="field_checkbox.tpl" field=$unapproved}}
</div>
{{/if}}
{{if $notself}}
{{if $slide}}
<h3>{{$lbl_slider}}</h3>
{{$slide}}
{{/if}}
{{if $connfilter}}
{{include file="field_textarea.tpl" field=$incl}}
{{include file="field_textarea.tpl" field=$excl}}
{{else}}
<input type="hidden" name="{{$incl.0}}" value="{{$incl.2}}" />
<input type="hidden" name="{{$excl.0}}" value="{{$excl.2}}" />
{{/if}}
{{if $rating}}
<h3>{{$lbl_rating}}</h3>
{{$rating}}
{{/if}}
{{/if}}
{{if $self}}
<div class="abook-autotext">
<div id="autoperm-desc" class="descriptive-paragraph">{{$autolbl}}</div>
{{include file="field_checkbox.tpl" field=$autoperms}}
</div>
{{/if}}
<input type="hidden" name="contact_id" value="{{$contact_id}}">
<input id="contact-closeness-mirror" type="hidden" name="closeness" value="{{$close}}" />
<input id="contact-rating-mirror" type="hidden" name="rating" value="{{$rating_val}}" />
{{if $rating}}
{{if $notself}}
{{include file="field_textarea.tpl" field=$rating_text}}
{{/if}}
{{/if}}
{{if $notself}}
{{if $multiprofs }}
<div>
<h3>{{$lbl_vis1}}</h3>
<div>{{$lbl_vis2}}</div>
{{$profile_select}}
</div>
{{/if}}
{{/if}}
<h3>{{$permlbl}}</h3>
{{if $notself}}
<div id="connedit-perms-wrap" class="fakelink" onclick="openClose('connedit-perms');">{{$clickme}}</div>
<div id="connedit-perms" style="display: none;" >
{{/if}}
<div id="perm-desc" class="descriptive-text">{{$permnote}}</div>
<table>
<tr><td></td><td class="abook-them">{{$them}}</td><td colspan="2" class="abook-me">{{$me}}</td><td></td></tr>
<tr><td colspan="5"><hr /></td></tr>
{{foreach $perms as $prm}}
{{include file="field_acheckbox.tpl" field=$prm}}
{{/foreach}}
<tr><td colspan="5"><hr /></td></tr>
</table>
</div>
{{if $notself}}
</div>
{{/if}}
<input class="contact-edit-submit" type="submit" name="done" value="{{$submit}}" />
{{if $self && $noperms}}
<script>
if(typeof(connectDefaultShare) !== 'undefined')
connectDefaultShare();
else
connectFullShare();
abook_perms_msg();
</script>
{{/if}}
</form>
</div>
<input type="hidden" name="contact_id" value="{{$contact_id}}">
<div class="panel-group" id="contact-edit-tools" role="tablist" aria-multiselectable="true">
{{if $notself}}
{{if $is_pending}}
<div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="pending-tool">
<h3>
<a data-toggle="collapse" data-parent="#contact-edit-tools" href="#pending-tool-collapse" aria-expanded="true" aria-controls="pending-tool-collapse">
{{$pending_label}}
</a>
</h3>
</div>
<div id="pending-tool-collapse" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="pending-tool">
<div class="section-content-tools-wrapper">
{{include file="field_checkbox.tpl" field=$unapproved}}
<div class="settings-submit-wrapper" >
<button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button>
</div>
</div>
</div>
</div>
<div class="modal" id="abook-pending-modal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{$pending_modal_title}}</h4>
</div>
<div class="modal-body">
<strong>{{$name}}</strong> {{$pending_modal_body}}
</div>
<div class="modal-footer">
<button class="btn btn-sm btn-danger pull-left" title="{{$buttons.delete.title}}" onclick="window.location.href='{{$buttons.delete.url}}'; return false;">{{$buttons.delete.label}}</button>
<button type="button" class="btn btn-default" data-dismiss="modal">{{$pending_modal_dismiss}}</button>
<button type="submit" class="btn btn-primary" name="pending" value="1">{{$pending_modal_approve}}</button>
</div>
</div>
</div>
</div>
<script>$('#abook-pending-modal').modal('show');</script>
{{/if}}
{{if $affinity }}
<div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="affinity-tool">
<h3>
<a data-toggle="collapse" data-parent="#contact-edit-tools" href="#affinity-tool-collapse" aria-expanded="true" aria-controls="affinity-tool-collapse">
{{$affinity }}
</a>
</h3>
</div>
<div id="affinity-tool-collapse" class="panel-collapse collapse{{if !$is_pending}} in{{/if}}" role="tabpanel" aria-labelledby="affinity-tool">
<div class="section-content-tools-wrapper">
{{if $slide}}
<div class="form-group"><strong>{{$lbl_slider}}</strong></div>
{{$slide}}
<input id="contact-closeness-mirror" type="hidden" name="closeness" value="{{$close}}" />
{{/if}}
{{if $multiprofs }}
<div class="form-group">
<strong>{{$lbl_vis2}}</strong>
{{$profile_select}}
</div>
{{/if}}
<div class="settings-submit-wrapper" >
<button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button>
</div>
</div>
</div>
</div>
{{/if}}
{{if $connfilter}}
<div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="fitert-tool">
<h3>
<a data-toggle="collapse" data-parent="#contact-edit-tools" href="#fitert-tool-collapse" aria-expanded="true" aria-controls="fitert-tool-collapse">
{{$connfilter_label}}
</a>
</h3>
</div>
<div id="fitert-tool-collapse" class="panel-collapse collapse{{if !$is_pending && !($slide || $multiprofs)}} in{{/if}}" role="tabpanel" aria-labelledby="fitert-tool">
<div class="section-content-tools-wrapper">
{{include file="field_textarea.tpl" field=$incl}}
{{include file="field_textarea.tpl" field=$excl}}
<div class="settings-submit-wrapper" >
<button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button>
</div>
</div>
</div>
</div>
{{else}}
<input type="hidden" name="{{$incl.0}}" value="{{$incl.2}}" />
<input type="hidden" name="{{$excl.0}}" value="{{$excl.2}}" />
{{/if}}
{{if $rating}}
<div class="panel">
<div class="section-subtitle-wrapper" role="tab" id="rating-tool">
<h3>
<a data-toggle="collapse" data-parent="#contact-edit-tools" href="#rating-tool-collapse" aria-expanded="true" aria-controls="rating-tool-collapse">
{{$lbl_rating}}
</a>
</h3>
</div>
<div id="rating-tool-collapse" class="panel-collapse collapse{{if !$is_pending && !($slide || $multiprofs) && !$connfilter}} in{{/if}}" role="tabpanel" aria-labelledby="rating-tool">
<div class="section-content-tools-wrapper">
<div class="section-content-warning-wrapper">
{{$rating_info}}
</div>
<div class="form-group"><strong>{{$lbl_rating_label}}</strong></div>
{{$rating}}
{{include file="field_textarea.tpl" field=$rating_text}}
<input id="contact-rating-mirror" type="hidden" name="rating" value="{{$rating_val}}" />
<div class="settings-submit-wrapper" >
<button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button>
</div>
</div>
</div>
</div>
{{/if}}
{{/if}}
<div class="panel">
{{if $notself}}
<div class="section-subtitle-wrapper" role="tab" id="perms-tool">
<h3>
<a data-toggle="collapse" data-parent="#contact-edit-tools" href="#perms-tool-collapse" aria-expanded="true" aria-controls="perms-tool-collapse">
{{$permlbl}}
</a>
</h3>
</div>
{{/if}}
<div id="perms-tool-collapse" class="panel-collapse collapse{{if $self}} in{{/if}}" role="tabpanel" aria-labelledby="perms-tool">
<div class="section-content-tools-wrapper">
<div class="section-content-warning-wrapper">
{{if $notself}}{{$permnote}}{{/if}}
{{if $self}}{{$permnote_self}}{{/if}}
</div>
<table id="perms-tool-table" class=form-group>
<tr>
<td></td>
{{if $notself}}
<td class="abook-them">{{$them}}</td>
{{/if}}
<td colspan="2" class="abook-me">{{$me}}</td>
</tr>
{{foreach $perms as $prm}}
{{include file="field_acheckbox.tpl" field=$prm}}
{{/foreach}}
</table>
{{if $self}}
<div>
<div class="section-content-info-wrapper">
{{$autolbl}}
</div>
{{include file="field_checkbox.tpl" field=$autoperms}}
</div>
{{/if}}
<div class="settings-submit-wrapper" >
<button type="submit" name="done" value="{{$submit}}" class="btn btn-primary">{{$submit}}</button>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>

View file

@ -1,4 +1,20 @@
<div id="contact-slider" class="slider" style="height: 32px; position: relative; left: 5%; width: 90%;"><input id="contact-range" type="text" name="fake-closeness" value="{{$val}}" /></div>
<div id="contact-slider" class="slider form-group"><input id="contact-range" type="text" name="fake-closeness" value="{{$val}}" /></div>
<script>
$("#contact-range").jRange({ from: {{$min|default:'0'}}, to: 99, step: 1, scale: [{{$labels}}], width:'100%', showLabels: false, onstatechange: function(v) { $("#contact-closeness-mirror").val(v); } });
$(document).ready(function() {
// The slider does not render correct if width is given in % and
// the slider container is hidden (display: none) during rendering.
// So let's unhide it to render and hide again afterwards.
if(!$("#affinity-tool-collapse").hasClass("in")) {
$("#affinity-tool-collapse").addClass("in");
makeContactSlider();
$("#affinity-tool-collapse").removeClass("in");
}
else {
makeContactSlider();
}
});
function makeContactSlider() {
$("#contact-range").jRange({ from: {{$min|default:'0'}}, to: 99, step: 1, scale: [{{$labels}}], width:'98%', showLabels: false, onstatechange: function(v) { $("#contact-closeness-mirror").val(v); } });
}
</script>

View file

@ -165,8 +165,7 @@
</div>
<div class="clear"></div>
</div>
<div class="wall-item-wrapper-end"></div>
<div class="wall-item-outside-wrapper-end {{$item.indent}}" ></div>
<div class="clear{{if $indent}} {{$indent}}{{/if}}"></div>
</div>
{{if $item.toplevel}}
{{foreach $item.children as $child}}

View file

@ -179,8 +179,7 @@
</div>
<div class="clear"></div>
</div>
<div class="wall-item-wrapper-end"></div>
<div class="wall-item-outside-wrapper-end {{$item.indent}}" ></div>
<div class="clear{{if $indent}} {{$indent}}{{/if}}"></div>
</div>
</div>
{{if $item.comment_lastcollapsed}}

View file

@ -25,8 +25,8 @@
'croppa',
{
previewWrap: 'previewWrap',
minWidth: 175,
minHeight: 175,
minWidth: 300,
minHeight: 300,
maxWidth: 640,
maxHeight: 640,
ratioDim: { x: 100, y:100 },

View file

@ -5,11 +5,4 @@
{{include file="field_checkbox.tpl" field=$globaldir}}
{{include file="field_checkbox.tpl" field=$pubforums}}
{{$sort}}: <select onchange='window.location.href="{{$sorturl}}&order="+this.value'>
<option value='normal' {{if $selected_sort == 'normal'}}selected='selected'{{/if}}>{{$normal}}</option>
<option value='reverse' {{if $selected_sort == 'reverse'}}selected='selected'{{/if}}>{{$reverse}}</option>
<option value='date' {{if $selected_sort == 'date'}}selected='selected'{{/if}}>{{$date}}</option>
<option value='reversedate' {{if $selected_sort == 'reversedate'}}selected='selected'{{/if}}>{{$reversedate}}</option>
</select><br />
</div>

View file

@ -1,6 +1,18 @@
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
<div class="btn-group pull-right">
<button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{{$sort}}">
<i class="icon-sort"></i>
</button>
<ul class="dropdown-menu">
<li><a href="directory?f=&order=date{{$suggest}}">{{$date}}</a></li>
<li><a href="directory?f=&order=normal{{$suggest}}">{{$normal}}</a></li>
<li><a href="directory?f=&order=reversedate{{$suggest}}">{{$reversedate}}</a></li>
<li><a href="directory?f=&order=reverse{{$suggest}}">{{$reverse}}</a></li>
</ul>
</div>
<h2>{{$dirlbl}}{{if $search}}:&nbsp;{{$safetxt}}{{/if}}</h2>
<div class="clear"></div>
</div>
{{foreach $entries as $entry}}
{{include file="direntry.tpl"}}

View file

@ -1,12 +1,14 @@
<div class="section-title-wrapper">
{{if $delete}}
<div class="pull-right">
<a href="item/drop/{{$id}}" id="delete-btn" class="btn btn-xs btn-danger" onclick="return confirmDelete();"><i class="icon-trash"></i>&nbsp;{{$delete}}</a>
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
{{if $delete}}
<div class="pull-right">
<a href="item/drop/{{$id}}" id="delete-btn" class="btn btn-xs btn-danger" onclick="return confirmDelete();"><i class="icon-trash"></i>&nbsp;{{$delete}}</a>
</div>
{{/if}}
<h2>{{$title}}</h2>
<div class="clear"></div>
</div>
<div id="webpage-editor" class="section-content-tools-wrapper">
{{$editor}}
</div>
{{/if}}
<h2>{{$title}}</h2>
<div class="clear"></div>
</div>
<div id="webpage-editor" class="section-content-tools-wrapper">
{{$editor}}
</div>

View file

@ -2,9 +2,20 @@
<div class="generic-content-wrapper-styled">
<h2>{{$title}}</h2>
<div class="pull-right">
<button class="btn btn-xs" onclick="window.location.href='{{$new_event.0}}'; return false;" >{{$new_event.1}}</button>&nbsp;<button class="btn btn-xs" onclick="exportDate(); return false;" >{{$export.1}}</button>&nbsp;<button class="btn btn-xs btn-success" onclick="openClose('event-upload-form');"><i class="icon-upload"></i>&nbsp;{{$upload}}</button>
</div>
<div id="export-event-link"><button class="btn btn-default btn-sm" onclick="exportDate(); return false;" >{{$export.1}}</button></div>
<div id="new-event-link"><button class="btn btn-default btn-sm" onclick="window.location.href='{{$new_event.0}}'; return false;" >{{$new_event.1}}</button></div>
<div id="event-upload-form" style="display:none;">
<div class="section-content-tools-wrapper">
<form action="events" enctype="multipart/form-data" method="post" name="event-upload-form" id="event-upload-form">
<div class="form-group">
<input id="event-upload-choose" type="file" name="userfile" />
</div>
<button id="dbtn-submit" class="btn btn-primary btn-sm" type="submit" name="submit" >{{$submit}}</button>
</form>
</div>
</div>
<script>
function exportDate() {
@ -13,6 +24,7 @@ function exportDate() {
window.location.href=sT;
}
</script>
<div class="clear"></div>
<br />
<div id="events-calendar"></div>
</div>

View file

@ -1,17 +1,22 @@
<tr>
<td>
<label class="mainlabel" for='id_{{$field.0}}'>{{$field.1}}</label>
</td>
<td class="abook-them">
<input type="checkbox" name='them_{{$field.0}}' id='them_id_{{$field.0}}' value="1" disabled="disabled" {{if $field.2}}checked="checked"{{/if}} />
</td>
<td class="abook-me">
<input type="checkbox" name='{{$field.0}}' class='abook-edit-me' id='me_id_{{$field.0}}' value="{{$field.4}}" {{if $field.3}}checked="checked"{{/if}} />
</td>
<td>
{{if $field.5}}<span class="permission-inherited">{{$inherited}}</span> {{/if}}
</td>
<tr class="highlight">
<td>
<label class="mainlabel" for='me_id_{{$field.0}}'>{{$field.1}}</label><br>
<span class='field_abook_help'>{{$field.6}}</span>
</td>
</tr>
{{if $notself}}
<td class="abook-them">
{{if $field.2}}<i class="icon-check"></i>{{else}}<i class="icon-check-empty"></i>{{/if}}
</td>
{{/if}}
<td class="abook-me">
{{if $self || !$field.5}}
<input type="checkbox" name='{{$field.0}}' class='abook-edit-me' id='me_id_{{$field.0}}' value="{{$field.4}}" {{if $field.3}}checked="checked"{{/if}} />
{{/if}}
{{if $notself && $field.5}}
{{if $field.3}}<i class="icon-check"></i>{{else}}<i class="icon-check-empty"></i>{{/if}}
{{/if}}
</td>
<td>
{{if $field.5}}<span class="permission-inherited">{{$inherited}}{{if $self}}{{if $field.7}} <i class="icon-check"></i>{{else}} <i class="icon-check-empty"></i>{{/if}}{{/if}}</span>{{/if}}
</td>
</tr>

View file

@ -1,8 +1,9 @@
{{if $header}}
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
{{if $menu_id}}
{{if $menu_edit_link}}
<div class="pull-right">
<a href="mitem/{{$menu_id}}" title="{{$hintedit}}" class="btn btn-xs btn-success"><i class="icon-edit"></i>&nbsp;{{$editcontents}}</a>
<a href="{{$menu_edit_link}}" title="{{$hintedit}}" class="btn btn-xs btn-success"><i class="icon-edit"></i>&nbsp;{{$editcontents}}</a>
</div>
{{/if}}
<h2>{{$header}}</h2>
@ -27,3 +28,6 @@
<div class="clear"></div>
</form>
</div>
{{if $header}}
</div>
{{/if}}

View file

@ -1,37 +1,42 @@
{{if $header}}
<div class="section-title-wrapper">
<h2>{{$header}}</h2>
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
<h2>{{$header}}</h2>
</div>
{{/if}}
<div id="menu-element-creator" class="section-content-tools-wrapper" style="display: {{$display}};">
<form id="mitemedit" action="mitem/{{$menu_id}}{{if $mitem_id}}/{{$mitem_id}}{{/if}}{{if $sys}}?f=&sys=1{{/if}}" method="post" >
<input type="hidden" name="menu_id" value="{{$menu_id}}" />
{{if $mitem_id}}
<input type="hidden" name="mitem_id" value="{{$mitem_id}}" />
{{/if}}
{{include file="field_input.tpl" field=$mitem_desc}}
{{include file="field_input.tpl" field=$mitem_link}}
{{if $menu_names}}
<datalist id="menu-names">
{{foreach $menu_names as $menu_name}}
<option value="{{$menu_name}}">
{{/foreach}}
</datalist>
{{/if}}
{{include file="field_input.tpl" field=$mitem_order}}
{{include file="field_checkbox.tpl" field=$usezid}}
{{include file="field_checkbox.tpl" field=$newwin}}
<div class="pull-right form-group">
<div class="btn-group">
<button id="dbtn-acl" class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" onclick="return false;">
<i id="jot-perms-icon" class="icon-{{$lockstate}}"></i>
</button>
{{if $submit_more}}
<button class="btn btn-primary btn-sm" type="submit" name="submit-more" value="{{$submit_more}}">{{$submit_more}}&nbsp;<i class="icon-caret-right"></i></button>
{{/if}}
<button class="btn btn-primary btn-sm" type="submit" name="submit" value="{{$submit}}">{{$submit}}</button>
</div>
{{$aclselect}}
</div>
<div class="clear"></div>
</form>
</div>
{{if $header}}
</div>
{{/if}}
<div id="menu-element-creator" class="section-content-tools-wrapper" style="display: {{$display}};">
<form id="mitemedit" action="mitem/{{$menu_id}}{{if $mitem_id}}/{{$mitem_id}}{{/if}}" method="post" >
<input type="hidden" name="menu_id" value="{{$menu_id}}" />
{{if $mitem_id}}
<input type="hidden" name="mitem_id" value="{{$mitem_id}}" />
{{/if}}
{{include file="field_input.tpl" field=$mitem_desc}}
{{include file="field_input.tpl" field=$mitem_link}}
{{if $menu_names}}
<datalist id="menu-names">
{{foreach $menu_names as $menu_name}}
<option value="{{$menu_name}}">
{{/foreach}}
</datalist>
{{/if}}
{{include file="field_input.tpl" field=$mitem_order}}
{{include file="field_checkbox.tpl" field=$usezid}}
{{include file="field_checkbox.tpl" field=$newwin}}
<div class="pull-right form-group">
<div class="btn-group">
<button id="dbtn-acl" class="btn btn-default btn-sm" data-toggle="modal" data-target="#aclModal" onclick="return false;">
<i id="jot-perms-icon" class="icon-{{$lockstate}}"></i>
</button>
{{if $submit_more}}
<button class="btn btn-primary btn-sm" type="submit" name="submit-more" value="{{$submit_more}}">{{$submit_more}}&nbsp;<i class="icon-caret-right"></i></button>
{{/if}}
<button class="btn btn-primary btn-sm" type="submit" name="submit" value="{{$submit}}">{{$submit}}</button>
</div>
{{$aclselect}}
</div>
</form>
</div>

View file

@ -1,35 +1,34 @@
<div class="section-title-wrapper">
<div class="pull-right">
<button id="webpage-create-btn" class="btn btn-xs btn-success" onclick="openClose('menu-element-creator');"><i class="icon-edit"></i>&nbsp;{{$hintnew}}</button>
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
<div class="pull-right">
<button id="webpage-create-btn" class="btn btn-xs btn-success" onclick="openClose('menu-element-creator');"><i class="icon-edit"></i>&nbsp;{{$hintnew}}</button>
</div>
<h2>{{$title}} {{if $menudesc}}{{$menudesc}}{{else}}{{$menuname}}{{/if}}</h2>
<div class="clear"></div>
</div>
<h2>{{$title}} {{if $menudesc}}{{$menudesc}}{{else}}{{$menuname}}{{/if}}</h2>
<div class="clear"></div>
{{$create}}
{{if $mlist }}
<div id="mitemlist-content-wrapper" class="section-content-wrapper-np">
<table id="mitem-list-table">
<tr>
<th width="1%">{{$nametitle}}</th>
<th width="96%">{{$targettitle}}</th>
<th width="1%"></th>
<th width="1%"></th>
<th width="1%"></th>
</tr>
{{foreach $mlist as $m }}
<tr id="mitem-list-item-{{$m.mitem_id}}">
<td width="1%">{{$m.mitem_desc}}</td>
<td width="96%"><a href="{{$m.mitem_link}}">{{$m.mitem_link}}</a></td>
<td width="1%" class="mitem-list-tool dropdown">{{if $m.allow_cid || $m.allow_gid || $m.deny_cid || $m.deny_gid}}<i class="icon-lock dropdown-toggle lockview" data-toggle="dropdown" onclick="lockview('menu_item',{{$m.mitem_id}});" ></i><ul id="panel-{{$m.mitem_id}}" class="lockview-panel dropdown-menu"></ul>{{/if}}</td>
<td width="1%" class="mitem-list-tool"><a href="mitem/{{$menu_id}}/{{$m.mitem_id}}" title="{{$hintedit}}"><i class="icon-pencil"></i></a></td>
<td width="1%" class="mitem-list-tool"><a href="#" title="{{$hintdrop}}" onclick="dropItem('mitem/{{$menu_id}}/{{$m.mitem_id}}/drop', '#mitem-list-item-{{$m.mitem_id}}, #pmenu-item-{{$m.mitem_id}}'); return false;"><i class="icon-trash drop-icons"></i></a></td>
</tr>
{{/foreach}}
</table>
</div>
{{/if}}
</div>
{{$create}}
{{if $mlist }}
<div id="mitemlist-content-wrapper" class="section-content-wrapper-np">
<table id="mitem-list-table">
<tr>
<th width="1%">{{$nametitle}}</th>
<th width="96%">{{$targettitle}}</th>
<th width="1%"></th>
<th width="1%"></th>
<th width="1%"></th>
</tr>
{{foreach $mlist as $m }}
<tr id="mitem-list-item-{{$m.mitem_id}}">
<td width="1%">{{$m.mitem_desc}}</td>
<td width="96%"><a href="{{$m.mitem_link}}">{{$m.mitem_link}}</a></td>
<td width="1%" class="mitem-list-tool dropdown">{{if $m.allow_cid || $m.allow_gid || $m.deny_cid || $m.deny_gid}}<i class="icon-lock dropdown-toggle lockview" data-toggle="dropdown" onclick="lockview('menu_item',{{$m.mitem_id}});" ></i><ul id="panel-{{$m.mitem_id}}" class="lockview-panel dropdown-menu"></ul>{{/if}}</td>
<td width="1%" class="mitem-list-tool"><a href="mitem/{{$menu_id}}/{{$m.mitem_id}}" title="{{$hintedit}}"><i class="icon-pencil"></i></a></td>
<td width="1%" class="mitem-list-tool"><a href="#" title="{{$hintdrop}}" onclick="dropItem('mitem/{{$menu_id}}/{{$m.mitem_id}}/drop', '#mitem-list-item-{{$m.mitem_id}}, #pmenu-item-{{$m.mitem_id}}'); return false;"><i class="icon-trash drop-icons"></i></a></td>
</tr>
{{/foreach}}
</table>
</div>
{{/if}}

View file

@ -1,9 +1,14 @@
<div class="page">
<div class="generic-content-wrapper" id="page-content-wrapper" >
{{if $title}}<h2 class="page-title">{{$title}}</h2>{{/if}}
<div class="page-author"><a class="page-author-link" href="{{$auth_url}}">{{$author}}</a></div>
<div class="page-date">{{$date}}</div>
<div class="page-body">{{$body}}</div>
</div>
<div class="generic-content-wrapper" id="page-content-wrapper" >
{{if $title}}
<div class="section-title-wrapper">
<h2 class="page-title">{{$title}}</h2>
</div>
{{/if}}
<div class="section-content-wrapper">
<div class="page-author"><a class="page-author-link" href="{{$auth_url}}">{{$author}}</a></div>
<div class="page-date">{{$date}}</div>
<div class="page-body">{{$body}}</div>
</div>
</div>
</div>

View file

@ -21,7 +21,7 @@
{{$comment}}
<div class="wall-item-outside-wrapper-end{{$indent}}" ></div>
<div class="clear{{if $indent}} {{$indent}}{{/if}}"></div>
</div>
</div>

View file

@ -2,7 +2,6 @@
<div class="generic-content-wrapper">
<div class="section-title-wrapper">
<div class="pull-right">
{{if $tools}}
<a class="btn btn-default btn-xs" title="{{$tools.profile.1}}" href="{{$tools.profile.0}}"><i class="icon-user"></i></a>
{{/if}}
@ -11,7 +10,6 @@
<i class="icon-globe btn btn-default btn-xs" title="{{$map_text}}" onclick="var pos = $('#photo-map').css('position'); if(pos === 'absolute') { $('#photo-map').css( { position: 'relative', left: 'auto', top: 'auto' }); } else { $('#photo-map').css( { position: 'absolute', left: '-9999px', top: '-9999px' }); }" ></i>
</div>
{{/if}}
<div class="btn-group btn-group dropdown">
{{if $edit}}
<i class="icon-pencil btn btn-default btn-xs" title="{{$edit.edit}}" onclick="openClose('photo-edit');"></i>
@ -29,11 +27,8 @@
{{/if}}
</div>
</div>
<h2>{{if $desc}}{{$desc}}{{elseif $filename}}{{$filename}}{{else}}{{$unknown}}{{/if}}</h2>
<div class="clear"></div>
</div>
<div id="photo-map">
{{$map}}
@ -88,12 +83,9 @@
</form>
<div id="photo-edit-end" class="clear"></div>
</div>
<div id="photo-view-wrapper">
<div id="photo-photo"><a href="{{$photo.href}}" title="{{$photo.title}}" onclick="$.colorbox({href: '{{$photo.href}}'}); return false;"><img style="width: 100%;" src="{{$photo.src}}"></a></div>
<div id="photo-photo-end" class="clear"></div>
{{if $tags}}
<div class="photo-item-tools-left" id="in-this-photo">
<span id="in-this-photo-text">{{$tag_hdr}}</span>
@ -102,31 +94,29 @@
{{/foreach}}
</div>
{{/if}}
<div class="photo-item-tools">
{{if $responses.count }}
<div class="photo-item-tools-left pull-left">
<div class="{{if $responses.count > 1}}btn-group{{/if}}">
{{foreach $responses as $verb=>$response}}
{{if $response.count}}
<div class="btn-group">
<button type="button" class="btn btn-default btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="wall-item-{{$verb}}-{{$id}}">{{$response.count}} {{$response.button}}</button>
{{if $response.list_part}}
<ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-{{$verb}}-{{$id}}">{{foreach $response.list_part as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
{{else}}
<ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-{{$verb}}-{{$id}}">{{foreach $response.list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
{{/if}}
{{if $response.list_part}}
{{if $responses.count }}
<div class="photo-item-tools-left pull-left">
<div class="{{if $responses.count > 1}}btn-group{{/if}}">
{{foreach $responses as $verb=>$response}}
{{if $response.count}}
<div class="btn-group">
<button type="button" class="btn btn-default btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="wall-item-{{$verb}}-{{$id}}">{{$response.count}} {{$response.button}}</button>
{{if $response.list_part}}
<ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-{{$verb}}-{{$id}}">{{foreach $response.list_part as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
{{else}}
<ul class="dropdown-menu" role="menu" aria-labelledby="wall-item-{{$verb}}-{{$id}}">{{foreach $response.list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
{{/if}}
{{if $response.list_part}}
<div class="modal" id="{{$verb}}Modal-{{$id}}">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title">{{$response.title}}</h4>
<h4 class="modal-title">{{$response.title}}</h4>
</div>
<div class="modal-body">
<ul>{{foreach $response.list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
<ul>{{foreach $response.list as $liker}}<li role="presentation">{{$liker}}</li>{{/foreach}}</ul>
</div>
<div class="modal-footer clear">
<button type="button" class="btn btn-default" data-dismiss="modal">{{$modal_dismiss}}</button>
@ -134,37 +124,34 @@
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
{{/if}}
</div>
{{/if}}
{{/foreach}}
</div>
{{/if}}
{{/foreach}}
</div>
{{/if}}
{{if $likebuttons}}
<div class="photo-item-tools-right btn-group pull-right">
<button type="button" class="btn btn-default btn-sm" onclick="dolike({{$id}},'like'); return false">
<i class="icon-thumbs-up-alt" title="{{$likethis}}"></i>
</button>
<button type="button" class="btn btn-default btn-sm" onclick="dolike({{$id}},'dislike'); return false">
<i class="icon-thumbs-down-alt" title="{{$nolike}}"></i>
</button>
</div>
<div id="like-rotator-{{$id}}" class="photo-like-rotator pull-right"></div>
{{/if}}
<div class="clear"></div>
</div>
{{/if}}
</div>
{{if $likebuttons}}
<div class="photo-item-tools-right btn-group pull-right">
<button type="button" class="btn btn-default btn-sm" onclick="dolike({{$id}},'like'); return false">
<i class="icon-thumbs-up-alt" title="{{$likethis}}"></i>
</button>
<button type="button" class="btn btn-default btn-sm" onclick="dolike({{$id}},'dislike'); return false">
<i class="icon-thumbs-down-alt" title="{{$nolike}}"></i>
</button>
</div>
<div id="like-rotator-{{$id}}" class="photo-like-rotator pull-right"></div>
{{/if}}
<div class="clear"></div>
</div>
{{$comments}}
{{if $commentbox}}
<div class="wall-item-comment-wrapper{{if $comments}} wall-item-comment-wrapper-wc{{/if}}" >
{{$commentbox}}
</div>
{{/if}}
<div class="clear"></div>
</div>
{{$paginate}}

View file

@ -1,5 +1,5 @@
<div class="vcard">
<div id="profile-photo-wrapper"><img class="photo" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.name}}"></div>
{{if $profile.edit}}
<div class="dropdown">
<a class="profile-edit-side-link dropdown-toggle" data-toggle="dropdown" title="{{$profile.edit.3}}" href="#" ><i class="icon-pencil" title="{{$profile.edit.1}}" ></i></a>
@ -18,7 +18,6 @@
<div class="fn">{{$profile.name}}{{if $profile.online}} <i class="icon-asterisk online-now" title="{{$profile.online}}"></i>{{/if}}</div>
{{if $reddress}}<div class="reddress" oncopy="return false;">{{$profile.reddress}}</div>{{/if}}
{{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}}
<div id="profile-photo-wrapper"><img class="photo" width="175" height="175" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.name}}"></div>

View file

@ -1,4 +1,19 @@
<div id="rating-slider" class="slider" style="height: 32px; position: relative; left: 5%; width: 90%;"><input id="rating-range" type="text" name="fake-rating" value="{{$val}}" /></div>
<div id="rating-slider" class="slider form-group"><input id="rating-range" type="text" name="fake-rating" value="{{$val}}" /></div>
<script>
$("#rating-range").jRange({ from: -10, to: 10, step: 1, width:'100%', showLabels: false, showScale: true, scale : [ '-10','-8','-6','-4','-2','0','2','4','6','8','10' ], onstatechange: function(v) { $("#contact-rating-mirror").val(v); } });
$(document).ready(function() {
// The slider does not render correct if width is given in % and
// the slider container is hidden (display: none) during rendering.
// So let's unhide it to render and hide again afterwards.
if(!$("#rating-tool-collapse").hasClass("in")) {
$("#rating-tool-collapse").addClass("in");
makeRatingSlider();
$("#rating-tool-collapse").removeClass("in");
}
else {
makeRatingSlider();
}
});
function makeRatingSlider() {
$("#rating-range").jRange({ from: -10, to: 10, step: 1, width:'98%', showLabels: false, showScale: true, scale : [ '-10','-8','-6','-4','-2','0','2','4','6','8','10' ], onstatechange: function(v) { $("#contact-rating-mirror").val(v); } });
}
</script>

View file

@ -57,7 +57,7 @@
<a href='{{$item.conv.href}}' id='context-{{$item.id}}' title='{{$item.conv.title}}'>{{$item.conv.title}}</a>
</div>
{{/if}}
<div class="wall-item-outside-wrapper-end {{$item.indent}}" ></div>
<div class="clear{{if $indent}} {{$indent}}{{/if}}"></div>
</div>
</div>

View file

@ -1,6 +1,6 @@
<div class="vcard">
<div class="fn">{{$name}}</div>
<div id="profile-photo-wrapper"><a href="{{$link}}"><img class="vcard-photo photo" src="{{$photo}}" alt="{{$name}}" /></a></div>
<div class="fn">{{$name}}</div>
</div>