[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.196,1.197 usersettings.php,1.50,1.51
dhaun at geeklog.net
dhaun at geeklog.net
Sat Jan 18 13:07:14 EST 2003
- Previous message (by thread): [geeklog-cvs] geeklog-1.3/public_html/layout/Smooth_Blue/preferences commentblock.thtml,NONE,1.1 displayblock.thtml,1.1,1.2 displayprefs.thtml,1.1,1.2
- Next message (by thread): [geeklog-cvs] geeklog-1.3/public_html/layout/Yahoo/preferences commentblock.thtml,NONE,1.1 displayblock.thtml,1.1,1.2 displayprefs.thtml,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/cvs/geeklog/geeklog-1.3/public_html
In directory internal.geeklog.net:/tmp/cvs-serv5084
Modified Files:
lib-common.php usersettings.php
Log Message:
Merged the Display and Comment Preferences (and moved hard-coded HTML from
Comment Preferences to template files).
Index: lib-common.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.196
retrieving revision 1.197
diff -C2 -d -r1.196 -r1.197
*** lib-common.php 9 Jan 2003 09:41:50 -0000 1.196
--- lib-common.php 18 Jan 2003 18:07:12 -0000 1.197
***************
*** 1956,1964 ****
$retval .= $adminmenu->parse( 'item', 'option' );
- $adminmenu->set_var( 'option_url', $_CONF['site_url'] . '/usersettings.php?mode=comments' );
- $adminmenu->set_var( 'option_label', $LANG01[63] );
- $adminmenu->set_var( 'option_count', '' );
- $retval .= $adminmenu->parse( 'item', 'option' );
-
$adminmenu->set_var( 'option_url', $_CONF['site_url'] . '/users.php?mode=logout' );
$adminmenu->set_var( 'option_label', $LANG01[19] );
--- 1956,1959 ----
Index: usersettings.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/usersettings.php,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** usersettings.php 17 Jan 2003 15:42:57 -0000 1.50
--- usersettings.php 18 Jan 2003 18:07:12 -0000 1.51
***************
*** 190,193 ****
--- 190,194 ----
'digest' => 'digestblock.thtml',
'boxes' => 'boxesblock.thtml',
+ 'comment' => 'commentblock.thtml',
'language' => 'language.thtml',
'theme' => 'theme.thtml'
***************
*** 218,221 ****
--- 219,228 ----
$preferences->set_var ('lang_emailedtopics', $LANG04[76]);
$preferences->set_var ('lang_boxes', $LANG04[55]);
+ $preferences->set_var ('lang_displaymode', $LANG04[57]);
+ $preferences->set_var ('lang_displaymode_text', $LANG04[60]);
+ $preferences->set_var ('lang_sortorder', $LANG04[58]);
+ $preferences->set_var ('lang_sortorder_text', $LANG04[61]);
+ $preferences->set_var ('lang_commentlimit', $LANG04[59]);
+ $preferences->set_var ('lang_commentlimit_text', $LANG04[62]);
$preferences->set_var ('lang_submit', $LANG04[9]);
***************
*** 228,233 ****
--- 235,254 ----
$preferences->set_var ('start_block_boxes',
COM_startBlock ($LANG04[47] . ' ' . $_USER['username']));
+ $preferences->set_var ('start_block_comment',
+ COM_startBlock ($LANG04[64] . ' ' . $_USER['username']));
$preferences->set_var ('end_block', COM_endBlock ());
+ $preferences->set_var ('display_headline',
+ $LANG04[45] . ' ' . $_USER['username'])
+ $preferences->set_var ('exclude_headline',
+ $LANG04[46] . ' ' . $_USER['username'])
+ $preferences->set_var ('digest_headline',
+ $LANG04[75] . ' ' . $_USER['username'])
+ $preferences->set_var ('boxes_headline',
+ $LANG04[47] . ' ' . $_USER['username'])
+ $preferences->set_var ('comment_headline',
+ $LANG04[64] . ' ' . $_USER['username'])
+
+ // display preferences block
if ($_CONF['allow_user_language'] == 1) {
$selection = '<select name="language">' . LB;
***************
*** 318,324 ****
. COM_optionList ($_TABLES['dateformats'], 'dfid,description',
$A['dfid']) . '</select>';
! $preferences->set_var ('dateformat_selection', $selection);
$preferences->parse ('display_block', 'display', true);
$groupList = '';
if (!empty ($_USER['uid'])) {
--- 339,346 ----
. COM_optionList ($_TABLES['dateformats'], 'dfid,description',
$A['dfid']) . '</select>';
! $preferences->set_var ('dateformat_selector', $selection);
$preferences->parse ('display_block', 'display', true);
+ // excluded items block
$groupList = '';
if (!empty ($_USER['uid'])) {
***************
*** 356,359 ****
--- 378,382 ----
$preferences->parse ('exclude_block', 'exclude', true);
+ // daily digest block
if ($_CONF['emailstories'] == 1) {
$user_etids = DB_getItem ($_TABLES['userindex'], 'etids',
***************
*** 373,376 ****
--- 396,400 ----
}
+ // boxes block
$selectedblock = '';
if (strlen($A['boxes']) > 0) {
***************
*** 389,433 ****
$preferences->parse ('boxes_block', 'boxes', true);
! return $preferences->finish ($preferences->parse ('output', 'prefs'));
! }
! /**
! * Shows comment preferences form
! *
! */
! function editcommentprefs()
! {
! global $_TABLES, $_CONF, $LANG04, $_USER;
! $retval = '';
! $result = DB_query("SELECT commentmode,commentorder,commentlimit FROM {$_TABLES['usercomment']} WHERE uid = {$_USER['uid']}");
! $A = DB_fetchArray($result);
! if (empty($A["commentmode"])) {
! $A["commentmode"] = $_CONF['comment_mode'];
! }
! if (empty($A["commentorder"])) $A["commentorder"] = 0;
! if (empty($A["commentlimit"])) $A["commentlimit"] = 100;
! $retval .= COM_startBlock($LANG04[64] . ' ' . $_USER['username']);
! $retval .= '<form action="' . $_CONF['site_url'] . '/usersettings.php" method="post">' . LB;
! $retval .= '<table border="0" cellspacing="0" cellpadding=3>' . LB;
! $retval .= '<tr valign="top"><td align="right"><b>' . $LANG04[57] . ':</b><br><small>' . $LANG04[60]
! . '</small></td><td><select name="commentmode">';
! $retval .= COM_optionList($_TABLES['commentmodes'],'mode,name',$A['commentmode']);
! $retval .= '</select></td></tr>';
! $retval .= '<tr valign="top"><td align="right"><b>' . $LANG04[58] . ':</b><br><small>' . $LANG04[61]
! . '</small></td><td><select name="commentorder">';
! $retval .= COM_optionList($_TABLES['sortcodes'],'code,name',$A['commentorder']);
! $retval .= '</select></td></tr>';
! $retval .= '<tr valign="top"><td align="right"><b>' . $LANG04[59] . ':</b><br><small>'
! . $LANG04[62] . '</small></td><td>';
! $retval .= '<input type="text" size="5" maxlength="5" name="commentlimit" value="' . $A['commentlimit']
! . '"></td></tr>' . LB;
! $retval .= '<tr><td align="right" colspan="2"><input type="hidden" name="mode" value="savecomments">';
! $retval .= '<input type="submit" value="' . $LANG04[9] . '"></td></tr>' . LB;
! $retval .= '</table></form>';
! $retval .= COM_endBlock();
! return $retval;
}
--- 413,439 ----
$preferences->parse ('boxes_block', 'boxes', true);
! // comment preferences block
! $result = DB_query("SELECT commentmode,commentorder,commentlimit FROM {$_TABLES['usercomment']} WHERE uid = {$_USER['uid']}");
! $A = DB_fetchArray ($result);
! if (empty ($A['commentmode'])) {
! $A['commentmode'] = $_CONF['comment_mode'];
! }
! if (empty ($A['commentorder'])) $A['commentorder'] = 0;
! if (empty ($A['commentlimit'])) $A['commentlimit'] = 100;
! $selection = '<select name="commentmode">';
! $selection .= COM_optionList ($_TABLES['commentmodes'], 'mode,name',
! $A['commentmode']);
! $preferences->set_var ('displaymode_selector', $selection);
! $selection = '<select name="commentorder">';
! $selection .= COM_optionList ($_TABLES['sortcodes'], 'code,name',
! $A['commentorder']);
! $preferences->set_var ('sortorder_selector', $selection);
! $preferences->set_var ('commentlimit_value', $A['commentlimit']);
! $preferences->parse ('comment_block', 'comment', true);
! return $preferences->finish ($preferences->parse ('output', 'prefs'));
}
***************
*** 579,585 ****
if ($A["willing"] == 'on') $A["willing"] = 1;
if ($A['noboxes'] == 'on') $A['noboxes'] = 1;
! /*echo 'user max = ' . $A['maxstories'] . '<br>';
! echo 'conf min = ' . $_CONF['minnews'] . '<br>';
! exit;*/
if ($A['maxstories'] < $_CONF['minnews']) {
$A['maxstories'] = $_CONF['minnews'];
--- 585,589 ----
if ($A["willing"] == 'on') $A["willing"] = 1;
if ($A['noboxes'] == 'on') $A['noboxes'] = 1;
!
if ($A['maxstories'] < $_CONF['minnews']) {
$A['maxstories'] = $_CONF['minnews'];
***************
*** 595,599 ****
$BOXES = @array_values($A["{$_TABLES['blocks']}"]);
$ETIDS = @array_values($A['etids']);
!
if (sizeof($TIDS) > 0) {
for ($i = 0; $i < sizeof($TIDS); $i++) {
--- 599,603 ----
$BOXES = @array_values($A["{$_TABLES['blocks']}"]);
$ETIDS = @array_values($A['etids']);
!
if (sizeof($TIDS) > 0) {
for ($i = 0; $i < sizeof($TIDS); $i++) {
***************
*** 632,636 ****
}
}
!
// Save theme, when doing so, put in cookie so we can set the user's theme even when they aren't logged in
DB_query("UPDATE {$_TABLES['users']} SET theme='{$A["theme"]}',language='{$A["language"]}' WHERE uid = {$_USER['uid']}");
--- 636,640 ----
}
}
!
// Save theme, when doing so, put in cookie so we can set the user's theme even when they aren't logged in
DB_query("UPDATE {$_TABLES['users']} SET theme='{$A["theme"]}',language='{$A["language"]}' WHERE uid = {$_USER['uid']}");
***************
*** 643,648 ****
$etids = '-';
}
! DB_save($_TABLES['userindex'],"uid,tids,aids,boxes,noboxes,maxstories,etids","'{$_USER['uid']}','$tids','$aids','$selectedblocks','{$A['noboxes']}',{$A['maxstories']},'$etids'",$_CONF['site_url'] . "/usersettings.php?mode=preferences&msg=6");
}
--- 647,653 ----
$etids = '-';
}
! DB_save($_TABLES['userindex'],"uid,tids,aids,boxes,noboxes,maxstories,etids","'{$_USER['uid']}','$tids','$aids','$selectedblocks','{$A['noboxes']}',{$A['maxstories']},'$etids'");
+ DB_save($_TABLES['usercomment'],'uid,commentmode,commentorder,commentlimit',"'{$_USER['uid']}','{$A['commentmode']}','{$A['commentorder']}','{$A['commentlimit']}'");
}
***************
*** 659,671 ****
switch ($mode) {
case 'preferences':
- $display .= COM_siteHeader('menu');
- $display .= COM_showMessage($HTTP_GET_VARS['msg']);
- $display .= editpreferences();
- $display .= COM_siteFooter();
- break;
case 'comments':
$display .= COM_siteHeader('menu');
$display .= COM_showMessage($HTTP_GET_VARS['msg']);
! $display .= editcommentprefs();
$display .= COM_siteFooter();
break;
--- 664,671 ----
switch ($mode) {
case 'preferences':
case 'comments':
$display .= COM_siteHeader('menu');
$display .= COM_showMessage($HTTP_GET_VARS['msg']);
! $display .= editpreferences();
$display .= COM_siteFooter();
break;
***************
*** 680,687 ****
break;
case 'savepreferences':
! savepreferences($HTTP_POST_VARS);
! break;
! case 'savecomments':
! DB_save($_TABLES['usercomment'],'uid,commentmode,commentorder,commentlimit',"'{$_USER['uid']}','{$HTTP_POST_VARS['commentmode']}','{$HTTP_POST_VARS['commentorder']}','{$HTTP_POST_VARS['commentlimit']}'",$_CONF['site_url'] . "/usersettings.php?mode=comments&msg=7");
break;
}
--- 680,686 ----
break;
case 'savepreferences':
! savepreferences ($HTTP_POST_VARS);
! $display .= COM_refresh ($_CONF['site_url']
! . '/usersettings.php?mode=preferences&msg=6');
break;
}
***************
*** 692,696 ****
$display .= '<br>' . $LANG04[71] . '<br><br>';
$display .= COM_endBlock();
! $display .= COM_siteFooter();
} else {
$display .= COM_refresh($_CONF['site_url'] . '/index.php');
--- 691,695 ----
$display .= '<br>' . $LANG04[71] . '<br><br>';
$display .= COM_endBlock();
! $display .= COM_siteFooter();
} else {
$display .= COM_refresh($_CONF['site_url'] . '/index.php');
- Previous message (by thread): [geeklog-cvs] geeklog-1.3/public_html/layout/Smooth_Blue/preferences commentblock.thtml,NONE,1.1 displayblock.thtml,1.1,1.2 displayprefs.thtml,1.1,1.2
- Next message (by thread): [geeklog-cvs] geeklog-1.3/public_html/layout/Yahoo/preferences commentblock.thtml,NONE,1.1 displayblock.thtml,1.1,1.2 displayprefs.thtml,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the geeklog-cvs
mailing list