aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Willingham <founder@kakste.com>2013-07-03 16:10:58 +0100
committerThomas Willingham <founder@kakste.com>2013-07-03 16:10:58 +0100
commitd065135d909bf876f4c305d303de7642657f7e3e (patch)
treec569ec28535fe5e91ab29dffe67c9a74f11fece2
parentd1cae2da2abc3a602f682114bc02cce08a7e7578 (diff)
parent429ebabfd98240fe7d69ba81879ee35769af305f (diff)
downloadvolse-hubzilla-d065135d909bf876f4c305d303de7642657f7e3e.tar.gz
volse-hubzilla-d065135d909bf876f4c305d303de7642657f7e3e.tar.bz2
volse-hubzilla-d065135d909bf876f4c305d303de7642657f7e3e.zip
Merge remote-tracking branch 'upstream/master'
-rwxr-xr-xboot.php41
-rw-r--r--include/contact_selectors.php16
-rw-r--r--include/dir_fns.php5
-rw-r--r--include/features.php1
-rwxr-xr-xinclude/items.php3
-rw-r--r--include/taxonomy.php23
-rw-r--r--include/zot.php6
-rw-r--r--install/database.sql17
-rw-r--r--install/update.php22
-rw-r--r--js/main.js30
-rw-r--r--mod/channel.php3
-rw-r--r--mod/connections.php15
-rw-r--r--mod/photos.php134
-rw-r--r--mod/profile.php26
-rw-r--r--mod/profiles.php3
-rw-r--r--version.inc2
-rw-r--r--view/theme/redbasic/css/style.css48
-rwxr-xr-xview/tpl/abook_edit.tpl9
-rwxr-xr-xview/tpl/photo_edit.tpl55
-rwxr-xr-xview/tpl/photo_view.tpl55
-rwxr-xr-xview/tpl/profile_edit.tpl2
21 files changed, 302 insertions, 214 deletions
diff --git a/boot.php b/boot.php
index 110bf423e..32942bbce 100755
--- a/boot.php
+++ b/boot.php
@@ -43,7 +43,7 @@ require_once('include/taxonomy.php');
define ( 'RED_PLATFORM', 'Red Matrix' );
define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'R');
define ( 'ZOT_REVISION', 1 );
-define ( 'DB_UPDATE_VERSION', 1048 );
+define ( 'DB_UPDATE_VERSION', 1049 );
define ( 'EOL', '<br />' . "\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );
@@ -1419,7 +1419,7 @@ function get_max_import_size() {
* Function : profile_load
* @parameter App $a
* @parameter string $nickname
- * @parameter int $profile
+ * @parameter string $profile
*
* Summary: Loads a profile into the page sidebar.
* The function requires a writeable copy of the main App structure, and the nickname
@@ -1436,7 +1436,9 @@ function get_max_import_size() {
*/
-function profile_load(&$a, $nickname, $profile = 0) {
+function profile_load(&$a, $nickname, $profile = '') {
+
+ logger('profile_load: ' . $profile);
$user = q("select channel_id from channel where channel_address = '%s' limit 1",
dbesc($nickname)
@@ -1460,30 +1462,29 @@ function profile_load(&$a, $nickname, $profile = 0) {
return;
}
- $r = q("SELECT abook_profile FROM abook WHERE abook_xchan = '%s' limit 1",
- dbesc($observer['xchan_hash'])
- );
- if($r)
- $profile = $r[0]['abook_profile'];
-
+ if(! $profile) {
+ $r = q("SELECT abook_profile FROM abook WHERE abook_xchan = '%s' and abook_channel = '%d' limit 1",
+ dbesc($observer['xchan_hash']),
+ intval($user[0]['channel_id'])
+ );
+ if($r)
+ $profile = $r[0]['abook_profile'];
+ }
$r = null;
-
-
if($profile) {
- $profile_int = intval($profile);
- $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , channel.* FROM `profile`
- LEFT JOIN channel ON `profile`.`uid` = channel.channel_id
- WHERE channel.channel_address = '%s' AND `profile`.`id` = %d LIMIT 1",
+ $r = q("SELECT profile.uid AS profile_uid, profile.*, channel.* FROM profile
+ LEFT JOIN channel ON profile.uid = channel.channel_id
+ WHERE channel.channel_address = '%s' AND profile.profile_guid = '%s' LIMIT 1",
dbesc($nickname),
- intval($profile_int)
+ dbesc($profile)
);
}
- if(! ($r && count($r))) {
- $r = q("SELECT `profile`.`uid` AS `profile_uid`, `profile`.* , `channel`.* FROM `profile`
- LEFT JOIN `channel` ON `profile`.`uid` = channel.channel_id
- WHERE channel.channel_address = '%s' AND `profile`.`is_default` = 1 LIMIT 1",
+ if(! $r) {
+ $r = q("SELECT profile.uid AS profile_uid, profile.*, channel.* FROM profile
+ LEFT JOIN channel ON profile.uid = channel.channel_id
+ WHERE channel.channel_address = '%s' AND profile.is_default = 1 LIMIT 1",
dbesc($nickname)
);
}
diff --git a/include/contact_selectors.php b/include/contact_selectors.php
index adcca2c52..b56a77937 100644
--- a/include/contact_selectors.php
+++ b/include/contact_selectors.php
@@ -1,21 +1,19 @@
<?php /** @file */
-function contact_profile_assign($current,$foreign_net) {
+function contact_profile_assign($current) {
$o = '';
- $disabled = (($foreign_net) ? ' disabled="true" ' : '');
+ $o .= "<select id=\"contact-profile-selector\" name=\"profile-assign\" />\r\n";
- $o .= "<select id=\"contact-profile-selector\" $disabled name=\"profile-assign\" />\r\n";
+ $r = q("SELECT profile_guid, profile_name FROM `profile` WHERE `uid` = %d",
+ intval($_SESSION['uid']));
- $r = q("SELECT `id`, `profile_name` FROM `profile` WHERE `uid` = %d",
- intval($_SESSION['uid']));
-
- if(count($r)) {
+ if($r) {
foreach($r as $rr) {
- $selected = (($rr['id'] == $current) ? " selected=\"selected\" " : "");
- $o .= "<option value=\"{$rr['id']}\" $selected >{$rr['profile_name']}</option>\r\n";
+ $selected = (($rr['profile_guid'] == $current) ? " selected=\"selected\" " : "");
+ $o .= "<option value=\"{$rr['profile_guid']}\" $selected >{$rr['profile_name']}</option>\r\n";
}
}
$o .= "</select>\r\n";
diff --git a/include/dir_fns.php b/include/dir_fns.php
index 5a1d671cb..0b678fd91 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -53,7 +53,7 @@ function syncdirs($uid) {
logger('syncdirs', LOGGER_DEBUG);
- $p = q("select channel.channel_hash, profile.* from profile left join channel on channel_id = uid where uid = %d and is_default = 1",
+ $p = q("select channel.channel_hash, channel_timezone, profile.* from profile left join channel on channel_id = uid where uid = %d and is_default = 1",
intval($uid)
);
@@ -64,6 +64,9 @@ function syncdirs($uid) {
$profile['description'] = $p[0]['pdesc'];
$profile['birthday'] = $p[0]['dob'];
+ if($age = age($p[0]['dob'],$p[0]['channel_timezone'],''))
+ $profile['age'] = $age;
+
$profile['gender'] = $p[0]['gender'];
$profile['marital'] = $p[0]['marital'];
$profile['sexual'] = $p[0]['sexual'];
diff --git a/include/features.php b/include/features.php
index c2aabbc42..da1322a14 100644
--- a/include/features.php
+++ b/include/features.php
@@ -58,6 +58,7 @@ function get_features() {
array('filing', t('Saved Folders'), t('Ability to file posts under folders')),
array('dislike', t('Dislike Posts'), t('Ability to dislike posts/comments')),
array('star_posts', t('Star Posts'), t('Ability to mark special posts with a star indicator')),
+ array('tagadelic', t('Tag Cloud'), t('Provide a personal tag cloud on your channel page')),
),
);
diff --git a/include/items.php b/include/items.php
index c4ffcbca6..a3d591899 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1858,9 +1858,6 @@ function tag_deliver($uid,$item_id) {
// See if we are the owner of the parent item and have given permission to tag our posts.
// If so tag the parent post.
- // FIXME --- If the item is deleted, remove the tag from the parent.
- // (First ensure that deleted items use this function, or else do that part separately.)
-
logger('tag_deliver: community tag activity received');
if(($item['owner_xchan'] === $u[0]['channel_hash']) && (! get_pconfig($u[0]['channel_id'],'system','blocktags'))) {
diff --git a/include/taxonomy.php b/include/taxonomy.php
index 7e9a4c856..e9cc0faf4 100644
--- a/include/taxonomy.php
+++ b/include/taxonomy.php
@@ -96,12 +96,15 @@ function format_term_for_display($term) {
// Tag cloud functions - need to be adpated to this database format
-function tagadelic($uid, $count = 0, $type = TERM_HASHTAG) {
+function tagadelic($uid, $count = 0, $flags = 0, $type = TERM_HASHTAG) {
+ if($flags)
+ $sql_options = " and ((item_flags & " . intval($flags) . ") = " . intval($flags) . ") ";
// Fetch tags
- $r = q("select term, count(term) as total from term
- where uid = %d and type = %d
- and otype = %d
+ $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
+ and otype = %d and item_restrict = 0
+ $sql_options
group by term order by total desc %s",
intval($uid),
intval($type),
@@ -145,15 +148,17 @@ function tags_sort($a,$b) {
}
-function tagblock($link,$uid,$count = 0,$type = TERM_HASHTAG) {
+function tagblock($link,$uid,$count = 0,$flags = 0,$type = TERM_HASHTAG) {
+ $o = '';
$tab = 0;
- $r = tagadelic($uid,$count,$type);
+ $r = tagadelic($uid,$count,$flags,$type);
if($r) {
- echo '<div class="tags" align="center">';
+ $o = '<div class="tagblock widget"><h3>' . t('Tags') . '</h3><div class="tags" align="center">';
foreach($r as $rr) {
- echo '<a href="'.$link .'/' . '?f=&tag=' . urlencode($rr[0]).'" class="tag'.$rr[2].'">'.$rr[0].'</a> ';
+ $o .= '<a href="'.$link .'/' . '?f=&tag=' . urlencode($rr[0]).'" class="tag'.$rr[2].'">'.$rr[0].'</a> ' . "\r\n";
}
- echo '</div>';
+ $o .= '</div></div>';
}
+ return $o;
}
diff --git a/include/zot.php b/include/zot.php
index f10a02d47..f9b40c06f 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1312,7 +1312,6 @@ function import_directory_profile($hash,$profile) {
$arr['xprof_keywords'] = implode(' ',$clean);
-
$r = q("select * from xprof where xprof_hash = '%s' limit 1",
dbesc($hash)
);
@@ -1328,6 +1327,7 @@ function import_directory_profile($hash,$profile) {
$x = q("update xprof set
xprof_desc = '%s',
xprof_dob = '%s',
+ xprof_age = %d,
xprof_gender = '%s',
xprof_marital = '%s',
xprof_sexual = '%s',
@@ -1339,6 +1339,7 @@ function import_directory_profile($hash,$profile) {
where xprof_hash = '%s' limit 1",
dbesc($arr['xprof_desc']),
dbesc($arr['xprof_dob']),
+ intval($arr['xprof_age']),
dbesc($arr['xprof_gender']),
dbesc($arr['xprof_marital']),
dbesc($arr['xprof_sexual']),
@@ -1353,10 +1354,11 @@ function import_directory_profile($hash,$profile) {
}
else {
$update = true;
- $x = q("insert into xprof (xprof_hash, xprof_desc, xprof_dob, xprof_gender, xprof_marital, xprof_sexual, xprof_locale, xprof_region, xprof_postcode, xprof_country, xprof_keywords) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
+ $x = q("insert into xprof (xprof_hash, xprof_desc, xprof_dob, xprof_age, xprof_gender, xprof_marital, xprof_sexual, xprof_locale, xprof_region, xprof_postcode, xprof_country, xprof_keywords) values ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
dbesc($arr['xprof_hash']),
dbesc($arr['xprof_desc']),
dbesc($arr['xprof_dob']),
+ intval($arr['xprof_age']),
dbesc($arr['xprof_gender']),
dbesc($arr['xprof_marital']),
dbesc($arr['xprof_sexual']),
diff --git a/install/database.sql b/install/database.sql
index 5cb0146f7..59192b753 100644
--- a/install/database.sql
+++ b/install/database.sql
@@ -599,6 +599,23 @@ CREATE TABLE IF NOT EXISTS `notify` (
KEY `otype` (`otype`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE IF NOT EXISTS `obj` (
+ `obj_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `obj_page` char(64) NOT NULL DEFAULT '',
+ `obj_verb` char(255) NOT NULL DEFAULT '',
+ `obj_type` int(10) unsigned NOT NULL DEFAULT '0',
+ `obj_obj` char(255) NOT NULL DEFAULT '',
+ `obj_channel` int(10) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`obj_id`),
+ KEY `obj_verb` (`obj_verb`),
+ KEY `obj_page` (`obj_page`),
+ KEY `obj_type` (`obj_type`),
+ KEY `obj_channel` (`obj_channel`),
+ KEY `obj_obj` (`obj_obj`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+
CREATE TABLE IF NOT EXISTS `outq` (
`outq_hash` char(255) NOT NULL,
`outq_account` int(10) unsigned NOT NULL DEFAULT '0',
diff --git a/install/update.php b/install/update.php
index ef436c688..22c069d2f 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1048 );
+define( 'UPDATE_VERSION' , 1049 );
/**
*
@@ -581,3 +581,23 @@ ADD INDEX ( `xprof_age` ) ");
return UPDATE_FAILED;
}
+function update_r1048() {
+ $r = q("CREATE TABLE IF NOT EXISTS `obj` (
+ `obj_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `obj_page` char(64) NOT NULL DEFAULT '',
+ `obj_verb` char(255) NOT NULL DEFAULT '',
+ `obj_type` int(10) unsigned NOT NULL DEFAULT '0',
+ `obj_obj` char(255) NOT NULL DEFAULT '',
+ `obj_channel` int(10) unsigned NOT NULL DEFAULT '0',
+ PRIMARY KEY (`obj_id`),
+ KEY `obj_verb` (`obj_verb`),
+ KEY `obj_page` (`obj_page`),
+ KEY `obj_type` (`obj_type`),
+ KEY `obj_channel` (`obj_channel`),
+ KEY `obj_obj` (`obj_obj`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 ");
+
+ if($r)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
diff --git a/js/main.js b/js/main.js
index 8b1114d19..161068310 100644
--- a/js/main.js
+++ b/js/main.js
@@ -343,26 +343,26 @@
function updateConvItems(mode,data) {
- var expanded_comments = false;
-
if(mode === 'update') {
prev = 'threads-begin';
+
$('.thread-wrapper.toplevel_item',data).each(function() {
+
var ident = $(this).attr('id');
+ var commentWrap = $('#'+ident+' .collapsed-comments').attr('id');
+ var itmId = commentWrap.replace('collapsed-comments-','');
+ var isVisible = false;
if($('#' + ident).length == 0 && profile_page == 1) {
$('img',this).each(function() {
$(this).attr('src',$(this).attr('dst'));
});
-// expanded_comments = false;
-// $('.collapsed-comments',this).each(function() {
-// if($(this).is(':visible'))
-// expanded_comments = this;
-// });
+ if($('#collapsed-comments-'+itmId).is(':visible'))
+ isVisible = true;
$('#' + prev).after($(this));
-// if(expanded_comments)
-// $(expanded_comments).show();
+ if(isVisible)
+ showHideComments(itmId);
$(".autotime").timeago();
// divgrow doesn't prevent itself from attaching a second (or 500th)
// "show more" div to a content region - it also has a few other
@@ -374,14 +374,12 @@ function updateConvItems(mode,data) {
$('img',this).each(function() {
$(this).attr('src',$(this).attr('dst'));
});
-// expanded_comments = false;
-// $('.collapsed-comments',this).each(function() {
-// if($(this).is(':visible'))
-// expanded_comments = this;
-// });
+ // more FIXME related to expanded comments
+ if($('#collapsed-comments-'+itmId).is(':visible'))
+ isVisible = true;
$('#' + ident).replaceWith($(this));
-// if(expanded_comments)
-// $(expanded_comments).show();
+ if(isVisible)
+ showHideComments(itmId);
$(".autotime").timeago();
// $("div.wall-item-body").divgrow({ initialHeight: 400 });
diff --git a/mod/channel.php b/mod/channel.php
index 1442070a9..5d4c7ce1b 100644
--- a/mod/channel.php
+++ b/mod/channel.php
@@ -47,6 +47,9 @@ function channel_aside(&$a) {
$a->set_widget('archive',posted_date_widget($a->get_baseurl(true) . '/channel/' . $a->profile['channel_address'],$a->profile['profile_uid'],true));
$a->set_widget('categories',categories_widget($a->get_baseurl(true) . '/channel/' . $a->profile['channel_address'],$cat));
}
+ if(feature_enabled($a->profile['profile_uid'],'tagadelic'))
+ $a->set_widget('tagcloud',tagblock('search',$a->profile['profile_uid'],50,ITEM_WALL|ITEM_THREAD_TOP));
+
}
diff --git a/mod/connections.php b/mod/connections.php
index a53107dcf..89c0bcbc0 100644
--- a/mod/connections.php
+++ b/mod/connections.php
@@ -63,10 +63,10 @@ function connections_post(&$a) {
call_hooks('contact_edit_post', $_POST);
- $profile_id = intval($_POST['profile-assign']);
+ $profile_id = $_POST['profile-assign'];
if($profile_id) {
- $r = q("SELECT `id` FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
- intval($profile_id),
+ $r = q("SELECT profile_guid FROM profile WHERE profile_guid = '%s' AND `uid` = %d LIMIT 1",
+ dbesc($profile_id),
intval(local_user())
);
if(! count($r)) {
@@ -99,9 +99,9 @@ function connections_post(&$a) {
$abook_flags = ( $abook_flags ^ ABOOK_FLAG_PENDING );
}
- $r = q("UPDATE abook SET abook_profile = %d, abook_my_perms = %d , abook_closeness = %d, abook_flags = %d
+ $r = q("UPDATE abook SET abook_profile = '%s', abook_my_perms = %d , abook_closeness = %d, abook_flags = %d
where abook_id = %d AND abook_channel = %d LIMIT 1",
- intval($profile_id),
+ dbesc($profile_id),
intval($abook_my_perms),
intval($closeness),
intval($abook_flags),
@@ -405,7 +405,7 @@ function connections_content(&$a) {
'$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['name']),
+ '$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'],
@@ -438,7 +438,8 @@ function connections_content(&$a) {
'$updpub' => t('Update public posts'),
'$last_update' => $last_update,
'$udnow' => t('Update now'),
-// '$profile_select' => contact_profile_assign($contact['profile_id'],(($contact['network'] !== NETWORK_DFRN) ? true : false)),
+ '$profile_select' => contact_profile_assign($contact['abook_profile']),
+ '$multiprofs' => feature_enabled(local_user(),'multi_profiles'),
'$contact_id' => $contact['abook_id'],
'$block_text' => (($contact['blocked']) ? t('Unblock') : t('Block') ),
'$ignore_text' => (($contact['readonly']) ? t('Unignore') : t('Ignore') ),
diff --git a/mod/photos.php b/mod/photos.php
index 65bf866f1..f0b2b882e 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -633,6 +633,9 @@ function photos_content(&$a) {
// dispatch request
//
+ /**
+ * Display upload form
+ */
if($datatype === 'upload') {
if(! ($can_post)) {
@@ -640,12 +643,8 @@ function photos_content(&$a) {
return;
}
-
$selname = (($datum) ? hex2bin($datum) : '');
-
-
$albumselect = '<select id="photos-upload-album-select" name="album" size="4">';
-
$albumselect .= '<option value="" ' . ((! $selname) ? ' selected="selected" ' : '') . '>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</option>';
if(count($a->data['albums'])) {
@@ -673,6 +672,7 @@ function photos_content(&$a) {
$default_upload = '<input id="photos-upload-choose" type="file" name="userfile" /> <div class="photos-upload-submit-wrapper" >
<input type="submit" name="submit" value="' . t('Submit') . '" id="photos-upload-submit" /> </div>';
+ /* Show space usage */
$r = q("select sum(size) as total from photo where uid = %d and scale = 0 ",
intval($a->data['channel']['channel_id'])
@@ -687,15 +687,8 @@ function photos_content(&$a) {
$usage_message = sprintf( t('You have used %1$.2f Mbytes of photo storage.'), $r[0]['total'] / 1024000 );
}
-
- if($a->get_template_engine() === 'internal') {
- $albumselect_e = template_escape($albumselect);
- $aclselect_e = (($visitor) ? '' : template_escape(populate_acl($a->user, $celeb)));
- }
- else {
- $albumselect_e = $albumselect;
- $aclselect_e = (($visitor) ? '' : populate_acl($a->user, $celeb));
- }
+ $albumselect_e = $albumselect;
+ $aclselect_e = (($visitor) ? '' : populate_acl($a->user, $celeb));
$tpl = get_markup_template('photos_upload.tpl');
$o .= replace_macros($tpl,array(
@@ -718,6 +711,10 @@ function photos_content(&$a) {
return $o;
}
+ /*
+ * Display a single photo album
+ */
+
if($datatype === 'album') {
$album = hex2bin($datum);
@@ -793,6 +790,7 @@ function photos_content(&$a) {
if(count($r))
$twist = 'rotright';
foreach($r as $rr) {
+
if($twist == 'rotright')
$twist = 'rotleft';
else
@@ -839,12 +837,12 @@ function photos_content(&$a) {
}
+ /**
+ * Display one photo
+ */
if($datatype === 'image') {
-
-
- //$o = '';
// fetch image, item containing image, then comments
$ph = q("SELECT * FROM `photo` WHERE `uid` = %d AND `resource_id` = '%s'
@@ -853,13 +851,16 @@ function photos_content(&$a) {
dbesc($datum)
);
- if(! count($ph)) {
+ if(! $ph) {
+
+ /* Check again - this time without specifying permissions */
+
$ph = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource_id` = '%s'
LIMIT 1",
intval($owner_uid),
dbesc($datum)
);
- if(count($ph))
+ if($ph)
notice( t('Permission denied. Access to this item may be restricted.'));
else
notice( t('Photo not available') . EOL );
@@ -893,9 +894,9 @@ function photos_content(&$a) {
break;
}
}
- $edit_suffix = ((($cmd === 'edit') && ($can_post)) ? '/edit' : '');
- $prevlink = $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['resource_id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
- $nextlink = $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['resource_id'] . $edit_suffix . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
+
+ $prevlink = $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $prvnxt[$prv]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
+ $nextlink = $a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $prvnxt[$nxt]['resource_id'] . (($_GET['order'] === 'posted') ? '?f=&order=posted' : '');
}
@@ -918,7 +919,6 @@ function photos_content(&$a) {
if($can_post && ($ph[0]['uid'] == $owner_uid)) {
$tools = array(
- 'edit' => array($a->get_baseurl() . '/photos/' . $a->data['channel']['channel_address'] . '/image/' . $datum . (($cmd === 'edit') ? '' : '/edit'), (($cmd === 'edit') ? t('View photo') : t('Edit photo'))),
'profile'=>array($a->get_baseurl() . '/profile_photo/use/'.$ph[0]['resource_id'], t('Use as profile photo')),
);
@@ -931,7 +931,7 @@ function photos_content(&$a) {
}
- if(! $cmd !== 'edit') {
+ if(! $can_post) {
$a->page['htmlhead'] .= '<script>
$(document).keydown(function(event) {' . "\n";
@@ -990,39 +990,33 @@ function photos_content(&$a) {
}
- $edit = Null;
- if(($cmd === 'edit') && ($can_post)) {
- if($a->get_template_engine() === 'internal') {
- $album_e = template_escape($ph[0]['album']);
- $caption_e = template_escape($ph[0]['desc']);
- $aclselect_e = template_escape(populate_acl($ph[0]));
- }
- else {
- $album_e = $ph[0]['album'];
- $caption_e = $ph[0]['desc'];
- $aclselect_e = populate_acl($ph[0]);
- }
+ $edit = null;
+ if($can_post) {
- $edit_tpl = get_markup_template('photo_edit.tpl');
- $edit = replace_macros($edit_tpl, array(
- '$id' => $ph[0]['id'],
- '$rotatecw' => t('Rotate CW (right)'),
- '$rotateccw' => t('Rotate CCW (left)'),
- '$album' => $album_e,
- '$newalbum' => t('New album name'),
- '$nickname' => $a->data['channel']['channel_address'],
- '$resource_id' => $ph[0]['resource_id'],
- '$capt_label' => t('Caption'),
- '$caption' => $caption_e,
- '$tag_label' => t('Add a Tag'),
- '$tags' => $link_item['tag'],
- '$permissions' => t('Permissions'),
- '$aclselect' => $aclselect_e,
- '$help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping'),
- '$item_id' => ((count($linked_items)) ? $link_item['id'] : 0),
- '$submit' => t('Submit'),
- '$delete' => t('Delete Photo')
- ));
+ $album_e = $ph[0]['album'];
+ $caption_e = $ph[0]['desc'];
+ $aclselect_e = populate_acl($ph[0]);
+
+ $edit = array(
+ 'edit' => t('Edit photo'),
+ 'id' => $ph[0]['id'],
+ 'rotatecw' => t('Rotate CW (right)'),
+ 'rotateccw' => t('Rotate CCW (left)'),
+ 'album' => $album_e,
+ 'newalbum' => t('New album name'),
+ 'nickname' => $a->data['channel']['channel_address'],
+ 'resource_id' => $ph[0]['resource_id'],
+ 'capt_label' => t('Caption'),
+ 'caption' => $caption_e,
+ 'tag_label' => t('Add a Tag'),
+ 'tags' => $link_item['tag'],
+ 'permissions' => t('Permissions'),
+ 'aclselect' => $aclselect_e,
+ 'help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping'),
+ 'item_id' => ((count($linked_items)) ? $link_item['id'] : 0),
+ 'submit' => t('Submit'),
+ 'delete' => t('Delete Photo')
+ );
}
if(count($linked_items)) {
@@ -1154,16 +1148,10 @@ function photos_content(&$a) {
$drop = replace_macros(get_markup_template('photo_drop.tpl'), array('$id' => $item['id'], '$delete' => t('Delete')));
- if($a->get_template_engine() === 'internal') {
- $name_e = template_escape($profile_name);
- $title_e = template_escape($item['title']);
- $body_e = template_escape(bbcode($item['body']));
- }
- else {
- $name_e = $profile_name;
- $title_e = $item['title'];
- $body_e = bbcode($item['body']);
- }
+ $name_e = $profile_name;
+ $title_e = $item['title'];
+ $body_e = bbcode($item['body']);
+
$comments .= replace_macros($template,array(
'$id' => $item['item_id'],
@@ -1184,18 +1172,10 @@ function photos_content(&$a) {
$paginate = paginate($a);
}
- if($a->get_template_engine() === 'internal') {
- $album_e = array($album_link,template_escape($ph[0]['album']));
- $tags_e = template_escape($tags);
- $like_e = template_escape($like);
- $dislike_e = template_escape($dislike);
- }
- else {
- $album_e = array($album_link,$ph[0]['album']);
- $tags_e = $tags;
- $like_e = $like;
- $dislike_e = $dislike;
- }
+ $album_e = array($album_link,$ph[0]['album']);
+ $tags_e = $tags;
+ $like_e = $like;
+ $dislike_e = $dislike;
$photo_tpl = get_markup_template('photo_view.tpl');
$o .= replace_macros($photo_tpl, array(
diff --git a/mod/profile.php b/mod/profile.php
index 2f869a533..d59602ba0 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -10,25 +10,35 @@ function profile_init(&$a) {
return;
}
- $profile = 0;
+ $profile = '';
$channel = $a->get_channel();
if((local_user()) && (argc() > 2) && (argv(2) === 'view')) {
$which = $channel['channel_address'];
$profile = argv(1);
+ $r = q("select profile_guid from profile where id = %d and uid = %d limit 1",
+ intval($profile),
+ intval(local_user())
+ );
+ if(! $r)
+ $profile = '';
+ $profile = $r[0]['profile_guid'];
}
$a->page['htmlhead'] .= '<link rel="alternate" type="application/atom+xml" href="' . $a->get_baseurl() . '/feed/' . $which .'" />' . "\r\n" ;
- $x = q("select channel_id as profile_uid from channel where channel_address = '%s' limit 1",
- dbesc(argv(1))
- );
- if($x) {
- $a->profile = $x[0];
+ if(! $profile) {
+ $x = q("select channel_id as profile_uid from channel where channel_address = '%s' limit 1",
+ dbesc(argv(1))
+ );
+ if($x) {
+ $a->profile = $x[0];
+ }
+ }
// $channel_display = get_pconfig($a->profile['profile_uid'],'system','channel_format');
// if(! $channel_display)
- profile_load($a,$which,$profile);
- }
+ profile_load($a,$which,$profile);
+
}
diff --git a/mod/profiles.php b/mod/profiles.php
index ff6bc8ff6..28d8dd973 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -47,7 +47,7 @@ function profiles_init(&$a) {
if((argc() > 1) && (argv(1) === 'new')) {
- check_form_security_token_redirectOnErr('/profiles', 'profile_new', 't');
+// check_form_security_token_redirectOnErr('/profiles', 'profile_new', 't');
$r0 = q("SELECT `id` FROM `profile` WHERE `uid` = %d",
intval(local_user()));
@@ -519,6 +519,7 @@ function profiles_content(&$a) {
'$profile_drop_link' => 'profiles/drop/' . $r[0]['id'] . '?t='
. get_form_security_token("profile_drop"),
+ '$guid' => $r[0]['profile_guid'],
'$banner' => t('Edit Profile Details'),
'$submit' => t('Submit'),
'$viewprof' => t('View this profile'),
diff --git a/version.inc b/version.inc
index ab6fd81ae..3e4010a3d 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2013-07-01.361
+2013-07-03.363
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index 38eea5b94..b1509c34f 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -3833,3 +3833,51 @@ span.mail-date {
float:left;
width: 200px;
}
+
+
+.tag1 {
+ font-size : 1.0em !important;
+ }
+.tag2 {
+ font-size : 1.2em !important;
+ }
+
+
+.tag3 {
+ font-size : 1.4em !important;
+ }
+
+
+.tag4 {
+ font-size : 1.6em !important;
+ }
+
+
+.tag5 {
+ font-size : 1.8em !important;
+ }
+
+
+.tag6 {
+ font-size : 2.0em !important;
+ }
+
+
+.tag7 {
+ font-size : 2.2em !important;
+ }
+
+
+.tag8 {
+ font-size : 2.4em !important;
+ }
+
+
+.tag9 {
+ font-size : 2.6em !important;
+ }
+
+
+.tag10 {
+ font-size : 2.8em !important;
+ }
diff --git a/view/tpl/abook_edit.tpl b/view/tpl/abook_edit.tpl
index 442692b3d..c373976ab 100755
--- a/view/tpl/abook_edit.tpl
+++ b/view/tpl/abook_edit.tpl
@@ -75,6 +75,15 @@
</div>
+{{if $multiprofs }}
+<div>
+<h3>{{$lbl_vis1}}</h3>
+<div>{{$lbl_vis2}}</div>
+
+{{$profile_select}}
+</div>
+{{/if}}
+
<input class="contact-edit-submit" type="submit" name="done" value="{{$submit}}" />
</form>
diff --git a/view/tpl/photo_edit.tpl b/view/tpl/photo_edit.tpl
deleted file mode 100755
index fefe7f10b..000000000
--- a/view/tpl/photo_edit.tpl
+++ /dev/null
@@ -1,55 +0,0 @@
-{{*
- * AUTOMATICALLY GENERATED TEMPLATE
- * DO NOT EDIT THIS FILE, CHANGES WILL BE OVERWRITTEN
- *
- *}}
-
-<form action="photos/{{$nickname}}/{{$resource_id}}" method="post" id="photo_edit_form" >
-
- <input type="hidden" name="item_id" value="{{$item_id}}" />
-
- <label id="photo-edit-albumname-label" for="photo-edit-albumname">{{$newalbum}}</label>
- <input id="photo-edit-albumname" type="text" size="32" name="albname" value="{{$album}}" />
-
- <div id="photo-edit-albumname-end"></div>
-
- <label id="photo-edit-caption-label" for="photo-edit-caption">{{$capt_label}}</label>
- <input id="photo-edit-caption" type="text" size="84" name="desc" value="{{$caption}}" />
-
- <div id="photo-edit-caption-end"></div>
-
- <label id="photo-edit-tags-label" for="photo-edit-newtag" >{{$tag_label}}</label>
- <input name="newtag" id="photo-edit-newtag" size="84" title="{{$help_tags}}" type="text" />
-
- <div id="photo-edit-tags-end"></div>
- <div id="photo-edit-rotate-wrapper">
- <div id="photo-edit-rotate-label">
- {{$rotatecw}}<br>
- {{$rotateccw}}
- </div>
- <input type="radio" name="rotate" value="1" /><br>
- <input type="radio" name="rotate" value="2" />
- </div>
- <div id="photo-edit-rotate-end"></div>
-
- <div id="photo-edit-perms" class="photo-edit-perms" >
- <a href="#photo-edit-perms-select" id="photo-edit-perms-menu" class="button popupbox" title="{{$permissions}}"/>
- <span id="jot-perms-icon" class="icon {{$lockstate}}" ></span>{{$permissions}}
- </a>
- <div id="photo-edit-perms-menu-end"></div>
-
- <div style="display: none;">
- <div id="photo-edit-perms-select" >
- {{$aclselect}}
- </div>
- </div>
- </div>
- <div id="photo-edit-perms-end"></div>
-
- <input id="photo-edit-submit-button" type="submit" name="submit" value="{{$submit}}" />
- <input id="photo-edit-delete-button" type="submit" name="delete" value="{{$delete}}" onclick="return confirmDelete()"; />
-
- <div id="photo-edit-end"></div>
-</form>
-
-
diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl
index fe090409a..fce6f6fa8 100755
--- a/view/tpl/photo_view.tpl
+++ b/view/tpl/photo_view.tpl
@@ -14,8 +14,6 @@
<div id="photo-edit-link-wrap">
{{if $tools}}
-<a id="photo-edit-link" href="{{$tools.edit.0}}">{{$tools.edit.1}}</a>
-|
<a id="photo-toprofile-link" href="{{$tools.profile.0}}">{{$tools.profile.1}}</a>
{{/if}}
{{if $lock}} | <img src="images/lock_icon.gif" class="lockview" alt="{{$lock}}" onclick="lockview(event,'photo/{{$id}}');" /> {{/if}}
@@ -32,7 +30,58 @@
{{/if}}
{{if $tags.2}}<div id="tag-remove"><a href="{{$tags.2}}">{{$tags.3}}</a></div>{{/if}}
-{{if $edit}}{{$edit}}{{/if}}
+{{if $edit}}
+<div id="photo-edit-edit-wrapper" class="fakelink" onclick="openClose('photo-edit-edit');">{{$edit.edit}}</div>
+<div id="photo-edit-edit" style="display: none;">
+<form action="photos/{{$edit.nickname}}/{{$edit.resource_id}}" method="post" id="photo_edit_form" >
+
+ <input type="hidden" name="item_id" value="{{$item_id}}" />
+
+ <label id="photo-edit-albumname-label" for="photo-edit-albumname">{{$edit.newalbum}}</label>
+ <input id="photo-edit-albumname" type="text" size="32" name="albname" value="{{$edit.album}}" />
+
+ <div id="photo-edit-albumname-end"></div>
+
+ <label id="photo-edit-caption-label" for="photo-edit-caption">{{$edit.capt_label}}</label>
+ <input id="photo-edit-caption" type="text" size="84" name="desc" value="{{$edit.caption}}" />
+
+ <div id="photo-edit-caption-end"></div>
+
+ <label id="photo-edit-tags-label" for="photo-edit-newtag" >{{$edit.tag_label}}</label>
+ <input name="newtag" id="photo-edit-newtag" size="84" title="{{$edit.help_tags}}" type="text" />
+
+ <div id="photo-edit-tags-end"></div>
+ <div id="photo-edit-rotate-wrapper">
+ <div id="photo-edit-rotate-label">
+ {{$edit.rotatecw}}<br>
+ {{$edit.rotateccw}}
+ </div>
+ <input type="radio" name="rotate" value="1" /><br>
+ <input type="radio" name="rotate" value="2" />
+ </div>
+ <div id="photo-edit-rotate-end"></div>
+
+ <div id="photo-edit-perms" class="photo-edit-perms" >
+ <a href="#photo-edit-perms-select" id="photo-edit-perms-menu" class="button popupbox" title="{{$edit.permissions}}"/>
+ <span id="jot-perms-icon" class="icon {{$edit.lockstate}}" ></span>{{$edit.permissions}}
+ </a>
+ <div id="photo-edit-perms-menu-end"></div>
+
+ <div style="display: none;">
+ <div id="photo-edit-perms-select" >
+ {{$edit.aclselect}}
+ </div>
+ </div>
+ </div>
+ <div id="photo-edit-perms-end"></div>
+
+ <input id="photo-edit-submit-button" type="submit" name="submit" value="{{$edit.submit}}" />
+ <input id="photo-edit-delete-button" type="submit" name="delete" value="{{$edit.delete}}" onclick="return confirmDelete()"; />
+
+ <div id="photo-edit-end"></div>
+</form>
+</div>
+{{/if}}
{{if $likebuttons}}
<div id="photo-like-div">
diff --git a/view/tpl/profile_edit.tpl b/view/tpl/profile_edit.tpl
index 864599244..33cc9b75b 100755
--- a/view/tpl/profile_edit.tpl
+++ b/view/tpl/profile_edit.tpl
@@ -10,7 +10,7 @@
<div id="profile-edit-links">
<ul>
<li><a href="profile_photo" id="profile-photo_upload-link" title="{{$profpic}}">{{$profpic}}</a></li>
-<li><a href="profile/{{$profile_id}}/view?tab=profile" id="profile-edit-view-link" title="{{$viewprof}}">{{$viewprof}}</a></li>
+<li><a href="profile/{{$profile_id}}/view" id="profile-edit-view-link" title="{{$viewprof}}">{{$viewprof}}</a></li>
<li><a href="{{$profile_clone_link}}" id="profile-edit-clone-link" title="{{$cr_prof}}">{{$cl_prof}}</a></li>
<li></li>
<li><a href="{{$profile_drop_link}}" id="profile-edit-drop-link" title="{{$del_prof}}" {{$disabled}} >{{$del_prof}}</a></li>