allow turning off forumlist on network page

pull/78/head
friendica 2012-10-05 02:09:01 -07:00
parent afa8321d2a
commit 0a9167c33c
3 changed files with 13 additions and 2 deletions

Binary file not shown.

View File

@ -10,13 +10,13 @@
}
#forumlist-settings-label, #forumlist-random-label, #forumlist-profile-label {
#forumlist-settings-label, #forumlist-random-label, #forumlist-profile-label, #forumlist-network-label {
float: left;
width: 200px;
margin-bottom: 25px;
}
#forumlist-max-forumlists, #forumlist-random, #forumlist-profile {
#forumlist-max-forumlists, #forumlist-random, #forumlist-profile, #forumlist-network {
float: left;
}

View File

@ -49,6 +49,10 @@ function forumlist_getpage($uid,$showhidden = true,$randomise = false) {
}
function forumlist_network_mod_init($a,$b) {
if(! intval(get_pconfig(local_user(),'forumlist','show_on_network')))
return;
$a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/forumlist/forumlist.css' . '" media="all" />' . "\r\n";
$forumlist = '<div id="forumlist-sidebar" class="widget">
@ -122,6 +126,7 @@ function forumlist_plugin_settings_post($a,$post) {
// set_pconfig(local_user(),'forumlist','max_forumlists',intval($_POST['forumlist_max_forumlists']));
set_pconfig(local_user(),'forumlist','randomise',intval($_POST['forumlist_random']));
set_pconfig(local_user(),'forumlist','show_on_profile',intval($_POST['forumlist_profile']));
set_pconfig(local_user(),'forumlist','show_on_network',intval($_POST['forumlist_network']));
info( t('Forumlist settings updated.') . EOL);
}
@ -144,6 +149,9 @@ function forumlist_plugin_settings(&$a,&$s) {
$profile = intval(get_pconfig(local_user(),'forumlist','show_on_profile'));
$profile_checked = (($profile) ? ' checked="checked" ' : '');
$network = intval(get_pconfig(local_user(),'forumlist','show_on_network'));
$network_checked = (($network) ? ' checked="checked" ' : '');
/* Add some HTML to the existing form */
@ -156,6 +164,9 @@ function forumlist_plugin_settings(&$a,&$s) {
$s .= '<label id="forumlist-profile-label" for="forumlist-profile">' . t('Show forums on profile page') . '</label>';
$s .= '<input id="forumlist-profile" type="checkbox" name="forumlist_profile" value="1" ' . $profile_checked . '/>';
$s .= '<div class="clear"></div>';
$s .= '<label id="forumlist-network-label" for="forumlist-network">' . t('Show forums on network page') . '</label>';
$s .= '<input id="forumlist-network" type="checkbox" name="forumlist_network" value="1" ' . $network_checked . '/>';
$s .= '<div class="clear"></div>';
$s .= '</div>';