From dhaun at geeklog.net Sat Mar 1 11:40:28 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Sat, 1 Mar 2003 10:40:28 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.203,1.204 search.php,1.49,1.50 Message-ID: <200303011640.h21GeSi25055@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html In directory internal.geeklog.net:/tmp/cvs-serv25007 Modified Files: lib-common.php search.php Log Message: Fixed incorrect error message when following the "more by ..." links from article.php and search was blocked for anonymous users. Also changed COM_whatsRelated to not display those links in this case (bug #671000). Index: lib-common.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/lib-common.php,v retrieving revision 1.203 retrieving revision 1.204 diff -C2 -d -r1.203 -r1.204 *** lib-common.php 24 Feb 2003 15:40:06 -0000 1.203 --- lib-common.php 1 Mar 2003 16:40:25 -0000 1.204 *************** *** 4650,4665 **** $rel = COM_extractLinks( $fulltext ); ! // add a link to "search by author" ! if( $_CONF["contributedbyline"] == 1 ) { ! $author = DB_getItem( $_TABLES['users'], 'username', "uid = $uid" ); ! $rel[] = "{$LANG24[37]} $author"; ! } ! // add a link to "search by topic" ! $topic = DB_getItem( $_TABLES['topics'], 'topic', "tid = '$tid'" ); ! $rel[] = "{$LANG24[38]} $topic"; ! $related = COM_checkHTML( COM_checkWords( COM_makeList( $rel ))); return( $related ); --- 4650,4672 ---- $rel = COM_extractLinks( $fulltext ); ! if( !empty( $_USER['username'] ) || (( $_CONF['loginrequired'] == 0 ) && ! ( $_CONF['searchloginrequired'] == 0 ))) { ! // add a link to "search by author" ! if( $_CONF["contributedbyline"] == 1 ) { ! $author = DB_getItem( $_TABLES['users'], 'username', "uid = $uid" ); ! $rel[] = "{$LANG24[37]} $author"; ! } ! // add a link to "search by topic" ! $topic = DB_getItem( $_TABLES['topics'], 'topic', "tid = '$tid'" ); ! $rel[] = "{$LANG24[38]} $topic"; ! } ! $related = ''; ! if( sizeof( $rel ) > 0 ) ! { ! $related = COM_checkHTML( COM_checkWords( COM_makeList( $rel ))); ! } return( $related ); Index: search.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/search.php,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** search.php 9 Feb 2003 21:27:01 -0000 1.49 --- search.php 1 Mar 2003 16:40:25 -0000 1.50 *************** *** 1100,1113 **** $query = strip_tags ($query); ! if (!advsearchAllowed ($query)) { ! // if advanced search is not allowed for the current user ! // then just ignore the advanced options ! $type = 'all'; ! unset ($datestart); ! unset ($dateend); ! unset ($author); ! unset ($topic); } ! // check for minimal length of the query if ((strlen ($query) < 3) && (empty ($topic) || ($topic == '0')) && --- 1100,1112 ---- $query = strip_tags ($query); ! // check for an advanced search ! if (!advsearchAllowed ($query) && (($type != 'all') || ! (isset ($datestart) && !empty ($datestart)) || ! (isset ($dateend) && !empty ($dateend)) || ! (isset ($author) && ($author > 0)) || ! (isset ($topic) && !empty ($topic)))) { ! $display .= loginRequired (); } ! else // check for minimal length of the query if ((strlen ($query) < 3) && (empty ($topic) || ($topic == '0')) && From dhaun at geeklog.net Wed Mar 5 09:24:51 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Wed, 5 Mar 2003 08:24:51 -0600 Subject: [geeklog-cvs] geeklog-1.3/language slovenian.php,NONE,1.1 Message-ID: <200303051424.h25EOpi21301@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/language In directory internal.geeklog.net:/tmp/cvs-serv21285 Added Files: slovenian.php Log Message: Slovenian language file, provided by gape --- NEW FILE: slovenian.php --- "Statistika strani", 8 => "Osebne nastavitve", 9 => "I??i", 10 => "Napredno iskanje" ); $LANG_404 = array( 1 => "404 Error", 2 => "Gee, I've looked everywhere but I can not find http://{$HTTP_SERVER_VARS["HTTP_HOST"]}{$HTTP_SERVER_VARS["REQUEST_URI"]}.", 3 => "

We're sorry, but the file you have requested does not exist. Please feel free to check the main page or the search page to see if you can find what you lost." ); $LANG_LOGIN = array ( 1 => 'Login required', 2 => 'Sorry, to access this area you need to be logged in as a user.', 3 => 'Login', 4 => 'New User' ); ?> From dhaun at geeklog.net Wed Mar 5 09:25:52 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Wed, 5 Mar 2003 08:25:52 -0600 Subject: [geeklog-cvs] geeklog-1.3/language slovak.php,NONE,1.1 Message-ID: <200303051425.h25EPqi21356@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/language In directory internal.geeklog.net:/tmp/cvs-serv21337 Added Files: slovak.php Log Message: Slovak language file, provided by Rado --- NEW FILE: slovak.php --- "?tatistiky sajty", 8 => "Prisp?sobenie", 9 => "H?adaj", 10 => "Fajnov? vyh?ad?vanie" ); $LANG_404 = array( 1 => "404 Error", 2 => "Gee, I've looked everywhere but I can not find http://{$HTTP_SERVER_VARS["HTTP_HOST"]}{$HTTP_SERVER_VARS["REQUEST_URI"]}.", 3 => "

We're sorry, but the file you have requested does not exist. Please feel free to check the main page or the search page to see if you can find what you lost." ); $LANG_LOGIN = array ( 1 => 'Login required', 2 => 'Sorry, to access this area you need to be logged in as a user.', 3 => 'Login', 4 => 'New User' ); ?> From dhaun at geeklog.net Wed Mar 5 09:26:55 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Wed, 5 Mar 2003 08:26:55 -0600 Subject: [geeklog-cvs] geeklog-1.3/language romanian.php,NONE,1.1 Message-ID: <200303051426.h25EQti21411@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/language In directory internal.geeklog.net:/tmp/cvs-serv21384 Added Files: romanian.php Log Message: Romanian language file, provided by Dan Gheorghitza --- NEW FILE: romanian.php --- "Statistici", 8 => "Personalizeaza", 9 => "Cauta", 10 => "cautare avansata" ); $LANG_404 = array( 1 => "Eroare 404", 2 => "Oh, nu! Ne-am uitat peste tot, dar n-am gasit http://{$HTTP_SERVER_VARS["HTTP_HOST"]}{$HTTP_SERVER_VARS["REQUEST_URI"]}.", 3 => "

Ne pare rau, dar pagina care o cautati nu exista. Va rugam, verificati pagina principala sau pagina de cautare sa vedeti daca gasiti ceea ce cautati." ); $LANG_LOGIN = array ( 1 => 'Inregistrare necesara', 2 => 'Ne pare rau, pentru a avea acces la aceasta zona trebuie sa fiti membru/utilizator inregistrat.', 3 => 'Inregistrare', 4 => 'Membru Nou' ); ?> From dhaun at geeklog.net Wed Mar 5 09:34:46 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Wed, 5 Mar 2003 08:34:46 -0600 Subject: [geeklog-cvs] geeklog-1.3/system lib-security.php,1.11,1.12 Message-ID: <200303051434.h25EYki21633@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/system In directory internal.geeklog.net:/tmp/cvs-serv21595 Modified Files: lib-security.php Log Message: Integrated Vincent Furia's improvements to SEC_getUserGroups() and SEC_getUserRights(). Index: lib-security.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/system/lib-security.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** lib-security.php 26 Oct 2002 18:28:09 -0000 1.11 --- lib-security.php 5 Mar 2003 14:34:44 -0000 1.12 *************** *** 9,16 **** // | | // +---------------------------------------------------------------------------+ ! // | Copyright (C) 2000,2001 by the following authors: | // | | // | Authors: Tony Bibbs - tony at tonybibbs.com | // | Mark Limburg - mlimburg at users.sourceforge.net | // +---------------------------------------------------------------------------+ // | | --- 9,17 ---- // | | // +---------------------------------------------------------------------------+ ! // | Copyright (C) 2000-2003 by the following authors: | // | | // | Authors: Tony Bibbs - tony at tonybibbs.com | // | Mark Limburg - mlimburg at users.sourceforge.net | + // | Vincent Furia - vmf at abtech.org | // +---------------------------------------------------------------------------+ // | | *************** *** 76,95 **** * * @param int $uid User ID to get information for. If empty current user. - * @param string $usergroups DO NOT USE (for recursion) comma delimited string of groups user belongs to - * @param int $cur_grp_id DO NOT USE (for recursion) Current group the function is working with in tree * @return array Associative Array grp_name -> ug_main_grp_id * */ ! function SEC_getUserGroups($uid='',$usergroups='',$cur_grp_id='') { global $_TABLES, $_USER, $_SEC_VERBOSE; - if (empty($usergroups)) { - $usergroups = array(); - } - if ($_SEC_VERBOSE) { COM_errorLog("****************in getusergroups(uid=$uid,usergroups=$usergroups,cur_grp_id=$cur_grp_id)***************",1); } if (empty($uid)) { --- 77,92 ---- * * @param int $uid User ID to get information for. If empty current user. * @return array Associative Array grp_name -> ug_main_grp_id * */ ! function SEC_getUserGroups($uid='') { global $_TABLES, $_USER, $_SEC_VERBOSE; if ($_SEC_VERBOSE) { COM_errorLog("****************in getusergroups(uid=$uid,usergroups=$usergroups,cur_grp_id=$cur_grp_id)***************",1); } + + $groups = array(); if (empty($uid)) { *************** *** 101,114 **** } ! if (empty($cur_grp_id)) { ! $result = DB_query("SELECT ug_main_grp_id,grp_name FROM {$_TABLES["group_assignments"]},{$_TABLES["groups"]}" . " WHERE grp_id = ug_main_grp_id AND ug_uid = $uid",1); - } else { - $result = DB_query("SELECT ug_main_grp_id,grp_name FROM {$_TABLES["group_assignments"]},{$_TABLES["groups"]}" - . " WHERE grp_id = ug_main_grp_id AND ug_grp_id = $cur_grp_id",1); - } if ($result == -1) { ! return $usergroups; } --- 98,106 ---- } ! $result = DB_query("SELECT ug_main_grp_id,grp_name FROM {$_TABLES["group_assignments"]},{$_TABLES["groups"]}" . " WHERE grp_id = ug_main_grp_id AND ug_uid = $uid",1); if ($result == -1) { ! return $groups; } *************** *** 119,135 **** } ! for ($i = 1; $i <= $nrows; $i++) { ! $A = DB_fetchArray($result); ! if ($_SEC_VERBOSE) { ! COM_errorLog('user is in group ' . $A['grp_name'],1); } ! $usergroups[$A['grp_name']] = $A['ug_main_grp_id']; ! $usergroups = SEC_getUserGroups($uid,$usergroups,$A['ug_main_grp_id']); } ! if (is_array($usergroups)) { ! ksort($usergroups); ! } if ($_SEC_VERBOSE) { --- 111,136 ---- } ! while ($nrows > 0) { ! $cgroups = array(); ! for ($i = 1; $i <= $nrows; $i++) { ! $A = DB_fetchArray($result); ! ! if ($_SEC_VERBOSE) { ! COM_errorLog('user is in group ' . $A['grp_name'],1); ! } ! if (!in_array($A['ug_main_grp_id'], $groups)) { ! array_push($cgroups, $A['ug_main_grp_id']); ! } ! $groups[$A['grp_name']] = $A['ug_main_grp_id']; } ! ! $glist = join(',', $cgroups); ! $result = DB_query("SELECT ug_main_grp_id,grp_name FROM {$_TABLES["group_assignments"]},{$_TABLES["groups"]}" ! . " WHERE grp_id = ug_main_grp_id AND ug_grp_id IN ($glist)",1); ! $nrows = DB_numRows($result); } ! ksort($groups); if ($_SEC_VERBOSE) { *************** *** 137,141 **** } ! return $usergroups; } --- 138,142 ---- } ! return $groups; } *************** *** 436,439 **** --- 437,444 ---- global $_TABLES, $_USER, $_SEC_VERBOSE; + if ($_SEC_VERBOSE) { + COM_errorLog("**********inside SEC_getUserPermissions(grp_id=$grp_id)**********",1); + } + // Get user ID if we don't already have it if (empty($uid)) { *************** *** 445,507 **** } ! if ($_SEC_VERBOSE) { ! COM_errorLog("**********inside SEC_getUserPermissions(grp_id=$grp_id)**********",1); ! } ! ! if (empty($grp_id)) { ! // Okay, this was the first time this function SEC_was called. ! // Let's get all the groups this user belongs to and get the permissions for each group. ! // NOTE: permissions are given to groups and NOT individuals ! ! // print "
uid = " . $_USER[uid]; ! ! $result = DB_query("SELECT ug_main_grp_id FROM {$_TABLES["group_assignments"]} WHERE ug_uid = $uid",1); ! if ($result <> -1) { ! $nrows = DB_numRows($result); ! if ($_SEC_VERBOSE) { ! COM_errorLog("got $nrows row(s) in SEC_getUserPermissions",1); ! } ! for ($i = 1; $i <= $nrows; $i++) { ! $A = DB_fetchArray($result); ! $retval .= SEC_getUserPermissions($A['ug_main_grp_id'],$uid); ! } } } else { ! // In this case we are going up the group tree for this user building a list of rights ! // along the way. First, get the rights for this group. ! ! $result = DB_query("SELECT ft_name FROM {$_TABLES["access"]},{$_TABLES["features"]} WHERE " ! . "ft_id = acc_ft_id AND acc_grp_id = $grp_id",1); ! $nrows = DB_numRows($result); ! ! if ($_SEC_VERBOSE) COM_errorLog("got $nrows rights for group $grp_id in SEC_getUserPermissions",1); ! ! for ($j = 1; $j <= $nrows; $j++) { ! $A = DB_fetchArray($result); ! if ($_SEC_VERBOSE) { ! COM_errorLog('Adding right ' . $A['ft_name'] . ' in SEC_getUserPermissions',1); ! } ! $retval .= $A['ft_name'] . ','; ! } ! // Now see if there are any groups tied to this one further up the tree. If so ! // see if they have additional rights ! $result = DB_query("SELECT ug_main_grp_id FROM {$_TABLES["group_assignments"]} WHERE ug_grp_id = $grp_id",1); ! $nrows = DB_numRows($result); if ($_SEC_VERBOSE) { ! COM_errorLog("got $nrows groups tied to group $grp_id in SEC_getUserPermissions",1); ! } ! for ($i = 1; $i <= $nrows; $i++) { ! // Now for each group, see if there are any rights assigned to it. If so, add to our ! // comma delimited string ! ! $A = DB_fetchArray($result); ! $retval .= SEC_getUserPermissions($A['ug_main_grp_id'],$uid); } } ! if ($_SEC_VERBOSE) { ! COM_errorLog("**********leaving SEC_getUserPermissions(grp_id=$grp_id)**********",1); ! } return $retval; } --- 450,475 ---- } ! if ($uid == $_USER['uid']) { ! if (!isset($_GROUPS)) { ! $_GROUPS = SEC_getUserGroups($uid); } + $groups = $_GROUPS; } else { ! $groups = SEC_getUserGroups($uid); ! } ! $glist = join(',', $groups); ! $result = DB_query("SELECT DISTINCT ft_name FROM {$_TABLES["access"]},{$_TABLES["features"]} " ! . "WHERE ft_id = acc_ft_id AND acc_grp_id IN ($glist)"); ! $nrows = DB_numrows($result); ! for ($j = 1; $j <= $nrows; $j++) { ! $A = DB_fetchArray($result); if ($_SEC_VERBOSE) { ! COM_errorLog('Adding right ' . $A['ft_name'] . ' in SEC_getUserPermissions',1); } + $retval .= $A['ft_name'] . ','; } ! return $retval; } From blaine at geeklog.net Sat Mar 8 20:20:37 2003 From: blaine at geeklog.net (blaine at geeklog.net) Date: Sat, 8 Mar 2003 19:20:37 -0600 Subject: [geeklog-cvs] geeklog-1.3/system/classes upload.class.php,1.24,1.25 Message-ID: <200303090120.h291Kbi14308@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/system/classes In directory internal.geeklog.net:/tmp/cvs-serv14296/system/classes Modified Files: upload.class.php Log Message: Added new function to allow changing the maximum number of files per form supported. Default was 5 with no support to change. Index: upload.class.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/system/classes/upload.class.php,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** upload.class.php 2 Feb 2003 21:14:07 -0000 1.24 --- upload.class.php 9 Mar 2003 01:20:35 -0000 1.25 *************** *** 614,617 **** --- 614,630 ---- /** + * Sets the max number of files that can be uploaded per form + * + * @param int $maxfiles Maximum number of files to allow. Default is 5 + * @return boolean True if set, false otherwise + * + */ + function setMaxFileUploads($maxfiles) + { + $this->_maxFileUploadsPerForm = $maxfiles; + return true; + } + + /** * Extra security option that forces all attempts to upload a file to be done * so from a set of VERY specific IP's. This is only good for those who are From dhaun at geeklog.net Sun Mar 9 06:47:24 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Sun, 9 Mar 2003 05:47:24 -0600 Subject: [geeklog-cvs] geeklog-1.3/sql mysql_tableanddata.php,1.42,1.43 Message-ID: <200303091147.h29BlOi30786@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/sql In directory internal.geeklog.net:/tmp/cvs-serv30721/sql Modified Files: mysql_tableanddata.php Log Message: Integrated Static Pages 1.3 Index: mysql_tableanddata.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/sql/mysql_tableanddata.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** mysql_tableanddata.php 23 Feb 2003 18:16:32 -0000 1.42 --- mysql_tableanddata.php 9 Mar 2003 11:47:22 -0000 1.43 *************** *** 534,551 **** $_SQL[40] = " CREATE TABLE {$_TABLES['staticpage']} ( ! sp_id varchar(20) DEFAULT '' NOT NULL, ! sp_uid mediumint(8) DEFAULT '1' NOT NULL, ! sp_title varchar(128) DEFAULT '' NOT NULL, ! sp_content text DEFAULT '' NOT NULL, ! sp_hits mediumint(8) unsigned DEFAULT '0' NOT NULL, ! sp_date datetime NOT NULL, ! sp_format varchar(20) NOT NULL, ! sp_onmenu tinyint(1) unsigned NOT NULL DEFAULT '0', ! sp_label varchar(64), ! INDEX staticpage_sp_id(sp_id), ! INDEX staticpage_sp_uid(sp_uid), ! INDEX staticpage_sp_date(sp_date), ! INDEX staticpage_sp_onmenu(sp_onmenu), ! PRIMARY KEY (sp_id) ) TYPE=MyISAM "; --- 534,558 ---- $_SQL[40] = " CREATE TABLE {$_TABLES['staticpage']} ( ! sp_id varchar(20) NOT NULL default '', ! sp_uid mediumint(8) NOT NULL default '1', ! sp_title varchar(128) NOT NULL default '', ! sp_content text NOT NULL, ! sp_hits mediumint(8) unsigned NOT NULL default '0', ! sp_date datetime NOT NULL default '0000-00-00 00:00:00', ! sp_format varchar(20) NOT NULL default '', ! sp_onmenu tinyint(1) unsigned NOT NULL default '0', ! sp_label varchar(64) default NULL, ! group_id mediumint(8) unsigned NOT NULL default '1', ! owner_id mediumint(8) unsigned NOT NULL default '1', ! perm_owner tinyint(1) unsigned NOT NULL default '3', ! perm_group tinyint(1) unsigned NOT NULL default '3', ! perm_members tinyint(1) unsigned NOT NULL default '2', ! perm_anon tinyint(1) unsigned NOT NULL default '2', ! sp_php tinyint(1) unsigned NOT NULL default '0', ! sp_nf tinyint(1) unsigned default '0', ! PRIMARY KEY (sp_id), ! KEY staticpage_sp_uid (sp_uid), ! KEY staticpage_sp_date (sp_date), ! KEY staticpage_sp_onmenu (sp_onmenu) ) TYPE=MyISAM "; *************** *** 571,574 **** --- 578,582 ---- $_DATA[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (17,14) "; $_DATA[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (18,14) "; + $_DATA[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (22,14) "; $_DATA[] = "INSERT INTO {$_TABLES['blocks']} (bid, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (3,'user_block','gldefault','User Functions','all',2,'','','0000-00-00 00:00:00',1,'',1,2,3,3,2,2) "; *************** *** 645,648 **** --- 653,657 ---- $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (20,'link.submit','May skip the link submission queue',1) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (21,'event.submit','May skip the event submission queue',1) "; + $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (22,'staticpages.PHP','Ability use PHP in static pages',0) "; $_DATA[] = "INSERT INTO {$_TABLES['frontpagecodes']} (code, name) VALUES (0,'Show Only in Topic') "; *************** *** 827,832 **** $_DATA[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('lastemailedstories','') "; $_DATA[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('rdf_sids','')"; - $_DATA[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('staticpages','1')"; - $_DATA[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('sp_group_id','15')"; $_INDEX[] = "ALTER TABLE {$_TABLES['comments']} ADD INDEX comments_date(date)"; --- 836,839 ---- From dhaun at geeklog.net Sun Mar 9 06:47:24 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Sun, 9 Mar 2003 05:47:24 -0600 Subject: [geeklog-cvs] geeklog-1.3/docs history,1.70,1.71 Message-ID: <200303091147.h29BlOi30763@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/docs In directory internal.geeklog.net:/tmp/cvs-serv30721/docs Modified Files: history Log Message: Integrated Static Pages 1.3 Index: history =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/docs/history,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** history 20 Feb 2003 19:04:58 -0000 1.70 --- history 9 Mar 2003 11:47:22 -0000 1.71 *************** *** 1,4 **** --- 1,10 ---- GeekLog History/Changes: + (1.3.8) + ------- + + - Integrated Tom Willet's version of the Static Pages plugin. This new version + is now called Static Pages 1.3. + Use Geeklog's install script to upgrade from any previous version (1.1 or 1.2) - Fixed a typo in lib-sessions.php that caused the creation of unnecessary sessions (pointed out by Kobaz). *************** *** 47,51 **** --- 53,61 ---- Account information has been moved to template files (new "preferences" directory). + - Updated French language file, provided by Jaques. + - New Slovenian language file, provided by gape + - New Slovak language file, provided by Rado + - New Romanian language file, provided by Dan Gheorghitza From dhaun at geeklog.net Sun Mar 9 06:47:24 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Sun, 9 Mar 2003 05:47:24 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/admin/install install.php,1.42,1.43 Message-ID: <200303091147.h29BlOi30776@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin/install In directory internal.geeklog.net:/tmp/cvs-serv30721/public_html/admin/install Modified Files: install.php Log Message: Integrated Static Pages 1.3 Index: install.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/install/install.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** install.php 17 Feb 2003 21:18:44 -0000 1.42 --- install.php 9 Mar 2003 11:47:22 -0000 1.43 *************** *** 47,51 **** } if (!defined ('VERSION')) { ! define('VERSION', '1.3.7'); } --- 47,51 ---- } if (!defined ('VERSION')) { ! define('VERSION', '1.3.8'); } *************** *** 138,142 **** $db_templates->set_var('upgrade',1); // They already have a lib-database file...they can't change their tables names ! $old_versions = array('1.2.5-1','1.3','1.3.1','1.3.2','1.3.2-1','1.3.3','1.3.4','1.3.5','1.3.6'); $versiondd = 'Current Geeklog Version:'; for ($j = 1; $j <= count($old_versions); $j++) { *************** *** 211,214 **** --- 211,240 ---- } + + /* + * Checks for Static Pages Version + * + * @return 1 if Static Pages 1.1 by Phill or 1.2 by Tom, 0 if original Static Pages + * + */ + function get_SP_Ver() + { + global $_TABLES; + + $result = DB_query ("SELECT * FROM {$_TABLES['staticpage']}"); + $A = DB_fetchArray ($result); + $fields = array (); + foreach ($A as $name => $value) { + $fields[] = $name; + } + if (in_array ('sp_pos',$fields,true)) { + $retval = 1; + } else { + $retval = 0; + } + + return $retval; + } + function INST_doDatabaseUpgrades($current_gl_version, $table_prefix) { global $_TABLES, $_CONF, $_DB_dbms, $_DB_table_prefix; *************** *** 361,364 **** --- 387,424 ---- $current_gl_version = '1.3.7'; + $_SQL = ''; + break; + case '1.3.7': + // upgrade Static Pages plugin + $spversion = get_SP_ver (); + if ($spversion == 0) { // original version + DB_query ("ALTER TABLE {$_TABLES['staticpage']} " + . "ADD COLUMN group_id mediumint(8) unsigned DEFAULT '1'," + . "ADD COLUMN owner_id mediumint(8) unsigned DEFAULT '1'," + . "ADD COLUMN perm_owner tinyint(1) unsigned DEFAULT '3'," + . "ADD COLUMN perm_group tinyint(1) unsigned DEFAULT '3'," + . "ADD COLUMN perm_members tinyint(1) unsigned DEFAULT '2'," + . "ADD COLUMN perm_anon tinyint(1) unsigned DEFAULT '2'," + . "ADD COLUMN sp_php tinyint(1) unsigned DEFAULT '0'," + . "ADD COLUMN sp_nf tinyint(1) unsigned DEFAULT '0'"); + DB_query ("INSERT INTO {$_TABLES['features']} (ft_name, ft_descr) VALUES ('staticpages.php','Ability to use PHP in static pages')"); + $php_id = DB_insertId (); + $group_id = DB_getItem ($_TABLES['groups'], 'grp_id', "grp_name = 'Static Page Admin'"); + DB_query ("INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($php_id, $group_id)"); + } else { // extended version by Phill or Tom + DB_query ("ALTER TABLE {$_TABLES['staticpage']} " + . "DROP COLUMN sp_pos," + . "DROP COLUMN sp_search_keywords," + . "ADD COLUMN sp_nf tinyint(1) unsigned DEFAULT '0'"); + } + DB_query ("UPDATE {$_TABLES['plugins']} SET pi_version = '1.3' WHERE pi_name = 'staticpages'"); + + // remove Static Pages 'lock' flag + DB_query ("DELETE FROM {$_TABLES['vars']} WHERE name = 'staticpages'"); + + // remove Static Pages Admin group id + DB_query ("DELETE FROM {$_TABLES['vars']} WHERE name = 'sp_group_id'"); + + $current_gl_version = '1.3.8'; $_SQL = ''; break; From dhaun at geeklog.net Sun Mar 9 06:47:24 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Sun, 9 Mar 2003 05:47:24 -0600 Subject: [geeklog-cvs] geeklog-1.3/plugins/staticpages/templates/admin editor.thtml,1.4,1.5 Message-ID: <200303091147.h29BlOi30770@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/templates/admin In directory internal.geeklog.net:/tmp/cvs-serv30721/plugins/staticpages/templates/admin Modified Files: editor.thtml Log Message: Integrated Static Pages 1.3 Index: editor.thtml =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/templates/admin/editor.thtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** editor.thtml 18 Aug 2002 18:10:35 -0000 1.4 --- editor.thtml 9 Mar 2003 11:47:22 -0000 1.5 *************** *** 40,43 **** --- 40,90 ---- +


+ + + {php_msg} +   {php_warn} + + + {exit_msg} +   {exit_info} + + +
+ + + {lang_accessrights} + + + {lang_owner}: + {owner_username} + + + {lang_group}: + + {group_dropdown} + + + + {lang_permissions}: + + + + + + {lang_perm_key} + + + + {permissions_editor} + + + + {permissions_msg} + + +
+ + {lang_hits}: {sp_hits} From dhaun at geeklog.net Sun Mar 9 06:47:24 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Sun, 9 Mar 2003 05:47:24 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html index.php,1.41,1.42 Message-ID: <200303091147.h29BlOi30773@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html In directory internal.geeklog.net:/tmp/cvs-serv30721/public_html Modified Files: index.php Log Message: Integrated Static Pages 1.3 Index: index.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/index.php,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** index.php 14 Feb 2003 04:36:31 -0000 1.41 --- index.php 9 Mar 2003 11:47:22 -0000 1.42 *************** *** 81,115 **** if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = 'staticpages'") == 1) { ! $spsql = "SELECT sp_content,sp_label,sp_format FROM {$_TABLES['staticpage']} WHERE sp_title = 'frontpage'"; ! $spresult = DB_fetchArray (DB_query ($spsql)); ! if ($spresult['sp_label'] == 'nonews') { // replace news entirely ! $shownews = false; ! switch ($spresult['sp_format']) { ! case 'noblocks': ! $display .= COM_siteHeader ('none'); ! break; ! case 'allblocks': ! case 'leftblocks': ! $display .= COM_siteHeader ('menu'); ! break; ! } ! $display .= stripslashes ($spresult['sp_content']); ! if ($spresult['sp_format'] == 'allblocks') { ! $display .= COM_siteFooter (true); ! } else if ($spresult['sp_format'] != 'blankpage') { ! $display .= COM_siteFooter (); } ! } else { // display static page content before the news $display .= COM_siteHeader(); - if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) { - $display .= COM_startBlock ($spresult['sp_label']); - } - $display .= stripslashes ($spresult['sp_content']); - if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) { - $display .= COM_endBlock (); - } } } else { --- 81,133 ---- if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = 'staticpages'") == 1) { ! $spsql = "SELECT sp_content,sp_label,sp_format,sp_php FROM {$_TABLES['staticpage']} WHERE sp_title = 'frontpage' AND " . SP_getPerms (); ! $result = DB_query ($spsql); ! if (DB_numRows ($result) > 0) { ! $spresult = DB_fetchArray ($result); ! if ($spresult['sp_label'] == 'nonews') { // replace news entirely ! $shownews = false; ! switch ($spresult['sp_format']) { ! case 'noblocks': ! $display .= COM_siteHeader ('none'); ! break; ! case 'allblocks': ! case 'leftblocks': ! $display .= COM_siteHeader ('menu'); ! break; ! } ! // Check for type (ie html or php) ! if ($spresult['sp_php'] == 1) { ! $display .= eval (stripslashes ($spresult['sp_content'])); ! } else { ! $display .= stripslashes ($spresult['sp_content']); ! } ! ! if ($spresult['sp_format'] == 'allblocks') { ! $display .= COM_siteFooter (true); ! } else if ($spresult['sp_format'] != 'blankpage') { ! $display .= COM_siteFooter (); ! } ! } else { // display static page content before the news ! $display .= COM_siteHeader (); ! if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) { ! $display .= COM_startBlock ($spresult['sp_label']); ! } ! ! // Check for type (ie html or php) ! if ($spresult['sp_php'] == 1) { ! $display .= eval (stripslashes ($spresult['sp_content'])); ! } else { ! $display .= stripslashes ($spresult['sp_content']); ! } ! ! if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) { ! $display .= COM_endBlock (); ! } } ! } else { $display .= COM_siteHeader(); } } else { *************** *** 122,126 **** // Show any Plugin formatted blocks // Requires a plugin to have a function called plugin_centerblock_ ! $display .= PLG_showCenterblock(); if ($shownews) { --- 140,144 ---- // Show any Plugin formatted blocks // Requires a plugin to have a function called plugin_centerblock_ ! $display .= PLG_showCenterblock (); if ($shownews) { *************** *** 282,285 **** --- 300,305 ---- $display .= COM_siteFooter(true); // The true value enables right hand blocks. + } else { + $display = COM_showMessage ($HTTP_GET_VARS['msg']) . $display; } From dhaun at geeklog.net Sun Mar 9 06:47:24 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Sun, 9 Mar 2003 05:47:24 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/staticpages index.php,1.9,1.10 Message-ID: <200303091147.h29BlOi30781@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/staticpages In directory internal.geeklog.net:/tmp/cvs-serv30721/public_html/staticpages Modified Files: index.php Log Message: Integrated Static Pages 1.3 Index: index.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/staticpages/index.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** index.php 7 Oct 2002 14:15:13 -0000 1.9 --- index.php 9 Mar 2003 11:47:22 -0000 1.10 *************** *** 3,7 **** /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ ! // | Static Page Geeklog Plugin 0.1 | // +---------------------------------------------------------------------------+ // | index.php | --- 3,7 ---- /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ ! // | Static Page Geeklog Plugin 1.3 | // +---------------------------------------------------------------------------+ // | index.php | *************** *** 9,15 **** // | | // +---------------------------------------------------------------------------+ ! // | Copyright (C) 2000,2001 by the following authors: | // | | // | Authors: Tony Bibbs - tony at tonybibbs.com | // +---------------------------------------------------------------------------+ // | | --- 9,16 ---- // | | // +---------------------------------------------------------------------------+ ! // | Copyright (C) 2000-2003 by the following authors: | // | | // | Authors: Tony Bibbs - tony at tonybibbs.com | + // | Tom Willett - twillett at users.sourceforge.net | // +---------------------------------------------------------------------------+ // | | *************** *** 32,79 **** // $Id$ ! require_once('../lib-common.php'); $error = 0; ! if (!empty($_USER['uid'])) { ! $result = DB_query("SELECT noboxes FROM {$_TABLES['userindex']} WHERE uid = '{$_USER['uid']}'"); ! $U = DB_fetchArray($result); } ! COM_setArgNames(array('page')); ! $page = COM_getArgument('page'); ! if (empty($page)) { ! $error = 1; } ! $count = DB_count($_TABLES['staticpage'],'sp_id',$page); if ($count == 0 || $count > 1) { ! $error = 1; } if (!($error)) { ! $result = DB_query("SELECT * FROM {$_TABLES['staticpage']} WHERE sp_id = '$page'"); ! $A = DB_fetchArray($result); ! $_CONF["pagetitle"] = stripslashes($A['sp_title']); ! if ($A['sp_format'] == 'allblocks' OR $A["sp_format"] == 'leftblocks') { ! $retval .= COM_siteHeader('menu'); ! } else { if ($A['sp_format'] <> 'blankpage') { ! $retval .= COM_siteHeader('none'); } ! } if ($_SP_CONF['in_block'] == 1) { $retval .= COM_startBlock (stripslashes ($A['sp_title'])); } ! $retval .= stripslashes($A['sp_content']); if ($A['sp_format'] <> 'blankpage') { ! $curtime = COM_getUserDateTimeFormat($A['sp_date']); ! $retval .= '


' . $LANG_STATIC[lastupdated] . ' ' . $curtime[0]; ! if (SEC_hasRights('staticpages.edit,staticpages.delete','OR')) { ! $retval .= '
'; ! $retval .= $LANG_STATIC[edit] . ""; ! } $retval .= '

'; } --- 33,89 ---- // $Id$ ! require_once ('../lib-common.php'); ! $error = 0; ! if (!empty ($_USER['uid'])) { ! $result = DB_query ("SELECT noboxes FROM {$_TABLES['userindex']} WHERE uid = '{$_USER['uid']}'"); ! $U = DB_fetchArray ($result); } ! COM_setArgNames (array ('page')); ! $page = COM_getArgument ('page'); ! if (empty ($page)) { ! $error = 1; } ! $result = DB_query ("SELECT * FROM {$_TABLES['staticpage']} WHERE (sp_id = '$page') AND " . SP_getPerms ()); ! $count = DB_numRows ($result); if ($count == 0 || $count > 1) { ! $error = 1; } if (!($error)) { ! $A = DB_fetchArray ($result); ! $_CONF["pagetitle"] = stripslashes ($A['sp_title']); ! if ($A['sp_format'] == 'allblocks' OR $A['sp_format'] == 'leftblocks') { ! $retval .= COM_siteHeader ('menu'); ! } else { if ($A['sp_format'] <> 'blankpage') { ! $retval .= COM_siteHeader ('none'); } ! } if ($_SP_CONF['in_block'] == 1) { $retval .= COM_startBlock (stripslashes ($A['sp_title'])); } ! //Check for type (ie html or php) ! if ($A['sp_php'] == 1) { ! $retval .= eval (stripslashes ($A['sp_content'])); ! } else { ! $retval .= stripslashes ($A['sp_content']); ! } if ($A['sp_format'] <> 'blankpage') { ! $curtime = COM_getUserDateTimeFormat ($A['sp_date']); ! $retval .= '


' . $LANG_STATIC['lastupdated'] ! . ' ' . $curtime[0]; ! if (SEC_hasAccess ($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon']) == 3) { ! $retval .= '
'; ! $retval .= $LANG_STATIC['edit'] . ""; ! } $retval .= '

'; } *************** *** 82,105 **** } ! if ($A['sp_format'] <> 'blankpage') ! { ! if ($A['sp_format'] == 'allblocks' && $U['noboxes'] != 1) { ! $retval .= COM_siteFooter(true); ! } ! else ! { ! $retval .= COM_siteFooter(); } - } ! // increment hit counter for page...is SQL compliant? ! DB_query("UPDATE {$_TABLES['staticpage']} SET sp_hits = sp_hits + 1 WHERE sp_id = '$page'"); } else { ! $retval .= COM_startBlock('error'); ! $retval .= 'page does not exist'; ! $retval .= COM_endBlock(); ! } echo $retval; --- 92,128 ---- } ! if ($A['sp_format'] <> 'blankpage') { if ($A['sp_format'] == 'allblocks' && $U['noboxes'] != 1) { ! $retval .= COM_siteFooter (true); ! } else { ! $retval .= COM_siteFooter (); } } ! // increment hit counter for page...is SQL compliant? ! DB_query ("UPDATE {$_TABLES['staticpage']} SET sp_hits = sp_hits + 1 WHERE sp_id = '$page'"); } else { ! $failflg = DB_getItem ($_TABLES['staticpage'], 'sp_nf', "sp_id='$page'"); ! if ($failflg) { ! $retval = COM_siteHeader ('menu'); ! $retval .= COM_startBlock ($LANG_LOGIN[1]); ! $login = new Template ($_CONF['path_layout'] . 'submit'); ! $login->set_file (array ('login'=>'submitloginrequired.thtml')); ! $login->set_var ('login_message', $LANG_LOGIN[2]); ! $login->set_var ('site_url', $_CONF['site_url']); ! $login->set_var ('lang_login', $LANG_LOGIN[3]); ! $login->set_var ('lang_newuser', $LANG_LOGIN[4]); ! $login->parse ('output', 'login'); ! $retval .= $login->finish ($login->get_var ('output')); ! $retval .= COM_endBlock (); ! $retval .= COM_siteFooter (true); ! } else { ! $retval = COM_siteHeader ('menu'); ! $retval .= COM_startBlock ($LANG_ACCESS['accessdenied']); ! $retval .= $LANG_STATIC['deny_msg']; ! $retval .= COM_endBlock (); ! $retval .= COM_siteFooter (true); ! } ! } echo $retval; From dhaun at geeklog.net Sun Mar 9 06:47:24 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Sun, 9 Mar 2003 05:47:24 -0600 Subject: [geeklog-cvs] geeklog-1.3/plugins/staticpages config.php,1.2,1.3 functions.inc,1.17,1.18 Message-ID: <200303091147.h29BlOi30761@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages In directory internal.geeklog.net:/tmp/cvs-serv30721/plugins/staticpages Modified Files: config.php functions.inc Log Message: Integrated Static Pages 1.3 Index: config.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/config.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** config.php 23 Jul 2002 10:12:35 -0000 1.2 --- config.php 9 Mar 2003 11:47:22 -0000 1.3 *************** *** 1,15 **** --- 1,15 ---- Index: functions.inc =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/functions.inc,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** functions.inc 30 Nov 2002 20:42:42 -0000 1.17 --- functions.inc 9 Mar 2003 11:47:22 -0000 1.18 *************** *** 3,17 **** /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ ! // | Static Pages Plugin 0.1 for Geeklog - The Ultimate Weblog | // +---------------------------------------------------------------------------+ // | functions.inc | // | This file does two things: 1) it implements the necessary Geeklog Plugin | // | API method and 2) implements all the common code needed by the Static | // | Pages' PHP files. | - // | | // +---------------------------------------------------------------------------+ ! // | Copyright (C) 2000,2001 by the following authors: | // | | // | Authors: Tony Bibbs - tony at tonybibbs.com | // +---------------------------------------------------------------------------+ // | | --- 3,19 ---- /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ ! // | Static Pages Plugin 1.3 for Geeklog - The Ultimate Weblog | // +---------------------------------------------------------------------------+ // | functions.inc | + // | | // | This file does two things: 1) it implements the necessary Geeklog Plugin | // | API method and 2) implements all the common code needed by the Static | // | Pages' PHP files. | // +---------------------------------------------------------------------------+ ! // | Copyright (C) 2000-2003 by the following authors: | // | | // | Authors: Tony Bibbs - tony at tonybibbs.com | + // | Tom Willett - twillett at users.sourceforge.net | + // | Blaine Lang - langmail at sympatico.ca | // +---------------------------------------------------------------------------+ // | | *************** *** 36,49 **** $langfile = $_CONF['path'] . 'plugins/staticpages/language/' . $_CONF['language'] . '.php'; ! if (file_exists ($langfile)) ! { include ($langfile); ! } ! else ! { include ($_CONF['path'] . 'plugins/staticpages/language/english.php'); } ! include($_CONF['path'] . 'plugins/staticpages/config.php'); // +---------------------------------------------------------------------------+ --- 38,48 ---- $langfile = $_CONF['path'] . 'plugins/staticpages/language/' . $_CONF['language'] . '.php'; ! if (file_exists ($langfile)) { include ($langfile); ! } else { include ($_CONF['path'] . 'plugins/staticpages/language/english.php'); } ! include ($_CONF['path'] . 'plugins/staticpages/config.php'); // +---------------------------------------------------------------------------+ *************** *** 62,71 **** global $_CONF, $_TABLES; ! $result = DB_query("SELECT sp_id, sp_label FROM {$_TABLES['staticpage']} WHERE sp_onmenu = 1 ORDER BY sp_label"); ! $nrows = DB_numRows($result); ! $menuitems = array(); for ($i = 1; $i <= $nrows; $i++) { ! $A = DB_fetchArray($result); ! $menuitems[$A['sp_label']] = COM_buildURL ($_CONF['site_url'] . "/staticpages/index.php?page={$A['sp_id']}"); } return $menuitems; --- 61,72 ---- global $_CONF, $_TABLES; ! $result = DB_query ('SELECT sp_id, sp_label, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon FROM ' . $_TABLES['staticpage'] . ' WHERE sp_onmenu = 1'); ! $nrows = DB_numRows ($result); ! $menuitems = array (); for ($i = 1; $i <= $nrows; $i++) { ! $A = DB_fetchArray ($result); ! if (SEC_hasAccess ($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon'])) { ! $menuitems[$A['sp_label']] = COM_buildURL ($_CONF['site_url'] . "/staticpages/index.php?page={$A['sp_id']}"); ! } } return $menuitems; *************** *** 73,80 **** /** ! * Geeklog is checking to see if this plugin supports comments, tell it no! ! * NOTE: to support comments you must use the same date/time based ID for your * widget. In other words, to make primary keys for your plugin you should call ! * makesid(). Comments are keyed off of that...it is a limitation on how geeklog * does comments. * --- 74,82 ---- /** ! * Geeklog is checking to see if this plugin supports comments, tell it no. ! * ! * NOTE: to support comments you must used the same date/time based ID for your * widget. In other words, to make primary keys for your plugin you should call ! * makesid(). Comments are keyed off of that...it is a limitation on how Geeklog * does comments. * *************** *** 87,93 **** /** ! * Shows the statistics for the static pages plugin on stats.php. If ! * $showsitestats is 1 then we are to only print the overall stats in the 'site ! * statistics' box otherwise we show the detailed stats for the static pages * * @showsitestate int Flag to let us know which stats to get --- 89,95 ---- /** ! * Shows the statistics for the Static Pages plugin on stats.php. ! * If $showsitestats is 1 then we are to only print the overall stats in the ! * 'site statistics box' otherwise we show the detailed stats * * @showsitestate int Flag to let us know which stats to get *************** *** 95,99 **** function plugin_showstats_staticpages($showsitestats) { ! // Code to come later } --- 97,134 ---- function plugin_showstats_staticpages($showsitestats) { ! global $LANG_STATIC, $_CONF, $_TABLES; ! ! $stat_templates = new Template ($_CONF['path_layout'] . 'stats'); ! $stat_templates->set_file (array ('itemstats'=>'itemstatistics.thtml', ! 'statrow'=>'singlestat.thtml')); ! if ($showsitestats == 1) { ! $result = DB_query ("SELECT count(*) AS cnt FROM {$_TABLES['staticpage']} WHERE " . SP_getPerms ()); ! $A = DB_fetchArray ($result); ! $total_pages = $A['cnt']; ! $retval = ''; ! $retval .= ''; ! $retval .= '
' . $LANG_STATIC['staticpages'] . '' . $total_pages . '  
'; ! } else { ! $result = DB_query ("SELECT sp_id,sp_title,sp_hits FROM {$_TABLES['staticpage']} WHERE sp_hits > 0 AND" . SP_getPerms() . ' ORDER BY sp_hits DESC LIMIT 10'); ! $nrows = DB_numRows ($result); ! $retval .= COM_startBlock ($LANG_STATIC['stats_headline']); ! if ($nrows > 0) { ! $stat_templates->set_var ('item_label', $LANG_STATIC['stats_page_title']); ! $stat_templates->set_var ('stat_name', $LANG_STATIC['stats_hits']); ! for ($i = 0; $i < $nrows; $i++) { ! $A = DB_fetchArray ($result); ! $stat_templates->set_var ('item_url', COM_buildURL ($_CONF['site_url'] . '/staticpages/index.php?page=' . $A['sp_id'])); ! $stat_templates->set_var ('item_text', stripslashes ($A['sp_title'])); ! $stat_templates->set_var ('item_stat', $A['sp_hits']); ! $stat_templates->parse ('stat_row','statrow',true); ! } ! $stat_templates->parse ('output','itemstats'); ! $retval .= $stat_templates->finish ($stat_templates->get_var ('output')); ! } else { ! $retval .= $LANG_STATIC['stats_no_hits']; ! } ! $retval .= COM_endBlock(); ! } ! return $retval; } *************** *** 108,114 **** --- 143,151 ---- $tmp['staticpages'] = $LANG_STATIC['staticpages']; + return $tmp; } + /** * this searches for static pages matching the user query and returns an array of *************** *** 123,135 **** * @author string Get all results by this author * */ function plugin_dopluginsearch_staticpages($query, $datestart, $dateend, $topic, $type, $author) { ! global $_TABLES, $_CONF, $LANG_STATIC; if (empty($type)) { $type = 'all'; } ! // Bail if we aren't supppose to do our search if ($type <> 'all' AND $type <> 'staticpages') { --- 160,173 ---- * @author string Get all results by this author * + * Oct 05/2002: Blaine Lang, Corrected bug with SQL Search string. */ function plugin_dopluginsearch_staticpages($query, $datestart, $dateend, $topic, $type, $author) { ! global $_TABLES, $_CONF, $LANG_STATIC; if (empty($type)) { $type = 'all'; } ! // Bail if we aren't supppose to do our search if ($type <> 'all' AND $type <> 'staticpages') { *************** *** 140,194 **** } ! // Build search SQL ! $sql = "SELECT sp_id,sp_content,sp_title,sp_hits,sp_uid,UNIX_TIMESTAMP(sp_date) as day FROM {$_TABLES['staticpage']} WHERE "; $sql .= "((sp_content like '%$query%' OR sp_content like '$query%' OR sp_content like '%$query') "; ! $sql .= "OR (sp_title like '%$query%' OR sp_title like '$query%' OR sp_title like '%$query')) "; ! if (!empty($datestart) && !empty($dateend)) { ! $delim = substr($datestart, 4, 1); ! $DS = explode($delim,$datestart); ! $DE = explode($delim,$dateend); ! $startdate = mktime(0,0,0,$DS[1],$DS[2],$DS[0]); ! $enddate = mktime(0,0,0,$DE[1],$DE[2],$DE[0]) + 3600; ! $sql .= "AND (UNIX_TIMESTAMP(sp_date) BETWEEN '$startdate' AND '$enddate') "; } ! if (!empty($author)) { $sql .= "AND (sp_uid = '$author') "; } ! $sql .= "ORDER BY sp_date desc"; // Perform search ! $result = DB_query($sql); ! ! // OK, now return coma delimited string of table header labels require_once($_CONF['path_system'] . 'classes/plugin.class.php'); $plugin_results = new Plugin(); $plugin_results->plugin_name = 'staticpages'; $plugin_results->searchlabel = $LANG_STATIC['results']; ! $plugin_results->addSearchHeading($LANG_STATIC['title']); ! $plugin_results->addSearchHeading($LANG_STATIC['date']); ! $plugin_results->addSearchHeading($LANG_STATIC['author']); ! $plugin_results->addSearchHeading($LANG_STATIC['hits']); ! $plugin_results->num_searchresults = DB_numRows($result); // NOTE if any of your data items need to be links then add them here! // make sure data elements are in an array and in the same order as your // headings above! ! for ($i = 1; $i <= $plugin_results->num_searchresults; $i++) { ! $A = DB_fetchArray($result); ! $thetime = COM_getUserDateTimeFormat($A['day']); ! $A['sp_title'] = stripslashes ($A['sp_title']); ! $row = array('' . $A['sp_title'] . '', $thetime[0], ! DB_getItem($_TABLES['users'],'username',"uid = '{$A["sp_uid"]}'"), $A['sp_hits']); ! $plugin_results->addSearchResult($row); ! } ! $plugin_results->num_itemssearched = DB_count($_TABLES['staticpage']); return $plugin_results; } /** * This will put an option for static pages in the command and control block on --- 178,238 ---- } ! // Build search SQL - Modified to exclude static PHP pages from search. ! $sql = "SELECT *,UNIX_TIMESTAMP(sp_date) as day FROM " . $_TABLES['staticpage'] . " WHERE (sp_php != '1' AND"; $sql .= "((sp_content like '%$query%' OR sp_content like '$query%' OR sp_content like '%$query') "; ! $sql .= "OR (sp_title like '%$query%' OR sp_title like '$query%' OR sp_title like '%$query'))"; ! if (!empty ($datestart) && !empty ($dateend)) { ! $delim = substr ($datestart, 4, 1); ! $DS = explode ($delim, $datestart); ! $DE = explode ($delim, $dateend); ! $startdate = mktime (0, 0, 0, $DS[1], $DS[2], $DS[0]); ! $enddate = mktime (23, 59, 59, $DE[1], $DE[2], $DE[0]); ! $sql .= " AND (UNIX_TIMESTAMP(sp_date) BETWEEN '$startdate' AND '$enddate')"; } ! if (!empty ($author)) { $sql .= "AND (sp_uid = '$author') "; } ! $sql .= ") ORDER BY sp_date desc"; // Perform search ! $result = DB_query ($sql); ! ! // OK, now return coma delmited string of table header labels require_once($_CONF['path_system'] . 'classes/plugin.class.php'); $plugin_results = new Plugin(); $plugin_results->plugin_name = 'staticpages'; $plugin_results->searchlabel = $LANG_STATIC['results']; ! $plugin_results->addSearchHeading ($LANG_STATIC['title']); ! $plugin_results->addSearchHeading ($LANG_STATIC['date']); ! $plugin_results->addSearchHeading ($LANG_STATIC['author']); ! $plugin_results->addSearchHeading ($LANG_STATIC['hits']); ! $mycount = DB_numRows ($result); // NOTE if any of your data items need to be links then add them here! // make sure data elements are in an array and in the same order as your // headings above! ! for ($i = 1; $i <= $mycount; $i++) { ! $A = DB_fetchArray ($result); ! ! if (SEC_hasAccess ($A['owner_id'], $A['group_id'], $A['perm_owner'], $A['perm_group'], $A['perm_members'], $A['perm_anon'])) { ! $rcnt++; ! $thetime = COM_getUserDateTimeFormat ($A['day']); ! $A['sp_title'] = stripslashes ($A['sp_title']); ! $row = array ('' . $A['sp_title'] . '', $thetime[0], ! '' . DB_getItem ($_TABLES['users'], 'username', "uid = '{$A['sp_uid']}'") . '', $A['sp_hits']); ! $plugin_results->addSearchResult ($row); ! } ! } ! $plugin_results->num_searchresults = $rcnt; ! $plugin_results->num_itemssearched = DB_count ($_TABLES['staticpage']); return $plugin_results; } + /** * This will put an option for static pages in the command and control block on *************** *** 200,208 **** global $LANG_STATIC, $_CONF; ! if (SEC_hasRights('staticpages.edit,staticpages.delete','OR')) { ! return array($LANG_STATIC['staticpages'],$_CONF['site_admin_url'] . '/plugins/staticpages/index.php',$_CONF['site_url'] . '/staticpages/images/staticpages.gif'); } ! return (false); } --- 244,254 ---- global $LANG_STATIC, $_CONF; ! if (SEC_hasRights ('staticpages.edit,staticpages.delete', 'OR')) { ! return array ($LANG_STATIC['staticpages'], ! $_CONF['site_admin_url'] . '/plugins/staticpages/index.php', ! $_CONF['site_url'] . '/staticpages/images/staticpages.gif'); } ! return false; } *************** *** 215,224 **** global $_CONF, $LANG_STATIC, $_TABLES; ! if (SEC_hasRights('staticpages.edit,staticpages.delete','OR')) { ! return array($LANG_STATIC[staticpages], $_CONF['site_admin_url'] . '/plugins/staticpages/index.php', DB_count($_TABLES['staticpage'])); } } /** * Removes the datastructures for this plugin from the Geeklog database * --- 261,317 ---- global $_CONF, $LANG_STATIC, $_TABLES; ! if (SEC_hasRights ('staticpages.edit,staticpages.delete', 'OR')) { ! $result = DB_query ("SELECT count(*) AS cnt FROM {$_TABLES['staticpage']} WHERE " . SP_getPerms ('','3')); ! $A = DB_fetchArray ($result); ! $total_pages = $A['cnt']; ! return array ($LANG_STATIC[staticpages], $_CONF['site_admin_url'] . '/plugins/staticpages/index.php', $total_pages); } } /** + * Return SQL where statement with appropriate permissions + * + * Takes User id and permission and returns SQL where clause which will return the appropriate objects. + * This assumes that the table has the following security structure: + * owner_id | mediumint(8) + * group_id | mediumint(8) + * perm_owner | tinyint(1) unsigned + * perm_group | tinyint(1) unsigned + * perm_members | tinyint(1) unsigned + * perm_anon | tinyint(1) unsigned + * This will work with the standard GL tables + * + * @table str Table name (used in joins) + * @access int Access if blank read access 2 = read 3 = read/edit + * @u_id int User ID if blank current user + * + * @return string Where clause of sql statement + * + */ + function SP_getPerms($table='',$access='2',$u_id='') + { + global $_USER, $_GROUPS; + + if ($table != '') { $table .= '.'; } + if ($u_id == '') { + $uid = $_USER['uid']; + $GROUPS = $_GROUPS; + } else { + $uid = $u_id; + $GROUPS = SEC_getUserGroups($uid); + } + $where = "((" . $table . "perm_anon >= $access)"; + // check to see if anonymous user + if ($uid > 1) { + $where .= " OR (" . $table . "perm_members >= $access)"; + foreach ($GROUPS as $group) { + $where .= " OR ((" . $table . "group_id = $group) AND (" . $table . "perm_group >= $access))"; + } + $where .= " OR ((" . $table . "owner_id = $uid) AND (" . $table . "perm_owner >= $access))"; + } + return $where . ")"; + } + + /** * Removes the datastructures for this plugin from the Geeklog database * *************** *** 245,249 **** // Remove the static page admin group ! $grp_id = DB_getItem($_TABLES['vars'], 'value', "name = 'sp_group_id'"); if (empty($steps) OR $steps['insertgroup'] == 1) { --- 338,342 ---- // Remove the static page admin group ! $grp_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Static Page Admin'"); if (empty($steps) OR $steps['insertgroup'] == 1) { *************** *** 256,259 **** --- 349,353 ---- $edit_id = DB_getItem($_TABLES['features'], 'ft_id', "ft_name = 'staticpages.edit'"); $delete_id = DB_getItem($_TABLES['features'], 'ft_id', "ft_name = 'staticpages.delete'"); + $php_id = DB_getItem($_TABLES['features'], 'ft_id', "ft_name = 'staticpages.PHP'"); if (empty($steps) OR $steps['addededittogroup'] == 1) { *************** *** 271,274 **** --- 365,375 ---- } + if (empty($steps) OR $steps['addedphptogroup'] == 1) { + // Remove access to those features + COM_errorLog('Attempting to remove rights to staticpage.PHP from all groups',1); + DB_query("DELETE FROM {$_TABLES['access']} WHERE acc_ft_id = $php_id"); + COM_errorLog('...success',1); + } + if (empty($steps) OR $steps['addedrootuserstogroup'] == 1) { // Remove root users from the group *************** *** 290,297 **** } ! if (empty($steps) OR $steps['savedgroupid']) { ! COM_errorLog('Attempting to remove the group id from the vars table',1); ! DB_query("DELETE FROM {$_TABLES['vars']} WHERE name = 'sp_group_id'"); ! COM_errorLog('success',1); } --- 391,398 ---- } ! if (empty($steps) OR $steps['insertedphpfeature'] == 1) { ! COM_errorLog('Attempting to remove the staticpage.PHP feature',1); ! DB_query("DELETE FROM {$_TABLES['features']} WHERE ft_id = $php_id"); ! COM_errorLog('...success',1); } *************** *** 301,305 **** COM_errorLog('Attempting to unregister the plugin from Geeklog',1); DB_query("DELETE FROM {$_TABLES['plugins']} WHERE pi_name = 'staticpages'"); - DB_query("DELETE FROM {$_TABLES['vars']} WHERE name = 'staticpages'"); COM_errorLog('...success',1); --- 402,405 ---- From dhaun at geeklog.net Sun Mar 9 06:47:24 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Sun, 9 Mar 2003 05:47:24 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/admin/plugins/staticpages index.php,1.14,1.15 install.php,1.8,1.9 Message-ID: <200303091147.h29BlOi30783@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages In directory internal.geeklog.net:/tmp/cvs-serv30721/public_html/admin/plugins/staticpages Modified Files: index.php install.php Log Message: Integrated Static Pages 1.3 Index: index.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages/index.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** index.php 29 Jan 2003 17:08:52 -0000 1.14 --- index.php 9 Mar 2003 11:47:22 -0000 1.15 *************** *** 3,7 **** /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ ! // | Static Pages Geeklog Plugin 0.1 | // +---------------------------------------------------------------------------+ // | index.php | --- 3,7 ---- /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ ! // | Static Pages Geeklog Plugin 1.3 | // +---------------------------------------------------------------------------+ // | index.php | *************** *** 9,15 **** // | | // +---------------------------------------------------------------------------+ ! // | Copyright (C) 2000,2001 by the following authors: | // | | // | Authors: Tony Bibbs - tony at tonybibbs.com | // +---------------------------------------------------------------------------+ // | | --- 9,17 ---- // | | // +---------------------------------------------------------------------------+ ! // | Copyright (C) 2000-2003 by the following authors: | // | | // | Authors: Tony Bibbs - tony at tonybibbs.com | + // | Phill Gillespie - phill at mediaaustralia.com.au | + // | Tom Willett - twillett at users.sourceforge.net // +---------------------------------------------------------------------------+ // | | *************** *** 55,62 **** function form($A, $error=false) { ! global $_TABLES, $PHP_SELF, $_CONF, $HTTP_POST_VARS, $_USER, $LANG_STATIC,$_SP_CONF; $retval = ''; if ($error) { $retval .= $error . "

"; --- 57,81 ---- function form($A, $error=false) { ! global $_TABLES, $PHP_SELF, $_CONF, $HTTP_POST_VARS, $_USER, $LANG_STATIC,$_SP_CONF, $LANG_ACCESS, $mode, $sp_id; + if (!empty($sp_id) && $mode=='edit') { + $access = SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']); + } else { + $A['owner_id'] = $_USER['uid']; + $A['group_id'] = DB_getItem($_TABLES['groups'],'grp_id',"grp_name = 'Static Page Admin'"); + $A['perm_owner'] = 3; + $A['perm_group'] = 3; + $A['perm_members'] = 2; + $A['perm_anon'] = 2; + $access = 3; + } $retval = ''; + if (empty($A['owner_id'])) { + $error = COM_startBlock($LANG_ACCESS['accessdenied']); + $error .= $LANG_STATIC['deny_msg']; + $error .= COM_endBlock(); + } + if ($error) { $retval .= $error . "

"; *************** *** 64,71 **** $sp_template = new Template($_CONF['path'] . 'plugins/staticpages/templates/admin'); if (($_CONF['advanced_editor'] == 1) && file_exists ($_CONF['path'] . 'plugins/staticpages/templates/admin/editor_advanced.thtml')) { ! $sp_template->set_file('form','editor_advanced.thtml'); } else { ! $sp_template->set_file('form','editor.thtml'); } $sp_template->set_var('site_url', $_CONF['site_url']); $sp_template->set_var('site_admin_url', $_CONF['site_admin_url']); --- 83,118 ---- $sp_template = new Template($_CONF['path'] . 'plugins/staticpages/templates/admin'); if (($_CONF['advanced_editor'] == 1) && file_exists ($_CONF['path'] . 'plugins/staticpages/templates/admin/editor_advanced.thtml')) { ! $sp_template->set_file ('form', 'editor_advanced.thtml'); } else { ! $sp_template->set_file ('form', 'editor.thtml'); } + $sp_template->set_var('lang_accessrights', $LANG_ACCESS['accessrights']); + $sp_template->set_var('lang_owner', $LANG_ACCESS['owner']); + $sp_template->set_var('owner_username', DB_getItem($_TABLES['users'],'username',"uid = {$A['owner_id']}")); + $sp_template->set_var('owner_id', $A['owner_id']); + $sp_template->set_var('lang_group', $LANG_ACCESS['group']); + $usergroups = SEC_getUserGroups(); + if ($access == 3) { + $groupdd .= ''; + } else { + // they can't set the group then + $groupdd .= DB_getItem($_TABLES['groups'],'grp_name',"grp_id = {$A['group_id']}"); + $groupdd .= ''; + } + $sp_template->set_var('group_dropdown', $groupdd); + $sp_template->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon'])); + $sp_template->set_var('lang_permissions', $LANG_ACCESS['permissions']); + $sp_template->set_var('lang_perm_key', $LANG_ACCESS['permissionskey']); + $sp_template->set_var('permissions_editor', SEC_getPermissionsHTML($A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon'])); + $sp_template->set_var('permissions_msg', $LANG_ACCESS['permmsg']); $sp_template->set_var('site_url', $_CONF['site_url']); $sp_template->set_var('site_admin_url', $_CONF['site_admin_url']); *************** *** 81,86 **** $sp_template->set_var('username', DB_getItem($_TABLES['users'],'username',"uid = {$A["sp_uid"]}")); $sp_template->set_var('sp_uid', $A['sp_uid']); ! $curtime = COM_getUserDateTimeFormat(); $sp_template->set_var('lang_lastupdated', $LANG_STATIC['date']); --- 128,156 ---- $sp_template->set_var('username', DB_getItem($_TABLES['users'],'username',"uid = {$A["sp_uid"]}")); $sp_template->set_var('sp_uid', $A['sp_uid']); + if (SEC_hasRights ('staticpages.PHP')) { + if ($A['sp_php'] == 1) { + $sp_template->set_var('php_checked','checked'); + $sp_template->set_var('php_type','checkbox'); + } else { + $sp_template->set_var('php_checked',''); + } + $sp_template->set_var('php_type','checkbox'); + $sp_template->set_var('php_warn',$LANG_STATIC['php_warn']); + $sp_template->set_var('php_msg',$LANG_STATIC['php_msg']); + } else { + $sp_template->set_var('php_type','hidden'); + $sp_template->set_var('php_warn',''); + $sp_template->set_var('php_msg',''); + $sp_template->set_var('php_checked',''); + } + $sp_template->set_var('exit_msg',$LANG_STATIC['exit_msg']); + if ($A['sp_nf'] == 1) { + $sp_template->set_var('exit_checked','checked'); + } else { + $sp_template->set_var('exit_checked',''); + } + $sp_template->set_var('exit_info',$LANG_STATIC['exit_info']); ! $curtime = COM_getUserDateTimeFormat(); $sp_template->set_var('lang_lastupdated', $LANG_STATIC['date']); *************** *** 156,160 **** if (!empty($sp_id) && $mode == 'edit') { ! $result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} WHERE sp_id = '$sp_id'"); $A = DB_fetchArray($result); } elseif ($mode == 'edit') { --- 226,230 ---- if (!empty($sp_id) && $mode == 'edit') { ! $result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} WHERE sp_id = '$sp_id' AND " . SP_getPerms('','3')); $A = DB_fetchArray($result); } elseif ($mode == 'edit') { *************** *** 195,199 **** //$limit = (50 * $page) - 50; //$result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} ORDER BY sp_date DESC LIMIT $limit,50"); ! $result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} ORDER BY sp_date DESC"); $nrows = DB_numRows($result); if ($nrows > 0) { --- 265,269 ---- //$limit = (50 * $page) - 50; //$result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} ORDER BY sp_date DESC LIMIT $limit,50"); ! $result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} WHERE " . SP_getPerms('','3') . " ORDER BY sp_date DESC"); $nrows = DB_numRows($result); if ($nrows > 0) { *************** *** 248,254 **** * @sp_hits int Number of page views * @sp_format string HTML or plain text * */ ! function submitstaticpage($sp_id,$sp_uid,$sp_title,$sp_content,$unixdate,$sp_hits,$sp_format, $sp_onmenu, $sp_label) { global $_CONF, $LANG12, $LANG_STATIC, $_SP_CONF, $_TABLES; --- 318,333 ---- * @sp_hits int Number of page views * @sp_format string HTML or plain text + * @sp_onmenu int Flag to place entry on menu + * @sp_label string Menu Entry + * @owner_id int Permission bits + * @group_id int + * @perm_owner int + * @perm_members int + * @perm_anon int + * @sp_php int Flag to indicate PHP usage + * @sp_nf int Flag to indicate type of not found message * */ ! function submitstaticpage($sp_id,$sp_uid,$sp_title,$sp_content,$unixdate,$sp_hits,$sp_format, $sp_onmenu, $sp_label, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $sp_php, $sp_nf) { global $_CONF, $LANG12, $LANG_STATIC, $_SP_CONF, $_TABLES; *************** *** 284,288 **** //$sp_label = addslashes(htmlspecialchars(strip_tags(COM_checkWords($sp_label)))); ! DB_save($_TABLES['staticpage'],'sp_id,sp_uid,sp_title,sp_content,sp_date,sp_hits,sp_format,sp_onmenu,sp_label',"'$sp_id',$sp_uid,'$sp_title','$sp_content','$date',$sp_hits,'$sp_format',$sp_onmenu,'$sp_label'",$_CONF['site_admin_url'] . '/plugins/staticpages/index.php'); } else { --- 363,372 ---- //$sp_label = addslashes(htmlspecialchars(strip_tags(COM_checkWords($sp_label)))); ! //If user does not have php edit perms, then set php flag to 0. ! if (!SEC_hasRights('staticpages.PHP')) { ! $sp_php='0'; ! } ! list($perm_owner,$perm_group,$perm_members,$perm_anon) = SEC_getPermissionValues($perm_owner,$perm_group,$perm_members,$perm_anon); ! DB_save($_TABLES['staticpage'],'sp_id,sp_uid,sp_title,sp_content,sp_date,sp_hits,sp_format,sp_onmenu,sp_label,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,sp_php,sp_nf',"'$sp_id',$sp_uid,'$sp_title','$sp_content','$date',$sp_hits,'$sp_format',$sp_onmenu,'$sp_label',$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon,'$sp_php','$sp_nf'",$_CONF['site_admin_url'] . '/plugins/staticpages/index.php'); } else { *************** *** 315,319 **** $display .= COM_siteFooter(); } else if (($mode == $LANG_STATIC['save']) && !empty ($LANG_STATIC['save'])) { ! submitstaticpage($sp_id,$sp_uid,$sp_title,$sp_content,$unixdate,$sp_hits,$sp_format,$sp_onmenu,$sp_label); } else { $display .= COM_siteHeader('menu'); --- 399,404 ---- $display .= COM_siteFooter(); } else if (($mode == $LANG_STATIC['save']) && !empty ($LANG_STATIC['save'])) { ! submitstaticpage($sp_id,$sp_uid,$sp_title,$sp_content,$unixdate,$sp_hits,$sp_format,$sp_onmenu,$sp_label, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $sp_php, $sp_nf); ! COM_errorlog("Saved Static Page " . $sp_id,1); } else { $display .= COM_siteHeader('menu'); Index: install.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages/install.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** install.php 27 Nov 2002 19:45:24 -0000 1.8 --- install.php 9 Mar 2003 11:47:22 -0000 1.9 *************** *** 3,7 **** /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ ! // | Static Pages Plugin 0.2 for Geeklog - The Ultimate Weblog | // +---------------------------------------------------------------------------+ // | install.php | --- 3,7 ---- /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ ! // | Static Pages Plugin 1.3 for Geeklog - The Ultimate Weblog | // +---------------------------------------------------------------------------+ // | install.php | *************** *** 10,16 **** // | plugin for Geeklog. | // +---------------------------------------------------------------------------+ ! // | Copyright (C) 2002 by the following authors: | // | | // | Authors: Tony Bibbs - tony at tonybibbs.com | // +---------------------------------------------------------------------------+ // | | --- 10,17 ---- // | plugin for Geeklog. | // +---------------------------------------------------------------------------+ ! // | Copyright (C) 2002,2003 by the following authors: | // | | // | Authors: Tony Bibbs - tony at tonybibbs.com | + // | Tom Willett - twillett at users.sourceforge.net // +---------------------------------------------------------------------------+ // | | *************** *** 77,82 **** . "sp_onmenu tinyint(1) unsigned NOT NULL DEFAULT '0'," . "sp_label varchar(64)," ! . "PRIMARY KEY (sp_id)" ! . ")"; COM_errorLog("Attempting to create table staticpage for Static Page plugin", 1); --- 78,94 ---- . "sp_onmenu tinyint(1) unsigned NOT NULL DEFAULT '0'," . "sp_label varchar(64)," ! . "group_id mediumint(8) unsigned NOT NULL default '1'," ! . "owner_id mediumint(8) unsigned NOT NULL default '1'," ! . "perm_owner tinyint(1) unsigned NOT NULL default '3'," ! . "perm_group tinyint(1) unsigned NOT NULL default '3'," ! . "perm_members tinyint(1) unsigned NOT NULL default '2'," ! . "perm_anon tinyint(1) unsigned NOT NULL default '2'," ! . "sp_php tinyint(1) unsigned NOT NULL default '0'," ! . "sp_nf tinyint(1) unsigned default '0'," ! . "PRIMARY KEY (sp_id)," ! . "KEY staticpage_sp_uid (sp_uid)," ! . "KEY staticpage_sp_date (sp_date)," ! . "KEY staticpage_sp_onmenu (sp_onmenu)" ! . ") TYPE=MyISAM"; COM_errorLog("Attempting to create table staticpage for Static Page plugin", 1); *************** *** 97,117 **** plugin_uninstall_staticpages($steps); return false; - exit; } COM_errorLog('...success',1); $steps['insertgroup'] = 1; ! // Save the grp id for later uninstall ! COM_errorLog('About to save group_id to vars table for use during uninstall',1); ! DB_query("INSERT INTO {$_TABLES['vars']} VALUES ('sp_group_id', LAST_INSERT_ID())",1); ! if (DB_error()) { ! plugin_uninstall_staticpages($steps); ! return false; ! exit; ! } ! COM_errorLog('...success',1); ! $steps['savedgroupid'] = 1; ! ! $group_id = DB_getItem($_TABLES['vars'], 'value', "name = 'sp_group_id'"); // Add static page features --- 109,117 ---- plugin_uninstall_staticpages($steps); return false; } COM_errorLog('...success',1); $steps['insertgroup'] = 1; ! $group_id = DB_getItem($_TABLES['groups'], 'grp_id', "grp_name = 'Static Page Admin'"); // Add static page features *************** *** 122,126 **** plugin_uninstall_staticpages($steps); return false; - exit; } $edit_id = DB_insertId(); --- 122,125 ---- *************** *** 134,138 **** plugin_uninstall_staticpages($steps); return false; - exit; } $delete_id = DB_insertId(); --- 133,136 ---- *************** *** 140,143 **** --- 138,152 ---- $steps['insertedfeaturedelete'] = 1; + COM_errorLog('Attempting to add staticpages.PHP feature',1); + DB_query("INSERT INTO {$_TABLES['features']} (ft_name, ft_descr) " + . "VALUES ('staticpages.PHP','Ability use PHP in static pages')",1); + if (DB_error()) { + plugin_uninstall_staticpages($steps); + return false; + } + $php_id = DB_insertId(); + COM_errorLog('...success',1); + $steps['insertedphpfeature'] = 1; + // Now add the features to the group COM_errorLog('Attempting to give Static Page Admin group access to staticpages.edit feature',1); *************** *** 146,150 **** plugin_uninstall_staticpages($steps); return false; - exit; } COM_errorLog('...success',1); --- 155,158 ---- *************** *** 156,164 **** plugin_uninstall_staticpages($steps); return false; - exit; } COM_errorLog('...success',1); $steps['addeddeletetogroup'] = 1; // OK, now give Root users access to this plugin now! NOTE: Root group should always be 1 COM_errorLog('Attempting to give all users in Root group access static page admin group',1); --- 164,180 ---- plugin_uninstall_staticpages($steps); return false; } COM_errorLog('...success',1); $steps['addeddeletetogroup'] = 1; + COM_errorLog('Attempting to give Static Page Admin group access to staticpages.PHP feature',1); + DB_query("INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($php_id, $group_id)",1); + if (DB_error()) { + plugin_uninstall_staticpages($steps); + return false; + } + COM_errorLog('...success',1); + $steps['addedphptogroup']=1; + // OK, now give Root users access to this plugin now! NOTE: Root group should always be 1 COM_errorLog('Attempting to give all users in Root group access static page admin group',1); *************** *** 167,171 **** plugin_uninstall_staticpages($steps); return false; - exit; } COM_errorLog('...success',1); --- 183,186 ---- *************** *** 174,183 **** // Register the plugin with Geeklog if (DB_count($_TABLES['plugins'],'pi_name','staticpages') > 0) { ! COM_errorLog('Attempting to remove staticpage rentry prior to adding an updated entry',1); DB_query("DELETE FROM {$_TABLES['plugins']} WHERE pi_name = 'staticpages'"); if (DB_error()) { plugin_uninstall_staticpages($steps); return false; - exit; } COM_errorLog('...success',1); --- 189,197 ---- // Register the plugin with Geeklog if (DB_count($_TABLES['plugins'],'pi_name','staticpages') > 0) { ! COM_errorLog('Attempting to remove staticpage entry prior to adding an updated entry',1); DB_query("DELETE FROM {$_TABLES['plugins']} WHERE pi_name = 'staticpages'"); if (DB_error()) { plugin_uninstall_staticpages($steps); return false; } COM_errorLog('...success',1); *************** *** 190,200 **** DB_delete($_TABLES['plugins'],'pi_name','staticpages'); DB_query("INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_homepage, pi_enabled) " ! . "VALUES ('staticpages', '{$_SP_CONF['version']}', '1.3.7', 'http://www.tonybibbs.com', 1)"); ! DB_query("INSERT INTO {$_TABLES['vars']} VALUES ('staticpages','1')"); if (DB_error()) { plugin_uninstall_staticpages($steps); return false; - exit; } COM_errorLog('...success',1); --- 204,212 ---- DB_delete($_TABLES['plugins'],'pi_name','staticpages'); DB_query("INSERT INTO {$_TABLES['plugins']} (pi_name, pi_version, pi_gl_version, pi_homepage, pi_enabled) " ! . "VALUES ('staticpages', '{$_SP_CONF['version']}', '1.3.8', 'http://www.tonybibbs.com', 1)"); if (DB_error()) { plugin_uninstall_staticpages($steps); return false; } COM_errorLog('...success',1); *************** *** 204,252 **** } - /* - MAIN: OK, I wanted to keep this simple so this is how this works. When ran for the first - time, this file will attempt to install the datastructures immediately. When that is complete, - it will insert a record into the Geeklog vars table (name = 'staticpages', value = 1) which will - lock this file from being executed at by anyone. - - If you want to remove this plugin you would set the value in that record to 0 and then this script - will uninstall the plugin. All this is outlined in the INSTALL and UNINSTALL documents. - */ - $display = COM_siteHeader(); ! if (DB_count($_TABLES['vars'], 'name', 'staticpages') == 0) { ! // Record in vars table doesn' exit, install this plugin ! if (plugin_install_staticpages()) { ! $display .= COM_startBlock($LANG_STATIC['installation_complete']); ! $display .= $LANG_STATIC['installation_complete_msg']; ! $display .= COM_endBlock(); } else { ! // Error occured ! $display .= COM_startBlock($LANG_STATIC['installation_failed']); ! $display .= $LANG_STATIC['installation_failed_msg']; ! $display .= COM_endBlock(); ! } ! } else { ! // This plugin is installed, see if it is locked or not ! if (DB_getItem($_TABLES['vars'],'value',"name = 'staticpages'") == 1) { ! // This is locked, do nothing ! $display .= COM_startBlock($LANG_STATIC['system_locked']); ! $display .= $LANG_STATIC['system_locked_msg']; ! $display .= COM_endBlock(); } else { ! // Uninstall plugin ! if (plugin_uninstall_staticpages()) { ! // Uninstall worked ! $display .= COM_startBlock($LANG_STATIC['uninstall_complete']); ! $display .= $LANG_STATIC['uninstall_complete_msg']; ! $display .= COM_endBlock(); ! } else { ! // Uninstall failed ! $display .= COM_startBlock($LANG_STATIC['uninstall_failed']); ! $display .= $LANG_STATIC['uninstall_failed_msg']; ! $display .= COM_endBlock(); ! } } } --- 216,248 ---- } $display = COM_siteHeader(); ! if ($action == 'uninstall') { ! if (plugin_uninstall_staticpages ()) { ! $display .= COM_showMessage (45); } else { ! $timestamp = strftime($_CONF['daytime']); ! $display .= COM_startBlock ($MESSAGE[40] . ' - ' . $timestamp) ! . '

