[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.209,1.210 submit.php,1.50,1.51

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
In directory internal.geeklog.net:/tmp/cvs-serv8775/public_html

Modified Files:
	lib-common.php submit.php 
Log Message:
You can now set a default topic for story submissions.


Index: lib-common.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.209
retrieving revision 1.210
diff -C2 -d -r1.209 -r1.210
*** lib-common.php	22 Mar 2003 14:04:53 -0000	1.209
--- lib-common.php	24 Mar 2003 17:42:17 -0000	1.210
***************
*** 786,790 ****
  
      // contribute link
!     $header->set_var( 'menuitem_url', $_CONF['site_url'] . '/submit.php?type=story' );
      $header->set_var( 'menuitem_text', $LANG01[71] );
      $header->parse( 'menu_elements', 'menuitem', true );
--- 786,800 ----
  
      // contribute link
!     if( empty( $topic ))
!     {
!         $contributelink = $_CONF['site_url'] . '/submit.php?type=story';
!         $header->set_var( 'current_topic', '' );
!     }
!     else
!     {
!         $contributelink = $_CONF['site_url'] . '/submit.php?type=story&topic=' . $topic;
!         $header->set_var( 'current_topic', '&topic=' . $topic );
!     }
!     $header->set_var( 'menuitem_url', $contributelink);
      $header->set_var( 'menuitem_text', $LANG01[71] );
      $header->parse( 'menu_elements', 'menuitem', true );

Index: submit.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/submit.php,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** submit.php	19 Mar 2003 16:05:35 -0000	1.50
--- submit.php	24 Mar 2003 17:42:17 -0000	1.51
***************
*** 52,56 ****
  *
  */
! function submissionform($type='story', $mode = '', $month='', $day='', $year='', $hour='') 
  {
      global $_TABLES, $_CONF, $LANG12, $REMOTE_ADDR, $_USER, $HTTP_POST_VARS,
--- 52,56 ----
  *
  */
! function submissionform($type='story', $mode = '', $month='', $day='', $year='', $hour='', $topic = '')
  {
      global $_TABLES, $_CONF, $LANG12, $REMOTE_ADDR, $_USER, $HTTP_POST_VARS,
***************
*** 104,108 ****
                      break;
                  } 
!                 $retval .= submitstory();
                  break;
              }
--- 104,108 ----
                      break;
                  } 
!                 $retval .= submitstory($topic);
                  break;
              }
***************
*** 302,306 ****
  *
  */
! function submitstory() 
  {
      global $_TABLES, $HTTP_POST_VARS, $_CONF, $LANG12, $_USER;
--- 302,306 ----
  *
  */
! function submitstory($topic = '') 
  {
      global $_TABLES, $HTTP_POST_VARS, $_CONF, $LANG12, $_USER;
***************
*** 375,378 ****
--- 375,384 ----
      $storyform->set_var('story_title', htmlspecialchars ($title));	
      $storyform->set_var('lang_topic', $LANG12[28]);
+     if (empty ($A['tid']) && !empty ($topic)) {
+         $A['tid'] = $topic;
+     }
+     if (empty ($A['tid'])) {
+         $A['tid'] = DB_getItem ($_TABLES['topics'], 'tid', 'is_default = 1' . COM_getPermSQL ('AND'));
+     }
      $storyform->set_var('story_topic_options', COM_topicList('tid,topic',$A['tid']));
      $storyform->set_var('lang_story', $LANG12[29]);
***************
*** 760,764 ****
      }
  
!     $display .= submissionform($type, $mode, $month, $day, $year, $hour); 
  
  }
--- 766,770 ----
      }
  
!     $display .= submissionform($type, $mode, $month, $day, $year, $hour, $topic); 
  
  }





More information about the geeklog-cvs mailing list