[geeklog-cvs] geeklog-1.3/public_html/admin story.php,1.82,1.83 topic.php,1.32,1.33
dhaun at geeklog.net
dhaun at geeklog.net
Mon Mar 24 12:42:19 EST 2003
Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin
In directory internal.geeklog.net:/tmp/cvs-serv8775/public_html/admin
Modified Files:
story.php topic.php
Log Message:
You can now set a default topic for story submissions.
Index: story.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/story.php,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -d -r1.82 -r1.83
*** story.php 19 Mar 2003 17:14:52 -0000 1.82
--- story.php 24 Mar 2003 17:42:17 -0000 1.83
***************
*** 293,297 ****
$story_templates->set_var('story_title', stripslashes($A['title']));
$story_templates->set_var('lang_topic', $LANG24[14]);
! $story_templates->set_var('topic_options', COM_topicList('tid,topic',$A['tid']));
$story_templates->set_var('lang_show_topic_icon', $LANG24[56]);
if ($A['show_topic_icon'] == 1) {
--- 293,300 ----
$story_templates->set_var('story_title', stripslashes($A['title']));
$story_templates->set_var('lang_topic', $LANG24[14]);
! if (empty ($A['tid'])) {
! $A['tid'] = DB_getItem ($_TABLES['topics'], 'tid', 'is_default = 1' . COM_getPermSQL ('AND'));
! }
! $story_templates->set_var ('topic_options', COM_topicList ('tid,topic', $A['tid']));
$story_templates->set_var('lang_show_topic_icon', $LANG24[56]);
if ($A['show_topic_icon'] == 1) {
Index: topic.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/topic.php,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** topic.php 2 Feb 2003 19:46:47 -0000 1.32
--- topic.php 24 Mar 2003 17:42:17 -0000 1.33
***************
*** 9,17 ****
// | |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2000,2001 by the following authors: |
// | |
! // | Authors: Tony Bibbs - tony at tonybibbs.com |
! // | Mark Limburg - mlimburg at users.sourceforge.net |
! // | Jason Wittenburg - jwhitten at securitygeeks.com |
// +---------------------------------------------------------------------------+
// | |
--- 9,18 ----
// | |
// +---------------------------------------------------------------------------+
! // | Copyright (C) 2000-2003 by the following authors: |
// | |
! // | Authors: Tony Bibbs - tony at tonybibbs.com |
! // | Mark Limburg - mlimburg at users.sourceforge.net |
! // | Jason Whittenburg - jwhitten at securitygeeks.com |
! // | Dirk Haun - dirk at haun-online.de |
// +---------------------------------------------------------------------------+
// | |
***************
*** 151,154 ****
--- 152,164 ----
$topic_templates->set_var('image_url', $A['imageurl']);
$topic_templates->set_var('warning_msg', $LANG27[6]);
+
+ $topic_templates->set_var ('lang_defaulttopic', $LANG27[22]);
+ $topic_templates->set_var ('lang_defaulttext', $LANG27[23]);
+ if ($A['is_default'] == 1) {
+ $topic_templates->set_var ('default_checked', 'checked="checked"');
+ } else {
+ $topic_templates->set_var ('default_checked', '');
+ }
+
$topic_templates->parse('output', 'editor');
$retval .= $topic_templates->finish($topic_templates->get_var('output'));
***************
*** 159,163 ****
###############################################################################
# Saves $tid to the database
! function savetopic($tid,$topic,$imageurl,$sortnum,$limitnews,$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon)
{
global $_TABLES, $_CONF, $LANG27, $MESSAGE;
--- 169,173 ----
###############################################################################
# Saves $tid to the database
! function savetopic($tid,$topic,$imageurl,$sortnum,$limitnews,$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon,$is_default)
{
global $_TABLES, $_CONF, $LANG27, $MESSAGE;
***************
*** 191,195 ****
}
$topic = addslashes ($topic);
! DB_save($_TABLES['topics'],'tid, topic, imageurl, sortnum, limitnews, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon',"'$tid', '$topic', '$imageurl','$sortnum','$limitnews',$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon",$_CONF['site_admin_url'] . "/topic.php?msg=13");
} else {
$retval .= COM_siteHeader('menu');
--- 201,213 ----
}
$topic = addslashes ($topic);
!
! if ($is_default == 'on') {
! $is_default = 1;
! DB_query ("UPDATE {$_TABLES['topics']} SET is_default = 0 WHERE is_default = 1");
! } else {
! $is_default = 0;
! }
!
! DB_save($_TABLES['topics'],'tid, topic, imageurl, sortnum, limitnews, is_default, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon',"'$tid', '$topic', '$imageurl','$sortnum','$limitnews',$is_default,$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon",$_CONF['site_admin_url'] . "/topic.php?msg=13");
} else {
$retval .= COM_siteHeader('menu');
***************
*** 239,242 ****
--- 257,265 ----
$topic_templates->set_var('topic_name', stripslashes ($A['topic']));
$topic_templates->set_var('topic_access', $access);
+ if ($A['is_default'] == 1) {
+ $topic_templates->set_var ('default_topic', '(*)');
+ } else {
+ $topic_templates->set_var ('default_topic', '');
+ }
if (!empty($A["imageurl"])) {
if (isset ($_THEME_URL)) {
***************
*** 286,290 ****
} else if (($mode == $LANG27[19]) && !empty ($LANG27[19])) { // save
savetopic($tid,$topic,$imageurl,$sortnum,$limitnews,$owner_id,$group_id,
! $perm_owner,$perm_group,$perm_members,$perm_anon);
} else if ($mode == 'edit') {
$display .= COM_siteHeader('menu');
--- 309,313 ----
} else if (($mode == $LANG27[19]) && !empty ($LANG27[19])) { // save
savetopic($tid,$topic,$imageurl,$sortnum,$limitnews,$owner_id,$group_id,
! $perm_owner,$perm_group,$perm_members,$perm_anon,$is_default);
} else if ($mode == 'edit') {
$display .= COM_siteHeader('menu');
More information about the geeklog-cvs
mailing list