' ! . $LANG08[6] . '

' . COM_endBlock (); ! } ! } else if (DB_count ($_TABLES['plugins'], 'pi_name', 'staticpages') == 0) { ! // plugin not installed - do it now ! if (plugin_install_staticpages ()) { ! $display = COM_refresh ($_CONF['site_admin_url'] ! . '/plugins.php?msg=44'); } else { ! $timestamp = strftime($_CONF['daytime']); ! $display .= COM_startBlock ($MESSAGE[40] . ' - ' . $timestamp) ! . '

' ! . $LANG08[6] . '

' . COM_endBlock (); } + } else { + // plugin already installed + $display .= COM_startBlock ($LANG32[6]) + . '

' . $LANG32[7] . '

' + . COM_endBlock (); } From dhaun at geeklog.net Sun Mar 9 06:47:24 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Sun, 9 Mar 2003 05:47:24 -0600 Subject: [geeklog-cvs] geeklog-1.3/plugins/staticpages/language README,1.2,1.3 danish.php,1.1,1.2 english.php,1.3,1.4 german.php,1.4,1.5 polish.php,1.1,1.2 spanish.php,1.1,1.2 Message-ID: <200303091147.h29BlOi30769@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language In directory internal.geeklog.net:/tmp/cvs-serv30721/plugins/staticpages/language Modified Files: README danish.php english.php german.php polish.php spanish.php Log Message: Integrated Static Pages 1.3 Index: README =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/README,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** README 29 Apr 2002 09:56:41 -0000 1.2 --- README 9 Mar 2003 11:47:22 -0000 1.3 *************** *** 3,11 **** language settings in your user settings or the default language in config.php. ! IMPORTANT: If there is no language file for your language, then the plugin ! will not work. In that case, simply copy one of the existing language files ! and give it the same name as the language file you're using in ! /path/to/geeklog/language. So e.g. if your language setting is 'dutch', you ! need to have a file 'dutch.php' in this directory. If there is none, you ! could make a copy of 'english.php' and name that copy 'dutch.php'. --- 3,7 ---- language settings in your user settings or the default language in config.php. ! If there is no language file for your language, then the plugin will revert ! to english.php. Index: danish.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/danish.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** danish.php 29 Dec 2002 10:27:11 -0000 1.1 --- danish.php 9 Mar 2003 11:47:22 -0000 1.2 *************** *** 7,10 **** --- 7,11 ---- # Copyright (C) 2001 Tony Bibbs # tony at tonybibbs.com + # Translation Steen Br?lling # # This program is free software; you can redistribute it and/or *************** *** 33,55 **** $LANG_STATIC= array( ! newpage => "Ny Side", ! adminhome => "Admin Hjem", ! staticpages => "Faste Sider", ! staticpageeditor => "Faste Sider Redigering", ! writtenby => "Skrevet af", ! date => "Seneste Opdatering", ! title => "Titel", ! content => "Indhold", ! hits => "Hits", ! staticpagelist => "Faste Sider Liste", ! usealtheader => "Brug Alt. Header", ! url => "URL", ! edit => "Rediger", ! lastupdated => "Sidst Opdateret", ! pageformat => "Side Format", ! leftrightblocks => "Venstre & H?jre Kasser", ! blankpage => "Blank Side", ! noblocks => "Ingen Kasser", ! leftblocks => "Venstre Kasser", addtomenu => 'Tilf?j til Menu', label => 'Titel', --- 34,56 ---- $LANG_STATIC= array( ! newpage => "Ny Side", ! adminhome => "Admin Hjem", ! staticpages => "Faste Sider", ! staticpageeditor => "Faste Sider Redigering", ! writtenby => "Skrevet af", ! date => "Seneste Opdatering", ! title => "Titel", ! content => "Indhold", ! hits => "Hits", ! staticpagelist => "Faste Sider Liste", ! usealtheader => "Brug Alt. Header", ! url => "URL", ! edit => "Rediger", ! lastupdated => "Sidst Opdateret", ! pageformat => "Side Format", ! leftrightblocks => "Venstre & H?jre Kasser", ! blankpage => "Blank Side", ! noblocks => "Ingen Kasser", ! leftblocks => "Venstre Kasser", addtomenu => 'Tilf?j til Menu', label => 'Titel', *************** *** 61,90 **** access_denied => 'Adgang N?gtet', access_denied_msg => 'Du fors?ger at f? adgang til Fast Side administrationssiderne. Dette fors?g er blevet logget', - installation_complete => 'Installation Komplet', - installation_complete_msg => 'Datastrukturen for Fast Side Plugin for GeekLog er med succes installeret i databasen! Hvis du f?r behov for at afinstallere denne plugin, l?s da venligst README filen som fulgte med denne plugin.', - installation_failed => 'Installationen Mislykkedes', - installation_failed_msg => 'Installationen af Fast Side Plugin mislykkedes. L?s venligst din GeekLog error.log fil for at diagnosticere problemet', - system_locked => 'System L?st', - system_locked_msg => 'Fst Side Plugin er allerede installeret, og er l?st. Hvis du vil afinstallere denne plugin, l?s da venligst README filen som fulgte med denne plugin', - uninstall_complete => 'Afinstallation Komplet', - uninstall_complete_msg => 'Datastrukturen for Fast Side Plugin er med succes fjernet fra din GeekLog database.', - uninstall_failed => 'Afinstallationen Mislykkedes', - uninstall_failed_msg => 'Afinstallationen af Fast Side Plugin mislykkedes. L?s venligst din GeekLog error.log fil for at diagnosticere problemet', all_html_allowed => 'Alle HTML koder er tilladte', results => 'Fast Side Resultat', author => 'Forfatter', ! no_such_page_logged_in => 'Desv?rre '.$_USER['username'].'..', ! no_such_page_anon => 'Log venligst ind..', ! no_page_access_msg => "Dette kan skyldes at du ikke er logget ind, eller ikke er oprettet som bruger af {$_CONF["site_name"]}. Bliv venligst oprettet som bruger af {$_CONF["site_name"]} for at f? fuld brugeradgang", ! upgrade_completed => 'Opgradering til version 1.2 skete med succes', ! upgrade_completed_msg => 'Din Fast Side Plugin er opgraderet. Nyd det!', ! upgrade_failed => 'Desv?rre, opgraderingen til version 1.2 mislykkedes', ! upgrade_failed_msg => 'Det er sket en fejl under fors?get p? at opgradere din Fast Side Plugin. L?s venligst din GeekLog error.log fil for at diagnosticere problemet', ! php_checkbox_checked => 'PHP: Er der PHP p? denne side? (brug ikke PHP medmindre det er n?dvendigt)
', ! php_checkbox_unchecked => 'PHP: PHP kode p? din side vil blive tolket korrekt. Brug kun med omtanke!
', ! pos_label => 'Pos: ', ! search_keywords_label => 'S?gen?gleord:', ! search_keywords_msg => 'NB: Hvis en side er standard HTML (ikke PHP), vil b?de \'Indhold\' & \'S?gen?gleord\' blive gennems?gt. Hvis en side er med PHP kode, vil kun \'S?gen?gleord\' blive gennems?gt.' ); ! ?> \ No newline at end of file --- 62,82 ---- access_denied => 'Adgang N?gtet', access_denied_msg => 'Du fors?ger at f? adgang til Fast Side administrationssiderne. Dette fors?g er blevet logget', all_html_allowed => 'Alle HTML koder er tilladte', results => 'Fast Side Resultat', author => 'Forfatter', ! no_title_or_content => 'You must at least fill in the Title and Content fields.', ! no_such_page_logged_in => 'Desv?rre '.$_USER['username'].'..', ! no_such_page_anon => 'Log venligst ind..', ! no_page_access_msg => "Dette kan skyldes at du ikke er logget ind, eller ikke er oprettet som bruger af {$_CONF["site_name"]}. Bliv venligst oprettet som bruger af {$_CONF["site_name"]} for at f? fuld brugeradgang", ! php_msg => 'PHP: ', ! php_warn => 'Warning: PHP code in your page will be evaluated if you enable this option. Use with caution !!', ! exit_msg => 'Exit Type: ', ! exit_info => 'Enable for Login Required Message. Leave unchecked for normal security check and message.', ! deny_msg => 'Access to this page is denied. Either the page has been moved/removed or you do not have sufficient permissions.', ! stats_headline => 'Top Ten Static Pages', ! stats_page_title => 'Page Title', ! stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.' ); ! ?> Index: english.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/english.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** english.php 10 Nov 2002 14:15:26 -0000 1.3 --- english.php 9 Mar 2003 11:47:22 -0000 1.4 *************** *** 33,55 **** $LANG_STATIC= array( ! newpage => "New Page", ! adminhome => "Admin Home", ! staticpages => "Static Pages", ! staticpageeditor => "Static Page Editor", ! writtenby => "Written By", ! date => "Last Updated", ! title => "Title", ! content => "Content", ! hits => "Hits", ! staticpagelist => "Static Page List", ! usealtheader => "Use Alt. Header", ! url => "URL", ! edit => "Edit", ! lastupdated => "Last Updated", ! pageformat => "Page Format", ! leftrightblocks => "Left & Right Blocks", ! blankpage => "Blank Page", ! noblocks => "No Blocks", ! leftblocks => "Left Blocks", addtomenu => 'Add To Menu', label => 'Label', --- 33,55 ---- $LANG_STATIC= array( ! newpage => "New Page", ! adminhome => "Admin Home", ! staticpages => "Static Pages", ! staticpageeditor => "Static Page Editor", ! writtenby => "Written By", ! date => "Last Updated", ! title => "Title", ! content => "Content", ! hits => "Hits", ! staticpagelist => "Static Page List", ! usealtheader => "Use Alt. Header", ! url => "URL", ! edit => "Edit", ! lastupdated => "Last Updated", ! pageformat => "Page Format", ! leftrightblocks => "Left & Right Blocks", ! blankpage => "Blank Page", ! noblocks => "No Blocks", ! leftblocks => "Left Blocks", addtomenu => 'Add To Menu', label => 'Label', *************** *** 61,78 **** access_denied => 'Access Denied', access_denied_msg => 'You are illegally trying access one of the Static Pages administration pages. Please note that all attempts to illegally access this page are logged', - installation_complete => 'Installation Complete', - installation_complete_msg => 'The data structures for the Static Pages plugin for Geeklog have been successfully installed into your database! If you ever need to uninstall this plugin, please read the README document that came with this plugin.', - installation_failed => 'Installation Failed', - installation_failed_msg => 'The installation of the Static Pages plugin failed. Please see your Geeklog error.log file for diagnostic information', - system_locked => 'System Locked', - system_locked_msg => 'The Static Pages plugin has already been installed and is locked. If you are trying to uninstall this plugin, please read the README document that shipped with this plugin', - uninstall_complete => 'Uninstall Complete', - uninstall_complete_msg => 'The datastructures for the Static Pages plugin have been successfully removed from your Geeklog database.', - uninstall_failed => 'Uninstall Failed', - uninstall_failed_msg => 'The uninstall of the Static Pages plugin failed. Please see your Geeklog error.log file for diagnostic information', all_html_allowed => 'All HTML is allowed', results => 'Static Pages Results', author => 'Author', ! no_title_or_content => 'You must at least fill in the Title and Content fields.' ); --- 61,80 ---- access_denied => 'Access Denied', access_denied_msg => 'You are illegally trying access one of the Static Pages administration pages. Please note that all attempts to illegally access this page are logged', all_html_allowed => 'All HTML is allowed', results => 'Static Pages Results', author => 'Author', ! no_title_or_content => 'You must at least fill in the Title and Content fields.', ! no_such_page_logged_in => 'Sorry '.$_USER['username'].'..', ! no_such_page_anon => 'Please log in..', ! no_page_access_msg => "This could be because you're not logged in, or not a member of {$_CONF["site_name"]}. Please become a member of {$_CONF["site_name"]} to receive full membership access", ! php_msg => 'PHP: ', ! php_warn => 'Warning: PHP code in your page will be evaluated if you enable this option. Use with caution !!', ! exit_msg => 'Exit Type: ', ! exit_info => 'Enable for Login Required Message. Leave unchecked for normal security check and message.', ! deny_msg => 'Access to this page is denied. Either the page has been moved/removed or you do not have sufficient permissions.', ! stats_headline => 'Top Ten Static Pages', ! stats_page_title => 'Page Title', ! stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.' ); Index: german.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/german.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** german.php 10 Nov 2002 14:15:26 -0000 1.4 --- german.php 9 Mar 2003 11:47:22 -0000 1.5 *************** *** 35,80 **** $LANG_STATIC= array( ! newpage => "Neue Seite", ! adminhome => "Admin Home", ! staticpages => "Statische Seiten", ! staticpageeditor => "Editor für Statische Seiten", ! writtenby => "Autor", ! date => "Letztes Update", ! title => "Titel", ! content => "Inhalt", ! hits => "Treffer", ! staticpagelist => "Liste der Statischen Seiten", ! usealtheader => "Alt. Header verwenden", ! url => "URL", ! edit => "Ändern", ! lastupdated => "Letztes Update", ! pageformat => "Seitenformat", ! leftrightblocks => "Blöcke links & rechts", ! blankpage => "Leere Seite", ! noblocks => "Keine Blöcke", ! leftblocks => "Blöcke links", ! addtomenu => 'Ins Menü aufnehmen', label => 'Label', nopages => 'Es sind keine statischen Seiten vorhanden.', save => 'Speichern', preview => 'Vorschau', ! delete => 'Loeschen', cancel => 'Abbruch', access_denied => 'Zugriff verweigert', ! access_denied_msg => 'Du hast unerlaubter Weise versucht, auf eine der Admin-Seiten für Statische Seiten zuzugreifen. Hinweis: Alle derartigen Versuche werden protokolliert', ! installation_complete => 'Installation komplett', ! installation_complete_msg => 'Die Datenstrukturen für das Statische-Seiten-Plugin für Geeklog wurden erfolgreich in die Datenbank eingetragen! Wenn Du dieses Plugin wieder deinstallieren will, lies bitte die README-Datei, die dem Plugin beiliegt.', ! installation_failed => 'Installation fehlgeschlagen', ! installation_failed_msg => 'Die Installation des Statische-Seiten-Plugins ist fehlgeschlagen. Die Geeklog-Datei error.log sollte weitere Informationen zu dem Problem enthalten', ! system_locked => 'Bereits installiert', ! system_locked_msg => 'Das Statische-Seiten-Plugin wurde bereits installiert. Solltest Du versucht haben, das Plugin zu deinstallieren, lies bitte die README-Datei, die dem Plugin beiliegt.', ! uninstall_complete => 'Deinstallation komplett', ! uninstall_complete_msg => 'Die Datenstrukturen für das Statische-Seiten-Plugin wurden erfolgreich aus der Geeklog-Datenbank entfernt.', ! uninstall_failed => 'Deinstallation fehlgeschlagen', ! uninstall_failed_msg => 'Die Deinstallation des Statische-Seiten-Plugins ist fehlgeschlagen. Die Geeklog-Datei error.log sollte weitere Informationen zu dem Problem enthalten', all_html_allowed => 'Alle HTML-Tags sind erlaubt', results => 'Gefundene Statische Seiten', author => 'Autor', ! no_title_or_content => 'Bitte mindestens die Felder Titel und Inhalt ausfüllen.' ); --- 35,82 ---- $LANG_STATIC= array( ! newpage => "Neue Seite", ! adminhome => "Admin Home", ! staticpages => "Statische Seiten", ! staticpageeditor => "Editor f?r Statische Seiten", ! writtenby => "Autor", ! date => "Letztes Update", ! title => "Titel", ! content => "Inhalt", ! hits => "Treffer", ! staticpagelist => "Liste der Statischen Seiten", ! usealtheader => "Alt. Header verwenden", ! url => "URL", ! edit => "?ndern", ! lastupdated => "Letztes Update", ! pageformat => "Seitenformat", ! leftrightblocks => "Bl?cke links & rechts", ! blankpage => "Leere Seite", ! noblocks => "Keine Bl?cke", ! leftblocks => "Bl?cke links", ! addtomenu => 'Ins Men? aufnehmen', label => 'Label', nopages => 'Es sind keine statischen Seiten vorhanden.', save => 'Speichern', preview => 'Vorschau', ! delete => 'L?schen', cancel => 'Abbruch', access_denied => 'Zugriff verweigert', ! access_denied_msg => 'Du hast unerlaubter Weise versucht, auf eine der Admin-Seiten f?r Statische Seiten zuzugreifen. Hinweis: Alle derartigen Versuche werden protokolliert', all_html_allowed => 'Alle HTML-Tags sind erlaubt', results => 'Gefundene Statische Seiten', author => 'Autor', ! no_title_or_content => 'Bitte mindestens die Felder Titel und Inhalt ausf?llen.', ! no_such_page_logged_in => 'Sorry '.$_USER['username'].'..', ! no_such_page_anon => 'Please log in..', ! no_page_access_msg => "This could be because you're not logged in, or not a member of {$_CONF["site_name"]}. Please become a member of {$_CONF["site_name"]} to receive full membership access.", ! php_msg => 'PHP: ', ! php_warn => 'Hinweis: Wenn dieser Schalter aktiviert ist, wird in der Seite enthaltener PHP-Code ausgef?hrt. Bitte mit Bedacht verwenden!', ! exit_msg => 'Hinweistext: ', ! exit_info => 'Art des Hinweistextes, wenn kein Zugriff auf die Seite erlaubt ist: Aktiviert = "Anmeldung erforderlich", nicht aktiviert = "Zugriff verweigert".', ! deny_msg => 'Zugriff auf diese Seite ist nicht m?glich. Die Seite wurde entweder umbenannt oder gel?scht oder Du hast nicht die n?tigen Zugriffsrechte.', ! stats_headline => 'Top Ten der Statische Seiten', ! stats_page_title => 'Titel', ! stats_hits => 'Angezeigt', ! stats_no_hits => 'Es gibt keine Statischen Seiten oder sie wurden von niemandem gelesen.' ); Index: polish.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/polish.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** polish.php 28 Nov 2002 15:37:26 -0000 1.1 --- polish.php 9 Mar 2003 11:47:22 -0000 1.2 *************** *** 33,55 **** $LANG_STATIC= array( ! newpage => "Nowa Strona", ! adminhome => "Centrum Admina", ! staticpages => "Strony Statyczne", ! staticpageeditor => "Edytor Stron Statycznych", ! writtenby => "Autor", ! date => "Ostatnia Aktualizacja", ! title => "Tytu?", ! content => "Zawarto??", ! hits => "Ods?on", ! staticpagelist => "Lista Stron Statycznych", ! usealtheader => "U?yj Alt. Nag??wka", ! url => "URL", ! edit => "Edycja", ! lastupdated => "Ostatnia Aktualizacja", ! pageformat => "Format Strony", ! leftrightblocks => "Lewe & Prawe Bloki", ! blankpage => "Nowe Okno", ! noblocks => "Bez Blok?w", ! leftblocks => "Lewe Bloki", addtomenu => 'Dodaj Do Menu', label => 'Etykieta', --- 33,55 ---- $LANG_STATIC= array( ! newpage => "Nowa Strona", ! adminhome => "Centrum Admina", ! staticpages => "Strony Statyczne", ! staticpageeditor => "Edytor Stron Statycznych", ! writtenby => "Autor", ! date => "Ostatnia Aktualizacja", ! title => "Tytu?", ! content => "Zawarto??", ! hits => "Ods?on", ! staticpagelist => "Lista Stron Statycznych", ! usealtheader => "U?yj Alt. Nag??wka", ! url => "URL", ! edit => "Edycja", ! lastupdated => "Ostatnia Aktualizacja", ! pageformat => "Format Strony", ! leftrightblocks => "Lewe & Prawe Bloki", ! blankpage => "Nowe Okno", ! noblocks => "Bez Blok?w", ! leftblocks => "Lewe Bloki", addtomenu => 'Dodaj Do Menu', label => 'Etykieta', *************** *** 61,89 **** access_denied => 'Odmowa Dost?pu', access_denied_msg => 'Pr?bujesz nielegalnie dosta? si? do panelu administruj?cego Stronami Statycznymi. Prosz? mie? na uwadze, ?e wszelkie nieutoryzowane pr?by wej?cia s? logowane', - installation_complete => 'Instalacja Zako?czona', - installation_complete_msg => 'Dane na potrzeby pluginu Static Pages zosta?y pomy?lnie zainstalowane w Twojej bazie! Je?eli kiedykolwiek zaistnieje potrzeba odinstalowania tego pluginu, prosz? przeczyta? dokument README dostarczony razem z tym pluginem.', - installation_failed => 'Instalacja Nie Powiod?a Si?', - installation_failed_msg => 'Instalacja pluginu Static Pages nie powiod?a si?. Prosz? sprawdzi? w pliku erroor.log komunikat b??du', - system_locked => 'System Zablokowany', - system_locked_msg => 'Plugin Static Pages jest ju? zainstalowany i zablokowany. Je?li pr?bujesz odinstalowa? plugin, prosz? przeczyta? dokument README', - uninstall_complete => 'Odinstalowanie Zako?czone', - uninstall_complete_msg => 'Dane na potrzeby pluginu Static Pages zosta?y pomy?lnie usuni?te z Twojej bazy.', - uninstall_failed => 'Odinstalowanie Nie Powiod?o Si?', - uninstall_failed_msg => 'Odinstalowanie pluginu Static Pages nie powiod?o si?. Prosz? sprawdzi? w pliku erroor.log komunikat b??du', all_html_allowed => 'Wszystkie Znaczniki HTML s? dozwolone', results => 'Wyniki Dla Stron Statycznych', author => 'Autor', ! no_such_page_logged_in => 'Sorry '.$_USER['username'].'..', ! no_such_page_anon => 'Prosze si? zalogowa?..', ! no_page_access_msg => "Mo?e to by? spowodowane tym, ?e nie jeste? zalogowana/-y lub zarejestrowanan/-y w Serwisie {$_CONF["site_name"]}. Prosz? zarejestrowa? si? of {$_CONF["site_name"]} aby otrzyma? przywileje u?ytkownik?w zarejestrowanych", ! upgrade_completed => 'Aktualizacja do wersji 1.2 zako?czona pomy?lnie', ! upgrade_completed_msg => 'Tw?j plugin Static Pages zosta? uaktualniony. Niech ci dobrze s?u?y!', ! upgrade_failed => 'Sorry Aktualizacja do wersji 1.2 nie powiod?a si?', ! upgrade_failed_msg => 'Pojawi? si? b??d podczas aktualizacji pluginu Static Pages. Prosz? sprawdzi? w pliku erroor.log komunikat b??du', ! php_checkbox_checked => 'PHP: Czy kod strony zawiera PHP ? (Nie u?ywaj chyba, ?e musisz.)
', ! php_checkbox_unchecked => 'PHP: Kod PHP twojej strony zostanie sprawdzony. U?ywaj tej opcji ostro?nie !!
', ! pos_label => 'Poz: ', ! search_keywords_label => 'S?owa Kluczowe:', ! search_keywords_msg => 'UWAGA: Je?li strona to standardowy html (nie php), WSZYSTKIE pola \'Zawarto??\' & \'S?owa Kluczowe\' s? przeszukiwane. Je?li strona ma uaktywniony php, TYLKO pole \'S?owa Kluczowe\' jest przeszukiwane.' ); --- 61,80 ---- access_denied => 'Odmowa Dost?pu', access_denied_msg => 'Pr?bujesz nielegalnie dosta? si? do panelu administruj?cego Stronami Statycznymi. Prosz? mie? na uwadze, ?e wszelkie nieutoryzowane pr?by wej?cia s? logowane', all_html_allowed => 'Wszystkie Znaczniki HTML s? dozwolone', results => 'Wyniki Dla Stron Statycznych', author => 'Autor', ! no_title_or_content => 'You must at least fill in the Title and Content fields.', ! no_such_page_logged_in => 'Sorry '.$_USER['username'].'..', ! no_such_page_anon => 'Prosze si? zalogowa?..', ! no_page_access_msg => "Mo?e to by? spowodowane tym, ?e nie jeste? zalogowana/-y lub zarejestrowanan/-y w Serwisie {$_CONF["site_name"]}. Prosz? zarejestrowa? si? of {$_CONF["site_name"]} aby otrzyma? przywileje u?ytkownik?w zarejestrowanych", ! php_msg => 'PHP: ', ! php_warn => 'Warning: PHP code in your page will be evaluated if you enable this option. Use with caution !!', ! exit_msg => 'Exit Type: ', ! exit_info => 'Enable for Login Required Message. Leave unchecked for normal security check and message.', ! deny_msg => 'Access to this page is denied. Either the page has been moved/removed or you do not have sufficient permissions.', ! stats_headline => 'Top Ten Static Pages', ! stats_page_title => 'Page Title', ! stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.' ); Index: spanish.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/spanish.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** spanish.php 27 Nov 2002 19:41:39 -0000 1.1 --- spanish.php 9 Mar 2003 11:47:22 -0000 1.2 *************** *** 33,55 **** $LANG_STATIC= array( ! newpage => "Nueva P?gina", ! adminhome => "Administraci?n", ! staticpages => "P?ginas Est?ticas", ! staticpageeditor => "Editor de p?ginas est?ticas", ! writtenby => "Escrito por", ! date => "?ltima edici?n", ! title => "T?tulo", ! content => "Contenido", ! hits => "Hits", ! staticpagelist => "Lista de P?ginas Est?ticas", ! usealtheader => "Usar cabecera alternativa", ! url => "URL", ! edit => "Editar", ! lastupdated => "?ltima Edici?n", ! pageformat => "Formato de P?gina", ! leftrightblocks => "Cajas a Derecha e Izquierda", ! blankpage => "P?gina en blanco", ! noblocks => "Sin Cajas", ! leftblocks => "Cajas a Izquierda", addtomenu => 'A?adir al men?', label => 'Etiqueta', --- 33,55 ---- $LANG_STATIC= array( ! newpage => "Nueva P?gina", ! adminhome => "Administraci?n", ! staticpages => "P?ginas Est?ticas", ! staticpageeditor => "Editor de p?ginas est?ticas", ! writtenby => "Escrito por", ! date => "?ltima edici?n", ! title => "T?tulo", ! content => "Contenido", ! hits => "Hits", ! staticpagelist => "Lista de P?ginas Est?ticas", ! usealtheader => "Usar cabecera alternativa", ! url => "URL", ! edit => "Editar", ! lastupdated => "?ltima Edici?n", ! pageformat => "Formato de P?gina", ! leftrightblocks => "Cajas a Derecha e Izquierda", ! blankpage => "P?gina en blanco", ! noblocks => "Sin Cajas", ! leftblocks => "Cajas a Izquierda", addtomenu => 'A?adir al men?', label => 'Etiqueta', *************** *** 61,77 **** access_denied => 'Acceso Denegado', access_denied_msg => 'Est?s intentando acceder a una p?gina de administraci?n de P?ginas Est?ticas. Ten en cuenta que cualquier acceso a esta p?gina se registra', - installation_complete => 'Instalaci?n Completada', - installation_complete_msg => 'Las estructuras de datos necesarias para las P?ginas Est?ticas de Geeklog se han creado correctamente en la base de datos. Si necesitas desinstalar este plugin por favor lee el fichero README', - installation_failed => 'Instalaci?n Fallida', - installation_failed_msg => 'La instalaci?n del plugin de P?ginas Est?ticas fall?. Por favor lee la informaci?n de diagn?stico del fichero error.log de Geeklog.', - system_locked => 'Sistema Bloqueado', - system_locked_msg => 'El plugin de P?ginas Est?ticas ya ha sido instalado y est? bloqueado. Si est?s intentando desinstalar este plugin, por favor, l?ete el documento README que acompa?a al plugin', - uninstall_complete => 'Desintalaci?n completada', - uninstall_complete_msg => 'Las estructuras de datos para el plugin de P?ginas Est?ticas han sido eliminadas correctamente de tu base de datos de Geeklog.', - uninstall_failed => 'Desinstalaci?n Fallida', - uninstall_failed_msg => 'El proceso de desinstalaci?n del plugin de P?ginas Est?ticas fall?. Por favor, lee la informaci?n de diagn?stico del fichero error.log de Geeklog', all_html_allowed => 'Se permite cualquier etiqueta HTML', results => 'Resultado de P?ginas Est?ticas', ! author => 'Autor' ); --- 61,80 ---- access_denied => 'Acceso Denegado', access_denied_msg => 'Est?s intentando acceder a una p?gina de administraci?n de P?ginas Est?ticas. Ten en cuenta que cualquier acceso a esta p?gina se registra', all_html_allowed => 'Se permite cualquier etiqueta HTML', results => 'Resultado de P?ginas Est?ticas', ! author => 'Autor', ! no_title_or_content => 'You must at least fill in the Title and Content fields.', ! no_such_page_logged_in => 'Sorry '.$_USER['username'].'..', ! no_such_page_anon => 'Please log in..', ! no_page_access_msg => "This could be because you're not logged in, or not a member of {$_CONF["site_name"]}. Please become a member of {$_CONF["site_name"]} to receive full membership access", ! php_msg => 'PHP: ', ! php_warn => 'Warning: PHP code in your page will be evaluated if you enable this option. Use with caution !!', ! exit_msg => 'Exit Type: ', ! exit_info => 'Enable for Login Required Message. Leave unchecked for normal security check and message.', ! deny_msg => 'Access to this page is denied. Either the page has been moved/removed or you do not have sufficient permissions.', ! stats_headline => 'Top Ten Static Pages', ! stats_page_title => 'Page Title', ! stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.' ); From dhaun at geeklog.net Sun Mar 9 13:10:28 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Sun, 9 Mar 2003 12:10:28 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/admin/install install.php,1.43,1.44 Message-ID: <200303091810.h29IASi05878@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin/install In directory internal.geeklog.net:/tmp/cvs-serv5818 Modified Files: install.php Log Message: Fixed spelling of staticpages.PHP feature (upercase "PHP"), test for static pages plugin can now identify a) not installed, b) original version, c) Phill's or Tom's version, d) v1.3 Index: install.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/install/install.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** install.php 9 Mar 2003 11:47:22 -0000 1.43 --- install.php 9 Mar 2003 18:10:26 -0000 1.44 *************** *** 215,219 **** * Checks for Static Pages Version * ! * @return 1 if Static Pages 1.1 by Phill or 1.2 by Tom, 0 if original Static Pages * */ --- 215,219 ---- * Checks for Static Pages Version * ! * @return 0 = not installed, 1 = original plugin, 2 = plugin by Phill or Tom, 3 = v1.3 * */ *************** *** 222,235 **** global $_TABLES; ! $result = DB_query ("SELECT * FROM {$_TABLES['staticpage']}"); ! $A = DB_fetchArray ($result); ! $fields = array (); ! foreach ($A as $name => $value) { ! $fields[] = $name; ! } ! if (in_array ('sp_pos',$fields,true)) { ! $retval = 1; ! } else { ! $retval = 0; } --- 222,242 ---- global $_TABLES; ! $retval = 0; ! ! if (DB_count ($_TABLES['plugins'], 'pi_name', 'staticpages') > 0) { ! $result = DB_query ("DESCRIBE {$_TABLES['staticpage']}"); ! $numrows = DB_numRows ($result); ! ! $retval = 1; // assume v1.1 for now ... ! ! for ($i = 0; $i < $numrows; $i++) { ! $A = DB_fetchArray ($result); ! if ($A[0] == 'sp_nf') { ! $retval = 3; // v1.3 ! break; ! } elseif ($A[0] == 'sp_pos') { ! $retval = 2; // v1.2 ! } ! } } *************** *** 392,396 **** // upgrade Static Pages plugin $spversion = get_SP_ver (); ! if ($spversion == 0) { // original version DB_query ("ALTER TABLE {$_TABLES['staticpage']} " . "ADD COLUMN group_id mediumint(8) unsigned DEFAULT '1'," --- 399,403 ---- // upgrade Static Pages plugin $spversion = get_SP_ver (); ! if ($spversion == 1) { // original version DB_query ("ALTER TABLE {$_TABLES['staticpage']} " . "ADD COLUMN group_id mediumint(8) unsigned DEFAULT '1'," *************** *** 402,410 **** . "ADD COLUMN sp_php tinyint(1) unsigned DEFAULT '0'," . "ADD COLUMN sp_nf tinyint(1) unsigned DEFAULT '0'"); ! DB_query ("INSERT INTO {$_TABLES['features']} (ft_name, ft_descr) VALUES ('staticpages.php','Ability to use PHP in static pages')"); $php_id = DB_insertId (); $group_id = DB_getItem ($_TABLES['groups'], 'grp_id', "grp_name = 'Static Page Admin'"); DB_query ("INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($php_id, $group_id)"); ! } else { // extended version by Phill or Tom DB_query ("ALTER TABLE {$_TABLES['staticpage']} " . "DROP COLUMN sp_pos," --- 409,417 ---- . "ADD COLUMN sp_php tinyint(1) unsigned DEFAULT '0'," . "ADD COLUMN sp_nf tinyint(1) unsigned DEFAULT '0'"); ! DB_query ("INSERT INTO {$_TABLES['features']} (ft_name, ft_descr) VALUES ('staticpages.PHP','Ability to use PHP in static pages')"); $php_id = DB_insertId (); $group_id = DB_getItem ($_TABLES['groups'], 'grp_id', "grp_name = 'Static Page Admin'"); DB_query ("INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES ($php_id, $group_id)"); ! } elseif ($spversion == 2) { // extended version by Phill or Tom DB_query ("ALTER TABLE {$_TABLES['staticpage']} " . "DROP COLUMN sp_pos," *************** *** 412,422 **** . "ADD COLUMN sp_nf tinyint(1) unsigned DEFAULT '0'"); } - DB_query ("UPDATE {$_TABLES['plugins']} SET pi_version = '1.3' WHERE pi_name = 'staticpages'"); ! // remove Static Pages 'lock' flag ! DB_query ("DELETE FROM {$_TABLES['vars']} WHERE name = 'staticpages'"); ! // remove Static Pages Admin group id ! DB_query ("DELETE FROM {$_TABLES['vars']} WHERE name = 'sp_group_id'"); $current_gl_version = '1.3.8'; --- 419,433 ---- . "ADD COLUMN sp_nf tinyint(1) unsigned DEFAULT '0'"); } ! if ($spversion > 0) { ! // update plugin version number ! DB_query ("UPDATE {$_TABLES['plugins']} SET pi_version = '1.3' WHERE pi_name = 'staticpages'"); ! // remove Static Pages 'lock' flag ! DB_query ("DELETE FROM {$_TABLES['vars']} WHERE name = 'staticpages'"); ! ! // remove Static Pages Admin group id ! DB_query ("DELETE FROM {$_TABLES['vars']} WHERE name = 'sp_group_id'"); ! } $current_gl_version = '1.3.8'; From dhaun at geeklog.net Mon Mar 10 05:50:02 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Mon, 10 Mar 2003 04:50:02 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/admin/plugins/staticpages index.php,1.15,1.16 Message-ID: <200303101050.h2AAo2i25714@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages In directory internal.geeklog.net:/tmp/cvs-serv25664/public_html/admin/plugins/staticpages Modified Files: index.php Log Message: You can now edit the ID of a static page (to create more readable URLs). Index: index.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages/index.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** index.php 9 Mar 2003 11:47:22 -0000 1.15 --- index.php 10 Mar 2003 10:50:00 -0000 1.16 *************** *** 6,11 **** // +---------------------------------------------------------------------------+ // | index.php | - // | Administration page. | // | | // +---------------------------------------------------------------------------+ // | Copyright (C) 2000-2003 by the following authors: | --- 6,11 ---- // +---------------------------------------------------------------------------+ // | index.php | // | | + // | Administration page. | // +---------------------------------------------------------------------------+ // | Copyright (C) 2000-2003 by the following authors: | *************** *** 55,59 **** * */ ! function form($A, $error=false) { global $_TABLES, $PHP_SELF, $_CONF, $HTTP_POST_VARS, $_USER, $LANG_STATIC,$_SP_CONF, $LANG_ACCESS, $mode, $sp_id; --- 55,59 ---- * */ ! function form ($A, $error = false) { global $_TABLES, $PHP_SELF, $_CONF, $HTTP_POST_VARS, $_USER, $LANG_STATIC,$_SP_CONF, $LANG_ACCESS, $mode, $sp_id; *************** *** 89,95 **** $sp_template->set_var('lang_accessrights', $LANG_ACCESS['accessrights']); $sp_template->set_var('lang_owner', $LANG_ACCESS['owner']); ! $sp_template->set_var('owner_username', DB_getItem($_TABLES['users'],'username',"uid = {$A['owner_id']}")); ! $sp_template->set_var('owner_id', $A['owner_id']); ! $sp_template->set_var('lang_group', $LANG_ACCESS['group']); $usergroups = SEC_getUserGroups(); if ($access == 3) { --- 89,95 ---- $sp_template->set_var('lang_accessrights', $LANG_ACCESS['accessrights']); $sp_template->set_var('lang_owner', $LANG_ACCESS['owner']); ! $sp_template->set_var('owner_username', DB_getItem($_TABLES['users'],'username',"uid = {$A['owner_id']}")); ! $sp_template->set_var('owner_id', $A['owner_id']); ! $sp_template->set_var('lang_group', $LANG_ACCESS['group']); $usergroups = SEC_getUserGroups(); if ($access == 3) { *************** *** 127,131 **** --- 127,138 ---- $sp_template->set_var('lang_writtenby', $LANG_STATIC['writtenby']); $sp_template->set_var('username', DB_getItem($_TABLES['users'],'username',"uid = {$A["sp_uid"]}")); + $sp_template->set_var ('lang_url', $LANG_STATIC['url']); + $sp_template->set_var ('lang_id', $LANG_STATIC['id']); $sp_template->set_var('sp_uid', $A['sp_uid']); + $sp_template->set_var('sp_id', $A['sp_id']); + $sp_template->set_var('sp_old_id', $A['sp_old_id']); + $sp_template->set_var ('example_url', COM_buildURL ($_CONF['site_url'] + . '/staticpages/index.php?page=' . $A['sp_id'])); + if (SEC_hasRights ('staticpages.PHP')) { if ($A['sp_php'] == 1) { *************** *** 139,143 **** $sp_template->set_var('php_msg',$LANG_STATIC['php_msg']); } else { ! $sp_template->set_var('php_type','hidden'); $sp_template->set_var('php_warn',''); $sp_template->set_var('php_msg',''); --- 146,150 ---- $sp_template->set_var('php_msg',$LANG_STATIC['php_msg']); } else { ! $sp_template->set_var('php_type','hidden'); $sp_template->set_var('php_warn',''); $sp_template->set_var('php_msg',''); *************** *** 200,204 **** $sp_template->set_var('lang_allowedhtml', $LANG_STATIC['all_html_allowed']); } - $sp_template->set_var('sp_id', $A['sp_id']); $sp_template->set_var('lang_hits', $LANG_STATIC['hits']); if (empty($A['sp_hits'])) { --- 207,210 ---- *************** *** 221,241 **** * */ ! function staticpageeditor($sp_id, $mode = '') { global $HTTP_POST_VARS, $_USER, $_CONF, $_TABLES; ! if (!empty($sp_id) && $mode == 'edit') { ! $result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} WHERE sp_id = '$sp_id' AND " . SP_getPerms('','3')); ! $A = DB_fetchArray($result); ! } elseif ($mode == 'edit') { ! $A['sp_id'] = COM_makesid(); ! $A['sp_uid'] = $_USER["uid"]; ! $A['unixdate'] = time(); ! } else { ! $A = $HTTP_POST_VARS; ! $A['sp_content'] = COM_checkHTML(COM_checkWords($A['sp_content'])); ! $A['sp_title'] = strip_tags($A['sp_title']); ! } ! return form($A); } --- 227,251 ---- * */ ! function staticpageeditor ($sp_id, $mode = '') { global $HTTP_POST_VARS, $_USER, $_CONF, $_TABLES; ! if (!empty ($sp_id) && $mode == 'edit') { ! $result = DB_query ("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} WHERE sp_id = '$sp_id' AND " . SP_getPerms ('', '3')); ! $A = DB_fetchArray ($result); ! $A['sp_old_id'] = $A['sp_id']; ! } elseif ($mode == 'edit') { ! $A['sp_id'] = COM_makesid (); ! $A['sp_uid'] = $_USER['uid']; ! $A['unixdate'] = time (); ! $A['sp_old_id'] = ''; ! } else { ! $A = $HTTP_POST_VARS; ! $A['sp_content'] = COM_checkHTML (COM_checkWords ($A['sp_content'])); ! $A['sp_title'] = strip_tags ($A['sp_title']); ! $A['sp_old_id'] = $HTTP_POST_VARS['sp_old_id']; ! } ! ! return form ($A); } *************** *** 243,247 **** # Displays a list of static pages ! function liststaticpages($page = 1) { global $_TABLES, $LANG_STATIC, $_CONF; --- 253,257 ---- # Displays a list of static pages ! function liststaticpages ($page = 1) { global $_TABLES, $LANG_STATIC, $_CONF; *************** *** 327,340 **** * @sp_php int Flag to indicate PHP usage * @sp_nf int Flag to indicate type of not found message * */ ! function submitstaticpage($sp_id,$sp_uid,$sp_title,$sp_content,$unixdate,$sp_hits,$sp_format, $sp_onmenu, $sp_label, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $sp_php, $sp_nf) { global $_CONF, $LANG12, $LANG_STATIC, $_SP_CONF, $_TABLES; ! if (!empty($sp_title) && !empty($sp_content)) { ! $date = date("Y-m-d H:i:s",$unixdate); ! if (empty($sp_hits)) $sp_hits = 0; if ($sp_onmenu== 'on') { --- 337,374 ---- * @sp_php int Flag to indicate PHP usage * @sp_nf int Flag to indicate type of not found message + * @sp_old_id string original ID of this static page * */ ! function submitstaticpage ($sp_id, $sp_uid, $sp_title, $sp_content, $unixdate, $sp_hits, $sp_format, $sp_onmenu, $sp_label, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $sp_php, $sp_nf, $sp_old_id) { global $_CONF, $LANG12, $LANG_STATIC, $_SP_CONF, $_TABLES; ! $sp_id = str_replace (' ', '', $sp_id); ! $sp_id = str_replace (array ('_', '/', '\\', ':'), '-', $sp_id); ! if (empty ($sp_id)) { ! $sp_id = COM_makesid (); ! } ! // Check for unique page ID ! $duplicate_id = false; ! $delete_old_page = false; ! if (DB_count ($_TABLES['staticpage'], 'sp_id', $sp_id) > 0) { ! if ($sp_id != $sp_old_id) { ! $duplicate_id = true; ! } ! } else { ! $delete_old_page = true; ! } ! ! if ($duplicate_id) { ! $retval .= COM_siteHeader (); ! $retval .= COM_errorLog ($LANG_STATIC['duplicate_id'], 2); ! $retval .= staticpageeditor ($sp_id); ! $retval .= COM_siteFooter (); ! echo $retval; ! } elseif (!empty ($sp_title) && !empty ($sp_content)) { ! $date = date ("Y-m-d H:i:s", $unixdate); ! ! if (empty ($sp_hits)) $sp_hits = 0; if ($sp_onmenu== 'on') { *************** *** 346,384 **** // Clean up the text if ($_SP_CONF['censor'] == 1) { ! $sp_content = COM_checkWords($sp_content); ! $sp_title = COM_checkWords($sp_title); ! $sp_label = COM_checkWords($sp_label); } if ($_SP_CONF['filter_html'] == 1) { ! $sp_content = COM_checkHTML($sp_content); ! $sp_title = COM_checkHTML($sp_title); ! $sp_label = COM_checkHTML($sp_label); } ! $sp_content = addslashes($sp_content); ! $sp_title = addslashes($sp_title); ! $sp_label = addslashes($sp_label); ! ! //$sp_content= addslashes(COM_checkHTML(COM_checkWords($sp_content))); ! //$sp_title = addslashes(htmlspecialchars(strip_tags(COM_checkWords($sp_title)))); ! //$sp_label = addslashes(htmlspecialchars(strip_tags(COM_checkWords($sp_label)))); ! //If user does not have php edit perms, then set php flag to 0. ! if (!SEC_hasRights('staticpages.PHP')) { ! $sp_php='0'; } ! list($perm_owner,$perm_group,$perm_members,$perm_anon) = SEC_getPermissionValues($perm_owner,$perm_group,$perm_members,$perm_anon); ! DB_save($_TABLES['staticpage'],'sp_id,sp_uid,sp_title,sp_content,sp_date,sp_hits,sp_format,sp_onmenu,sp_label,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,sp_php,sp_nf',"'$sp_id',$sp_uid,'$sp_title','$sp_content','$date',$sp_hits,'$sp_format',$sp_onmenu,'$sp_label',$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon,'$sp_php','$sp_nf'",$_CONF['site_admin_url'] . '/plugins/staticpages/index.php'); ! } else { ! $retval .= COM_siteHeader(); ! $retval .= COM_errorLog($LANG_STATIC['no_title_or_content'],2); ! $retval .= staticpageeditor($sp_id); ! $retval .= COM_siteFooter(); echo $retval; } } - // MAIN if (empty($mode) OR empty($sp_id)) { --- 380,418 ---- // Clean up the text if ($_SP_CONF['censor'] == 1) { ! $sp_content = COM_checkWords ($sp_content); ! $sp_title = COM_checkWords ($sp_title); ! $sp_label = COM_checkWords ($sp_label); } if ($_SP_CONF['filter_html'] == 1) { ! $sp_content = COM_checkHTML ($sp_content); ! $sp_title = COM_checkHTML ($sp_title); ! $sp_label = COM_checkHTML ($sp_label); } ! $sp_content = addslashes ($sp_content); ! $sp_title = addslashes ($sp_title); ! $sp_label = addslashes ($sp_label); ! // If user does not have php edit perms, then set php flag to 0. ! if (!SEC_hasRights ('staticpages.PHP')) { ! $sp_php = 0; } ! list($perm_owner,$perm_group,$perm_members,$perm_anon) = SEC_getPermissionValues($perm_owner,$perm_group,$perm_members,$perm_anon); ! DB_save ($_TABLES['staticpage'], 'sp_id,sp_uid,sp_title,sp_content,sp_date,sp_hits,sp_format,sp_onmenu,sp_label,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,sp_php,sp_nf', "'$sp_id',$sp_uid,'$sp_title','$sp_content','$date',$sp_hits,'$sp_format',$sp_onmenu,'$sp_label',$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon,'$sp_php','$sp_nf'"); ! if ($delete_old_page) { ! DB_delete ($_TABLES['staticpage'], 'sp_id', $sp_old_id); ! } ! echo COM_refresh ($_CONF['site_admin_url'] ! . '/plugins/staticpages/index.php'); } else { ! $retval .= COM_siteHeader (); ! $retval .= COM_errorLog ($LANG_STATIC['no_title_or_content'], 2); ! $retval .= staticpageeditor ($sp_id); ! $retval .= COM_siteFooter (); echo $retval; } } + // MAIN if (empty($mode) OR empty($sp_id)) { *************** *** 399,408 **** $display .= COM_siteFooter(); } else if (($mode == $LANG_STATIC['save']) && !empty ($LANG_STATIC['save'])) { ! submitstaticpage($sp_id,$sp_uid,$sp_title,$sp_content,$unixdate,$sp_hits,$sp_format,$sp_onmenu,$sp_label, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $sp_php, $sp_nf); ! COM_errorlog("Saved Static Page " . $sp_id,1); } else { ! $display .= COM_siteHeader('menu'); ! $display .= liststaticpages($sp_id); ! $display .= COM_siteFooter(); } --- 433,444 ---- $display .= COM_siteFooter(); } else if (($mode == $LANG_STATIC['save']) && !empty ($LANG_STATIC['save'])) { ! submitstaticpage ($sp_id, $sp_uid, $sp_title, $sp_content, $unixdate, ! $sp_hits, $sp_format, $sp_onmenu, $sp_label, $owner_id, $group_id, ! $perm_owner, $perm_group, $perm_members, $perm_anon, $sp_php, ! $sp_nf, $sp_old_id); } else { ! $display .= COM_siteHeader ('menu'); ! $display .= liststaticpages ($page); ! $display .= COM_siteFooter (); } From dhaun at geeklog.net Mon Mar 10 05:50:02 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Mon, 10 Mar 2003 04:50:02 -0600 Subject: [geeklog-cvs] geeklog-1.3/docs history,1.71,1.72 Message-ID: <200303101050.h2AAo2i25701@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/docs In directory internal.geeklog.net:/tmp/cvs-serv25664/docs Modified Files: history Log Message: You can now edit the ID of a static page (to create more readable URLs). Index: history =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/docs/history,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** history 9 Mar 2003 11:47:22 -0000 1.71 --- history 10 Mar 2003 10:50:00 -0000 1.72 *************** *** 4,7 **** --- 4,9 ---- ------- + - You can now edit the ID of a static page to create more readable URLs like + http://yoursite/staticpages/index.php?page=about - Integrated Tom Willet's version of the Static Pages plugin. This new version is now called Static Pages 1.3. From dhaun at geeklog.net Mon Mar 10 05:50:02 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Mon, 10 Mar 2003 04:50:02 -0600 Subject: [geeklog-cvs] geeklog-1.3/plugins/staticpages/language danish.php,1.2,1.3 english.php,1.4,1.5 german.php,1.5,1.6 polish.php,1.2,1.3 spanish.php,1.2,1.3 Message-ID: <200303101050.h2AAo2i25708@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language In directory internal.geeklog.net:/tmp/cvs-serv25664/plugins/staticpages/language Modified Files: danish.php english.php german.php polish.php spanish.php Log Message: You can now edit the ID of a static page (to create more readable URLs). Index: danish.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/danish.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** danish.php 9 Mar 2003 11:47:22 -0000 1.2 --- danish.php 10 Mar 2003 10:50:00 -0000 1.3 *************** *** 77,81 **** stats_page_title => 'Page Title', stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.' ); --- 77,83 ---- stats_page_title => 'Page Title', stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', ! id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.' ); Index: english.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/english.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** english.php 9 Mar 2003 11:47:22 -0000 1.4 --- english.php 10 Mar 2003 10:50:00 -0000 1.5 *************** *** 76,80 **** stats_page_title => 'Page Title', stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.' ); --- 76,82 ---- stats_page_title => 'Page Title', stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', ! id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.' ); Index: german.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/german.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** german.php 9 Mar 2003 11:47:22 -0000 1.5 --- german.php 10 Mar 2003 10:50:00 -0000 1.6 *************** *** 67,72 **** author => 'Autor', no_title_or_content => 'Bitte mindestens die Felder Titel und Inhalt ausf?llen.', ! no_such_page_logged_in => 'Sorry '.$_USER['username'].'..', ! no_such_page_anon => 'Please log in..', no_page_access_msg => "This could be because you're not logged in, or not a member of {$_CONF["site_name"]}. Please become a member of {$_CONF["site_name"]} to receive full membership access.", php_msg => 'PHP: ', --- 67,72 ---- author => 'Autor', no_title_or_content => 'Bitte mindestens die Felder Titel und Inhalt ausf?llen.', ! no_such_page_logged_in => 'Sorry, ' . $_USER['username'] . ' ...', ! no_such_page_anon => 'Bitte einloggen.', no_page_access_msg => "This could be because you're not logged in, or not a member of {$_CONF["site_name"]}. Please become a member of {$_CONF["site_name"]} to receive full membership access.", php_msg => 'PHP: ', *************** *** 75,82 **** exit_info => 'Art des Hinweistextes, wenn kein Zugriff auf die Seite erlaubt ist: Aktiviert = "Anmeldung erforderlich", nicht aktiviert = "Zugriff verweigert".', deny_msg => 'Zugriff auf diese Seite ist nicht m?glich. Die Seite wurde entweder umbenannt oder gel?scht oder Du hast nicht die n?tigen Zugriffsrechte.', ! stats_headline => 'Top Ten der Statische Seiten', stats_page_title => 'Titel', stats_hits => 'Angezeigt', ! stats_no_hits => 'Es gibt keine Statischen Seiten oder sie wurden von niemandem gelesen.' ); --- 75,84 ---- exit_info => 'Art des Hinweistextes, wenn kein Zugriff auf die Seite erlaubt ist: Aktiviert = "Anmeldung erforderlich", nicht aktiviert = "Zugriff verweigert".', deny_msg => 'Zugriff auf diese Seite ist nicht m?glich. Die Seite wurde entweder umbenannt oder gel?scht oder Du hast nicht die n?tigen Zugriffsrechte.', ! stats_headline => 'Top Ten der Statischen Seiten', stats_page_title => 'Titel', stats_hits => 'Angezeigt', ! stats_no_hits => 'Es gibt keine Statischen Seiten oder sie wurden von niemandem gelesen.', ! id => 'ID', ! duplicate_id => 'Diese ID wird bereits f?r eine andere Statische Seite benutzt. Bitte w?hle eine andere ID.' ); Index: polish.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/polish.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** polish.php 9 Mar 2003 11:47:22 -0000 1.2 --- polish.php 10 Mar 2003 10:50:00 -0000 1.3 *************** *** 76,80 **** stats_page_title => 'Page Title', stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.' ); --- 76,82 ---- stats_page_title => 'Page Title', stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', ! id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.' ); Index: spanish.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/spanish.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** spanish.php 9 Mar 2003 11:47:22 -0000 1.2 --- spanish.php 10 Mar 2003 10:50:00 -0000 1.3 *************** *** 76,80 **** stats_page_title => 'Page Title', stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.' ); --- 76,82 ---- stats_page_title => 'Page Title', stats_hits => 'Hits', ! stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', ! id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.' ); From dhaun at geeklog.net Mon Mar 10 05:50:02 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Mon, 10 Mar 2003 04:50:02 -0600 Subject: [geeklog-cvs] geeklog-1.3/plugins/staticpages/templates/admin editor.thtml,1.5,1.6 Message-ID: <200303101050.h2AAo2i25711@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/templates/admin In directory internal.geeklog.net:/tmp/cvs-serv25664/plugins/staticpages/templates/admin Modified Files: editor.thtml Log Message: You can now edit the ID of a static page (to create more readable URLs). Index: editor.thtml =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/templates/admin/editor.thtml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** editor.thtml 9 Mar 2003 11:47:22 -0000 1.5 --- editor.thtml 10 Mar 2003 10:50:00 -0000 1.6 *************** *** 3,14 **** - - - - - - - - --- 3,6 ---- *************** *** 33,36 **** --- 25,36 ---- + + + + + + + + ! ! --- 40,60 ---- + + + + + + + + ! ! *************** *** 95,99 **** {delete_option} ! --- 103,107 ---- {delete_option} ! From dhaun at geeklog.net Mon Mar 10 10:53:11 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Mon, 10 Mar 2003 09:53:11 -0600 Subject: [geeklog-cvs] geeklog-1.3/plugins/staticpages/templates/admin editor.thtml,1.6,1.7 Message-ID: <200303101553.h2AFrAi00434@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/templates/admin In directory internal.geeklog.net:/tmp/cvs-serv411/staticpages/templates/admin Modified Files: editor.thtml Log Message: Removed a comma ... Index: editor.thtml =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/templates/admin/editor.thtml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** editor.thtml 10 Mar 2003 10:50:00 -0000 1.6 --- editor.thtml 10 Mar 2003 15:53:08 -0000 1.7 *************** *** 26,30 **** ! --- 26,30 ---- ! From dhaun at geeklog.net Mon Mar 10 10:53:46 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Mon, 10 Mar 2003 09:53:46 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/admin/plugins/staticpages index.php,1.16,1.17 Message-ID: <200303101553.h2AFrki00472@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages In directory internal.geeklog.net:/tmp/cvs-serv449/public_html/admin/plugins/staticpages Modified Files: index.php Log Message: Fixed problem that could delete all your static pages when saving a new one ... Index: index.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages/index.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** index.php 10 Mar 2003 10:50:00 -0000 1.16 --- index.php 10 Mar 2003 15:53:44 -0000 1.17 *************** *** 342,346 **** function submitstaticpage ($sp_id, $sp_uid, $sp_title, $sp_content, $unixdate, $sp_hits, $sp_format, $sp_onmenu, $sp_label, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $sp_php, $sp_nf, $sp_old_id) { ! global $_CONF, $LANG12, $LANG_STATIC, $_SP_CONF, $_TABLES; $sp_id = str_replace (' ', '', $sp_id); --- 342,346 ---- function submitstaticpage ($sp_id, $sp_uid, $sp_title, $sp_content, $unixdate, $sp_hits, $sp_format, $sp_onmenu, $sp_label, $owner_id, $group_id, $perm_owner, $perm_group, $perm_members, $perm_anon, $sp_php, $sp_nf, $sp_old_id) { ! global $_CONF, $LANG12, $LANG_STATIC, $_SP_CONF, $_TABLES; $sp_id = str_replace (' ', '', $sp_id); *************** *** 357,362 **** $duplicate_id = true; } ! } else { ! $delete_old_page = true; } --- 357,364 ---- $duplicate_id = true; } ! } elseif (!empty ($sp_old_id)) { ! if ($sp_id != $sp_old_id) { ! $delete_old_page = true; ! } } *************** *** 368,374 **** echo $retval; } elseif (!empty ($sp_title) && !empty ($sp_content)) { ! $date = date ("Y-m-d H:i:s", $unixdate); ! if (empty ($sp_hits)) $sp_hits = 0; if ($sp_onmenu== 'on') { --- 370,376 ---- echo $retval; } elseif (!empty ($sp_title) && !empty ($sp_content)) { ! $date = date ("Y-m-d H:i:s", $unixdate); ! if (empty ($sp_hits)) $sp_hits = 0; if ($sp_onmenu== 'on') { *************** *** 378,382 **** } ! // Clean up the text if ($_SP_CONF['censor'] == 1) { $sp_content = COM_checkWords ($sp_content); --- 380,384 ---- } ! // Clean up the text if ($_SP_CONF['censor'] == 1) { $sp_content = COM_checkWords ($sp_content); *************** *** 399,408 **** list($perm_owner,$perm_group,$perm_members,$perm_anon) = SEC_getPermissionValues($perm_owner,$perm_group,$perm_members,$perm_anon); DB_save ($_TABLES['staticpage'], 'sp_id,sp_uid,sp_title,sp_content,sp_date,sp_hits,sp_format,sp_onmenu,sp_label,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,sp_php,sp_nf', "'$sp_id',$sp_uid,'$sp_title','$sp_content','$date',$sp_hits,'$sp_format',$sp_onmenu,'$sp_label',$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon,'$sp_php','$sp_nf'"); ! if ($delete_old_page) { DB_delete ($_TABLES['staticpage'], 'sp_id', $sp_old_id); } echo COM_refresh ($_CONF['site_admin_url'] . '/plugins/staticpages/index.php'); ! } else { $retval .= COM_siteHeader (); $retval .= COM_errorLog ($LANG_STATIC['no_title_or_content'], 2); --- 401,410 ---- list($perm_owner,$perm_group,$perm_members,$perm_anon) = SEC_getPermissionValues($perm_owner,$perm_group,$perm_members,$perm_anon); DB_save ($_TABLES['staticpage'], 'sp_id,sp_uid,sp_title,sp_content,sp_date,sp_hits,sp_format,sp_onmenu,sp_label,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,sp_php,sp_nf', "'$sp_id',$sp_uid,'$sp_title','$sp_content','$date',$sp_hits,'$sp_format',$sp_onmenu,'$sp_label',$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon,'$sp_php','$sp_nf'"); ! if ($delete_old_page && !empty ($sp_old_id)) { DB_delete ($_TABLES['staticpage'], 'sp_id', $sp_old_id); } echo COM_refresh ($_CONF['site_admin_url'] . '/plugins/staticpages/index.php'); ! } else { $retval .= COM_siteHeader (); $retval .= COM_errorLog ($LANG_STATIC['no_title_or_content'], 2); *************** *** 410,414 **** $retval .= COM_siteFooter (); echo $retval; ! } } --- 412,416 ---- $retval .= COM_siteFooter (); echo $retval; ! } } From dhaun at geeklog.net Mon Mar 10 13:36:03 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Mon, 10 Mar 2003 12:36:03 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/admin/plugins/staticpages index.php,1.17,1.18 Message-ID: <200303101836.h2AIa3i05888@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages In directory internal.geeklog.net:/tmp/cvs-serv5835/public_html/admin/plugins/staticpages Modified Files: index.php Log Message: Found this old feature request (#544847) ... You can now "clone" static pages. Index: index.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages/index.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** index.php 10 Mar 2003 15:53:44 -0000 1.17 --- index.php 10 Mar 2003 18:36:01 -0000 1.18 *************** *** 229,233 **** function staticpageeditor ($sp_id, $mode = '') { ! global $HTTP_POST_VARS, $_USER, $_CONF, $_TABLES; if (!empty ($sp_id) && $mode == 'edit') { --- 229,233 ---- function staticpageeditor ($sp_id, $mode = '') { ! global $HTTP_POST_VARS, $_USER, $_CONF, $_TABLES; if (!empty ($sp_id) && $mode == 'edit') { *************** *** 240,243 **** --- 240,250 ---- $A['unixdate'] = time (); $A['sp_old_id'] = ''; + } elseif (!empty ($sp_id) && $mode == 'clone') { + $result = DB_query ("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} WHERE sp_id = '$sp_id' AND " . SP_getPerms ('', '3')); + $A = DB_fetchArray ($result); + $A['sp_id'] = COM_makesid (); + $A['sp_uid'] = $_USER['uid']; + $A['unixdate'] = time (); + $A['sp_old_id'] = ''; } else { $A = $HTTP_POST_VARS; *************** *** 255,259 **** function liststaticpages ($page = 1) { ! global $_TABLES, $LANG_STATIC, $_CONF; $retval = ''; --- 262,266 ---- function liststaticpages ($page = 1) { ! global $_TABLES, $LANG_STATIC, $_CONF; $retval = ''; *************** *** 267,270 **** --- 274,278 ---- $sp_templates->set_var('lang_newpage', $LANG_STATIC['newpage']); $sp_templates->set_var('lang_adminhome', $LANG_STATIC['adminhome']); + $sp_templates->set_var('lang_instructions', $LANG_STATIC['instructions']); $sp_templates->set_var('lang_title', $LANG_STATIC['title']); $sp_templates->set_var('lang_writtenby', $LANG_STATIC['writtenby']); *************** *** 285,288 **** --- 293,297 ---- $sp_templates->set_var('row_number', $i); $sp_templates->set_var('page_display_url',COM_buildURL($_CONF['site_url'] . '/staticpages/index.php?page=' . $A['sp_id'])); + $sp_templates->set_var ('page_clone_url', COM_buildURL ($_CONF['site_admin_url'] . '/plugins/staticpages/index.php?mode=clone&sp_id=' . $A['sp_id'])); $sp_templates->set_var('sp_title', stripslashes ($A['sp_title'])); $sp_templates->set_var('username', DB_getItem($_TABLES['users'],'username',"uid = {$A["sp_uid"]}")); *************** *** 434,437 **** --- 443,450 ---- $display .= staticpageeditor($sp_id,$mode); $display .= COM_siteFooter(); + } else if ($mode == 'clone') { + $display .= COM_siteHeader ('menu'); + $display .= staticpageeditor ($sp_id,$mode); + $display .= COM_siteFooter (); } else if (($mode == $LANG_STATIC['save']) && !empty ($LANG_STATIC['save'])) { submitstaticpage ($sp_id, $sp_uid, $sp_title, $sp_content, $unixdate, From dhaun at geeklog.net Mon Mar 10 13:36:03 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Mon, 10 Mar 2003 12:36:03 -0600 Subject: [geeklog-cvs] geeklog-1.3/plugins/staticpages/templates/admin list.thtml,1.6,1.7 row.thtml,1.4,1.5 Message-ID: <200303101836.h2AIa3i05886@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/templates/admin In directory internal.geeklog.net:/tmp/cvs-serv5835/plugins/staticpages/templates/admin Modified Files: list.thtml row.thtml Log Message: Found this old feature request (#544847) ... You can now "clone" static pages. Index: list.thtml =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/templates/admin/list.thtml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** list.thtml 20 Aug 2002 13:14:57 -0000 1.6 --- list.thtml 10 Mar 2003 18:36:01 -0000 1.7 *************** *** 2,14 ****
{lang_writtenby}:{username}
{lang_lastupdated}:{sp_formateddate}
{lang_title}:
{lang_id}:
{lang_url}:{example_url}
{lang_content}: *************** *** 40,52 ****

