summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorHash9 <hash9@users.sourceforge.net>2006-07-06 15:08:00 +0000
committerHash9 <hash9@users.sourceforge.net>2006-07-06 15:08:00 +0000
commitd3324323e88f20e4b5a871d25e85752d90f62d0a (patch)
tree7916a6daad1f90352ee139c20d334ea029f37a9f /modules
parentdaa08abd928e93abe4f0cd78c4edc39bd7205e0a (diff)
downloadboards-d3324323e88f20e4b5a871d25e85752d90f62d0a.tar.gz
boards-d3324323e88f20e4b5a871d25e85752d90f62d0a.tar.bz2
boards-d3324323e88f20e4b5a871d25e85752d90f62d0a.zip
add userprefs in modules dir
Diffstat (limited to 'modules')
-rw-r--r--modules/userprefs.php31
-rw-r--r--modules/userprefs.tpl29
2 files changed, 60 insertions, 0 deletions
diff --git a/modules/userprefs.php b/modules/userprefs.php
new file mode 100644
index 0000000..a8617a0
--- /dev/null
+++ b/modules/userprefs.php
@@ -0,0 +1,31 @@
+<?php
+$title ="Boards";
+
+$boardsSettings = array(
+ 'show_avatars' => array(
+ 'pref' => 'boards_show_avatars',
+ 'label' => "Show Avatars",
+ 'type' => "checkbox",
+ 'default'=> 'y',
+ 'note' => "",
+ ),
+ 'signature' => array(
+ 'pref' => 'boards_signature',
+ 'label' => "Board Post Signature",
+ 'type' => "text",
+ 'default'=> '',
+ 'note' => "",
+ ),
+);
+
+foreach( $boardsSettings as $option => $op) {
+ if ($op['type']=="checkbox") {
+ $editUser->storePreference($op['pref'], !empty( $_REQUEST['boards'][$option]) ? 'y' : 'n', 'users');
+ } else {
+ $editUser->storePreference($op['pref'], !empty( $_REQUEST['boards'][$option]) ? $_REQUEST['boards'][$option] : '', 'users');
+ }
+}
+
+$gBitSmarty->assign('boardsSettings',$boardsSettings);
+
+?> \ No newline at end of file
diff --git a/modules/userprefs.tpl b/modules/userprefs.tpl
new file mode 100644
index 0000000..882d9d1
--- /dev/null
+++ b/modules/userprefs.tpl
@@ -0,0 +1,29 @@
+{assign var=package value='boards'}
+{assign var=title value=$package|ucwords}
+{strip}
+{form legend=$title}
+ {foreach from=$boardsSettings key=option item=output}
+ <div class="row">
+ {assign var='pref' value=$output.pref}
+ {if $userPrefs.$pref == null}
+ {assign var='value' value=$output.default}
+ {else}
+ {assign var='value' value=$userPrefs.$pref}
+ {/if}
+ {formlabel label=$output.label for=$option}
+ {forminput}
+ {if $output.type == 'text'}
+ <input type="text" maxlength="250" size="250" name="boards[{$option}]" id="boards[{$option}]" value="{$value|escape}" />
+ {else}
+ {html_checkboxes name="boards[$option]" values="y" checked=$value labels=false id="boards[$option]"}
+ {/if}
+ {formhelp note=`$output.note` page=`$output.page` link=`$output.link`}
+ {/forminput}
+ </div>
+ {/foreach}
+
+ <div class="row submit">
+ <input type="submit" name="boards[submit]" value="{tr}Change preferences{/tr}" />
+ </div>
+{/form}
+{/strip}