aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mod/manage.php21
-rw-r--r--view/css/mod_manage.css2
-rw-r--r--view/tpl/channel.tpl8
3 files changed, 18 insertions, 13 deletions
diff --git a/mod/manage.php b/mod/manage.php
index 040857f5e..2cdfce115 100644
--- a/mod/manage.php
+++ b/mod/manage.php
@@ -11,14 +11,17 @@ function manage_content(&$a) {
$change_channel = ((argc() > 1) ? intval(argv(1)) : 0);
- if((argc() > 2) && (argv(2) === 'primary')) {
- q("update channel set channel_primary = 0 where channel_account_id = %d",
- intval(get_account_id())
- );
- q("update channel set channel_primary = 1 where channel_id = %d and channel_account_id = %d limit 1",
+ if((argc() > 2) && (argv(2) === 'default')) {
+ $r = q("select channel_id from channel where channel_id = %d and channel_account_id = %d limit 1",
intval($change_channel),
intval(get_account_id())
);
+ if($r) {
+ q("update account set account_default_channel = %d where account_id = %d limit 1",
+ intval($change_channel),
+ intval(get_account_id())
+ );
+ }
goaway(z_root() . '/manage');
}
@@ -38,6 +41,7 @@ function manage_content(&$a) {
);
$selected_channel = null;
+ $account = get_app()->get_account();
if($r && count($r)) {
$channels = $r;
@@ -45,7 +49,8 @@ function manage_content(&$a) {
$channels[$x]['link'] = 'manage/' . intval($channels[$x]['channel_id']);
if($channels[$x]['channel_id'] == local_user())
$selected_channel = $channels[$x];
- $channels[$x]['primary_links'] = '1';
+ $channels[$x]['default'] = (($channels[$x]['channel_id'] == $account['account_default_channel']) ? "1" : '');
+ $channels[$x]['default_links'] = '1';
}
}
}
@@ -60,8 +65,8 @@ function manage_content(&$a) {
'$msg_selected' => t('Current Channel'),
'$selected' => $selected_channel,
'$desc' => t('Attach to one of your channels by selecting it.'),
- '$msg_primary' => t('Default Channel'),
- '$msg_make_primary' => t('Make Default'),
+ '$msg_default' => t('Default Channel'),
+ '$msg_make_default' => t('Make Default'),
'$links' => $links,
'$all_channels' => $channels,
));
diff --git a/view/css/mod_manage.css b/view/css/mod_manage.css
index 15dd30ec6..51f5062ae 100644
--- a/view/css/mod_manage.css
+++ b/view/css/mod_manage.css
@@ -12,7 +12,7 @@
margin-bottom: 20px;
}
-.channel-selection-primary {
+.channel-selection-default {
font-size: 0.8em;
margin-bottom: 10px;
}
diff --git a/view/tpl/channel.tpl b/view/tpl/channel.tpl
index 5bae5ba33..af4f9b703 100644
--- a/view/tpl/channel.tpl
+++ b/view/tpl/channel.tpl
@@ -1,9 +1,9 @@
<div class="channel-selection">
-{{ if $channel.primary_links }}
-{{ if $channel.channel_primary }}
-<div class="channel-selection-primary primary">$msg_primary</div>
+{{ if $channel.default_links }}
+{{ if $channel.default }}
+<div class="channel-selection-default default">$msg_default</div>
{{ else }}
-<div class="channel-selection-primary"><a href="manage/$channel.channel_id/primary">$msg_make_primary</a></div>
+<div class="channel-selection-default"><a href="manage/$channel.channel_id/default">$msg_make_default</a></div>
{{ endif }}
{{ endif }}
<a href="$channel.link" class="channel-selection-photo-link" title="$channel.channel_name"><img class="channel-photo" src="$channel.xchan_photo_m" alt="$channel.channel_name" /></a>