{php_msg}  {php_warn}
{exit_msg}  {exit_info}
{lang_writtenby}:{username}
{lang_lastupdated}:{sp_formateddate}

{php_msg}  {php_warn}
{exit_msg}  {exit_info}
{lang_id}:
{lang_id}:
!
[ {lang_newpage} | {lang_adminhome} ]
! --- 2,17 ----
# {lang_title} {lang_writtenby}
! + + +
[ {lang_newpage} | {lang_adminhome} ]
{lang_instructions}
! Index: row.thtml =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/templates/admin/row.thtml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** row.thtml 20 Aug 2002 13:14:57 -0000 1.4 --- row.thtml 10 Mar 2003 18:36:01 -0000 1.5 *************** *** 4,7 **** --- 4,10 ---- + From dhaun at geeklog.net Mon Mar 10 13:36:03 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Mon, 10 Mar 2003 12:36:03 -0600 Subject: [geeklog-cvs] geeklog-1.3/plugins/staticpages/language danish.php,1.3,1.4 english.php,1.5,1.6 german.php,1.6,1.7 polish.php,1.3,1.4 spanish.php,1.3,1.4 Message-ID: <200303101836.h2AIa3i05887@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language In directory internal.geeklog.net:/tmp/cvs-serv5835/plugins/staticpages/language Modified Files: danish.php english.php german.php polish.php spanish.php Log Message: Found this old feature request (#544847) ... You can now "clone" static pages. Index: danish.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/danish.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** danish.php 10 Mar 2003 10:50:00 -0000 1.3 --- danish.php 10 Mar 2003 18:36:01 -0000 1.4 *************** *** 79,83 **** stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.' ); --- 79,84 ---- stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.', ! instructions => "To modify or delete a static page, click on that page's number below. To view a static page, click on the title of the page you wish to view. To create a new static page click on new page above. Click on [C] to create a copy of an existing page." ); Index: english.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/english.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** english.php 10 Mar 2003 10:50:00 -0000 1.5 --- english.php 10 Mar 2003 18:36:01 -0000 1.6 *************** *** 78,82 **** stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.' ); --- 78,83 ---- stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.', ! instructions => "To modify or delete a static page, click on that page's number below. To view a static page, click on the title of the page you wish to view. To create a new static page click on new page above. Click on [C] to create a copy of an existing page." ); Index: german.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/german.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** german.php 10 Mar 2003 10:50:00 -0000 1.6 --- german.php 10 Mar 2003 18:36:01 -0000 1.7 *************** *** 80,84 **** stats_no_hits => 'Es gibt keine Statischen Seiten oder sie wurden von niemandem gelesen.', id => 'ID', ! duplicate_id => 'Diese ID wird bereits f?r eine andere Statische Seite benutzt. Bitte w?hle eine andere ID.' ); --- 80,85 ---- stats_no_hits => 'Es gibt keine Statischen Seiten oder sie wurden von niemandem gelesen.', id => 'ID', ! duplicate_id => 'Diese ID wird bereits f?r eine andere Statische Seite benutzt. Bitte w?hle eine andere ID.', ! instructions => 'Auf die Nummer klicken, um eine Statische Seite zu ?ndern oder zu l?schen. Um eine Statische Seite anzusehen, auf deren Titel klicken. Auf Neue Seite (s.o.) klicken, um einen neue Statische Seite anzulegen. Auf das [C] klicken, um eine Kopie einer vorhandenen Seite zu erhalten.' ); Index: polish.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/polish.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** polish.php 10 Mar 2003 10:50:00 -0000 1.3 --- polish.php 10 Mar 2003 18:36:01 -0000 1.4 *************** *** 78,82 **** stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.' ); --- 78,83 ---- stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.', ! instructions => "To modify or delete a static page, click on that page's number below. To view a static page, click on the title of the page you wish to view. To create a new static page click on new page above. Click on [C] to create a copy of an existing page." ); Index: spanish.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/language/spanish.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** spanish.php 10 Mar 2003 10:50:00 -0000 1.3 --- spanish.php 10 Mar 2003 18:36:01 -0000 1.4 *************** *** 78,82 **** stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.' ); --- 78,83 ---- stats_no_hits => 'It appears that there are no static pages on this site or no one has ever viewed them.', id => 'ID', ! duplicate_id => 'The ID you chose for this static page is already in use. Please select another ID.', ! instructions => "To modify or delete a static page, click on that page's number below. To view a static page, click on the title of the page you wish to view. To create a new static page click on new page above. Click on [C] to create a copy of an existing page." ); From dhaun at geeklog.net Mon Mar 10 13:36:03 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Mon, 10 Mar 2003 12:36:03 -0600 Subject: [geeklog-cvs] geeklog-1.3/docs history,1.72,1.73 Message-ID: <200303101836.h2AIa3i05885@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/docs In directory internal.geeklog.net:/tmp/cvs-serv5835/docs Modified Files: history Log Message: Found this old feature request (#544847) ... You can now "clone" static pages. Index: history =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/docs/history,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** history 10 Mar 2003 10:50:00 -0000 1.72 --- history 10 Mar 2003 18:36:01 -0000 1.73 *************** *** 4,7 **** --- 4,8 ---- ------- + - You can now "clone" static pages, i.e. make a copy of an existing page. - You can now edit the ID of a static page to create more readable URLs like http://yoursite/staticpages/index.php?page=about From dhaun at geeklog.net Tue Mar 11 04:37:53 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Tue, 11 Mar 2003 03:37:53 -0600 Subject: [geeklog-cvs] geeklog-1.3/docs history,1.73,1.74 Message-ID: <200303110937.h2B9bqi29367@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/docs In directory internal.geeklog.net:/tmp/cvs-serv29353/docs Modified Files: history Log Message: Fixed the "late" update of portal blocks (bug #681855). Index: history =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/docs/history,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** history 10 Mar 2003 18:36:01 -0000 1.73 --- history 11 Mar 2003 09:37:50 -0000 1.74 *************** *** 4,7 **** --- 4,8 ---- ------- + - Fixed "late" update of portal blocks (bug #681855). - You can now "clone" static pages, i.e. make a copy of an existing page. - You can now edit the ID of a static page to create more readable URLs like From dhaun at geeklog.net Tue Mar 11 04:37:53 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Tue, 11 Mar 2003 03:37:53 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html lib-common.php,1.204,1.205 Message-ID: <200303110937.h2B9bri29370@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html In directory internal.geeklog.net:/tmp/cvs-serv29353/public_html Modified Files: lib-common.php Log Message: Fixed the "late" update of portal blocks (bug #681855). Index: lib-common.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/lib-common.php,v retrieving revision 1.204 retrieving revision 1.205 diff -C2 -d -r1.204 -r1.205 *** lib-common.php 1 Mar 2003 16:40:25 -0000 1.204 --- lib-common.php 11 Mar 2003 09:37:50 -0000 1.205 *************** *** 3050,3054 **** if( $A['type'] == 'portal' ) { ! COM_rdfCheck( $A['bid'], $A['rdfurl'], $A['date'] ); } --- 3050,3058 ---- if( $A['type'] == 'portal' ) { ! if( COM_rdfCheck( $A['bid'], $A['rdfurl'], $A['date'] )) ! { ! $A['content'] = DB_getItem( $_TABLES['blocks'], 'content', ! "bid = '{$A['bid']}'"); ! } } *************** *** 3120,3128 **** * @param string $date Last time the headlines were imported * @see function COM_rdfImport ! * @return void */ function COM_rdfCheck( $bid, $rdfurl, $date ) { $nextupdate = $date + 3600; --- 3124,3133 ---- * @param string $date Last time the headlines were imported * @see function COM_rdfImport ! * @return bool "true" if the block was updated, "false" if not */ function COM_rdfCheck( $bid, $rdfurl, $date ) { + $retval = false; $nextupdate = $date + 3600; *************** *** 3130,3134 **** --- 3135,3142 ---- { COM_rdfImport( $bid, $rdfurl ); + $retval = true; } + + return $retval; } From dhaun at geeklog.net Tue Mar 11 05:14:51 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Tue, 11 Mar 2003 04:14:51 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/admin block.php,1.47,1.48 Message-ID: <200303111014.h2BAEpi29908@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin In directory internal.geeklog.net:/tmp/cvs-serv29891/public_html/admin Modified Files: block.php Log Message: Fixed problem with the Older Stories block disappearing. Index: block.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/block.php,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** block.php 4 Feb 2003 20:33:32 -0000 1.47 --- block.php 11 Mar 2003 10:14:49 -0000 1.48 *************** *** 6,11 **** // +---------------------------------------------------------------------------+ // | block.php | - // | Geeklog block administration. | // | | // +---------------------------------------------------------------------------+ // | Copyright (C) 2000-2003 by the following authors: | --- 6,11 ---- // +---------------------------------------------------------------------------+ // | block.php | // | | + // | Geeklog block administration. | // +---------------------------------------------------------------------------+ // | Copyright (C) 2000-2003 by the following authors: | *************** *** 398,401 **** --- 398,404 ---- DB_save($_TABLES['blocks'],'bid,name,title,help,type,blockorder,content,tid,rdfurl,rdfupdated,phpblockfn,onleft,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon,is_enabled',"$bid,'$name','$title','$help','$type','$blockorder','$content','$tid','$rdfurl','$rdfupdated','$phpblockfn',$onleft,$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon,$is_enabled",$_CONF['site_admin_url'] . "/block.php?msg=11"); + if (($type == 'gldefault') && ($name == 'older_stories')) { + COM_olderStuff (); + } } else { From dhaun at geeklog.net Tue Mar 11 05:14:51 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Tue, 11 Mar 2003 04:14:51 -0600 Subject: [geeklog-cvs] geeklog-1.3/docs history,1.74,1.75 Message-ID: <200303111014.h2BAEpi29905@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/docs In directory internal.geeklog.net:/tmp/cvs-serv29891/docs Modified Files: history Log Message: Fixed problem with the Older Stories block disappearing. Index: history =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/docs/history,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** history 11 Mar 2003 09:37:50 -0000 1.74 --- history 11 Mar 2003 10:14:49 -0000 1.75 *************** *** 4,7 **** --- 4,9 ---- ------- + - Fixed problem with the Older Stories block disappearing when it was edited + (e.g. moved from left to right), bug #670673. - Fixed "late" update of portal blocks (bug #681855). - You can now "clone" static pages, i.e. make a copy of an existing page. From dhaun at geeklog.net Tue Mar 11 12:00:59 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Tue, 11 Mar 2003 11:00:59 -0600 Subject: [geeklog-cvs] geeklog-1.3/sql mysql_tableanddata.php,1.43,1.44 Message-ID: <200303111700.h2BH0xi03698@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/sql In directory internal.geeklog.net:/tmp/cvs-serv3643/sql Modified Files: mysql_tableanddata.php Log Message: Fixed problems with static pages permissions. Index: mysql_tableanddata.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/sql/mysql_tableanddata.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** mysql_tableanddata.php 9 Mar 2003 11:47:22 -0000 1.43 --- mysql_tableanddata.php 11 Mar 2003 17:00:57 -0000 1.44 *************** *** 546,550 **** owner_id mediumint(8) unsigned NOT NULL default '1', perm_owner tinyint(1) unsigned NOT NULL default '3', ! perm_group tinyint(1) unsigned NOT NULL default '3', perm_members tinyint(1) unsigned NOT NULL default '2', perm_anon tinyint(1) unsigned NOT NULL default '2', --- 546,550 ---- owner_id mediumint(8) unsigned NOT NULL default '1', perm_owner tinyint(1) unsigned NOT NULL default '3', ! perm_group tinyint(1) unsigned NOT NULL default '2', perm_members tinyint(1) unsigned NOT NULL default '2', perm_anon tinyint(1) unsigned NOT NULL default '2', From dhaun at geeklog.net Tue Mar 11 12:00:59 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Tue, 11 Mar 2003 11:00:59 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/admin/install install.php,1.44,1.45 Message-ID: <200303111700.h2BH0xi03688@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin/install In directory internal.geeklog.net:/tmp/cvs-serv3643/public_html/admin/install Modified Files: install.php Log Message: Fixed problems with static pages permissions. Index: install.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/install/install.php,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** install.php 9 Mar 2003 18:10:26 -0000 1.44 --- install.php 11 Mar 2003 17:00:56 -0000 1.45 *************** *** 404,408 **** . "ADD COLUMN owner_id mediumint(8) unsigned DEFAULT '1'," . "ADD COLUMN perm_owner tinyint(1) unsigned DEFAULT '3'," ! . "ADD COLUMN perm_group tinyint(1) unsigned DEFAULT '3'," . "ADD COLUMN perm_members tinyint(1) unsigned DEFAULT '2'," . "ADD COLUMN perm_anon tinyint(1) unsigned DEFAULT '2'," --- 404,408 ---- . "ADD COLUMN owner_id mediumint(8) unsigned DEFAULT '1'," . "ADD COLUMN perm_owner tinyint(1) unsigned DEFAULT '3'," ! . "ADD COLUMN perm_group tinyint(1) unsigned DEFAULT '2'," . "ADD COLUMN perm_members tinyint(1) unsigned DEFAULT '2'," . "ADD COLUMN perm_anon tinyint(1) unsigned DEFAULT '2'," *************** *** 429,432 **** --- 429,441 ---- // remove Static Pages Admin group id DB_query ("DELETE FROM {$_TABLES['vars']} WHERE name = 'sp_group_id'"); + + if ($spversion == 1) { + $result = DB_query ("SELECT DISTINCT sp_uid FROM {$_TABLES['staticpage']}"); + $authors = DB_numRows ($result); + for ($i = 0; $i < $authors; $i++) { + $A = DB_fetchArray ($result); + DB_query ("UPDATE {$_TABLES['staticpage']} SET owner_id = '{$A['sp_uid']}' WHERE sp_uid = '{$A['sp_uid']}'"); + } + } } From dhaun at geeklog.net Tue Mar 11 12:00:58 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Tue, 11 Mar 2003 11:00:58 -0600 Subject: [geeklog-cvs] geeklog-1.3/plugins/staticpages functions.inc,1.18,1.19 Message-ID: <200303111700.h2BH0wi03682@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages In directory internal.geeklog.net:/tmp/cvs-serv3643/plugins/staticpages Modified Files: functions.inc Log Message: Fixed problems with static pages permissions. Index: functions.inc =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/functions.inc,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** functions.inc 9 Mar 2003 11:47:22 -0000 1.18 --- functions.inc 11 Mar 2003 17:00:56 -0000 1.19 *************** *** 103,107 **** 'statrow'=>'singlestat.thtml')); if ($showsitestats == 1) { ! $result = DB_query ("SELECT count(*) AS cnt FROM {$_TABLES['staticpage']} WHERE " . SP_getPerms ()); $A = DB_fetchArray ($result); $total_pages = $A['cnt']; --- 103,111 ---- 'statrow'=>'singlestat.thtml')); if ($showsitestats == 1) { ! $perms = SP_getPerms (); ! if (!empty ($perms)) { ! $perms = ' WHERE ' . $perms; ! } ! $result = DB_query ("SELECT count(*) AS cnt FROM {$_TABLES['staticpage']}" . $perms); $A = DB_fetchArray ($result); $total_pages = $A['cnt']; *************** *** 110,114 **** $retval .= '
# {lang_title} {lang_writtenby} + [C] + {sp_title} ' . $total_pages . '  
'; } else { ! $result = DB_query ("SELECT sp_id,sp_title,sp_hits FROM {$_TABLES['staticpage']} WHERE sp_hits > 0 AND" . SP_getPerms() . ' ORDER BY sp_hits DESC LIMIT 10'); $nrows = DB_numRows ($result); $retval .= COM_startBlock ($LANG_STATIC['stats_headline']); --- 114,122 ---- $retval .= '' . $total_pages . '  '; } else { ! $perms = SP_getPerms (); ! if (!empty ($perms)) { ! $perms = ' AND ' . $perms; ! } ! $result = DB_query ("SELECT sp_id,sp_title,sp_hits FROM {$_TABLES['staticpage']} WHERE sp_hits > 0" . $perms . ' ORDER BY sp_hits DESC LIMIT 10'); $nrows = DB_numRows ($result); $retval .= COM_startBlock ($LANG_STATIC['stats_headline']); *************** *** 262,266 **** if (SEC_hasRights ('staticpages.edit,staticpages.delete', 'OR')) { ! $result = DB_query ("SELECT count(*) AS cnt FROM {$_TABLES['staticpage']} WHERE " . SP_getPerms ('','3')); $A = DB_fetchArray ($result); $total_pages = $A['cnt']; --- 270,278 ---- if (SEC_hasRights ('staticpages.edit,staticpages.delete', 'OR')) { ! $perms = SP_getPerms ('', '3'); ! if (!empty ($perms)) { ! $perms = ' WHERE ' . $perms; ! } ! $result = DB_query ("SELECT count(*) AS cnt FROM {$_TABLES['staticpage']}" . $perms); $A = DB_fetchArray ($result); $total_pages = $A['cnt']; *************** *** 272,276 **** * Return SQL where statement with appropriate permissions * ! * Takes User id and permission and returns SQL where clause which will return the appropriate objects. * This assumes that the table has the following security structure: * owner_id | mediumint(8) --- 284,289 ---- * Return SQL where statement with appropriate permissions * ! * Takes User id and permission and returns SQL where clause which will return ! * the appropriate objects. * This assumes that the table has the following security structure: * owner_id | mediumint(8) *************** *** 289,314 **** * */ ! function SP_getPerms($table='',$access='2',$u_id='') { ! global $_USER, $_GROUPS; ! ! if ($table != '') { $table .= '.'; } ! if ($u_id == '') { ! $uid = $_USER['uid']; ! $GROUPS = $_GROUPS; ! } else { ! $uid = $u_id; ! $GROUPS = SEC_getUserGroups($uid); ! } ! $where = "((" . $table . "perm_anon >= $access)"; ! // check to see if anonymous user ! if ($uid > 1) { ! $where .= " OR (" . $table . "perm_members >= $access)"; ! foreach ($GROUPS as $group) { ! $where .= " OR ((" . $table . "group_id = $group) AND (" . $table . "perm_group >= $access))"; ! } ! $where .= " OR ((" . $table . "owner_id = $uid) AND (" . $table . "perm_owner >= $access))"; } ! return $where . ")"; } --- 302,343 ---- * */ ! function SP_getPerms ($table = '', $access = '2', $u_id = '') { ! global $_USER, $_GROUPS; ! ! if ($table != '') { $table .= '.'; } ! ! if ($u_id == '') { ! $uid = $_USER['uid']; ! $GROUPS = $_GROUPS; ! } else { ! $uid = $u_id; ! $GROUPS = SEC_getUserGroups ($uid); } ! ! if (SEC_inGroup ('Root', $uid)) { ! return ''; ! } ! ! $sql = '('; ! ! if ($uid > 1) { ! $sql .= "((owner_id = '{$uid}') AND (perm_owner >= $access)) OR "; ! ! $groupList = ''; ! foreach ($GROUPS as $grp) { ! $groupList .= $grp . ','; ! } ! $groupList = substr ($groupList, 0, -1); ! $sql .= "((group_id IN ($groupList)) AND (perm_group >= $access)) OR "; ! ! $sql .= "(perm_members >= $access)"; ! } else { ! $sql .= "perm_anon >= $access"; ! } ! ! $sql .= ')'; ! ! return $sql; } From dhaun at geeklog.net Tue Mar 11 12:00:58 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Tue, 11 Mar 2003 11:00:58 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html index.php,1.42,1.43 Message-ID: <200303111700.h2BH0wi03685@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html In directory internal.geeklog.net:/tmp/cvs-serv3643/public_html Modified Files: index.php Log Message: Fixed problems with static pages permissions. Index: index.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/index.php,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** index.php 9 Mar 2003 11:47:22 -0000 1.42 --- index.php 11 Mar 2003 17:00:56 -0000 1.43 *************** *** 81,85 **** if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = 'staticpages'") == 1) { ! $spsql = "SELECT sp_content,sp_label,sp_format,sp_php FROM {$_TABLES['staticpage']} WHERE sp_title = 'frontpage' AND " . SP_getPerms (); $result = DB_query ($spsql); --- 81,89 ---- if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = 'staticpages'") == 1) { ! $perms = SP_getPerms (); ! if (!empty ($perms)) { ! $perms = ' AND ' . $perms; ! } ! $spsql = "SELECT sp_content,sp_label,sp_format,sp_php FROM {$_TABLES['staticpage']} WHERE sp_title = 'frontpage'" . $perms; $result = DB_query ($spsql); *************** *** 209,217 **** $sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR "; $sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR "; ! $sql .= "(perm_members >= 2) OR "; } - $sql .= "(perm_anon >= 2))"; if (!empty($U['aids'])) { $AIDS = explode(' ',$U['aids']); for ($z = 0; $z < sizeof($AIDS); $z++) { --- 213,223 ---- $sql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR "; $sql .= "(group_id IN ($groupList) AND perm_group >= 2) OR "; ! $sql .= "(perm_members >= 2))"; ! } else { ! $sql .= "perm_anon >= 2)"; } if (!empty($U['aids'])) { + $sql .= ' '; $AIDS = explode(' ',$U['aids']); for ($z = 0; $z < sizeof($AIDS); $z++) { *************** *** 221,224 **** --- 227,231 ---- if (!empty($U['tids'])) { + $sql .= ' '; $TIDS = explode(' ',$U['tids']); for ($z = 0; $z < sizeof($TIDS); $z++) { *************** *** 228,232 **** if ($newstories) { ! $sql .= "AND (date >= (NOW() - INTERVAL {$_CONF['newstoriesinterval']} SECOND))"; } --- 235,239 ---- if ($newstories) { ! $sql .= "AND (date >= (NOW() - INTERVAL {$_CONF['newstoriesinterval']} SECOND)) "; } *************** *** 249,255 **** $countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR "; $countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR "; ! $countsql .= "(perm_members >= 2) OR "; } - $countsql .= "(perm_anon >= 2))"; if ($newstories) { --- 256,263 ---- $countsql .= "(owner_id = {$_USER['uid']} AND perm_owner >= 2) OR "; $countsql .= "(group_id IN ($groupList) AND perm_group >= 2) OR "; ! $countsql .= "(perm_members >= 2))"; ! } else { ! $countsql .= "perm_anon >= 2)"; } if ($newstories) { *************** *** 264,278 **** for ($x = 1; $x <= $nrows; $x++) { $A = DB_fetchArray($result); ! if (SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']) > 0) { ! if ($A['featured'] == 1) { ! $feature = 'true'; ! } elseif (($x == 1) && ($_CONF['showfirstasfeatured'] == 1)) { ! $feature = 'true'; ! $A['featured'] = 1; ! } ! $display .= COM_article($A,'y'); } } ! // Print Google-like paging navigation if (empty($topic)) { --- 272,284 ---- for ($x = 1; $x <= $nrows; $x++) { $A = DB_fetchArray($result); ! if ($A['featured'] == 1) { ! $feature = 'true'; ! } elseif (($x == 1) && ($_CONF['showfirstasfeatured'] == 1)) { ! $feature = 'true'; ! $A['featured'] = 1; } + $display .= COM_article($A,'y'); } ! // Print Google-like paging navigation if (empty($topic)) { From dhaun at geeklog.net Tue Mar 11 12:00:59 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Tue, 11 Mar 2003 11:00:59 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/admin/plugins/staticpages index.php,1.18,1.19 install.php,1.9,1.10 Message-ID: <200303111700.h2BH0xi03693@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages In directory internal.geeklog.net:/tmp/cvs-serv3643/public_html/admin/plugins/staticpages Modified Files: index.php install.php Log Message: Fixed problems with static pages permissions. Index: index.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages/index.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** index.php 10 Mar 2003 18:36:01 -0000 1.18 --- index.php 11 Mar 2003 17:00:57 -0000 1.19 *************** *** 232,236 **** if (!empty ($sp_id) && $mode == 'edit') { ! $result = DB_query ("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} WHERE sp_id = '$sp_id' AND " . SP_getPerms ('', '3')); $A = DB_fetchArray ($result); $A['sp_old_id'] = $A['sp_id']; --- 232,240 ---- if (!empty ($sp_id) && $mode == 'edit') { ! $perms = SP_getPerms ('', '3'); ! if (!empty ($perms)) { ! $perms = ' AND ' . $perms; ! } ! $result = DB_query ("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} WHERE sp_id = '$sp_id'" . $perms); $A = DB_fetchArray ($result); $A['sp_old_id'] = $A['sp_id']; *************** *** 241,245 **** $A['sp_old_id'] = ''; } elseif (!empty ($sp_id) && $mode == 'clone') { ! $result = DB_query ("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} WHERE sp_id = '$sp_id' AND " . SP_getPerms ('', '3')); $A = DB_fetchArray ($result); $A['sp_id'] = COM_makesid (); --- 245,253 ---- $A['sp_old_id'] = ''; } elseif (!empty ($sp_id) && $mode == 'clone') { ! $perms = SP_getPerms ('', '3'); ! if (!empty ($perms)) { ! $perms = ' AND ' . $perms; ! } ! $result = DB_query ("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} WHERE sp_id = '$sp_id'" . $perms); $A = DB_fetchArray ($result); $A['sp_id'] = COM_makesid (); *************** *** 283,287 **** //$limit = (50 * $page) - 50; //$result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} ORDER BY sp_date DESC LIMIT $limit,50"); ! $result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} WHERE " . SP_getPerms('','3') . " ORDER BY sp_date DESC"); $nrows = DB_numRows($result); if ($nrows > 0) { --- 291,299 ---- //$limit = (50 * $page) - 50; //$result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} ORDER BY sp_date DESC LIMIT $limit,50"); ! $perms = SP_getPerms ('', '3'); ! if (!empty ($perms)) { ! $perms = ' WHERE ' . $perms; ! } ! $result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']}" . $perms . " ORDER BY sp_date DESC"); $nrows = DB_numRows($result); if ($nrows > 0) { Index: install.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages/install.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** install.php 9 Mar 2003 11:47:22 -0000 1.9 --- install.php 11 Mar 2003 17:00:57 -0000 1.10 *************** *** 81,85 **** . "owner_id mediumint(8) unsigned NOT NULL default '1'," . "perm_owner tinyint(1) unsigned NOT NULL default '3'," ! . "perm_group tinyint(1) unsigned NOT NULL default '3'," . "perm_members tinyint(1) unsigned NOT NULL default '2'," . "perm_anon tinyint(1) unsigned NOT NULL default '2'," --- 81,85 ---- . "owner_id mediumint(8) unsigned NOT NULL default '1'," . "perm_owner tinyint(1) unsigned NOT NULL default '3'," ! . "perm_group tinyint(1) unsigned NOT NULL default '2'," . "perm_members tinyint(1) unsigned NOT NULL default '2'," . "perm_anon tinyint(1) unsigned NOT NULL default '2'," From dhaun at geeklog.net Tue Mar 11 12:00:59 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Tue, 11 Mar 2003 11:00:59 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/staticpages index.php,1.10,1.11 Message-ID: <200303111700.h2BH0xi03695@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/staticpages In directory internal.geeklog.net:/tmp/cvs-serv3643/public_html/staticpages Modified Files: index.php Log Message: Fixed problems with static pages permissions. Index: index.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/staticpages/index.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** index.php 9 Mar 2003 11:47:22 -0000 1.10 --- index.php 11 Mar 2003 17:00:57 -0000 1.11 *************** *** 50,54 **** } ! $result = DB_query ("SELECT * FROM {$_TABLES['staticpage']} WHERE (sp_id = '$page') AND " . SP_getPerms ()); $count = DB_numRows ($result); --- 50,58 ---- } ! $perms = SP_getPerms (); ! if (!empty ($perms)) { ! $perms = ' AND ' . $perms; ! } ! $result = DB_query ("SELECT * FROM {$_TABLES['staticpage']} WHERE (sp_id = '$page')" . $perms); $count = DB_numRows ($result); From dhaun at geeklog.net Tue Mar 11 17:08:26 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Tue, 11 Mar 2003 16:08:26 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/admin link.php,1.31,1.32 Message-ID: <200303112208.h2BM8Qi09938@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin In directory internal.geeklog.net:/tmp/cvs-serv9907/public_html/admin Modified Files: link.php Log Message: Erm, I guess we really want to display a proper error message (instead of an SQL error) when you don't fill in all the fields for a link ... Index: link.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/link.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** link.php 2 Feb 2003 19:46:47 -0000 1.31 --- link.php 11 Mar 2003 22:08:24 -0000 1.32 *************** *** 6,17 **** // +---------------------------------------------------------------------------+ // | link.php | - // | Geeklog links administration page. | // | | // +---------------------------------------------------------------------------+ // | 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 | // +---------------------------------------------------------------------------+ // | | --- 6,18 ---- // +---------------------------------------------------------------------------+ // | link.php | // | | + // | Geeklog links administration page. | // +---------------------------------------------------------------------------+ // | Copyright (C) 2000,2001 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 | // +---------------------------------------------------------------------------+ // | | *************** *** 252,256 **** $retval .= COM_siteHeader('menu'); $retval .= COM_errorLog($LANG23[10],2); ! editlink($mode,$lid); $retval .= COM_siteFooter(); return $retval; --- 253,261 ---- $retval .= COM_siteHeader('menu'); $retval .= COM_errorLog($LANG23[10],2); ! if (DB_count ($_TABLES['links'], 'lid', $lid) > 0) { ! $retval .= editlink ($mode, $lid); ! } else { ! $retval .= editlink ($mode, ''); ! } $retval .= COM_siteFooter(); return $retval; From dhaun at geeklog.net Wed Mar 12 06:34:08 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Wed, 12 Mar 2003 05:34:08 -0600 Subject: [geeklog-cvs] geeklog-1.3/plugins/staticpages/templates/admin list.thtml,1.7,1.8 Message-ID: <200303121134.h2CBY8i26290@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/templates/admin In directory internal.geeklog.net:/tmp/cvs-serv26271/plugins/staticpages/templates/admin Modified Files: list.thtml Log Message: Added paging for the list of Static Pages (for more than 50 pages). Index: list.thtml =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/plugins/staticpages/templates/admin/list.thtml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** list.thtml 10 Mar 2003 18:36:01 -0000 1.7 --- list.thtml 12 Mar 2003 11:34:05 -0000 1.8 *************** *** 21,24 **** --- 21,25 ---- {lang_nopages_msg} + {google_paging} {end_block} From dhaun at geeklog.net Wed Mar 12 06:34:08 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Wed, 12 Mar 2003 05:34:08 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html/admin/plugins/staticpages index.php,1.19,1.20 Message-ID: <200303121134.h2CBY8i26291@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages In directory internal.geeklog.net:/tmp/cvs-serv26271/public_html/admin/plugins/staticpages Modified Files: index.php Log Message: Added paging for the list of Static Pages (for more than 50 pages). Index: index.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/admin/plugins/staticpages/index.php,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** index.php 11 Mar 2003 17:00:57 -0000 1.19 --- index.php 12 Mar 2003 11:34:05 -0000 1.20 *************** *** 13,17 **** // | Authors: Tony Bibbs - tony at tonybibbs.com | // | Phill Gillespie - phill at mediaaustralia.com.au | ! // | Tom Willett - twillett at users.sourceforge.net // +---------------------------------------------------------------------------+ // | | --- 13,18 ---- // | Authors: Tony Bibbs - tony at tonybibbs.com | // | Phill Gillespie - phill at mediaaustralia.com.au | ! // | Tom Willett - twillett at users.sourceforge.net | ! // | Dirk Haun - dirk at haun-online.de | // +---------------------------------------------------------------------------+ // | | *************** *** 288,336 **** $sp_templates->set_var('lang_url', $LANG_STATIC['url']); ! //if (empty($page)) $page = 1; ! //$limit = (50 * $page) - 50; ! //$result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']} ORDER BY sp_date DESC LIMIT $limit,50"); ! $perms = SP_getPerms ('', '3'); ! if (!empty ($perms)) { ! $perms = ' WHERE ' . $perms; } ! $result = DB_query("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']}" . $perms . " ORDER BY sp_date DESC"); ! $nrows = DB_numRows($result); ! if ($nrows > 0) { ! for ($i = 1; $i <= $nrows; $i++) { ! //$scount = (50 * $page) - 50 + $i; ! $A = DB_fetchArray($result); ! $sp_templates->set_var('sp_id', $A['sp_id']); ! $sp_templates->set_var('page_edit_url',COM_buildURL($_CONF['site_admin_url'] . '/plugins/staticpages/index.php?mode=edit&sp_id=' . $A['sp_id'])); ! $sp_templates->set_var('row_number', $i); ! $sp_templates->set_var('page_display_url',COM_buildURL($_CONF['site_url'] . '/staticpages/index.php?page=' . $A['sp_id'])); ! $sp_templates->set_var ('page_clone_url', COM_buildURL ($_CONF['site_admin_url'] . '/plugins/staticpages/index.php?mode=clone&sp_id=' . $A['sp_id'])); ! $sp_templates->set_var('sp_title', stripslashes ($A['sp_title'])); ! $sp_templates->set_var('username', DB_getItem($_TABLES['users'],'username',"uid = {$A["sp_uid"]}")); ! $curtime = COM_getUserDateTimeFormat($A['unixdate']); ! $sp_templates->set_var('sp_date', $curtime[0]); ! $sp_templates->parse('list_item', 'row', true); ! } ! $sp_templates->set_var('lang_nopages_msg', ''); ! /* ! $retval .= ""; ! if (DB_count($_TABLES['staticpage']) > 50) { ! $prevpage = $page - 1; ! $nextpage = $page + 1; ! $num_pages = DB_count($_TABLES['staticpage']) / 50; ! if ($page > 1) { ! $retval .= "{$LANG50[1]}  "; ! } ! if ($page < $num_pages) { ! $retval .= "{$LANG50[2]} "; ! } ! } ! $retval .= " ! */ ! } else { ! $sp_templates->set_var('lang_nopages_msg', $LANG_STATIC['nopages']); ! $sp_templates->set_var('list_item', ''); } ! $sp_templates->set_var('end_block', COM_endBlock()); $retval .= $sp_templates->parse('output', 'list'); --- 289,351 ---- $sp_templates->set_var('lang_url', $LANG_STATIC['url']); ! $perpage = 50; ! if ($page <= 0) { ! $page = 1; ! } ! ! $perms = SP_getPerms ('', '3'); ! if (!empty ($perms)) { ! $perms = ' WHERE ' . $perms; ! } ! ! $result = DB_query ("SELECT COUNT(*) AS count FROM {$_TABLES['staticpage']}" . $perms); ! $C = DB_fetchArray ($result); ! $numpages = ceil ($C['count'] / $perpage); ! ! if ($page > $numpages) { ! $page = 1; ! } ! $start = ($page - 1) * $perpage; ! ! $result = DB_query ("SELECT *,UNIX_TIMESTAMP(sp_date) AS unixdate FROM {$_TABLES['staticpage']}" . $perms . " ORDER BY sp_date DESC LIMIT $start,$perpage"); ! $nrows = DB_numRows ($result); ! if ($nrows > 0) { ! for ($i = 1; $i <= $nrows; $i++) { ! $A = DB_fetchArray($result); ! $sp_templates->set_var ('sp_id', $A['sp_id']); ! $sp_templates->set_var ('page_edit_url', ! COM_buildURL ($_CONF['site_admin_url'] ! . '/plugins/staticpages/index.php?mode=edit&sp_id=' ! . $A['sp_id'])); ! $sp_templates->set_var ('row_number', $i + $start); ! $sp_templates->set_var ('page_display_url', ! COM_buildURL ($_CONF['site_url'] ! . '/staticpages/index.php?page=' . $A['sp_id'])); ! $sp_templates->set_var ('page_clone_url', ! COM_buildURL ($_CONF['site_admin_url'] ! . '/plugins/staticpages/index.php?mode=clone&sp_id=' ! . $A['sp_id'])); ! $sp_templates->set_var ('sp_title', stripslashes ($A['sp_title'])); ! $sp_templates->set_var ('username', DB_getItem ($_TABLES['users'], ! 'username', "uid = {$A["sp_uid"]}")); ! $curtime = COM_getUserDateTimeFormat ($A['unixdate']); ! $sp_templates->set_var ('sp_date', $curtime[0]); ! $sp_templates->parse ('list_item', 'row', true); } ! $sp_templates->set_var ('lang_nopages_msg', ''); ! ! $baseurl = $_CONF['site_admin_url'] . '/plugins/staticpages/index.php'; ! if ($numpages > 1) { ! $sp_templates->set_var ('google_paging', ! COM_printPageNavigation ($baseurl, $page, $numpages)); ! } else { ! $sp_templates->set_var ('google_paging', ''); ! } ! } else { ! $sp_templates->set_var ('lang_nopages_msg', $LANG_STATIC['nopages']); ! $sp_templates->set_var ('list_item', ''); ! $sp_templates->set_var ('google_paging', ''); } ! $sp_templates->set_var ('end_block', COM_endBlock ()); $retval .= $sp_templates->parse('output', 'list'); From dhaun at geeklog.net Wed Mar 12 14:02:03 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Wed, 12 Mar 2003 13:02:03 -0600 Subject: [geeklog-cvs] geeklog-1.3/public_html index.php,1.43,1.44 Message-ID: <200303121902.h2CJ23i04200@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/public_html In directory internal.geeklog.net:/tmp/cvs-serv4149/public_html Modified Files: index.php Log Message: Static Pages named topic: (e.g. topic:GeekLog) will be displayed on top of that topic (based on a hack by James Fryer). Also made sure that any messages are displayed above anything else. Index: index.php =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/index.php,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** index.php 11 Mar 2003 17:00:56 -0000 1.43 --- index.php 12 Mar 2003 19:02:01 -0000 1.44 *************** *** 76,143 **** $shownews = true; ! if (empty ($topic)) { ! // check if static pages plugin is installed and enabled ! if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = 'staticpages'") == 1) { ! $perms = SP_getPerms (); ! if (!empty ($perms)) { ! $perms = ' AND ' . $perms; ! } ! $spsql = "SELECT sp_content,sp_label,sp_format,sp_php FROM {$_TABLES['staticpage']} WHERE sp_title = 'frontpage'" . $perms; ! $result = DB_query ($spsql); ! if (DB_numRows ($result) > 0) { ! $spresult = DB_fetchArray ($result); ! if ($spresult['sp_label'] == 'nonews') { // replace news entirely ! $shownews = false; ! switch ($spresult['sp_format']) { ! case 'noblocks': ! $display .= COM_siteHeader ('none'); ! break; ! case 'allblocks': ! case 'leftblocks': ! $display .= COM_siteHeader ('menu'); ! break; ! } ! // Check for type (ie html or php) ! if ($spresult['sp_php'] == 1) { ! $display .= eval (stripslashes ($spresult['sp_content'])); ! } else { ! $display .= stripslashes ($spresult['sp_content']); ! } ! if ($spresult['sp_format'] == 'allblocks') { ! $display .= COM_siteFooter (true); ! } else if ($spresult['sp_format'] != 'blankpage') { ! $display .= COM_siteFooter (); ! } ! } else { // display static page content before the news ! $display .= COM_siteHeader (); ! if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) { ! $display .= COM_startBlock ($spresult['sp_label']); ! } ! // Check for type (ie html or php) ! if ($spresult['sp_php'] == 1) { ! $display .= eval (stripslashes ($spresult['sp_content'])); ! } else { ! $display .= stripslashes ($spresult['sp_content']); ! } ! if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) { ! $display .= COM_endBlock (); ! } } - } else { - $display .= COM_siteHeader(); } } else { ! $display .= COM_siteHeader(); } } else { ! $display .= COM_siteHeader(); } --- 76,147 ---- $shownews = true; ! // check if static pages plugin is installed and enabled ! if (DB_getItem ($_TABLES['plugins'], 'pi_enabled', "pi_name = 'staticpages'") == 1) { ! if (empty ($topic)) { ! $staticpage_title = 'frontpage'; ! } else { ! $staticpage_title = 'topic:' . $topic; ! } ! $perms = SP_getPerms (); ! if (!empty ($perms)) { ! $perms = ' AND ' . $perms; ! } ! $spsql = "SELECT sp_content,sp_label,sp_format,sp_php FROM {$_TABLES['staticpage']} WHERE sp_title = '{$staticpage_title}'" . $perms; ! $result = DB_query ($spsql); ! if (DB_numRows ($result) > 0) { ! $spresult = DB_fetchArray ($result); ! if ($spresult['sp_label'] == 'nonews') { // replace news entirely ! $shownews = false; ! switch ($spresult['sp_format']) { ! case 'noblocks': ! $display .= COM_siteHeader ('none') ! . COM_showMessage ($HTTP_GET_VARS['msg']); ! break; ! case 'allblocks': ! case 'leftblocks': ! $display .= COM_siteHeader ('menu') ! . COM_showMessage ($HTTP_GET_VARS['msg']); ! break; ! } ! // Check for type (ie html or php) ! if ($spresult['sp_php'] == 1) { ! $display .= eval (stripslashes ($spresult['sp_content'])); ! } else { ! $display .= stripslashes ($spresult['sp_content']); ! } ! if ($spresult['sp_format'] == 'allblocks') { ! $display .= COM_siteFooter (true); ! } else if ($spresult['sp_format'] != 'blankpage') { ! $display .= COM_siteFooter (); ! } ! } else { // display static page content before the news ! $display .= COM_siteHeader () ! . COM_showMessage ($HTTP_GET_VARS['msg']); ! if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) { ! $display .= COM_startBlock ($spresult['sp_label']); ! } ! // Check for type (ie html or php) ! if ($spresult['sp_php'] == 1) { ! $display .= eval (stripslashes ($spresult['sp_content'])); ! } else { ! $display .= stripslashes ($spresult['sp_content']); ! } ! if (($_SP_CONF['in_block'] == 1) && !empty ($spresult['sp_label'])) { ! $display .= COM_endBlock (); } } } else { ! $display .= COM_siteHeader() . COM_showMessage ($HTTP_GET_VARS['msg']); } } else { ! $display .= COM_siteHeader() . COM_showMessage ($HTTP_GET_VARS['msg']); } *************** *** 182,187 **** $limit = $U['maxstories']; - $display .= COM_showMessage($HTTP_GET_VARS['msg']); - // Geeklog now allows for articles to be published in the future. Because of // this, we need to check to see if we need to rebuild the RDF file in the case --- 186,189 ---- *************** *** 306,311 **** $display .= COM_siteFooter(true); // The true value enables right hand blocks. - } else { - $display = COM_showMessage ($HTTP_GET_VARS['msg']) . $display; } --- 308,311 ---- From dhaun at geeklog.net Wed Mar 12 14:02:03 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Wed, 12 Mar 2003 13:02:03 -0600 Subject: [geeklog-cvs] geeklog-1.3/docs history,1.75,1.76 Message-ID: <200303121902.h2CJ23i04198@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/docs In directory internal.geeklog.net:/tmp/cvs-serv4149/docs Modified Files: history Log Message: Static Pages named topic: (e.g. topic:GeekLog) will be displayed on top of that topic (based on a hack by James Fryer). Also made sure that any messages are displayed above anything else. Index: history =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/docs/history,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** history 11 Mar 2003 10:14:49 -0000 1.75 --- history 12 Mar 2003 19:02:01 -0000 1.76 *************** *** 4,7 **** --- 4,11 ---- ------- + - A Static Page with a title of "topic:" (e.g. topic:GeekLog) will + be displayed on top of the index page for that topic (based on a hack by + James Fryer). + - Added paging to the list of Static Pages (for more than 50 pages). - Fixed problem with the Older Stories block disappearing when it was edited (e.g. moved from left to right), bug #670673. From dhaun at geeklog.net Wed Mar 12 17:36:54 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Wed, 12 Mar 2003 16:36:54 -0600 Subject: [geeklog-cvs] geeklog-1.3/language chinese_gb2312.php,NONE,1.1 Message-ID: <200303122236.h2CMasi10047@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/language In directory internal.geeklog.net:/tmp/cvs-serv10025 Added Files: chinese_gb2312.php Log Message: Chinese language file (gb2312 encoding), provided by Crocodile King --- NEW FILE: chinese_gb2312.php --- "????????????", 8 => "??????", 9 => "????", 10 => "????????" ); $LANG_404 = array( 1 => "404 ????", 2 => "??????????????????????????http://{$HTTP_SERVER_VARS["HTTP_HOST"]}{$HTTP_SERVER_VARS["REQUEST_URI"]}.", 3 => "

????????????????????????????????????????????????????????????????" ); $LANG_LOGIN = array ( 1 => "????????", 2 => "????????????????????????????????", 3 => "????", 4 => "??????" ); ?> From dhaun at geeklog.net Thu Mar 13 05:36:13 2003 From: dhaun at geeklog.net (dhaun at geeklog.net) Date: Thu, 13 Mar 2003 04:36:13 -0600 Subject: [geeklog-cvs] geeklog-1.3/docs index.html,1.9,1.10 Message-ID: <200303131036.h2DAaDi26816@internal.geeklog.net> Update of /usr/cvs/geeklog/geeklog-1.3/docs In directory internal.geeklog.net:/tmp/cvs-serv26797/docs Modified Files: index.html Log Message: Added documentation for the Static Pages plugin 1.3 Index: index.html =================================================================== RCS file: /usr/cvs/geeklog/geeklog-1.3/docs/index.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** index.html 28 Dec 2002 13:28:34 -0000 1.9 --- index.html 13 Mar 2003 10:36:11 -0000 1.10 *************** *** 33,36 **** --- 33,37 ---- instructions)

  • The Geeklog Configuration File (config.php)
  • +
  • Static Pages plugin
  • Geeklog's API