[geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.409,1.410 directory.php,1.1,1.2
dhaun at iowaoutdoors.org
dhaun at iowaoutdoors.org
Mon Jan 17 07:42:07 EST 2005
Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv25263/public_html
Modified Files:
lib-common.php directory.php
Log Message:
Hooked the directory script up with the menu bar, moved its text strings to the language files, and added an option to block access for anonymous users.
Index: directory.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/directory.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** directory.php 8 Jan 2005 20:09:20 -0000 1.1
--- directory.php 17 Jan 2005 12:42:05 -0000 1.2
***************
*** 42,52 ****
define ('THIS_SCRIPT', 'directory.php');
! $LANG_DIR = array (
! 'title' => 'Article Directory',
! 'title_year' => 'Article Directory for %d',
! 'title_month_year' => 'Article Directory for %s %d',
! 'nav_top' => 'Back to Article Directory',
! 'no_articles' => 'No articles.',
! );
/**
--- 42,66 ----
define ('THIS_SCRIPT', 'directory.php');
! $display = '';
!
! if (empty ($_USER['username']) && (($_CONF['loginrequired'] == 1) ||
! ($_CONF['directoryloginrequired'] == 1))) {
! $display = COM_siteHeader ('menu', $LANG_DIR['title']);
! $display .= COM_startBlock ($LANG_LOGIN[1], '',
! COM_getBlockTemplate ('_msg_block', 'header'));
! $login = new Template ($_CONF['path_layout'] . 'submit');
! $login->set_file (array ('login' => 'submitloginrequired.thtml'));
! $login->set_var ('site_url', $_CONF['site_url']);
! $login->set_var ('layout_url', $_CONF['layout_url']);
! $login->set_var ('login_message', $LANG_LOGIN[2]);
! $login->set_var ('lang_login', $LANG_LOGIN[3]);
! $login->set_var ('lang_newuser', $LANG_LOGIN[4]);
! $login->parse ('output', 'login');
! $display .= $login->finish ($login->get_var ('output'));
! $display .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer'));
! $display .= COM_siteFooter ();
! echo $display;
! exit;
! }
/**
***************
*** 413,417 ****
$topic = COM_getArgument ('topic');
$year = COM_getArgument ('year');
! $month = COM_getArgument('month');
}
--- 427,431 ----
$topic = COM_getArgument ('topic');
$year = COM_getArgument ('year');
! $month = COM_getArgument ('month');
}
Index: lib-common.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.409
retrieving revision 1.410
diff -C2 -d -r1.409 -r1.410
*** lib-common.php 16 Jan 2005 19:14:28 -0000 1.409
--- lib-common.php 17 Jan 2005 12:42:05 -0000 1.410
***************
*** 506,510 ****
$_CONF['menu_elements'] = array( // default set of links
'contribute', 'links', 'polls', 'calendar', 'search', 'stats',
! 'plugins' );
}
--- 506,510 ----
$_CONF['menu_elements'] = array( // default set of links
'contribute', 'links', 'polls', 'calendar', 'search', 'stats',
! 'directory', 'plugins' );
}
***************
*** 603,606 ****
--- 603,621 ----
break;
+ case 'directory':
+ $url = $_CONF['site_url'] . '/directory.php';
+ if( !empty( $topic ))
+ {
+ $url = COM_buildUrl( $url . '?topic='
+ . urlencode( $topic ));
+ }
+ $label = $LANG01[117];
+ if( $anon && ( $_CONF['loginrequired'] ||
+ $_CONF['directoryloginrequired'] ))
+ {
+ $allowed = false;
+ }
+ break;
+
case 'home':
$url = $_CONF['site_url'] . '/';
***************
*** 719,726 ****
* Programming Note:
*
! * The two functions COM_siteHeader and COM_siteFooter provide the framework for page display
! * in Geeklog. COM_siteHeader controls the display of the Header and left blocks and COM_siteFooter
! * controls the dsiplay of the right blocks and the footer. You use them like a sandwich. Thus the
! * following code will display a Geeklog page with both right and left blocks displayed.
*
* -------------------------------------------------------------------------------------
--- 734,742 ----
* Programming Note:
*
! * The two functions COM_siteHeader and COM_siteFooter provide the framework for
! * page display in Geeklog. COM_siteHeader controls the display of the Header
! * and left blocks and COM_siteFooter controls the dsiplay of the right blocks
! * and the footer. You use them like a sandwich. Thus the following code will
! * display a Geeklog page with both right and left blocks displayed.
*
* -------------------------------------------------------------------------------------
***************
*** 733,738 ****
* ? >
* ---------------------------------------------------------------------------------------
! * Note that the default for the header is to display the left blocks and the default of the
! * footer is to not display the right blocks.
*
* This sandwich produces code like this (greatly simplified)
--- 749,755 ----
* ? >
* ---------------------------------------------------------------------------------------
! *
! * Note that the default for the header is to display the left blocks and the
! * default of the footer is to not display the right blocks.
*
* This sandwich produces code like this (greatly simplified)
***************
*** 751,754 ****
--- 768,772 ----
* @param string $what If 'none' then no left blocks are returned, if 'menu' (default) then right blocks are returned
* @param string $pagetitle optional content for the page's <title>
+ * @param string $headercode optional code to go into the page's <head>
* @return string Formatted HTML containing the site header
* @see function COM_siteFooter
***************
*** 882,885 ****
--- 900,904 ----
$header->set_var( 'button_search', $LANG_BUTTONS[9] );
$header->set_var( 'button_advsearch', $LANG_BUTTONS[10] );
+ $header->set_var( 'button_directory', $LANG_BUTTONS[11] );
// Get plugin menu options
More information about the geeklog-cvs
mailing list