From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:07 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:07 -0500 Subject: [geeklog-cvs] geeklog: First attempt of a more generic plugin install Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/238b6a303d1a changeset: 6586:238b6a303d1a user: Dirk Haun date: Wed Dec 24 14:50:25 2008 +0100 description: First attempt of a more generic plugin install diffstat: 3 files changed, 498 insertions(+), 468 deletions(-) plugins/calendar/autoinstall.php | 112 +++++ public_html/admin/plugins.php | 462 ++++++++++++++++++++---- public_html/admin/plugins/calendar/install.php | 392 -------------------- diffs (truncated from 1103 to 300 lines): diff -r 2638dcb8940d -r 238b6a303d1a plugins/calendar/autoinstall.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/calendar/autoinstall.php Wed Dec 24 14:50:25 2008 +0100 @@ -0,0 +1,112 @@ + $pi_name, + 'pi_version' => '1.1.0', + 'pi_gl_version' => '1.6.0', + 'pi_homepage' => 'http://www.geeklog.net/' + ); + + $groups = array( + $pi_admin => 'Has full access to ' . $pi_name . ' features' + ); + + $features = array( + $pi_name . '.moderate' => 'Ability to moderate pending events', + $pi_name . '.edit' => 'Access to event editor', + $pi_name . '.submit' => 'May skip the event submission queue' + ); + + $mappings = array( + $pi_name . '.moderate' => array($pi_admin), + $pi_name . '.edit' => array($pi_admin), + $pi_name . '.submit' => array($pi_admin) + ); + + $inst_parms = array( + 'info' => $info, + 'groups' => $groups, + 'features' => $features, + 'mappings' => $mappings + ); + + return $inst_parms; +} + +function plugin_load_configuration_calendar($pi_name) +{ + global $_CONF, $base_path; + + $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/'; + + require_once $_CONF['path_system'] . 'classes/config.class.php'; + require_once $base_path . 'install_defaults.php'; + + return plugin_initconfig_calendar(); +} + +function plugin_postinstall_calendar($pi_name) +{ + return true; +} + +function plugin_compatible_with_this_version_calendar($pi_name) +{ + if (function_exists('COM_printUpcomingEvents')) { + // if this function exists, then someone's trying to install the + // plugin on Geeklog 1.4.0 or older - sorry, but that won't work + return false; + } + + if (!function_exists('MBYTE_strpos')) { + // the plugin requires the multi-byte functions + return false; + } + + if (!function_exists('SEC_createToken')) { + return false; + } + + if (!function_exists('COM_showMessageText')) { + return false; + } + + return true; +} + +?> diff -r 2638dcb8940d -r 238b6a303d1a public_html/admin/plugins.php --- a/public_html/admin/plugins.php Mon Dec 22 15:11:36 2008 +0100 +++ b/public_html/admin/plugins.php Wed Dec 24 14:50:25 2008 +0100 @@ -99,7 +99,7 @@ $plg_templates = new Template($_CONF['path_layout'] . 'admin/plugins'); $plg_templates->set_file('editor', 'editor.thtml'); - $plg_templates->set_var( 'xhtml', XHTML ); + $plg_templates->set_var('xhtml', XHTML); $plg_templates->set_var('site_url', $_CONF['site_url']); $plg_templates->set_var('site_admin_url', $_CONF['site_admin_url']); $plg_templates->set_var('layout_url', $_CONF['layout_url']); @@ -161,20 +161,21 @@ * @return void * */ -function changePluginStatus ($pi_name_arr) +function changePluginStatus($pi_name_arr) { global $_TABLES, $_DB_table_prefix; + // first, get a list of all plugins - $rst = DB_query ("SELECT pi_name, pi_enabled FROM {$_TABLES['plugins']}"); + $rst = DB_query("SELECT pi_name, pi_enabled FROM {$_TABLES['plugins']}"); $plg_count = DB_numRows($rst); - for ($i=0; $i<$plg_count; $i++) { // iterate and check/change match with array + for ($i = 0; $i < $plg_count; $i++) { // iterate and check/change match with array $P = DB_fetchArray($rst); - if (isset($pi_name_arr[$P['pi_name']]) && $P['pi_enabled'] == 0) { // enable it - PLG_enableStateChange ($P['pi_name'], true); - DB_query ("UPDATE {$_TABLES['plugins']} SET pi_enabled = '1' WHERE pi_name = '{$P['pi_name']}'"); - } else if (!isset($pi_name_arr[$P['pi_name']]) && $P['pi_enabled'] == 1) { // disable it - PLG_enableStateChange ($P['pi_name'], false); - DB_query ("UPDATE {$_TABLES['plugins']} SET pi_enabled = '0' WHERE pi_name = '{$P['pi_name']}'"); + if (isset($pi_name_arr[$P['pi_name']]) && ($P['pi_enabled'] == 0)) { // enable it + PLG_enableStateChange($P['pi_name'], true); + DB_query("UPDATE {$_TABLES['plugins']} SET pi_enabled = 1 WHERE pi_name = '{$P['pi_name']}'"); + } elseif (!isset($pi_name_arr[$P['pi_name']]) && $P['pi_enabled'] == 1) { // disable it + PLG_enableStateChange($P['pi_name'], false); + DB_query("UPDATE {$_TABLES['plugins']} SET pi_enabled = 0 WHERE pi_name = '{$P['pi_name']}'"); } } } @@ -218,7 +219,7 @@ $retval = COM_refresh($_CONF['site_admin_url'] . '/plugins.php?msg=28'); } else { - $retval .= COM_siteHeader ('menu', $LANG32[13]); + $retval .= COM_siteHeader('menu', $LANG32[13]); $retval .= COM_startBlock ($LANG32[13], '', COM_getBlockTemplate ('_msg_block', 'header')); $retval .= COM_errorLog ('error saving plugin, no pi_name provided', 1); @@ -233,52 +234,73 @@ /** * Creates list of uninstalled plugins (if any) and offers install link to them. * -* @return string HTML containing list of uninstalled plugins +* @param strint $token security token to use in list +* @return string HTML containing list of uninstalled plugins * */ -function show_newplugins ($token) +function show_newplugins($token) { global $_CONF, $_TABLES, $LANG32; - require_once( $_CONF['path_system'] . 'lib-admin.php' ); - $plugins = array (); + + require_once $_CONF['path_system'] . 'lib-admin.php'; + + $plugins = array(); $plugins_dir = $_CONF['path'] . 'plugins/'; - $fd = opendir ($plugins_dir); + $fd = opendir($plugins_dir); $index = 1; $retval = ''; $data_arr = array(); - while (($dir = @readdir ($fd)) == TRUE) { + while (($dir = @readdir($fd)) == TRUE) { if (($dir <> '.') && ($dir <> '..') && ($dir <> 'CVS') && (substr($dir, 0 , 1) <> '.') && is_dir($plugins_dir . $dir)) { clearstatcache (); // Check and see if this plugin is installed - if there is a record. // If not then it's a new plugin - if (DB_count($_TABLES['plugins'],'pi_name',$dir) == 0) { + if (DB_count($_TABLES['plugins'], 'pi_name', $dir) == 0) { + $plugin_ok = false; + $plugin_new_style = false; // additionally, check if a 'functions.inc' exists - if (file_exists ($plugins_dir . $dir . '/functions.inc')) { - // and finally, since we're going to link to it, check if - // an install script exists - $adminurl = $_CONF['site_admin_url']; - if (strrpos ($adminurl, '/') == strlen ($adminurl)) { - $adminurl = substr ($adminurl, 0, -1); + if (file_exists($plugins_dir . $dir . '/functions.inc')) { + // new plugins will have a autoinstall.php + if (file_exists($plugins_dir . $dir . '/autoinstall.php')) { + $plugin_ok = true; + $plugin_new_style = true; + } else { + // and finally, since we're going to link to it, check + // if an install script exists + $adminurl = $_CONF['site_admin_url']; + if (strrpos($adminurl, '/') == strlen($adminurl)) { + $adminurl = substr($adminurl, 0, -1); + } + $pos = strrpos($adminurl, '/'); + if ($pos === false) { + // didn't work out - use the URL + $admindir = $_CONF['site_admin_url']; + } else { + $admindir = $_CONF['path_html'] + . substr($adminurl, $pos + 1); + } + $fh = @fopen($admindir . '/plugins/' . $dir + . '/install.php', 'r'); + if ($fh) { + fclose($fh); + $plugin_ok = true; + $plugin_new_style = false; + } } - $pos = strrpos ($adminurl, '/'); - if ($pos === false) { - // didn't work out - use the URL - $admindir = $_CONF['site_admin_url']; - } else { - $admindir = $_CONF['path_html'] - . substr ($adminurl, $pos + 1); - } - $fh = @fopen ($admindir . '/plugins/' . $dir - . '/install.php', 'r'); - if ($fh) { - fclose ($fh); + if ($plugin_ok) { + if ($plugin_new_style) { + $url = $_CONF['site_admin_url'] . '/plugins.php' + . '?mode=autoinstall&plugin=' . $dir; + } else { + $url = $_CONF['site_admin_url'] . '/plugins/' . $dir + . '/install.php?action=install'; + } + $url .= '&' . CSRF_TOKEN . '=' . $token; $data_arr[] = array( - 'pi_name' => $dir, - 'number' => $index, - 'install_link'=> COM_createLink($LANG32[22], - $_CONF['site_admin_url'] . '/plugins/' . $dir - . '/install.php?action=install&'.CSRF_TOKEN.'='.$token) + 'pi_name' => $dir, + 'number' => $index, + 'install_link' => COM_createLink($LANG32[22], $url) ); $index++; } @@ -294,8 +316,8 @@ ); $text_arr = array('title' => $LANG32[14]); - $retval .= ADMIN_simpleList('', $header_arr, $text_arr, - $data_arr); + $retval .= ADMIN_simpleList('', $header_arr, $text_arr, $data_arr); + return $retval; } @@ -306,27 +328,25 @@ * @return string HTML for error or success message * */ -function do_update ($pi_name) +function do_update($pi_name) { - global $_CONF, $LANG32, $LANG08, $MESSAGE, $_IMAGE_TYPE; + global $_CONF, $LANG32; $retval = ''; - if (strlen ($pi_name) == 0) { - $retval .= COM_startBlock ($LANG32[13], '', - COM_getBlockTemplate ('_msg_block', 'header')); - $retval .= COM_errorLog ($LANG32[12]); - $retval .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer')); From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:07 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:07 -0500 Subject: [geeklog-cvs] geeklog: Got the auto install working from the install script Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/027df4078405 changeset: 6587:027df4078405 user: Dirk Haun date: Thu Dec 25 12:34:00 2008 +0100 description: Got the auto install working from the install script diffstat: 4 files changed, 425 insertions(+), 161 deletions(-) plugins/calendar/autoinstall.php | 11 - public_html/admin/install/install-plugins.php | 113 +++++----- public_html/admin/install/lib-install.php | 266 ++++++++++++++++++++++++- public_html/admin/plugins.php | 196 +++++++++--------- diffs (truncated from 754 to 300 lines): diff -r 238b6a303d1a -r 027df4078405 plugins/calendar/autoinstall.php --- a/plugins/calendar/autoinstall.php Wed Dec 24 14:50:25 2008 +0100 +++ b/plugins/calendar/autoinstall.php Thu Dec 25 12:34:00 2008 +0100 @@ -36,14 +36,15 @@ $pi_admin = $pi_display_name . ' Admin'; $info = array( - 'pi_name' => $pi_name, - 'pi_version' => '1.1.0', - 'pi_gl_version' => '1.6.0', - 'pi_homepage' => 'http://www.geeklog.net/' + 'pi_name' => $pi_name, + 'pi_display_name' => $pi_display_name, + 'pi_version' => '1.1.0', + 'pi_gl_version' => '1.6.0', + 'pi_homepage' => 'http://www.geeklog.net/' ); $groups = array( - $pi_admin => 'Has full access to ' . $pi_name . ' features' + $pi_admin => 'Has full access to ' . $pi_display_name . ' features' ); $features = array( diff -r 238b6a303d1a -r 027df4078405 public_html/admin/install/install-plugins.php --- a/public_html/admin/install/install-plugins.php Wed Dec 24 14:50:25 2008 +0100 +++ b/public_html/admin/install/install-plugins.php Thu Dec 25 12:34:00 2008 +0100 @@ -28,10 +28,7 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// | You don't need to change anything in this file. | -// | Please read docs/install.html which describes how to install Geeklog. | -// +---------------------------------------------------------------------------+ -// + // +---------------------------------------------------------------------------+ // | Main | @@ -159,10 +156,14 @@ $archive->extractList(array($dirname . '/admin/install.php'), $_CONF['path'] . 'data/'); } + $plugin_inst = $_CONF['path'] . 'data/' . $dirname . '/admin/install.php'; - $fhandle = fopen($plugin_inst, 'r'); - $fdata = fread($fhandle, filesize($plugin_inst)); - fclose($fhandle); + $fdata = ''; + $fhandle = @fopen($plugin_inst, 'r'); + if ($fhandle) { + $fdata = fread($fhandle, filesize($plugin_inst)); + fclose($fhandle); + } // Remove the plugin from data/ require_once 'System.php'; @@ -296,6 +297,7 @@ // If no record exists in the plugins table then it's a new plugin if (DB_count($_TABLES['plugins'], 'pi_name', $plugin) == 0) { + $pi_name = ''; $pi_display_name = ''; $pi_version = 'Unknown'; $gl_version = 'Unknown'; @@ -335,20 +337,37 @@ . substr ($admin_url, $pos + 1); } + $missing_autoinstall = false; + $info = INST_getPluginInfo($plugin); + if ($info === false) { + $missing_autoinstall = true; + } else { + $pi_name = $info['pi_name']; + $pi_display_name = $info['pi_display_name']; + $pi_version = $info['pi_version']; + $gl_version = $info['pi_gl_version']; + $pi_url = $info['pi_homepage']; + } + // If the plugin has been installed to the admin directory - if (!file_exists($admin_dir . '/plugins/' . $plugin)) { + if (! file_exists($admin_dir . '/plugins/' . $plugin)) { $missing_admin = true; - } else { + } + if (! $missing_admin && empty($pi_name)) { /** * Plugins keep their config info in install.php */ + $plugin_inst = $admin_dir . '/plugins/' . $plugin . '/install.php'; - $fhandle = fopen($plugin_inst, 'r'); - $fdata = fread($fhandle, filesize($plugin_inst)); - fclose($fhandle); + $fdata = ''; + $fhandle = @fopen($plugin_inst, 'r'); + if ($fhandle) { + $fdata = fread($fhandle, filesize($plugin_inst)); + fclose($fhandle); + } $fdata = preg_replace('/\n/', '', $fdata); $fdata = preg_replace('/ /', '', $fdata); @@ -404,7 +423,7 @@ $display .= '' . LB . '' . LB + . ($missing_public_html || $missing_admin || $missing_autoinstall ? ' disabled="true"' : ' checked="checked"') . XHTML . '>' . LB . '' . LB . '' . LB . '' @@ -448,71 +467,47 @@ case 2: $error = 0; -/* foreach ($_POST['plugins'] as $plugin) { // If the plugin was selected to be installed if (isset($plugin['install']) && ($plugin['install'] == 'on')) { -*/ - /** - * Install the plugin by including & executing the database queries for each plugin - * Start by looking for the database install file. - */ -/* - $plugin_sql = ''; - if (file_exists($_CONF['path'] . 'plugins/' . $plugin['name'] . '/sql/' . $_DB_dbms . '_install.php')) { - $plugin_sql = $_CONF['path'] . 'plugins/' . $plugin['name'] . '/sql/' . $_DB_dbms . '_install.php'; - - } else if (file_exists($_CONF['path'] . 'plugins/' . $plugin['name'] . '/sql/install.php')) { - - $plugin_sql = $_CONF['path'] . 'plugins/' . $plugin['name'] . '/sql/install.php'; - - } + $pi_name = COM_applyFilter($plugin['name']); + $pi_name = COM_sanitizeFilename($pi_name); - $plugin_func = $_CONF['path'] . 'plugins/' . $plugin['name'] . '/functions.inc'; + $plugin_inst = $_CONF['path'] . 'plugins/' . $pi_name + . '/autoinstall.php'; + if (file_exists($plugin_inst)) { - if (file_exists($plugin_sql)) { // If database table and/or data exists for this plugin + require_once $plugin_inst; - $plugin_conf = $_CONF['path'] . 'plugins/' . $plugin['name'] . '/config.php'; - if (file_exists($plugin_conf)) { - - require_once $plugin_conf; - + $check_compatible = 'plugin_compatible_with_this_version_' + . $pi_name; + if (function_exists($check_compatible)) { + if (! $check_compatible($pi_name)) { + continue; // with next plugin + } } - $_SQL = array(); // Initialize for each plugin, otherwise the queries for the first plugin - $_DATA = array(); // will execute twice if more than one plugin is being installed. - require_once $plugin_sql; // Include $_SQL and $_DATA for each plugin, - // these arrays contain the DB structures and data. - - - foreach ($_SQL as $sql) { - - DB_query($sql); // Create the table structures, if necessary - //sanity($sql); - + $auto_install = 'plugin_autoinstall_' . $pi_name; + if (! function_exists($auto_install)) { + continue; // with next plugin } - foreach ($_DATA as $data) { - - DB_query($data); // Insert necessary data, if any - //sanity($data); - + $inst_parms = $auto_install($pi_name); + if (($inst_parms === false) || empty($inst_parms)) { + continue; // with next plugin } - // Enable the plugin in the plugins table - // Todo: This should be checked for injection attempts or does DB_query() do that automatically? - DB_query("INSERT INTO {$_TABLES['plugins']} (`pi_name`, `pi_version`, `pi_gl_version`, `pi_enabled`, `pi_homepage`) VALUES ( '{$plugin['name']}', '{$plugin['version']}', '" . VERSION . "', 1, '{$plugin['pi_url']}')"); - - } + INST_pluginAutoinstall($pi_name, $inst_parms); + } } } -*/ + // Done! -// $display .= '

Done doing stuff

' . LB; + header('Location: success.php?language=' . $language); break; diff -r 238b6a303d1a -r 027df4078405 public_html/admin/install/lib-install.php --- a/public_html/admin/install/lib-install.php Wed Dec 24 14:50:25 2008 +0100 +++ b/public_html/admin/install/lib-install.php Thu Dec 25 12:34:00 2008 +0100 @@ -28,7 +28,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// /** * The functionality of many of these functions already exists in other @@ -73,9 +72,11 @@ } $language = 'english'; -if (isset($_REQUEST['language'])) { - $lng = $_REQUEST['language']; -} else if (isset($_COOKIE['language'])) { +if (isset($_POST['language'])) { + $lng = $_POST['language']; +} elseif (isset($_GET['language'])) { + $lng = $_GET['language']; +} elseif (isset($_COOKIE['language'])) { // Okay, so the name of the language cookie is configurable, so it may not // be named 'language' after all. Still worth a try ... $lng = $_COOKIE['language']; @@ -542,6 +543,7 @@ */ function INST_urlExists($url) { +/* $handle = curl_init($url); if ($handle === false) { return false; @@ -553,6 +555,8 @@ $response = curl_exec($handle); curl_close($handle); return $response; +*/ + return true; } /** @@ -757,4 +761,258 @@ fclose($siteconfig_file); } +function INST_getPluginInfo($plugin) +{ + global $_CONF; + + $info = false; + + $autoinstall = $_CONF['path'] . 'plugins/' . $plugin . '/autoinstall.php'; + if (! file_exists($autoinstall)) { + return false; + } + + include $autoinstall; + + $fn = 'plugin_autoinstall_' . $plugin; + if (function_exists($fn)) { + $inst_info = $fn($plugin); + if (isset($inst_info['info']) && + !empty($inst_info['info']['pi_name'])) { + $info = $inst_info['info']; + } + } + + return $info; +} + +/** +* Do the actual plugin auto install +* +* @param string $plugin Plugin name +* @param array $inst_parm Installation parameters for the plugin +* @param boolean $verbose true: enable verbose logging +* @return boolean true on success, false otherwise +* +*/ +function INST_pluginAutoinstall($plugin, $inst_parms, $verbose = true) +{ + global $_CONF, $_TABLES, $_USER, $_DB_dbms; + + $fake_uid = false; + if (!isset($_USER['uid'])) { + $_USER['uid'] = 1; + $fake_uid = false; From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:08 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:08 -0500 Subject: [geeklog-cvs] geeklog: Got the auto install working for plugins uploaded via t... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/c26c11b34fd9 changeset: 6588:c26c11b34fd9 user: Dirk Haun date: Thu Dec 25 22:11:00 2008 +0100 description: Got the auto install working for plugins uploaded via the Plugins panel diffstat: 1 file changed, 16 insertions(+), 4 deletions(-) public_html/admin/plugins.php | 20 ++++++++++++++++---- diffs (65 lines): diff -r 027df4078405 -r c26c11b34fd9 public_html/admin/plugins.php --- a/public_html/admin/plugins.php Thu Dec 25 12:34:00 2008 +0100 +++ b/public_html/admin/plugins.php Thu Dec 25 22:11:00 2008 +0100 @@ -643,6 +643,10 @@ $pi_name = $dirname; + } elseif (empty($pi_name)) { + + $pi_name = $dirname; + } // Extract the uploaded archive to the plugins directory @@ -667,7 +671,7 @@ } if (file_exists($plg_path . 'admin')) { rename($plg_path . 'admin', - $_CONF['path_html'] . 'admin/plugins/' . $pi_name); + $_CONF['path_html'] . 'admin/plugins/' . $pi_name); } } @@ -676,7 +680,7 @@ // if the plugin has an autoinstall.php, install it now if (file_exists($plg_path . 'autoinstall.php')) { - if (plugin_autoinstall($plugin)) { + if (plugin_autoinstall($pi_name)) { $retval .= COM_refresh($_CONF['site_admin_url'] . '/plugins.php?msg=44'); } else { @@ -787,7 +791,7 @@ */ function plugin_do_autoinstall($plugin, $inst_parms, $verbose = true) { - global $_CONF, $_TABLES, $_USER, $_DB_dbms; + global $_CONF, $_TABLES, $_USER, $_DB_dbms, $_DB_table_prefix; $base_path = $_CONF['path'] . 'plugins/' . $plugin . '/'; @@ -809,6 +813,14 @@ return false; } + // add plugin tables, if any + if (! empty($inst_parms['tables'])) { + $tables = $inst_parms['tables']; + foreach ($tables as $table) { + $_TABLES[$table] = $_DB_table_prefix . $table; + } + } + // Create the plugin's group(s), if any $groups = array(); $admin_group_id = 0; @@ -816,7 +828,7 @@ $groups = $inst_parms['groups']; foreach ($groups as $name => $desc) { if ($verbose) { - COM_errorLog("Attempting to create plugin '$name' group", 1); + COM_errorLog("Attempting to create '$name' group", 1); } $grp_name = addslashes($name); From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:11 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:11 -0500 Subject: [geeklog-cvs] geeklog: Pick up and install all autoinstall-able plugins during... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/86f08a6dd0ad changeset: 6590:86f08a6dd0ad user: Dirk Haun date: Fri Dec 26 11:46:42 2008 +0100 description: Pick up and install all autoinstall-able plugins during the default install diffstat: 1 file changed, 53 insertions(+), 1 deletion(-) public_html/admin/install/index.php | 54 ++++++++++++++++++++++++++++++++++- diffs (71 lines): diff -r ec370986aa11 -r 86f08a6dd0ad public_html/admin/install/index.php --- a/public_html/admin/install/index.php Thu Dec 25 22:48:45 2008 +0100 +++ b/public_html/admin/install/index.php Fri Dec 26 11:46:42 2008 +0100 @@ -482,7 +482,13 @@ $config->set('language', $lng); } - // Installation is complete. Continue onto either plugin installation or success page + if (! $install_plugins) { + // do a default install of all available plugins + INST_defaultPluginInstall(); + } + + // Installation is complete. Continue onto either + // custom plugin installation page or success page header('Location: ' . $next_link); } else { @@ -1474,6 +1480,52 @@ return $result; } +/** +* Handle default install of available plugins +* +* Picks up and installs all plugins with an autoinstall.php. +* Any errors are silently ignored ... +* +*/ +function INST_defaultPluginInstall() +{ + global $_CONF, $_TABLES; + + if (! function_exists('COM_errorLog')) { + // "Emergency" version of COM_errorLog + function COM_errorLog($a, $b = '') + { + return ''; + } + } + + $plugins_dir = $_CONF['path'] . 'plugins/'; + $fd = opendir($plugins_dir); + while (($plugin = @readdir($fd)) == TRUE) { + + if (($plugin <> '.') && ($plugin <> '..') && ($plugin <> 'CVS') && + (substr($plugin, 0, 1) <> '.') && + (substr($plugin, 0, 1) <> '_') && + is_dir($plugins_dir . $plugin)) { + + clearstatcache (); + $plugin_dir = $plugins_dir . $plugin; + + if (DB_count($_TABLES['plugins'], 'pi_name', $plugin) == 0) { + + $info = INST_getPluginInfo($plugin); + if ($info !== false) { + $fn = 'plugin_autoinstall_' . $plugin; + $inst_parms = $fn($plugin); + INST_pluginAutoinstall($plugin, $inst_parms); + } + + } + + } + } +} + // +---------------------------------------------------------------------------+ // | Main | From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:10 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:10 -0500 Subject: [geeklog-cvs] geeklog: Minor corrections, refinements, and cosmetics Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/ec370986aa11 changeset: 6589:ec370986aa11 user: Dirk Haun date: Thu Dec 25 22:48:45 2008 +0100 description: Minor corrections, refinements, and cosmetics diffstat: 3 files changed, 28 insertions(+), 15 deletions(-) plugins/calendar/autoinstall.php | 9 ++++++- plugins/calendar/functions.inc | 2 - public_html/admin/install/install-plugins.php | 32 ++++++++++++++----------- diffs (106 lines): diff -r c26c11b34fd9 -r ec370986aa11 plugins/calendar/autoinstall.php --- a/plugins/calendar/autoinstall.php Thu Dec 25 22:11:00 2008 +0100 +++ b/plugins/calendar/autoinstall.php Thu Dec 25 22:48:45 2008 +0100 @@ -59,11 +59,18 @@ $pi_name . '.submit' => array($pi_admin) ); + $tables = array( + 'events', + 'eventsubmission', + 'personal_events' + ); + $inst_parms = array( 'info' => $info, 'groups' => $groups, 'features' => $features, - 'mappings' => $mappings + 'mappings' => $mappings, + 'tables' => $tables ); return $inst_parms; diff -r c26c11b34fd9 -r ec370986aa11 plugins/calendar/functions.inc --- a/plugins/calendar/functions.inc Thu Dec 25 22:11:00 2008 +0100 +++ b/plugins/calendar/functions.inc Thu Dec 25 22:48:45 2008 +0100 @@ -57,7 +57,7 @@ $_CA_CONF = $ca_config->get_config('calendar'); } -$_CA_CONF['version'] = '1.0.2'; +$_CA_CONF['version'] = '1.1.0'; // +---------------------------------------------------------------------------+ // | Geeklog Plugin API Implementations | diff -r c26c11b34fd9 -r ec370986aa11 public_html/admin/install/install-plugins.php --- a/public_html/admin/install/install-plugins.php Thu Dec 25 22:11:00 2008 +0100 +++ b/public_html/admin/install/install-plugins.php Thu Dec 25 22:48:45 2008 +0100 @@ -207,12 +207,18 @@ $upload_success = $archive->extract($_CONF['path'] . 'plugins/'); } + + $plg_path = $_CONF['path'] . 'plugins/' . $pi_name . '/'; if ($upload_success) { - if (file_exists($_CONF['path'] . 'plugins/' . $pi_name . '/public_html')) { - rename($_CONF['path'] . 'plugins/' . $pi_name . '/public_html', $_CONF['path_html'] . $pi_name); + if (file_exists($plg_path . 'public_html')) { + rename($plg_path . 'public_html', + $_CONF['path_html'] . $pi_name); } - rename($_CONF['path'] . 'plugins/' . $pi_name . '/admin', $_CONF['path_html'] . 'admin/plugins/' . $pi_name); + if (file_exists($plg_path . 'admin')) { + rename($plg_path . 'admin', $_CONF['path_html'] + . 'admin/plugins/' . $pi_name); + } } @@ -248,8 +254,10 @@ $fd = opendir($plugins_dir); while (($plugin = @readdir($fd)) == TRUE) { - if (is_dir ($plugins_dir . $plugin) && ($plugin != '.') && ($plugin != '..') && - ($plugin != 'CVS') && (substr ($plugin, 0 , 1) != '.')) { + if (($plugin <> '.') && ($plugin <> '..') && ($plugin <> 'CVS') && + (substr($plugin, 0, 1) <> '.') && + (substr($plugin, 0, 1) <> '_') && + is_dir($plugins_dir . $plugin)) { clearstatcache (); @@ -287,8 +295,10 @@ $fd = opendir($plugins_dir); while (($plugin = @readdir($fd)) == TRUE) { - if (is_dir ($plugins_dir . $plugin) && ($plugin != '.') && ($plugin != '..') && - ($plugin != 'CVS') && (substr ($plugin, 0 , 1) != '.') && ($plugin != '__MACOSX')) { + if (($plugin <> '.') && ($plugin <> '..') && + ($plugin <> 'CVS') && (substr($plugin, 0, 1) <> '.') && + (substr($plugin, 0, 1) <> '_') && + is_dir($plugins_dir . $plugin)) { clearstatcache (); $plugin_dir = $plugins_dir . $plugin; @@ -423,17 +433,13 @@ $display .= '' . LB . '' . LB + . ($missing_autoinstall ? ' disabled="disabled"' : ' checked="checked"') . XHTML . '>' . LB . '' . LB . '' . LB . '' . '' . $pi_display_name . LB - . ($missing_public_html || $missing_admin - ? '

Warning: This plugin is not fully installed. Check that the plugin has been correctly installed to:' - . ($missing_public_html ? '' . $_CONF['path_html'] . '' : '') - . ($missing_admin ? '' . $admin_dir . '' : '') . '

' - : '') + . ($missing_autoinstall ? '

Note: This plugin requires manual activation from the Plugins admin panel.

' : '') . '' . LB . '' . $pi_version From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:13 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:13 -0500 Subject: [geeklog-cvs] geeklog: Sync with admin/plugins.php (handle plugin tables) Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/21181f35aea7 changeset: 6591:21181f35aea7 user: Dirk Haun date: Fri Dec 26 11:56:01 2008 +0100 description: Sync with admin/plugins.php (handle plugin tables) diffstat: 1 file changed, 10 insertions(+), 2 deletions(-) public_html/admin/install/lib-install.php | 12 ++++++++++-- diffs (36 lines): diff -r 86f08a6dd0ad -r 21181f35aea7 public_html/admin/install/lib-install.php --- a/public_html/admin/install/lib-install.php Fri Dec 26 11:46:42 2008 +0100 +++ b/public_html/admin/install/lib-install.php Fri Dec 26 11:56:01 2008 +0100 @@ -797,7 +797,7 @@ */ function INST_pluginAutoinstall($plugin, $inst_parms, $verbose = true) { - global $_CONF, $_TABLES, $_USER, $_DB_dbms; + global $_CONF, $_TABLES, $_USER, $_DB_dbms, $_DB_table_prefix; $fake_uid = false; if (!isset($_USER['uid'])) { @@ -825,6 +825,14 @@ return false; } + // add plugin tables, if any + if (! empty($inst_parms['tables'])) { + $tables = $inst_parms['tables']; + foreach ($tables as $table) { + $_TABLES[$table] = $_DB_table_prefix . $table; + } + } + // Create the plugin's group(s), if any $groups = array(); $admin_group_id = 0; @@ -832,7 +840,7 @@ $groups = $inst_parms['groups']; foreach ($groups as $name => $desc) { if ($verbose) { - COM_errorLog("Attempting to create plugin '$name' group", 1); + COM_errorLog("Attempting to create '$name' group", 1); } $grp_name = addslashes($name); From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:14 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:14 -0500 Subject: [geeklog-cvs] geeklog: Handle missing plugin name Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/e403a16fe4ca changeset: 6592:e403a16fe4ca user: Dirk Haun date: Fri Dec 26 12:00:01 2008 +0100 description: Handle missing plugin name diffstat: 1 file changed, 4 insertions(+) public_html/admin/install/install-plugins.php | 4 ++++ diffs (14 lines): diff -r 21181f35aea7 -r e403a16fe4ca public_html/admin/install/install-plugins.php --- a/public_html/admin/install/install-plugins.php Fri Dec 26 11:56:01 2008 +0100 +++ b/public_html/admin/install/install-plugins.php Fri Dec 26 12:00:01 2008 +0100 @@ -190,6 +190,10 @@ // Some plugins don't have $pi_name set in their install.php file, // This means our regex won't work and we should just use $dirname if (preg_match('/\<\?php/', $pi_name) || preg_match('/--/', $pi_name)) { + + $pi_name = $dirname; + + } elseif (empty($pi_name)) { $pi_name = $dirname; From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:15 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:15 -0500 Subject: [geeklog-cvs] geeklog: This version will be called 1.6.0. Version 1.5.2 from b... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/c4c31b02807d changeset: 6593:c4c31b02807d user: Dirk Haun date: Fri Dec 26 12:21:20 2008 +0100 description: This version will be called 1.6.0. Version 1.5.2 from branch to be added later diffstat: 9 files changed, 95 insertions(+), 91 deletions(-) public_html/admin/install/index.php | 8 ++++- public_html/admin/install/lib-install.php | 2 - public_html/siteconfig.php.dist | 2 - sql/mssql_tableanddata.php | 2 - sql/mysql_tableanddata.php | 2 - sql/updates/mssql_1.5.1_to_1.5.2.php | 42 ---------------------------- sql/updates/mssql_1.5.1_to_1.6.0.php | 42 ++++++++++++++++++++++++++++ sql/updates/mysql_1.5.1_to_1.5.2.php | 43 ----------------------------- sql/updates/mysql_1.5.1_to_1.6.0.php | 43 +++++++++++++++++++++++++++++ diffs (266 lines): diff -r e403a16fe4ca -r c4c31b02807d public_html/admin/install/index.php --- a/public_html/admin/install/index.php Fri Dec 26 12:00:01 2008 +0100 +++ b/public_html/admin/install/index.php Fri Dec 26 12:21:20 2008 +0100 @@ -481,6 +481,9 @@ if (!empty($lng)) { $config->set('language', $lng); } + + DB_change($_TABLES['vars'], 'value', VERSION, + 'name', 'database_version'); if (! $install_plugins) { // do a default install of all available plugins @@ -1375,7 +1378,8 @@ break; case '1.5.1': - require_once $_CONF['path'] . 'sql/updates/' . $_DB_dbms . '_1.5.1_to_1.5.2.php'; + case '1.5.2': // TBD + require_once $_CONF['path'] . 'sql/updates/' . $_DB_dbms . '_1.5.1_to_1.6.0.php'; update_ConfValues(); @@ -1387,7 +1391,7 @@ } } - $current_gl_version = '1.5.2'; + $current_gl_version = '1.6.0'; $_SQL = ''; break; diff -r e403a16fe4ca -r c4c31b02807d public_html/admin/install/lib-install.php --- a/public_html/admin/install/lib-install.php Fri Dec 26 12:00:01 2008 +0100 +++ b/public_html/admin/install/lib-install.php Fri Dec 26 12:21:20 2008 +0100 @@ -51,7 +51,7 @@ define('LB', "\n"); } if (!defined('VERSION')) { - define('VERSION', '1.5.2'); + define('VERSION', '1.6.0'); } if (!defined('XHTML')) { define('XHTML', ' /'); diff -r e403a16fe4ca -r c4c31b02807d public_html/siteconfig.php.dist --- a/public_html/siteconfig.php.dist Fri Dec 26 12:00:01 2008 +0100 +++ b/public_html/siteconfig.php.dist Fri Dec 26 12:21:20 2008 +0100 @@ -38,7 +38,7 @@ define('LB',"\n"); } if (!defined('VERSION')) { - define('VERSION', '1.5.2hg'); + define('VERSION', '1.6.0hg'); } ?> diff -r e403a16fe4ca -r c4c31b02807d sql/mssql_tableanddata.php --- a/sql/mssql_tableanddata.php Fri Dec 26 12:00:01 2008 +0100 +++ b/sql/mssql_tableanddata.php Fri Dec 26 12:21:20 2008 +0100 @@ -1379,7 +1379,7 @@ $_SQL[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('totalhits','0')"; $_SQL[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('lastemailedstories','')"; $_SQL[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('last_scheduled_run','')"; -$_SQL[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('database_version','1.5.2')"; +$_SQL[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('database_version','0.0.0')"; $_SQL[] = "INSERT INTO {$_TABLES['trackbackcodes']} (code, name) VALUES (0,'Trackback Enabled')"; $_SQL[] = "INSERT INTO {$_TABLES['trackbackcodes']} (code, name) VALUES (-1,'Trackback Disabled')"; diff -r e403a16fe4ca -r c4c31b02807d sql/mysql_tableanddata.php --- a/sql/mysql_tableanddata.php Fri Dec 26 12:00:01 2008 +0100 +++ b/sql/mysql_tableanddata.php Fri Dec 26 12:21:20 2008 +0100 @@ -667,7 +667,7 @@ $_DATA[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('totalhits','0') "; $_DATA[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('lastemailedstories','') "; $_DATA[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('last_scheduled_run','') "; -$_DATA[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('database_version','1.5.2') "; +$_DATA[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('database_version','0.0.0') "; $_DATA[] = "INSERT INTO {$_TABLES['trackbackcodes']} (code, name) VALUES (0,'Trackback Enabled') "; $_DATA[] = "INSERT INTO {$_TABLES['trackbackcodes']} (code, name) VALUES (-1,'Trackback Disabled') "; diff -r e403a16fe4ca -r c4c31b02807d sql/updates/mssql_1.5.1_to_1.5.2.php --- a/sql/updates/mssql_1.5.1_to_1.5.2.php Fri Dec 26 12:00:01 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); - - if (INST_pluginExists('links')) { - $c->add('new_window',false,'select',0,0,1,55,TRUE,'links'); - } - - return true; -} - -function upgrade_PollsPluginId() -{ - global $_TABLES; - - $P_SQL = array(); - $P_SQL[] = "ALTER TABLE {$_TABLES['pollanswers']} ALTER COLUMN [pid] VARCHARS(40)"; - $P_SQL[] = "ALTER TABLE {$_TABLES['pollquestions']} ALTER COLUMN [pid] VARCHARS(40)"; - $P_SQL[] = "ALTER TABLE {$_TABLES['polltopics']} ALTER COLUMN [pid] VARCHARS(40)"; - $P_SQL[] = "ALTER TABLE {$_TABLES['pollvoters']} ALTER COLUMN [pid] VARCHARS(40)"; - - foreach ($P_SQL as $sql) { - $rst = DB_query($sql); - if (DB_error()) { - echo "There was an error upgrading the polls, SQL: $sql
"; - return false; - } - } - - return true; -} - -?> diff -r e403a16fe4ca -r c4c31b02807d sql/updates/mssql_1.5.1_to_1.6.0.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sql/updates/mssql_1.5.1_to_1.6.0.php Fri Dec 26 12:21:20 2008 +0100 @@ -0,0 +1,42 @@ +add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); + + if (INST_pluginExists('links')) { + $c->add('new_window',false,'select',0,0,1,55,TRUE,'links'); + } + + return true; +} + +function upgrade_PollsPluginId() +{ + global $_TABLES; + + $P_SQL = array(); + $P_SQL[] = "ALTER TABLE {$_TABLES['pollanswers']} ALTER COLUMN [pid] VARCHARS(40)"; + $P_SQL[] = "ALTER TABLE {$_TABLES['pollquestions']} ALTER COLUMN [pid] VARCHARS(40)"; + $P_SQL[] = "ALTER TABLE {$_TABLES['polltopics']} ALTER COLUMN [pid] VARCHARS(40)"; + $P_SQL[] = "ALTER TABLE {$_TABLES['pollvoters']} ALTER COLUMN [pid] VARCHARS(40)"; + + foreach ($P_SQL as $sql) { + $rst = DB_query($sql); + if (DB_error()) { + echo "There was an error upgrading the polls, SQL: $sql
"; + return false; + } + } + + return true; +} + +?> diff -r e403a16fe4ca -r c4c31b02807d sql/updates/mysql_1.5.1_to_1.5.2.php --- a/sql/updates/mysql_1.5.1_to_1.5.2.php Fri Dec 26 12:00:01 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); - - if (INST_pluginExists('links')) { - $c->add('new_window',false,'select',0,0,1,55,TRUE,'links'); - } - - return true; -} - -function upgrade_PollsPluginId() -{ - global $_TABLES; - - $P_SQL = array(); - $P_SQL[] = "ALTER TABLE {$_TABLES['pollanswers']} CHANGE pid pid varchar(40) NOT NULL default ''"; - $P_SQL[] = "ALTER TABLE {$_TABLES['pollquestions']} CHANGE pid pid varchar(40) NOT NULL default ''"; - $P_SQL[] = "ALTER TABLE {$_TABLES['polltopics']} CHANGE pid pid varchar(40) NOT NULL default ''"; - $P_SQL[] = "ALTER TABLE {$_TABLES['pollvoters']} CHANGE pid pid varchar(40) NOT NULL default ''"; - - $P_SQL = INST_checkInnodbUpgrade($P_SQL); - foreach ($P_SQL as $sql) { - $rst = DB_query($sql); - if (DB_error()) { - echo "There was an error upgrading the polls, SQL: $sql
"; - return false; - } - } - - return true; -} - -?> diff -r e403a16fe4ca -r c4c31b02807d sql/updates/mysql_1.5.1_to_1.6.0.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sql/updates/mysql_1.5.1_to_1.6.0.php Fri Dec 26 12:21:20 2008 +0100 @@ -0,0 +1,43 @@ +add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); + + if (INST_pluginExists('links')) { + $c->add('new_window',false,'select',0,0,1,55,TRUE,'links'); + } + + return true; +} + +function upgrade_PollsPluginId() +{ + global $_TABLES; + + $P_SQL = array(); + $P_SQL[] = "ALTER TABLE {$_TABLES['pollanswers']} CHANGE pid pid varchar(40) NOT NULL default ''"; + $P_SQL[] = "ALTER TABLE {$_TABLES['pollquestions']} CHANGE pid pid varchar(40) NOT NULL default ''"; + $P_SQL[] = "ALTER TABLE {$_TABLES['polltopics']} CHANGE pid pid varchar(40) NOT NULL default ''"; + $P_SQL[] = "ALTER TABLE {$_TABLES['pollvoters']} CHANGE pid pid varchar(40) NOT NULL default ''"; + + $P_SQL = INST_checkInnodbUpgrade($P_SQL); + foreach ($P_SQL as $sql) { + $rst = DB_query($sql); + if (DB_error()) { + echo "There was an error upgrading the polls, SQL: $sql
"; + return false; + } + } + + return true; +} + +?> From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:16 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:16 -0500 Subject: [geeklog-cvs] geeklog: First attempt to get the plugin upgrade working Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/7fd9bfe6d53f changeset: 6594:7fd9bfe6d53f user: Dirk Haun date: Fri Dec 26 15:58:22 2008 +0100 description: First attempt to get the plugin upgrade working diffstat: 3 files changed, 65 insertions(+), 1 deletion(-) plugins/calendar/functions.inc | 9 +++++++++ public_html/admin/install/index.php | 29 ++++++++++++++++++++++++++++- public_html/admin/install/lib-install.php | 28 ++++++++++++++++++++++++++++ diffs (110 lines): diff -r c4c31b02807d -r 7fd9bfe6d53f plugins/calendar/functions.inc --- a/plugins/calendar/functions.inc Fri Dec 26 12:21:20 2008 +0100 +++ b/plugins/calendar/functions.inc Fri Dec 26 15:58:22 2008 +0100 @@ -1432,6 +1432,15 @@ */ function plugin_upgrade_calendar() { + global $_TABLES, $_CA_CONF; + + $version = DB_getItem($_TABLES['plugins'], 'pi_version', + "pi_name = 'calendar'"); + if ($version == $_CA_CONF['version']) { + // nothing to do + return true; + } + // the plugin needs these function so complain when they don't exist if (!function_exists('PLG_uninstall') || !function_exists('COM_createLink')) { diff -r c4c31b02807d -r 7fd9bfe6d53f public_html/admin/install/index.php --- a/public_html/admin/install/index.php Fri Dec 26 12:21:20 2008 +0100 +++ b/public_html/admin/install/index.php Fri Dec 26 15:58:22 2008 +0100 @@ -551,9 +551,17 @@ $config->set_default('default_photo', urldecode($site_url) . '/default.jpg'); } + // disable plugins for which we don't have the source files INST_checkPlugins(); - // Installation is complete. Continue onto either plugin installation or success page + if (! $install_plugins) { + // extra step 4: upgrade plugins + $next_link = 'index.php?step=4&mode=' . $install_type + . '&language=' . $language; + } + + // Installation is complete. Continue onto either plugin + // installation or success page header('Location: ' . $next_link); } else { @@ -562,6 +570,19 @@ } break; } + break; + + /** + * Extra Step 4 - Upgrade plugins + */ + case 4: + INST_pluginUpgrades(); + + $next_link = 'success.php?type=' . $install_type + . '&language=' . $language; + + header('Location: ' . $next_link); + break; } } @@ -1883,6 +1904,12 @@ case 'install': // Deliberate fall-through, no "break" case 'upgrade': + if (($mode == 'upgrade') && ($step == 4)) { + // for the plugin upgrade, + // we need lib-common.php in the global(!) namespace + require_once '../../lib-common.php'; + } + // Run the installation function INST_installEngine($mode, $step); break; diff -r c4c31b02807d -r 7fd9bfe6d53f public_html/admin/install/lib-install.php --- a/public_html/admin/install/lib-install.php Fri Dec 26 12:21:20 2008 +0100 +++ b/public_html/admin/install/lib-install.php Fri Dec 26 15:58:22 2008 +0100 @@ -1023,4 +1023,32 @@ return true; } +/** +* Upgrade any enabled plugins +* +* @note Needs a fully working Geeklog, so can only be done late in the upgrade +* process! +* +*/ +function INST_pluginUpgrades() +{ + global $_CONF, $_TABLES; + + $result = DB_query("SELECT pi_name, pi_version FROM {$_TABLES['plugins']} WHERE pi_enabled = 1"); + $numPlugins = DB_numRows($result); + + for ($i = 0; $i < $numPlugins; $i++) { + list($pi_name, $pi_version) = DB_fetchArray($result); + + $code_version = PLG_chkVersion($pi_name); + if (! empty($code_version) && ($code_version != $pi_version)) { + if (PLG_upgrade($pi_name) !== true) { + // upgrade failed - disable plugin + DB_query("UPDATE {$_TABLES['plugins']} SET pi_enabled = 0 WHERE pi_name = '$pi_name'"); + COM_errorLog("Upgrade for '$pi_name' plugin failed - plugin disabled"); + } + } + } +} + ?> From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:19 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:19 -0500 Subject: [geeklog-cvs] geeklog: Handle plugin upgrade when adding new plugins Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/2a81ead43d9c changeset: 6596:2a81ead43d9c user: Dirk Haun date: Sat Dec 27 10:47:14 2008 +0100 description: Handle plugin upgrade when adding new plugins diffstat: 1 file changed, 13 insertions(+), 8 deletions(-) public_html/admin/install/index.php | 21 +++++++++++++-------- diffs (40 lines): diff -r a0f2b65c1957 -r 2a81ead43d9c public_html/admin/install/index.php --- a/public_html/admin/install/index.php Fri Dec 26 19:31:15 2008 +0100 +++ b/public_html/admin/install/index.php Sat Dec 27 10:47:14 2008 +0100 @@ -554,14 +554,13 @@ // disable plugins for which we don't have the source files INST_checkPlugins(); - if (! $install_plugins) { - // extra step 4: upgrade plugins - $next_link = 'index.php?step=4&mode=' . $install_type - . '&language=' . $language; + // extra step 4: upgrade plugins + $next_link = 'index.php?step=4&mode=' . $install_type + . '&language=' . $language; + if ($install_plugins) { + $next_link .= '&install_plugins=true'; } - // Installation is complete. Continue onto either plugin - // installation or success page header('Location: ' . $next_link); } else { @@ -578,8 +577,14 @@ case 4: INST_pluginUpgrades(); - $next_link = 'success.php?type=' . $install_type - . '&language=' . $language; + $install_plugins = ((isset($_GET['install_plugins']) && + !empty($_GET['install_plugins'])) + ? true + : false); + $next_link = ($install_plugins + ? 'install-plugins.php?language=' . $language + : 'success.php?type=' . $install_type + . '&language=' . $language); header('Location: ' . $next_link); From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:17 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:17 -0500 Subject: [geeklog-cvs] geeklog: Implemented Calendar upgrade Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/a0f2b65c1957 changeset: 6595:a0f2b65c1957 user: Dirk Haun date: Fri Dec 26 19:31:15 2008 +0100 description: Implemented Calendar upgrade diffstat: 6 files changed, 131 insertions(+), 26 deletions(-) plugins/calendar/autoinstall.php | 10 +++-- plugins/calendar/functions.inc | 57 ++++++++++++++++++++++++-------- plugins/calendar/sql/mssql_install.php | 9 ++--- plugins/calendar/sql/mssql_updates.php | 37 ++++++++++++++++++++ plugins/calendar/sql/mysql_install.php | 7 +-- plugins/calendar/sql/mysql_updates.php | 37 ++++++++++++++++++++ diffs (276 lines): diff -r 7fd9bfe6d53f -r a0f2b65c1957 plugins/calendar/autoinstall.php --- a/plugins/calendar/autoinstall.php Fri Dec 26 15:58:22 2008 +0100 +++ b/plugins/calendar/autoinstall.php Fri Dec 26 19:31:15 2008 +0100 @@ -2,7 +2,7 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Calendar plugin 1.1 for Geeklog | +// | Calendar Plugin 1.1 | // +---------------------------------------------------------------------------+ // | autoinstall.php | // | | @@ -100,12 +100,16 @@ // plugin on Geeklog 1.4.0 or older - sorry, but that won't work return false; } - + if (!function_exists('MBYTE_strpos')) { // the plugin requires the multi-byte functions return false; } - + + if (!function_exists('COM_createLink')) { + return false; + } + if (!function_exists('SEC_createToken')) { return false; } diff -r 7fd9bfe6d53f -r a0f2b65c1957 plugins/calendar/functions.inc --- a/plugins/calendar/functions.inc Fri Dec 26 15:58:22 2008 +0100 +++ b/plugins/calendar/functions.inc Fri Dec 26 19:31:15 2008 +0100 @@ -2,7 +2,7 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Calendar Plugin 1.0 | +// | Calendar Plugin 1.1 | // +---------------------------------------------------------------------------+ // | functions.inc | // | | @@ -57,7 +57,6 @@ $_CA_CONF = $ca_config->get_config('calendar'); } -$_CA_CONF['version'] = '1.1.0'; // +---------------------------------------------------------------------------+ // | Geeklog Plugin API Implementations | @@ -1419,9 +1418,13 @@ */ function plugin_chkVersion_calendar() { - global $_CA_CONF; + global $_CONF; - return $_CA_CONF['version']; + require_once $_CONF['path'] . 'plugins/calendar/autoinstall.php'; + + $inst_parms = plugin_autoinstall_calendar('calendar'); + + return $inst_parms['info']['pi_version']; } /** @@ -1432,24 +1435,50 @@ */ function plugin_upgrade_calendar() { - global $_TABLES, $_CA_CONF; + global $_CONF, $_TABLES, $_DB_dbms; - $version = DB_getItem($_TABLES['plugins'], 'pi_version', - "pi_name = 'calendar'"); - if ($version == $_CA_CONF['version']) { + $installed_version = DB_getItem($_TABLES['plugins'], 'pi_version', + "pi_name = 'calendar'"); + $code_version = plugin_chkVersion_calendar(); + if ($installed_version == $code_version) { // nothing to do return true; } - // the plugin needs these function so complain when they don't exist - if (!function_exists('PLG_uninstall') || - !function_exists('COM_createLink')) { + require_once $_CONF['path'] . 'plugins/calendar/autoinstall.php'; + + if (! plugin_compatible_with_this_version_calendar('calendar')) { return 3002; } - // upgrades are done by the install script - return a generic error - COM_errorLog("Plugin upgrade function not implemented"); - return 3001; + $inst_parms = plugin_autoinstall_calendar('calendar'); + $pi_gl_version = $inst_parms['info']['pi_gl_version']; + + require_once $_CONF['path'] . 'plugins/calendar/sql/' + . $_DB_dbms . '_updates.php'; + + $current_version = $installed_version; + $done = false; + while (! $done) { + switch ($current_version) { + case '1.0.2': + if (isset($_UPDATES[$current_version])) { + $_SQL = $_UPDATES[$current_version]; + foreach ($_SQL as $sql) { + DB_query($sql); + } + } + $current_version = '1.1.0'; + break; + + default: + $done = true; + } + } + + DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '$code_version', pi_gl_version = '$pi_gl_version' WHERE pi_name = 'calendar'"); + + return true; } /** diff -r 7fd9bfe6d53f -r a0f2b65c1957 plugins/calendar/sql/mssql_install.php --- a/plugins/calendar/sql/mssql_install.php Fri Dec 26 15:58:22 2008 +0100 +++ b/plugins/calendar/sql/mssql_install.php Fri Dec 26 19:31:15 2008 +0100 @@ -2,9 +2,9 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Calendar Plugin 1.0 | +// | Calendar Plugin 1.1 | // +---------------------------------------------------------------------------+ -// | Installation SQL | +// | mssql_install.php | // +---------------------------------------------------------------------------+ // | Copyright (C) 2000-2008 by the following authors: | // | | @@ -30,8 +30,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: mssql_install.php,v 1.6 2008/08/12 18:13:33 mjervis Exp $ $_SQL[] = " CREATE TABLE [dbo].[{$_TABLES['events']}] ( @@ -58,7 +56,8 @@ [event_type] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [location] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [timestart] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , - [timeend] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL + [timeend] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , + [in_transit] [tinyint] NULL ) ON [PRIMARY] "; diff -r 7fd9bfe6d53f -r a0f2b65c1957 plugins/calendar/sql/mssql_updates.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/calendar/sql/mssql_updates.php Fri Dec 26 19:31:15 2008 +0100 @@ -0,0 +1,37 @@ + array( + "ALTER TABLE {$_TABLES['events']} ADD in_transit tinyint NULL" + ) + +); + +?> diff -r 7fd9bfe6d53f -r a0f2b65c1957 plugins/calendar/sql/mysql_install.php --- a/plugins/calendar/sql/mysql_install.php Fri Dec 26 15:58:22 2008 +0100 +++ b/plugins/calendar/sql/mysql_install.php Fri Dec 26 19:31:15 2008 +0100 @@ -2,9 +2,9 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Calendar Plugin 1.0 | +// | Calendar Plugin 1.1 | // +---------------------------------------------------------------------------+ -// | Installation SQL | +// | mysql_install.php | // +---------------------------------------------------------------------------+ // | Copyright (C) 2000-2008 by the following authors: | // | | @@ -29,8 +29,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: mysql_install.php,v 1.3 2008/05/02 12:08:07 dhaun Exp $ $_SQL[] = " CREATE TABLE {$_TABLES['events']} ( @@ -58,6 +56,7 @@ location varchar(128) default NULL, timestart time default NULL, timeend time default NULL, + in_transit tinyint(1) unsigned default '0', INDEX events_eid(eid), INDEX events_event_type(event_type), INDEX events_datestart(datestart), diff -r 7fd9bfe6d53f -r a0f2b65c1957 plugins/calendar/sql/mysql_updates.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/calendar/sql/mysql_updates.php Fri Dec 26 19:31:15 2008 +0100 @@ -0,0 +1,37 @@ + array( + "ALTER TABLE {$_TABLES['events']} ADD in_transit tinyint(1) unsigned default '0' AFTER timeend" + ) + +); + +?> From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:19 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:19 -0500 Subject: [geeklog-cvs] geeklog: Cosmetics: Try to display the plugin's full/display name Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/e02ca493ee9a changeset: 6597:e02ca493ee9a user: Dirk Haun date: Sat Dec 27 11:46:10 2008 +0100 description: Cosmetics: Try to display the plugin's full/display name diffstat: 3 files changed, 67 insertions(+), 16 deletions(-) public_html/admin/plugins.php | 70 ++++++++++-- public_html/layout/professional/admin/plugins/editor.thtml | 2 system/lib-admin.php | 11 + diffs (173 lines): diff -r 2a81ead43d9c -r e02ca493ee9a public_html/admin/plugins.php --- a/public_html/admin/plugins.php Sat Dec 27 10:47:14 2008 +0100 +++ b/public_html/admin/plugins.php Sat Dec 27 11:46:10 2008 +0100 @@ -32,8 +32,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: plugins.php,v 1.84 2008/09/18 19:09:38 dhaun Exp $ require_once '../lib-common.php'; require_once 'auth.inc.php'; @@ -73,11 +71,8 @@ $retval = ''; - if (strlen ($pi_name) == 0) { - $retval .= COM_startBlock ($LANG32[13], '', - COM_getBlockTemplate ('_msg_block', 'header')); - $retval .= COM_errorLog ($LANG32[12]); - $retval .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer')); + if (strlen($pi_name) == 0) { + $retval .= COM_showMessageText($LANG32[12], $LANG32[13]); return $retval; } @@ -108,13 +103,13 @@ $plg_templates->set_var('lang_save', $LANG_ADMIN['save']); $plg_templates->set_var('lang_cancel', $LANG_ADMIN['cancel']); $plg_templates->set_var('lang_delete', $LANG_ADMIN['delete']); - $plg_templates->set_var ('pi_icon', PLG_getIcon ($pi_name)); + $plg_templates->set_var('pi_icon', PLG_getIcon($pi_name)); if (!empty($pi_name)) { $plg_templates->set_var ('delete_option', ''); } $plugin_code_version = PLG_chkVersion($pi_name); - if (empty ($plugin_code_version)) { + if (empty($plugin_code_version)) { $code_version = 'N/A'; } else { $code_version = $plugin_code_version; @@ -130,6 +125,7 @@ $plg_templates->set_var('confirmed', $confirmed); $plg_templates->set_var('lang_pluginname', $LANG32[26]); $plg_templates->set_var('pi_name', $pi_name); + $plg_templates->set_var('pi_display_name', plugin_get_pluginname($pi_name)); $plg_templates->set_var('lang_pluginhomepage', $LANG32[27]); $plg_templates->set_var('pi_homepage', $A['pi_homepage']); $plg_templates->set_var('lang_pluginversion', $LANG32[28]); @@ -298,7 +294,7 @@ } $url .= '&' . CSRF_TOKEN . '=' . $token; $data_arr[] = array( - 'pi_name' => $dir, + 'pi_name' => plugin_get_pluginname($dir), 'number' => $index, 'install_link' => COM_createLink($LANG32[22], $url) ); @@ -441,7 +437,7 @@ ); // this is a dummy variable so we know the form has been used if all plugins - // should be disabled in order to disable the last one. + // should be disabled in order to disable the last one. $form_arr = array('bottom' => ''); $retval .= ADMIN_list('plugins', 'ADMIN_getListField_plugins', $header_arr, @@ -1007,6 +1003,58 @@ return true; } +/** +* See if we can figure out the plugin's real name +* +* @param string $plugin internal name / directory name +* @return string real or beautified name +* +*/ +function plugin_get_pluginname($plugin) +{ + global $_CONF; + + $retval = ''; + + $plugins_dir = $_CONF['path'] . 'plugins/'; + $autoinstall = $plugins_dir . $plugin . '/autoinstall.php'; + + // for new plugins, get the name from the autoinstall.php + if (file_exists($autoinstall)) { + + require_once $autoinstall; + + $fn = 'plugin_autoinstall_' . $plugin; + if (function_exists($fn)) { + $info = $fn($plugin); + if (is_array($info) && isset($info['info']) && + isset($info['info']['pi_display_name'])) { + $retval = $info['info']['pi_display_name']; + } + } + + } + + if (empty($retval)) { + // else try the 'getadminoption' function + // - may fail if we don't have the proper permissions + $fn = 'plugin_getadminoption_' . $plugin; + if (function_exists($fn)) { + $result = $fn(); + if (is_array($result) && !empty($result[0])) { + $retval = $result[0]; + } + } + } + + if (empty($retval)) { + // give up and fake it + $retval = strtoupper($plugin{0}) . substr($plugin, 1); + } + + return $retval; +} + // MAIN $display = ''; diff -r 2a81ead43d9c -r e02ca493ee9a public_html/layout/professional/admin/plugins/editor.thtml --- a/public_html/layout/professional/admin/plugins/editor.thtml Sat Dec 27 10:47:14 2008 +0100 +++ b/public_html/layout/professional/admin/plugins/editor.thtml Sat Dec 27 11:46:10 2008 +0100 @@ -18,7 +18,7 @@ {lang_pluginname}: - {pi_name} + {pi_display_name} {lang_pluginhomepage}: diff -r 2a81ead43d9c -r e02ca493ee9a system/lib-admin.php --- a/system/lib-admin.php Sat Dec 27 10:47:14 2008 +0100 +++ b/system/lib-admin.php Sat Dec 27 11:46:10 2008 +0100 @@ -32,8 +32,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: lib-admin.php,v 1.136 2008/09/21 08:37:11 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'lib-admin.php') !== false) { die('This file can not be used on its own!'); @@ -957,14 +955,19 @@ return $retval; } -function ADMIN_getListField_plugins($fieldname, $fieldvalue, $A, $icon_arr, $token) { +function ADMIN_getListField_plugins($fieldname, $fieldvalue, $A, $icon_arr, $token) +{ global $_CONF, $LANG_ADMIN, $LANG32; + $retval = ''; switch($fieldname) { - case "edit": + case 'edit': $retval = COM_createLink($icon_arr['edit'], "{$_CONF['site_admin_url']}/plugins.php?mode=edit&pi_name={$A['pi_name']}"); + break; + case 'pi_name': + $retval = plugin_get_pluginname($A['pi_name']); break; case 'pi_version': $plugin_code_version = PLG_chkVersion ($A['pi_name']); From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:22 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:22 -0500 Subject: [geeklog-cvs] geeklog: Implemented Links upgrade Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/1f6f00948537 changeset: 6599:1f6f00948537 user: Dirk Haun date: Sat Dec 27 22:22:41 2008 +0100 description: Implemented Links upgrade diffstat: 3 files changed, 24 insertions(+), 14 deletions(-) plugins/links/functions.inc | 30 ++++++++++++++++++++++++------ sql/updates/mssql_1.5.1_to_1.6.0.php | 4 ---- sql/updates/mysql_1.5.1_to_1.6.0.php | 4 ---- diffs (71 lines): diff -r fb55acb618e1 -r 1f6f00948537 plugins/links/functions.inc --- a/plugins/links/functions.inc Sat Dec 27 15:31:21 2008 +0100 +++ b/plugins/links/functions.inc Sat Dec 27 22:22:41 2008 +0100 @@ -713,15 +713,33 @@ */ function plugin_upgrade_links() { - // the plugin needs these function so complain when they don't exist - if (!function_exists('PLG_uninstall') || - !function_exists('COM_createLink')) { + global $_CONF, $_TABLES, $_LI_CONF; + + $installed_version = DB_getItem($_TABLES['plugins'], 'pi_version', + "pi_name = 'links'"); + $code_version = plugin_chkVersion_links(); + if ($installed_version == $code_version) { + // nothing to do + return true; + } + + require_once $_CONF['path'] . 'plugins/links/autoinstall.php'; + + if (! plugin_compatible_with_this_version_links('links')) { return 3002; } - // upgrades are done by the install script - return a generic error - COM_errorLog("Plugin upgrade function not implemented"); - return 3001; + $inst_parms = plugin_autoinstall_links('links'); + $pi_gl_version = $inst_parms['info']['pi_gl_version']; + + if (! isset($_LI_CONF['new_window'])) { + $c = config::get_instance(); + $c->add('new_window',false,'select',0,0,1,55,TRUE,'links'); + } + + DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '$code_version', pi_gl_version = '$pi_gl_version' WHERE pi_name = 'links'"); + + return true; } /** diff -r fb55acb618e1 -r 1f6f00948537 sql/updates/mssql_1.5.1_to_1.6.0.php --- a/sql/updates/mssql_1.5.1_to_1.6.0.php Sat Dec 27 15:31:21 2008 +0100 +++ b/sql/updates/mssql_1.5.1_to_1.6.0.php Sat Dec 27 22:22:41 2008 +0100 @@ -10,10 +10,6 @@ // new option $c->add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); - - if (INST_pluginExists('links')) { - $c->add('new_window',false,'select',0,0,1,55,TRUE,'links'); - } return true; } diff -r fb55acb618e1 -r 1f6f00948537 sql/updates/mysql_1.5.1_to_1.6.0.php --- a/sql/updates/mysql_1.5.1_to_1.6.0.php Sat Dec 27 15:31:21 2008 +0100 +++ b/sql/updates/mysql_1.5.1_to_1.6.0.php Sat Dec 27 22:22:41 2008 +0100 @@ -10,10 +10,6 @@ // new option $c->add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); - - if (INST_pluginExists('links')) { - $c->add('new_window',false,'select',0,0,1,55,TRUE,'links'); - } return true; } From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:22 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:22 -0500 Subject: [geeklog-cvs] geeklog: Implemented Links autoinstall Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/fb55acb618e1 changeset: 6598:fb55acb618e1 user: Dirk Haun date: Sat Dec 27 15:31:21 2008 +0100 description: Implemented Links autoinstall diffstat: 3 files changed, 160 insertions(+), 399 deletions(-) plugins/links/autoinstall.php | 153 ++++++++++ plugins/links/functions.inc | 11 public_html/admin/plugins/links/install.php | 395 --------------------------- diffs (truncated from 592 to 300 lines): diff -r e02ca493ee9a -r fb55acb618e1 plugins/links/autoinstall.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/links/autoinstall.php Sat Dec 27 15:31:21 2008 +0100 @@ -0,0 +1,153 @@ + $pi_name, + 'pi_display_name' => $pi_display_name, + 'pi_version' => '2.1.0', + 'pi_gl_version' => '1.6.0', + 'pi_homepage' => 'http://www.geeklog.net/' + ); + + $groups = array( + $pi_admin => 'Has full access to ' . $pi_display_name . ' features' + ); + + $features = array( + $pi_name . '.edit' => 'Access to links editor', + $pi_name . '.moderate' => 'Ability to moderate pending links', + $pi_name . '.submit' => 'May skip the links submission queue' + ); + + $mappings = array( + $pi_name . '.edit' => array($pi_admin), + $pi_name . '.moderate' => array($pi_admin), + $pi_name . '.submit' => array($pi_admin) + ); + + $tables = array( + 'linkcategories', + 'links', + 'linksubmission' + ); + + $inst_parms = array( + 'info' => $info, + 'groups' => $groups, + 'features' => $features, + 'mappings' => $mappings, + 'tables' => $tables + ); + + return $inst_parms; +} + +function plugin_load_configuration_links($pi_name) +{ + global $_CONF, $base_path; + + $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/'; + + require_once $_CONF['path_system'] . 'classes/config.class.php'; + require_once $base_path . 'install_defaults.php'; + + return plugin_initconfig_links(); +} + +/** +* Plugin postinstall +* +* We're inserting our default data here since it depends on other stuff that +* has to happen first ... +* +* @return boolean true = proceed with install, false = an error occured +* +*/ +function plugin_postinstall_links($pi_name) +{ + global $_CONF, $_TABLES; + + require_once $_CONF['path_system'] . 'classes/config.class.php'; + + $li_config = config::get_instance(); + $_LI_CONF = $li_config->get_config('links'); + + $inst_parms = plugin_autoinstall_links($pi_name); + $pi_admin = key($inst_parms['groups']); + + $admin_group_id = DB_getItem($_TABLES['groups'], 'grp_id', + "grp_name = '{$pi_admin}'"); + $blockadmin_id = DB_getItem($_TABLES['groups'], 'grp_id', + "grp_name = 'Block Admin'"); + + $L_SQL = array(); + $L_SQL[] = "INSERT INTO {$_TABLES['linkcategories']} (cid, pid, category, description, tid, created, modified, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES ('{$_LI_CONF['root']}', 'root', 'Root', 'Website root', '', NOW(), NOW(), #group#, 2, 3, 3, 2, 2)"; + + $L_SQL[] = "INSERT INTO {$_TABLES['linkcategories']} (cid, pid, category, description, tid, created, modified, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES ('geeklog-sites', '{$_LI_CONF['root']}', 'Geeklog Sites', 'Sites using or related to the Geeklog CMS', NULL, NOW(), NOW(), #group#, 2, 3, 3, 2, 2)"; + + $L_SQL[] = "INSERT INTO {$_TABLES['links']} (lid, cid, url, description, title, hits, date, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon) VALUES ('geeklog.net', 'geeklog-sites', 'http://www.geeklog.net/', 'Visit the Geeklog homepage for support, FAQs, updates, add-ons, and a great community.', 'Geeklog Project Homepage', 123, NOW(), 1, #group#, 3, 3, 2, 2);"; + + foreach ($L_SQL as $sql) { + $sql = str_replace('#group#', $admin_group_id, $sql); + DB_query($sql, 1); + if (DB_error()) { + COM_error("SQL error in Links plugin postinstall, SQL: " . $sql); + return false; + } + } + + return true; +} + +function plugin_compatible_with_this_version_links($pi_name) +{ + if (!function_exists('COM_truncate') || !function_exists('MBYTE_strpos')) { + return false; + } + + if (!function_exists('SEC_createToken')) { + return false; + } + + if (!function_exists('COM_showMessageText')) { + return false; + } + + return true; +} + +?> diff -r e02ca493ee9a -r fb55acb618e1 plugins/links/functions.inc --- a/plugins/links/functions.inc Sat Dec 27 11:46:10 2008 +0100 +++ b/plugins/links/functions.inc Sat Dec 27 15:31:21 2008 +0100 @@ -2,7 +2,7 @@ // Reminder: always indent with 4 spaces (no tabs). // +---------------------------------------------------------------------------+ -// | Links Plugin 2.0 | +// | Links Plugin 2.1 | // +---------------------------------------------------------------------------+ // | functions.inc | // | | @@ -59,7 +59,6 @@ $_LI_CONF = $li_config->get_config('links'); } -$_LI_CONF['version'] = '2.0.0'; // +---------------------------------------------------------------------------+ // | Geeklog Plugin API Implementation | @@ -207,9 +206,13 @@ */ function plugin_chkVersion_links () { - global $_LI_CONF; + global $_CONF; - return $_LI_CONF['version']; + require_once $_CONF['path'] . 'plugins/links/autoinstall.php'; + + $inst_parms = plugin_autoinstall_links('links'); + + return $inst_parms['info']['pi_version']; } /** diff -r e02ca493ee9a -r fb55acb618e1 public_html/admin/plugins/links/install.php --- a/public_html/admin/plugins/links/install.php Sat Dec 27 11:46:10 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,395 +0,0 @@ - details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/35e3270f5456 changeset: 6600:35e3270f5456 user: Dirk Haun date: Sun Dec 28 00:39:41 2008 +0100 description: Implemented Spam-X autoinstall and upgrade diffstat: 5 files changed, 143 insertions(+), 364 deletions(-) plugins/spamx/autoinstall.php | 109 ++++++++ plugins/spamx/functions.inc | 37 ++ plugins/spamx/sql/mssql_install.php | 8 plugins/spamx/sql/mysql_install.php | 8 public_html/admin/plugins/spamx/install.php | 345 --------------------------- diffs (truncated from 601 to 300 lines): diff -r 1f6f00948537 -r 35e3270f5456 plugins/spamx/autoinstall.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/spamx/autoinstall.php Sun Dec 28 00:39:41 2008 +0100 @@ -0,0 +1,109 @@ + $pi_name, + 'pi_display_name' => $pi_display_name, + 'pi_version' => '1.2.0', + 'pi_gl_version' => '1.6.0', + 'pi_homepage' => 'http://www.pigstye.net/gplugs/staticpages/index.php/spamx' + ); + + $groups = array( + $pi_admin => 'Users in this group can administer the ' + . $pi_display_name . ' plugin' + ); + + $features = array( + $pi_name . '.admint' => 'Full access to ' . $pi_display_name + .' plugin' + ); + + $mappings = array( + $pi_name . '.admin' => array($pi_admin) + ); + + $tables = array( + 'spamx' + ); + + $inst_parms = array( + 'info' => $info, + 'groups' => $groups, + 'features' => $features, + 'mappings' => $mappings, + 'tables' => $tables + ); + + return $inst_parms; +} + +function plugin_load_configuration_spamx($pi_name) +{ + global $_CONF; + + $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/'; + + require_once $_CONF['path_system'] . 'classes/config.class.php'; + require_once $base_path . 'install_defaults.php'; + + return plugin_initconfig_spamx(); +} + +function plugin_postinstall_spamx($pi_name) +{ + return true; +} + +function plugin_compatible_with_this_version_spamx($pi_name) +{ + if (! function_exists('PLG_spamAction')) { + return false; + } + + if (! function_exists('SEC_createToken')) { + return false; + } + + if (! function_exists('COM_showMessageText')) { + return false; + } + + return true; +} + +?> diff -r 1f6f00948537 -r 35e3270f5456 plugins/spamx/functions.inc --- a/plugins/spamx/functions.inc Sat Dec 27 22:22:41 2008 +0100 +++ b/plugins/spamx/functions.inc Sun Dec 28 00:39:41 2008 +0100 @@ -10,7 +10,6 @@ * * Licensed under GNU General Public License * - * $Id: functions.inc,v 1.37 2008/09/21 08:37:08 dhaun Exp $ */ if (strpos(strtolower($_SERVER['PHP_SELF']), 'functions.inc') !== false) { @@ -39,7 +38,6 @@ $_SPX_CONF = $spx_config->get_config('spamx'); } -$_SPX_CONF['version'] = '1.1.1'; // +---------------------------------------------------------------------------+ // | Geeklog Plugin API Implementations | @@ -146,11 +144,15 @@ * * @return string plugin version */ -function plugin_chkVersion_spamx () +function plugin_chkVersion_spamx() { - global $_SPX_CONF; + global $_CONF; - return $_SPX_CONF['version']; + require_once $_CONF['path'] . 'plugins/spamx/autoinstall.php'; + + $inst_parms = plugin_autoinstall_spamx('spamx'); + + return $inst_parms['info']['pi_version']; } /** @@ -161,15 +163,28 @@ */ function plugin_upgrade_spamx() { - // the plugin needs these function so complain when they don't exist - if (!function_exists('PLG_uninstall') || - !function_exists('COM_createLink')) { + global $_CONF, $_TABLES; + + $installed_version = DB_getItem($_TABLES['plugins'], 'pi_version', + "pi_name = 'spamx'"); + $code_version = plugin_chkVersion_spamx(); + if ($installed_version == $code_version) { + // nothing to do + return true; + } + + require_once $_CONF['path'] . 'plugins/spamx/autoinstall.php'; + + if (! plugin_compatible_with_this_version_spamx('spamx')) { return 3002; } - // upgrades are done by the install script - return a generic error - COM_errorLog("Plugin upgrade function not implemented"); - return 3001; + $inst_parms = plugin_autoinstall_spamx('spamx'); + $pi_gl_version = $inst_parms['info']['pi_gl_version']; + + DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '$code_version', pi_gl_version = '$pi_gl_version' WHERE pi_name = 'spamx'"); + + return true; } /** diff -r 1f6f00948537 -r 35e3270f5456 plugins/spamx/sql/mssql_install.php --- a/plugins/spamx/sql/mssql_install.php Sat Dec 27 22:22:41 2008 +0100 +++ b/plugins/spamx/sql/mssql_install.php Sun Dec 28 00:39:41 2008 +0100 @@ -2,11 +2,11 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Spam-X Plugin 1.1 | +// | Spam-X Plugin 1.2 | // +---------------------------------------------------------------------------+ // | Installation SQL | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2004-2006 by the following authors: | +// | Copyright (C) 2004-2008 by the following authors: | // | | // | Authors: Tom Willett - tomw AT pigstye DOT net | // | Randy Kolenko - randy AT nextide DOT ca | @@ -26,8 +26,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: mssql_install.php,v 1.1 2006/08/28 18:42:25 dhaun Exp $ $_SQL[] = " CREATE TABLE [dbo].[{$_TABLES['spamx']}] ( @@ -36,4 +34,6 @@ ) ON [PRIMARY] "; +$DEFVALUES[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('spamx.counter', '0')"; + ?> diff -r 1f6f00948537 -r 35e3270f5456 plugins/spamx/sql/mysql_install.php --- a/plugins/spamx/sql/mysql_install.php Sat Dec 27 22:22:41 2008 +0100 +++ b/plugins/spamx/sql/mysql_install.php Sun Dec 28 00:39:41 2008 +0100 @@ -2,11 +2,11 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Spam-X Plugin 1.1 | +// | Spam-X Plugin 1.2 | // +---------------------------------------------------------------------------+ // | Installation SQL | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2004-2006 by the following authors: | +// | Copyright (C) 2004-2008 by the following authors: | // | | // | Authors: Tom Willett - tomw AT pigstye DOT net | // +---------------------------------------------------------------------------+ @@ -25,8 +25,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: mysql_install.php,v 1.1 2006/08/20 16:27:52 dhaun Exp $ $_SQL[] = " CREATE TABLE {$_TABLES['spamx']} ( @@ -36,4 +34,6 @@ ) TYPE=MyISAM "; +$DEFVALUES[] = "INSERT INTO {$_TABLES['vars']} (name, value) VALUES ('spamx.counter', '0')"; + ?> diff -r 1f6f00948537 -r 35e3270f5456 public_html/admin/plugins/spamx/install.php --- a/public_html/admin/plugins/spamx/install.php Sat Dec 27 22:22:41 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,345 +0,0 @@ - details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/5216b7b7a5ae changeset: 6601:5216b7b7a5ae user: Dirk Haun date: Sun Dec 28 10:11:54 2008 +0100 description: Implemented Static Pages autoinstall and upgrade diffstat: 3 files changed, 142 insertions(+), 367 deletions(-) plugins/staticpages/autoinstall.php | 116 ++++++ plugins/staticpages/functions.inc | 36 +- public_html/admin/plugins/staticpages/install.php | 357 --------------------- diffs (truncated from 552 to 300 lines): diff -r 35e3270f5456 -r 5216b7b7a5ae plugins/staticpages/autoinstall.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/staticpages/autoinstall.php Sun Dec 28 10:11:54 2008 +0100 @@ -0,0 +1,116 @@ + $pi_name, + 'pi_display_name' => $pi_display_name, + 'pi_version' => '1.6.0', + 'pi_gl_version' => '1.6.0', + 'pi_homepage' => 'http://www.geeklog.net/' + ); + + $groups = array( + $pi_admin => 'Users in this group can administer the ' + . $pi_display_name . ' plugin' + ); + + $features = array( + $pi_name . '.edit' => 'Access to ' . $pi_display_name . ' editor', + $pi_name . '.delete' => 'Ability to delete static pages', + $pi_name . '.PHP' => 'Ability to use PHP in static pages' + ); + + $mappings = array( + $pi_name . '.edit' => array($pi_admin), + $pi_name . '.delete' => array($pi_admin) + // Note: 'staticpages.PHP' is not assigned to any group by default + ); + + $tables = array( + 'staticpage' + ); + + $inst_parms = array( + 'info' => $info, + 'groups' => $groups, + 'features' => $features, + 'mappings' => $mappings, + 'tables' => $tables + ); + + return $inst_parms; +} + +function plugin_load_configuration_staticpages($pi_name) +{ + global $_CONF; + + $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/'; + + require_once $_CONF['path_system'] . 'classes/config.class.php'; + require_once $base_path . 'install_defaults.php'; + + return plugin_initconfig_staticpages(); +} + +function plugin_postinstall_staticpages($pi_name) +{ + return true; +} + +function plugin_compatible_with_this_version_staticpages($pi_name) +{ + if (! function_exists('SEC_getGroupDropdown')) { + return false; + } + + if (! function_exists('SEC_createToken')) { + return false; + } + + if (! function_exists('COM_showMessageText')) { + return false; + } + + if (! function_exists('COM_setLangIdAndAttribute')) { + return false; + } + + return true; +} + +?> diff -r 35e3270f5456 -r 5216b7b7a5ae plugins/staticpages/functions.inc --- a/plugins/staticpages/functions.inc Sun Dec 28 00:39:41 2008 +0100 +++ b/plugins/staticpages/functions.inc Sun Dec 28 10:11:54 2008 +0100 @@ -2,7 +2,7 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Static Pages Plugin 1.5 | +// | Static Pages Plugin 1.6 | // +---------------------------------------------------------------------------+ // | functions.inc | // | | @@ -57,7 +57,6 @@ $_SP_CONF = $sp_config->get_config('staticpages'); } -$_SP_CONF['version'] = '1.5.0'; // +---------------------------------------------------------------------------+ // | Plugin API - Services | @@ -986,9 +985,13 @@ */ function plugin_chkVersion_staticpages() { - global $_SP_CONF; + global $_CONF; - return $_SP_CONF['version']; + require_once $_CONF['path'] . 'plugins/staticpages/autoinstall.php'; + + $inst_parms = plugin_autoinstall_staticpages('staticpages'); + + return $inst_parms['info']['pi_version']; } /** @@ -1053,15 +1056,28 @@ */ function plugin_upgrade_staticpages() { - // the plugin needs these function so complain when they don't exist - if (!function_exists('PLG_uninstall') || - !function_exists('COM_createLink')) { + global $_CONF, $_TABLES; + + $installed_version = DB_getItem($_TABLES['plugins'], 'pi_version', + "pi_name = 'staticpages'"); + $code_version = plugin_chkVersion_staticpages(); + if ($installed_version == $code_version) { + // nothing to do + return true; + } + + require_once $_CONF['path'] . 'plugins/staticpages/autoinstall.php'; + + if (! plugin_compatible_with_this_version_staticpages('staticpages')) { return 3002; } - // upgrades are done by the install script - return a generic error - COM_errorLog("Plugin upgrade function not implemented"); - return 3001; + $inst_parms = plugin_autoinstall_staticpages('staticpages'); + $pi_gl_version = $inst_parms['info']['pi_gl_version']; + + DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '$code_version', pi_gl_version = '$pi_gl_version' WHERE pi_name = 'staticpages'"); + + return true; } diff -r 35e3270f5456 -r 5216b7b7a5ae public_html/admin/plugins/staticpages/install.php --- a/public_html/admin/plugins/staticpages/install.php Sun Dec 28 00:39:41 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,357 +0,0 @@ - details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/e85cfa6ea9fe changeset: 6602:e85cfa6ea9fe user: Dirk Haun date: Sun Dec 28 10:13:44 2008 +0100 description: Fixed global declaration diffstat: 2 files changed, 2 insertions(+), 2 deletions(-) plugins/calendar/autoinstall.php | 2 +- plugins/links/autoinstall.php | 2 +- diffs (24 lines): diff -r 5216b7b7a5ae -r e85cfa6ea9fe plugins/calendar/autoinstall.php --- a/plugins/calendar/autoinstall.php Sun Dec 28 10:11:54 2008 +0100 +++ b/plugins/calendar/autoinstall.php Sun Dec 28 10:13:44 2008 +0100 @@ -78,7 +78,7 @@ function plugin_load_configuration_calendar($pi_name) { - global $_CONF, $base_path; + global $_CONF; $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/'; diff -r 5216b7b7a5ae -r e85cfa6ea9fe plugins/links/autoinstall.php --- a/plugins/links/autoinstall.php Sun Dec 28 10:11:54 2008 +0100 +++ b/plugins/links/autoinstall.php Sun Dec 28 10:13:44 2008 +0100 @@ -78,7 +78,7 @@ function plugin_load_configuration_links($pi_name) { - global $_CONF, $base_path; + global $_CONF; $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/'; From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:32 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:32 -0500 Subject: [geeklog-cvs] geeklog: Implemented Polls upgrade Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/9a4f84840886 changeset: 6604:9a4f84840886 user: Dirk Haun date: Sun Dec 28 20:00:25 2008 +0100 description: Implemented Polls upgrade diffstat: 6 files changed, 121 insertions(+), 57 deletions(-) plugins/polls/functions.inc | 47 +++++++++++++++++++++++++++++----- plugins/polls/sql/mssql_updates.php | 40 ++++++++++++++++++++++++++++ plugins/polls/sql/mysql_updates.php | 40 ++++++++++++++++++++++++++++ public_html/admin/install/index.php | 8 ----- sql/updates/mssql_1.5.1_to_1.6.0.php | 21 --------------- sql/updates/mysql_1.5.1_to_1.6.0.php | 22 --------------- diffs (225 lines): diff -r 6bf615c55b68 -r 9a4f84840886 plugins/polls/functions.inc --- a/plugins/polls/functions.inc Sun Dec 28 10:59:04 2008 +0100 +++ b/plugins/polls/functions.inc Sun Dec 28 20:00:25 2008 +0100 @@ -1111,15 +1111,50 @@ */ function plugin_upgrade_polls() { - // the plugin needs these function so complain when they don't exist - if (!function_exists('PLG_uninstall') || - !function_exists('COM_createLink')) { + global $_CONF, $_TABLES, $_DB_dbms; + + $installed_version = DB_getItem($_TABLES['plugins'], 'pi_version', + "pi_name = 'polls'"); + $code_version = plugin_chkVersion_polls(); + if ($installed_version == $code_version) { + // nothing to do + return true; + } + + require_once $_CONF['path'] . 'plugins/polls/autoinstall.php'; + + if (! plugin_compatible_with_this_version_polls('polls')) { return 3002; } - // upgrades are done by the install script - return a generic error - COM_errorLog("Plugin upgrade function not implemented"); - return 3001; + $inst_parms = plugin_autoinstall_polls('polls'); + $pi_gl_version = $inst_parms['info']['pi_gl_version']; + + require_once $_CONF['path'] . 'plugins/polls/sql/' + . $_DB_dbms . '_updates.php'; + + $current_version = $installed_version; + $done = false; + while (! $done) { + switch ($current_version) { + case '2.0.1': + if (isset($_UPDATES[$current_version])) { + $_SQL = $_UPDATES[$current_version]; + foreach ($_SQL as $sql) { + DB_query($sql); + } + } + $current_version = '2.1.0'; + break; + + default: + $done = true; + } + } + + DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '$code_version', pi_gl_version = '$pi_gl_version' WHERE pi_name = 'polls'"); + + return true; } /** diff -r 6bf615c55b68 -r 9a4f84840886 plugins/polls/sql/mssql_updates.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/polls/sql/mssql_updates.php Sun Dec 28 20:00:25 2008 +0100 @@ -0,0 +1,40 @@ + array( + "ALTER TABLE {$_TABLES['pollanswers']} ALTER COLUMN [pid] VARCHARS(40)", + "ALTER TABLE {$_TABLES['pollquestions']} ALTER COLUMN [pid] VARCHARS(40)", + "ALTER TABLE {$_TABLES['polltopics']} ALTER COLUMN [pid] VARCHARS(40)", + "ALTER TABLE {$_TABLES['pollvoters']} ALTER COLUMN [pid] VARCHARS(40)" + ) + +); + +?> diff -r 6bf615c55b68 -r 9a4f84840886 plugins/polls/sql/mysql_updates.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/polls/sql/mysql_updates.php Sun Dec 28 20:00:25 2008 +0100 @@ -0,0 +1,40 @@ + array( + "ALTER TABLE {$_TABLES['pollanswers']} CHANGE pid pid varchar(40) NOT NULL default ''", + "ALTER TABLE {$_TABLES['pollquestions']} CHANGE pid pid varchar(40) NOT NULL default ''", + "ALTER TABLE {$_TABLES['polltopics']} CHANGE pid pid varchar(40) NOT NULL default ''", + "ALTER TABLE {$_TABLES['pollvoters']} CHANGE pid pid varchar(40) NOT NULL default ''" + ) + +); + +?> diff -r 6bf615c55b68 -r 9a4f84840886 public_html/admin/install/index.php --- a/public_html/admin/install/index.php Sun Dec 28 10:59:04 2008 +0100 +++ b/public_html/admin/install/index.php Sun Dec 28 20:00:25 2008 +0100 @@ -1409,14 +1409,6 @@ update_ConfValues(); - if (INST_pluginExists('polls')) { - $check = upgrade_PollsPluginId(); - if (!$check) { - echo "Error updating the polls"; - return false; - } - } - $current_gl_version = '1.6.0'; $_SQL = ''; break; diff -r 6bf615c55b68 -r 9a4f84840886 sql/updates/mssql_1.5.1_to_1.6.0.php --- a/sql/updates/mssql_1.5.1_to_1.6.0.php Sun Dec 28 10:59:04 2008 +0100 +++ b/sql/updates/mssql_1.5.1_to_1.6.0.php Sun Dec 28 20:00:25 2008 +0100 @@ -14,25 +14,4 @@ return true; } -function upgrade_PollsPluginId() -{ - global $_TABLES; - - $P_SQL = array(); - $P_SQL[] = "ALTER TABLE {$_TABLES['pollanswers']} ALTER COLUMN [pid] VARCHARS(40)"; - $P_SQL[] = "ALTER TABLE {$_TABLES['pollquestions']} ALTER COLUMN [pid] VARCHARS(40)"; - $P_SQL[] = "ALTER TABLE {$_TABLES['polltopics']} ALTER COLUMN [pid] VARCHARS(40)"; - $P_SQL[] = "ALTER TABLE {$_TABLES['pollvoters']} ALTER COLUMN [pid] VARCHARS(40)"; - - foreach ($P_SQL as $sql) { - $rst = DB_query($sql); - if (DB_error()) { - echo "There was an error upgrading the polls, SQL: $sql
"; - return false; - } - } - - return true; -} - ?> diff -r 6bf615c55b68 -r 9a4f84840886 sql/updates/mysql_1.5.1_to_1.6.0.php --- a/sql/updates/mysql_1.5.1_to_1.6.0.php Sun Dec 28 10:59:04 2008 +0100 +++ b/sql/updates/mysql_1.5.1_to_1.6.0.php Sun Dec 28 20:00:25 2008 +0100 @@ -14,26 +14,4 @@ return true; } -function upgrade_PollsPluginId() -{ - global $_TABLES; - - $P_SQL = array(); - $P_SQL[] = "ALTER TABLE {$_TABLES['pollanswers']} CHANGE pid pid varchar(40) NOT NULL default ''"; - $P_SQL[] = "ALTER TABLE {$_TABLES['pollquestions']} CHANGE pid pid varchar(40) NOT NULL default ''"; - $P_SQL[] = "ALTER TABLE {$_TABLES['polltopics']} CHANGE pid pid varchar(40) NOT NULL default ''"; - $P_SQL[] = "ALTER TABLE {$_TABLES['pollvoters']} CHANGE pid pid varchar(40) NOT NULL default ''"; - - $P_SQL = INST_checkInnodbUpgrade($P_SQL); - foreach ($P_SQL as $sql) { - $rst = DB_query($sql); - if (DB_error()) { - echo "There was an error upgrading the polls, SQL: $sql
"; - return false; - } - } - - return true; -} - ?> From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:36 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:36 -0500 Subject: [geeklog-cvs] geeklog: Added missing texts (not translated yet) Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/61917ffc519d changeset: 6605:61917ffc519d user: Dirk Haun date: Sun Dec 28 20:06:56 2008 +0100 description: Added missing texts (not translated yet) diffstat: 4 files changed, 72 insertions(+), 4 deletions(-) language/german.php | 19 ++++++++++++++++++- language/german_formal.php | 19 ++++++++++++++++++- language/german_formal_utf-8.php | 19 ++++++++++++++++++- language/german_utf-8.php | 19 ++++++++++++++++++- diffs (116 lines): diff -r 9a4f84840886 -r 61917ffc519d language/german.php --- a/language/german.php Sun Dec 28 20:00:25 2008 +0100 +++ b/language/german.php Sun Dec 28 20:06:56 2008 +0100 @@ -1028,7 +1028,24 @@ 35 => '?ndern', 36 => 'Code', 37 => 'Aktuell', - 38 => 'Bitte aktualisieren!' + 38 => 'Bitte aktualisieren!', + 39 => 'Upload a plugin', + 40 => 'You can upload a plugin archive (.tar.gz, .tgz, .zip) directly here:', + 41 => 'Upload', + + // to match the PHP error constants, + // http://www.php.net/manual/en/features.file-upload.errors.php + // TBD: move to a separate $LANG array + 99 => 'An unknown error occured', + 100 => 'Ok.', + 101 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini.', + 102 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.', + 103 => 'The uploaded file was only partially uploaded.', + 104 => 'No file was uploaded.', + 105 => '(undefined error)', + 106 => 'Missing a temporary folder.', + 107 => 'Failed to write file to disk.', + 108 => 'File upload stopped by extension.' ); ############################################################################### diff -r 9a4f84840886 -r 61917ffc519d language/german_formal.php --- a/language/german_formal.php Sun Dec 28 20:00:25 2008 +0100 +++ b/language/german_formal.php Sun Dec 28 20:06:56 2008 +0100 @@ -1029,7 +1029,24 @@ 35 => '?ndern', 36 => 'Code', 37 => 'Aktuell', - 38 => 'Bitte aktualisieren!' + 38 => 'Bitte aktualisieren!', + 39 => 'Upload a plugin', + 40 => 'You can upload a plugin archive (.tar.gz, .tgz, .zip) directly here:', + 41 => 'Upload', + + // to match the PHP error constants, + // http://www.php.net/manual/en/features.file-upload.errors.php + // TBD: move to a separate $LANG array + 99 => 'An unknown error occured', + 100 => 'Ok.', + 101 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini.', + 102 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.', + 103 => 'The uploaded file was only partially uploaded.', + 104 => 'No file was uploaded.', + 105 => '(undefined error)', + 106 => 'Missing a temporary folder.', + 107 => 'Failed to write file to disk.', + 108 => 'File upload stopped by extension.' ); ############################################################################### diff -r 9a4f84840886 -r 61917ffc519d language/german_formal_utf-8.php --- a/language/german_formal_utf-8.php Sun Dec 28 20:00:25 2008 +0100 +++ b/language/german_formal_utf-8.php Sun Dec 28 20:06:56 2008 +0100 @@ -1029,7 +1029,24 @@ 35 => '??ndern', 36 => 'Code', 37 => 'Aktuell', - 38 => 'Bitte aktualisieren!' + 38 => 'Bitte aktualisieren!', + 39 => 'Upload a plugin', + 40 => 'You can upload a plugin archive (.tar.gz, .tgz, .zip) directly here:', + 41 => 'Upload', + + // to match the PHP error constants, + // http://www.php.net/manual/en/features.file-upload.errors.php + // TBD: move to a separate $LANG array + 99 => 'An unknown error occured', + 100 => 'Ok.', + 101 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini.', + 102 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.', + 103 => 'The uploaded file was only partially uploaded.', + 104 => 'No file was uploaded.', + 105 => '(undefined error)', + 106 => 'Missing a temporary folder.', + 107 => 'Failed to write file to disk.', + 108 => 'File upload stopped by extension.' ); ############################################################################### diff -r 9a4f84840886 -r 61917ffc519d language/german_utf-8.php --- a/language/german_utf-8.php Sun Dec 28 20:00:25 2008 +0100 +++ b/language/german_utf-8.php Sun Dec 28 20:06:56 2008 +0100 @@ -1028,7 +1028,24 @@ 35 => '??ndern', 36 => 'Code', 37 => 'Aktuell', - 38 => 'Bitte aktualisieren!' + 38 => 'Bitte aktualisieren!', + 39 => 'Upload a plugin', + 40 => 'You can upload a plugin archive (.tar.gz, .tgz, .zip) directly here:', + 41 => 'Upload', + + // to match the PHP error constants, + // http://www.php.net/manual/en/features.file-upload.errors.php + // TBD: move to a separate $LANG array + 99 => 'An unknown error occured', + 100 => 'Ok.', + 101 => 'The uploaded file exceeds the upload_max_filesize directive in php.ini.', + 102 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.', + 103 => 'The uploaded file was only partially uploaded.', + 104 => 'No file was uploaded.', + 105 => '(undefined error)', + 106 => 'Missing a temporary folder.', + 107 => 'Failed to write file to disk.', + 108 => 'File upload stopped by extension.' ); ############################################################################### From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:37 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:37 -0500 Subject: [geeklog-cvs] geeklog: Cosmetics - better fake Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/83b0e1e24d5b changeset: 6606:83b0e1e24d5b user: Dirk Haun date: Sun Dec 28 20:12:04 2008 +0100 description: Cosmetics - better fake diffstat: 1 file changed, 2 insertions(+), 2 deletions(-) public_html/admin/plugins.php | 4 ++-- diffs (21 lines): diff -r 61917ffc519d -r 83b0e1e24d5b public_html/admin/plugins.php --- a/public_html/admin/plugins.php Sun Dec 28 20:06:56 2008 +0100 +++ b/public_html/admin/plugins.php Sun Dec 28 20:12:04 2008 +0100 @@ -2,7 +2,7 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | plugins.php | // | | @@ -1049,7 +1049,7 @@ if (empty($retval)) { // give up and fake it - $retval = strtoupper($plugin{0}) . substr($plugin, 1); + $retval = ucwords(str_replace('_', ' ', $plugin)); } return $retval; From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:32 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:32 -0500 Subject: [geeklog-cvs] geeklog: Implemented Polls autoinstall Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6bf615c55b68 changeset: 6603:6bf615c55b68 user: Dirk Haun date: Sun Dec 28 10:59:04 2008 +0100 description: Implemented Polls autoinstall diffstat: 5 files changed, 165 insertions(+), 427 deletions(-) plugins/polls/autoinstall.php | 116 ++++++++ plugins/polls/functions.inc | 11 plugins/polls/sql/mssql_install.php | 39 +- plugins/polls/sql/mysql_install.php | 39 +- public_html/admin/plugins/polls/install.php | 387 --------------------------- diffs (truncated from 679 to 300 lines): diff -r e85cfa6ea9fe -r 6bf615c55b68 plugins/polls/autoinstall.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/plugins/polls/autoinstall.php Sun Dec 28 10:59:04 2008 +0100 @@ -0,0 +1,116 @@ + $pi_name, + 'pi_display_name' => $pi_display_name, + 'pi_version' => '2.1.0', + 'pi_gl_version' => '1.6.0', + 'pi_homepage' => 'http://www.geeklog.net/' + ); + + $groups = array( + $pi_admin => 'Has full access to ' . $pi_display_name . ' features' + ); + + $features = array( + $pi_name . '.edit' => 'Access to ' . $pi_name . ' editor' + ); + + $mappings = array( + $pi_name . '.edit' => array($pi_admin) + ); + + $tables = array( + 'pollanswers', + 'pollquestions', + 'polltopics', + 'pollvoters' + ); + + $inst_parms = array( + 'info' => $info, + 'groups' => $groups, + 'features' => $features, + 'mappings' => $mappings, + 'tables' => $tables + ); + + return $inst_parms; +} + +function plugin_load_configuration_polls($pi_name) +{ + global $_CONF; + + $base_path = $_CONF['path'] . 'plugins/' . $pi_name . '/'; + + require_once $_CONF['path_system'] . 'classes/config.class.php'; + require_once $base_path . 'install_defaults.php'; + + return plugin_initconfig_polls(); +} + +function plugin_postinstall_polls($pi_name) +{ + return true; +} + +function plugin_compatible_with_this_version_polls($pi_name) +{ + if (function_exists('COM_showPoll') || function_exists('COM_pollVote')) { + // if these functions exist, then someone's trying to install the + // plugin on Geeklog 1.3.11 or older - sorry, but that won't work + return false; + } + + if (! function_exists('SEC_getGroupDropdown')) { + return false; + } + + if (! function_exists('SEC_createToken')) { + return false; + } + + if (! function_exists('COM_showMessageText')) { + return false; + } + + return true; +} + +?> diff -r e85cfa6ea9fe -r 6bf615c55b68 plugins/polls/functions.inc --- a/plugins/polls/functions.inc Sun Dec 28 10:13:44 2008 +0100 +++ b/plugins/polls/functions.inc Sun Dec 28 10:59:04 2008 +0100 @@ -2,7 +2,7 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Polls Plugin 2.0 | +// | Polls Plugin 2.1 | // +---------------------------------------------------------------------------+ // | functions.inc | // | | @@ -57,7 +57,6 @@ $_PO_CONF = $po_config->get_config('polls'); } -$_PO_CONF['version'] = '2.0.1'; // +---------------------------------------------------------------------------+ // | Geeklog Plugin API Implementations | @@ -360,9 +359,13 @@ */ function plugin_chkVersion_polls() { - global $_PO_CONF; + global $_CONF; - return $_PO_CONF['version']; + require_once $_CONF['path'] . 'plugins/polls/autoinstall.php'; + + $inst_parms = plugin_autoinstall_polls('polls'); + + return $inst_parms['info']['pi_version']; } /** diff -r e85cfa6ea9fe -r 6bf615c55b68 plugins/polls/sql/mssql_install.php --- a/plugins/polls/sql/mssql_install.php Sun Dec 28 10:13:44 2008 +0100 +++ b/plugins/polls/sql/mssql_install.php Sun Dec 28 10:59:04 2008 +0100 @@ -2,9 +2,9 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Polls Plugin 2.0 | +// | Polls Plugin 2.1 | // +---------------------------------------------------------------------------+ -// | Installation SQL | +// | mssql_install.php | // +---------------------------------------------------------------------------+ // | Copyright (C) 2000-2008 by the following authors: | // | | @@ -30,8 +30,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: mssql_install.php,v 1.6 2008/08/12 18:13:34 mjervis Exp $ $_SQL[] = " CREATE TABLE [dbo].[{$_TABLES['pollanswers']}] ( @@ -111,22 +109,27 @@ ) ON [PRIMARY] "; -// Note: The 'pollquestion' entry for the above answers is in the install script - $_SQL[] = "INSERT INTO {$_TABLES['blocks']} (is_enabled, name, type, title, tid, blockorder, content, onleft, phpblockfn, owner_id, group_id, perm_owner, perm_group) VALUES (1,'polls_block','phpblock','Poll','all',30,'',0,'phpblock_polls',{$_USER['uid']},#group#,3,3)"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 1, 'MS SQL support', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 2, 'Multi-language support', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 3, 'Calendar as a plugin', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 4, 'SLV spam protection', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 5, 'Mass-delete users', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 6, 'Other', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 1, 'Story-Images', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 2, 'User-Rights handling', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 3, 'The Support', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 4, 'Plugin Availability', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollquestions']} (qid, pid, question) VALUES (0, 'geeklogfeaturepoll', 'What is the best new feature of Geeklog?');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollquestions']} (qid, pid, question) VALUES (1, 'geeklogfeaturepoll', 'What is the all-time best feature of Geeklog?');"; +// default poll + +$DEFVALUES[] = "INSERT INTO {$_TABLES['polltopics']} (pid, topic, voters, questions, date, display, is_open, hideresults, commentcode, statuscode, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon) VALUES ('geeklogfeaturepoll', 'Tell us your opinion about Geeklog', 0, 2, NOW(), 1, 1, 1, 0, 0, {$_USER['uid']}, #group#, 3, 2, 2, 2);"; + +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollquestions']} (qid, pid, question) VALUES (0, 'geeklogfeaturepoll', 'What is the best new feature of Geeklog?');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollquestions']} (qid, pid, question) VALUES (1, 'geeklogfeaturepoll', 'What is the all-time best feature of Geeklog?');"; + +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 1, 'MS SQL support', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 2, 'Multi-language support', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 3, 'Calendar as a plugin', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 4, 'SLV spam protection', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 5, 'Mass-delete users', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 6, 'Other', 0, '');"; + +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 1, 'Permissions Handling', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 2, 'Spam Protection', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 3, 'Focus on Security', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 4, 'Plugin Availability', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 5, 'The Community', 0, '');"; ?> diff -r e85cfa6ea9fe -r 6bf615c55b68 plugins/polls/sql/mysql_install.php --- a/plugins/polls/sql/mysql_install.php Sun Dec 28 10:13:44 2008 +0100 +++ b/plugins/polls/sql/mysql_install.php Sun Dec 28 10:59:04 2008 +0100 @@ -2,9 +2,9 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Polls Plugin 2.0 | +// | Polls Plugin 2.1 | // +---------------------------------------------------------------------------+ -// | Installation SQL | +// | mysql_install.php | // +---------------------------------------------------------------------------+ // | Copyright (C) 2000-2008 by the following authors: | // | | @@ -29,8 +29,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: mysql_install.php,v 1.11 2008/05/13 18:50:42 mwest Exp $ $_SQL[] = " CREATE TABLE {$_TABLES['pollanswers']} ( @@ -90,22 +88,27 @@ ) TYPE=MyISAM "; -// Note: The 'pollquestion' entry for the above answers is in the install script - $_SQL[] = "INSERT INTO {$_TABLES['blocks']} (is_enabled, name, type, title, tid, blockorder, content, onleft, phpblockfn, owner_id, group_id, perm_owner, perm_group) VALUES (1,'polls_block','phpblock','Poll','all',30,'',0,'phpblock_polls',{$_USER['uid']},#group#,3,3)"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 1, 'MS SQL support', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 2, 'Multi-language support', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 3, 'Calendar as a plugin', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 4, 'SLV spam protection', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 5, 'Mass-delete users', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 6, 'Other', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 1, 'Story-Images', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 2, 'User-Rights handling', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 3, 'The Support', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 4, 'Plugin Availability', 0, '');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollquestions']} (qid, pid, question) VALUES (0, 'geeklogfeaturepoll', 'What is the best new feature of Geeklog?');"; -$_SQL[] = "INSERT INTO {$_TABLES['pollquestions']} (qid, pid, question) VALUES (1, 'geeklogfeaturepoll', 'What is the all-time best feature of Geeklog?');"; +// default poll + +$DEFVALUES[] = "INSERT INTO {$_TABLES['polltopics']} (pid, topic, voters, questions, date, display, is_open, hideresults, commentcode, statuscode, owner_id, group_id, perm_owner, perm_group, perm_members, perm_anon) VALUES ('geeklogfeaturepoll', 'Tell us your opinion about Geeklog', 0, 2, NOW(), 1, 1, 1, 0, 0, {$_USER['uid']}, #group#, 3, 2, 2, 2);"; + +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollquestions']} (qid, pid, question) VALUES (0, 'geeklogfeaturepoll', 'What is the best new feature of Geeklog?');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollquestions']} (qid, pid, question) VALUES (1, 'geeklogfeaturepoll', 'What is the all-time best feature of Geeklog?');"; + +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 1, 'MS SQL support', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 2, 'Multi-language support', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 3, 'Calendar as a plugin', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 4, 'SLV spam protection', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 5, 'Mass-delete users', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 0, 6, 'Other', 0, '');"; + +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 1, 'Permissions Handling', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 2, 'Spam Protection', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 3, 'Focus on Security', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 4, 'Plugin Availability', 0, '');"; +$DEFVALUES[] = "INSERT INTO {$_TABLES['pollanswers']} (pid, qid, aid, answer, votes, remark) VALUES ('geeklogfeaturepoll', 1, 5, 'The Community', 0, '');"; ?> diff -r e85cfa6ea9fe -r 6bf615c55b68 public_html/admin/plugins/polls/install.php --- a/public_html/admin/plugins/polls/install.php Sun Dec 28 10:13:44 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,387 +0,0 @@ - details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/8a7add14f603 changeset: 6607:8a7add14f603 user: Dirk Haun date: Mon Dec 29 19:11:16 2008 +0100 description: Fix paths and URLs during an upgrade, so we can install database backups elsewhere, e.g. locally diffstat: 2 files changed, 81 insertions(+), 6 deletions(-) public_html/admin/install/index.php | 14 +++-- public_html/admin/install/lib-install.php | 73 ++++++++++++++++++++++++++++- diffs (141 lines): diff -r 83b0e1e24d5b -r 8a7add14f603 public_html/admin/install/index.php --- a/public_html/admin/install/index.php Sun Dec 28 20:12:04 2008 +0100 +++ b/public_html/admin/install/index.php Mon Dec 29 19:11:16 2008 +0100 @@ -2,7 +2,7 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | index.php | // | | @@ -36,10 +36,8 @@ // | You don't need to change anything in this file. | // | Please read docs/install.html which describes how to install Geeklog. | // +---------------------------------------------------------------------------+ -// -// $Id: index.php,v 1.47 2008/06/15 06:41:26 mwest Exp $ -require_once "lib-install.php"; +require_once 'lib-install.php'; /* @@ -48,7 +46,7 @@ * The guts of the installation and upgrade package. * * @param string $install_type 'install' or 'upgrade' - * @param int $install_step 1 - 3 + * @param int $install_step 1 - 4 */ function INST_installEngine($install_type, $install_step) { @@ -549,6 +547,12 @@ $config->set('site_mail', urldecode($site_mail)); $config->set('noreply_mail', urldecode($noreply_mail)); $config->set_default('default_photo', urldecode($site_url) . '/default.jpg'); + } else { + $site_url = isset($_POST['site_url']) ? $_POST['site_url'] : (isset($_GET['site_url']) ? $_GET['site_url'] : '') ; + $site_admin_url = isset($_POST['site_admin_url']) ? $_POST['site_admin_url'] : (isset($_GET['site_admin_url']) ? $_GET['site_admin_url'] : '') ; + + INST_fixPathsAndUrls($_CONF['path'], $html_path, + urldecode($site_url), urldecode($site_admin_url)); } // disable plugins for which we don't have the source files diff -r 83b0e1e24d5b -r 8a7add14f603 public_html/admin/install/lib-install.php --- a/public_html/admin/install/lib-install.php Sun Dec 28 20:12:04 2008 +0100 +++ b/public_html/admin/install/lib-install.php Mon Dec 29 19:11:16 2008 +0100 @@ -2,7 +2,7 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | lib-install.php | // | | @@ -11,6 +11,7 @@ // | Copyright (C) 2008 by the following authors: | // | | // | Authors: Matt West - matt.danger.west AT gmail DOT com | +// | Dirk Haun - dirk AT haun-online DOT de | // +---------------------------------------------------------------------------+ // | | // | This program is free software; you can redistribute it and/or | @@ -1051,4 +1052,74 @@ } } +/** +* Do a sanity check on the paths and URLs +* +* This is somewhat speculative but should provide the user with a working +* site even if, for example, a site backup was installed elsewhere. +* +* @param string $path proper /path/to/Geeklog +* @param string $path_html path to public_html +* @param string $site_url The site's URL +* @param string $site_admin_url URL to the admin directory +* +*/ +function INST_fixPathsAndUrls($path, $path_html, $site_url, $site_admin_url) +{ + // no global $_CONF here! + + require_once $path . 'system/classes/config.class.php'; + + $config = config::get_instance(); + $config->set_configfile($path . 'db-config.php'); + $config->load_baseconfig(); + $config->initConfig(); + $_CONF = $config->get_config('Core'); + + if (! file_exists($_CONF['path_log'] . 'error.log')) { + $config->set('path_log', $path . 'logs/'); + } + if (! file_exists($_CONF['path_language'] . $_CONF['language'] . '.php')) { + $config->set('path_language', $path . 'language/'); + } + if (! file_exists($_CONF['backup_path'])) { + $config->set('backup_path', $path . 'backups/'); + } + if (! file_exists($_CONF['path_data'])) { + $config->set('path_data', $path . 'data/'); + } + if ((! $_CONF['have_pear']) && + (! file_exists($_CONF['path_pear'] . 'PEAR.php'))) { + $config->set('path_pear', $path . 'system/pear/'); + } + + if (! file_exists($_CONF['path_html'] . 'lib-common.php')) { + $config->set('path_html', $path_html); + } + if (! file_exists($_CONF['path_themes'] . $_CONF['theme'] + . '/header.thtml')) { + $config->set('path_themes', $path_html . 'layout/'); + } + if (! file_exists($_CONF['path_images'] . 'articles')) { + $config->set('path_images', $path_html . 'images/'); + } + if (substr($_CONF['rdf_file'], strlen($path_html)) != $path_html) { + // this may not be correct but neither was the old value apparently ... + $config->set('rdf_file', $path_html . 'backend/geeklog.rss'); + } + + if (! empty($site_url) && ($_CONF['site_url'] != $site_url)) { + $config->set('site_url', $site_url); + + // if we had to fix the site's URL, chances are that cookie domain + // and path are also wrong and the user won't be able to log in + $config->set('cookiedomain', ''); + $config->set('cookie_path', '/'); + } + if (! empty($site_admin_url) && + ($_CONF['site_admin_url'] != $site_admin_url)) { + $config->set('site_admin_url', $site_admin_url); + } +} + ?> From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:39 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:39 -0500 Subject: [geeklog-cvs] geeklog: Read SQL dump line by line (or we may run into memory l... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/ee69c79e8aa5 changeset: 6608:ee69c79e8aa5 user: Dirk Haun date: Mon Dec 29 21:40:27 2008 +0100 description: Read SQL dump line by line (or we may run into memory limits); reset cookie domain and path diffstat: 1 file changed, 29 insertions(+), 12 deletions(-) public_html/admin/install/migrate.php | 41 +++++++++++++++++++++++---------- diffs (89 lines): diff -r 8a7add14f603 -r ee69c79e8aa5 public_html/admin/install/migrate.php --- a/public_html/admin/install/migrate.php Mon Dec 29 19:11:16 2008 +0100 +++ b/public_html/admin/install/migrate.php Mon Dec 29 21:40:27 2008 +0100 @@ -2,7 +2,7 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | migrate.php | // | | @@ -31,10 +31,10 @@ // | You don't need to change anything in this file. | // | Please read docs/install.html which describes how to install Geeklog. | // +---------------------------------------------------------------------------+ -// -require_once "lib-install.php"; +require_once 'lib-install.php'; require_once '../../siteconfig.php'; + // +---------------------------------------------------------------------------+ // | Main | @@ -44,7 +44,7 @@ $html_path = str_replace('admin/install/migrate.php', '', str_replace('admin\install\migrate.php', '', str_replace('\\', '/', __FILE__))); $siteconfig_path = '../../siteconfig.php'; -if ($_CONF['path'] == '/path/to/Geeklog/') { // If the Geeklog path has not been?defined. +if ($_CONF['path'] == '/path/to/Geeklog/') { // If the Geeklog path has not been defined. // Attempt to locate Geeklog's path $gl_path = strtr(__FILE__, '\\', '/'); // replace all '\' with '/' @@ -406,16 +406,29 @@ } // Parse the .sql file to grab the table prefix + $has_config = false; + $sql_file = fopen($backup_dir . $backup_file, 'r'); - $sql_data = fread($sql_file, filesize($backup_dir . $backup_file)); + while (! feof($sql_file)) { + $line = @fgets($sql_file); + if (! empty($line)) { + if (preg_match('/CREATE TABLE/i', $line)) { + $line = trim($line); + if (strpos($line, 'access`') !== false) { + $DB['table_prefix'] = preg_replace('/^.*`/', '', preg_replace('/access`.*$/', '', $line)); + } elseif (strpos($line, 'conf_values') !== false) { + $has_config = true; + break; + } elseif (strpos($line, 'featurecodes') !== false) { + // assume there's no conf_values table in this db dump + break; + } + } + } + } fclose($sql_file); - $sql_data = preg_replace('/\n/', '', $sql_data); - $DB['table_prefix'] = preg_replace('/^.*`/', '', preg_replace('/access`.*$/', '', $sql_data)); - // Check if the backup file is version 1.5 or newer -// if (preg_match('/conf_values/', $sql_data)) { -if(1){ - + if ($has_config) { // Update db-config.php with the table prefix from the backup file. if (!INST_writeConfig($_REQUEST['dbconfig_path'], $DB)) { exit($LANG_INSTALL[26] . ' ' . $dbconfig_path . $LANG_INSTALL[58]); @@ -465,6 +478,10 @@ $config->set('path_themes', $html_path . 'layout/'); $config->set('rdf_file', $html_path . 'backend/geeklog.rss'); $config->set('path_pear', $_CONF['path_system'] . 'pear/'); + + // reset cookie domain and path as wrong values may prevent login + $config->set('cookiedomain', ''); + $config->set('cookie_path', '/'); /** * Check for missing plugins @@ -634,4 +651,4 @@ echo $display; -?> \ No newline at end of file +?> From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:40 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:40 -0500 Subject: [geeklog-cvs] geeklog: Don't change existing texts - added a new entry instead Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/1f658d7e55a2 changeset: 6609:1f658d7e55a2 user: Dirk Haun date: Tue Dec 30 10:30:26 2008 +0100 description: Don't change existing texts - added a new entry instead diffstat: 2 files changed, 5 insertions(+), 6 deletions(-) public_html/admin/install/index.php | 2 +- public_html/admin/install/language/english.php | 9 ++++----- diffs (52 lines): diff -r ee69c79e8aa5 -r 1f658d7e55a2 public_html/admin/install/index.php --- a/public_html/admin/install/index.php Mon Dec 29 21:40:27 2008 +0100 +++ b/public_html/admin/install/index.php Tue Dec 30 10:30:26 2008 +0100 @@ -1777,7 +1777,7 @@ if ($num_wrong) { // If any files have incorrect permissions. - $display .= INST_printTab(2) . '

' . 'Step' . ' ' . $display_step . ' - ' . $LANG_INSTALL[14] . '

' . LB; + $display .= INST_printTab(2) . '

' . 'Step' . ' ' . $display_step . ' - ' . $LANG_INSTALL[97] . '

' . LB; $display_step++; if (isset($_GET['install_type'])) { diff -r ee69c79e8aa5 -r 1f658d7e55a2 public_html/admin/install/language/english.php --- a/public_html/admin/install/language/english.php Mon Dec 29 21:40:27 2008 +0100 +++ b/public_html/admin/install/language/english.php Tue Dec 30 10:30:26 2008 +0100 @@ -2,7 +2,7 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | english.php | // | | @@ -33,8 +33,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: english.php,v 1.11 2008/05/01 21:08:31 dhaun Exp $ // +---------------------------------------------------------------------------+ @@ -65,7 +63,7 @@ 11 => 'Permissions', 12 => 'Change to', 13 => 'Currently', - 14 => 'Set File Permissions', + 14 => '', 15 => 'Export of Geeklog headlines is switched off. The backend directory was not tested', 17 => 'User photos are disabled. The userphotos directory was not tested', 18 => 'Images in articles are disabled. The articles directory was not tested', @@ -146,7 +144,8 @@ 93 => 'Success', 94 => 'Here are some hints to find the correct path:', 95 => 'The complete path to this file (the install script) is:', - 96 => 'The installer was looking for %s in:' + 96 => 'The installer was looking for %s in:', + 97 => 'Set File Permissions' ); // +---------------------------------------------------------------------------+ From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:44 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:44 -0500 Subject: [geeklog-cvs] geeklog: Moved hard-coded text strings to the language file Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/05fc48ded7de changeset: 6610:05fc48ded7de user: Dirk Haun date: Tue Dec 30 10:45:19 2008 +0100 description: Moved hard-coded text strings to the language file diffstat: 2 files changed, 10 insertions(+), 7 deletions(-) public_html/admin/install/index.php | 12 ++++++------ public_html/admin/install/language/english.php | 5 ++++- diffs (51 lines): diff -r 1f658d7e55a2 -r 05fc48ded7de public_html/admin/install/index.php --- a/public_html/admin/install/index.php Tue Dec 30 10:30:26 2008 +0100 +++ b/public_html/admin/install/index.php Tue Dec 30 10:45:19 2008 +0100 @@ -1794,8 +1794,8 @@ // Also, list the auto-generated chmod command for advanced users $display .= INST_printTab(3) . '
' . LB . $display_permissions . INST_printTab(3) . '
' . LB - . INST_printTab(3) . '

' . 'Advanced Users' . '

' . LB - . INST_printTab(3) . '

' . 'If you have command line (SSH) access to your web server then you can simple copy and paste the following command into your shell: ' . '

' . LB + . INST_printTab(3) . '

' . $LANG_INSTALL[98] . '

' . LB + . INST_printTab(3) . '

' . $LANG_INSTALL[99] . '

' . LB . INST_printTab(3) . '

' . $chmod_string . LB . INST_printTab(3) . '


' . LB; $step++; @@ -1893,8 +1893,8 @@ . '&display_step=' . $_REQUEST['display_step']); break; default: - $display .= '

Invalid mode specified

' . LB; - + $display .= '

' . $LANG_INSTALL[100] . '

' . LB; + break; } break; @@ -1905,8 +1905,8 @@ case 'install': // Deliberate fall-through, no "break" case 'upgrade': - if (($mode == 'upgrade') && ($step == 4)) { - // for the plugin upgrade, + if ($step == 4) { + // for the plugin install and upgrade, // we need lib-common.php in the global(!) namespace require_once '../../lib-common.php'; } diff -r 1f658d7e55a2 -r 05fc48ded7de public_html/admin/install/language/english.php --- a/public_html/admin/install/language/english.php Tue Dec 30 10:30:26 2008 +0100 +++ b/public_html/admin/install/language/english.php Tue Dec 30 10:45:19 2008 +0100 @@ -145,7 +145,10 @@ 94 => 'Here are some hints to find the correct path:', 95 => 'The complete path to this file (the install script) is:', 96 => 'The installer was looking for %s in:', - 97 => 'Set File Permissions' + 97 => 'Set File Permissions', + 98 => 'Advanced Users', + 99 => 'If you have command line (SSH) access to your web server then you can simple copy and paste the following command into your shell:', + 100 => 'Invalid mode specified' ); // +---------------------------------------------------------------------------+ From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:44 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:44 -0500 Subject: [geeklog-cvs] geeklog: Allow import from compressed database backups Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/f9452c50d580 changeset: 6611:f9452c50d580 user: Dirk Haun date: Tue Dec 30 19:06:49 2008 +0100 description: Allow import from compressed database backups diffstat: 2 files changed, 143 insertions(+), 41 deletions(-) public_html/admin/install/language/english.php | 2 public_html/admin/install/migrate.php | 182 ++++++++++++++++++------ diffs (246 lines): diff -r 05fc48ded7de -r f9452c50d580 public_html/admin/install/language/english.php --- a/public_html/admin/install/language/english.php Tue Dec 30 10:45:19 2008 +0100 +++ b/public_html/admin/install/language/english.php Tue Dec 30 19:06:49 2008 +0100 @@ -218,7 +218,7 @@ 11 => 'No backup files found.', 12 => 'The upload limit for this server is ', 13 => '. If your backup file is larger than ', - 14 => ' or if you experience a timeout, then you should upload he file to Geeklog\'s backups directory via FTP.', + 14 => ' or if you experience a timeout, then you should upload the file to Geeklog\'s backups directory via FTP.', 15 => 'Your backups directory is not writable by the web server. Permissions need to be 777.', 16 => 'Migrate', 17 => 'Migrate From Backup', diff -r 05fc48ded7de -r f9452c50d580 public_html/admin/install/migrate.php --- a/public_html/admin/install/migrate.php Tue Dec 30 10:45:19 2008 +0100 +++ b/public_html/admin/install/migrate.php Tue Dec 30 19:06:49 2008 +0100 @@ -28,13 +28,99 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// | You don't need to change anything in this file. | -// | Please read docs/install.html which describes how to install Geeklog. | -// +---------------------------------------------------------------------------+ require_once 'lib-install.php'; require_once '../../siteconfig.php'; + +/** +* Unpack a db backup file, if necessary +* +* Note: This requires a minimal PEAR setup (incl. Tar and Zip classes) and a +* way to set the PEAR include path. But if that doesn't work on your +* setup, then chances are you won't get Geeklog up and running anyway ... +* +* @param string $backup_path path to the "backups" directory +* @param string $backup_file backup file name +* @param ref $display reference to HTML string (for error msg) +* @return mixed file name of unpacked file or false: error +* +*/ +function INST_unpackFile($backup_path, $backup_file, &$display) +{ + global $_CONF; + + $unpacked_file = $backup_file; + + $type = ''; + if (preg_match('/\.zip$/i', $backup_file)) { + $type = 'zip'; + } elseif (preg_match('/\.tar.gz$/i', $backup_file) || + preg_match('/\.tgz$/i', $backup_file)) { + $type = 'tar'; + } + + if (empty($type)) { + // not packed + return $backup_file; + } + + $include_path = @ini_get('include_path'); + if (@ini_set('include_path', $_CONF['path'] . 'system/pear/' + . PATH_SEPARATOR . $include_path) === false) { + + + $display .= INST_getAlertMsg("Failed to set PEAR include path. Sorry, can't handle compressed database backups without PEAR."); + return false; + } + + if ($type == 'zip') { + + require_once 'Archive/Zip.php'; + + $archive = new Archive_Zip($backup_path . $backup_file); + + } else { + + require_once 'Archive/Tar.php'; + + $archive = new Archive_Tar($backup_path . $backup_file); + + } + + $files = $archive->listContent(); + $dirname = preg_replace('/\/.*$/', '', $files[0]['filename']); + if ($dirname == $files[0]['filename']) { + $dirname = ''; // no directory + } + $success = false; + if ($type == 'zip') { + $result = $archive->extract(array('add_path' => $backup_path, + 'remove_path' => $dirname)); + if (is_array($result)) { + $success = true; + } + } else { + $result = $archive->extractList(array($files[0]['filename']), + $backup_path, $dirname); + $success = $result; + } + + if (empty($dirname)) { + $unpacked_file = $files[0]['filename']; + } else { + $unpacked_file = substr($files[0]['filename'], strlen($dirname) + 1); + } + + if ((! $success) || (! file_exists($backup_path . $unpacked_file))) { + $display .= INST_getAlertMsg(sprintf("Error extracting database backup '%s' from compressed backup file.", $unpacked_file)); + return false; + } + + unset($archive); + + return $unpacked_file; +} // +---------------------------------------------------------------------------+ // | Main | @@ -127,7 +213,13 @@ . INST_printTab(3) . '

  ' . $LANG_INSTALL[46] . '

' . LB . INST_printTab(3) . '

  ' . $LANG_INSTALL[46] . '

' . LB; - rsort($backup_files = glob($backup_dir . '*.sql')); // Identify the backup files in backups/ and order them newest to oldest + //rsort($backup_files = glob($backup_dir . '*.sql')); // Identify the backup files in backups/ and order them newest to oldest + $sql_files = glob($backup_dir . '*.sql'); + $tar_files = glob($backup_dir . '*.tar.gz'); + $tgz_files = glob($backup_dir . '*.tgz'); + $zip_files = glob($backup_dir . '*.zip'); + $backup_files = array_merge($sql_files, $tar_files, $tgz_files, $zip_files); + rsort($backup_files); // Identify the backup files in backups/ and order them newest to oldest $display .= INST_printTab(3) . '

' . LB . INST_printTab(4) . '' . LB - . '

' . LB + . '

' . LB . '

' . LB - . '

' . LB + . '

' . LB . '' . LB; } @@ -277,7 +277,7 @@ } - $display .= '

Select which plugins to install

' . LB; + $display .= '

' . $LANG_PLUGINS[12] . '

' . LB; // If there are new plugins if ($new_plugins > 0) { @@ -288,9 +288,9 @@ . '' . LB . '' . LB . '' . LB - . '' . LB - . '' . LB - . '' . LB + . '' . LB + . '' . LB + . '' . LB . '' . LB; /** @@ -313,8 +313,8 @@ $pi_name = ''; $pi_display_name = ''; - $pi_version = 'Unknown'; - $gl_version = 'Unknown'; + $pi_version = $LANG_PLUGINS[16]; + $gl_version = $LANG_PLUGINS[16]; $pi_url = ''; /** @@ -443,7 +443,7 @@ . '' . '' . $pi_display_name . LB - . ($missing_autoinstall ? '

Note: This plugin requires manual activation from the Plugins admin panel.

' : '') + . ($missing_autoinstall ? '

' . $LANG_PLUGINS[17] . ': ' . $LANG_PLUGINS[18] . '

' : '') . '' . LB . '
Install?PluginVersion' . $LANG_PLUGINS[13] . '' . $LANG_PLUGINS[14] . '' . $LANG_PLUGINS[15] . '
' . $pi_version @@ -456,15 +456,15 @@ // Form footer $display .= '
' . LB - . '' . LB + . '' . LB . '' . LB . '

' . LB; } else { - $display .= '

There are no new plugins to install.

' . LB + $display .= '

' . $LANG_PLUGINS[20] . '

' . LB . '
' . LB - . '' . LB + . '' . LB . '

' . LB; } diff -r 5ae4a81df4b2 -r 22eff903b537 public_html/admin/install/language/english.php --- a/public_html/admin/install/language/english.php Wed Dec 31 15:13:02 2008 +0100 +++ b/public_html/admin/install/language/english.php Wed Dec 31 16:42:40 2008 +0100 @@ -40,7 +40,7 @@ // +---------------------------------------------------------------------------+ // | Array Format: | -// | $LANG_NAME[XX]: $LANG - variable name | +// | $LANG_NAME[XX]: $LANG - variable name | // | NAME - where array is used | // | XX - phrase id number | // +---------------------------------------------------------------------------+ @@ -246,6 +246,32 @@ ); // +---------------------------------------------------------------------------+ +// install-plugins.php + +$LANG_PLUGINS = array( + 1 => 'Plugin Installation', + 2 => 'Step', + 3 => 'Geeklog plugins are addon components that provide new functionality and leverage the internal services of Geeklog. By default, Geeklog includes a few useful plugins that you may want to install.', + 4 => 'You can also choose to upload additional plugins.', + 5 => 'The file you uploaded was not a GZip compressed plugin file.', + 6 => 'The plugin you uploaded already exists!', + 7 => 'Success!', + 8 => 'The %s plugin was uploaded successfully.', + 9 => 'Upload a plugin', + 10 => 'Select plugin file', + 11 => 'Upload', + 12 => 'Select which plugins to install', + 13 => 'Install?', + 14 => 'Plugin', + 15 => 'Version', + 16 => 'Unknown', + 17 => 'Note', + 18 => 'This plugin requires manual activation from the Plugins admin panel.', + 19 => 'Refresh', + 20 => 'There are no new plugins to install.' +); + +// +---------------------------------------------------------------------------+ // bigdump.php $LANG_BIGDUMP = array( diff -r 5ae4a81df4b2 -r 22eff903b537 public_html/admin/install/language/german.php --- a/public_html/admin/install/language/german.php Wed Dec 31 15:13:02 2008 +0100 +++ b/public_html/admin/install/language/german.php Wed Dec 31 16:42:40 2008 +0100 @@ -2,7 +2,7 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | german.php | // | | @@ -33,8 +33,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: german.php,v 1.9 2008/05/28 18:46:52 dhaun Exp $ // +---------------------------------------------------------------------------+ @@ -42,7 +40,7 @@ // +---------------------------------------------------------------------------+ // | Array Format: | -// | $LANG_NAME[XX]: $LANG - variable name | +// | $LANG_NAME[XX]: $LANG - variable name | // | NAME - where array is used | // | XX - phrase id number | // +---------------------------------------------------------------------------+ @@ -146,7 +144,11 @@ 93 => 'Success', 94 => 'Hier sind einige Hinweise, um den richtigen Pfad zu ermitteln:', 95 => 'Der komplette Pfad zu dieser Datei (dem Installations-Skript) ist:', - 96 => 'Das Installations-Skript hat nach %s in diesem Verzeichnis gesucht:' + 96 => 'Das Installations-Skript hat nach %s in diesem Verzeichnis gesucht:', + 97 => 'Set File Permissions', + 98 => 'Advanced Users', + 99 => 'If you have command line (SSH) access to your web server then you can simple copy and paste the following command into your shell:', + 100 => 'Invalid mode specified' ); // +---------------------------------------------------------------------------+ @@ -174,7 +176,8 @@ 18 => 'zur?cksetzen auf', 19 => 'Note: Because the security model has been changed, we have created a new account with the rights you need to administer your new site. The username for this new account is NewAdmin and the password is password', 20 => 'installiert', - 21 => 'aktualisiert' + 21 => 'aktualisiert', + 22 => 'migriert' ); // +---------------------------------------------------------------------------+ @@ -197,4 +200,130 @@ 13 => 'Indicate whether to use UTF-8 as the default character set for your site. Recommended especially for multi-lingual setups.' ); +// +---------------------------------------------------------------------------+ +// migrate.php + +$LANG_MIGRATE = array( + 0 => 'The migration process will overwrite any existing database information.', + 1 => 'Before Proceding', + 2 => 'Be sure any previously installed plugins have been copied to your new server.', + 3 => 'Be sure any images from public_html/images/articles/, public_html/images/topics/, and public_html/images/userphotos/, have been copied to your new server.', + 4 => 'If you\'re upgrading to a new Geeklog version, then run the install script in upgrade mode first.', + 5 => 'If you\'re upgrading to a new Geeklog version, then don\'t upload your theme just yet. Use the included default theme until you can be sure your migrated site works properly.', + 6 => 'Select an existing backup', + 7 => 'Choose file...', + 8 => 'From the server\'s backups directory', + 9 => 'From your computer', + 10 => 'Choose file...', + 11 => 'No backup files found.', + 12 => 'The upload limit for this server is ', + 13 => '. If your backup file is larger than ', + 14 => ' or if you experience a timeout, then you should upload the file to Geeklog\'s backups directory via FTP.', + 15 => 'Your backups directory is not writable by the web server. Permissions need to be 777.', + 16 => 'Migrate', + 17 => 'Migrate From Backup', + 18 => 'No backup file was selected', + 19 => 'Could not save ', + 20 => ' to ', + 21 => 'The file', + 22 => 'already exists. Would you like to replace it?', + 23 => 'Yes', + 24 => 'No', + 25 => 'The version of Geeklog you chose to migrate from is out of date.', + 26 => 'Migration notice: ', + 27 => 'The "', + 28 => '" plugin is missing and has been disabled. You can install and reactivate it at any time from the administration section.', + 29 => 'The image "', + 30 => '" listed in the "', + 31 => '" table could not be found in ', + 32 => 'The database file contained information for one or more plugins that the migration script could not locate in your', + 33 => 'directory. The plugins have been deactivated. You can install and reactivate them at any time from the administration section.', + 34 => 'The database file contained information for one or more files that the migration script could not locate in your', + 35 => 'directory. Check error.log for more details.', + 36 => 'You can correct these any time.', + 37 => 'Migration Complete', + 38 => 'The migration process has completed. However, the installation script found the following issues:' +); + +// +---------------------------------------------------------------------------+ +// install-plugins.php + +$LANG_PLUGINS = array( + 1 => 'Plugin Installation', + 2 => 'Step', + 3 => 'Geeklog plugins are addon components that provide new functionality and leverage the internal services of Geeklog. By default, Geeklog includes a few useful plugins that you may want to install.', + 4 => 'You can also choose to upload additional plugins.', + 5 => 'The file you uploaded was not a GZip compressed plugin file.', + 6 => 'The plugin you uploaded already exists!', + 7 => 'Success!', + 8 => 'The %s plugin was uploaded successfully.', + 9 => 'Upload a plugin', + 10 => 'Select plugin file', + 11 => 'Upload', + 12 => 'Select which plugins to install', + 13 => 'Install?', + 14 => 'Plugin', + 15 => 'Version', + 16 => 'Unknown', + 17 => 'Note', + 18 => 'This plugin requires manual activation from the Plugins admin panel.', + 19 => 'Refresh', + 20 => 'There are no new plugins to install.' +); + +// +---------------------------------------------------------------------------+ +// bigdump.php + +$LANG_BIGDUMP = array( + 0 => 'Start Import', + 1 => ' from ', + 2 => ' into ', + 3 => ' at ', From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:55 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:55 -0500 Subject: [geeklog-cvs] geeklog: Make the database input fields behave like they do for ... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/1aceb360b6ea changeset: 6620:1aceb360b6ea user: Dirk Haun date: Wed Dec 31 19:56:03 2008 +0100 description: Make the database input fields behave like they do for a fresh install and upgrade diffstat: 1 file changed, 8 insertions(+) public_html/admin/install/migrate.php | 8 ++++++++ diffs (18 lines): diff -r f6cceb986985 -r 1aceb360b6ea public_html/admin/install/migrate.php --- a/public_html/admin/install/migrate.php Wed Dec 31 19:05:40 2008 +0100 +++ b/public_html/admin/install/migrate.php Wed Dec 31 19:56:03 2008 +0100 @@ -211,6 +211,14 @@ 'user' => 'username', 'pass' => '', 'prefix' => 'gl_' ); + if (file_exists($dbconfig_path)) { + require_once $dbconfig_path; + + $_FORM['host'] = ($_DB_host != 'localhost' ? '' : $_DB_host); + $_FORM['name'] = ($_DB_name != 'geeklog' ? '' : $_DB_name); + $_FORM['user'] = ($_DB_user != 'username' ? '' : $_DB_user); + $_FORM['prefix'] = $_DB_table_prefix; + } // Set up the URL and admin URL paths. $site_url = isset($_REQUEST['site_url']) ? $_REQUEST['site_url'] : 'http://' . $_SERVER['HTTP_HOST'] . preg_replace('/\/admin.*/', '', $_SERVER['PHP_SELF']) ; From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:54 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:54 -0500 Subject: [geeklog-cvs] geeklog: Don't rename plugin config.php during upgrades (from pr... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/f6cceb986985 changeset: 6619:f6cceb986985 user: Dirk Haun date: Wed Dec 31 19:05:40 2008 +0100 description: Don't rename plugin config.php during upgrades (from pre-1.5.0 versions) any more. It's not needed and will only cause inconveniences when having to run the upgrade again. diffstat: 2 files changed, 60 deletions(-) sql/updates/mssql_1.4.1_to_1.5.0.php | 30 ------------------------------ sql/updates/mysql_1.4.1_to_1.5.0.php | 30 ------------------------------ diffs (136 lines): diff -r bfbef11defcf -r f6cceb986985 sql/updates/mssql_1.4.1_to_1.5.0.php --- a/sql/updates/mssql_1.4.1_to_1.5.0.php Wed Dec 31 17:34:40 2008 +0100 +++ b/sql/updates/mssql_1.4.1_to_1.5.0.php Wed Dec 31 19:05:40 2008 +0100 @@ -459,12 +459,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } @@ -501,12 +495,6 @@ echo "There was an error upgrading the Static Pages plugin, SQL: $sql
"; return false; } - } - - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); } return true; @@ -558,12 +546,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } @@ -593,12 +575,6 @@ if (DB_error()) { echo "There was an error upgrading the Spam-X plugin"; return false; - } - - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); } return true; @@ -698,12 +674,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } diff -r bfbef11defcf -r f6cceb986985 sql/updates/mysql_1.4.1_to_1.5.0.php --- a/sql/updates/mysql_1.4.1_to_1.5.0.php Wed Dec 31 17:34:40 2008 +0100 +++ b/sql/updates/mysql_1.4.1_to_1.5.0.php Wed Dec 31 19:05:40 2008 +0100 @@ -422,12 +422,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } @@ -464,12 +458,6 @@ echo "There was an error upgrading the Static Pages plugin, SQL: $sql
"; return false; } - } - - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); } return true; @@ -521,12 +509,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } @@ -556,12 +538,6 @@ if (DB_error()) { echo "There was an error upgrading the Spam-X plugin"; return false; - } - - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); } return true; @@ -657,12 +633,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:59 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:59 -0500 Subject: [geeklog-cvs] geeklog: Fixed "migrate + update" when an old config.php is invo... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/1ba00656781c changeset: 6622:1ba00656781c user: Dirk Haun date: Thu Jan 01 12:15:36 2009 +0100 description: Fixed "migrate + update" when an old config.php is involved diffstat: 1 file changed, 28 insertions(+), 4 deletions(-) public_html/admin/install/migrate.php | 32 ++++++++++++++++++++++++++++---- diffs (64 lines): diff -r 591bc2b8c55d -r 1ba00656781c public_html/admin/install/migrate.php --- a/public_html/admin/install/migrate.php Thu Jan 01 11:15:21 2009 +0100 +++ b/public_html/admin/install/migrate.php Thu Jan 01 12:15:36 2009 +0100 @@ -603,6 +603,8 @@ } elseif (empty($version)) { $display .= INST_getAlertMsg("Could not identify database version. Please perform a manual update."); + // TBD: add a link back to the install script, preferrably a direct + // link to the upgrade screen $upgrade_error = true; } elseif ($version != VERSION) { @@ -635,6 +637,10 @@ * Let's assume that the paths that were imported from the backup are * incorrect and update them with the current paths. * + * Note: When updating the config settings in the database, we also + * need to fix the $_CONF values. We can _not_ simply reload + * them via get_config('Core') here yet. + * */ require_once $_CONF['path_system'] . 'classes/config.class.php'; $config = config::get_instance(); @@ -643,18 +649,36 @@ $config->set('site_url', urldecode($_REQUEST['site_url'])); $config->set('site_admin_url', urldecode($_REQUEST['site_admin_url'])); $config->set('path_html', $html_path); - $config->set('path_log', $gl_path . '/logs/'); - $config->set('path_language', $gl_path . '/language/'); + $_CONF['path_html'] = $html_path; + $config->set('path_log', $gl_path . 'logs/'); + $_CONF['path_log'] = $gl_path . 'logs/'; + $config->set('path_language', $gl_path . 'language/'); + $_CONF['path_language'] = $gl_path . 'language/'; $config->set('backup_path', $backup_dir); - $config->set('path_data', $gl_path . '/data/'); - $config->set('path_images', $html_path . '/images/'); + $_CONF['backup_path'] = $backup_dir; + $config->set('path_data', $gl_path . 'data/'); + $_CONF['path_data'] = $gl_path . 'data/'; + $config->set('path_images', $html_path . 'images/'); + $_CONF['path_images'] = $html_path . 'images/'; $config->set('path_themes', $html_path . 'layout/'); + $_CONF['path_themes'] = $html_path . 'layout/'; $config->set('rdf_file', $html_path . 'backend/geeklog.rss'); + $_CONF['rdf_file'] = $html_path . 'backend/geeklog.rss'; $config->set('path_pear', $_CONF['path_system'] . 'pear/'); + $_CONF['path_pear'] = $_CONF['path_system'] . 'pear/'; // reset cookie domain and path as wrong values may prevent login $config->set('cookiedomain', ''); + $_CONF['cookiedomain'] = ''; $config->set('cookie_path', '/'); + $_CONF['cookie_path'] = '/'; + + // check the default theme + if (! file_exists($_CONF['path_themes'] . $_CONF['theme'] + . '/header.thtml')) { + $config->set('theme', 'professional'); + $_CONF['theme'] = 'professional'; + } /** * Check for missing plugins From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:55 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:55 -0500 Subject: [geeklog-cvs] geeklog: Fixed upgrade issues when taking settings from an old c... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/591bc2b8c55d changeset: 6621:591bc2b8c55d user: Dirk Haun date: Thu Jan 01 11:15:21 2009 +0100 description: Fixed upgrade issues when taking settings from an old config.php diffstat: 3 files changed, 44 insertions(+), 60 deletions(-) public_html/admin/install/index.php | 37 +---------------------------- public_html/admin/install/lib-install.php | 33 ++++++------------------- public_html/admin/install/lib-upgrade.php | 34 ++++++++++++++++++++++++++ diffs (165 lines): diff -r 1aceb360b6ea -r 591bc2b8c55d public_html/admin/install/index.php --- a/public_html/admin/install/index.php Wed Dec 31 19:56:03 2008 +0100 +++ b/public_html/admin/install/index.php Thu Jan 01 11:15:21 2009 +0100 @@ -551,10 +551,10 @@ } else { $site_url = isset($_POST['site_url']) ? $_POST['site_url'] : (isset($_GET['site_url']) ? $_GET['site_url'] : '') ; $site_admin_url = isset($_POST['site_admin_url']) ? $_POST['site_admin_url'] : (isset($_GET['site_admin_url']) ? $_GET['site_admin_url'] : '') ; + } - INST_fixPathsAndUrls($_CONF['path'], $html_path, + INST_fixPathsAndUrls($_CONF['path'], $html_path, urldecode($site_url), urldecode($site_admin_url)); - } // disable plugins for which we don't have the source files INST_checkPlugins(); @@ -832,39 +832,6 @@ } } - -/** -* Change default character set to UTF-8 -* -* @param string $siteconfig_path complete path to siteconfig.php -* @param string $charset default character set to use -* @return boolean true: success; false: an error occured -* @note Yes, this means that we need to patch siteconfig.php a second time. -* -*/ -function INST_setDefaultCharset($siteconfig_path, $charset) -{ - $result = true; - - $siteconfig_file = fopen($siteconfig_path, 'r'); - $siteconfig_data = fread($siteconfig_file, filesize($siteconfig_path)); - fclose($siteconfig_file); - - $siteconfig_data = preg_replace - ( - '/\$_CONF\[\'default_charset\'\] = \'[^\']*\';/', - "\$_CONF['default_charset'] = '" . $charset . "';", - $siteconfig_data - ); - - $siteconfig_file = fopen($siteconfig_path, 'w'); - if (!fwrite($siteconfig_file, $siteconfig_data)) { - $result = false; - } - @fclose($siteconfig_file); - - return $result; -} /** * Handle default install of available plugins diff -r 1aceb360b6ea -r 591bc2b8c55d public_html/admin/install/lib-install.php --- a/public_html/admin/install/lib-install.php Wed Dec 31 19:56:03 2008 +0100 +++ b/public_html/admin/install/lib-install.php Thu Jan 01 11:15:21 2009 +0100 @@ -457,28 +457,6 @@ } /** - * Import a Geeklog database from a backup file - * - * @param string $file Path to backup file on the server - * @return bool True if successful, false if not - * - */ -/* -function INST_importDBFromBackup($file) -{ - global $_DB, $_DB_name, $display, $_TABLES; - - // Make sure the database is clean - if (!DB_query('drop database ' . $_DB_name)) - die('unable to drop database ' . $_DB_name); - if (!DB_query('create database ' . $_DB_name)) - die('unable to create database ' . $_DB_name); - - return true; -} -*/ - -/** * Can the install script connect to the database? * * @param array $db Database information @@ -792,7 +770,7 @@ COM_errorLog("Attempting to install the '$plugin' plugin", 1); } - // sanity checks in $inst_parms + // sanity checks for $inst_parms if (isset($inst_parms['info'])) { $pi_name = $inst_parms['info']['pi_name']; $pi_version = $inst_parms['info']['pi_version']; @@ -1019,7 +997,7 @@ */ function INST_fixPathsAndUrls($path, $path_html, $site_url, $site_admin_url) { - // no global $_CONF here! + // no "global $_CONF" here! require_once $path . 'system/classes/config.class.php'; @@ -1050,8 +1028,13 @@ $config->set('path_html', $path_html); } if (! file_exists($_CONF['path_themes'] . $_CONF['theme'] - . '/header.thtml')) { + . '/header.thtml')) { $config->set('path_themes', $path_html . 'layout/'); + + if (! file_exists($path_html . 'layout/' . $_CONF['theme'] + . '/header.thtml')) { + $config->set('theme', 'professional'); + } } if (! file_exists($_CONF['path_images'] . 'articles')) { $config->set('path_images', $path_html . 'images/'); diff -r 1aceb360b6ea -r 591bc2b8c55d public_html/admin/install/lib-upgrade.php --- a/public_html/admin/install/lib-upgrade.php Wed Dec 31 19:56:03 2008 +0100 +++ b/public_html/admin/install/lib-upgrade.php Thu Jan 01 11:15:21 2009 +0100 @@ -579,6 +579,40 @@ /** +* Change default character set to UTF-8 +* +* @param string $siteconfig_path complete path to siteconfig.php +* @param string $charset default character set to use +* @return boolean true: success; false: an error occured +* @note Yes, this means that we need to patch siteconfig.php a second time. +* +*/ +function INST_setDefaultCharset($siteconfig_path, $charset) +{ + $result = true; + + $siteconfig_file = fopen($siteconfig_path, 'r'); + $siteconfig_data = fread($siteconfig_file, filesize($siteconfig_path)); + fclose($siteconfig_file); + + $siteconfig_data = preg_replace + ( + '/\$_CONF\[\'default_charset\'\] = \'[^\']*\';/', + "\$_CONF['default_charset'] = '" . $charset . "';", + $siteconfig_data + ); + + $siteconfig_file = fopen($siteconfig_path, 'w'); + if (!fwrite($siteconfig_file, $siteconfig_data)) { + $result = false; + } + @fclose($siteconfig_file); + + return $result; +} + + +/** * Set VERSION constant in siteconfig.php after successful upgrade * * @param string $siteconfig_path path to siteconfig.php From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:06:59 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:06:59 -0500 Subject: [geeklog-cvs] geeklog: Removed old script to add indexes to some tables Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/d9f30084e9c5 changeset: 6623:d9f30084e9c5 user: Dirk Haun date: Thu Jan 01 13:37:41 2009 +0100 description: Removed old script to add indexes to some tables diffstat: 1 file changed, 145 deletions(-) public_html/admin/install/addindex.php | 145 -------------------------------- diffs (149 lines): diff -r 1ba00656781c -r d9f30084e9c5 public_html/admin/install/addindex.php --- a/public_html/admin/install/addindex.php Thu Jan 01 12:15:36 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ - -// Initial version -// 2002-11-24 0.2 Dirk Haun -// Added key names for the indexes, added authentication check - -require_once('../../lib-common.php'); - -if (!SEC_inGroup ('Root')) { - COM_errorLog ("Access denied to {$PHP_SELF} for user {$_USER['username']}, IP=" . $_SERVER['REMOTE_ADDR']); - $display = COM_siteHeader('menu'); - $display .= COM_startBlock($LANG20[1]); - $display .= $LANG20[6]; - $display .= COM_endBlock(); - $display .= COM_siteFooter(); - echo $display; - exit; -} - -// $_DEBUG = 1; - -// list according to Jeff's post on geeklog-devel (2002-10-14) -// plus stories.hits (Rob Griffiths) plus group_assignments.ug_uid -// - -$index['comments'] = "cid,type,sid,date,uid"; -$index['stories'] = "sid,tid,date,uid,frontpage,featured,hits"; -$index['blocks'] = "bid,is_enabled,tid,type"; -$index['events'] = "eid,datestart,dateend,event_type"; -$index['links'] = "lid,category,date"; -$index['pollquestions'] = "qid,date,display,commentcode,statuscode"; -$index['staticpage'] = "sp_id,sp_uid,sp_date,sp_onmenu"; -$index['userindex'] = "uid,noboxes,maxstories"; -$index['group_assignments'] = "ug_main_grp_id,ug_uid"; - - -echo COM_siteHeader('menu'); -echo COM_startBlock("Updating indexes ..."); - -foreach ($index as $table=>$fields) { - - $idx = explode (",", $fields); - - echo "

Table: {$_TABLES[$table]}

"; - - if ($_DEBUG) { - echo "

Wanted: "; - foreach ($idx as $id) { - echo "$id, "; - } - echo "

"; - } - - $result = DB_query ("show index from {$_TABLES[$table]}"); - $nrows = DB_numRows ($result); - $exidx = array (); - for ($i = 0; $i < $nrows; $i++) { - $A = DB_fetchArray ($result); - $exidx[] = $A['Column_name']; - } - $newidx = array_diff ($idx, $exidx); - - if ($_DEBUG) { - echo "

Existing: "; - foreach ($exidx as $ex) { - echo "$ex, "; - } - echo "

"; - } - - if ($_DEBUG) { - echo "

Need to add: "; - foreach ($newidx as $ne) { - echo "$ne, "; - } - echo "

"; - } - - if (sizeof ($newidx) > 0) { - echo "

Adding indexes ..."; - foreach ($newidx as $ne) { - $idxname = $table . '_' . $ne; - echo "Adding index \"$idxname\""; - flush (); - - $idxtimer = new timerobject (); - $idxtimer->setPercision (4); - $idxtimer->startTimer (); - - DB_query("ALTER TABLE {$_TABLES[$table]} ADD INDEX $idxname ($ne)"); - - $idxtime = $idxtimer->stopTimer (); - $idxtimer->setPercision (4); - echo " in $idxtime seconds"; - } - echo "Done!

"; - } else { - echo "

No index to add for table {$_TABLES[$table]}

"; - } - - echo ""; -} - -echo COM_endBlock(); -echo COM_siteFooter(); - -?> From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:07:04 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:07:04 -0500 Subject: [geeklog-cvs] geeklog: Set noreply_mail when updating from an old version Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/4b7cb04f5988 changeset: 6625:4b7cb04f5988 user: Dirk Haun date: Thu Jan 01 14:06:24 2009 +0100 description: Set noreply_mail when updating from an old version diffstat: 1 file changed, 7 insertions(+), 1 deletion(-) public_html/admin/install/migrate.php | 8 +++++++- diffs (25 lines): diff -r c12f857524eb -r 4b7cb04f5988 public_html/admin/install/migrate.php --- a/public_html/admin/install/migrate.php Thu Jan 01 13:50:40 2009 +0100 +++ b/public_html/admin/install/migrate.php Thu Jan 01 14:06:24 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Install Geeklog from a backup. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2008 by the following authors: | +// | Copyright (C) 2008-2009 by the following authors: | // | | // | Authors: Matt West - matt AT mattdanger DOT net | // | Dirk Haun - dirk AT haun-online DOT de | @@ -680,6 +680,12 @@ $_CONF['theme'] = 'professional'; } + // set noreply_mail when updating from an old version + if (empty($_CONF['noreply_mail']) && (! empty($_CONF['site_mail']))) { + $_CONF['noreply_mail'] = $_CONF['site_mail']; + $config->set('noreply_mail', $_CONF['noreply_mail']); + } + /** * Check for missing plugins */ From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:07:04 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:07:04 -0500 Subject: [geeklog-cvs] geeklog: Fixed description of debug_image_upload option Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/0002d085bfd2 changeset: 6626:0002d085bfd2 user: Dirk Haun date: Thu Jan 01 14:30:50 2009 +0100 description: Fixed description of debug_image_upload option diffstat: 1 file changed, 5 insertions(+), 5 deletions(-) public_html/docs/config.html | 10 +++++----- diffs (20 lines): diff -r 4b7cb04f5988 -r 0002d085bfd2 public_html/docs/config.html --- a/public_html/docs/config.html Thu Jan 01 14:06:24 2009 +0100 +++ b/public_html/docs/config.html Thu Jan 01 14:30:50 2009 +0100 @@ -939,11 +939,11 @@ images. debug_image_upload - (disabled) - When enabled and set to true, this option - enables debugging output to be written into Geeklog's error.log - file during the upload of an image. This is useful to track down problems - with the image upload. + false + When set to true, this option enables debugging + output to be written into Geeklog's error.log file during the + upload of an image. This is useful to track down problems with the image + upload.

Images: Images in Articles

From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:07:02 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:07:02 -0500 Subject: [geeklog-cvs] geeklog: Removed misplaced global declaration (and started using... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/c12f857524eb changeset: 6624:c12f857524eb user: Dirk Haun date: Thu Jan 01 13:50:40 2009 +0100 description: Removed misplaced global declaration (and started using 2009 as the copyright year) diffstat: 4 files changed, 11 insertions(+), 24 deletions(-) public_html/admin/user.php | 13 +++++-------- public_html/lib-common.php | 7 ++----- public_html/users.php | 7 ++----- system/lib-user.php | 8 ++------ diffs (162 lines): diff -r d9f30084e9c5 -r c12f857524eb public_html/admin/user.php --- a/public_html/admin/user.php Thu Jan 01 13:37:41 2009 +0100 +++ b/public_html/admin/user.php Thu Jan 01 13:50:40 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | user.php | // | | // | Geeklog user administration page. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -31,15 +31,13 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: user.php,v 1.209 2008/08/01 18:48:58 blaine Exp $ - -// Set this to true to get various debug messages from this script -$_USER_VERBOSE = false; require_once '../lib-common.php'; require_once 'auth.inc.php'; require_once $_CONF['path_system'] . 'lib-user.php'; + +// Set this to true to get various debug messages from this script +$_USER_VERBOSE = false; $display = ''; @@ -957,7 +955,6 @@ $subject = sprintf($LANG28[81], $_CONF['site_name']); if ($_CONF['site_mail'] !== $_CONF['noreply_mail']) { $mailfrom = $_CONF['noreply_mail']; - global $LANG_LOGIN; $mailtext .= LB . LB . $LANG04[159]; } else { $mailfrom = $_CONF['site_mail']; diff -r d9f30084e9c5 -r c12f857524eb public_html/lib-common.php --- a/public_html/lib-common.php Thu Jan 01 13:37:41 2009 +0100 +++ b/public_html/lib-common.php Thu Jan 01 13:50:40 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | lib-common.php | // | | // | Geeklog common library. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -32,8 +32,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: lib-common.php,v 1.728 2008/09/21 08:37:09 dhaun Exp $ // Prevent PHP from reporting uninitialized variables error_reporting( E_ERROR | E_WARNING | E_PARSE | E_COMPILE_ERROR ); @@ -4113,7 +4111,6 @@ if ($_CONF['site_mail'] !== $_CONF['noreply_mail']) { $mailfrom = $_CONF['noreply_mail']; - global $LANG_LOGIN; $mailtext .= LB . LB . $LANG04[159]; } else { $mailfrom = $_CONF['site_mail']; diff -r d9f30084e9c5 -r c12f857524eb public_html/users.php --- a/public_html/users.php Thu Jan 01 13:37:41 2009 +0100 +++ b/public_html/users.php Thu Jan 01 13:50:40 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | users.php | // | | // | User authentication module. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -31,8 +31,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: users.php,v 1.170 2008/09/15 18:26:17 mjervis Exp $ /** * This file handles user authentication @@ -407,7 +405,6 @@ $subject = $_CONF['site_name'] . ': ' . $LANG04[16]; if ($_CONF['site_mail'] !== $_CONF['noreply_mail']) { $mailfrom = $_CONF['noreply_mail']; - global $LANG_LOGIN; $mailtext .= LB . LB . $LANG04[159]; } else { $mailfrom = $_CONF['site_mail']; diff -r d9f30084e9c5 -r c12f857524eb system/lib-user.php --- a/system/lib-user.php Thu Jan 01 13:37:41 2009 +0100 +++ b/system/lib-user.php Thu Jan 01 13:50:40 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | lib-user.php | // | | // | User-related functions needed in more than one place. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -31,8 +31,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: lib-user.php,v 1.49 2008/09/21 08:37:12 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'lib-user.php') !== false) { die('This file can not be used on its own!'); @@ -178,7 +176,6 @@ $subject = $_CONF['site_name'] . ': ' . $LANG04[16]; if ($_CONF['site_mail'] !== $_CONF['noreply_mail']) { $mailfrom = $_CONF['noreply_mail']; - global $LANG_LOGIN; $mailtext .= LB . LB . $LANG04[159]; } else { $mailfrom = $_CONF['site_mail']; @@ -221,7 +218,6 @@ $subject = $_CONF['site_name'] . ': ' . $LANG04[120]; if ($_CONF['site_mail'] !== $_CONF['noreply_mail']) { $mailfrom = $_CONF['noreply_mail']; - global $LANG_LOGIN; $mailtext .= LB . LB . $LANG04[159]; } else { $mailfrom = $_CONF['site_mail']; From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:07:06 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:07:06 -0500 Subject: [geeklog-cvs] geeklog: Initial screen of the install script did not work when ... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/f6f7ccea3966 changeset: 6627:f6f7ccea3966 user: Dirk Haun date: Thu Jan 01 16:12:27 2009 +0100 description: Initial screen of the install script did not work when switching the language diffstat: 3 files changed, 12 insertions(+), 9 deletions(-) public_html/admin/install/index.php | 7 ++++--- public_html/admin/install/language/english.php | 3 ++- public_html/admin/install/language/german.php | 11 ++++++----- diffs (102 lines): diff -r 0002d085bfd2 -r f6f7ccea3966 public_html/admin/install/index.php --- a/public_html/admin/install/index.php Thu Jan 01 14:30:50 2009 +0100 +++ b/public_html/admin/install/index.php Thu Jan 01 16:12:27 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Geeklog installation script. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Matt West - matt AT mattdanger DOT net | // | Tony Bibbs - tony AT tonybibbs DOT com | @@ -1137,7 +1137,7 @@ // If they did, determine which method they selected switch ($install_type) { - case 'Migrate': + case $LANG_INSTALL[16]: $install_type = 'migrate'; break; case $LANG_INSTALL[24]: @@ -1166,10 +1166,11 @@ . INST_printTab(3) . '

' . LB . INST_printTab(3) . '' . LB . INST_printTab(3) . '' . LB + . INST_printTab(3) . '' . LB . INST_printTab(3) . '' . LB . INST_printTab(3) . '' . LB . INST_printTab(3) . '' . LB - . INST_printTab(3) . '' . LB + . INST_printTab(3) . '' . LB . INST_printTab(3) . '

' . LB; } diff -r 0002d085bfd2 -r f6f7ccea3966 public_html/admin/install/language/english.php --- a/public_html/admin/install/language/english.php Thu Jan 01 14:30:50 2009 +0100 +++ b/public_html/admin/install/language/english.php Thu Jan 01 16:12:27 2009 +0100 @@ -8,7 +8,7 @@ // | | // | English language file for the Geeklog installation script | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -65,6 +65,7 @@ 13 => 'Currently', 14 => '', 15 => 'Export of Geeklog headlines is switched off. The backend directory was not tested', + 16 => 'Migrate', 17 => 'User photos are disabled. The userphotos directory was not tested', 18 => 'Images in articles are disabled. The articles directory was not tested', 19 => 'In order to operate correctly Geeklog requires that certain files and directories be writable by the web server. Below is a list of file and directory permissions that you need to modify before continuing with the your installation.', diff -r 0002d085bfd2 -r f6f7ccea3966 public_html/admin/install/language/german.php --- a/public_html/admin/install/language/german.php Thu Jan 01 14:30:50 2009 +0100 +++ b/public_html/admin/install/language/german.php Thu Jan 01 16:12:27 2009 +0100 @@ -8,7 +8,7 @@ // | | // | German language file for the Geeklog installation script | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -65,13 +65,14 @@ 13 => 'Derzeit', 14 => 'Change directory to', 15 => 'Export of Geeklog headlines is switched off. The backend directory was not tested', + 16 => 'Migration', 17 => 'User photos are disabled. The userphotos directory was not tested', 18 => 'Images in articles are disabled. The articles directory was not tested', 19 => 'Geeklog setzt voraus, dass bestimmte Dateien und Verzeichnisse f?r den Webserver schreibbar sind. Es folgt eine Liste der Dateien und Verzeichnisse, die ge?ndert werden m?ssen.', 20 => 'Warnung!', 21 => 'Geeklog und Deine Website werden nicht funktionsf?hig sein, solange diese Fehler nicht korrigiert werden. Bitte nimm die notwendigen ?nderungen vor, bevor Du mit der Installation fortf?hrst.', 22 => 'unbekannt', - 23 => 'Bitte w?hle eine Installationsmethode:', + 23 => 'Bitte w?hle eine Installationsmethode', 24 => 'Neuinstallation', 25 => 'Upgrade', 26 => 'Unable to modify', @@ -107,7 +108,7 @@ 56 => 'Could not connect to database', 57 => 'Sorry, but the installer could not find the database you specified. Either the database does not exist or you misspelled the name. Please go back and try again.', 58 => '. Did you make sure the file is write-able by the web server?', - 59 => 'Hinweis:', + 59 => 'Hinweis', 60 => 'InnoDB tables are not supported by your version of MySQL. Would you like to continue the installation without InnoDB support?', 61 => 'zur?ck', 62 => 'weiter', @@ -220,8 +221,8 @@ 13 => '. If your backup file is larger than ', 14 => ' or if you experience a timeout, then you should upload the file to Geeklog\'s backups directory via FTP.', 15 => 'Your backups directory is not writable by the web server. Permissions need to be 777.', - 16 => 'Migrate', - 17 => 'Migrate From Backup', + 16 => 'Migration', + 17 => 'Migration vom Backup', 18 => 'No backup file was selected', 19 => 'Could not save ', 20 => ' to ', From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:07:07 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:07:07 -0500 Subject: [geeklog-cvs] geeklog: Moved hard-coded text strings to the language file Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/9bd8b2905fe6 changeset: 6628:9bd8b2905fe6 user: Dirk Haun date: Thu Jan 01 16:59:31 2009 +0100 description: Moved hard-coded text strings to the language file diffstat: 3 files changed, 32 insertions(+), 16 deletions(-) public_html/admin/install/index.php | 30 ++++++++++++++---------- public_html/admin/install/language/english.php | 7 ++++- public_html/admin/install/language/german.php | 11 ++++++-- diffs (151 lines): diff -r f6f7ccea3966 -r 9bd8b2905fe6 public_html/admin/install/index.php --- a/public_html/admin/install/index.php Thu Jan 01 16:12:27 2009 +0100 +++ b/public_html/admin/install/index.php Thu Jan 01 16:59:31 2009 +0100 @@ -73,7 +73,7 @@ } } - $display .= '

' . 'Step' . ' ' . $_REQUEST['display_step'] . ' - Enter configuration information

' . LB; + $display .= '

' . $LANG_INSTALL[101] . ' ' . $_REQUEST['display_step'] . ' - ' . $LANG_INSTALL[102] . '

' . LB; // Set all the form values either with their defaults or with received POST data. @@ -186,7 +186,7 @@ $display .=' - + ' . LB; break; @@ -217,8 +217,8 @@ // Check if $site_admin_url is correct if (!INST_urlExists($site_admin_url)) { - $display .= '

' . 'Incorrect Admin Directory Path' . '

' - . 'Sorry, but the admin directory path you entered does not appear to be correct. Please go back and try again.' . '

' + $display .= '

' . $LANG_INSTALL[104] . '

' + . $LANG_INSTALL[105] . '

' . INST_showReturnFormData($_POST) . LB; // Check if we can connect to the database @@ -232,20 +232,24 @@ } else if (INST_mysqlOutOfDate($DB)) { $display .= '

' . $LANG_INSTALL[51] . '

' . LB; - $display .= '

' . $LANG_INSTALL[52] . $myv[0] . '.' . $myv[1] . '.' . $myv[2] . $LANG_INSTALL[53] . '

' . LB; + $display .= '

' . $LANG_INSTALL[52] + . $myv[0] . '.' . $myv[1] . '.' . $myv[2] + . $LANG_INSTALL[53] . '

' . LB; // Check if database doesn't exist } else if (!INST_dbExists($DB)) { - $display .= '

' . $LANG_INSTALL[56] . '

-

' . $LANG_INSTALL[57] . '

' . INST_showReturnFormData($_POST) . LB; + $display .= '

' . $LANG_INSTALL[56] . '

' + . $LANG_INSTALL[57] . '

' + . INST_showReturnFormData($_POST) . LB; } else { // Write the database info to db-config.php if (!INST_writeConfig($dbconfig_path, $DB)) { - exit($LANG_INSTALL[26] . ' ' . $dbconfig_path . $LANG_INSTALL[58]); + exit($LANG_INSTALL[26] . ' ' . $dbconfig_path + . $LANG_INSTALL[58]); } @@ -261,7 +265,9 @@ require $dbconfig_path; require_once $siteconfig_path; require_once $_CONF['path_system'] . 'lib-database.php'; - $req_string = 'index.php?mode=' . $install_type . '&step=3&dbconfig_path=' . $dbconfig_path + + $req_string = 'index.php?mode=' . $install_type + . '&step=3&dbconfig_path=' . $dbconfig_path . '&install_plugins=' . $install_plugins . '&language=' . $language . '&site_name=' . urlencode($site_name) @@ -357,7 +363,7 @@ } $display .= '

- + ' . LB; $curv = $old_versions[count($old_versions) - 1]; @@ -1104,7 +1110,7 @@ if ($num_wrong) { // If any files have incorrect permissions. - $display .= INST_printTab(2) . '

' . 'Step' . ' ' . $display_step . ' - ' . $LANG_INSTALL[97] . '

' . LB; + $display .= INST_printTab(2) . '

' . $LANG_INSTALL[101] . ' ' . $display_step . ' - ' . $LANG_INSTALL[97] . '

' . LB; $display_step++; if (isset($_GET['install_type'])) { @@ -1162,7 +1168,7 @@ // Show the "Select your installation method" buttons $upgr_class = ($LANG_DIRECTION == 'rtl') ? 'upgrade-rtl' : 'upgrade' ; - $display .= INST_printTab(2) . '

' . 'Step' . ' ' . $display_step . ' - ' . $LANG_INSTALL[23] . '

' . LB + $display .= INST_printTab(2) . '

' . $LANG_INSTALL[101] . ' ' . $display_step . ' - ' . $LANG_INSTALL[23] . '

' . LB . INST_printTab(3) . '

' . LB . INST_printTab(3) . '' . LB . INST_printTab(3) . '' . LB diff -r f6f7ccea3966 -r 9bd8b2905fe6 public_html/admin/install/language/english.php --- a/public_html/admin/install/language/english.php Thu Jan 01 16:12:27 2009 +0100 +++ b/public_html/admin/install/language/english.php Thu Jan 01 16:59:31 2009 +0100 @@ -149,7 +149,12 @@ 97 => 'Set File Permissions', 98 => 'Advanced Users', 99 => 'If you have command line (SSH) access to your web server then you can simple copy and paste the following command into your shell:', - 100 => 'Invalid mode specified' + 100 => 'Invalid mode specified', + 101 => 'Step', + 102 => 'Enter configuration information', + 103 => 'and configure additional plugins', + 104 => 'Incorrect Admin Directory Path', + 105 => 'Sorry, but the admin directory path you entered does not appear to be correct. Please go back and try again.' ); // +---------------------------------------------------------------------------+ diff -r f6f7ccea3966 -r 9bd8b2905fe6 public_html/admin/install/language/german.php --- a/public_html/admin/install/language/german.php Thu Jan 01 16:12:27 2009 +0100 +++ b/public_html/admin/install/language/german.php Thu Jan 01 16:59:31 2009 +0100 @@ -69,7 +69,7 @@ 17 => 'User photos are disabled. The userphotos directory was not tested', 18 => 'Images in articles are disabled. The articles directory was not tested', 19 => 'Geeklog setzt voraus, dass bestimmte Dateien und Verzeichnisse f?r den Webserver schreibbar sind. Es folgt eine Liste der Dateien und Verzeichnisse, die ge?ndert werden m?ssen.', - 20 => 'Warnung!', + 20 => 'Warnung', 21 => 'Geeklog und Deine Website werden nicht funktionsf?hig sein, solange diese Fehler nicht korrigiert werden. Bitte nimm die notwendigen ?nderungen vor, bevor Du mit der Installation fortf?hrst.', 22 => 'unbekannt', 23 => 'Bitte w?hle eine Installationsmethode', @@ -96,7 +96,7 @@ 44 => 'Optionale Einstellungen', 45 => 'URL der Website', 46 => '(ohne Slash am Ende)', - 47 => 'Pfad f?r das "admin"-Verzeichnis', + 47 => 'URL f. "admin"-Verzeichnis', 48 => 'Website-Email-Adresse', 49 => '"No Reply"-Email-Adresse', 50 => 'Installieren', @@ -149,7 +149,12 @@ 97 => 'Set File Permissions', 98 => 'Advanced Users', 99 => 'If you have command line (SSH) access to your web server then you can simple copy and paste the following command into your shell:', - 100 => 'Invalid mode specified' + 100 => 'Invalid mode specified', + 101 => 'Schritt', + 102 => 'Konfigurations-Informationen eingeben', + 103 => 'und zus?tzliche Plugins konfigurieren', + 104 => 'Incorrect Admin Directory Path', + 105 => 'Sorry, but the admin directory path you entered does not appear to be correct. Please go back and try again.' ); // +---------------------------------------------------------------------------+ From geeklog-cvs at lists.geeklog.net Mon Jan 5 05:07:08 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 05 Jan 2009 05:07:08 -0500 Subject: [geeklog-cvs] geeklog: Need to check for InnoDB support again when migrating Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/3f7294b43f79 changeset: 6629:3f7294b43f79 user: Dirk Haun date: Thu Jan 01 17:16:23 2009 +0100 description: Need to check for InnoDB support again when migrating diffstat: 3 files changed, 30 insertions(+), 27 deletions(-) public_html/admin/install/index.php | 26 +------------------------- public_html/admin/install/lib-upgrade.php | 22 +++++++++++++++++++++- public_html/admin/install/migrate.php | 9 ++++++++- diffs (104 lines): diff -r 9bd8b2905fe6 -r 3f7294b43f79 public_html/admin/install/index.php --- a/public_html/admin/install/index.php Thu Jan 01 16:59:31 2009 +0100 +++ b/public_html/admin/install/index.php Thu Jan 01 17:16:23 2009 +0100 @@ -8,14 +8,10 @@ // | | // | Geeklog installation script. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2009 by the following authors: | +// | Copyright (C) 2007-2009 by the following authors: | // | | // | Authors: Matt West - matt AT mattdanger DOT net | -// | Tony Bibbs - tony AT tonybibbs DOT com | -// | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | -// | Jason Whittenburg - jwhitten AT securitygeeks DOT com | // | Dirk Haun - dirk AT haun-online DOT de | -// | Randy Kolenko - randy AT nextide DOT ca | // +---------------------------------------------------------------------------+ // | | // | This program is free software; you can redistribute it and/or | @@ -820,26 +816,6 @@ /** - * Check for InnoDB table support (usually as of MySQL 4.0, but may be - * available in earlier versions, e.g. "Max" or custom builds). - * - * @return boolean true = InnoDB tables supported, false = not supported - * - */ -function INST_innodbSupported() -{ - $result = DB_query ("SHOW VARIABLES LIKE 'have_innodb'"); - $A = DB_fetchArray ($result, true); - - if (strcasecmp ($A[1], 'yes') == 0) { - return true; - } else { - return false; - } -} - - -/** * Handle default install of available plugins * * Picks up and installs all plugins with an autoinstall.php. diff -r 9bd8b2905fe6 -r 3f7294b43f79 public_html/admin/install/lib-upgrade.php --- a/public_html/admin/install/lib-upgrade.php Thu Jan 01 16:59:31 2009 +0100 +++ b/public_html/admin/install/lib-upgrade.php Thu Jan 01 17:16:23 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Functions needed to perform a database update. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Matt West - matt.danger.west AT gmail DOT com | // | Dirk Haun - dirk AT haun-online DOT de | @@ -727,6 +727,26 @@ /** + * Check for InnoDB table support (usually as of MySQL 4.0, but may be + * available in earlier versions, e.g. "Max" or custom builds). + * + * @return boolean true = InnoDB tables supported, false = not supported + * + */ +function INST_innodbSupported() +{ + $result = DB_query("SHOW VARIABLES LIKE 'have_innodb'"); + $A = DB_fetchArray($result, true); + + if (strcasecmp($A[1], 'yes') == 0) { + return true; + } + + return false; +} + + +/** * Check if a current plugin is installed * * @param string $plugin Name of plugin to check diff -r 9bd8b2905fe6 -r 3f7294b43f79 public_html/admin/install/migrate.php --- a/public_html/admin/install/migrate.php Thu Jan 01 16:59:31 2009 +0100 +++ b/public_html/admin/install/migrate.php Thu Jan 01 17:16:23 2009 +0100 @@ -613,7 +613,14 @@ $db_engine = DB_getItem($_TABLES['vars'], 'value', "name = 'database_engine'"); if ($db_engine == 'InnoDB') { - $use_innodb = true; + // we've migrated, probably to a different server + // - so check InnoDB support again + if (INST_innodbSupported()) { + $use_innodb = true; + } else { + // no InnoDB support on this server + DB_delete($_TABLES['vars'], 'name', 'database_engine'); + } } if (! INST_doDatabaseUpgrades($version)) { From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:14 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:14 -0500 Subject: [geeklog-cvs] geeklog: Missing word: "Ability _to_ use PHP in static pages" Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/878c3258ab58 changeset: 6647:878c3258ab58 user: Dirk Haun date: Sun Dec 28 18:14:57 2008 +0100 description: Missing word: "Ability _to_ use PHP in static pages" diffstat: 3 files changed, 3 insertions(+), 3 deletions(-) public_html/admin/plugins/staticpages/install.php | 2 +- sql/mssql_tableanddata.php | 2 +- sql/mysql_tableanddata.php | 2 +- diffs (36 lines): diff -r 75f54388c20b -r 878c3258ab58 public_html/admin/plugins/staticpages/install.php --- a/public_html/admin/plugins/staticpages/install.php Mon Dec 22 15:22:36 2008 +0100 +++ b/public_html/admin/plugins/staticpages/install.php Sun Dec 28 18:14:57 2008 +0100 @@ -63,7 +63,7 @@ $FEATURES = array(); $FEATURES['staticpages.edit'] = 'Access to Static Pages editor'; $FEATURES['staticpages.delete'] = 'Ability to delete static pages'; -$FEATURES['staticpages.PHP'] = 'Ability use PHP in static pages'; +$FEATURES['staticpages.PHP'] = 'Ability to use PHP in static pages'; $MAPPINGS = array(); $MAPPINGS['staticpages.edit'] = array ($pi_admin); diff -r 75f54388c20b -r 878c3258ab58 sql/mssql_tableanddata.php --- a/sql/mssql_tableanddata.php Mon Dec 22 15:22:36 2008 +0100 +++ b/sql/mssql_tableanddata.php Sun Dec 28 18:14:57 2008 +0100 @@ -1568,7 +1568,7 @@ INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (18,'staticpages.delete','Ability to delete static pages',0) INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (19,'story.submit','May skip the story submission queue',1) INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (21,'calendar.submit','May skip the event submission queue',1) -INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (22,'staticpages.PHP','Ability use PHP in static pages',0) +INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (22,'staticpages.PHP','Ability to use PHP in static pages',0) INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (23,'spamx.admin', 'Full access to Spam-X plugin', 0) INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (24,'story.ping', 'Ability to send pings, pingbacks, or trackbacks for stories', 1) INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (3,'links.moderate','Ability to moderate pending links',0) diff -r 75f54388c20b -r 878c3258ab58 sql/mysql_tableanddata.php --- a/sql/mysql_tableanddata.php Mon Dec 22 15:22:36 2008 +0100 +++ b/sql/mysql_tableanddata.php Sun Dec 28 18:14:57 2008 +0100 @@ -840,7 +840,7 @@ $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (19,'story.submit','May skip the story submission queue',1) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (20,'links.submit','May skip the links submission queue',0) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (21,'calendar.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['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (22,'staticpages.PHP','Ability to use PHP in static pages',0) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (23,'spamx.admin', 'Full access to Spam-X plugin', 0) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (24,'story.ping', 'Ability to send pings, pingbacks, or trackbacks for stories', 1) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (25,'syndication.edit', 'Access to Content Syndication', 1) "; From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:16 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:16 -0500 Subject: [geeklog-cvs] geeklog: Fixed description of debug_image_upload option Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/247fea0cfba2 changeset: 6649:247fea0cfba2 user: Dirk Haun date: Thu Jan 01 14:30:50 2009 +0100 description: Fixed description of debug_image_upload option diffstat: 1 file changed, 5 insertions(+), 5 deletions(-) public_html/docs/config.html | 10 +++++----- diffs (20 lines): diff -r e7d2d8d37fc1 -r 247fea0cfba2 public_html/docs/config.html --- a/public_html/docs/config.html Wed Dec 31 19:05:40 2008 +0100 +++ b/public_html/docs/config.html Thu Jan 01 14:30:50 2009 +0100 @@ -926,11 +926,11 @@ [imageX] tag). debug_image_upload - (disabled) - When enabled and set to true, this option - enables debugging output to be written into Geeklog's error.log - file during the upload of an image. This is useful to track down problems - with the image upload. + false + When set to true, this option enables debugging + output to be written into Geeklog's error.log file during the + upload of an image. This is useful to track down problems with the image + upload.

Images: Images in Articles

From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:15 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:15 -0500 Subject: [geeklog-cvs] geeklog: Don't rename plugin config.php during upgrades (from pr... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/e7d2d8d37fc1 changeset: 6648:e7d2d8d37fc1 user: Dirk Haun date: Wed Dec 31 19:05:40 2008 +0100 description: Don't rename plugin config.php during upgrades (from pre-1.5.0 versions) any more. It's not needed and will only cause inconveniences when having to run the upgrade again. diffstat: 2 files changed, 60 deletions(-) sql/updates/mssql_1.4.1_to_1.5.0.php | 30 ------------------------------ sql/updates/mysql_1.4.1_to_1.5.0.php | 30 ------------------------------ diffs (136 lines): diff -r 878c3258ab58 -r e7d2d8d37fc1 sql/updates/mssql_1.4.1_to_1.5.0.php --- a/sql/updates/mssql_1.4.1_to_1.5.0.php Sun Dec 28 18:14:57 2008 +0100 +++ b/sql/updates/mssql_1.4.1_to_1.5.0.php Wed Dec 31 19:05:40 2008 +0100 @@ -459,12 +459,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } @@ -501,12 +495,6 @@ echo "There was an error upgrading the Static Pages plugin, SQL: $sql
"; return false; } - } - - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); } return true; @@ -558,12 +546,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } @@ -593,12 +575,6 @@ if (DB_error()) { echo "There was an error upgrading the Spam-X plugin"; return false; - } - - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); } return true; @@ -698,12 +674,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } diff -r 878c3258ab58 -r e7d2d8d37fc1 sql/updates/mysql_1.4.1_to_1.5.0.php --- a/sql/updates/mysql_1.4.1_to_1.5.0.php Sun Dec 28 18:14:57 2008 +0100 +++ b/sql/updates/mysql_1.4.1_to_1.5.0.php Wed Dec 31 19:05:40 2008 +0100 @@ -422,12 +422,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } @@ -464,12 +458,6 @@ echo "There was an error upgrading the Static Pages plugin, SQL: $sql
"; return false; } - } - - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); } return true; @@ -521,12 +509,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } @@ -556,12 +538,6 @@ if (DB_error()) { echo "There was an error upgrading the Spam-X plugin"; return false; - } - - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); } return true; @@ -657,12 +633,6 @@ } } - if (file_exists($plugin_path . 'config.php')) { - // Rename the existing config.php as it's not needed any more - $ren = @rename($plugin_path . 'config.php', - $plugin_path . 'config-pre1.5.0.php'); - } - return true; } From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:16 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:16 -0500 Subject: [geeklog-cvs] geeklog: Display language dropdown on the very first page (when ... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/4dc636c1dc12 changeset: 6650:4dc636c1dc12 user: Dirk Haun date: Thu Jan 01 21:13:33 2009 +0100 description: Display language dropdown on the very first page (when the install script can't find db-config.php) diffstat: 1 file changed, 1 insertion(+), 1 deletion(-) public_html/admin/install/index.php | 2 +- diffs (12 lines): diff -r 247fea0cfba2 -r 4dc636c1dc12 public_html/admin/install/index.php --- a/public_html/admin/install/index.php Thu Jan 01 14:30:50 2009 +0100 +++ b/public_html/admin/install/index.php Thu Jan 01 21:13:33 2009 +0100 @@ -1835,7 +1835,7 @@
' . $LANG_INSTALL[2] . ' ' . LB; // Show the language drop down selection on the first page -if ($mode == 'check_permissions') { +if (empty($mode) || ($mode == 'check_permissions')) { $display .='' . LB; $_PATH = array('dbconfig', 'public_html'); From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:18 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:18 -0500 Subject: [geeklog-cvs] geeklog: Cosmetics: Always set the default for the copyright yea... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/49679ac7237e changeset: 6651:49679ac7237e user: Dirk Haun date: Sat Jan 03 17:55:42 2009 +0100 description: Cosmetics: Always set the default for the copyright year to the current year diffstat: 1 file changed, 2 insertions(+), 2 deletions(-) public_html/admin/install/config-install.php | 4 ++-- diffs (21 lines): diff -r 4dc636c1dc12 -r 49679ac7237e public_html/admin/install/config-install.php --- a/public_html/admin/install/config-install.php Thu Jan 01 21:13:33 2009 +0100 +++ b/public_html/admin/install/config-install.php Sat Jan 03 17:55:42 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Initial configuration setup. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2007-2008 by the following authors: | +// | Copyright (C) 2007-2009 by the following authors: | // | | // | Authors: Aaron Blankstein - kantai AT gmail DOT com | // +---------------------------------------------------------------------------+ @@ -51,7 +51,7 @@ $c->add('site_slogan','','text',0,0,NULL,70,TRUE); $c->add('microsummary_short','GL: ','text',0,0,NULL,80,TRUE); $c->add('site_disabled_msg','Geeklog Site is down. Please come back soon.','text',0,0,NULL,510,TRUE); - $c->add('copyrightyear','2008','text',0,0,NULL,1440,FALSE); + $c->add('copyrightyear',date('Y'),'text',0,0,NULL,1440,FALSE); $c->add('url_rewrite',FALSE,'select',0,0,1,1800,TRUE); $c->add('fs_mail', NULL, 'fieldset', 0, 1, NULL, 0, TRUE); From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:18 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:18 -0500 Subject: [geeklog-cvs] geeklog: Don't let the user enable plugins when there's no funct... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/8a1973c71aba changeset: 6652:8a1973c71aba user: Dirk Haun date: Sun Jan 04 09:23:47 2009 +0100 description: Don't let the user enable plugins when there's no functions.inc diffstat: 2 files changed, 22 insertions(+), 5 deletions(-) public_html/admin/plugins.php | 7 ++++++- system/lib-admin.php | 20 ++++++++++++++++---- diffs (59 lines): diff -r 49679ac7237e -r 8a1973c71aba public_html/admin/plugins.php --- a/public_html/admin/plugins.php Sat Jan 03 17:55:42 2009 +0100 +++ b/public_html/admin/plugins.php Sun Jan 04 09:23:47 2009 +0100 @@ -144,7 +144,12 @@ if ($A['pi_enabled'] == 1) { $plg_templates->set_var('enabled_checked', 'checked="checked"'); } else { - $plg_templates->set_var('enabled_checked', ''); + if (file_exists($_CONF['path'] . 'plugins/' . $pi_name + . '/functions.inc')) { + $plg_templates->set_var('enabled_checked', ''); + } else { + $plg_templates->set_var('enabled_checked', 'disabled="disabled"'); + } } $plg_templates->set_var('gltoken', SEC_createToken()); $plg_templates->set_var('gltoken_name', CSRF_TOKEN); diff -r 49679ac7237e -r 8a1973c71aba system/lib-admin.php --- a/system/lib-admin.php Sat Jan 03 17:55:42 2009 +0100 +++ b/system/lib-admin.php Sun Jan 04 09:23:47 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Admin-related functions needed in more than one place. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -985,14 +985,26 @@ } break; case 'enabled': + $not_present = false; if ($A['pi_enabled'] == 1) { $switch = ' checked="checked"'; } else { $switch = ''; + if (! file_exists($_CONF['path'] . 'plugins/' . $A['pi_name'] + . '/functions.inc')) { + $not_present = true; + } } - $retval = ""; - $retval .= ""; + if ($not_present) { + $retval = ''; + } else { + $retval = ''; + $retval .= ''; + } break; default: $retval = $fieldvalue; From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:19 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:19 -0500 Subject: [geeklog-cvs] geeklog: Added "Send Pings" to the Story Options block (if enabl... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/1b88a2104e51 changeset: 6653:1b88a2104e51 user: Dirk Haun date: Sun Jan 04 10:47:34 2009 +0100 description: Added "Send Pings" to the Story Options block (if enabled and allowed for the current user) diffstat: 1 file changed, 11 insertions(+), 4 deletions(-) public_html/article.php | 15 +++++++++++---- diffs (45 lines): diff -r 8a1973c71aba -r 1b88a2104e51 public_html/article.php --- a/public_html/article.php Sun Jan 04 09:23:47 2009 +0100 +++ b/public_html/article.php Sun Jan 04 10:47:34 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Shows articles in various formats. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Jason Whittenburg - jwhitten AT securitygeeks DOT com | @@ -31,15 +31,13 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: article.php,v 1.99 2008/07/27 09:11:29 dhaun Exp $ /** * This page is responsible for showing a single article in different modes which * may, or may not, include the comments attached * * @author Jason Whittenburg -* @author Tony Bibbbs +* @author Tony Bibbbs * @author Vincent Furia */ @@ -284,6 +282,15 @@ 'class' => $feedClass)); } } + if ($_CONF['trackback_enabled'] && + ($story->displayElements('trackbackcode') >= 0) && + SEC_hasRights('story.ping') && + ($story->displayElements('draft_flag') == 0) && + ($story->displayElements('day') < time ())) { + $url = $_CONF['site_admin_url'] + . '/trackback.php?mode=sendall&id=' . $story->getSid(); + $story_options[] = COM_createLink($LANG_TRB['send_trackback'], $url); + } $related = STORY_whatsRelated($story->displayElements('related'), $story->displayElements('uid'), $story->displayElements('tid')); From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:19 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:19 -0500 Subject: [geeklog-cvs] geeklog: Updated list of changes for a 1.5.2 release Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/973185c5af4e changeset: 6654:973185c5af4e user: Dirk Haun date: Tue Jan 06 10:25:01 2009 +0100 description: Updated list of changes for a 1.5.2 release diffstat: 2 files changed, 57 insertions(+), 5 deletions(-) public_html/docs/history | 20 ++++++++++++++++---- public_html/docs/theme.html | 42 +++++++++++++++++++++++++++++++++++++++++- diffs (92 lines): diff -r 1b88a2104e51 -r 973185c5af4e public_html/docs/history --- a/public_html/docs/history Sun Jan 04 10:47:34 2009 +0100 +++ b/public_html/docs/history Tue Jan 06 10:25:01 2009 +0100 @@ -1,13 +1,22 @@ Geeklog History/Changes: -??? ??, 2008 (1.5.2) ------------- - +Jan ??, 2009 (1.5.2) +------------ + +- Added "Send Pings" to the Story Options block (if enabled and allowed for the + current user) [Dirk] +- Don't let the user enable plugins when there's no functions.inc for the + plugin [Dirk] +- When the install script can't find db-config.php, that message was always + displayed in English, i.e. you could not change the language for that screen + [Dirk] +- When upgrading from a Geeklog version prior to 1.5.0, the plugin config.php + files are no longer renamed [Dirk] - Admin lists allowed non-sortable columns to be sortable (reported and patch provided by hiroron, bug #0000791) -- Fixed wrong use of COM_isAnonUser in COM_getPermSQL (since 1.5.0) [Dirk] - Fixed STORY_getItemInfo - need to check the draft flag and for a publish date in the future [mystral-kk, Dirk] +- Fixed wrong use of COM_isAnonUser in COM_getPermSQL (since 1.5.0) [Dirk] - When calling COM_getYearFormOptions with a $startoffset parameter, the list of years was off by one (bug #0000783; patch provided by hiroron) - Fixed updating feeds after changing topic permissions (bug #0000779) [Dirk] @@ -30,6 +39,9 @@ - Saving a story tried to update a feed of type 'geeklog' instead of 'article' (reported by Tom Homer) - Delete a feed's file when deleting a feed (bug #0000758) [Dirk] +- When using gdlib, use imagecopyresampled instead or imagecopyresized to scale + images. This should result in better image quality (part of Feature request + #0000720) [Dirk] - The {start_storylink_anchortag} variable in the story templates was missing a '>' (reported by Michael Brusletten) [Dirk] - Display a "Service" column in the Admin's list of users when remote auth is diff -r 1b88a2104e51 -r 973185c5af4e public_html/docs/theme.html --- a/public_html/docs/theme.html Sun Jan 04 10:47:34 2009 +0100 +++ b/public_html/docs/theme.html Tue Jan 06 10:25:01 2009 +0100 @@ -195,7 +195,47 @@ -

Theme changes in Geeklog 1.5.1

+

Theme changes in Geeklog 1.5.2

+ +

Note: Themes made for Geeklog 1.5.0 or 1.5.1 should work just fine with +Geeklog 1.5.2. In this release, we only fixed a few problems in the themes +(detailed below) that also affected 1.5.0 and 1.5.1. The other changes listed +here are optional.

+ +

Bugfixes

+ +

These changes are actual bugs in the template files that also exist in +Geeklog 1.5.0 and 1.5.1. We recommend making these changes to all custom +themes.

+ +
    +
  • The security token was missing from the trackback editor template file, + admin/trackback/trackbackeditor.thtml
  • +
  • The {start_storylink_anchortag} variable in the story templates + was missing the closing '>'. This caused the story title to disappear + on some themes.
  • +
  • The {site_admin_url} was missing from the Configuration form + action in admin/config/configuration.thtml. This may have caused + problems making configuration changes on some setups.
  • +
+ +

Other changes

+ +

These changes are optional. They fix cosmetic issues or issues that only +affect some setups.

+ +
    +
  • Cosmetics: In the Professional theme, the last menu entry isn't different + from the other entries, so the + .header-navigation-container li.last rule in style.css + is not needed for this theme.
  • +
  • Internationalisation: The language direction variable, + {direction}, was not available in the printer-friendly + templates for articles and static pages.
  • +
+ + +

Theme changes in Geeklog 1.5.1

Note: Themes made for Geeklog 1.5.0 are mostly compatible with Geeklog 1.5.1. We only made one mandatory change (for the Configuration admin panel) - all the other changes listed below are optional or adjustments for special setups (e.g. multi-language sites, right-to-left languages). See details below.

From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:22 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:22 -0500 Subject: [geeklog-cvs] geeklog: Cosmetics: Label text was too long and caused display i... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/48f8bb6be77d changeset: 6656:48f8bb6be77d user: Dirk Haun date: Tue Jan 06 11:26:43 2009 +0100 description: Cosmetics: Label text was too long and caused display issues diffstat: 1 file changed, 2 insertions(+), 4 deletions(-) public_html/admin/install/language/german.php | 6 ++---- diffs (30 lines): diff -r 973185c5af4e -r 48f8bb6be77d public_html/admin/install/language/german.php --- a/public_html/admin/install/language/german.php Tue Jan 06 10:25:01 2009 +0100 +++ b/public_html/admin/install/language/german.php Tue Jan 06 11:26:43 2009 +0100 @@ -8,7 +8,7 @@ // | | // | German language file for the Geeklog installation script | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -33,8 +33,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: german.php,v 1.9 2008/05/28 18:46:52 dhaun Exp $ // +---------------------------------------------------------------------------+ @@ -97,7 +95,7 @@ 44 => 'Optionale Einstellungen', 45 => 'URL der Website', 46 => '(ohne Slash am Ende)', - 47 => 'Pfad f?r das "admin"-Verzeichnis', + 47 => 'URL f. "admin"-Verzeichnis', 48 => 'Website-Email-Adresse', 49 => '"No Reply"-Email-Adresse', 50 => 'Installieren', From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:20 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:20 -0500 Subject: [geeklog-cvs] geeklog: Synced list of changes with the 1.5.2 branch Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/0c3b9b147571 changeset: 6655:0c3b9b147571 user: Dirk Haun date: Tue Jan 06 11:05:43 2009 +0100 description: Synced list of changes with the 1.5.2 branch diffstat: 2 files changed, 121 insertions(+), 38 deletions(-) public_html/docs/history | 110 +++++++++++++++++++++++++++++-------------- public_html/docs/theme.html | 49 +++++++++++++++++-- diffs (240 lines): diff -r 82bde5897922 -r 0c3b9b147571 public_html/docs/history --- a/public_html/docs/history Sun Jan 04 10:47:34 2009 +0100 +++ b/public_html/docs/history Tue Jan 06 11:05:43 2009 +0100 @@ -1,13 +1,81 @@ Geeklog History/Changes: ??? ??, 2009 (1.6.0) +------------ + +Geeklog 1.6.0 incorporates the following projects implemented during +the 2008 Google Summer of Code: + ++ Site migration support and easier plugin installation, by Matt West ++ (TBD) Improved search, by Sami Barakat ++ (TBD) Comment moderation and editable comments, by Jared Wenerd + +Other changes: +- Implemented extended API for PLG_getItemInfo [mystral-kk, Dirk] +- Fixed inconsistencies and various small mistakes when displaying "Access + denied" messages on the admin pages [Dirk] +- Added a print.css stylesheet to be used by the printable template files + (feature request #0000766) [Dirk] +- Re-introduced the path hints in the install script when it can't find + db-config.php [Dirk] +- Added a note about the max. dimensions of a userphoto in the About You pane + of a user's My Account page (feature request #0000629) [Dirk] +- Display a message when no topics exist and don't let the user enter the story + editors (bug #0000738) [Dirk] +- Added a configuration option to control the JPEG quality (Feature request + #0000720) [Dirk] + +Calendar plugin +--------------- +- Added auto installation support [Dirk] +- Added support for PLG_getItemInfo [Dirk] + +Links plugin +------------ +- Added auto installation support [Dirk] +- Added support for PLG_getItemInfo [Dirk] +- Introduced function LINKS_getCategorySQL and fixed visibility of link + categories in the Top 10 Links list and site statistics [Dirk] +- Added an option to allow opening external links in a new window (feature + request #0000693). Use with care, please [Dirk] +- Only external links are marked with class="ext-link" [Dirk] + +Polls plugin +------------ +- Added auto installation support [Dirk] +- Added support for PLG_getItemInfo [Dirk] +- Extended length of poll IDs to 40 characters (feature request #0000754) [Dirk] + +Spam-X +------ +- Added auto installation support [Dirk] + +Static Pages plugin +------------------- +- Added auto installation support [Dirk] +- Added support for PLG_getItemInfo [Dirk] +- The printable.thtml template file uses the HTML Strict doctype and print.css + now [Dirk] +- Display "successfully saved" and "successfully deleted" messages, just like + every other plugin and built-in function does (bug #0000644) [Dirk] + + +Jan ??, 2009 (1.5.2) ------------ - Added "Send Pings" to the Story Options block (if enabled and allowed for the current user) [Dirk] +- Don't let the user enable plugins when there's no functions.inc for the + plugin [Dirk] +- When the install script can't find db-config.php, that message was always + displayed in English, i.e. you could not change the language for that screen + [Dirk] +- When upgrading from a Geeklog version prior to 1.5.0, the plugin config.php + files are no longer renamed [Dirk] - Admin lists allowed non-sortable columns to be sortable (reported and patch provided by hiroron, bug #0000791) -- Implemented extended API for PLG_getItemInfo [mystral-kk, Dirk] +- Fixed STORY_getItemInfo - need to check the draft flag and for a publish date + in the future [mystral-kk, Dirk] - Fixed wrong use of COM_isAnonUser in COM_getPermSQL (since 1.5.0) [Dirk] - When calling COM_getYearFormOptions with a $startoffset parameter, the list of years was off by one (bug #0000783; patch provided by hiroron) @@ -16,21 +84,8 @@ (reported and patch provided by hiroron, bug #0000778) - Removed rel="tag" from topic links in lib-story.php as that would indicate a Microformat with a slightly different meaning [Dirk] -- Fixed inconsistencies and various small mistakes when displaying "Access - denied" messages on the admin pages [Dirk] -- Added a print.css stylesheet to be used by the printable template files - (feature request #0000766) [Dirk] -- Re-introduced the path hints in the install script when it can't find - db-config.php [Dirk] -- Added a note about the max. dimensions of a userphoto in the About You pane - of a user's My Account page (feature request #0000629) [Dirk] - Don't include X-Originating-IP header in emails sent from the site's admin area (bug #0000701) [Dirk] -- Display a message when no topics exist and don't let the user enter the story - editors (bug #0000738) [Dirk] -- Improved image quality when using gdlib to rescale images. Also added a - configuration option to control the JPEG quality (Feature request #0000720) - [Dirk] - Check if COM_errorLog exists before using it in the config class (for possible problems during installation, bug #0000768) [Dirk] - Fixed filling out the Site Email / No-Reply Email fields in the install @@ -44,6 +99,9 @@ - Saving a story tried to update a feed of type 'geeklog' instead of 'article' (reported by Tom Homer) - Delete a feed's file when deleting a feed (bug #0000758) [Dirk] +- When using gdlib, use imagecopyresampled instead or imagecopyresized to scale + images. This should result in better image quality (part of Feature request + #0000720) [Dirk] - The {start_storylink_anchortag} variable in the story templates was missing a '>' (reported by Michael Brusletten) [Dirk] - Display a "Service" column in the Admin's list of users when remote auth is @@ -78,45 +136,27 @@ Calendar plugin --------------- -- Added support for PLG_getItemInfo [Dirk] - Make {event_url} available in eventdetails.thtml [Dirk] Links plugin ------------ -- Added support for PLG_getItemInfo [Dirk] -- Introduced function LINKS_getCategorySQL and fixed visibility of link - categories in the Top 10 Links list and site statistics [Dirk] -- Added an option to allow opening external links in a new window (feature - request #0000693). Use with care, please [Dirk] -- Only external links are marked with class="ext-link" [Dirk] +- Missing parentheses my have resulted in incorrect search results [Dirk] - Added urlencoded versions of {link_actual_url} and {link_name} [Dirk] - Prevent overwriting existing links when changing the link ID [Dirk] Polls plugin ------------ -- Added support for PLG_getItemInfo [Dirk] -- Extended length of poll IDs to 40 characters (feature request #0000754) [Dirk] - Fixed SQL error when poll questions contained single quotes (bug #0000756) [Dirk] - Fixed handling of poll IDs in Polls editor (bug #0000753) [Dirk] - + Static Pages plugin ------------------- -- Added support for PLG_getItemInfo [Dirk] - The owner of a static page changed to the user who last edited it (bug #0000777) [Dirk] -- The printable.thtml template file uses the HTML Strict doctype and print.css - now [Dirk] - Fixed call to WS_makeId when sp_id was longer than STATICPAGE_MAX_ID_LENGTH (found by Marc Maier) [Dirk] -- Display "successfully saved" and "successfully deleted" messages, just like - every other plugin and built-in function does (bug #0000644) [Dirk] - - -Jan ??, 2009 (1.5.2) ------------- - -(TBD) + Sep 22, 2008 (1.5.1) diff -r 82bde5897922 -r 0c3b9b147571 public_html/docs/theme.html --- a/public_html/docs/theme.html Sun Jan 04 10:47:34 2009 +0100 +++ b/public_html/docs/theme.html Tue Jan 06 11:05:43 2009 +0100 @@ -195,7 +195,7 @@ -

Theme changes in Geeklog 1.5.2

+

Theme changes in Geeklog 1.6.0

  • New variable {photo_max_dimensions} to inform users about the @@ -203,8 +203,10 @@
  • Added a print.css stylesheet to be used by the printable.thtml template files for articles and the static pages plugin.
  • -
  • The security token was missing from the trackback editor form, - admin/trackback/trackbackeditor.thtml
  • +
  • The plugin editor can now show a plugin's "display name" (or a beautified + version of the directory name) when using the new variable + {pi_display_name} in admin/plugins/editor.thtml. + This is a purely cosmetic change.

Plugins

@@ -217,6 +219,47 @@ uses print.css (see above). It also uses the HTML Strict doctype now. + + +

Theme changes in Geeklog 1.5.2

+ +

Note: Themes made for Geeklog 1.5.0 or 1.5.1 should work just fine with +Geeklog 1.5.2. In this release, we only fixed a few problems in the themes +(detailed below) that also affected 1.5.0 and 1.5.1. The other changes listed +here are optional.

+ +

Bugfixes

+ +

These changes are actual bugs in the template files that also exist in +Geeklog 1.5.0 and 1.5.1. We recommend making these changes to all custom +themes.

+ +
    +
  • The security token was missing from the trackback editor template file, + admin/trackback/trackbackeditor.thtml
  • +
  • The {start_storylink_anchortag} variable in the story templates + was missing the closing '>'. This caused the story title to disappear + on some themes.
  • +
  • The {site_admin_url} was missing from the Configuration form + action in admin/config/configuration.thtml. This may have caused + problems making configuration changes on some setups.
  • +
+ +

Other changes

+ +

These changes are optional. They fix cosmetic issues or issues that only +affect some setups.

+ +
    +
  • Cosmetics: In the Professional theme, the last menu entry isn't different + from the other entries, so the + .header-navigation-container li.last rule in style.css + is not needed for this theme.
  • +
  • Internationalisation: The language direction variable, + {direction}, was not available in the printer-friendly + templates for articles and static pages.
  • +
+

Theme changes in Geeklog 1.5.1

From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:23 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:23 -0500 Subject: [geeklog-cvs] geeklog: The compatibility check in the Spam-X plugin install sc... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/de9415469b9c changeset: 6657:de9415469b9c user: Dirk Haun date: Tue Jan 06 11:30:03 2009 +0100 description: The compatibility check in the Spam-X plugin install script did the checks the wrong way around diffstat: 2 files changed, 10 insertions(+), 8 deletions(-) public_html/admin/plugins/spamx/install.php | 14 ++++++-------- public_html/docs/history | 4 ++++ diffs (56 lines): diff -r 48f8bb6be77d -r de9415469b9c public_html/admin/plugins/spamx/install.php --- a/public_html/admin/plugins/spamx/install.php Tue Jan 06 11:26:43 2009 +0100 +++ b/public_html/admin/plugins/spamx/install.php Tue Jan 06 11:30:03 2009 +0100 @@ -11,7 +11,7 @@ // +---------------------------------------------------------------------------+ // | Based on the Universal Plugin and prior work by the following authors: | // | | -// | Copyright (C) 2002-2008 by the following authors: | +// | Copyright (C) 2002-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Tom Willett - tom AT pigstye DOT net | @@ -35,8 +35,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: install.php,v 1.26 2008/05/23 13:36:12 dhaun Exp $ require_once '../../../lib-common.php'; @@ -80,15 +78,15 @@ */ function plugin_compatible_with_this_geeklog_version() { - if (function_exists('PLG_spamAction')) { - return true; + if (! function_exists('PLG_spamAction')) { + return false; } - if (function_exists('SEC_createToken')) { - return true; + if (! function_exists('SEC_createToken')) { + return false; } - return false; + return true; } /** diff -r 48f8bb6be77d -r de9415469b9c public_html/docs/history --- a/public_html/docs/history Tue Jan 06 11:26:43 2009 +0100 +++ b/public_html/docs/history Tue Jan 06 11:30:03 2009 +0100 @@ -90,6 +90,10 @@ [Dirk] - Fixed handling of poll IDs in Polls editor (bug #0000753) [Dirk] +Spam-X +------ +- Fixed compatibility check in the plugin install script [Dirk] + Static Pages plugin ------------------- - The owner of a static page changed to the user who last edited it From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:26 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:26 -0500 Subject: [geeklog-cvs] geeklog: Reduce default number of questions per poll and answers... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/5011dba99c14 changeset: 6658:5011dba99c14 user: Dirk Haun date: Tue Jan 06 13:10:01 2009 +0100 description: Reduce default number of questions per poll and answers per question to avoid running into the Suhosin default limit for POST vars diffstat: 2 files changed, 6 insertions(+), 5 deletions(-) plugins/polls/install_defaults.php | 8 +++----- public_html/docs/history | 3 +++ diffs (45 lines): diff -r de9415469b9c -r 5011dba99c14 plugins/polls/install_defaults.php --- a/plugins/polls/install_defaults.php Tue Jan 06 11:30:03 2009 +0100 +++ b/plugins/polls/install_defaults.php Tue Jan 06 13:10:01 2009 +0100 @@ -10,7 +10,7 @@ // | records. These settings are only used during the initial installation | // | and not referenced any more once the plugin is installed. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2008 by the following authors: | +// | Copyright (C) 2009 by the following authors: | // | | // | Authors: Dirk Haun - dirk AT haun-online DOT de | // +---------------------------------------------------------------------------+ @@ -30,8 +30,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: install_defaults.php,v 1.8 2008/09/21 08:37:08 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'install_defaults.php') !== false) { die('This file can not be used on its own!'); @@ -54,8 +52,8 @@ // Set to 1 to hide the "Polls" entry from the top menu: $_PO_DEFAULT['hidepollsmenu'] = 0; -$_PO_DEFAULT['maxquestions'] = 10; // max. number of questions in a poll -$_PO_DEFAULT['maxanswers'] = 10; // max. number of options in a question +$_PO_DEFAULT['maxquestions'] = 5; // max. number of questions in a poll +$_PO_DEFAULT['maxanswers'] = 8; // max. number of options in a question // 'submitorder' is the order in which answers are saved in admin/poll.php // 'voteorder' will list answers ordered by number of votes (highest->lowest); diff -r de9415469b9c -r 5011dba99c14 public_html/docs/history --- a/public_html/docs/history Tue Jan 06 11:30:03 2009 +0100 +++ b/public_html/docs/history Tue Jan 06 13:10:01 2009 +0100 @@ -86,6 +86,9 @@ Polls plugin ------------ +- Lowered the default number of questions per poll to 5 and the number of + answers per question to 8 to avoid running into Suhosin's default + post.max_vars limit (for new installs only) [Dirk] - Fixed SQL error when poll questions contained single quotes (bug #0000756) [Dirk] - Fixed handling of poll IDs in Polls editor (bug #0000753) [Dirk] From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:26 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:26 -0500 Subject: [geeklog-cvs] geeklog: Fixed syntax error Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/68a8051fe997 changeset: 6659:68a8051fe997 user: Dirk Haun date: Tue Jan 06 13:10:56 2009 +0100 description: Fixed syntax error diffstat: 1 file changed, 2 insertions(+), 4 deletions(-) system/lib-story.php | 6 ++---- diffs (30 lines): diff -r 5011dba99c14 -r 68a8051fe997 system/lib-story.php --- a/system/lib-story.php Tue Jan 06 13:10:01 2009 +0100 +++ b/system/lib-story.php Tue Jan 06 13:10:56 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Story-related functions needed in more than one place. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -32,8 +32,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: lib-story.php,v 1.133 2008/09/21 08:37:12 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'lib-story.php') !== false) { die('This file can not be used on its own!'); @@ -727,7 +725,7 @@ if (count ($fields) > 0) { $result = DB_query ("SELECT " . implode (',', $fields) . " FROM {$_TABLES['stories']} WHERE sid = '$sid'" - . ' AND (draft_flag = 0) AND (date <= NOW())'; + . ' AND (draft_flag = 0) AND (date <= NOW())' . COM_getPermSql ('AND') . COM_getTopicSql ('AND')); $A = DB_fetchArray ($result); } else { From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:27 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:27 -0500 Subject: [geeklog-cvs] geeklog: "old_pid" hidden input field was missing from the polls... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6e9a1e838996 changeset: 6660:6e9a1e838996 user: Dirk Haun date: Tue Jan 06 13:32:02 2009 +0100 description: "old_pid" hidden input field was missing from the polls editor template file diffstat: 3 files changed, 13 insertions(+), 4 deletions(-) plugins/polls/templates/admin/polleditor.thtml | 7 ++++++- public_html/admin/plugins/polls/index.php | 7 ++++--- public_html/docs/theme.html | 3 +++ diffs (59 lines): diff -r 68a8051fe997 -r 6e9a1e838996 plugins/polls/templates/admin/polleditor.thtml --- a/plugins/polls/templates/admin/polleditor.thtml Tue Jan 06 13:10:56 2009 +0100 +++ b/plugins/polls/templates/admin/polleditor.thtml Tue Jan 06 13:32:02 2009 +0100 @@ -42,5 +42,10 @@

{lang_permissionskey}

{permissions_editor}

{lang_permissions_msg}

-

{delete_option}

+

+ + {delete_option} + + +

diff -r 68a8051fe997 -r 6e9a1e838996 public_html/admin/plugins/polls/index.php --- a/public_html/admin/plugins/polls/index.php Tue Jan 06 13:10:56 2009 +0100 +++ b/public_html/admin/plugins/polls/index.php Tue Jan 06 13:32:02 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Geeklog poll administration page | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -31,8 +31,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: index.php,v 1.59 2008/06/10 17:26:50 dhaun Exp $ // Set this to true if you want to log debug messages to error.log $_POLL_VERBOSE = false; @@ -559,6 +557,9 @@ if (empty($pid) && !empty($old_pid)) { $pid = $old_pid; } + if (empty($old_pid) && (! empty($pid))) { + $old_pid = $pid; + } if (!empty($pid)) { $statuscode = 0; if (isset ($_POST['statuscode'])) { diff -r 68a8051fe997 -r 6e9a1e838996 public_html/docs/theme.html --- a/public_html/docs/theme.html Tue Jan 06 13:10:56 2009 +0100 +++ b/public_html/docs/theme.html Tue Jan 06 13:32:02 2009 +0100 @@ -217,6 +217,9 @@
  • The {site_admin_url} was missing from the Configuration form action in admin/config/configuration.thtml. This may have caused problems making configuration changes on some setups.
  • +
  • Added a hidden old_pid input field to the polls editor template + file, plugins/polls/templates/admin/polleditor.thtml, to fix + problems when changing a poll's ID.
  • Other changes

    From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:29 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:29 -0500 Subject: [geeklog-cvs] geeklog: Ignore compressed backups Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/9173577ab5f3 changeset: 6661:9173577ab5f3 user: Dirk Haun date: Tue Jan 06 11:14:07 2009 +0100 description: Ignore compressed backups diffstat: 1 file changed, 3 insertions(+) .hgignore | 3 +++ diffs (10 lines): diff -r 0c3b9b147571 -r 9173577ab5f3 .hgignore --- a/.hgignore Tue Jan 06 11:05:43 2009 +0100 +++ b/.hgignore Tue Jan 06 11:14:07 2009 +0100 @@ -17,3 +17,6 @@ syntax: glob backups/*.sql +backups/*.tar.gz +backups/*.tgz +backups/*.zip From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:31 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:31 -0500 Subject: [geeklog-cvs] geeklog: Synced with 1.5.2 Polls fixes Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/ac8cef1d497d changeset: 6662:ac8cef1d497d user: Dirk Haun date: Tue Jan 06 13:38:22 2009 +0100 description: Synced with 1.5.2 Polls fixes diffstat: 2 files changed, 12 insertions(+), 8 deletions(-) public_html/admin/plugins/polls/index.php | 15 ++++++++------- public_html/docs/theme.html | 5 ++++- diffs (69 lines): diff -r 9173577ab5f3 -r ac8cef1d497d public_html/admin/plugins/polls/index.php --- a/public_html/admin/plugins/polls/index.php Tue Jan 06 11:14:07 2009 +0100 +++ b/public_html/admin/plugins/polls/index.php Tue Jan 06 13:38:22 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Polls Plugin 2.0 | +// | Polls Plugin 2.1 | // +---------------------------------------------------------------------------+ // | index.php | // | | // | Geeklog poll administration page | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -31,14 +31,12 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: index.php,v 1.59 2008/06/10 17:26:50 dhaun Exp $ + +require_once '../../../lib-common.php'; +require_once '../../auth.inc.php'; // Set this to true if you want to log debug messages to error.log $_POLL_VERBOSE = false; - -require_once '../../../lib-common.php'; -require_once '../../auth.inc.php'; $display = ''; @@ -559,6 +557,9 @@ if (empty($pid) && !empty($old_pid)) { $pid = $old_pid; } + if (empty($old_pid) && (! empty($pid))) { + $old_pid = $pid; + } if (!empty($pid)) { $statuscode = 0; if (isset ($_POST['statuscode'])) { diff -r 9173577ab5f3 -r ac8cef1d497d public_html/docs/theme.html --- a/public_html/docs/theme.html Tue Jan 06 11:14:07 2009 +0100 +++ b/public_html/docs/theme.html Tue Jan 06 13:38:22 2009 +0100 @@ -221,7 +221,7 @@ -

    Theme changes in Geeklog 1.5.2

    +

    Theme changes in Geeklog 1.5.2

    Note: Themes made for Geeklog 1.5.0 or 1.5.1 should work just fine with Geeklog 1.5.2. In this release, we only fixed a few problems in the themes @@ -243,6 +243,9 @@

  • The {site_admin_url} was missing from the Configuration form action in admin/config/configuration.thtml. This may have caused problems making configuration changes on some setups.
  • +
  • Added a hidden old_pid input field to the polls editor template + file, plugins/polls/templates/admin/polleditor.thtml, to fix + problems when changing a poll's ID.
  • Other changes

    From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:32 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:32 -0500 Subject: [geeklog-cvs] geeklog: Reduce default number of questions per poll and answers... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/4ea7ea065d70 changeset: 6663:4ea7ea065d70 user: Dirk Haun date: Tue Jan 06 13:10:01 2009 +0100 description: Reduce default number of questions per poll and answers per question to avoid running into the Suhosin default limit for POST vars diffstat: 2 files changed, 6 insertions(+), 5 deletions(-) plugins/polls/install_defaults.php | 8 +++----- public_html/docs/history | 3 +++ diffs (45 lines): diff -r ac8cef1d497d -r 4ea7ea065d70 plugins/polls/install_defaults.php --- a/plugins/polls/install_defaults.php Tue Jan 06 13:38:22 2009 +0100 +++ b/plugins/polls/install_defaults.php Tue Jan 06 13:10:01 2009 +0100 @@ -10,7 +10,7 @@ // | records. These settings are only used during the initial installation | // | and not referenced any more once the plugin is installed. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2008 by the following authors: | +// | Copyright (C) 2009 by the following authors: | // | | // | Authors: Dirk Haun - dirk AT haun-online DOT de | // +---------------------------------------------------------------------------+ @@ -30,8 +30,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: install_defaults.php,v 1.8 2008/09/21 08:37:08 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'install_defaults.php') !== false) { die('This file can not be used on its own!'); @@ -54,8 +52,8 @@ // Set to 1 to hide the "Polls" entry from the top menu: $_PO_DEFAULT['hidepollsmenu'] = 0; -$_PO_DEFAULT['maxquestions'] = 10; // max. number of questions in a poll -$_PO_DEFAULT['maxanswers'] = 10; // max. number of options in a question +$_PO_DEFAULT['maxquestions'] = 5; // max. number of questions in a poll +$_PO_DEFAULT['maxanswers'] = 8; // max. number of options in a question // 'submitorder' is the order in which answers are saved in admin/poll.php // 'voteorder' will list answers ordered by number of votes (highest->lowest); diff -r ac8cef1d497d -r 4ea7ea065d70 public_html/docs/history --- a/public_html/docs/history Tue Jan 06 13:38:22 2009 +0100 +++ b/public_html/docs/history Tue Jan 06 13:10:01 2009 +0100 @@ -146,6 +146,9 @@ Polls plugin ------------ +- Lowered the default number of questions per poll to 5 and the number of + answers per question to 8 to avoid running into Suhosin's default + post.max_vars limit (for new installs only) [Dirk] - Fixed SQL error when poll questions contained single quotes (bug #0000756) [Dirk] - Fixed handling of poll IDs in Polls editor (bug #0000753) [Dirk] From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:35 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:35 -0500 Subject: [geeklog-cvs] geeklog: Updated version numbers Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/706481908635 changeset: 6664:706481908635 user: Dirk Haun date: Tue Jan 06 16:10:40 2009 +0100 description: Updated version numbers diffstat: 16 files changed, 68 insertions(+), 53 deletions(-) plugins/calendar/functions.inc | 6 ++---- plugins/links/functions.inc | 6 ++---- plugins/polls/functions.inc | 6 ++---- plugins/spamx/functions.inc | 5 ++--- plugins/staticpages/functions.inc | 6 ++---- public_html/admin/install/index.php | 18 +++++++++++++----- public_html/admin/plugins/calendar/install.php | 6 ++---- public_html/admin/plugins/links/install.php | 6 ++---- public_html/admin/plugins/polls/install.php | 6 ++---- public_html/admin/plugins/spamx/install.php | 2 +- public_html/admin/plugins/staticpages/install.php | 6 ++---- public_html/siteconfig.php.dist | 4 ++-- sql/mssql_tableanddata.php | 10 +++++----- sql/mysql_tableanddata.php | 10 +++++----- sql/updates/mssql_1.5.1_to_1.5.2.php | 12 ++++++++++++ sql/updates/mysql_1.5.1_to_1.5.2.php | 12 ++++++++++++ diffs (truncated from 442 to 300 lines): diff -r 6e9a1e838996 -r 706481908635 plugins/calendar/functions.inc --- a/plugins/calendar/functions.inc Tue Jan 06 13:32:02 2009 +0100 +++ b/plugins/calendar/functions.inc Tue Jan 06 16:10:40 2009 +0100 @@ -10,7 +10,7 @@ // | API method and 2) implements all the common code needed by the CAlendar | // | plugin' PHP files. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Tom Willett - twillett AT users DOT sourceforge DOT net | @@ -33,8 +33,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: functions.inc,v 1.95 2008/09/21 08:37:07 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'functions.inc') !== false) { die('This file can not be used on its own.'); @@ -59,7 +57,7 @@ $_CA_CONF = $ca_config->get_config('calendar'); } -$_CA_CONF['version'] = '1.0.2'; +$_CA_CONF['version'] = '1.0.3'; // +---------------------------------------------------------------------------+ // | Geeklog Plugin API Implementations | diff -r 6e9a1e838996 -r 706481908635 plugins/links/functions.inc --- a/plugins/links/functions.inc Tue Jan 06 13:32:02 2009 +0100 +++ b/plugins/links/functions.inc Tue Jan 06 16:10:40 2009 +0100 @@ -10,7 +10,7 @@ // | API method and 2) implements all the common code needed by the Links | // | Plugins' PHP files. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users.sourceforge DOT net | @@ -35,8 +35,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: functions.inc,v 1.111 2008/09/21 08:37:08 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'functions.inc') !== false) { die('This file can not be used on its own.'); @@ -61,7 +59,7 @@ $_LI_CONF = $li_config->get_config('links'); } -$_LI_CONF['version'] = '2.0.0'; +$_LI_CONF['version'] = '2.0.1'; // +---------------------------------------------------------------------------+ // | Geeklog Plugin API Implementation | diff -r 6e9a1e838996 -r 706481908635 plugins/polls/functions.inc --- a/plugins/polls/functions.inc Tue Jan 06 13:32:02 2009 +0100 +++ b/plugins/polls/functions.inc Tue Jan 06 16:10:40 2009 +0100 @@ -10,7 +10,7 @@ // | API method and 2) implements all the common code needed by the Polls | // | plugin' PHP files. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Tom Willett - twillett AT users DOT sourceforge DOT net | @@ -33,8 +33,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: functions.inc,v 1.92 2008/09/21 08:37:08 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'functions.inc') !== false) { die('This file can not be used on its own.'); @@ -59,7 +57,7 @@ $_PO_CONF = $po_config->get_config('polls'); } -$_PO_CONF['version'] = '2.0.1'; +$_PO_CONF['version'] = '2.0.2'; // +---------------------------------------------------------------------------+ // | Geeklog Plugin API Implementations | diff -r 6e9a1e838996 -r 706481908635 plugins/spamx/functions.inc --- a/plugins/spamx/functions.inc Tue Jan 06 13:32:02 2009 +0100 +++ b/plugins/spamx/functions.inc Tue Jan 06 16:10:40 2009 +0100 @@ -4,13 +4,12 @@ * File: functions.inc * This is the functions.inc for the Geeklog Spam-X plugin * - * Copyright (C) 2004-2008 by the following authors: + * Copyright (C) 2004-2009 by the following authors: * Authors Tom Willett tomw AT pigstye DOT net * Dirk Haun dirk AT haun-online DOT de * * Licensed under GNU General Public License * - * $Id: functions.inc,v 1.37 2008/09/21 08:37:08 dhaun Exp $ */ if (strpos(strtolower($_SERVER['PHP_SELF']), 'functions.inc') !== false) { @@ -39,7 +38,7 @@ $_SPX_CONF = $spx_config->get_config('spamx'); } -$_SPX_CONF['version'] = '1.1.1'; +$_SPX_CONF['version'] = '1.1.2'; // +---------------------------------------------------------------------------+ // | Geeklog Plugin API Implementations | diff -r 6e9a1e838996 -r 706481908635 plugins/staticpages/functions.inc --- a/plugins/staticpages/functions.inc Tue Jan 06 13:32:02 2009 +0100 +++ b/plugins/staticpages/functions.inc Tue Jan 06 16:10:40 2009 +0100 @@ -10,7 +10,7 @@ // | API method and 2) implements all the common code needed by the Static | // | Pages' PHP files. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Tom Willett - twillett AT users DOT sourceforge DOT net | @@ -33,8 +33,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: functions.inc,v 1.127 2008/09/21 08:37:08 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'functions.inc') !== false) { die('This file can not be used on its own.'); @@ -59,7 +57,7 @@ $_SP_CONF = $sp_config->get_config('staticpages'); } -$_SP_CONF['version'] = '1.5.0'; +$_SP_CONF['version'] = '1.5.1'; // +---------------------------------------------------------------------------+ // | Plugin API - Services | diff -r 6e9a1e838996 -r 706481908635 public_html/admin/install/index.php --- a/public_html/admin/install/index.php Tue Jan 06 13:32:02 2009 +0100 +++ b/public_html/admin/install/index.php Tue Jan 06 16:10:40 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Geeklog installation script. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -36,8 +36,6 @@ // | You don't need to change anything in this file. | // | Please read docs/install.html which describes how to install Geeklog. | // +---------------------------------------------------------------------------+ -// -// $Id: index.php,v 1.55 2008/09/06 14:46:24 dhaun Exp $ // this should help expose parse errors even when // display_errors is set to Off in php.ini @@ -50,7 +48,7 @@ define("LB", "\n"); } if (!defined('VERSION')) { - define('VERSION', '1.5.1'); + define('VERSION', '1.5.2'); } if (!defined('XHTML')) { define('XHTML', ' /'); @@ -588,7 +586,7 @@ . '

    ' . $LANG_INSTALL[91] . '

    '; } else { - $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','1.3.7','1.3.8','1.3.9','1.3.10','1.3.11','1.4.0','1.4.1','1.5.0'); + $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','1.3.7','1.3.8','1.3.9','1.3.10','1.3.11','1.4.0','1.4.1','1.5.0','1.5.1'); if (empty($curv)) { // If we were unable to determine the current GL // version is then ask the user what it is @@ -944,6 +942,7 @@ case 'mysql': $test = array( + '1.5.2' => array("SELECT value FROM {$_TABLES['vars']} WHERE name = 'database_version'", '1.5.2'), '1.5.1' => array("SELECT name FROM {$_TABLES['vars']} WHERE name = 'database_version'", 'database_version'), '1.5.0' => array("DESCRIBE {$_TABLES['storysubmission']} bodytext",''), '1.4.1' => array("SELECT ft_name FROM {$_TABLES['features']} WHERE ft_name = 'syndication.edit'", 'syndication.edit'), @@ -966,6 +965,7 @@ case 'mssql': $test = array( + '1.5.2' => array("SELECT value FROM {$_TABLES['vars']} WHERE name = 'database_version'", '1.5.2'), '1.5.1' => array("SELECT name FROM {$_TABLES['vars']} WHERE name = 'database_version'", 'database_version'), '1.5.0' => array("SELECT c.name FROM syscolumns c JOIN sysobjects o ON o.id = c.id WHERE c.name='bodytext' AND o.name='{$_TABLES['storysubmission']}'",'bodytext'), '1.4.1' => array("SELECT ft_name FROM {$_TABLES['features']} WHERE ft_name = 'syndication.edit'", 'syndication.edit') @@ -1643,6 +1643,14 @@ $_SQL = ''; break; + case '1.5.1': + require_once $_CONF['path'] . 'sql/updates/' . $_DB_dbms . '_1.5.1_to_1.5.2.php'; + INST_updateDB($_SQL); + + $current_gl_version = '1.5.2'; + $_SQL = ''; + break; + default: $done = true; } diff -r 6e9a1e838996 -r 706481908635 public_html/admin/plugins/calendar/install.php --- a/public_html/admin/plugins/calendar/install.php Tue Jan 06 13:32:02 2009 +0100 +++ b/public_html/admin/plugins/calendar/install.php Tue Jan 06 16:10:40 2009 +0100 @@ -11,7 +11,7 @@ // +---------------------------------------------------------------------------+ // | Based on the Universal Plugin and prior work by the following authors: | // | | -// | Copyright (C) 2002-2008 by the following authors: | +// | Copyright (C) 2002-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Tom Willett - tom AT pigstye DOT net | @@ -35,8 +35,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: install.php,v 1.15 2008/05/23 13:36:12 dhaun Exp $ require_once '../../../lib-common.php'; @@ -46,7 +44,7 @@ // $pi_display_name = 'Calendar'; $pi_name = 'calendar'; -$pi_version = '1.0.2'; +$pi_version = '1.0.3'; $gl_version = '1.5.0'; $pi_url = 'http://www.geeklog.net/'; diff -r 6e9a1e838996 -r 706481908635 public_html/admin/plugins/links/install.php --- a/public_html/admin/plugins/links/install.php Tue Jan 06 13:32:02 2009 +0100 +++ b/public_html/admin/plugins/links/install.php Tue Jan 06 16:10:40 2009 +0100 @@ -11,7 +11,7 @@ // +---------------------------------------------------------------------------+ // | Based on the Universal Plugin and prior work by the following authors: | // | | -// | Copyright (C) 2002-2008 by the following authors: | +// | Copyright (C) 2002-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Tom Willett - tom AT pigstye DOT net | @@ -37,8 +37,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: install.php,v 1.26 2008/05/23 13:36:12 dhaun Exp $ require_once '../../../lib-common.php'; @@ -48,7 +46,7 @@ // $pi_display_name = 'Links'; $pi_name = 'links'; -$pi_version = '2.0.0'; +$pi_version = '2.0.1'; $gl_version = '1.5.0'; $pi_url = 'http://www.geeklog.net/'; diff -r 6e9a1e838996 -r 706481908635 public_html/admin/plugins/polls/install.php --- a/public_html/admin/plugins/polls/install.php Tue Jan 06 13:32:02 2009 +0100 +++ b/public_html/admin/plugins/polls/install.php Tue Jan 06 16:10:40 2009 +0100 @@ -11,7 +11,7 @@ // +---------------------------------------------------------------------------+ // | Based on the Universal Plugin and prior work by the following authors: | // | | -// | Copyright (C) 2002-2008 by the following authors: | +// | Copyright (C) 2002-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Tom Willett - tom AT pigstye DOT net | @@ -35,8 +35,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: install.php,v 1.24 2008/05/23 13:36:12 dhaun Exp $ require_once '../../../lib-common.php'; @@ -46,7 +44,7 @@ // From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:36 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:36 -0500 Subject: [geeklog-cvs] geeklog: Retrofitted 1.5.2 updates Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/8817f62abd8a changeset: 6665:8817f62abd8a user: Dirk Haun date: Tue Jan 06 16:27:45 2009 +0100 description: Retrofitted 1.5.2 updates diffstat: 9 files changed, 71 insertions(+), 38 deletions(-) public_html/admin/install/index.php | 2 +- public_html/admin/install/lib-upgrade.php | 13 +++++++++++-- public_html/siteconfig.php.dist | 2 +- sql/updates/mssql_1.5.1_to_1.5.2.php | 12 ++++++++++++ sql/updates/mssql_1.5.1_to_1.6.0.php | 17 ----------------- sql/updates/mssql_1.5.2_to_1.6.0.php | 17 +++++++++++++++++ sql/updates/mysql_1.5.1_to_1.5.2.php | 12 ++++++++++++ sql/updates/mysql_1.5.1_to_1.6.0.php | 17 ----------------- sql/updates/mysql_1.5.2_to_1.6.0.php | 17 +++++++++++++++++ diffs (177 lines): diff -r 4ea7ea065d70 -r 8817f62abd8a public_html/admin/install/index.php --- a/public_html/admin/install/index.php Tue Jan 06 13:10:01 2009 +0100 +++ b/public_html/admin/install/index.php Tue Jan 06 16:27:45 2009 +0100 @@ -339,7 +339,7 @@ . '

    ' . $LANG_INSTALL[91] . '

    '; } else { - $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','1.3.7','1.3.8','1.3.9','1.3.10','1.3.11','1.4.0','1.4.1','1.5.0','1.5.1'); + $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','1.3.7','1.3.8','1.3.9','1.3.10','1.3.11','1.4.0','1.4.1','1.5.0','1.5.1','1.5.2'); if (empty($curv)) { // If we were unable to determine the current GL // version is then ask the user what it is diff -r 4ea7ea065d70 -r 8817f62abd8a public_html/admin/install/lib-upgrade.php --- a/public_html/admin/install/lib-upgrade.php Tue Jan 06 13:10:01 2009 +0100 +++ b/public_html/admin/install/lib-upgrade.php Tue Jan 06 16:27:45 2009 +0100 @@ -452,8 +452,15 @@ break; case '1.5.1': - case '1.5.2': // TBD - require_once $_CONF['path'] . 'sql/updates/' . $_DB_dbms . '_1.5.1_to_1.6.0.php'; + require_once $_CONF['path'] . 'sql/updates/' . $_DB_dbms . '_1.5.1_to_1.5.2.php'; + INST_updateDB($_SQL); + + $current_gl_version = '1.5.2'; + $_SQL = ''; + break; + + case '1.5.2': + require_once $_CONF['path'] . 'sql/updates/' . $_DB_dbms . '_1.5.2_to_1.6.0.php'; update_ConfValues(); @@ -504,6 +511,7 @@ case 'mysql': $test = array( + '1.5.2' => array("SELECT value FROM {$_TABLES['vars']} WHERE name = 'database_version'", '1.5.2'), '1.5.1' => array("SELECT name FROM {$_TABLES['vars']} WHERE name = 'database_version'", 'database_version'), '1.5.0' => array("DESCRIBE {$_TABLES['storysubmission']} bodytext",''), '1.4.1' => array("SELECT ft_name FROM {$_TABLES['features']} WHERE ft_name = 'syndication.edit'", 'syndication.edit'), @@ -526,6 +534,7 @@ case 'mssql': $test = array( + '1.5.2' => array("SELECT value FROM {$_TABLES['vars']} WHERE name = 'database_version'", '1.5.2'), '1.5.1' => array("SELECT name FROM {$_TABLES['vars']} WHERE name = 'database_version'", 'database_version'), '1.5.0' => array("SELECT c.name FROM syscolumns c JOIN sysobjects o ON o.id = c.id WHERE c.name='bodytext' AND o.name='{$_TABLES['storysubmission']}'",'bodytext'), '1.4.1' => array("SELECT ft_name FROM {$_TABLES['features']} WHERE ft_name = 'syndication.edit'", 'syndication.edit') diff -r 4ea7ea065d70 -r 8817f62abd8a public_html/siteconfig.php.dist --- a/public_html/siteconfig.php.dist Tue Jan 06 13:10:01 2009 +0100 +++ b/public_html/siteconfig.php.dist Tue Jan 06 16:27:45 2009 +0100 @@ -20,7 +20,7 @@ // If you have errors on your site, can't login, or can't get to the // config UI, then you can comment this in to set the root debug option // on and get detailed error messages. You can set this to 'force' (which the -// Config UI won't allow you to do, to override hiding of password and cookie +// Config UI won't allow you to do) to override hiding of password and cookie // items in the debug trace. // $_CONF['rootdebug'] = true; diff -r 4ea7ea065d70 -r 8817f62abd8a sql/updates/mssql_1.5.1_to_1.5.2.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sql/updates/mssql_1.5.1_to_1.5.2.php Tue Jan 06 16:27:45 2009 +0100 @@ -0,0 +1,12 @@ + diff -r 4ea7ea065d70 -r 8817f62abd8a sql/updates/mssql_1.5.1_to_1.6.0.php --- a/sql/updates/mssql_1.5.1_to_1.6.0.php Tue Jan 06 13:10:01 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); - - return true; -} - -?> diff -r 4ea7ea065d70 -r 8817f62abd8a sql/updates/mssql_1.5.2_to_1.6.0.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sql/updates/mssql_1.5.2_to_1.6.0.php Tue Jan 06 16:27:45 2009 +0100 @@ -0,0 +1,17 @@ +add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); + + return true; +} + +?> diff -r 4ea7ea065d70 -r 8817f62abd8a sql/updates/mysql_1.5.1_to_1.5.2.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sql/updates/mysql_1.5.1_to_1.5.2.php Tue Jan 06 16:27:45 2009 +0100 @@ -0,0 +1,12 @@ + diff -r 4ea7ea065d70 -r 8817f62abd8a sql/updates/mysql_1.5.1_to_1.6.0.php --- a/sql/updates/mysql_1.5.1_to_1.6.0.php Tue Jan 06 13:10:01 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ -add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); - - return true; -} - -?> diff -r 4ea7ea065d70 -r 8817f62abd8a sql/updates/mysql_1.5.2_to_1.6.0.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sql/updates/mysql_1.5.2_to_1.6.0.php Tue Jan 06 16:27:45 2009 +0100 @@ -0,0 +1,17 @@ +add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); + + return true; +} + +?> From geeklog-cvs at lists.geeklog.net Wed Jan 7 03:53:36 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 07 Jan 2009 03:53:36 -0500 Subject: [geeklog-cvs] geeklog: Changed logic for the auto-detect of table prefix to ha... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6150014cda16 changeset: 6666:6150014cda16 user: Dirk Haun date: Tue Jan 06 17:32:41 2009 +0100 description: Changed logic for the auto-detect of table prefix to handle old-style mysqldump backups diffstat: 1 file changed, 9 insertions(+), 3 deletions(-) public_html/admin/install/migrate.php | 12 +++++++++--- diffs (29 lines): diff -r 8817f62abd8a -r 6150014cda16 public_html/admin/install/migrate.php --- a/public_html/admin/install/migrate.php Tue Jan 06 16:27:45 2009 +0100 +++ b/public_html/admin/install/migrate.php Tue Jan 06 17:32:41 2009 +0100 @@ -542,6 +542,7 @@ // Parse the .sql file to grab the table prefix $has_config = false; $num_create = 0; + $DB['table_prefix'] = ''; $sql_file = @fopen($backup_dir . $backup_file, 'r'); if (! $sql_file) { @@ -554,9 +555,14 @@ if (preg_match('/CREATE TABLE/i', $line)) { $num_create++; $line = trim($line); - if (strpos($line, 'access`') !== false) { - $DB['table_prefix'] = preg_replace('/^.*`/', '', - preg_replace('/access`.*$/', '', $line)); + if (strpos($line, 'access') !== false) { + $words = explode(' ', $line); + if (count($words) >= 3) { + $table = str_replace('`', '', $words[2]); + if (substr($table, -6) == 'access') { + $DB['table_prefix'] = substr($table, 0, -6); + } + } } elseif (strpos($line, 'conf_values') !== false) { $has_config = true; break; From geeklog-cvs at lists.geeklog.net Mon Jan 12 04:22:39 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 12 Jan 2009 04:22:39 -0500 Subject: [geeklog-cvs] geeklog: Fixed wrong use of str_replace in STORY_extractLinks (b... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/c6b2b2c6335a changeset: 6667:c6b2b2c6335a user: Dirk Haun date: Sat Jan 10 10:15:58 2009 +0100 description: Fixed wrong use of str_replace in STORY_extractLinks (bug #0000794) diffstat: 2 files changed, 2 insertions(+), 1 deletion(-) public_html/docs/history | 1 + system/lib-story.php | 2 +- diffs (23 lines): diff -r 706481908635 -r c6b2b2c6335a public_html/docs/history --- a/public_html/docs/history Tue Jan 06 16:10:40 2009 +0100 +++ b/public_html/docs/history Sat Jan 10 10:15:58 2009 +0100 @@ -3,6 +3,7 @@ Jan ??, 2009 (1.5.2) ------------ +- Fixed wrong use of str_replace in STORY_extractLinks (bug #0000794) [Dirk] - Added "Send Pings" to the Story Options block (if enabled and allowed for the current user) [Dirk] - Don't let the user enable plugins when there's no functions.inc for the diff -r 706481908635 -r c6b2b2c6335a system/lib-story.php --- a/system/lib-story.php Tue Jan 06 16:10:40 2009 +0100 +++ b/system/lib-story.php Sat Jan 10 10:15:58 2009 +0100 @@ -573,7 +573,7 @@ } $rel[] = '' - . str_replace ("/(\015\012)|(\015)|(\012)/", '', $matches[2][$i]) + . str_replace(array("\015", "\012"), '', $matches[2][$i]) . ''; } From geeklog-cvs at lists.geeklog.net Mon Jan 12 04:22:40 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 12 Jan 2009 04:22:40 -0500 Subject: [geeklog-cvs] geeklog: Fixed wrong use of str_replace in STORY_extractLinks (b... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/bcb391cc856b changeset: 6668:bcb391cc856b user: Dirk Haun date: Sat Jan 10 10:15:58 2009 +0100 description: Fixed wrong use of str_replace in STORY_extractLinks (bug #0000794) diffstat: 2 files changed, 2 insertions(+), 1 deletion(-) public_html/docs/history | 1 + system/lib-story.php | 2 +- diffs (23 lines): diff -r 6150014cda16 -r bcb391cc856b public_html/docs/history --- a/public_html/docs/history Tue Jan 06 17:32:41 2009 +0100 +++ b/public_html/docs/history Sat Jan 10 10:15:58 2009 +0100 @@ -63,6 +63,7 @@ Jan ??, 2009 (1.5.2) ------------ +- Fixed wrong use of str_replace in STORY_extractLinks (bug #0000794) [Dirk] - Added "Send Pings" to the Story Options block (if enabled and allowed for the current user) [Dirk] - Don't let the user enable plugins when there's no functions.inc for the diff -r 6150014cda16 -r bcb391cc856b system/lib-story.php --- a/system/lib-story.php Tue Jan 06 17:32:41 2009 +0100 +++ b/system/lib-story.php Sat Jan 10 10:15:58 2009 +0100 @@ -573,7 +573,7 @@ } $rel[] = '' - . str_replace ("/(\015\012)|(\015)|(\012)/", '', $matches[2][$i]) + . str_replace(array("\015", "\012"), '', $matches[2][$i]) . ''; } From geeklog-cvs at lists.geeklog.net Mon Jan 12 04:22:41 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 12 Jan 2009 04:22:41 -0500 Subject: [geeklog-cvs] geeklog: Avoid using preg_replace where str_replace is sufficien... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/ea5e93e5bb47 changeset: 6669:ea5e93e5bb47 user: Dirk Haun date: Sat Jan 10 10:29:04 2009 +0100 description: Avoid using preg_replace where str_replace is sufficient (cf. bug #0000794) diffstat: 4 files changed, 19 insertions(+), 24 deletions(-) public_html/lib-common.php | 11 +++++------ sql/updates/mysql_1.3.9_to_1.3.10.php | 2 +- system/lib-syndication.php | 22 ++++++++++------------ system/lib-trackback.php | 8 +++----- diffs (156 lines): diff -r bcb391cc856b -r ea5e93e5bb47 public_html/lib-common.php --- a/public_html/lib-common.php Sat Jan 10 10:15:58 2009 +0100 +++ b/public_html/lib-common.php Sat Jan 10 10:29:04 2009 +0100 @@ -3283,9 +3283,8 @@ { if( $day != 'noday' ) { - $daylist = COM_makeList( $oldnews, 'list-older-stories' ); - $daylist = preg_replace( "/(\015\012)|(\015)|(\012)/", - '', $daylist ); + $daylist = COM_makeList($oldnews, 'list-older-stories'); + $daylist = str_replace(array("\015", "\012"), '', $daylist); $string .= $daylist . ''; } @@ -3304,8 +3303,8 @@ if( !empty( $oldnews )) { - $daylist = COM_makeList( $oldnews, 'list-older-stories' ); - $daylist = preg_replace( "/(\015\012)|(\015)|(\012)/", '', $daylist ); + $daylist = COM_makeList($oldnews, 'list-older-stories'); + $daylist = str_replace(array("\015", "\012"), '', $daylist); $string .= $daylist; $string = addslashes( $string ); @@ -3759,7 +3758,7 @@ // build a list $content = COM_makeList($articles, 'list-feed'); - $content = preg_replace("/(\015\012)|(\015)|(\012)/", '', $content); + $content = str_replace(array("\015", "\012"), '', $content); if (strlen($content) > 65000) { $content = $LANG21[68]; diff -r bcb391cc856b -r ea5e93e5bb47 sql/updates/mysql_1.3.9_to_1.3.10.php --- a/sql/updates/mysql_1.3.9_to_1.3.10.php Sat Jan 10 10:15:58 2009 +0100 +++ b/sql/updates/mysql_1.3.9_to_1.3.10.php Sat Jan 10 10:29:04 2009 +0100 @@ -111,7 +111,7 @@ } $rel[] = '' - . str_replace ("/(\015\012)|(\015)|(\012)/", '', $matches[2][$i]) + . str_replace(array("\015", "\012"), '', $matches[2][$i]) . ''; } diff -r bcb391cc856b -r ea5e93e5bb47 system/lib-syndication.php --- a/system/lib-syndication.php Sat Jan 10 10:15:58 2009 +0100 +++ b/system/lib-syndication.php Sat Jan 10 10:29:04 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | lib-syndication.php | // | | // | Geeklog syndication library. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2003-2008 by the following authors: | +// | Copyright (C) 2003-2009 by the following authors: | // | | // | Authors: Dirk Haun - dirk AT haun-online DOT de | // | Michael Jervis - mike AT fuckingbrit DOT com | @@ -29,11 +29,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: lib-syndication.php,v 1.45 2008/09/21 08:37:12 dhaun Exp $ - -// set to true to enable debug output in error.log -$_SYND_DEBUG = false; if (strpos(strtolower($_SERVER['PHP_SELF']), 'lib-syndication.php') !== false) { die('This file can not be used on its own!'); @@ -42,6 +37,9 @@ if ($_CONF['trackback_enabled']) { require_once $_CONF['path_system'] . 'lib-trackback.php'; } + +// set to true to enable debug output in error.log +$_SYND_DEBUG = false; /** * Check if a feed for all stories needs to be updated. @@ -270,8 +268,8 @@ $storytext = SYND_truncateSummary( $fulltext, $contentLength ); $fulltext = trim( $fulltext ); - $fulltext = preg_replace( "/(\015)/", "", $fulltext ); - + $fulltext = str_replace("\015", '', $fulltext); + if( $row['postmode'] == 'plaintext' ) { if( !empty($storytext) ) @@ -393,8 +391,8 @@ $fulltext = PLG_replaceTags( $fulltext ); $storytext = SYND_truncateSummary( $fulltext, $contentLength ); $fulltext = trim( $fulltext ); - $fulltext = preg_replace( "/(\015)/", "", $fulltext ); - + $fulltext = str_replace("\015", '', $fulltext); + if( $row['postmode'] == 'plaintext' ) { if( !empty($storytext) ) @@ -622,7 +620,7 @@ { $text = stripslashes( $text ); $text = trim( $text ); - $text = preg_replace( "/(\015)/", "", $text ); + $text = str_replace("\015", '', $text); if(( $length > 3 ) && ( MBYTE_strlen( $text ) > $length )) { $text = substr( $text, 0, $length - 3 ) . '...'; diff -r bcb391cc856b -r ea5e93e5bb47 system/lib-trackback.php --- a/system/lib-trackback.php Sat Jan 10 10:15:58 2009 +0100 +++ b/system/lib-trackback.php Sat Jan 10 10:29:04 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | lib-trackback.php | // | | // | Functions needed to handle trackback comments. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2005-2008 by the following authors: | +// | Copyright (C) 2005-2009 by the following authors: | // | | // | Author: Dirk Haun - dirk AT haun-online DOT de | // +---------------------------------------------------------------------------+ @@ -28,8 +28,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: lib-trackback.php,v 1.52 2008/09/21 08:37:12 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'lib-trackback.php') !== false) { die('This file can not be used on its own!'); @@ -861,7 +859,7 @@ // no luck with the RDF? try searching for a rel="trackback" link if ($retval === false) { // remove all linefeeds first to help the regexp below - $page = preg_replace( "/(\015\012)|(\015)|(\012)/", '', $page); + $page = str_replace(array("\015", "\012"), '', $page); preg_match_all( "/]*href=[\"']([^\"']*)[\"'][^>]*>(.*?)<\/a>/i", $page, $matches ); for ($i = 0; $i < count ($matches[0]); $i++) { From geeklog-cvs at lists.geeklog.net Mon Jan 12 04:22:41 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 12 Jan 2009 04:22:41 -0500 Subject: [geeklog-cvs] geeklog: Also fix wrong use of str_replace in this old update fi... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/30227a2b8203 changeset: 6670:30227a2b8203 user: Dirk Haun date: Sat Jan 10 10:30:24 2009 +0100 description: Also fix wrong use of str_replace in this old update file (cf. bug #0000794) diffstat: 1 file changed, 1 insertion(+), 1 deletion(-) sql/updates/mysql_1.3.9_to_1.3.10.php | 2 +- diffs (12 lines): diff -r c6b2b2c6335a -r 30227a2b8203 sql/updates/mysql_1.3.9_to_1.3.10.php --- a/sql/updates/mysql_1.3.9_to_1.3.10.php Sat Jan 10 10:15:58 2009 +0100 +++ b/sql/updates/mysql_1.3.9_to_1.3.10.php Sat Jan 10 10:30:24 2009 +0100 @@ -111,7 +111,7 @@ } $rel[] = '' - . str_replace ("/(\015\012)|(\015)|(\012)/", '', $matches[2][$i]) + . str_replace(array("\015", "\012"), '', $matches[2][$i]) . ''; } From geeklog-cvs at lists.geeklog.net Mon Jan 12 04:22:42 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 12 Jan 2009 04:22:42 -0500 Subject: [geeklog-cvs] geeklog: Since BigDump has to skip the /*! lines, we need to tak... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/1dbd8d39fbd2 changeset: 6671:1dbd8d39fbd2 user: Dirk Haun date: Sat Jan 10 15:51:48 2009 +0100 description: Since BigDump has to skip the /*! lines, we need to take care of utf8 ourselves diffstat: 2 files changed, 12 insertions(+), 3 deletions(-) public_html/admin/install/bigdump.php | 9 ++++++--- public_html/admin/install/migrate.php | 6 ++++++ diffs (64 lines): diff -r ea5e93e5bb47 -r 1dbd8d39fbd2 public_html/admin/install/bigdump.php --- a/public_html/admin/install/bigdump.php Sat Jan 10 10:29:04 2009 +0100 +++ b/public_html/admin/install/bigdump.php Sat Jan 10 15:51:48 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Staggered import for large MySQL Dumps | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2008 by the following authors: | +// | Copyright (C) 2008-2009 by the following authors: | // | | // | Authors: Alexey Ozerov - alexey AT ozerov DOT de (BigDump author) | // | Matt West - matt.danger.west AT gmail DOT com | @@ -72,6 +72,9 @@ // Connection character set should be the same as the dump file character set (utf8, latin1, cp1251, koi8r etc.) // See http://dev.mysql.com/doc/refman/5.0/en/charset-charsets.html for the full list $db_connection_charset = ''; +if (isset($_REQUEST['db_connection_charset'])) { + $db_connection_charset = preg_replace('/[^a-z0-9\-_]/', '', $_REQUEST['db_connection_charset']); +} // ******************************************************************************************* // If not familiar with PHP please don't change anything below this line @@ -369,9 +372,9 @@ // Go to the next step echo '' . LB + . urlencode($curfilename) . '&foffset=' . $foffset . '&totalqueries=' . $totalqueries . '&db_connection_charset=' . $db_connection_charset . '&language=' . $language . '&site_url=' . $site_url . '&site_admin_url=' . $site_admin_url . '";\',500+' . $delaypersession . ');' . LB . '' . LB . '

    ' . $LANG_BIGDUMP[26] . ' ' . $LANG_BIGDUMP[27] . ' ' . $LANG_BIGDUMP[28] . '

    ' . LB; } diff -r ea5e93e5bb47 -r 1dbd8d39fbd2 public_html/admin/install/migrate.php --- a/public_html/admin/install/migrate.php Sat Jan 10 10:29:04 2009 +0100 +++ b/public_html/admin/install/migrate.php Sat Jan 10 15:51:48 2009 +0100 @@ -542,6 +542,7 @@ // Parse the .sql file to grab the table prefix $has_config = false; $num_create = 0; + $db_connection_charset = ''; $DB['table_prefix'] = ''; $sql_file = @fopen($backup_dir . $backup_file, 'r'); @@ -570,6 +571,10 @@ // assume there's no conf_values table in here break; } + } elseif (substr($line, 0, 3) == '/*!') { + if (strpos($line, 'SET NAMES utf8') !== false) { + $db_connection_charset = 'utf8'; + } } } } @@ -589,6 +594,7 @@ // Send file to bigdump.php script to do the import. header('Location: bigdump.php?start=1&foffset=0&totalqueries=0' + . '&db_connection_charset=' . $db_connection_charset . '&language=' . $language . '&fn=' . urlencode($backup_dir . $backup_file) . '&site_url=' . urlencode($_REQUEST['site_url']) From geeklog-cvs at lists.geeklog.net Mon Jan 12 04:22:43 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 12 Jan 2009 04:22:43 -0500 Subject: [geeklog-cvs] geeklog: Fixed story preview losing the story when the sid alrea... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/fba25bb560d1 changeset: 6672:fba25bb560d1 user: Dirk Haun date: Sat Jan 10 19:10:20 2009 +0100 description: Fixed story preview losing the story when the sid already existed (bug #0000789). Reason: Duplicate values for different errors - re-numbered STORY_xxx errors. diffstat: 3 files changed, 22 insertions(+), 19 deletions(-) public_html/admin/story.php | 8 +++----- public_html/docs/history | 2 ++ system/classes/story.class.php | 31 +++++++++++++++++-------------- diffs (138 lines): diff -r 30227a2b8203 -r fba25bb560d1 public_html/admin/story.php --- a/public_html/admin/story.php Sat Jan 10 10:30:24 2009 +0100 +++ b/public_html/admin/story.php Sat Jan 10 19:10:20 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Geeklog story administration page. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -31,8 +31,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: story.php,v 1.270 2008/09/13 07:26:43 mjervis Exp $ /** * This is the Geeklog story administration page. @@ -293,7 +291,7 @@ return COM_refresh( $_CONF['site_admin_url'] . '/story.php' ); } } elseif( $result == STORY_DUPLICATE_SID) { - $display .= COM_errorLog ($LANG24[24], 2); + $display .= COM_showMessageText($LANG24[24]); } // Load HTML templates @@ -340,7 +338,7 @@ if ($advanced_editormode AND $previewContent != '' ) { $story_templates->set_var('preview_content', $previewContent); } elseif ($previewContent != '') { - $display = COM_startBlock ($LANG24[26], '', + $display .= COM_startBlock ($LANG24[26], '', COM_getBlockTemplate ('_admin_block', 'header')); $display .= $previewContent; $display .= COM_endBlock (COM_getBlockTemplate ('_admin_block', 'footer')); diff -r 30227a2b8203 -r fba25bb560d1 public_html/docs/history --- a/public_html/docs/history Sat Jan 10 10:30:24 2009 +0100 +++ b/public_html/docs/history Sat Jan 10 19:10:20 2009 +0100 @@ -3,6 +3,8 @@ Jan ??, 2009 (1.5.2) ------------ +- Fixed story preview losing the story when the sid already existed (bug + #0000789) [Dirk] - Fixed wrong use of str_replace in STORY_extractLinks (bug #0000794) [Dirk] - Added "Send Pings" to the Story Options block (if enabled and allowed for the current user) [Dirk] diff -r 30227a2b8203 -r fba25bb560d1 system/classes/story.class.php --- a/system/classes/story.class.php Sat Jan 10 10:30:24 2009 +0100 +++ b/system/classes/story.class.php Sat Jan 10 19:10:20 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Geeklog Story Abstraction. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2006-2008 by the following authors: | +// | Copyright (C) 2006-2009 by the following authors: | // | | // | Authors: Michael Jervis, mike AT fuckingbrit DOT com | // +---------------------------------------------------------------------------+ @@ -28,8 +28,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: story.class.php,v 1.36 2008/08/16 18:07:09 dhaun Exp $ /** * This file provides a class to represent a story, or article. It provides a @@ -53,26 +51,28 @@ * Constants for stories: * Loading from database: */ +define('STORY_LOADED_OK', 1); + define('STORY_INVALID_SID', -1); - define('STORY_PERMISSION_DENIED', -2); define('STORY_EDIT_DENIED', -3); -define('STORY_LOADED_OK', 1); + /** * Constants for Stories: * Saving to database */ -define('STORY_SAVED', 1); -define('STORY_SAVED_SUBMISSION', 2); +define('STORY_SAVED', 2); +define('STORY_SAVED_SUBMISSION', 3); + /** * Constants for Stories: * Loading from request. */ -define('STORY_DUPLICATE_SID', -1); -define('STORY_EXISTING_NO_EDIT_PERMISSION', -2); -define('STORY_NO_ACCESS_PARAMS', -3); -define('STORY_EMPTY_REQUIRED_FIELDS', -4); -define('STORY_NO_ACCESS_TOPIC', -5); +define('STORY_DUPLICATE_SID', -4); +define('STORY_EXISTING_NO_EDIT_PERMISSION', -5); +define('STORY_NO_ACCESS_PARAMS', -6); +define('STORY_EMPTY_REQUIRED_FIELDS', -7); +define('STORY_NO_ACCESS_TOPIC', -8); /** * Constants for our magic loader @@ -688,6 +688,8 @@ * /public_html/admin/story.php */ + $retval = STORY_LOADED_OK; // default to success + /* Load the trivial stuff: */ $this->_loadBasics($array); @@ -702,7 +704,8 @@ if ($result && (DB_numRows($result) > 0)) { /* Sid exists! Is it our article? */ if ($this->_sid != $this->_originalSid) { - return STORY_DUPLICATE_SID; + // for story preview: don't abort + $retval = STORY_DUPLICATE_SID; } $article = DB_fetchArray($result); @@ -752,7 +755,7 @@ $this->_sanitizeData(); - return STORY_LOADED_OK; + return $retval; } /** From geeklog-cvs at lists.geeklog.net Mon Jan 12 04:22:44 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 12 Jan 2009 04:22:44 -0500 Subject: [geeklog-cvs] geeklog: Fixed story preview losing the story when the sid alrea... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/aa686f7bdc05 changeset: 6673:aa686f7bdc05 user: Dirk Haun date: Sat Jan 10 19:10:20 2009 +0100 description: Fixed story preview losing the story when the sid already existed (bug #0000789). Reason: Duplicate values for different errors - re-numbered STORY_xxx errors. diffstat: 3 files changed, 22 insertions(+), 19 deletions(-) public_html/admin/story.php | 8 +++----- public_html/docs/history | 2 ++ system/classes/story.class.php | 31 +++++++++++++++++-------------- diffs (138 lines): diff -r 1dbd8d39fbd2 -r aa686f7bdc05 public_html/admin/story.php --- a/public_html/admin/story.php Sat Jan 10 15:51:48 2009 +0100 +++ b/public_html/admin/story.php Sat Jan 10 19:10:20 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Geeklog story administration page. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -31,8 +31,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: story.php,v 1.270 2008/09/13 07:26:43 mjervis Exp $ /** * This is the Geeklog story administration page. @@ -297,7 +295,7 @@ return COM_refresh( $_CONF['site_admin_url'] . '/story.php' ); } } elseif( $result == STORY_DUPLICATE_SID) { - $display .= COM_errorLog ($LANG24[24], 2); + $display .= COM_showMessageText($LANG24[24]); } // Load HTML templates @@ -344,7 +342,7 @@ if ($advanced_editormode AND $previewContent != '' ) { $story_templates->set_var('preview_content', $previewContent); } elseif ($previewContent != '') { - $display = COM_startBlock ($LANG24[26], '', + $display .= COM_startBlock ($LANG24[26], '', COM_getBlockTemplate ('_admin_block', 'header')); $display .= $previewContent; $display .= COM_endBlock (COM_getBlockTemplate ('_admin_block', 'footer')); diff -r 1dbd8d39fbd2 -r aa686f7bdc05 public_html/docs/history --- a/public_html/docs/history Sat Jan 10 15:51:48 2009 +0100 +++ b/public_html/docs/history Sat Jan 10 19:10:20 2009 +0100 @@ -63,6 +63,8 @@ Jan ??, 2009 (1.5.2) ------------ +- Fixed story preview losing the story when the sid already existed (bug + #0000789) [Dirk] - Fixed wrong use of str_replace in STORY_extractLinks (bug #0000794) [Dirk] - Added "Send Pings" to the Story Options block (if enabled and allowed for the current user) [Dirk] diff -r 1dbd8d39fbd2 -r aa686f7bdc05 system/classes/story.class.php --- a/system/classes/story.class.php Sat Jan 10 15:51:48 2009 +0100 +++ b/system/classes/story.class.php Sat Jan 10 19:10:20 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Geeklog Story Abstraction. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2006-2008 by the following authors: | +// | Copyright (C) 2006-2009 by the following authors: | // | | // | Authors: Michael Jervis, mike AT fuckingbrit DOT com | // +---------------------------------------------------------------------------+ @@ -28,8 +28,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: story.class.php,v 1.36 2008/08/16 18:07:09 dhaun Exp $ /** * This file provides a class to represent a story, or article. It provides a @@ -53,26 +51,28 @@ * Constants for stories: * Loading from database: */ +define('STORY_LOADED_OK', 1); + define('STORY_INVALID_SID', -1); - define('STORY_PERMISSION_DENIED', -2); define('STORY_EDIT_DENIED', -3); -define('STORY_LOADED_OK', 1); + /** * Constants for Stories: * Saving to database */ -define('STORY_SAVED', 1); -define('STORY_SAVED_SUBMISSION', 2); +define('STORY_SAVED', 2); +define('STORY_SAVED_SUBMISSION', 3); + /** * Constants for Stories: * Loading from request. */ -define('STORY_DUPLICATE_SID', -1); -define('STORY_EXISTING_NO_EDIT_PERMISSION', -2); -define('STORY_NO_ACCESS_PARAMS', -3); -define('STORY_EMPTY_REQUIRED_FIELDS', -4); -define('STORY_NO_ACCESS_TOPIC', -5); +define('STORY_DUPLICATE_SID', -4); +define('STORY_EXISTING_NO_EDIT_PERMISSION', -5); +define('STORY_NO_ACCESS_PARAMS', -6); +define('STORY_EMPTY_REQUIRED_FIELDS', -7); +define('STORY_NO_ACCESS_TOPIC', -8); /** * Constants for our magic loader @@ -688,6 +688,8 @@ * /public_html/admin/story.php */ + $retval = STORY_LOADED_OK; // default to success + /* Load the trivial stuff: */ $this->_loadBasics($array); @@ -702,7 +704,8 @@ if ($result && (DB_numRows($result) > 0)) { /* Sid exists! Is it our article? */ if ($this->_sid != $this->_originalSid) { - return STORY_DUPLICATE_SID; + // for story preview: don't abort + $retval = STORY_DUPLICATE_SID; } $article = DB_fetchArray($result); @@ -752,7 +755,7 @@ $this->_sanitizeData(); - return STORY_LOADED_OK; + return $retval; } /** From geeklog-cvs at lists.geeklog.net Mon Jan 12 04:22:45 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 12 Jan 2009 04:22:45 -0500 Subject: [geeklog-cvs] geeklog: Update some text content fields when the site_url chang... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/a6ae19468150 changeset: 6674:a6ae19468150 user: Dirk Haun date: Sat Jan 10 22:31:06 2009 +0100 description: Update some text content fields when the site_url changed due to the migration diffstat: 1 file changed, 83 insertions(+), 6 deletions(-) public_html/admin/install/migrate.php | 89 ++++++++++++++++++++++++++++++--- diffs (123 lines): diff -r aa686f7bdc05 -r a6ae19468150 public_html/admin/install/migrate.php --- a/public_html/admin/install/migrate.php Sat Jan 10 19:10:20 2009 +0100 +++ b/public_html/admin/install/migrate.php Sat Jan 10 22:31:06 2009 +0100 @@ -32,6 +32,69 @@ require_once 'lib-install.php'; require_once '../../siteconfig.php'; + + +/** +* Fix site_url in content +* +* If the site's URL changed due to the migration, this function will replace +* the old URL with the new one in text content of the given tables. +* +* @param string $old_url the site's previous URL +* @param string $new_url the site's new URL after the migration +* @param array $tablespec (optional) list of tables to patch +* +* The $tablespec is an array of tablename => fieldlist pairs, where the field +* list contains the text fields to be searched and the table's index field +* as the first(!) entry. +* +*/ +function INST_updateSiteUrl($old_url, $new_url, $tablespec = '') +{ + global $_TABLES; + + // standard tables to update if no $tablespec given + $tables = array( + 'stories' => 'sid, introtext, bodytext, related', + 'storysubmission' => 'sid, introtext, bodytext', + 'comments' => 'cid, comment', + 'trackback' => 'cid, excerpt', + 'blocks' => 'bid, content' + ); + + if (empty($tablespec) || (! is_array($tablespec))) { + $tablespec = $tables; + } + + foreach ($tablespec as $table => $fieldlist) { + $fields = explode(',', str_replace(' ', '', $fieldlist)); + $index = array_shift($fields); + + $result = DB_query("SELECT $fieldlist FROM {$_TABLES[$table]}"); + $numRows = DB_numRows($result); + for ($i = 0; $i < $numRows; $i++) { + $A = DB_fetchArray($result); + $changed = false; + foreach ($fields as $field) { + $newtxt = str_replace($old_url, $new_url, $A[$field]); + if ($newtxt != $A[$field]) { + $A[$field] = $newtxt; + $changed = true; + } + } + + if ($changed) { + $sql = "UPDATE {$_TABLES[$table]} SET "; + foreach ($fields as $field) { + $sql .= "$field = '" . addslashes($A[$field]) . "', "; + } + $sql = substr($sql, 0, -2); + + DB_query($sql . " WHERE $index = '" . addslashes($A[$index]) . "'"); + } + } + } +} /** @@ -678,10 +741,15 @@ */ require_once $_CONF['path_system'] . 'classes/config.class.php'; $config = config::get_instance(); + $config->initConfig(); - $config->initConfig(); + // save a copy of the old config + $_OLD_CONF = $config->get_config('Core'); + $config->set('site_url', urldecode($_REQUEST['site_url'])); + $_CONF['site_url'] = urldecode($_REQUEST['site_url']); $config->set('site_admin_url', urldecode($_REQUEST['site_admin_url'])); + $_CONF['site_admin_url'] = urldecode($_REQUEST['site_admin_url']); $config->set('path_html', $html_path); $_CONF['path_html'] = $html_path; $config->set('path_log', $gl_path . 'logs/'); @@ -710,9 +778,8 @@ // check the default theme $theme = ''; if (empty($_CONF['theme'])) { - // no config.php involved - get from db - $_CONF_TMP = $config->get_config('Core'); - $theme = $_CONF_TMP['theme']; + // try old conf value + $theme = $_OLD_CONF['theme']; } else { $theme = $_CONF['theme']; } @@ -844,8 +911,18 @@ } - // refresh "Older Stories" block to fix URLs, if necessary - COM_olderStuff(); + // did the site URL change? + if ((! empty($_OLD_CONF['site_url'])) & (! empty($_CONF['site_url'])) + && ($_OLD_CONF['site_url'] != $_CONF['site_url'])) { + + INST_updateSiteUrl($_OLD_CONF['site_url'], $_CONF['site_url']); + + } else { + + // refresh "Older Stories" block + COM_olderStuff(); + + } /** * Import complete. From geeklog-cvs at lists.geeklog.net Mon Jan 12 04:22:48 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 12 Jan 2009 04:22:48 -0500 Subject: [geeklog-cvs] geeklog: Updated documentation for the 1.5.2 release Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/46ec9a028d29 changeset: 6676:46ec9a028d29 user: Dirk Haun date: Sun Jan 11 18:29:04 2009 +0100 description: Updated documentation for the 1.5.2 release diffstat: 1 file changed, 36 insertions(+), 1 deletion(-) public_html/docs/changes.html | 37 ++++++++++++++++++++++++++++++++++++- diffs (54 lines): diff -r fba25bb560d1 -r 46ec9a028d29 public_html/docs/changes.html --- a/public_html/docs/changes.html Sat Jan 10 19:10:20 2009 +0100 +++ b/public_html/docs/changes.html Sun Jan 11 18:29:04 2009 +0100 @@ -15,6 +15,41 @@ and / or obvious changes. For a detailed list of changes, please consult the ChangeLog. The file docs/changed-files has a list of files that have been changed since the last release.

    + +

    Geeklog 1.5.2

    + +

    Bugfixes

    + +
      +
    • Fixed a bug in the story preview where the story content was lost when + previewing a story with a duplicate story ID.
    • +
    • The Trackback editor didn't work since the security token was missing from + the editor template.
    • +
    • Fixed various problems with updating feeds, e.g. when chaning topic + permissions.
    • +
    + +

    Fixes in the bundled Plugins

    + +
      +
    • Links: Changing a link's ID to one that was already in use overwrote the + other link.
    • +
    • Polls: Changing a poll's ID created a new poll. Also fixed an SQL error + when the poll question contained single quotes.
    • +
    • Static Pages: Saving a static page changed the owner to the user who saved + it.
    • +
    + +

    Other Changes

    + +
      +
    • Improved image quality when using gdlib to rescale uploaded images.
    • +
    • Theme changes are documented in the theme + documentation, as usual. There are 4 bugfixes (one of which is in the + templates for the Polls plugin) that should be applied to all themes for + the 1.5.x series.
    • +
    +

    Geeklog 1.5.1

    @@ -520,7 +555,7 @@

    This release comes with a new default theme: We've chosen the Professional theme, kindly provided by Victor B. Gonzalez (of Aeonserv fame). The theme has been modified slightly and is now fully HTML 4.01 and CSS compliant.

    -

    We've also decided to remove the old set of themes (Classic, Clean, Digital Monchrome, Gameserver, Smooth Blue, XSilver, Yahoo) from the distribution. They are now available as a separate tarball.

    +

    We've also decided to remove the old set of themes (Classic, Clean, Digital Monochrome, Gameserver, Smooth Blue, XSilver, Yahoo) from the distribution. They are now available as a separate tarball.

    New Features

    From geeklog-cvs at lists.geeklog.net Mon Jan 12 04:22:48 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 12 Jan 2009 04:22:48 -0500 Subject: [geeklog-cvs] geeklog: Added a note to copy over config.php files when upgradi... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/ed62fb68fc81 changeset: 6675:ed62fb68fc81 user: Dirk Haun date: Sun Jan 11 09:07:58 2009 +0100 description: Added a note to copy over config.php files when upgrading from versions older than 1.5.0 diffstat: 8 files changed, 8 insertions(+), 8 deletions(-) public_html/admin/install/language/chinese_simplified_utf-8.php | 2 +- public_html/admin/install/language/chinese_traditional_utf-8.php | 2 +- public_html/admin/install/language/english.php | 2 +- public_html/admin/install/language/german.php | 2 +- public_html/admin/install/language/hebrew_utf-8.php | 2 +- public_html/admin/install/language/japanese_utf-8.php | 2 +- public_html/admin/install/language/polish.php | 2 +- public_html/admin/install/migrate.php | 2 +- diffs (97 lines): diff -r a6ae19468150 -r ed62fb68fc81 public_html/admin/install/language/chinese_simplified_utf-8.php --- a/public_html/admin/install/language/chinese_simplified_utf-8.php Sat Jan 10 22:31:06 2009 +0100 +++ b/public_html/admin/install/language/chinese_simplified_utf-8.php Sun Jan 11 09:07:58 2009 +0100 @@ -194,7 +194,7 @@ 1 => 'Before Proceding', 2 => 'Be sure any previously installed plugins have been copied to your new server.', 3 => 'Be sure any images from public_html/images/articles/, public_html/images/topics/, and public_html/images/userphotos/, have been copied to your new server.', - 4 => 'If you\'re upgrading to a new Geeklog version, then run the install script in upgrade mode first.', + 4 => 'If you\'re upgrading from a Geeklog version older than 1.5.0, then make sure to copy over all your old config.php files so that the migration can pick up your settings.', 5 => 'If you\'re upgrading to a new Geeklog version, then don\'t upload your theme just yet. Use the included default theme until you can be sure your migrated site works properly.', 6 => 'Select an existing backup', 7 => 'Choose file...', diff -r a6ae19468150 -r ed62fb68fc81 public_html/admin/install/language/chinese_traditional_utf-8.php --- a/public_html/admin/install/language/chinese_traditional_utf-8.php Sat Jan 10 22:31:06 2009 +0100 +++ b/public_html/admin/install/language/chinese_traditional_utf-8.php Sun Jan 11 09:07:58 2009 +0100 @@ -194,7 +194,7 @@ 1 => 'Before Proceding', 2 => 'Be sure any previously installed plugins have been copied to your new server.', 3 => 'Be sure any images from public_html/images/articles/, public_html/images/topics/, and public_html/images/userphotos/, have been copied to your new server.', - 4 => 'If you\'re upgrading to a new Geeklog version, then run the install script in upgrade mode first.', + 4 => 'If you\'re upgrading from a Geeklog version older than 1.5.0, then make sure to copy over all your old config.php files so that the migration can pick up your settings.', 5 => 'If you\'re upgrading to a new Geeklog version, then don\'t upload your theme just yet. Use the included default theme until you can be sure your migrated site works properly.', 6 => 'Select an existing backup', 7 => 'Choose file...', diff -r a6ae19468150 -r ed62fb68fc81 public_html/admin/install/language/english.php --- a/public_html/admin/install/language/english.php Sat Jan 10 22:31:06 2009 +0100 +++ b/public_html/admin/install/language/english.php Sun Jan 11 09:07:58 2009 +0100 @@ -194,7 +194,7 @@ 1 => 'Before Proceding', 2 => 'Be sure any previously installed plugins have been copied to your new server.', 3 => 'Be sure any images from public_html/images/articles/, public_html/images/topics/, and public_html/images/userphotos/, have been copied to your new server.', - 4 => 'If you\'re upgrading to a new Geeklog version, then run the install script in upgrade mode first.', + 4 => 'If you\'re upgrading from a Geeklog version older than 1.5.0, then make sure to copy over all your old config.php files so that the migration can pick up your settings.', 5 => 'If you\'re upgrading to a new Geeklog version, then don\'t upload your theme just yet. Use the included default theme until you can be sure your migrated site works properly.', 6 => 'Select an existing backup', 7 => 'Choose file...', diff -r a6ae19468150 -r ed62fb68fc81 public_html/admin/install/language/german.php --- a/public_html/admin/install/language/german.php Sat Jan 10 22:31:06 2009 +0100 +++ b/public_html/admin/install/language/german.php Sun Jan 11 09:07:58 2009 +0100 @@ -194,7 +194,7 @@ 1 => 'Before Proceding', 2 => 'Be sure any previously installed plugins have been copied to your new server.', 3 => 'Be sure any images from public_html/images/articles/, public_html/images/topics/, and public_html/images/userphotos/, have been copied to your new server.', - 4 => 'If you\'re upgrading to a new Geeklog version, then run the install script in upgrade mode first.', + 4 => 'If you\'re upgrading from a Geeklog version older than 1.5.0, then make sure to copy over all your old config.php files so that the migration can pick up your settings.', 5 => 'If you\'re upgrading to a new Geeklog version, then don\'t upload your theme just yet. Use the included default theme until you can be sure your migrated site works properly.', 6 => 'Backup ausw?hlen', 7 => 'Datei ausw?hlen...', diff -r a6ae19468150 -r ed62fb68fc81 public_html/admin/install/language/hebrew_utf-8.php --- a/public_html/admin/install/language/hebrew_utf-8.php Sat Jan 10 22:31:06 2009 +0100 +++ b/public_html/admin/install/language/hebrew_utf-8.php Sun Jan 11 09:07:58 2009 +0100 @@ -189,7 +189,7 @@ 1 => 'Before Proceding', 2 => 'Be sure any previously installed plugins have been copied to your new server.', 3 => 'Be sure any images from public_html/images/articles/, public_html/images/topics/, and public_html/images/userphotos/, have been copied to your new server.', - 4 => 'If you\'re upgrading to a new Geeklog version, then run the install script in upgrade mode first.', + 4 => 'If you\'re upgrading from a Geeklog version older than 1.5.0, then make sure to copy over all your old config.php files so that the migration can pick up your settings.', 5 => 'If you\'re upgrading to a new Geeklog version, then don\'t upload your theme just yet. Use the included default theme until you can be sure your migrated site works properly.', 6 => 'Select an existing backup', 7 => 'Choose file...', diff -r a6ae19468150 -r ed62fb68fc81 public_html/admin/install/language/japanese_utf-8.php --- a/public_html/admin/install/language/japanese_utf-8.php Sat Jan 10 22:31:06 2009 +0100 +++ b/public_html/admin/install/language/japanese_utf-8.php Sun Jan 11 09:07:58 2009 +0100 @@ -195,7 +195,7 @@ 1 => 'Before Proceding', 2 => 'Be sure any previously installed plugins have been copied to your new server.', 3 => 'Be sure any images from public_html/images/articles/, public_html/images/topics/, and public_html/images/userphotos/, have been copied to your new server.', - 4 => 'If you\'re upgrading to a new Geeklog version, then run the install script in upgrade mode first.', + 4 => 'If you\'re upgrading from a Geeklog version older than 1.5.0, then make sure to copy over all your old config.php files so that the migration can pick up your settings.', 5 => 'If you\'re upgrading to a new Geeklog version, then don\'t upload your theme just yet. Use the included default theme until you can be sure your migrated site works properly.', 6 => 'Select an existing backup', 7 => 'Choose file...', diff -r a6ae19468150 -r ed62fb68fc81 public_html/admin/install/language/polish.php --- a/public_html/admin/install/language/polish.php Sat Jan 10 22:31:06 2009 +0100 +++ b/public_html/admin/install/language/polish.php Sun Jan 11 09:07:58 2009 +0100 @@ -193,7 +193,7 @@ 1 => 'Before Proceding', 2 => 'Be sure any previously installed plugins have been copied to your new server.', 3 => 'Be sure any images from public_html/images/articles/, public_html/images/topics/, and public_html/images/userphotos/, have been copied to your new server.', - 4 => 'If you\'re upgrading to a new Geeklog version, then run the install script in upgrade mode first.', + 4 => 'If you\'re upgrading from a Geeklog version older than 1.5.0, then make sure to copy over all your old config.php files so that the migration can pick up your settings.', 5 => 'If you\'re upgrading to a new Geeklog version, then don\'t upload your theme just yet. Use the included default theme until you can be sure your migrated site works properly.', 6 => 'Select an existing backup', 7 => 'Choose file...', diff -r a6ae19468150 -r ed62fb68fc81 public_html/admin/install/migrate.php --- a/public_html/admin/install/migrate.php Sat Jan 10 22:31:06 2009 +0100 +++ b/public_html/admin/install/migrate.php Sun Jan 11 09:07:58 2009 +0100 @@ -266,8 +266,8 @@ . INST_printTab(3) . '
      ' . LB . INST_printTab(4) . '
    • ' . $LANG_MIGRATE[2] . '
    • ' . LB . INST_printTab(4) . '
    • ' . $LANG_MIGRATE[3] . '
    • ' . LB - //. INST_printTab(4) . '
    • ' . $LANG_MIGRATE[4] . '
    • ' . LB . INST_printTab(4) . '
    • ' . $LANG_MIGRATE[5] . '
    • ' . LB + . INST_printTab(4) . '
    • ' . $LANG_MIGRATE[4] . '
    • ' . LB . INST_printTab(3) . '
    ' . LB . LB; // Default form values From geeklog-cvs at lists.geeklog.net Mon Jan 12 04:22:49 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 12 Jan 2009 04:22:49 -0500 Subject: [geeklog-cvs] geeklog: Updated documentation for the 1.5.2 release Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/8b68bf7224fc changeset: 6677:8b68bf7224fc user: Dirk Haun date: Sun Jan 11 18:29:04 2009 +0100 description: Updated documentation for the 1.5.2 release diffstat: 1 file changed, 36 insertions(+), 1 deletion(-) public_html/docs/changes.html | 37 ++++++++++++++++++++++++++++++++++++- diffs (54 lines): diff -r ed62fb68fc81 -r 8b68bf7224fc public_html/docs/changes.html --- a/public_html/docs/changes.html Sun Jan 11 09:07:58 2009 +0100 +++ b/public_html/docs/changes.html Sun Jan 11 18:29:04 2009 +0100 @@ -15,6 +15,41 @@ and / or obvious changes. For a detailed list of changes, please consult the ChangeLog. The file docs/changed-files has a list of files that have been changed since the last release.

    + +

    Geeklog 1.5.2

    + +

    Bugfixes

    + +
      +
    • Fixed a bug in the story preview where the story content was lost when + previewing a story with a duplicate story ID.
    • +
    • The Trackback editor didn't work since the security token was missing from + the editor template.
    • +
    • Fixed various problems with updating feeds, e.g. when chaning topic + permissions.
    • +
    + +

    Fixes in the bundled Plugins

    + +
      +
    • Links: Changing a link's ID to one that was already in use overwrote the + other link.
    • +
    • Polls: Changing a poll's ID created a new poll. Also fixed an SQL error + when the poll question contained single quotes.
    • +
    • Static Pages: Saving a static page changed the owner to the user who saved + it.
    • +
    + +

    Other Changes

    + +
      +
    • Improved image quality when using gdlib to rescale uploaded images.
    • +
    • Theme changes are documented in the theme + documentation, as usual. There are 4 bugfixes (one of which is in the + templates for the Polls plugin) that should be applied to all themes for + the 1.5.x series.
    • +
    +

    Geeklog 1.5.1

    @@ -520,7 +555,7 @@

    This release comes with a new default theme: We've chosen the Professional theme, kindly provided by Victor B. Gonzalez (of Aeonserv fame). The theme has been modified slightly and is now fully HTML 4.01 and CSS compliant.

    -

    We've also decided to remove the old set of themes (Classic, Clean, Digital Monchrome, Gameserver, Smooth Blue, XSilver, Yahoo) from the distribution. They are now available as a separate tarball.

    +

    We've also decided to remove the old set of themes (Classic, Clean, Digital Monochrome, Gameserver, Smooth Blue, XSilver, Yahoo) from the distribution. They are now available as a separate tarball.

    New Features

    From geeklog-cvs at lists.geeklog.net Sat Jan 17 10:50:33 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 17 Jan 2009 10:50:33 -0500 Subject: [geeklog-cvs] geeklog: Comments were always showing the username, even when $_... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6470a0d263f3 changeset: 6681:6470a0d263f3 user: Dirk Haun date: Sat Jan 17 16:48:55 2009 +0100 description: Comments were always showing the username, even when $_CONF['show_fullname'] was enabled (reported and patch provided by mystral-kk, bug #0000800) diffstat: 2 files changed, 4 insertions(+), 4 deletions(-) public_html/docs/history | 2 ++ system/lib-comment.php | 6 ++---- diffs (42 lines): diff -r 9f806b0e5cf0 -r 6470a0d263f3 public_html/docs/history --- a/public_html/docs/history Sat Jan 17 12:46:40 2009 +0100 +++ b/public_html/docs/history Sat Jan 17 16:48:55 2009 +0100 @@ -3,6 +3,8 @@ Jan ??, 2009 (1.5.2) ------------ +- Comments were always showing the username, even when $_CONF['show_fullname'] + was enabled (reported and patch provided by mystral-kk, bug #0000800) - Fixed story preview losing the story when the sid already existed (bug #0000789) [Dirk] - Fixed wrong use of str_replace in STORY_extractLinks (bug #0000794) [Dirk] diff -r 9f806b0e5cf0 -r 6470a0d263f3 system/lib-comment.php --- a/system/lib-comment.php Sat Jan 17 12:46:40 2009 +0100 +++ b/system/lib-comment.php Sat Jan 17 16:48:55 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Geeklog comment library. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -32,8 +32,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: lib-comment.php,v 1.69 2008/09/21 08:37:11 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'lib-comment.php') !== false) { die('This file can not be used on its own!'); @@ -326,7 +324,7 @@ $template->set_var( 'end_author_anchortag', '' ); $template->set_var( 'author_link', COM_createLink( - $A['username'], + $fullname, $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] ) ); From geeklog-cvs at lists.geeklog.net Sat Jan 17 10:50:34 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 17 Jan 2009 10:50:34 -0500 Subject: [geeklog-cvs] geeklog: Comments were always showing the username, even when $_... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/b8aef2b980d6 changeset: 6682:b8aef2b980d6 user: Dirk Haun date: Sat Jan 17 16:48:55 2009 +0100 description: Comments were always showing the username, even when $_CONF['show_fullname'] was enabled (reported and patch provided by mystral-kk, bug #0000800) diffstat: 2 files changed, 4 insertions(+), 4 deletions(-) public_html/docs/history | 2 ++ system/lib-comment.php | 6 ++---- diffs (42 lines): diff -r e7e9113fd209 -r b8aef2b980d6 public_html/docs/history --- a/public_html/docs/history Sat Jan 17 12:49:01 2009 +0100 +++ b/public_html/docs/history Sat Jan 17 16:48:55 2009 +0100 @@ -63,6 +63,8 @@ Jan ??, 2009 (1.5.2) ------------ +- Comments were always showing the username, even when $_CONF['show_fullname'] + was enabled (reported and patch provided by mystral-kk, bug #0000800) - Fixed story preview losing the story when the sid already existed (bug #0000789) [Dirk] - Fixed wrong use of str_replace in STORY_extractLinks (bug #0000794) [Dirk] diff -r e7e9113fd209 -r b8aef2b980d6 system/lib-comment.php --- a/system/lib-comment.php Sat Jan 17 12:49:01 2009 +0100 +++ b/system/lib-comment.php Sat Jan 17 16:48:55 2009 +0100 @@ -8,7 +8,7 @@ // | | // | Geeklog comment library. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -32,8 +32,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: lib-comment.php,v 1.69 2008/09/21 08:37:11 dhaun Exp $ if (strpos(strtolower($_SERVER['PHP_SELF']), 'lib-comment.php') !== false) { die('This file can not be used on its own!'); @@ -326,7 +324,7 @@ $template->set_var( 'end_author_anchortag', '' ); $template->set_var( 'author_link', COM_createLink( - $A['username'], + $fullname, $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] ) ); From geeklog-cvs at lists.geeklog.net Sat Jan 17 12:52:27 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 17 Jan 2009 12:52:27 -0500 Subject: [geeklog-cvs] geeklog: The comment submission form didn't show the user's full... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/995ee34758f8 changeset: 6683:995ee34758f8 user: Dirk Haun date: Sat Jan 17 18:51:14 2009 +0100 description: The comment submission form didn't show the user's full name when $_CONF['show_fullname'] was enabled diffstat: 2 files changed, 20 insertions(+), 7 deletions(-) public_html/docs/history | 2 ++ system/lib-comment.php | 25 ++++++++++++++++++------- diffs (63 lines): diff -r 6470a0d263f3 -r 995ee34758f8 public_html/docs/history --- a/public_html/docs/history Sat Jan 17 16:48:55 2009 +0100 +++ b/public_html/docs/history Sat Jan 17 18:51:14 2009 +0100 @@ -3,6 +3,8 @@ Jan ??, 2009 (1.5.2) ------------ +- The comment submission form didn't show the user's full name when + $_CONF['show_fullname'] was enabled [Dirk] - Comments were always showing the username, even when $_CONF['show_fullname'] was enabled (reported and patch provided by mystral-kk, bug #0000800) - Fixed story preview losing the story when the sid already existed (bug diff -r 6470a0d263f3 -r 995ee34758f8 system/lib-comment.php --- a/system/lib-comment.php Sat Jan 17 16:48:55 2009 +0100 +++ b/system/lib-comment.php Sat Jan 17 18:51:14 2009 +0100 @@ -638,7 +638,8 @@ */ function CMT_commentForm($title,$comment,$sid,$pid='0',$type,$mode,$postmode) { - global $_CONF, $_TABLES, $_USER, $LANG03, $LANG12, $LANG_LOGIN; + global $_CONF, $_TABLES, $_USER, $LANG03, $LANG12, $LANG_LOGIN, + $LANG_ACCESS; $retval = ''; @@ -782,21 +783,31 @@ $comment_template->set_var('site_admin_url', $_CONF['site_admin_url']); $comment_template->set_var('layout_url', $_CONF['layout_url']); $comment_template->set_var('start_block_postacomment', COM_startBlock($LANG03[1])); - $comment_template->set_var('lang_username', $LANG03[5]); + if ($_CONF['show_fullname'] == 1) { + $comment_template->set_var('lang_username', $LANG_ACCESS['name']); + } else { + $comment_template->set_var('lang_username', $LANG03[5]); + } $comment_template->set_var('sid', $sid); $comment_template->set_var('pid', $pid); $comment_template->set_var('type', $type); if (!empty($_USER['username'])) { $comment_template->set_var('uid', $_USER['uid']); - $comment_template->set_var('username', $_USER['username']); - $comment_template->set_var('action_url', $_CONF['site_url'] . '/users.php?mode=logout'); - $comment_template->set_var('lang_logoutorcreateaccount', $LANG03[03]); + $name = COM_getDisplayName($_USER['uid'], $_USER['username'], + $_USER['fullname']); + $comment_template->set_var('username', $name); + $comment_template->set_var('action_url', + $_CONF['site_url'] . '/users.php?mode=logout'); + $comment_template->set_var('lang_logoutorcreateaccount', + $LANG03[03]); } else { $comment_template->set_var('uid', 1); $comment_template->set_var('username', $LANG03[24]); - $comment_template->set_var('action_url', $_CONF['site_url'] . '/users.php?mode=new'); - $comment_template->set_var('lang_logoutorcreateaccount', $LANG03[04]); + $comment_template->set_var('action_url', + $_CONF['site_url'] . '/users.php?mode=new'); + $comment_template->set_var('lang_logoutorcreateaccount', + $LANG03[04]); } if ($postmode == 'html') { From geeklog-cvs at lists.geeklog.net Sat Jan 17 12:52:27 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 17 Jan 2009 12:52:27 -0500 Subject: [geeklog-cvs] geeklog: The comment submission form didn't show the user's full... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/87fd88086fef changeset: 6684:87fd88086fef user: Dirk Haun date: Sat Jan 17 18:51:14 2009 +0100 description: The comment submission form didn't show the user's full name when $_CONF['show_fullname'] was enabled diffstat: 2 files changed, 20 insertions(+), 7 deletions(-) public_html/docs/history | 2 ++ system/lib-comment.php | 25 ++++++++++++++++++------- diffs (63 lines): diff -r b8aef2b980d6 -r 87fd88086fef public_html/docs/history --- a/public_html/docs/history Sat Jan 17 16:48:55 2009 +0100 +++ b/public_html/docs/history Sat Jan 17 18:51:14 2009 +0100 @@ -63,6 +63,8 @@ Jan ??, 2009 (1.5.2) ------------ +- The comment submission form didn't show the user's full name when + $_CONF['show_fullname'] was enabled [Dirk] - Comments were always showing the username, even when $_CONF['show_fullname'] was enabled (reported and patch provided by mystral-kk, bug #0000800) - Fixed story preview losing the story when the sid already existed (bug diff -r b8aef2b980d6 -r 87fd88086fef system/lib-comment.php --- a/system/lib-comment.php Sat Jan 17 16:48:55 2009 +0100 +++ b/system/lib-comment.php Sat Jan 17 18:51:14 2009 +0100 @@ -638,7 +638,8 @@ */ function CMT_commentForm($title,$comment,$sid,$pid='0',$type,$mode,$postmode) { - global $_CONF, $_TABLES, $_USER, $LANG03, $LANG12, $LANG_LOGIN; + global $_CONF, $_TABLES, $_USER, $LANG03, $LANG12, $LANG_LOGIN, + $LANG_ACCESS; $retval = ''; @@ -782,21 +783,31 @@ $comment_template->set_var('site_admin_url', $_CONF['site_admin_url']); $comment_template->set_var('layout_url', $_CONF['layout_url']); $comment_template->set_var('start_block_postacomment', COM_startBlock($LANG03[1])); - $comment_template->set_var('lang_username', $LANG03[5]); + if ($_CONF['show_fullname'] == 1) { + $comment_template->set_var('lang_username', $LANG_ACCESS['name']); + } else { + $comment_template->set_var('lang_username', $LANG03[5]); + } $comment_template->set_var('sid', $sid); $comment_template->set_var('pid', $pid); $comment_template->set_var('type', $type); if (!empty($_USER['username'])) { $comment_template->set_var('uid', $_USER['uid']); - $comment_template->set_var('username', $_USER['username']); - $comment_template->set_var('action_url', $_CONF['site_url'] . '/users.php?mode=logout'); - $comment_template->set_var('lang_logoutorcreateaccount', $LANG03[03]); + $name = COM_getDisplayName($_USER['uid'], $_USER['username'], + $_USER['fullname']); + $comment_template->set_var('username', $name); + $comment_template->set_var('action_url', + $_CONF['site_url'] . '/users.php?mode=logout'); + $comment_template->set_var('lang_logoutorcreateaccount', + $LANG03[03]); } else { $comment_template->set_var('uid', 1); $comment_template->set_var('username', $LANG03[24]); - $comment_template->set_var('action_url', $_CONF['site_url'] . '/users.php?mode=new'); - $comment_template->set_var('lang_logoutorcreateaccount', $LANG03[04]); + $comment_template->set_var('action_url', + $_CONF['site_url'] . '/users.php?mode=new'); + $comment_template->set_var('lang_logoutorcreateaccount', + $LANG03[04]); } if ($postmode == 'html') { From geeklog-cvs at lists.geeklog.net Sat Jan 17 15:30:30 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 17 Jan 2009 15:30:30 -0500 Subject: [geeklog-cvs] geeklog: - Usersettings.php - can not change password when custo... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/53e92082a7b2 changeset: 6685:53e92082a7b2 user: blaine Lang date: Sat Jan 17 13:50:12 2009 -0500 description: - Usersettings.php - can not change password when custom membership is enabled. Modified CUSTOM_userCheck to return both a error message string and Error code. Updated users.php and usersettings,php (bug #0000776) [Blaine] diffstat: 6 files changed, 3359 insertions(+), 3336 deletions(-) language/english.php | 8 language/english_utf-8.php | 9 public_html/docs/history | 3 public_html/users.php | 2528 +++++++++++++++++----------------- public_html/usersettings.php | 3097 +++++++++++++++++++++--------------------- system/lib-custom.php | 1050 +++++++------- diffs (truncated from 6757 to 300 lines): diff -r 87fd88086fef -r 53e92082a7b2 language/english.php --- a/language/english.php Sat Jan 17 18:51:14 2009 +0100 +++ b/language/english.php Sat Jan 17 13:50:12 2009 -0500 @@ -1202,11 +1202,13 @@ 94 => 'Backup Failed: Filesize less than 1kb', 95 => 'There was an error.', 96 => '', - 97 => 'Not all required fields have been passed validation - default custom membership message', + 97 => '', 98 => 'The plugin was successfully uploaded.', 99 => 'The plugin already exists.', 100 => 'The plugin file you uploaded was not a GZip or Zip compressed archive.', - 101 => 'There are no topics (that you have access to). You need at least one topic to be able to submit stories.' + 101 => 'There are no topics (that you have access to). You need at least one topic to be able to submit stories.', + 400 => 'Not all required fields have been passed validation', // Error codes in the 400 range reserved for CUSTOM membership + 401 => 'Please enter Fullname' ); ############################################################################### @@ -1652,7 +1654,7 @@ 'date' => "Date Format", 'daytime' => "Daytime Format", 'shortdate' => "Short Date Format", - 'dateonly' => "Date Only Format", + 'dateonly' => "Date Only Format", 'timeonly' => "Time Only Format", 'week_start' => "Week Start", 'hour_mode' => "Hour Mode", diff -r 87fd88086fef -r 53e92082a7b2 language/english_utf-8.php --- a/language/english_utf-8.php Sat Jan 17 18:51:14 2009 +0100 +++ b/language/english_utf-8.php Sat Jan 17 13:50:12 2009 -0500 @@ -1202,11 +1202,14 @@ 94 => 'Backup Failed: Filesize less than 1kb', 95 => 'There was an error.', 96 => '', - 97 => 'Not all required fields have been passed validation - default custom membership message', + 97 => '', 98 => 'The plugin was successfully uploaded.', 99 => 'The plugin already exists.', 100 => 'The plugin file you uploaded was not a GZip or Zip compressed archive.', - 101 => 'There are no topics (that you have access to). You need at least one topic to be able to submit stories.' + 101 => 'There are no topics (that you have access to). You need at least one topic to be able to submit stories.', + 400 => 'Not all required fields have been passed validation', // Error codes in the 400 range reserved for CUSTOM membership + 401 => 'Please enter Fullname' + ); ############################################################################### @@ -1652,7 +1655,7 @@ 'date' => "Date Format", 'daytime' => "Daytime Format", 'shortdate' => "Short Date Format", - 'dateonly' => "Date Only Format", + 'dateonly' => "Date Only Format", 'timeonly' => "Time Only Format", 'week_start' => "Week Start", 'hour_mode' => "Hour Mode", diff -r 87fd88086fef -r 53e92082a7b2 public_html/docs/history --- a/public_html/docs/history Sat Jan 17 18:51:14 2009 +0100 +++ b/public_html/docs/history Sat Jan 17 13:50:12 2009 -0500 @@ -11,6 +11,9 @@ + (TBD) Comment moderation and editable comments, by Jared Wenerd Other changes: +- Usersettings.php - can not change password when custom membership is enabled. + Modified CUSTOM_userCheck to return both a error message string and Error code. + Updated users.php and usersettings,php (bug #0000776) [Blaine] - Implemented extended API for PLG_getItemInfo [mystral-kk, Dirk] - Fixed inconsistencies and various small mistakes when displaying "Access denied" messages on the admin pages [Dirk] diff -r 87fd88086fef -r 53e92082a7b2 public_html/users.php --- a/public_html/users.php Sat Jan 17 18:51:14 2009 +0100 +++ b/public_html/users.php Sat Jan 17 13:50:12 2009 -0500 @@ -1,1264 +1,1264 @@ - -* @author Mark Limburg -* @author Jason Whittenburg -* -*/ - -/** -* Geeklog common function library -*/ -require_once 'lib-common.php'; -require_once $_CONF['path_system'] . 'lib-user.php'; -$VERBOSE = false; - -// Uncomment the line below if you need to debug the HTTP variables being passed -// to the script. This will sometimes cause errors but it will allow you to see -// the data being passed in a POST operation - -// echo COM_debug($_POST); - -/** -* Shows a profile for a user -* -* This grabs the user profile for a given user and displays it -* -* @param int $user User ID of profile to get -* @param int $msg Message to display (if != 0) -* @param string $plugin optional plugin name for message -* @return string HTML for user profile page -* -*/ -function userprofile($user, $msg = 0, $plugin = '') -{ - global $_CONF, $_TABLES, $_USER, $LANG01, $LANG04, $LANG09, $LANG28, $LANG_LOGIN; - - $retval = ''; - if (empty ($_USER['username']) && - (($_CONF['loginrequired'] == 1) || ($_CONF['profileloginrequired'] == 1))) { - $retval .= COM_siteHeader ('menu', $LANG_LOGIN[1]); - $retval .= COM_startBlock ($LANG_LOGIN[1], '', - COM_getBlockTemplate ('_msg_block', 'header')); - $login = new Template($_CONF['path_layout'] . 'submit'); - $login->set_file (array ('login'=>'submitloginrequired.thtml')); - $login->set_var ( 'xhtml', XHTML ); - $login->set_var ('login_message', $LANG_LOGIN[2]); - $login->set_var ('site_url', $_CONF['site_url']); - $login->set_var ('site_admin_url', $_CONF['site_admin_url']); - $login->set_var ('layout_url', $_CONF['layout_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 (COM_getBlockTemplate ('_msg_block', 'footer')); - $retval .= COM_siteFooter (); - - return $retval; - } - - $result = DB_query ("SELECT {$_TABLES['users']}.uid,username,fullname,regdate,homepage,about,location,pgpkey,photo,email,status FROM {$_TABLES['userinfo']},{$_TABLES['users']} WHERE {$_TABLES['userinfo']}.uid = {$_TABLES['users']}.uid AND {$_TABLES['users']}.uid = $user"); - $nrows = DB_numRows ($result); - if ($nrows == 0) { // no such user - return COM_refresh ($_CONF['site_url'] . '/index.php'); - } - $A = DB_fetchArray ($result); - - if ($A['status'] == USER_ACCOUNT_DISABLED && !SEC_hasRights ('user.edit')) { - COM_displayMessageAndAbort (30, '', 403, 'Forbidden'); - } - - $display_name = htmlspecialchars(COM_getDisplayName($user, $A['username'], - $A['fullname'])); - - $retval .= COM_siteHeader ('menu', $LANG04[1] . ' ' . $display_name); - if ($msg > 0) { - $retval .= COM_showMessage($msg, $plugin); - } - - // format date/time to user preference - $curtime = COM_getUserDateTimeFormat ($A['regdate']); - $A['regdate'] = $curtime[0]; - - $user_templates = new Template ($_CONF['path_layout'] . 'users'); - $user_templates->set_file (array ('profile' => 'profile.thtml', - 'row' => 'commentrow.thtml', - 'strow' => 'storyrow.thtml')); - $user_templates->set_var ('xhtml', XHTML); - $user_templates->set_var ('site_url', $_CONF['site_url']); - $user_templates->set_var ('start_block_userprofile', - COM_startBlock ($LANG04[1] . ' ' . $display_name)); - $user_templates->set_var ('end_block', COM_endBlock ()); - $user_templates->set_var ('lang_username', $LANG04[2]); - - if ($_CONF['show_fullname'] == 1) { - if (empty ($A['fullname'])) { - $username = $A['username']; - $fullname = ''; - } else { - $username = $A['fullname']; - $fullname = $A['username']; - } - } else { - $username = $A['username']; - $fullname = $A['fullname']; - } - $username = htmlspecialchars($username); - $fullname = htmlspecialchars($fullname); - - if ($A['status'] == USER_ACCOUNT_DISABLED) { - $username = sprintf ('%s', $LANG28[42], $username); - if (!empty ($fullname)) { - $fullname = sprintf ('%s', $LANG28[42], $fullname); - } - } - - $user_templates->set_var ('username', $username); - $user_templates->set_var ('user_fullname', $fullname); - - if (SEC_hasRights ('user.edit')) { - global $_IMAGE_TYPE, $LANG_ADMIN; - - $edit_icon = '' . $LANG_ADMIN['edit']
-                   . ''; - $edit_link_url = COM_createLink($edit_icon, - "{$_CONF['site_admin_url']}/user.php?mode=edit&uid={$A['uid']}"); - $user_templates->set_var ('edit_icon', $edit_icon); - $user_templates->set_var ('edit_link', $edit_link_url); - $user_templates->set_var ('user_edit', $edit_link_url); - } - - if (isset ($A['photo']) && empty ($A['photo'])) { - $A['photo'] = '(none)'; // user does not have a photo - } - $photo = USER_getPhoto ($user, $A['photo'], $A['email'], -1); - $user_templates->set_var ('user_photo', $photo); - - $user_templates->set_var ('lang_membersince', $LANG04[67]); - $user_templates->set_var ('user_regdate', $A['regdate']); - $user_templates->set_var ('lang_email', $LANG04[5]); - $user_templates->set_var ('user_id', $user); - $user_templates->set_var ('lang_sendemail', $LANG04[81]); - $user_templates->set_var ('lang_homepage', $LANG04[6]); - $user_templates->set_var ('user_homepage', COM_killJS ($A['homepage'])); - $user_templates->set_var ('lang_location', $LANG04[106]); - $user_templates->set_var ('user_location', strip_tags ($A['location'])); - $user_templates->set_var ('lang_bio', $LANG04[7]); - $user_templates->set_var ('user_bio', nl2br (stripslashes ($A['about']))); - $user_templates->set_var ('lang_pgpkey', $LANG04[8]); - $user_templates->set_var ('user_pgp', nl2br ($A['pgpkey'])); - $user_templates->set_var ('start_block_last10stories', - COM_startBlock ($LANG04[82] . ' ' . $display_name)); - $user_templates->set_var ('start_block_last10comments', - COM_startBlock($LANG04[10] . ' ' . $display_name)); - $user_templates->set_var ('start_block_postingstats', - COM_startBlock ($LANG04[83] . ' ' . $display_name)); - $user_templates->set_var ('lang_title', $LANG09[16]); - $user_templates->set_var ('lang_date', $LANG09[17]); - - // for alternative layouts: use these as headlines instead of block titles - $user_templates->set_var ('headline_last10stories', $LANG04[82]); - $user_templates->set_var ('headline_last10comments', $LANG04[10]); - $user_templates->set_var ('headline_postingstats', $LANG04[83]); - - $result = DB_query ("SELECT tid FROM {$_TABLES['topics']}" - . COM_getPermSQL ()); - $nrows = DB_numRows ($result); - $tids = array (); - for ($i = 0; $i < $nrows; $i++) { - $T = DB_fetchArray ($result); - $tids[] = $T['tid']; - } - $topics = "'" . implode ("','", $tids) . "'"; - - // list of last 10 stories by this user - if (sizeof ($tids) > 0) { - $sql = "SELECT sid,title,UNIX_TIMESTAMP(date) AS unixdate FROM {$_TABLES['stories']} WHERE (uid = $user) AND (draft_flag = 0) AND (date <= NOW()) AND (tid IN ($topics))" . COM_getPermSQL ('AND'); - $sql .= " ORDER BY unixdate DESC LIMIT 10"; - $result = DB_query ($sql); - $nrows = DB_numRows ($result); - } else { - $nrows = 0; - } - if ($nrows > 0) { - for ($i = 0; $i < $nrows; $i++) { - $C = DB_fetchArray ($result); - $user_templates->set_var ('cssid', ($i % 2) + 1); - $user_templates->set_var ('row_number', ($i + 1) . '.'); - $articleUrl = COM_buildUrl ($_CONF['site_url'] - . '/article.php?story=' . $C['sid']); - $user_templates->set_var ('article_url', $articleUrl); From geeklog-cvs at lists.geeklog.net Sat Jan 17 16:16:34 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 17 Jan 2009 16:16:34 -0500 Subject: [geeklog-cvs] geeklog: test Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/69a4c316c2ce changeset: 6686:69a4c316c2ce user: blaine date: Sat Jan 17 16:16:02 2009 -0500 description: test diffstat: 1 file changed, 2 insertions(+) system/lib-custom.php | 2 ++ diffs (12 lines): diff -r 53e92082a7b2 -r 69a4c316c2ce system/lib-custom.php --- a/system/lib-custom.php Sat Jan 17 13:50:12 2009 -0500 +++ b/system/lib-custom.php Sat Jan 17 16:16:02 2009 -0500 @@ -44,6 +44,8 @@ // +---------------------------------------------------------------------------+ // // $Id: lib-custom.php,v 1.43 2008/09/21 08:37:11 dhaun Exp $ + +// Test update if (strpos(strtolower($_SERVER['PHP_SELF']), 'lib-custom.php') !== false) { die('This file can not be used on its own!'); From geeklog-cvs at lists.geeklog.net Sat Jan 17 16:19:56 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 17 Jan 2009 16:19:56 -0500 Subject: [geeklog-cvs] geeklog: test Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/446370fcbb92 changeset: 6687:446370fcbb92 user: blaine date: Sat Jan 17 16:19:36 2009 -0500 description: test diffstat: 1 file changed, 2 deletions(-) system/lib-custom.php | 2 -- diffs (12 lines): diff -r 69a4c316c2ce -r 446370fcbb92 system/lib-custom.php --- a/system/lib-custom.php Sat Jan 17 16:16:02 2009 -0500 +++ b/system/lib-custom.php Sat Jan 17 16:19:36 2009 -0500 @@ -44,8 +44,6 @@ // +---------------------------------------------------------------------------+ // // $Id: lib-custom.php,v 1.43 2008/09/21 08:37:11 dhaun Exp $ - -// Test update if (strpos(strtolower($_SERVER['PHP_SELF']), 'lib-custom.php') !== false) { die('This file can not be used on its own!'); From geeklog-cvs at lists.geeklog.net Sat Jan 17 16:47:06 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 17 Jan 2009 16:47:06 -0500 Subject: [geeklog-cvs] geeklog: Testing encode/decode Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/084a3b8097cd changeset: 6688:084a3b8097cd user: blaine date: Sat Jan 17 16:46:33 2009 -0500 description: Testing encode/decode diffstat: 1 file changed, 526 deletions(-) system/lib-custom.php | 526 ------------------------------------------------- diffs (truncated from 530 to 300 lines): diff -r 446370fcbb92 -r 084a3b8097cd system/lib-custom.php --- a/system/lib-custom.php Sat Jan 17 16:19:36 2009 -0500 +++ b/system/lib-custom.php Sat Jan 17 16:46:33 2009 -0500 @@ -1,526 +0,0 @@ -' . $_RIGHTS[$i] . '' . LB; - } - - if ($_CST_VERBOSE) { - COM_errorLog('**** Leaving phpblock_showrights in lib-custom.php ****', 1); - } - - return $retval; -} - - -/** -* Include any code in this function that will be called by the internal CRON API -* The interval between runs is determined by $_CONF['cron_schedule_interval'] -*/ -function CUSTOM_runScheduledTask() { - -} - - -/** -* Example of custom function that can be used to handle a login error. -* Only active with custom registration mode enabled -* Used if you have a custom front page and need to trap and reformat any error messages -* This example redirects to the front page with a extra passed variable plus the message -* Note: Message could be a string but in this case maps to $MESSAGE[81] as a default - edit in language file -*/ -function CUSTOM_loginErrorHandler($msg='') { - global $_CONF,$MESSAGE; - - if ($msg > 0) { - $msg = $msg; - } elseif ($msg == '') { - $msg = 81; - } - $retval = COM_refresh($_CONF['site_url'] .'/index.php?mode=loginfail&msg='.$msg); - echo $retval; - exit; -} - - -/** -* Include any code in this function to add custom template variables. -* Initially, this function is only called in the COM_siteHeader function to set -* header.thtml variables -*/ -function CUSTOM_templateSetVars ($templatename, &$template) -{ - if ($templatename == 'header') { - // define a {hello_world} variable which displays "Hello, world!" - $template->set_var ('hello_world', 'Hello, world!'); - } -} - - -/* Sample Custom Member Functions to create and update Custom Membership registration and profile - - Note1: Enable CustomRegistration Feature in the configuration - $_CONF['custom_registration'] = true; // Set to true if you have custom code - - Note2: This example requires a template file called memberdetail.thtml to be - located under the theme_dir/custom directory. - Sample is provided under /system with the distribution. - - Note3: Optional parm $bulkimport added so that if your using the [Batch Add] feature, - you can execute different logic if required. - - Functions have been provided that are called from the Core Geeklog user and admin functions - - This works with User Moderation as well - - Admin will see the new registration info when checking a member's profile only - - All other users will see the standard User profile with the optional extended custom information - - Customization requires changes to a few of the core template files to add {customfields} variables - - See notes below in the custom function about the template changes -*/ - -/* Create any new records in additional tables you may have added */ -/* Update any fields in the core GL tables for this user as needed */ -/* Called when user is first created */ -function CUSTOM_userCreate ($uid,$bulkimport=false) -{ - global $_CONF, $_TABLES; - - // Ensure all data is prepared correctly before inserts, quotes may need to - // be escaped with addslashes() - $email = ''; - if (isset ($_POST['email'])) { - $email = COM_applyFilter ($_POST['email']); - $email = addslashes ($email); - } - - $homepage = ''; - if (isset ($_POST['homepage'])) { - $homepage = COM_applyFilter ($_POST['homepage']); - $homepage = addslashes ($homepage); - } - - $fullname = ''; - if (isset ($_POST['fullname'])) { - // COM_applyFilter would strip special characters, e.g. quotes, so - // we only strip HTML - $fullname = strip_tags ($_POST['fullname']); - $fullname = addslashes ($fullname); - } - - // Note: In this case, we can trust the $uid variable to contain the new - // account's uid. - DB_query("UPDATE {$_TABLES['users']} SET email = '$email', homepage = '$homepage', fullname = '$fullname' WHERE uid = $uid"); - - return true; -} - -// Delete any records from custom tables you may have used -function CUSTOM_userDelete($uid) -{ - return true; -} - -/* Called from users.php - when user is displaying a member profile. - * This function can now return any extra fields that need to be shown. - * Output is then replaced in {customfields} -- This variable needs to be added - * to your templates - * Template: path_layout/users/profile/profile.thtml - */ -function CUSTOM_userDisplay($uid) -{ - global $_CONF, $_TABLES; - - $var = "Value from custom table"; - $retval .= ' - Custom Fields: - ' . $var .' - '; - - return $retval; -} - - -/* Function called when editing user profile. */ -/* Called from usersettings.php - when user is eding their own profile */ -/* and from admin/user.php when admin is editing a member profile */ -/* This function can now return any extra fields that need to be shown for editing */ -/* Output is then replaced in {customfields} -- This variable needs to be added to your templates */ -/* User: path_layout/preferences/profile.thtml and Admin: path_layout/admin/user/edituser.thtml */ - -/* This example shows adding the Cookie Timeout setting and extra text field */ -/* As noted: You need to add the {customfields} template variable. */ -/* For the edituser.thtml - maybe it would be added about the {group_edit} variable. */ - -function CUSTOM_userEdit($uid) -{ - global $_CONF, $_TABLES; - - $var = "Value from custom table"; - $cookietimeout = DB_getitem($_TABLES['users'], 'cookietimeout', $uid); - $selection = ''; - $retval .= ' - Remember user for: - ' . $selection .' - '; - $retval .= ' - Custom Fields: - - '; - $retval .= ''; - - return $retval; -} - -/* Function called when saving the user profile. */ -/* This function can now update any extra fields */ -function CUSTOM_userSave($uid) -{ - global $_CONF, $_TABLES; - - $cooktime = 0; - if (isset ($_POST['cooktime'])) { - $cooktime = COM_applyFilter ($_POST['cooktime'], true); - if ($cooktime < 0) { - $cooktime = 0; - } - - DB_query("UPDATE {$_TABLES['users']} SET cookietimeout = $cooktime WHERE uid = $uid"); - } -} - - -/** -* Main Form used for Custom membership when member is registering -* -* Note: Requires a file custom/memberdetail.thtml in every theme that is -* installed on the site! -* -* @param string $msg an error message to display or the word 'new' -* @return string HTML for the registration form -* -*/ -function CUSTOM_userForm ($msg = '') -{ - global $_CONF, $_TABLES, $LANG04; - - if (!empty ($msg) && ($msg != 'new')) { - $retval .= COM_startBlock($LANG04[21]) . $msg . COM_endBlock(); - } - - $post_url = $_CONF['site_url'] . '/users.php'; - $postmode = 'create'; - $submitbutton = ''; - $message = "
    Please complete the application below. Once you have completed the application, click the Register Now! button and the application will be processed immediately.
    "; - - $user_templates = new Template ($_CONF['path_layout'] . 'custom'); - $user_templates->set_file('memberdetail', 'memberdetail.thtml'); - $user_templates->set_var( 'xhtml', XHTML ); - $user_templates->set_var('site_url', $_CONF['site_url']); - $user_templates->set_var('layout_url', $_CONF['layout_url']); - $user_templates->set_var('post_url', $post_url); - $user_templates->set_var('startblock', COM_startBlock("Custom Registration Example")); - $user_templates->set_var('message', $message); - - $user_templates->set_var('USERNAME', $LANG04[2]); - $user_templates->set_var('USERNAME_HELP', "Name to be used when accessing this site"); From geeklog-cvs at lists.geeklog.net Sat Jan 17 16:51:39 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 17 Jan 2009 16:51:39 -0500 Subject: [geeklog-cvs] geeklog: restore from test Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/7e5123157b92 changeset: 6689:7e5123157b92 user: blaine date: Sat Jan 17 16:51:25 2009 -0500 description: restore from test diffstat: 1 file changed, 526 insertions(+) system/lib-custom.php | 526 +++++++++++++++++++++++++++++++++++++++++++++++++ diffs (truncated from 530 to 300 lines): diff -r 084a3b8097cd -r 7e5123157b92 system/lib-custom.php --- a/system/lib-custom.php Sat Jan 17 16:46:33 2009 -0500 +++ b/system/lib-custom.php Sat Jan 17 16:51:25 2009 -0500 @@ -0,0 +1,526 @@ +' . $_RIGHTS[$i] . '' . LB; + } + + if ($_CST_VERBOSE) { + COM_errorLog('**** Leaving phpblock_showrights in lib-custom.php ****', 1); + } + + return $retval; +} + + +/** +* Include any code in this function that will be called by the internal CRON API +* The interval between runs is determined by $_CONF['cron_schedule_interval'] +*/ +function CUSTOM_runScheduledTask() { + +} + + +/** +* Example of custom function that can be used to handle a login error. +* Only active with custom registration mode enabled +* Used if you have a custom front page and need to trap and reformat any error messages +* This example redirects to the front page with a extra passed variable plus the message +* Note: Message could be a string but in this case maps to $MESSAGE[81] as a default - edit in language file +*/ +function CUSTOM_loginErrorHandler($msg='') { + global $_CONF,$MESSAGE; + + if ($msg > 0) { + $msg = $msg; + } elseif ($msg == '') { + $msg = 81; + } + $retval = COM_refresh($_CONF['site_url'] .'/index.php?mode=loginfail&msg='.$msg); + echo $retval; + exit; +} + + +/** +* Include any code in this function to add custom template variables. +* Initially, this function is only called in the COM_siteHeader function to set +* header.thtml variables +*/ +function CUSTOM_templateSetVars ($templatename, &$template) +{ + if ($templatename == 'header') { + // define a {hello_world} variable which displays "Hello, world!" + $template->set_var ('hello_world', 'Hello, world!'); + } +} + + +/* Sample Custom Member Functions to create and update Custom Membership registration and profile + + Note1: Enable CustomRegistration Feature in the configuration + $_CONF['custom_registration'] = true; // Set to true if you have custom code + + Note2: This example requires a template file called memberdetail.thtml to be + located under the theme_dir/custom directory. + Sample is provided under /system with the distribution. + + Note3: Optional parm $bulkimport added so that if your using the [Batch Add] feature, + you can execute different logic if required. + + Functions have been provided that are called from the Core Geeklog user and admin functions + - This works with User Moderation as well + - Admin will see the new registration info when checking a member's profile only + - All other users will see the standard User profile with the optional extended custom information + - Customization requires changes to a few of the core template files to add {customfields} variables + - See notes below in the custom function about the template changes +*/ + +/* Create any new records in additional tables you may have added */ +/* Update any fields in the core GL tables for this user as needed */ +/* Called when user is first created */ +function CUSTOM_userCreate ($uid,$bulkimport=false) +{ + global $_CONF, $_TABLES; + + // Ensure all data is prepared correctly before inserts, quotes may need to + // be escaped with addslashes() + $email = ''; + if (isset ($_POST['email'])) { + $email = COM_applyFilter ($_POST['email']); + $email = addslashes ($email); + } + + $homepage = ''; + if (isset ($_POST['homepage'])) { + $homepage = COM_applyFilter ($_POST['homepage']); + $homepage = addslashes ($homepage); + } + + $fullname = ''; + if (isset ($_POST['fullname'])) { + // COM_applyFilter would strip special characters, e.g. quotes, so + // we only strip HTML + $fullname = strip_tags ($_POST['fullname']); + $fullname = addslashes ($fullname); + } + + // Note: In this case, we can trust the $uid variable to contain the new + // account's uid. + DB_query("UPDATE {$_TABLES['users']} SET email = '$email', homepage = '$homepage', fullname = '$fullname' WHERE uid = $uid"); + + return true; +} + +// Delete any records from custom tables you may have used +function CUSTOM_userDelete($uid) +{ + return true; +} + +/* Called from users.php - when user is displaying a member profile. + * This function can now return any extra fields that need to be shown. + * Output is then replaced in {customfields} -- This variable needs to be added + * to your templates + * Template: path_layout/users/profile/profile.thtml + */ +function CUSTOM_userDisplay($uid) +{ + global $_CONF, $_TABLES; + + $var = "Value from custom table"; + $retval .= ' + Custom Fields: + ' . $var .' + '; + + return $retval; +} + + +/* Function called when editing user profile. */ +/* Called from usersettings.php - when user is eding their own profile */ +/* and from admin/user.php when admin is editing a member profile */ +/* This function can now return any extra fields that need to be shown for editing */ +/* Output is then replaced in {customfields} -- This variable needs to be added to your templates */ +/* User: path_layout/preferences/profile.thtml and Admin: path_layout/admin/user/edituser.thtml */ + +/* This example shows adding the Cookie Timeout setting and extra text field */ +/* As noted: You need to add the {customfields} template variable. */ +/* For the edituser.thtml - maybe it would be added about the {group_edit} variable. */ + +function CUSTOM_userEdit($uid) +{ + global $_CONF, $_TABLES; + + $var = "Value from custom table"; + $cookietimeout = DB_getitem($_TABLES['users'], 'cookietimeout', $uid); + $selection = ''; + $retval .= ' + Remember user for: + ' . $selection .' + '; + $retval .= ' + Custom Fields: + + '; + $retval .= ''; + + return $retval; +} + +/* Function called when saving the user profile. */ +/* This function can now update any extra fields */ +function CUSTOM_userSave($uid) +{ + global $_CONF, $_TABLES; + + $cooktime = 0; + if (isset ($_POST['cooktime'])) { + $cooktime = COM_applyFilter ($_POST['cooktime'], true); + if ($cooktime < 0) { + $cooktime = 0; + } + + DB_query("UPDATE {$_TABLES['users']} SET cookietimeout = $cooktime WHERE uid = $uid"); + } +} + + +/** +* Main Form used for Custom membership when member is registering +* +* Note: Requires a file custom/memberdetail.thtml in every theme that is +* installed on the site! +* +* @param string $msg an error message to display or the word 'new' +* @return string HTML for the registration form +* +*/ +function CUSTOM_userForm ($msg = '') +{ + global $_CONF, $_TABLES, $LANG04; + + if (!empty ($msg) && ($msg != 'new')) { + $retval .= COM_startBlock($LANG04[21]) . $msg . COM_endBlock(); + } + + $post_url = $_CONF['site_url'] . '/users.php'; + $postmode = 'create'; + $submitbutton = ''; + $message = "
    Please complete the application below. Once you have completed the application, click the Register Now! button and the application will be processed immediately.
    "; + + $user_templates = new Template ($_CONF['path_layout'] . 'custom'); + $user_templates->set_file('memberdetail', 'memberdetail.thtml'); + $user_templates->set_var( 'xhtml', XHTML ); + $user_templates->set_var('site_url', $_CONF['site_url']); + $user_templates->set_var('layout_url', $_CONF['layout_url']); + $user_templates->set_var('post_url', $post_url); + $user_templates->set_var('startblock', COM_startBlock("Custom Registration Example")); + $user_templates->set_var('message', $message); + + $user_templates->set_var('USERNAME', $LANG04[2]); + $user_templates->set_var('USERNAME_HELP', "Name to be used when accessing this site"); From geeklog-cvs at lists.geeklog.net Sat Jan 17 17:08:23 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 17 Jan 2009 17:08:23 -0500 Subject: [geeklog-cvs] geeklog: Fixed line endings (DOS vs. Unix) - no change in content Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/c31a00d27f02 changeset: 6690:c31a00d27f02 user: Dirk Haun date: Sat Jan 17 23:08:07 2009 +0100 description: Fixed line endings (DOS vs. Unix) - no change in content diffstat: 3 files changed, 3345 insertions(+), 3345 deletions(-) public_html/users.php | 2528 +++++++++++++++++----------------- public_html/usersettings.php | 3110 +++++++++++++++++++++--------------------- system/lib-custom.php | 1052 +++++++------- diffs (truncated from 6702 to 300 lines): diff -r 7e5123157b92 -r c31a00d27f02 public_html/users.php --- a/public_html/users.php Sat Jan 17 16:51:25 2009 -0500 +++ b/public_html/users.php Sat Jan 17 23:08:07 2009 +0100 @@ -1,1264 +1,1264 @@ - -* @author Mark Limburg -* @author Jason Whittenburg -* -*/ - -/** -* Geeklog common function library -*/ -require_once 'lib-common.php'; -require_once $_CONF['path_system'] . 'lib-user.php'; -$VERBOSE = false; - -// Uncomment the line below if you need to debug the HTTP variables being passed -// to the script. This will sometimes cause errors but it will allow you to see -// the data being passed in a POST operation - -// echo COM_debug($_POST); - -/** -* Shows a profile for a user -* -* This grabs the user profile for a given user and displays it -* -* @param int $user User ID of profile to get -* @param int $msg Message to display (if != 0) -* @param string $plugin optional plugin name for message -* @return string HTML for user profile page -* -*/ -function userprofile($user, $msg = 0, $plugin = '') -{ - global $_CONF, $_TABLES, $_USER, $LANG01, $LANG04, $LANG09, $LANG28, $LANG_LOGIN; - - $retval = ''; - if (empty ($_USER['username']) && - (($_CONF['loginrequired'] == 1) || ($_CONF['profileloginrequired'] == 1))) { - $retval .= COM_siteHeader ('menu', $LANG_LOGIN[1]); - $retval .= COM_startBlock ($LANG_LOGIN[1], '', - COM_getBlockTemplate ('_msg_block', 'header')); - $login = new Template($_CONF['path_layout'] . 'submit'); - $login->set_file (array ('login'=>'submitloginrequired.thtml')); - $login->set_var ( 'xhtml', XHTML ); - $login->set_var ('login_message', $LANG_LOGIN[2]); - $login->set_var ('site_url', $_CONF['site_url']); - $login->set_var ('site_admin_url', $_CONF['site_admin_url']); - $login->set_var ('layout_url', $_CONF['layout_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 (COM_getBlockTemplate ('_msg_block', 'footer')); - $retval .= COM_siteFooter (); - - return $retval; - } - - $result = DB_query ("SELECT {$_TABLES['users']}.uid,username,fullname,regdate,homepage,about,location,pgpkey,photo,email,status FROM {$_TABLES['userinfo']},{$_TABLES['users']} WHERE {$_TABLES['userinfo']}.uid = {$_TABLES['users']}.uid AND {$_TABLES['users']}.uid = $user"); - $nrows = DB_numRows ($result); - if ($nrows == 0) { // no such user - return COM_refresh ($_CONF['site_url'] . '/index.php'); - } - $A = DB_fetchArray ($result); - - if ($A['status'] == USER_ACCOUNT_DISABLED && !SEC_hasRights ('user.edit')) { - COM_displayMessageAndAbort (30, '', 403, 'Forbidden'); - } - - $display_name = htmlspecialchars(COM_getDisplayName($user, $A['username'], - $A['fullname'])); - - $retval .= COM_siteHeader ('menu', $LANG04[1] . ' ' . $display_name); - if ($msg > 0) { - $retval .= COM_showMessage($msg, $plugin); - } - - // format date/time to user preference - $curtime = COM_getUserDateTimeFormat ($A['regdate']); - $A['regdate'] = $curtime[0]; - - $user_templates = new Template ($_CONF['path_layout'] . 'users'); - $user_templates->set_file (array ('profile' => 'profile.thtml', - 'row' => 'commentrow.thtml', - 'strow' => 'storyrow.thtml')); - $user_templates->set_var ('xhtml', XHTML); - $user_templates->set_var ('site_url', $_CONF['site_url']); - $user_templates->set_var ('start_block_userprofile', - COM_startBlock ($LANG04[1] . ' ' . $display_name)); - $user_templates->set_var ('end_block', COM_endBlock ()); - $user_templates->set_var ('lang_username', $LANG04[2]); - - if ($_CONF['show_fullname'] == 1) { - if (empty ($A['fullname'])) { - $username = $A['username']; - $fullname = ''; - } else { - $username = $A['fullname']; - $fullname = $A['username']; - } - } else { - $username = $A['username']; - $fullname = $A['fullname']; - } - $username = htmlspecialchars($username); - $fullname = htmlspecialchars($fullname); - - if ($A['status'] == USER_ACCOUNT_DISABLED) { - $username = sprintf ('%s', $LANG28[42], $username); - if (!empty ($fullname)) { - $fullname = sprintf ('%s', $LANG28[42], $fullname); - } - } - - $user_templates->set_var ('username', $username); - $user_templates->set_var ('user_fullname', $fullname); - - if (SEC_hasRights ('user.edit')) { - global $_IMAGE_TYPE, $LANG_ADMIN; - - $edit_icon = '' . $LANG_ADMIN['edit']
-                   . ''; - $edit_link_url = COM_createLink($edit_icon, - "{$_CONF['site_admin_url']}/user.php?mode=edit&uid={$A['uid']}"); - $user_templates->set_var ('edit_icon', $edit_icon); - $user_templates->set_var ('edit_link', $edit_link_url); - $user_templates->set_var ('user_edit', $edit_link_url); - } - - if (isset ($A['photo']) && empty ($A['photo'])) { - $A['photo'] = '(none)'; // user does not have a photo - } - $photo = USER_getPhoto ($user, $A['photo'], $A['email'], -1); - $user_templates->set_var ('user_photo', $photo); - - $user_templates->set_var ('lang_membersince', $LANG04[67]); - $user_templates->set_var ('user_regdate', $A['regdate']); - $user_templates->set_var ('lang_email', $LANG04[5]); - $user_templates->set_var ('user_id', $user); - $user_templates->set_var ('lang_sendemail', $LANG04[81]); - $user_templates->set_var ('lang_homepage', $LANG04[6]); - $user_templates->set_var ('user_homepage', COM_killJS ($A['homepage'])); - $user_templates->set_var ('lang_location', $LANG04[106]); - $user_templates->set_var ('user_location', strip_tags ($A['location'])); - $user_templates->set_var ('lang_bio', $LANG04[7]); - $user_templates->set_var ('user_bio', nl2br (stripslashes ($A['about']))); - $user_templates->set_var ('lang_pgpkey', $LANG04[8]); - $user_templates->set_var ('user_pgp', nl2br ($A['pgpkey'])); - $user_templates->set_var ('start_block_last10stories', - COM_startBlock ($LANG04[82] . ' ' . $display_name)); - $user_templates->set_var ('start_block_last10comments', - COM_startBlock($LANG04[10] . ' ' . $display_name)); - $user_templates->set_var ('start_block_postingstats', - COM_startBlock ($LANG04[83] . ' ' . $display_name)); - $user_templates->set_var ('lang_title', $LANG09[16]); - $user_templates->set_var ('lang_date', $LANG09[17]); - - // for alternative layouts: use these as headlines instead of block titles - $user_templates->set_var ('headline_last10stories', $LANG04[82]); - $user_templates->set_var ('headline_last10comments', $LANG04[10]); - $user_templates->set_var ('headline_postingstats', $LANG04[83]); - - $result = DB_query ("SELECT tid FROM {$_TABLES['topics']}" - . COM_getPermSQL ()); - $nrows = DB_numRows ($result); - $tids = array (); - for ($i = 0; $i < $nrows; $i++) { - $T = DB_fetchArray ($result); - $tids[] = $T['tid']; - } - $topics = "'" . implode ("','", $tids) . "'"; - - // list of last 10 stories by this user - if (sizeof ($tids) > 0) { - $sql = "SELECT sid,title,UNIX_TIMESTAMP(date) AS unixdate FROM {$_TABLES['stories']} WHERE (uid = $user) AND (draft_flag = 0) AND (date <= NOW()) AND (tid IN ($topics))" . COM_getPermSQL ('AND'); - $sql .= " ORDER BY unixdate DESC LIMIT 10"; - $result = DB_query ($sql); - $nrows = DB_numRows ($result); - } else { - $nrows = 0; - } - if ($nrows > 0) { - for ($i = 0; $i < $nrows; $i++) { - $C = DB_fetchArray ($result); - $user_templates->set_var ('cssid', ($i % 2) + 1); - $user_templates->set_var ('row_number', ($i + 1) . '.'); - $articleUrl = COM_buildUrl ($_CONF['site_url'] - . '/article.php?story=' . $C['sid']); - $user_templates->set_var ('article_url', $articleUrl); - $C['title'] = str_replace ('$', '$', $C['title']); - $user_templates->set_var ('story_title', - COM_createLink( - stripslashes ($C['title']), - $articleUrl, - array ('class'=>'b')) - ); - $storytime = COM_getUserDateTimeFormat ($C['unixdate']); - $user_templates->set_var ('story_date', $storytime[0]); - $user_templates->parse ('story_row', 'strow', true); - } - } else { - $user_templates->set_var ('story_row', - '' . $LANG01[37] . ''); - } - - // list of last 10 comments by this user - $sidArray = array(); - if (sizeof ($tids) > 0) { - // first, get a list of all stories the current visitor has access to - $sql = "SELECT sid FROM {$_TABLES['stories']} WHERE (draft_flag = 0) AND (date <= NOW()) AND (tid IN ($topics))" . COM_getPermSQL ('AND'); - $result = DB_query($sql); - $numsids = DB_numRows($result); - for ($i = 1; $i <= $numsids; $i++) { - $S = DB_fetchArray ($result); - $sidArray[] = $S['sid']; - } - } - - $sidList = implode("', '",$sidArray); - $sidList = "'$sidList'"; - - // then, find all comments by the user in those stories - $sql = "SELECT sid,title,cid,UNIX_TIMESTAMP(date) AS unixdate FROM {$_TABLES['comments']} WHERE (uid = $user) GROUP BY sid,title,cid,UNIX_TIMESTAMP(date)"; - - // SQL NOTE: Using a HAVING clause is usually faster than a where if the - // field is part of the select - // if (!empty ($sidList)) { - // $sql .= " AND (sid in ($sidList))"; - // } - if (!empty ($sidList)) { - $sql .= " HAVING sid in ($sidList)"; - } - $sql .= " ORDER BY unixdate DESC LIMIT 10"; - - $result = DB_query($sql); - $nrows = DB_numRows($result); - if ($nrows > 0) { - for ($i = 0; $i < $nrows; $i++) { - $C = DB_fetchArray ($result); - $user_templates->set_var ('cssid', ($i % 2) + 1); - $user_templates->set_var ('row_number', ($i + 1) . '.'); - $C['title'] = str_replace ('$', '$', $C['title']); - $comment_url = $_CONF['site_url'] . - '/comment.php?mode=view&cid=' . $C['cid']; - $user_templates->set_var ('comment_title', - COM_createLink( - stripslashes ($C['title']), - $comment_url, - array ('class'=>'b')) - ); - $commenttime = COM_getUserDateTimeFormat ($C['unixdate']); - $user_templates->set_var ('comment_date', $commenttime[0]); - $user_templates->parse ('comment_row', 'row', true); - } - } else { - $user_templates->set_var('comment_row','' . $LANG01[29] . ''); - } - - // posting stats for this user From geeklog-cvs at lists.geeklog.net Sun Jan 18 07:46:40 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 18 Jan 2009 07:46:40 -0500 Subject: [geeklog-cvs] geeklog: Fixed remaining part of bug #779: Write "empty" feed fi... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/c50b9e34d55b changeset: 6691:c50b9e34d55b user: Dirk Haun date: Sun Jan 18 13:45:10 2009 +0100 description: Fixed remaining part of bug #779: Write "empty" feed files (header/footer only) when topic permissions don't allow inclusion of any articles diffstat: 2 files changed, 52 insertions(+), 47 deletions(-) system/classes/syndication/feedparserbase.class.php | 48 +++++++---------- system/lib-syndication.php | 51 +++++++++++-------- diffs (167 lines): diff -r c31a00d27f02 -r c50b9e34d55b system/classes/syndication/feedparserbase.class.php --- a/system/classes/syndication/feedparserbase.class.php Sat Jan 17 23:08:07 2009 +0100 +++ b/system/classes/syndication/feedparserbase.class.php Sun Jan 18 13:45:10 2009 +0100 @@ -137,36 +137,30 @@ */ function createFeed( $fileName, $limit='' ) { - /* If we have no items, return false */ - if( count( $this->articles ) == 0 ) + /* Start the XML Feed formating */ + $xml = $this->_feedHeader(); + + /* Start with a limit of the size of the array, then, if we have a + * specific max length use that unless it's bigger than our count */ + $count = count( $this->articles ); + if( $limit ) { - return false; - } else { - /* Start the XML Feed formating */ - $xml = $this->_feedHeader(); + if( $limit < $count ) + { + $count = $limit; + } + } - /* Start with a limit of the size of the array, then, if we have a - * specific max length use that unless it's bigger than our count */ - $count = count( $this->articles ); - if( $limit ) - { - if( $limit < $count ) - { - $count = $limit; - } - } + /* Put the first $count items into the xml, using formatArticle */ + for( $i = 0; $i < $count; $i++ ) + { + $xml .= $this->_formatArticle( $this->articles[$i] ); + } - /* Put the first $count items into the xml, using formatArticle */ - for( $i = 0; $i < $count; $i++ ) - { - $xml .= $this->_formatArticle( $this->articles[$i] ); - } - - /* Close off the feed */ - $xml .= $this->_feedFooter(); - /* And write it to file */ - return $this->_writeFile( $fileName, $xml ); - } + /* Close off the feed */ + $xml .= $this->_feedFooter(); + /* And write it to file */ + return $this->_writeFile( $fileName, $xml ); } function _writeFile( $fileName, $data ) diff -r c31a00d27f02 -r c50b9e34d55b system/lib-syndication.php --- a/system/lib-syndication.php Sat Jan 17 23:08:07 2009 +0100 +++ b/system/lib-syndication.php Sun Jan 18 13:45:10 2009 +0100 @@ -75,6 +75,8 @@ $limitsql = ' LIMIT 10'; } + $sids = array (); + // get list of topics that anonymous users have access to $tresult = DB_query( "SELECT tid FROM {$_TABLES['topics']}" . COM_getPermSQL( 'WHERE', 1 )); @@ -89,26 +91,26 @@ { $tlist = "'" . implode( "','", $topiclist ) . "'"; $where .= " AND (tid IN ($tlist))"; - } - if ($frontpage_only) { - $where .= ' AND frontpage = 1'; - } - $result = DB_query( "SELECT sid FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() $where AND perm_anon > 0 ORDER BY date DESC $limitsql" ); - $nrows = DB_numRows( $result ); - - $sids = array (); - for( $i = 0; $i < $nrows; $i++ ) - { - $A = DB_fetchArray( $result ); - - if( $A['sid'] == $updated_id ) - { - // no need to look any further - this feed has to be updated - return false; + if ($frontpage_only) { + $where .= ' AND frontpage = 1'; } - $sids[] = $A['sid']; + $result = DB_query( "SELECT sid FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() $where AND perm_anon > 0 ORDER BY date DESC $limitsql" ); + $nrows = DB_numRows( $result ); + + for( $i = 0; $i < $nrows; $i++ ) + { + $A = DB_fetchArray( $result ); + + if( $A['sid'] == $updated_id ) + { + // no need to look any further - this feed has to be updated + return false; + } + + $sids[] = $A['sid']; + } } $current = implode( ',', $sids ); @@ -153,7 +155,7 @@ $limitsql = ' LIMIT 10'; } - $result = DB_query( "SELECT sid FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() AND tid = '$tid' AND perm_anon > 0 ORDER BY date DESC $limitsql" ); + $result = DB_query( "SELECT sid FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() AND tid = '$tid'" . COM_getTopicSQL('AND', 1) . " AND perm_anon > 0 ORDER BY date DESC $limitsql" ); $nrows = DB_numRows( $result ); $sids = array (); @@ -331,6 +333,8 @@ { global $_TABLES, $_CONF, $LANG01; + $link = $_CONF['site_url']; + $where = ''; if( !empty( $limit )) { @@ -355,6 +359,14 @@ $tresult = DB_query( "SELECT tid,topic FROM {$_TABLES['topics']}" . COM_getPermSQL( 'WHERE', 1 )); $tnumrows = DB_numRows( $tresult ); + + if ($tnumrows == 0) { + // no public topics + $update = ''; + + return array(); + } + $tlist = ''; for( $i = 1; $i <= $tnumrows; $i++ ) { @@ -431,7 +443,6 @@ $content[] = $article; } - $link = $_CONF['site_url']; $update = implode( ',', $sids ); return $content; @@ -527,7 +538,7 @@ * at least one does, then include the trackback namespace: */ $trackbackenabled = false; - foreach($content as $item) + foreach ($content as $item) { if( array_key_exists('extensions', $item) && array_key_exists('trackbacktag', $item['extensions']) From geeklog-cvs at lists.geeklog.net Sun Jan 18 07:46:40 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 18 Jan 2009 07:46:40 -0500 Subject: [geeklog-cvs] geeklog: Fixed remaining part of bug #779: Write "empty" feed fi... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6a2d0d94a03d changeset: 6692:6a2d0d94a03d user: Dirk Haun date: Sun Jan 18 13:45:10 2009 +0100 description: Fixed remaining part of bug #779: Write "empty" feed files (header/footer only) when topic permissions don't allow inclusion of any articles diffstat: 2 files changed, 52 insertions(+), 47 deletions(-) system/classes/syndication/feedparserbase.class.php | 48 +++++++---------- system/lib-syndication.php | 51 +++++++++++-------- diffs (167 lines): diff -r 995ee34758f8 -r 6a2d0d94a03d system/classes/syndication/feedparserbase.class.php --- a/system/classes/syndication/feedparserbase.class.php Sat Jan 17 18:51:14 2009 +0100 +++ b/system/classes/syndication/feedparserbase.class.php Sun Jan 18 13:45:10 2009 +0100 @@ -137,36 +137,30 @@ */ function createFeed( $fileName, $limit='' ) { - /* If we have no items, return false */ - if( count( $this->articles ) == 0 ) + /* Start the XML Feed formating */ + $xml = $this->_feedHeader(); + + /* Start with a limit of the size of the array, then, if we have a + * specific max length use that unless it's bigger than our count */ + $count = count( $this->articles ); + if( $limit ) { - return false; - } else { - /* Start the XML Feed formating */ - $xml = $this->_feedHeader(); + if( $limit < $count ) + { + $count = $limit; + } + } - /* Start with a limit of the size of the array, then, if we have a - * specific max length use that unless it's bigger than our count */ - $count = count( $this->articles ); - if( $limit ) - { - if( $limit < $count ) - { - $count = $limit; - } - } + /* Put the first $count items into the xml, using formatArticle */ + for( $i = 0; $i < $count; $i++ ) + { + $xml .= $this->_formatArticle( $this->articles[$i] ); + } - /* Put the first $count items into the xml, using formatArticle */ - for( $i = 0; $i < $count; $i++ ) - { - $xml .= $this->_formatArticle( $this->articles[$i] ); - } - - /* Close off the feed */ - $xml .= $this->_feedFooter(); - /* And write it to file */ - return $this->_writeFile( $fileName, $xml ); - } + /* Close off the feed */ + $xml .= $this->_feedFooter(); + /* And write it to file */ + return $this->_writeFile( $fileName, $xml ); } function _writeFile( $fileName, $data ) diff -r 995ee34758f8 -r 6a2d0d94a03d system/lib-syndication.php --- a/system/lib-syndication.php Sat Jan 17 18:51:14 2009 +0100 +++ b/system/lib-syndication.php Sun Jan 18 13:45:10 2009 +0100 @@ -77,6 +77,8 @@ $limitsql = ' LIMIT 10'; } + $sids = array (); + // get list of topics that anonymous users have access to $tresult = DB_query( "SELECT tid FROM {$_TABLES['topics']}" . COM_getPermSQL( 'WHERE', 1 )); @@ -91,26 +93,26 @@ { $tlist = "'" . implode( "','", $topiclist ) . "'"; $where .= " AND (tid IN ($tlist))"; - } - if ($frontpage_only) { - $where .= ' AND frontpage = 1'; - } - $result = DB_query( "SELECT sid FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() $where AND perm_anon > 0 ORDER BY date DESC $limitsql" ); - $nrows = DB_numRows( $result ); - - $sids = array (); - for( $i = 0; $i < $nrows; $i++ ) - { - $A = DB_fetchArray( $result ); - - if( $A['sid'] == $updated_id ) - { - // no need to look any further - this feed has to be updated - return false; + if ($frontpage_only) { + $where .= ' AND frontpage = 1'; } - $sids[] = $A['sid']; + $result = DB_query( "SELECT sid FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() $where AND perm_anon > 0 ORDER BY date DESC $limitsql" ); + $nrows = DB_numRows( $result ); + + for( $i = 0; $i < $nrows; $i++ ) + { + $A = DB_fetchArray( $result ); + + if( $A['sid'] == $updated_id ) + { + // no need to look any further - this feed has to be updated + return false; + } + + $sids[] = $A['sid']; + } } $current = implode( ',', $sids ); @@ -155,7 +157,7 @@ $limitsql = ' LIMIT 10'; } - $result = DB_query( "SELECT sid FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() AND tid = '$tid' AND perm_anon > 0 ORDER BY date DESC $limitsql" ); + $result = DB_query( "SELECT sid FROM {$_TABLES['stories']} WHERE draft_flag = 0 AND date <= NOW() AND tid = '$tid'" . COM_getTopicSQL('AND', 1) . " AND perm_anon > 0 ORDER BY date DESC $limitsql" ); $nrows = DB_numRows( $result ); $sids = array (); @@ -333,6 +335,8 @@ { global $_TABLES, $_CONF, $LANG01; + $link = $_CONF['site_url']; + $where = ''; if( !empty( $limit )) { @@ -357,6 +361,14 @@ $tresult = DB_query( "SELECT tid,topic FROM {$_TABLES['topics']}" . COM_getPermSQL( 'WHERE', 1 )); $tnumrows = DB_numRows( $tresult ); + + if ($tnumrows == 0) { + // no public topics + $update = ''; + + return array(); + } + $tlist = ''; for( $i = 1; $i <= $tnumrows; $i++ ) { @@ -433,7 +445,6 @@ $content[] = $article; } - $link = $_CONF['site_url']; $update = implode( ',', $sids ); return $content; @@ -529,7 +540,7 @@ * at least one does, then include the trackback namespace: */ $trackbackenabled = false; - foreach($content as $item) + foreach ($content as $item) { if( array_key_exists('extensions', $item) && array_key_exists('trackbacktag', $item['extensions']) From geeklog-cvs at lists.geeklog.net Sun Jan 18 12:30:12 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 18 Jan 2009 12:30:12 -0500 Subject: [geeklog-cvs] geeklog: Quick fix to report when sending an email failed Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/479e6795ea14 changeset: 6693:479e6795ea14 user: Dirk Haun date: Sun Jan 18 18:29:15 2009 +0100 description: Quick fix to report when sending an email failed diffstat: 1 file changed, 7 insertions(+), 9 deletions(-) public_html/profiles.php | 16 +++++++--------- diffs (57 lines): diff -r 6a2d0d94a03d -r 479e6795ea14 public_html/profiles.php --- a/public_html/profiles.php Sun Jan 18 13:45:10 2009 +0100 +++ b/public_html/profiles.php Sun Jan 18 18:29:15 2009 +0100 @@ -9,7 +9,7 @@ // | This pages lets GL users communicate with each other without risk of | // | their email address being intercepted by spammers. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -32,8 +32,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: profiles.php,v 1.56 2008/02/20 20:32:37 mjervis Exp $ require_once 'lib-common.php'; @@ -126,12 +124,12 @@ } $from = COM_formatEmailAddress ($author, $authoremail); - COM_mail ($to, $subject, $message, $from); - COM_updateSpeedlimit ('mail'); + $sent = COM_mail($to, $subject, $message, $from); + COM_updateSpeedlimit('mail'); $retval .= COM_refresh($_CONF['site_url'] . '/users.php?mode=profile&uid=' . $uid - . '&msg=27'); + . '&msg=' . ($sent ? '27' : '85')); } else { $subject = strip_tags ($subject); $subject = substr ($subject, 0, strcspn ($subject, "\r\n")); @@ -345,16 +343,16 @@ $mailfrom = COM_formatEmailAddress ($from, $fromemail); $subject = COM_undoSpecialChars(strip_tags(stripslashes('Re: '.$A['title']))); - COM_mail ($mailto, $subject, $mailtext, $mailfrom); + $sent = COM_mail ($mailto, $subject, $mailtext, $mailfrom); COM_updateSpeedlimit ('mail'); // Increment numemails counter for story DB_query ("UPDATE {$_TABLES['stories']} SET numemails = numemails + 1 WHERE sid = '$sid'"); if ($_CONF['url_rewrite']) { - $retval = COM_refresh($storyurl . '?msg=27'); + $retval = COM_refresh($storyurl . '?msg=' . ($sent ? '27' : '85')); } else { - $retval = COM_refresh($storyurl . '&msg=27'); + $retval = COM_refresh($storyurl . '&msg=' . ($sent ? '27' : '85')); } return $retval; From geeklog-cvs at lists.geeklog.net Sun Jan 18 12:30:12 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 18 Jan 2009 12:30:12 -0500 Subject: [geeklog-cvs] geeklog: Quick fix to report when sending an email failed Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/3ca4ab4f13f3 changeset: 6694:3ca4ab4f13f3 user: Dirk Haun date: Sun Jan 18 18:29:15 2009 +0100 description: Quick fix to report when sending an email failed diffstat: 1 file changed, 7 insertions(+), 9 deletions(-) public_html/profiles.php | 16 +++++++--------- diffs (57 lines): diff -r c50b9e34d55b -r 3ca4ab4f13f3 public_html/profiles.php --- a/public_html/profiles.php Sun Jan 18 13:45:10 2009 +0100 +++ b/public_html/profiles.php Sun Jan 18 18:29:15 2009 +0100 @@ -9,7 +9,7 @@ // | This pages lets GL users communicate with each other without risk of | // | their email address being intercepted by spammers. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -32,8 +32,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: profiles.php,v 1.56 2008/02/20 20:32:37 mjervis Exp $ require_once 'lib-common.php'; @@ -126,12 +124,12 @@ } $from = COM_formatEmailAddress ($author, $authoremail); - COM_mail ($to, $subject, $message, $from); - COM_updateSpeedlimit ('mail'); + $sent = COM_mail($to, $subject, $message, $from); + COM_updateSpeedlimit('mail'); $retval .= COM_refresh($_CONF['site_url'] . '/users.php?mode=profile&uid=' . $uid - . '&msg=27'); + . '&msg=' . ($sent ? '27' : '85')); } else { $subject = strip_tags ($subject); $subject = substr ($subject, 0, strcspn ($subject, "\r\n")); @@ -345,16 +343,16 @@ $mailfrom = COM_formatEmailAddress ($from, $fromemail); $subject = COM_undoSpecialChars(strip_tags(stripslashes('Re: '.$A['title']))); - COM_mail ($mailto, $subject, $mailtext, $mailfrom); + $sent = COM_mail ($mailto, $subject, $mailtext, $mailfrom); COM_updateSpeedlimit ('mail'); // Increment numemails counter for story DB_query ("UPDATE {$_TABLES['stories']} SET numemails = numemails + 1 WHERE sid = '$sid'"); if ($_CONF['url_rewrite']) { - $retval = COM_refresh($storyurl . '?msg=27'); + $retval = COM_refresh($storyurl . '?msg=' . ($sent ? '27' : '85')); } else { - $retval = COM_refresh($storyurl . '&msg=27'); + $retval = COM_refresh($storyurl . '&msg=' . ($sent ? '27' : '85')); } return $retval; From geeklog-cvs at lists.geeklog.net Sun Jan 18 16:49:29 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 18 Jan 2009 16:49:29 -0500 Subject: [geeklog-cvs] geeklog: My test file Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/c5560b4eef68 changeset: 6695:c5560b4eef68 user: blaine date: Sun Jan 18 16:48:19 2009 -0500 description: My test file - Blaine diffstat: 1 file changed, 12 insertions(+) public_html/blaine.php | 12 ++++++++++++ diffs (17 lines): diff -r 3ca4ab4f13f3 -r c5560b4eef68 public_html/blaine.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/public_html/blaine.php Sun Jan 18 16:48:19 2009 -0500 @@ -0,0 +1,12 @@ +This is a test file - ignore'; + +echo COM_endBlock(); +echo COM_siteFooter(); + +?> \ No newline at end of file From geeklog-cvs at lists.geeklog.net Sun Jan 18 21:10:48 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 18 Jan 2009 21:10:48 -0500 Subject: [geeklog-cvs] geeklog: Update Advanced Editor functionality so the 'preview' p... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/b963011d0fbc changeset: 6696:b963011d0fbc user: blaine date: Sun Jan 18 21:09:44 2009 -0500 description: Update Advanced Editor functionality so the 'preview' panel will be selected if preview mode/operation is selected diffstat: 4 files changed, 21 insertions(+), 13 deletions(-) public_html/admin/story.php | 12 +++++- public_html/javascript/advanced_editor.js | 2 - public_html/javascript/storyeditor_fckeditor.js | 18 +++++----- public_html/layout/professional/admin/story/storyeditor_advanced.thtml | 2 - diffs (95 lines): diff -r c5560b4eef68 -r b963011d0fbc public_html/admin/story.php --- a/public_html/admin/story.php Sun Jan 18 16:48:19 2009 -0500 +++ b/public_html/admin/story.php Sun Jan 18 21:09:44 2009 -0500 @@ -308,7 +308,6 @@ $story_templates->set_var ('change_editormode', 'onchange="change_editmode(this);"'); require_once $_CONF['path_system'] . 'classes/navbar.class.php'; - $story_templates->set_var ('show_preview', 'none'); $story_templates->set_var ('lang_expandhelp', $LANG24[67]); $story_templates->set_var ('lang_reducehelp', $LANG24[68]); @@ -367,8 +366,15 @@ $navbar->add_menuitem($LANG24[84],'showhideEditorDiv("perms",4);return false;',true); $navbar->add_menuitem($LANG24[85],'showhideEditorDiv("all",5);return false;',true); } - - $navbar->set_selected($LANG24[80]); + if ($mode == 'preview') { + $story_templates->set_var ('show_preview', ''); + $story_templates->set_var ('show_htmleditor', 'none'); + $story_templates->set_var ('show_texteditor', 'none'); + $story_templates->set_var ('show_submitoptions', 'none'); + $navbar->set_selected($LANG24[79]); + } else { + $navbar->set_selected($LANG24[80]); + } $story_templates->set_var ('navbar', $navbar->generate() ); } diff -r c5560b4eef68 -r b963011d0fbc public_html/javascript/advanced_editor.js --- a/public_html/javascript/advanced_editor.js Sun Jan 18 16:48:19 2009 -0500 +++ b/public_html/javascript/advanced_editor.js Sun Jan 18 21:09:44 2009 -0500 @@ -31,7 +31,7 @@ // Reset the current selected navbar tab var navbar = document.getElementById('current'); if (navbar) navbar.id = ''; - // Cycle thru the navlist child elements - buiding an array of just the link items + // Cycle thru the navlist child elements - buiding an array of just the link items var navbar = document.getElementById('navlist'); var menuitems = new Array(8); var item = 0; diff -r c5560b4eef68 -r b963011d0fbc public_html/javascript/storyeditor_fckeditor.js --- a/public_html/javascript/storyeditor_fckeditor.js Sun Jan 18 16:48:19 2009 -0500 +++ b/public_html/javascript/storyeditor_fckeditor.js Sun Jan 18 21:09:44 2009 -0500 @@ -24,6 +24,7 @@ } function change_editmode(obj) { + showhideEditorDiv("editor",1); if (obj.value == 'html') { document.getElementById('html_editor').style.display='none'; document.getElementById('text_editor').style.display=''; @@ -76,9 +77,8 @@ function swapEditorContent(curmode,instanceName) { var content = ''; - var oEditor = FCKeditorAPI.GetInstance(instanceName) ; - - if (curmode == 'adveditor') { // Switching from Text to HTML mode + var oEditor = FCKeditorAPI.GetInstance(instanceName); + if (curmode == 'adveditor') { // Switching from Text/HTML mode to AdvancedEditor Mode // Get the content from the textarea 'text' content and copy it to the editor if (instanceName == 'introhtml' ) { content = document.getElementById('introtext').value; @@ -90,11 +90,13 @@ } catch (e) {} } else { - content = getEditorContent(instanceName); - if (instanceName == 'introhtml' ) { - document.getElementById('introtext').value = content; - } else { - document.getElementById('bodytext').value = content; + content = getEditorContent(instanceName); + if (content != '') { + if (instanceName == 'introhtml' ) { + document.getElementById('introtext').value = content; + } else { + document.getElementById('bodytext').value = content; + } } } } diff -r c5560b4eef68 -r b963011d0fbc public_html/layout/professional/admin/story/storyeditor_advanced.thtml --- a/public_html/layout/professional/admin/story/storyeditor_advanced.thtml Sun Jan 18 16:48:19 2009 -0500 +++ b/public_html/layout/professional/admin/story/storyeditor_advanced.thtml Sun Jan 18 21:09:44 2009 -0500 @@ -212,7 +212,7 @@

    {permissions_msg}

    -
    +
    From geeklog-cvs at lists.geeklog.net Sun Jan 18 21:17:08 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 18 Jan 2009 21:17:08 -0500 Subject: [geeklog-cvs] geeklog: Fixed up a few comments Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/c10af5ef9e81 changeset: 6697:c10af5ef9e81 user: blaine date: Sun Jan 18 21:16:35 2009 -0500 description: Fixed up a few comments diffstat: 1 file changed, 2 insertions(+), 2 deletions(-) public_html/javascript/advanced_editor.js | 4 ++-- diffs (21 lines): diff -r b963011d0fbc -r c10af5ef9e81 public_html/javascript/advanced_editor.js --- a/public_html/javascript/advanced_editor.js Sun Jan 18 21:09:44 2009 -0500 +++ b/public_html/javascript/advanced_editor.js Sun Jan 18 21:16:35 2009 -0500 @@ -31,7 +31,7 @@ // Reset the current selected navbar tab var navbar = document.getElementById('current'); if (navbar) navbar.id = ''; - // Cycle thru the navlist child elements - buiding an array of just the link items + // Cycle thru the navlist child elements - building an array of just the link items var navbar = document.getElementById('navlist'); var menuitems = new Array(8); var item = 0; @@ -42,7 +42,7 @@ } } // Now that I have just the link items I can set the selected tab using the passed selected Item number - // Set the tag to have an id called 'current' var menuitem = menuitems[selindex]; for (var j=0 ;j < menuitem.childNodes.length ; j++ ) { if (menuitem.childNodes[j].nodeName.toLowerCase() == 'a') menuitem.childNodes[j].id = 'current'; From geeklog-cvs at lists.geeklog.net Mon Jan 19 03:41:24 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 19 Jan 2009 03:41:24 -0500 Subject: [geeklog-cvs] geeklog: Ignore old config.php files Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/598212c390aa changeset: 6698:598212c390aa user: Dirk Haun date: Mon Jan 19 09:41:13 2009 +0100 description: Ignore old config.php files diffstat: 1 file changed, 8 insertions(+) .hgignore | 8 ++++++++ diffs (23 lines): diff -r c10af5ef9e81 -r 598212c390aa .hgignore --- a/.hgignore Sun Jan 18 21:16:35 2009 -0500 +++ b/.hgignore Mon Jan 19 09:41:13 2009 +0100 @@ -1,4 +1,5 @@ system/pear/Archive +system/pear/Auth system/pear/Console system/pear/Date system/pear/HTTP @@ -15,6 +16,13 @@ db-config.php public_html/siteconfig.php +config.php +plugins/calendar/config.php +plugins/links/config.php +plugins/polls/config.php +plugins/spamx/config.php +plugins/staticpages/config.php + syntax: glob backups/*.sql backups/*.tar.gz From geeklog-cvs at lists.geeklog.net Mon Jan 19 06:41:28 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 19 Jan 2009 06:41:28 -0500 Subject: [geeklog-cvs] geeklog: Removed dead link Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/85f8d55e79a6 changeset: 6699:85f8d55e79a6 user: Dirk Haun date: Mon Jan 19 12:39:45 2009 +0100 description: Removed dead link diffstat: 1 file changed, 5 insertions(+), 6 deletions(-) public_html/docs/config.html | 11 +++++------ diffs (21 lines): diff -r 479e6795ea14 -r 85f8d55e79a6 public_html/docs/config.html --- a/public_html/docs/config.html Sun Jan 18 18:29:15 2009 +0100 +++ b/public_html/docs/config.html Mon Jan 19 12:39:45 2009 +0100 @@ -1042,12 +1042,11 @@ gravatar_rating (disabled) - Avatars submitted to gravatar.com are rated with the rating system used - for movies (in the U.S.), i.e. the letters G, PG, R, or X. This option will - let you chose the maximum allowed rating for an avatar. For - example, a max. rating of R will make sure that no X-rated avatars will be - displayed on your site (only G, PG, and R). + Avatars submitted to gravatar.com are rated with the rating + system used for movies (in the U.S.), i.e. the letters G, PG, R, or X. This + option will let you chose the maximum allowed rating for an avatar. + For example, a max. rating of R will make sure that no X-rated avatars will + be displayed on your site (only G, PG, and R). From geeklog-cvs at lists.geeklog.net Mon Jan 19 06:41:28 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 19 Jan 2009 06:41:28 -0500 Subject: [geeklog-cvs] geeklog: Removed dead link Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/81ae9443dc14 changeset: 6700:81ae9443dc14 user: Dirk Haun date: Mon Jan 19 12:39:45 2009 +0100 description: Removed dead link diffstat: 1 file changed, 5 insertions(+), 6 deletions(-) public_html/docs/config.html | 11 +++++------ diffs (21 lines): diff -r 598212c390aa -r 81ae9443dc14 public_html/docs/config.html --- a/public_html/docs/config.html Mon Jan 19 09:41:13 2009 +0100 +++ b/public_html/docs/config.html Mon Jan 19 12:39:45 2009 +0100 @@ -1055,12 +1055,11 @@ gravatar_rating (disabled) - Avatars submitted to gravatar.com are rated with the rating system used - for movies (in the U.S.), i.e. the letters G, PG, R, or X. This option will - let you chose the maximum allowed rating for an avatar. For - example, a max. rating of R will make sure that no X-rated avatars will be - displayed on your site (only G, PG, and R). + Avatars submitted to gravatar.com are rated with the rating + system used for movies (in the U.S.), i.e. the letters G, PG, R, or X. This + option will let you chose the maximum allowed rating for an avatar. + For example, a max. rating of R will make sure that no X-rated avatars will + be displayed on your site (only G, PG, and R). From geeklog-cvs at lists.geeklog.net Mon Jan 19 20:44:31 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 19 Jan 2009 20:44:31 -0500 Subject: [geeklog-cvs] geeklog: Update FCKeditor to ver 2.6.4 Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/4a324dbbedd2 changeset: 6701:4a324dbbedd2 user: blaine date: Mon Jan 19 20:33:48 2009 -0500 description: Update FCKeditor to ver 2.6.4 diffstat: 266 files changed, 77960 insertions(+), 77007 deletions(-) public_html/fckeditor/_documentation.html | 76 public_html/fckeditor/_upgrade.html | 78 public_html/fckeditor/_whatsnew.html | 315 public_html/fckeditor/_whatsnew_history.html | 7703 +++++----- public_html/fckeditor/editor/_source/classes/fckcontextmenu.js | 446 public_html/fckeditor/editor/_source/classes/fckdataprocessor.js | 238 public_html/fckeditor/editor/_source/classes/fckdocumentfragment_gecko.js | 106 public_html/fckeditor/editor/_source/classes/fckdocumentfragment_ie.js | 116 public_html/fckeditor/editor/_source/classes/fckdomrange.js | 1870 +- public_html/fckeditor/editor/_source/classes/fckdomrange_gecko.js | 208 public_html/fckeditor/editor/_source/classes/fckdomrange_ie.js | 398 public_html/fckeditor/editor/_source/classes/fckdomrangeiterator.js | 654 public_html/fckeditor/editor/_source/classes/fckeditingarea.js | 736 public_html/fckeditor/editor/_source/classes/fckelementpath.js | 178 public_html/fckeditor/editor/_source/classes/fckenterkey.js | 1396 - public_html/fckeditor/editor/_source/classes/fckevents.js | 142 public_html/fckeditor/editor/_source/classes/fckhtmliterator.js | 284 public_html/fckeditor/editor/_source/classes/fckicon.js | 206 public_html/fckeditor/editor/_source/classes/fckiecleanup.js | 136 public_html/fckeditor/editor/_source/classes/fckimagepreloader.js | 128 public_html/fckeditor/editor/_source/classes/fckkeystrokehandler.js | 282 public_html/fckeditor/editor/_source/classes/fckmenublock.js | 306 public_html/fckeditor/editor/_source/classes/fckmenublockpanel.js | 108 public_html/fckeditor/editor/_source/classes/fckmenuitem.js | 322 public_html/fckeditor/editor/_source/classes/fckpanel.js | 849 - public_html/fckeditor/editor/_source/classes/fckplugin.js | 112 public_html/fckeditor/editor/_source/classes/fckspecialcombo.js | 752 public_html/fckeditor/editor/_source/classes/fckstyle.js | 3000 +-- public_html/fckeditor/editor/_source/classes/fcktoolbar.js | 206 public_html/fckeditor/editor/_source/classes/fcktoolbarbreak_gecko.js | 72 public_html/fckeditor/editor/_source/classes/fcktoolbarbreak_ie.js | 76 public_html/fckeditor/editor/_source/classes/fcktoolbarbutton.js | 162 public_html/fckeditor/editor/_source/classes/fcktoolbarbuttonui.js | 396 public_html/fckeditor/editor/_source/classes/fcktoolbarfontformatcombo.js | 278 public_html/fckeditor/editor/_source/classes/fcktoolbarfontscombo.js | 196 public_html/fckeditor/editor/_source/classes/fcktoolbarfontsizecombo.js | 152 public_html/fckeditor/editor/_source/classes/fcktoolbarpanelbutton.js | 206 public_html/fckeditor/editor/_source/classes/fcktoolbarspecialcombo.js | 292 public_html/fckeditor/editor/_source/classes/fcktoolbarstylecombo.js | 400 public_html/fckeditor/editor/_source/classes/fckw3crange.js | 902 - public_html/fckeditor/editor/_source/classes/fckxml.js | 216 public_html/fckeditor/editor/_source/classes/fckxml_gecko.js | 212 public_html/fckeditor/editor/_source/classes/fckxml_ie.js | 186 public_html/fckeditor/editor/_source/commandclasses/fck_othercommands.js | 1268 - public_html/fckeditor/editor/_source/commandclasses/fckblockquotecommand.js | 531 public_html/fckeditor/editor/_source/commandclasses/fckcorestylecommand.js | 122 public_html/fckeditor/editor/_source/commandclasses/fckfitwindow.js | 403 public_html/fckeditor/editor/_source/commandclasses/fckindentcommands.js | 564 public_html/fckeditor/editor/_source/commandclasses/fckjustifycommands.js | 346 public_html/fckeditor/editor/_source/commandclasses/fcklistcommands.js | 764 public_html/fckeditor/editor/_source/commandclasses/fcknamedcommand.js | 78 public_html/fckeditor/editor/_source/commandclasses/fckpasteplaintextcommand.js | 80 public_html/fckeditor/editor/_source/commandclasses/fckpastewordcommand.js | 80 public_html/fckeditor/editor/_source/commandclasses/fckremoveformatcommand.js | 90 public_html/fckeditor/editor/_source/commandclasses/fckshowblocks.js | 185 public_html/fckeditor/editor/_source/commandclasses/fckspellcheckcommand_gecko.js | 90 public_html/fckeditor/editor/_source/commandclasses/fckspellcheckcommand_ie.js | 141 public_html/fckeditor/editor/_source/commandclasses/fckstylecommand.js | 120 public_html/fckeditor/editor/_source/commandclasses/fcktablecommand.js | 212 public_html/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js | 402 public_html/fckeditor/editor/_source/fckconstants.js | 112 public_html/fckeditor/editor/_source/fckeditorapi.js | 357 public_html/fckeditor/editor/_source/fckjscoreextensions.js | 325 public_html/fckeditor/editor/_source/fckscriptloader.js | 244 public_html/fckeditor/editor/_source/internals/fck.js | 2508 +-- public_html/fckeditor/editor/_source/internals/fck_contextmenu.js | 687 public_html/fckeditor/editor/_source/internals/fck_gecko.js | 990 - public_html/fckeditor/editor/_source/internals/fck_ie.js | 912 - public_html/fckeditor/editor/_source/internals/fckbrowserinfo.js | 122 public_html/fckeditor/editor/_source/internals/fckcodeformatter.js | 200 public_html/fckeditor/editor/_source/internals/fckcommands.js | 344 public_html/fckeditor/editor/_source/internals/fckconfig.js | 474 public_html/fckeditor/editor/_source/internals/fckdebug.js | 118 public_html/fckeditor/editor/_source/internals/fckdialog.js | 478 public_html/fckeditor/editor/_source/internals/fckdocumentprocessor.js | 540 public_html/fckeditor/editor/_source/internals/fckdomtools.js | 2114 +- public_html/fckeditor/editor/_source/internals/fcklanguagemanager.js | 329 public_html/fckeditor/editor/_source/internals/fcklisthandler.js | 304 public_html/fckeditor/editor/_source/internals/fcklistslib.js | 126 public_html/fckeditor/editor/_source/internals/fckplugins.js | 92 public_html/fckeditor/editor/_source/internals/fckregexlib.js | 200 public_html/fckeditor/editor/_source/internals/fckselection.js | 84 public_html/fckeditor/editor/_source/internals/fckselection_gecko.js | 456 public_html/fckeditor/editor/_source/internals/fckselection_ie.js | 566 public_html/fckeditor/editor/_source/internals/fckstyles.js | 762 public_html/fckeditor/editor/_source/internals/fcktablehandler.js | 1724 +- public_html/fckeditor/editor/_source/internals/fcktablehandler_gecko.js | 112 public_html/fckeditor/editor/_source/internals/fcktablehandler_ie.js | 128 public_html/fckeditor/editor/_source/internals/fcktoolbaritems.js | 248 public_html/fckeditor/editor/_source/internals/fcktoolbarset.js | 798 - public_html/fckeditor/editor/_source/internals/fcktools.js | 1498 - public_html/fckeditor/editor/_source/internals/fcktools_gecko.js | 564 public_html/fckeditor/editor/_source/internals/fcktools_ie.js | 468 public_html/fckeditor/editor/_source/internals/fckundo.js | 446 public_html/fckeditor/editor/_source/internals/fckurlparams.js | 78 public_html/fckeditor/editor/_source/internals/fckxhtml.js | 1068 - public_html/fckeditor/editor/_source/internals/fckxhtml_gecko.js | 228 public_html/fckeditor/editor/_source/internals/fckxhtml_ie.js | 426 public_html/fckeditor/editor/_source/internals/fckxhtmlentities.js | 711 public_html/fckeditor/editor/css/behaviors/disablehandles.htc | 30 public_html/fckeditor/editor/css/behaviors/showtableborders.htc | 72 public_html/fckeditor/editor/css/fck_editorarea.css | 220 public_html/fckeditor/editor/css/fck_internal.css | 398 public_html/fckeditor/editor/css/fck_showtableborders_gecko.css | 98 public_html/fckeditor/editor/dialog/common/fck_dialog_common.css | 170 public_html/fckeditor/editor/dialog/common/fck_dialog_common.js | 658 public_html/fckeditor/editor/dialog/fck_about.html | 322 public_html/fckeditor/editor/dialog/fck_anchor.html | 440 public_html/fckeditor/editor/dialog/fck_button.html | 208 public_html/fckeditor/editor/dialog/fck_checkbox.html | 208 public_html/fckeditor/editor/dialog/fck_colorselector.html | 344 public_html/fckeditor/editor/dialog/fck_docprops.html | 1200 - public_html/fckeditor/editor/dialog/fck_docprops/fck_document_preview.html | 226 public_html/fckeditor/editor/dialog/fck_flash.html | 304 public_html/fckeditor/editor/dialog/fck_flash/fck_flash.js | 600 public_html/fckeditor/editor/dialog/fck_flash/fck_flash_preview.html | 100 public_html/fckeditor/editor/dialog/fck_form.html | 218 public_html/fckeditor/editor/dialog/fck_hiddenfield.html | 230 public_html/fckeditor/editor/dialog/fck_image.html | 516 public_html/fckeditor/editor/dialog/fck_image/fck_image.js | 1024 - public_html/fckeditor/editor/dialog/fck_image/fck_image_preview.html | 144 public_html/fckeditor/editor/dialog/fck_link.html | 590 public_html/fckeditor/editor/dialog/fck_link/fck_link.js | 1786 +- public_html/fckeditor/editor/dialog/fck_listprop.html | 240 public_html/fckeditor/editor/dialog/fck_paste.html | 693 public_html/fckeditor/editor/dialog/fck_radiobutton.html | 208 public_html/fckeditor/editor/dialog/fck_replace.html | 1298 - public_html/fckeditor/editor/dialog/fck_select.html | 360 public_html/fckeditor/editor/dialog/fck_select/fck_select.js | 388 public_html/fckeditor/editor/dialog/fck_smiley.html | 222 public_html/fckeditor/editor/dialog/fck_source.html | 136 public_html/fckeditor/editor/dialog/fck_specialchar.html | 242 public_html/fckeditor/editor/dialog/fck_spellerpages.html | 140 public_html/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controlWindow.js | 174 public_html/fckeditor/editor/dialog/fck_spellerpages/spellerpages/controls.html | 306 public_html/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.cfm | 296 public_html/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.php | 398 public_html/fckeditor/editor/dialog/fck_spellerpages/spellerpages/server-scripts/spellchecker.pl | 362 public_html/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellChecker.js | 922 - public_html/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellchecker.html | 142 public_html/fckeditor/editor/dialog/fck_spellerpages/spellerpages/spellerStyle.css | 98 public_html/fckeditor/editor/dialog/fck_spellerpages/spellerpages/wordWindow.js | 544 public_html/fckeditor/editor/dialog/fck_table.html | 737 public_html/fckeditor/editor/dialog/fck_tablecell.html | 550 public_html/fckeditor/editor/dialog/fck_template.html | 484 public_html/fckeditor/editor/dialog/fck_textarea.html | 188 public_html/fckeditor/editor/dialog/fck_textfield.html | 272 public_html/fckeditor/editor/dtd/fck_dtd_test.html | 82 public_html/fckeditor/editor/dtd/fck_xhtml10strict.js | 232 public_html/fckeditor/editor/dtd/fck_xhtml10transitional.js | 280 public_html/fckeditor/editor/fckdebug.html | 306 public_html/fckeditor/editor/fckdialog.html | 1631 +- public_html/fckeditor/editor/fckeditor.html | 634 public_html/fckeditor/editor/fckeditor.original.html | 848 - public_html/fckeditor/editor/filemanager/browser/default/browser.css | 174 public_html/fckeditor/editor/filemanager/browser/default/browser.html | 400 public_html/fckeditor/editor/filemanager/browser/default/frmactualfolder.html | 190 public_html/fckeditor/editor/filemanager/browser/default/frmcreatefolder.html | 228 public_html/fckeditor/editor/filemanager/browser/default/frmfolders.html | 396 public_html/fckeditor/editor/filemanager/browser/default/frmresourceslist.html | 338 public_html/fckeditor/editor/filemanager/browser/default/frmresourcetype.html | 138 public_html/fckeditor/editor/filemanager/browser/default/frmupload.html | 230 public_html/fckeditor/editor/filemanager/browser/default/js/common.js | 176 public_html/fckeditor/editor/filemanager/browser/default/js/fckxml.js | 294 public_html/fckeditor/editor/filemanager/connectors/php/basexml.php | 186 public_html/fckeditor/editor/filemanager/connectors/php/commands.php | 546 public_html/fckeditor/editor/filemanager/connectors/php/config.php | 310 public_html/fckeditor/editor/filemanager/connectors/php/connector.php | 174 public_html/fckeditor/editor/filemanager/connectors/php/io.php | 590 public_html/fckeditor/editor/filemanager/connectors/php/phpcompat.php | 34 public_html/fckeditor/editor/filemanager/connectors/php/upload.php | 125 public_html/fckeditor/editor/filemanager/connectors/php/util.php | 440 public_html/fckeditor/editor/js/fckadobeair.js | 352 public_html/fckeditor/editor/js/fckeditorcode_gecko.js | 216 public_html/fckeditor/editor/js/fckeditorcode_ie.js | 218 public_html/fckeditor/editor/lang/_translationstatus.txt | 157 public_html/fckeditor/editor/lang/af.js | 1060 - public_html/fckeditor/editor/lang/ar.js | 1060 - public_html/fckeditor/editor/lang/bg.js | 1060 - public_html/fckeditor/editor/lang/bn.js | 1060 - public_html/fckeditor/editor/lang/bs.js | 1060 - public_html/fckeditor/editor/lang/ca.js | 1060 - public_html/fckeditor/editor/lang/cs.js | 1060 - public_html/fckeditor/editor/lang/da.js | 1060 - public_html/fckeditor/editor/lang/de.js | 1060 - public_html/fckeditor/editor/lang/el.js | 1060 - public_html/fckeditor/editor/lang/en-au.js | 1060 - public_html/fckeditor/editor/lang/en-ca.js | 1060 - public_html/fckeditor/editor/lang/en-uk.js | 1060 - public_html/fckeditor/editor/lang/en.js | 1060 - public_html/fckeditor/editor/lang/eo.js | 1060 - public_html/fckeditor/editor/lang/es.js | 1060 - public_html/fckeditor/editor/lang/et.js | 1060 - public_html/fckeditor/editor/lang/eu.js | 1062 - public_html/fckeditor/editor/lang/fa.js | 1060 - public_html/fckeditor/editor/lang/fi.js | 1060 - public_html/fckeditor/editor/lang/fo.js | 1060 - public_html/fckeditor/editor/lang/fr-ca.js | 1060 - public_html/fckeditor/editor/lang/fr.js | 1060 - public_html/fckeditor/editor/lang/gl.js | 1060 - public_html/fckeditor/editor/lang/he.js | 1060 - public_html/fckeditor/editor/lang/hi.js | 1060 - public_html/fckeditor/editor/lang/hr.js | 1060 - public_html/fckeditor/editor/lang/hu.js | 1060 - public_html/fckeditor/editor/lang/it.js | 1060 - public_html/fckeditor/editor/lang/ja.js | 1060 - public_html/fckeditor/editor/lang/km.js | 1060 - public_html/fckeditor/editor/lang/ko.js | 1060 - public_html/fckeditor/editor/lang/lt.js | 1060 - public_html/fckeditor/editor/lang/lv.js | 1060 - public_html/fckeditor/editor/lang/mn.js | 1060 - public_html/fckeditor/editor/lang/ms.js | 1060 - public_html/fckeditor/editor/lang/nb.js | 1060 - public_html/fckeditor/editor/lang/nl.js | 1060 - public_html/fckeditor/editor/lang/no.js | 1060 - public_html/fckeditor/editor/lang/pl.js | 1060 - public_html/fckeditor/editor/lang/pt-br.js | 1060 - public_html/fckeditor/editor/lang/pt.js | 1060 - public_html/fckeditor/editor/lang/ro.js | 1060 - public_html/fckeditor/editor/lang/ru.js | 1060 - public_html/fckeditor/editor/lang/sk.js | 1060 - public_html/fckeditor/editor/lang/sl.js | 1060 - public_html/fckeditor/editor/lang/sr-latn.js | 1060 - public_html/fckeditor/editor/lang/sr.js | 1060 - public_html/fckeditor/editor/lang/sv.js | 1060 - public_html/fckeditor/editor/lang/th.js | 1060 - public_html/fckeditor/editor/lang/tr.js | 1060 - public_html/fckeditor/editor/lang/uk.js | 1060 - public_html/fckeditor/editor/lang/vi.js | 1060 - public_html/fckeditor/editor/lang/zh-cn.js | 1060 - public_html/fckeditor/editor/lang/zh.js | 1060 - public_html/fckeditor/editor/plugins/autogrow/fckplugin.js | 211 public_html/fckeditor/editor/plugins/bbcode/_sample/sample.config.js | 52 public_html/fckeditor/editor/plugins/bbcode/_sample/sample.html | 134 public_html/fckeditor/editor/plugins/bbcode/fckplugin.js | 246 public_html/fckeditor/editor/plugins/dragresizetable/fckplugin.js | 1053 - public_html/fckeditor/editor/plugins/placeholder/fck_placeholder.html | 210 public_html/fckeditor/editor/plugins/placeholder/fckplugin.js | 374 public_html/fckeditor/editor/plugins/placeholder/lang/de.js | 54 public_html/fckeditor/editor/plugins/placeholder/lang/en.js | 54 public_html/fckeditor/editor/plugins/placeholder/lang/es.js | 54 public_html/fckeditor/editor/plugins/placeholder/lang/fr.js | 54 public_html/fckeditor/editor/plugins/placeholder/lang/it.js | 54 public_html/fckeditor/editor/plugins/placeholder/lang/pl.js | 54 public_html/fckeditor/editor/plugins/simplecommands/fckplugin.js | 58 public_html/fckeditor/editor/plugins/tablecommands/fckplugin.js | 66 public_html/fckeditor/editor/skins/_fckviewstrips.html | 242 public_html/fckeditor/editor/skins/default/fck_dialog.css | 804 - public_html/fckeditor/editor/skins/default/fck_dialog_ie6.js | 220 public_html/fckeditor/editor/skins/default/fck_editor.css | 928 - public_html/fckeditor/editor/skins/office2003/fck_dialog.css | 804 - public_html/fckeditor/editor/skins/office2003/fck_dialog_ie6.js | 220 public_html/fckeditor/editor/skins/office2003/fck_editor.css | 952 - public_html/fckeditor/editor/skins/silver/fck_dialog.css | 804 - public_html/fckeditor/editor/skins/silver/fck_dialog_ie6.js | 220 public_html/fckeditor/editor/skins/silver/fck_editor.css | 946 - public_html/fckeditor/fckconfig.js | 648 public_html/fckeditor/fckeditor.js | 658 public_html/fckeditor/fckeditor.php | 62 public_html/fckeditor/fckeditor_php4.php | 524 public_html/fckeditor/fckeditor_php5.php | 514 public_html/fckeditor/fckpackager.xml | 524 public_html/fckeditor/fckstyles.xml | 222 public_html/fckeditor/fcktemplates.xml | 206 public_html/fckeditor/license.txt | 2492 +-- system/classes/story.class.php | 2 diffs (truncated from 156043 to 300 lines): diff -r c10af5ef9e81 -r 4a324dbbedd2 public_html/fckeditor/_documentation.html --- a/public_html/fckeditor/_documentation.html Sun Jan 18 21:16:35 2009 -0500 +++ b/public_html/fckeditor/_documentation.html Mon Jan 19 20:33:48 2009 -0500 @@ -1,38 +1,38 @@ - - - - - FCKeditor - Documentation - - - - -

    - FCKeditor Documentation

    -

    - You can find the official documentation for FCKeditor online, at - http://docs.fckeditor.net/.

    - - + + + + + FCKeditor - Documentation + + + + +

    + FCKeditor Documentation

    +

    + You can find the official documentation for FCKeditor online, at + http://docs.fckeditor.net/.

    + + diff -r c10af5ef9e81 -r 4a324dbbedd2 public_html/fckeditor/_upgrade.html --- a/public_html/fckeditor/_upgrade.html Sun Jan 18 21:16:35 2009 -0500 +++ b/public_html/fckeditor/_upgrade.html Mon Jan 19 20:33:48 2009 -0500 @@ -1,39 +1,39 @@ - - - - - FCKeditor - Upgrade - - - - -

    - FCKeditor Upgrade

    -

    - Please check the following URL for notes regarding upgrade:
    - - http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Installation/Upgrading

    - - + + + + + FCKeditor - Upgrade + + + + +

    + FCKeditor Upgrade

    +

    + Please check the following URL for notes regarding upgrade:
    + + http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Installation/Upgrading

    + + diff -r c10af5ef9e81 -r 4a324dbbedd2 public_html/fckeditor/_whatsnew.html --- a/public_html/fckeditor/_whatsnew.html Sun Jan 18 21:16:35 2009 -0500 +++ b/public_html/fckeditor/_whatsnew.html Mon Jan 19 20:33:48 2009 -0500 @@ -1,167 +1,148 @@ - - - - - FCKeditor ChangeLog - What's New? - - - - -

    - FCKeditor ChangeLog - What's New?

    -

    - Version 2.6.3

    -

    - Fixed Bugs:

    -
      -
    • [#2412] FCK.InsertHtml() - is now properly removing selected contents after content insertion in Firefox.
    • -
    • [#2420] Spelling - mistake corrections made by the spell checking dialog are now undoable.
    • -
    • [#2411] Insert - anchor was not working for non-empty selections.
    • -
    • [#2426] It was - impossible to switch between editor areas with a single click.
    • -
    • Language file updates for the following languages: -
        -
      • Canadian French
      • -
      • [#2402] Catalan -
      • -
      • [#2400] Chinese - (Simplified and Traditional)
      • -
      • [#2401] Croatian
      • -
      • [#2422] Czech
      • -
      • [#2417] Dutch
      • -
      • [#2428] French
      • -
      • German
      • -
      • [#2427] Hebrew
      • -
      • [#2410] Hindi
      • -
      • [#2405] Japanese
      • -
      • [#2409] Norwegian - and Norwegian Bokm??l
      • -
      • [#2429] Spanish
      • -
      • [#2406] Vietnamese
      • -
      -
    • -
    -

    - This version has been sponsored by Data Illusion - survey software solutions.

    -

    - Version 2.6.3 Beta

    -

    - New Features and Improvements:

    -
      -
    • [#439] Added a - new context menu option for opening links in the editor.
    • -
    • [#2220] - Email links from the Link dialog are now encoded by default - to prevent being harvested by spammers. (Kudos to asuter for proposing the patch) -
    • -
    • [#2234] Added - the ability to create, modify and remove DIV containers.
    • -
    • [#2247] The - SHIFT+SPACE keystroke will now produce a &nbsp; character. -
    • -
    • [#2252] It's - now possible to enable the browsers default menu using the configuration file (FCKConfig.BrowserContextMenu - option).
    • -
    • [#2032] Added - HTML samples for legacy HTML and Flash HTML.
    • -
    • [#234] Introduced - the "PreventSubmitHandler" setting, which makes it possible to instruct the editor - to not handle the hidden field update on form submit events.
    • -
    -

    - Fixed Bugs:

    -
      -
    • [#2319] On Opera - and Firefox 3, the entire page was scrolling on SHIFT+ENTER, or when EnterMode='br'.
    • -
    • [#2321] On Firefox - 3, the entire page was scrolling when inserting block elements with the FCK.InsertElement - function, used by the Table and Horizontal Rule buttons..
    • -
    • [#692] Added some - hints in editor/css/fck_editorarea.css on how to handle style items that would break - the style combo.
    • -
    • [#2263] Fixed - a JavaScript error in IE which occurs when there are placeholder elements in the - document and the user has pressed the Source button.
    • -
    • [#2314] Corrected - mixed up Chinese translations for the blockquote command.
    • -
    • [#2323] Fixed - the issue where the show blocks command loses the current selection from the view - area when editing a long document.
    • -
    • [#2322] Fixed - the issue where the fit window command loses the current selection and scroll position - in the editing area.
    • -
    • [#1917] Fixed - the issue where the merge down command for tables cells does not work in IE for - more than two cells.
    • -
    • [#2320] Fixed - the issue where the Find/Replace dialog scrolls the entire page.
    • -
    • [#1645] Added - warning message about Firefox 3's strict origin policy.
    • -
    • [#2272] Improved - the garbage filter in Paste from Word dialog.
    • -
    • [#2327] Fixed - invalid HTML in the Paste dialog.
    • -
    • [#1907] Fixed - sporadic "FCKeditorAPI is not defined" errors in Firefox 3.
    • -
    • [#2356] Fixed - access denied error in IE7 when FCKeditor is launched from local filesystem.
    • From geeklog-cvs at lists.geeklog.net Mon Jan 19 22:20:12 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 19 Jan 2009 22:20:12 -0500 Subject: [geeklog-cvs] geeklog: Update FCKeditor to ver 2.6.4 Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/70033dba2376 changeset: 6702:70033dba2376 user: blaine date: Mon Jan 19 22:19:19 2009 -0500 description: Update FCKeditor to ver 2.6.4 diffstat: 1 file changed, 1 insertion(+) public_html/docs/history | 1 + diffs (11 lines): diff -r 4a324dbbedd2 -r 70033dba2376 public_html/docs/history --- a/public_html/docs/history Mon Jan 19 20:33:48 2009 -0500 +++ b/public_html/docs/history Mon Jan 19 22:19:19 2009 -0500 @@ -11,6 +11,7 @@ + (TBD) Comment moderation and editable comments, by Jared Wenerd Other changes: +- Updated FCKeditor to version 2.6.4 [Blaine] - Usersettings.php - can not change password when custom membership is enabled. Modified CUSTOM_userCheck to return both a error message string and Error code. Updated users.php and usersettings,php (bug #0000776) [Blaine] From geeklog-cvs at lists.geeklog.net Tue Jan 20 00:18:17 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Tue, 20 Jan 2009 00:18:17 -0500 Subject: [geeklog-cvs] geeklog: Update to support a new CONFIG parm that will bring bac... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/0e60778aa4ae changeset: 6703:0e60778aa4ae user: blaine date: Tue Jan 20 00:17:45 2009 -0500 description: Update to support a new CONFIG parm that will bring back the separate setting for Allowable HTML if advanced Editor is enabled and your have story.edit permissions. diffstat: 1 file changed, 8 insertions(+), 2 deletions(-) public_html/lib-common.php | 10 ++++++++-- diffs (20 lines): diff -r 70033dba2376 -r 0e60778aa4ae public_html/lib-common.php --- a/public_html/lib-common.php Mon Jan 19 22:19:19 2009 -0500 +++ b/public_html/lib-common.php Tue Jan 20 00:17:45 2009 -0500 @@ -2985,8 +2985,14 @@ } else { - $html = array_merge_recursive( $_CONF['user_html'], - $_CONF['admin_html'] ); + if ($_CONF['advanced_editor']) { + $html = array_merge_recursive( $_CONF['user_html'], + $_CONF['admin_html'], + $_CONF['advanced_html'] ); + } else { + $html = array_merge_recursive( $_CONF['user_html'], + $_CONF['admin_html'] ); + } } foreach( $html as $tag => $attr ) From geeklog-cvs at lists.geeklog.net Tue Jan 20 06:41:06 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Tue, 20 Jan 2009 06:41:06 -0500 Subject: [geeklog-cvs] geeklog: Fixed E_ALL notice Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/c60982f34497 changeset: 6705:c60982f34497 user: Dirk Haun date: Tue Jan 20 12:40:52 2009 +0100 description: Fixed E_ALL notice diffstat: 1 file changed, 2 insertions(+), 1 deletion(-) public_html/lib-common.php | 3 ++- diffs (20 lines): diff -r 64e336333c7b -r c60982f34497 public_html/lib-common.php --- a/public_html/lib-common.php Tue Jan 20 10:17:24 2009 +0100 +++ b/public_html/lib-common.php Tue Jan 20 12:40:52 2009 +0100 @@ -2985,7 +2985,7 @@ } else { - if ($_CONF['advanced_editor']) { + if ($_CONF['advanced_editor'] && is_array($_CONF['advanced_html'])) { $html = array_merge_recursive( $_CONF['user_html'], $_CONF['admin_html'], $_CONF['advanced_html'] ); @@ -3005,6 +3005,7 @@ $str = $filter->Parse( $str ); $str = str_replace('[raw2]','', $str); $str = str_replace('[/raw2]','', $str); + return $str; } From geeklog-cvs at lists.geeklog.net Tue Jan 20 23:47:21 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Tue, 20 Jan 2009 23:47:21 -0500 Subject: [geeklog-cvs] geeklog: Fixed making links clickable when using plain text Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/10567844ea80 changeset: 6706:10567844ea80 user: Sami Barakat date: Wed Jan 21 04:42:00 2009 +0000 description: Fixed making links clickable when using plain text diffstat: 1 file changed, 37 insertions(+), 13 deletions(-) public_html/lib-common.php | 50 ++++++++++++++++++++++++++++++++------------ diffs (83 lines): diff -r c60982f34497 -r 10567844ea80 public_html/lib-common.php --- a/public_html/lib-common.php Tue Jan 20 12:40:52 2009 +0100 +++ b/public_html/lib-common.php Wed Jan 21 04:42:00 2009 +0000 @@ -5701,19 +5701,42 @@ * Detect links in a plain-ascii text and turn them into clickable links. * Will detect links starting with "http:", "https:", "ftp:", and "www.". * -* Derived from a newsgroup posting by Andreas Schwarz in -* news:de.comp.lang.php -* * @param string $text the (plain-ascii) text string * @return string the same string, with links enclosed in ... tags * */ function COM_makeClickableLinks( $text ) { - $regex = '/((ht|f)tp(s?)\:\/\/|~\/|\/)?([\w]+:\w+@)?(([a-zA-Z]{1}([\w\-]+\.)+([\w]{2,5}))(:[\d]{1,5})?((\/?\w+\/)+|\/?)([\w\-%]+(\.[\w]{3,4})?)?((\?|&|&)[\w\-%]+=[\w\-%]+)*)/is'; - - $text = preg_replace( $regex, '\\6', $text ); - return $text; + // These regular expressions will work for this purpuse, but + // they should NOT be used for validating links. + + // matches anything starting with http:// or https:// or ftp:// or ftps:// + $regex[] = '/(?<=^|[\n\r\t\s\(\)\[\]<>";])((?:(?:ht|f)tps?:\/{2})(?:[^\n\r\t\s\(\)\[\]<>"&]+(?:&)?)+)(?=[\n\r\t\s\(\)\[\]<>"&]|$)/ei'; + $replace[] = "COM_makeClickableLinksCallback('', '\\1')"; + + // matches anything containing a top level domain: xxx.com or xxx.yyy.net/stuff.php or xxx.yyy.zz + // list taken from: http://en.wikipedia.org/wiki/List_of_Internet_TLDs + $regex[] = '/(?<=^|[\n\r\t\s\(\)\[\]<>";])((?:[a-z0-9]+\.)*[a-z0-9]+\.(?:aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|[a-z]{2})(?:[\/?#](?:[^\n\r\t\s\(\)\[\]<>"&]+(?:&)?)*)?)(?=[\n\r\t\s\(\)\[\]<>"&]|$)/ei'; + $replace[] = "COM_makeClickableLinksCallback('http://', '\\1')"; + + $text = preg_replace( $regex, $replace, $text ); + + return $text; +} + +/** +* Callback function to help format links in COM_makeClickableLinks +* +* @param string $http set to 'http://' when not aleady in the url +* @param string $link the url +* @return string link enclosed in ... tags +* +*/ +function COM_makeClickableLinksCallback( $http, $link ) +{ + $text = COM_truncate( $link, 50, '...', '10' ); + + return "$text"; } /** @@ -6470,22 +6493,23 @@ * e.g. '...', to indicate the truncation. * This function is multi-byte string aware, based on a patch by Yusuke Sakata. * -* @param string $text the text string to truncate -* @param int $maxlen max. number of characters in the truncated string -* @param string $filler optional filler string, e.g. '...' -* @return string truncated string +* @param string $text the text string to truncate +* @param int $maxlen max. number of characters in the truncated string +* @param string $filler optional filler string, e.g. '...' +* @param int $endchars number of characters to show after the filler +* @return string truncated string * * @note The truncated string may be shorter but will never be longer than * $maxlen characters, i.e. the $filler string is taken into account. * */ -function COM_truncate( $text, $maxlen, $filler = '' ) +function COM_truncate( $text, $maxlen, $filler = '', $endchars = 0 ) { $newlen = $maxlen - MBYTE_strlen( $filler ); $len = MBYTE_strlen( $text ); if( $len > $maxlen ) { - $text = MBYTE_substr( $text, 0, $newlen ) . $filler; + $text = MBYTE_substr( $text, 0, $newlen - $endchars ) . $filler . MBYTE_substr( $text, $len - $endchars, $endchars ); } return $text; From geeklog-cvs at lists.geeklog.net Wed Jan 21 03:55:32 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 21 Jan 2009 03:55:32 -0500 Subject: [geeklog-cvs] geeklog: Fixed making links clickable when using plain text Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/639b6e768f25 changeset: 6707:639b6e768f25 user: Sami Barakat date: Wed Jan 21 04:42:00 2009 +0000 description: Fixed making links clickable when using plain text diffstat: 1 file changed, 37 insertions(+), 13 deletions(-) public_html/lib-common.php | 50 ++++++++++++++++++++++++++++++++------------ diffs (83 lines): diff -r 85f8d55e79a6 -r 639b6e768f25 public_html/lib-common.php --- a/public_html/lib-common.php Mon Jan 19 12:39:45 2009 +0100 +++ b/public_html/lib-common.php Wed Jan 21 04:42:00 2009 +0000 @@ -5698,19 +5698,42 @@ * Detect links in a plain-ascii text and turn them into clickable links. * Will detect links starting with "http:", "https:", "ftp:", and "www.". * -* Derived from a newsgroup posting by Andreas Schwarz in -* news:de.comp.lang.php -* * @param string $text the (plain-ascii) text string * @return string the same string, with links enclosed in ... tags * */ function COM_makeClickableLinks( $text ) { - $regex = '/((ht|f)tp(s?)\:\/\/|~\/|\/)?([\w]+:\w+@)?(([a-zA-Z]{1}([\w\-]+\.)+([\w]{2,5}))(:[\d]{1,5})?((\/?\w+\/)+|\/?)([\w\-%]+(\.[\w]{3,4})?)?((\?|&|&)[\w\-%]+=[\w\-%]+)*)/is'; - - $text = preg_replace( $regex, '\\6', $text ); - return $text; + // These regular expressions will work for this purpuse, but + // they should NOT be used for validating links. + + // matches anything starting with http:// or https:// or ftp:// or ftps:// + $regex[] = '/(?<=^|[\n\r\t\s\(\)\[\]<>";])((?:(?:ht|f)tps?:\/{2})(?:[^\n\r\t\s\(\)\[\]<>"&]+(?:&)?)+)(?=[\n\r\t\s\(\)\[\]<>"&]|$)/ei'; + $replace[] = "COM_makeClickableLinksCallback('', '\\1')"; + + // matches anything containing a top level domain: xxx.com or xxx.yyy.net/stuff.php or xxx.yyy.zz + // list taken from: http://en.wikipedia.org/wiki/List_of_Internet_TLDs + $regex[] = '/(?<=^|[\n\r\t\s\(\)\[\]<>";])((?:[a-z0-9]+\.)*[a-z0-9]+\.(?:aero|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|[a-z]{2})(?:[\/?#](?:[^\n\r\t\s\(\)\[\]<>"&]+(?:&)?)*)?)(?=[\n\r\t\s\(\)\[\]<>"&]|$)/ei'; + $replace[] = "COM_makeClickableLinksCallback('http://', '\\1')"; + + $text = preg_replace( $regex, $replace, $text ); + + return $text; +} + +/** +* Callback function to help format links in COM_makeClickableLinks +* +* @param string $http set to 'http://' when not aleady in the url +* @param string $link the url +* @return string link enclosed in ... tags +* +*/ +function COM_makeClickableLinksCallback( $http, $link ) +{ + $text = COM_truncate( $link, 50, '...', '10' ); + + return "$text"; } /** @@ -6467,22 +6490,23 @@ * e.g. '...', to indicate the truncation. * This function is multi-byte string aware, based on a patch by Yusuke Sakata. * -* @param string $text the text string to truncate -* @param int $maxlen max. number of characters in the truncated string -* @param string $filler optional filler string, e.g. '...' -* @return string truncated string +* @param string $text the text string to truncate +* @param int $maxlen max. number of characters in the truncated string +* @param string $filler optional filler string, e.g. '...' +* @param int $endchars number of characters to show after the filler +* @return string truncated string * * @note The truncated string may be shorter but will never be longer than * $maxlen characters, i.e. the $filler string is taken into account. * */ -function COM_truncate( $text, $maxlen, $filler = '' ) +function COM_truncate( $text, $maxlen, $filler = '', $endchars = 0 ) { $newlen = $maxlen - MBYTE_strlen( $filler ); $len = MBYTE_strlen( $text ); if( $len > $maxlen ) { - $text = MBYTE_substr( $text, 0, $newlen ) . $filler; + $text = MBYTE_substr( $text, 0, $newlen - $endchars ) . $filler . MBYTE_substr( $text, $len - $endchars, $endchars ); } return $text; From geeklog-cvs at lists.geeklog.net Thu Jan 22 16:31:13 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Thu, 22 Jan 2009 16:31:13 -0500 Subject: [geeklog-cvs] geeklog: Fix for calendar plugin - unable to add personal event Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/7ecb1ebb03c7 changeset: 6708:7ecb1ebb03c7 user: blaine Lang date: Thu Jan 22 16:30:26 2009 -0500 description: Fix for calendar plugin - unable to add personal event diffstat: 2 files changed, 3 insertions(+), 7 deletions(-) public_html/calendar/index.php | 8 ++------ public_html/docs/history | 2 +- diffs (30 lines): diff -r 10567844ea80 -r 7ecb1ebb03c7 public_html/calendar/index.php --- a/public_html/calendar/index.php Wed Jan 21 04:42:00 2009 +0000 +++ b/public_html/calendar/index.php Thu Jan 22 16:30:26 2009 -0500 @@ -801,12 +801,8 @@ break; case 'addentry': - if (SEC_checkToken()) { - $display .= plugin_submit_calendar($mode); - $display .= COM_siteFooter(); - } else { - $display = COM_refresh($_CONF['site_url'] . '/calendar/index.php'); - } + $display .= plugin_submit_calendar($mode); + $display .= COM_siteFooter(); break; case 'savepersonal': diff -r 10567844ea80 -r 7ecb1ebb03c7 public_html/docs/history --- a/public_html/docs/history Wed Jan 21 04:42:00 2009 +0000 +++ b/public_html/docs/history Thu Jan 22 16:30:26 2009 -0500 @@ -66,7 +66,7 @@ Jan ??, 2009 (1.5.2) ------------ - +- Fix for calendar plugin - unable to add personal event [Blaine] - The comment submission form didn't show the user's full name when $_CONF['show_fullname'] was enabled [Dirk] - Comments were always showing the username, even when $_CONF['show_fullname'] From geeklog-cvs at lists.geeklog.net Thu Jan 22 23:50:53 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Thu, 22 Jan 2009 23:50:53 -0500 Subject: [geeklog-cvs] geeklog: Fix for calendar plugin - unable to add personal event Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/07adf3e00771 changeset: 6709:07adf3e00771 user: blaine Lang date: Thu Jan 22 23:49:07 2009 -0500 description: Fix for calendar plugin - unable to add personal event diffstat: 1 file changed, 2 insertions(+), 6 deletions(-) public_html/calendar/index.php | 8 ++------ diffs (18 lines): diff -r 639b6e768f25 -r 07adf3e00771 public_html/calendar/index.php --- a/public_html/calendar/index.php Wed Jan 21 04:42:00 2009 +0000 +++ b/public_html/calendar/index.php Thu Jan 22 23:49:07 2009 -0500 @@ -801,12 +801,8 @@ break; case 'addentry': - if (SEC_checkToken()) { - $display .= plugin_submit_calendar($mode); - $display .= COM_siteFooter(); - } else { - $display = COM_refresh($_CONF['site_url'] . '/calendar/index.php'); - } + $display .= plugin_submit_calendar($mode); + $display .= COM_siteFooter(); break; case 'savepersonal': From geeklog-cvs at lists.geeklog.net Thu Jan 22 23:52:54 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Thu, 22 Jan 2009 23:52:54 -0500 Subject: [geeklog-cvs] geeklog: Fix for calendar plugin - unable to add personal event Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6495b7f1e3e6 changeset: 6710:6495b7f1e3e6 user: blaine Lang date: Thu Jan 22 23:52:32 2009 -0500 description: Fix for calendar plugin - unable to add personal event diffstat: 1 file changed, 1 insertion(+), 1 deletion(-) public_html/docs/history | 2 +- diffs (12 lines): diff -r 07adf3e00771 -r 6495b7f1e3e6 public_html/docs/history --- a/public_html/docs/history Thu Jan 22 23:49:07 2009 -0500 +++ b/public_html/docs/history Thu Jan 22 23:52:32 2009 -0500 @@ -2,7 +2,7 @@ Jan ??, 2009 (1.5.2) ------------ - +- Fix for calendar plugin - unable to add personal event [Blaine] - The comment submission form didn't show the user's full name when $_CONF['show_fullname'] was enabled [Dirk] - Comments were always showing the username, even when $_CONF['show_fullname'] From geeklog-cvs at lists.geeklog.net Sat Jan 24 03:49:15 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 24 Jan 2009 03:49:15 -0500 Subject: [geeklog-cvs] geeklog: Documentation updates for the 1.5.2rc1 release Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/14a00f899fb4 changeset: 6711:14a00f899fb4 user: Dirk Haun date: Sat Jan 24 09:42:02 2009 +0100 description: Documentation updates for the 1.5.2rc1 release diffstat: 3 files changed, 11 insertions(+), 5 deletions(-) public_html/docs/changes.html | 4 +++- public_html/docs/history | 9 ++++++--- public_html/docs/theme.html | 3 ++- diffs (58 lines): diff -r 6495b7f1e3e6 -r 14a00f899fb4 public_html/docs/changes.html --- a/public_html/docs/changes.html Thu Jan 22 23:52:32 2009 -0500 +++ b/public_html/docs/changes.html Sat Jan 24 09:42:02 2009 +0100 @@ -25,13 +25,15 @@ previewing a story with a duplicate story ID.
    • The Trackback editor didn't work since the security token was missing from the editor template.
    • -
    • Fixed various problems with updating feeds, e.g. when chaning topic +
    • Fixed issues with clickable links in plain text postings.
    • +
    • Fixed various problems with updating feeds, e.g. when changing topic permissions.

    Fixes in the bundled Plugins

      +
    • Calendar: You couldn't add a new event to your personal calendar.
    • Links: Changing a link's ID to one that was already in use overwrote the other link.
    • Polls: Changing a poll's ID created a new poll. Also fixed an SQL error diff -r 6495b7f1e3e6 -r 14a00f899fb4 public_html/docs/history --- a/public_html/docs/history Thu Jan 22 23:52:32 2009 -0500 +++ b/public_html/docs/history Sat Jan 24 09:42:02 2009 +0100 @@ -1,8 +1,10 @@ Geeklog History/Changes: -Jan ??, 2009 (1.5.2) ------------- -- Fix for calendar plugin - unable to add personal event [Blaine] +Jan 24, 2009 (1.5.2rc1) +------------ + +- Fixed various issues with COM_makeClickableLinks (bug #0000767, #0000793, + #0000796) [Sami] - The comment submission form didn't show the user's full name when $_CONF['show_fullname'] was enabled [Dirk] - Comments were always showing the username, even when $_CONF['show_fullname'] @@ -83,6 +85,7 @@ Calendar plugin --------------- +- Fix for calendar plugin - unable to add personal event [Blaine] - Make {event_url} available in eventdetails.thtml [Dirk] Links plugin diff -r 6495b7f1e3e6 -r 14a00f899fb4 public_html/docs/theme.html --- a/public_html/docs/theme.html Thu Jan 22 23:52:32 2009 -0500 +++ b/public_html/docs/theme.html Sat Jan 24 09:42:02 2009 +0100 @@ -213,7 +213,8 @@ admin/trackback/trackbackeditor.thtml
    • The {start_storylink_anchortag} variable in the story templates was missing the closing '>'. This caused the story title to disappear - on some themes.
    • + on some themes. (This was a bug in Geeklog's code, so no theme changes + required)
    • The {site_admin_url} was missing from the Configuration form action in admin/config/configuration.thtml. This may have caused problems making configuration changes on some setups.
    • From geeklog-cvs at lists.geeklog.net Sat Jan 24 03:49:17 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 24 Jan 2009 03:49:17 -0500 Subject: [geeklog-cvs] geeklog: Updated Hebrew language file for the Spam-X plugin, pro... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/7f464d6d419b changeset: 6712:7f464d6d419b user: Dirk Haun date: Sat Jan 24 09:48:46 2009 +0100 description: Updated Hebrew language file for the Spam-X plugin, provided by LWC diffstat: 2 files changed, 3 insertions(+), 2 deletions(-) plugins/spamx/language/hebrew_utf-8.php | 2 +- public_html/docs/history | 3 ++- diffs (25 lines): diff -r 14a00f899fb4 -r 7f464d6d419b plugins/spamx/language/hebrew_utf-8.php --- a/plugins/spamx/language/hebrew_utf-8.php Sat Jan 24 09:42:02 2009 +0100 +++ b/plugins/spamx/language/hebrew_utf-8.php Sat Jan 24 09:48:46 2009 +0100 @@ -105,7 +105,7 @@ 'import_success' => '

      ?????????? ???????????? %d ???????? ???????????? ????????????.', 'import_failure' => '

      ??????????: ???? ?????????? ????????????.', 'allow_url_fopen' => '

      ??????????????, ?????????? ???????? ???????? ???? ???????? ?????????? ?????????? ???? ?????????????? (allow_url_fopen ?????? ???????? off). ?????? ???????????? ???? ???????????? ???????????? ?????????????? ???????? ?????????? ???????? ?????????????? ??-"data" ???? ????????????, %s, ???????? ?????????? ??????:', - 'documentation' => '?????????????????????? ???? ??-Spam-X Plugin', + 'documentation' => '?????????????????????? ???? ??-Spam-X Plugin', 'emailmsg' => "???????? ???????? ?????? ???????? ??: \"%s\"\n?????? ?????????? ??????????: \"%s\"\n\n????????:\"%s\"", 'emailsubject' => '???????? ???????? ??: %s', 'ipblack' => '???????????? ???????????? ???? ???????????? IP ???? Spam-X', diff -r 14a00f899fb4 -r 7f464d6d419b public_html/docs/history --- a/public_html/docs/history Sat Jan 24 09:42:02 2009 +0100 +++ b/public_html/docs/history Sat Jan 24 09:48:46 2009 +0100 @@ -78,7 +78,8 @@ - Fixed an issue with story expiry dates on PHP 4/Windows (reported by zeb) [Mike] -- Updated Hebrew language file for the install script, provided by LWC +- Updated Hebrew language file for the install script and Spam-X plugin, + provided by LWC - Updated Japanese language files, provided by the Geeklog.jp group - Updated Polish language files, provided by Robert Stadnik - Updated Slovenian language file for the Links plugin, provided by gape From geeklog-cvs at lists.geeklog.net Sat Jan 24 03:51:18 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 24 Jan 2009 03:51:18 -0500 Subject: [geeklog-cvs] geeklog: Documentation updates for the 1.5.2rc1 release Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/e0fab2686bd0 changeset: 6713:e0fab2686bd0 user: Dirk Haun date: Sat Jan 24 09:42:02 2009 +0100 description: Documentation updates for the 1.5.2rc1 release diffstat: 3 files changed, 11 insertions(+), 5 deletions(-) public_html/docs/changes.html | 4 +++- public_html/docs/history | 9 ++++++--- public_html/docs/theme.html | 3 ++- diffs (59 lines): diff -r 7ecb1ebb03c7 -r e0fab2686bd0 public_html/docs/changes.html --- a/public_html/docs/changes.html Thu Jan 22 16:30:26 2009 -0500 +++ b/public_html/docs/changes.html Sat Jan 24 09:42:02 2009 +0100 @@ -25,13 +25,15 @@ previewing a story with a duplicate story ID.

    • The Trackback editor didn't work since the security token was missing from the editor template.
    • -
    • Fixed various problems with updating feeds, e.g. when chaning topic +
    • Fixed issues with clickable links in plain text postings.
    • +
    • Fixed various problems with updating feeds, e.g. when changing topic permissions.

    Fixes in the bundled Plugins

      +
    • Calendar: You couldn't add a new event to your personal calendar.
    • Links: Changing a link's ID to one that was already in use overwrote the other link.
    • Polls: Changing a poll's ID created a new poll. Also fixed an SQL error diff -r 7ecb1ebb03c7 -r e0fab2686bd0 public_html/docs/history --- a/public_html/docs/history Thu Jan 22 16:30:26 2009 -0500 +++ b/public_html/docs/history Sat Jan 24 09:42:02 2009 +0100 @@ -64,9 +64,11 @@ every other plugin and built-in function does (bug #0000644) [Dirk] -Jan ??, 2009 (1.5.2) ------------- -- Fix for calendar plugin - unable to add personal event [Blaine] +Jan 24, 2009 (1.5.2rc1) +------------ + +- Fixed various issues with COM_makeClickableLinks (bug #0000767, #0000793, + #0000796) [Sami] - The comment submission form didn't show the user's full name when $_CONF['show_fullname'] was enabled [Dirk] - Comments were always showing the username, even when $_CONF['show_fullname'] @@ -147,6 +149,7 @@ Calendar plugin --------------- +- Fix for calendar plugin - unable to add personal event [Blaine] - Make {event_url} available in eventdetails.thtml [Dirk] Links plugin diff -r 7ecb1ebb03c7 -r e0fab2686bd0 public_html/docs/theme.html --- a/public_html/docs/theme.html Thu Jan 22 16:30:26 2009 -0500 +++ b/public_html/docs/theme.html Sat Jan 24 09:42:02 2009 +0100 @@ -239,7 +239,8 @@ admin/trackback/trackbackeditor.thtml
    • The {start_storylink_anchortag} variable in the story templates was missing the closing '>'. This caused the story title to disappear - on some themes.
    • + on some themes. (This was a bug in Geeklog's code, so no theme changes + required)
    • The {site_admin_url} was missing from the Configuration form action in admin/config/configuration.thtml. This may have caused problems making configuration changes on some setups.
    • From geeklog-cvs at lists.geeklog.net Sat Jan 24 03:51:19 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 24 Jan 2009 03:51:19 -0500 Subject: [geeklog-cvs] geeklog: Updated Hebrew language file for the Spam-X plugin, pro... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/704dfe7e4c00 changeset: 6714:704dfe7e4c00 user: Dirk Haun date: Sat Jan 24 09:48:46 2009 +0100 description: Updated Hebrew language file for the Spam-X plugin, provided by LWC diffstat: 2 files changed, 3 insertions(+), 2 deletions(-) plugins/spamx/language/hebrew_utf-8.php | 2 +- public_html/docs/history | 3 ++- diffs (25 lines): diff -r e0fab2686bd0 -r 704dfe7e4c00 plugins/spamx/language/hebrew_utf-8.php --- a/plugins/spamx/language/hebrew_utf-8.php Sat Jan 24 09:42:02 2009 +0100 +++ b/plugins/spamx/language/hebrew_utf-8.php Sat Jan 24 09:48:46 2009 +0100 @@ -105,7 +105,7 @@ 'import_success' => '

      ?????????? ???????????? %d ???????? ???????????? ????????????.', 'import_failure' => '

      ??????????: ???? ?????????? ????????????.', 'allow_url_fopen' => '

      ??????????????, ?????????? ???????? ???????? ???? ???????? ?????????? ?????????? ???? ?????????????? (allow_url_fopen ?????? ???????? off). ?????? ???????????? ???? ???????????? ???????????? ?????????????? ???????? ?????????? ???????? ?????????????? ??-"data" ???? ????????????, %s, ???????? ?????????? ??????:', - 'documentation' => '?????????????????????? ???? ??-Spam-X Plugin', + 'documentation' => '?????????????????????? ???? ??-Spam-X Plugin', 'emailmsg' => "???????? ???????? ?????? ???????? ??: \"%s\"\n?????? ?????????? ??????????: \"%s\"\n\n????????:\"%s\"", 'emailsubject' => '???????? ???????? ??: %s', 'ipblack' => '???????????? ???????????? ???? ???????????? IP ???? Spam-X', diff -r e0fab2686bd0 -r 704dfe7e4c00 public_html/docs/history --- a/public_html/docs/history Sat Jan 24 09:42:02 2009 +0100 +++ b/public_html/docs/history Sat Jan 24 09:48:46 2009 +0100 @@ -142,7 +142,8 @@ - Fixed an issue with story expiry dates on PHP 4/Windows (reported by zeb) [Mike] -- Updated Hebrew language file for the install script, provided by LWC +- Updated Hebrew language file for the install script and Spam-X plugin, + provided by LWC - Updated Japanese language files, provided by the Geeklog.jp group - Updated Polish language files, provided by Robert Stadnik - Updated Slovenian language file for the Links plugin, provided by gape From geeklog-cvs at lists.geeklog.net Sat Jan 24 04:08:40 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 24 Jan 2009 04:08:40 -0500 Subject: [geeklog-cvs] tools: Updated script for Mercurial Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/4ae16cf50fc3 changeset: 21:4ae16cf50fc3 user: Dirk Haun date: Sat Jan 24 10:08:30 2009 +0100 description: Updated script for Mercurial diffstat: 2 files changed, 42 insertions(+), 57 deletions(-) ship/README | 10 ++++-- ship/mkdist.sh | 89 ++++++++++++++++++++++---------------------------------- diffs (175 lines): diff -r 408878562aeb -r 4ae16cf50fc3 ship/README --- a/ship/README Fri Oct 03 17:25:57 2008 +0200 +++ b/ship/README Sat Jan 24 10:08:30 2009 +0100 @@ -2,7 +2,7 @@ requires the following directory structure: ./mkdist.sh -- the script - ./Geeklog-1.x/ -- the local copy of the CVS repository + ./geeklog/geeklog/ -- the local copy of the Mercurial repository ./dist/ -- directory of previous releases ./pear/pear-1.3/ -- the PEAR classes to use live here, e.g. /Archive/ @@ -23,8 +23,12 @@ over the previous version. The script will also print the md5 checksum of the tarball it just created. -The script also has an option to build a German release - from files that -currently only live on my local hard drive ... +There's a third (optional) argument: The name of the directory to pack. That +directory has to be below the "geeklog" directory and defaults to "geeklog" +(hence the ./geeklog/geeklog/ above). To create a tarball from a repository +in ./geeklog/bugfix, use + + ./mkdist.sh 1.4.17sr3 1.4.17sr2 bugfix bye, Dirk diff -r 408878562aeb -r 4ae16cf50fc3 ship/mkdist.sh --- a/ship/mkdist.sh Fri Oct 03 17:25:57 2008 +0200 +++ b/ship/mkdist.sh Sat Jan 24 10:08:30 2009 +0100 @@ -1,14 +1,12 @@ #!/bin/bash # -# mkdist.sh - make a Geeklog distribution from a local CVS copy +# mkdist.sh - make a Geeklog distribution from a local Mercurial repository # -# Usage: mkdist.sh new-version old-version [german] -# e.g. ./mkdist.sh 1.3.9rc1 1.3.8-1sr4 -# -# $Id: mkdist.sh,v 1.3 2008/08/17 16:19:20 dhaun Exp $ +# Usage: mkdist.sh new-version old-version +# e.g. ./mkdist.sh 1.3.9rc1 1.3.8-1sr4 [repository-dir] if [ -z "$1" ]; then - echo "Usage: $0 new-version old-version [german]" + echo "Usage: $0 new-version-number old-version-number [repository-dir]" exit fi @@ -18,13 +16,15 @@ fi if [ -z "$3" ]; then - langv="english" + repository="geeklog" else - langv="german" + repository="$3" fi NEWVERSION="geeklog-$1" OLDVERSION="geeklog-$2" + +echo "Creating $NEWVERSION from $repository" cd dist @@ -32,21 +32,20 @@ rm -rf $NEWVERSION fi -cp -r -p ../Geeklog-1.x $NEWVERSION +# use tar to create a copy without the .hg directory +cd ../geeklog +tar cf gl-temp.tar '--exclude=\.hg' $repository +mv gl-temp.tar ../dist/ +cd ../dist +tar xf gl-temp.tar +rm -f gl-temp.tar +mv $repository $NEWVERSION + cp -r -p ../pear-1.3/pear/* $NEWVERSION/system/pear/ cd $NEWVERSION -# remove old default themes -rm -rf public_html/layout/Classic -rm -rf public_html/layout/clean -rm -rf public_html/layout/Digital_Monochrome -rm -rf public_html/layout/gameserver -rm -rf public_html/layout/Smooth_Blue -rm -rf public_html/layout/XSilver -rm -rf public_html/layout/Yahoo - -# no PDF support for now +# still no PDF support rm public_html/pdfgenerator.php rm -rf public_html/layout/professional/pdfgenerator rm -rf pdfs @@ -59,10 +58,6 @@ # you'd need to set up a honeypot to use it rm -f plugins/spamx/ProjectHoneyPot.Examine.class.php -# don't ship these language files any more -rm -f language/chinese_big5.php -rm -f language/chinese_gb2312.php - # PEAR buildpackage files rm -f plugins/calendar/buildpackage.php rm -f plugins/links/buildpackage.php @@ -71,47 +66,33 @@ rm -f plugins/staticpages/buildpackage.php rm -rf system/build -# no more config.php, yay! -rm -f config.php config.php.dist +# about time we clean up the install directory ... +rm -f public_html/admin/install/addindex.php mv db-config.php.dist db-config.php mv public_html/siteconfig.php.dist public_html/siteconfig.php rm -f system/lib-custom.php.dist find . -type f -name '.*' -exec rm \{\} \; -find . -name CVS -exec rm -r \{\} \; 2>/dev/null +#find . -name CVS -exec rm -r \{\} \; 2>/dev/null find . -type f -exec chmod a-x \{\} \; chmod a+x emailgeeklogstories -# set the default permissions ... -chmod -R 775 backups -chmod -R 775 data -chmod -R 775 logs -# chmod -R 775 pdfs -chmod -R 775 public_html/backend -chmod -R 775 public_html/images/articles -chmod -R 775 public_html/images/topics -chmod -R 775 public_html/images/userphotos - -if [ "$langv" = "german" ]; then - echo "Making German version ..." - rm -rf public_html/docs - mv public_html/docs.german public_html/docs - mv config.php.german config.php - mv sql/mysql_tableanddata.php.german sql/mysql_tableanddata.php - mv sql/updates/mysql_1.3.8_to_1.3.9.php.german sql/updates/mysql_1.3.8_to_1.3.9.php - mv sql/updates/mysql_1.3.9_to_1.3.10.php.german sql/updates/mysql_1.3.9_to_1.3.10.php - mv public_html/admin/install/success.php.german public_html/admin/install/success.php -else - echo "Making English version ..." - rm -rf public_html/docs.german - rm -f config.php.german - rm -f sql/mysql_tableanddata.php.german - rm -f sql/updates/mysql_1.3.8_to_1.3.9.php.german - rm -f sql/updates/mysql_1.3.9_to_1.3.10.php.german - rm -f public_html/admin/install/success.php.german -fi +# set the default permissions +chmod 775 backups +chmod 775 data +chmod 775 logs +chmod 664 logs/*log +# chmod 775 pdfs +chmod 775 public_html/backend +chmod 644 public_html/backend/*.rss +chmod 775 public_html/images/articles +chmod 664 public_html/images/articles/* +chmod 775 public_html/images/topics +chmod 664 public_html/images/topics/* +chmod 775 public_html/images/userphotos +chmod 664 public_html/images/userphotos/* cd .. From geeklog-cvs at lists.geeklog.net Sat Jan 24 08:52:08 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 24 Jan 2009 08:52:08 -0500 Subject: [geeklog-cvs] geeklog: Updated Japanese language file, provided by the Geeklog... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/b3eeb545eec4 changeset: 6715:b3eeb545eec4 user: Dirk Haun date: Sat Jan 24 14:50:56 2009 +0100 description: Updated Japanese language file, provided by the Geeklog.jp group diffstat: 1 file changed, 4 insertions(+), 4 deletions(-) language/japanese_utf-8.php | 8 ++++---- diffs (33 lines): diff -r 7f464d6d419b -r b3eeb545eec4 language/japanese_utf-8.php --- a/language/japanese_utf-8.php Sat Jan 24 09:48:46 2009 +0100 +++ b/language/japanese_utf-8.php Sat Jan 24 14:50:56 2009 +0100 @@ -144,7 +144,7 @@ 92 => '???', 93 => 'Copyright', 94 => '?????????????????????????????????????????????????????????????????????????????????????????????', - 95 => 'Powered By', + 95 => 'powered by', 96 => '????????????', 97 => '??????????????????', 98 => '???????????????', @@ -223,7 +223,7 @@ 2 => '????????????', 3 => '??????', 4 => '???????????????', - 5 => '?????????????????????', + 5 => '?????????', 6 => '??????????????????', 7 => '????????????', 8 => 'PGP???', @@ -424,9 +424,9 @@ 16 => '??????', 17 => '?????????????????????????????????', 18 => '????????????', - 19 => '?????????E-mail', + 19 => '?????????Email', 20 => '??????', - 21 => '?????????????????????', + 21 => '?????????Email', 22 => '?????????????????????????????????????????????????????????????????????????????????', 23 => "???????????????!{$_CONF['site_name']}???????????????????????????\n\n%s ?????????\n{$_CONF['site_url']}\n????????????????????????????????????????????????????????????\n%s ?????????????????????????????????????????????\n??????????????????????????????SPAM???????????????????????????????????????\n?????????????????????????????????????????????????????????????????????????????????????????????", 24 => '?????????????????????????????????????????????????????????????????????', From geeklog-cvs at lists.geeklog.net Sat Jan 24 08:52:11 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 24 Jan 2009 08:52:11 -0500 Subject: [geeklog-cvs] geeklog: Updated Japanese language file, provided by the Geeklog... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/0fc898f2081e changeset: 6716:0fc898f2081e user: Dirk Haun date: Sat Jan 24 14:50:56 2009 +0100 description: Updated Japanese language file, provided by the Geeklog.jp group diffstat: 1 file changed, 4 insertions(+), 4 deletions(-) language/japanese_utf-8.php | 8 ++++---- diffs (33 lines): diff -r 704dfe7e4c00 -r 0fc898f2081e language/japanese_utf-8.php --- a/language/japanese_utf-8.php Sat Jan 24 09:48:46 2009 +0100 +++ b/language/japanese_utf-8.php Sat Jan 24 14:50:56 2009 +0100 @@ -144,7 +144,7 @@ 92 => '???', 93 => 'Copyright', 94 => '?????????????????????????????????????????????????????????????????????????????????????????????', - 95 => 'Powered By', + 95 => 'powered by', 96 => '????????????', 97 => '??????????????????', 98 => '???????????????', @@ -223,7 +223,7 @@ 2 => '????????????', 3 => '??????', 4 => '???????????????', - 5 => '?????????????????????', + 5 => '?????????', 6 => '??????????????????', 7 => '????????????', 8 => 'PGP???', @@ -424,9 +424,9 @@ 16 => '??????', 17 => '?????????????????????????????????', 18 => '????????????', - 19 => '?????????E-mail', + 19 => '?????????Email', 20 => '??????', - 21 => '?????????????????????', + 21 => '?????????Email', 22 => '?????????????????????????????????????????????????????????????????????????????????', 23 => "???????????????!{$_CONF['site_name']}???????????????????????????\n\n%s ?????????\n{$_CONF['site_url']}\n????????????????????????????????????????????????????????????\n%s ?????????????????????????????????????????????\n??????????????????????????????SPAM???????????????????????????????????????\n?????????????????????????????????????????????????????????????????????????????????????????????", 24 => '?????????????????????????????????????????????????????????????????????', From geeklog-cvs at lists.geeklog.net Sat Jan 24 09:49:34 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 24 Jan 2009 09:49:34 -0500 Subject: [geeklog-cvs] geeklog: Added tag geeklog_1_5_2rc1 for changeset b3eeb545eec4 Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/f6a30d243a0f changeset: 6717:f6a30d243a0f user: Dirk Haun date: Sat Jan 24 15:49:23 2009 +0100 description: Added tag geeklog_1_5_2rc1 for changeset b3eeb545eec4 diffstat: 1 file changed, 1 insertion(+) .hgtags | 1 + diffs (7 lines): diff -r b3eeb545eec4 -r f6a30d243a0f .hgtags --- a/.hgtags Sat Jan 24 14:50:56 2009 +0100 +++ b/.hgtags Sat Jan 24 15:49:23 2009 +0100 @@ -1,2 +1,3 @@ f51a1417bd7041bea96370434142498438d4e558 geeklog_1_5_0_stable 8abbb13ee513b6cf2c76d702273c3fa118f9bf5c geeklog_1_5_1_stable +b3eeb545eec477cc120336f895e31a34fd64a486 geeklog_1_5_2rc1 From geeklog-cvs at lists.geeklog.net Sun Jan 25 03:29:44 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 25 Jan 2009 03:29:44 -0500 Subject: [geeklog-cvs] geeklog: Simplified PLG_itemSaved and added an optional $old_id ... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/07cb671a87f0 changeset: 6718:07cb671a87f0 user: Dirk Haun date: Sat Jan 24 21:10:21 2009 +0100 description: Simplified PLG_itemSaved and added an optional $old_id parameter; call PLG_itemSaved whenever a story is saved; drop in_transit column from the stories table diffstat: 9 files changed, 35 insertions(+), 59 deletions(-) public_html/admin/moderation.php | 7 ++--- public_html/index.php | 12 ++++----- sql/mssql_tableanddata.php | 1 sql/mysql_tableanddata.php | 2 - sql/updates/mssql_1.5.2_to_1.6.0.php | 2 + sql/updates/mysql_1.5.2_to_1.6.0.php | 3 ++ system/classes/story.class.php | 8 ++---- system/lib-plugins.php | 42 +++++++++++----------------------- system/lib-story.php | 17 ++++--------- diffs (293 lines): diff -r 0fc898f2081e -r 07cb671a87f0 public_html/admin/moderation.php --- a/public_html/admin/moderation.php Sat Jan 24 14:50:56 2009 +0100 +++ b/public_html/admin/moderation.php Sat Jan 24 21:10:21 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | moderation.php | // | | // | Geeklog main administration page. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -31,8 +31,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: moderation.php,v 1.124 2008/09/04 19:03:29 mjervis Exp $ require_once '../lib-common.php'; require_once 'auth.inc.php'; @@ -536,6 +534,7 @@ "'{$A['sid']}',{$A['uid']},'{$A['tid']}','{$A['title']}','{$A['introtext']}','{$A['bodytext']}','{$A['related']}','{$A['date']}','{$_CONF['show_topic_icon']}','{$_CONF['comment_code']}','{$_CONF['trackback_code']}','{$A['postmode']}',$frontpage,{$A['owner_id']},{$T['group_id']},{$T['perm_owner']},{$T['perm_group']},{$T['perm_members']},{$T['perm_anon']}"); DB_delete($_TABLES['storysubmission'],"$id",$mid[$i]); + PLG_itemSaved($A['sid'], 'article'); COM_rdfUpToDateCheck (); COM_olderStuff (); } else if ($type == 'draft') { diff -r 0fc898f2081e -r 07cb671a87f0 public_html/index.php --- a/public_html/index.php Sat Jan 24 14:50:56 2009 +0100 +++ b/public_html/index.php Sat Jan 24 21:10:21 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.4 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | index.php | // | | // | Geeklog homepage. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2007 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony at tonybibbs.com | // | Mark Limburg - mlimburg at users.sourceforge.net | @@ -31,11 +31,9 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: index.php,v 1.99 2008/08/14 19:05:53 mjervis Exp $ -require_once ('lib-common.php'); -require_once ($_CONF['path_system'] . 'lib-story.php'); +require_once 'lib-common.php'; +require_once $_CONF['path_system'] . 'lib-story.php'; $newstories = false; $displayall = false; @@ -282,7 +280,7 @@ . "{$_TABLES['topics']} AS t WHERE (s.uid = u.uid) AND (s.tid = t.tid) AND" . $sql . "ORDER BY featured DESC, date DESC LIMIT $offset, $limit"; -$msql['mssql']="SELECT STRAIGHT_JOIN s.sid, s.uid, s.draft_flag, s.tid, s.date, s.title, cast(s.introtext as text) as introtext, cast(s.bodytext as text) as bodytext, s.hits, s.numemails, s.comments, s.trackbacks, s.related, s.featured, s.show_topic_icon, s.commentcode, s.trackbackcode, s.statuscode, s.expire, s.postmode, s.frontpage, s.in_transit, s.owner_id, s.group_id, s.perm_owner, s.perm_group, s.perm_members, s.perm_anon, s.advanced_editor_mode, " +$msql['mssql']="SELECT STRAIGHT_JOIN s.sid, s.uid, s.draft_flag, s.tid, s.date, s.title, cast(s.introtext as text) as introtext, cast(s.bodytext as text) as bodytext, s.hits, s.numemails, s.comments, s.trackbacks, s.related, s.featured, s.show_topic_icon, s.commentcode, s.trackbackcode, s.statuscode, s.expire, s.postmode, s.frontpage, s.owner_id, s.group_id, s.perm_owner, s.perm_group, s.perm_members, s.perm_anon, s.advanced_editor_mode, " . " UNIX_TIMESTAMP(s.date) AS unixdate, " . 'UNIX_TIMESTAMP(s.expire) as expireunix, ' . $userfields . ", t.topic, t.imageurl " diff -r 0fc898f2081e -r 07cb671a87f0 sql/mssql_tableanddata.php --- a/sql/mssql_tableanddata.php Sat Jan 24 14:50:56 2009 +0100 +++ b/sql/mssql_tableanddata.php Sat Jan 24 21:10:21 2009 +0100 @@ -260,7 +260,6 @@ [postmode] [varchar] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL , [advanced_editor_mode] [tinyint] NOT NULL , [frontpage] [tinyint] NULL , - [in_transit] [tinyint] NULL , [owner_id] [int] NOT NULL , [group_id] [int] NOT NULL , [perm_owner] [tinyint] NOT NULL , diff -r 0fc898f2081e -r 07cb671a87f0 sql/mysql_tableanddata.php --- a/sql/mysql_tableanddata.php Sat Jan 24 14:50:56 2009 +0100 +++ b/sql/mysql_tableanddata.php Sat Jan 24 21:10:21 2009 +0100 @@ -280,7 +280,6 @@ postmode varchar(10) NOT NULL default 'html', advanced_editor_mode tinyint(1) unsigned default '0', frontpage tinyint(3) unsigned default '1', - in_transit tinyint(1) unsigned default '0', owner_id mediumint(8) NOT NULL default '1', group_id mediumint(8) NOT NULL default '2', perm_owner tinyint(1) unsigned NOT NULL default '3', @@ -296,7 +295,6 @@ INDEX stories_expire(expire), INDEX stories_date(date), INDEX stories_frontpage(frontpage), - INDEX stories_in_transit(in_transit), PRIMARY KEY (sid) ) TYPE=MyISAM "; diff -r 0fc898f2081e -r 07cb671a87f0 sql/updates/mssql_1.5.2_to_1.6.0.php --- a/sql/updates/mssql_1.5.2_to_1.6.0.php Sat Jan 24 14:50:56 2009 +0100 +++ b/sql/updates/mssql_1.5.2_to_1.6.0.php Sat Jan 24 21:10:21 2009 +0100 @@ -1,4 +1,6 @@ 1, 'advanced_editor_mode' => 1, 'frontpage' => 1, - 'in_transit' => 1, 'owner_id' => 1, 'group_id' => 1, 'perm_owner' => 1, @@ -404,7 +402,7 @@ . "u.username, u.fullname, u.photo, u.email, t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s, {$_TABLES['users']} AS u, {$_TABLES['topics']} AS t " . "WHERE (s.uid = u.uid) AND (s.tid = t.tid) AND (sid = '$sid')"; $sql['mssql'] = - "SELECT STRAIGHT_JOIN s.sid, s.uid, s.draft_flag, s.tid, s.date, s.title, CAST(s.introtext AS text) AS introtext, CAST(s.bodytext AS text) AS bodytext, s.hits, s.numemails, s.comments, s.trackbacks, s.related, s.featured, s.show_topic_icon, s.commentcode, s.trackbackcode, s.statuscode, s.expire, s.postmode, s.frontpage, s.in_transit, s.owner_id, s.group_id, s.perm_owner, s.perm_group, s.perm_members, s.perm_anon, s.advanced_editor_mode, " . " UNIX_TIMESTAMP(s.date) AS unixdate, UNIX_TIMESTAMP(s.expire) as expireunix, " . "u.username, u.fullname, u.photo, u.email, t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s, {$_TABLES['users']} AS u, {$_TABLES['topics']} AS t " . "WHERE (s.uid = u.uid) AND (s.tid = t.tid) AND (sid = '$sid')"; + "SELECT STRAIGHT_JOIN s.sid, s.uid, s.draft_flag, s.tid, s.date, s.title, CAST(s.introtext AS text) AS introtext, CAST(s.bodytext AS text) AS bodytext, s.hits, s.numemails, s.comments, s.trackbacks, s.related, s.featured, s.show_topic_icon, s.commentcode, s.trackbackcode, s.statuscode, s.expire, s.postmode, s.frontpage, s.owner_id, s.group_id, s.perm_owner, s.perm_group, s.perm_members, s.perm_anon, s.advanced_editor_mode, " . " UNIX_TIMESTAMP(s.date) AS unixdate, UNIX_TIMESTAMP(s.expire) as expireunix, " . "u.username, u.fullname, u.photo, u.email, t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s, {$_TABLES['users']} AS u, {$_TABLES['topics']} AS t " . "WHERE (s.uid = u.uid) AND (s.tid = t.tid) AND (sid = '$sid')"; } elseif (!empty($sid) && ($mode == 'editsubmission')) { $sql = 'SELECT STRAIGHT_JOIN s.*, UNIX_TIMESTAMP(s.date) AS unixdate, ' . 'u.username, u.fullname, u.photo, u.email, t.topic, t.imageurl, t.group_id, ' . 't.perm_owner, t.perm_group, t.perm_members, t.perm_anon ' . 'FROM ' . $_TABLES['storysubmission'] . ' AS s, ' . $_TABLES['users'] . ' AS u, ' . $_TABLES['topics'] . ' AS t WHERE (s.uid = u.uid) AND' . ' (s.tid = t.tid) AND (sid = \'' . $sid . '\')'; @@ -633,7 +631,6 @@ // Get the related URLs $this->_related = implode("\n", STORY_extractLinks("{$this->_introtext} {$this->_bodytext}")); - $this->_in_transit = 1; $values = ''; $fields = ''; reset($this->_dbFields); @@ -933,6 +930,7 @@ $this->saveToDatabase(); + PLG_itemSaved($this->_sid, 'article'); COM_rdfUpToDateCheck(); COM_olderStuff(); diff -r 0fc898f2081e -r 07cb671a87f0 system/lib-plugins.php --- a/system/lib-plugins.php Sat Jan 24 14:50:56 2009 +0100 +++ b/system/lib-plugins.php Sat Jan 24 21:10:21 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | lib-plugins.php | // | | // | This file implements plugin support in Geeklog. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Blaine Lang - blaine AT portalparts DOT com | @@ -2061,45 +2061,31 @@ * "Generic" plugin API: Save item * * To be called (eventually) whenever Geeklog saves an item into the database. -* Plugins can hook into this and modify the item (which is already in the -* database but not visible on the site yet). -* -* Plugins can signal an error by returning an error message (otherwise, they -* should return 'false' to signal "no errors"). In case of an error, all the -* plugins called up to that point will be invoked through an "abort" call to -* undo their changes. +* Plugins can define their own 'itemsaved' function to be notified whenever +* an item is saved or modified. * * @param string $id unique ID of the item * @param string $type type of the item, e.g. 'article' -* @returns mixed Boolean false for "no error", or an error msg text +* @param string $old_id (optional) old ID when the ID was changed +* @returns void (actually: false, for backward compatibility) +* @note The behaviour of this API function changed in Geeklog 1.6.0 * */ -function PLG_itemSaved($id, $type) +function PLG_itemSaved($id, $type, $old_id = '') { global $_PLUGINS; - $error = false; - - $plugins = count ($_PLUGINS); + $plugins = count($_PLUGINS); for ($save = 0; $save < $plugins; $save++) { - $function = 'plugin_itemsaved_' . $_PLUGINS[$save]; - if (function_exists($function)) { - $error = $function($id, $type); - if ($error !== false) { - // plugin reported a problem - abort - - for ($abort = 0; $abort < $save; $abort++) { - $function = 'plugin_abortsave_' . $_PLUGINS[$abort]; - if (function_exists($function)) { - $function($id, $type); - } - } - break; // out of for($save) loop + if ($_PLUGINS[$save] != $type) { + $function = 'plugin_itemsaved_' . $_PLUGINS[$save]; + if (function_exists($function)) { + $function($id, $type, $old_id); } } } - return $error; + return false; // for backward compatibility } /** diff -r 0fc898f2081e -r 07cb671a87f0 system/lib-story.php --- a/system/lib-story.php Sat Jan 24 14:50:56 2009 +0100 +++ b/system/lib-story.php Sat Jan 24 21:10:21 2009 +0100 @@ -1259,17 +1259,10 @@ if ($result == STORY_SAVED) { // see if any plugins want to act on that story - $plugin_error = PLG_itemSaved ($sid, 'article'); - - // always clear 'in_transit' flag - DB_change ($_TABLES['stories'], 'in_transit', 0, 'sid', $sid); - - // in case of an error go back to the story editor - if ($plugin_error !== false) { - $output .= COM_siteHeader ('menu', $LANG24[5]); - $output .= storyeditor ($sid, 'retry', $plugin_error); - $output .= COM_siteFooter (); - return PLG_RET_ERROR; + if ((! empty($args['old_sid'])) && ($args['old_sid'] != $sid)) { + PLG_itemSaved($sid, 'article', $args['old_sid']); + } else { + PLG_itemSaved($sid, 'article'); } // update feed(s) and Older Stories block @@ -1475,7 +1468,7 @@ . "u.username, u.fullname, u.photo, u.email, t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s, {$_TABLES['users']} AS u, {$_TABLES['topics']} AS t " . "WHERE (s.uid = u.uid) AND (s.tid = t.tid)" . COM_getPermSQL('AND', $_USER['uid'], 2, 's') . $order . $limit; $sql['mssql'] = - "SELECT STRAIGHT_JOIN s.sid, s.uid, s.draft_flag, s.tid, s.date, s.title, CAST(s.introtext AS text) AS introtext, CAST(s.bodytext AS text) AS bodytext, s.hits, s.numemails, s.comments, s.trackbacks, s.related, s.featured, s.show_topic_icon, s.commentcode, s.trackbackcode, s.statuscode, s.expire, s.postmode, s.frontpage, s.in_transit, s.owner_id, s.group_id, s.perm_owner, s.perm_group, s.perm_members, s.perm_anon, s.advanced_editor_mode, " . " UNIX_TIMESTAMP(s.date) AS unixdate, UNIX_TIMESTAMP(s.expire) as expireunix, " . "u.username, u.fullname, u.photo, u.email, t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s, {$_TABLES['users']} AS u, {$_TABLES['topics']} AS t " . "WHERE (s.uid = u.uid) AND (s.tid = t.tid)" . COM_getPermSQL('AND', $_USER['uid'], 2, 's') . $order . $limit; + "SELECT STRAIGHT_JOIN s.sid, s.uid, s.draft_flag, s.tid, s.date, s.title, CAST(s.introtext AS text) AS introtext, CAST(s.bodytext AS text) AS bodytext, s.hits, s.numemails, s.comments, s.trackbacks, s.related, s.featured, s.show_topic_icon, s.commentcode, s.trackbackcode, s.statuscode, s.expire, s.postmode, s.frontpage, s.owner_id, s.group_id, s.perm_owner, s.perm_group, s.perm_members, s.perm_anon, s.advanced_editor_mode, " . " UNIX_TIMESTAMP(s.date) AS unixdate, UNIX_TIMESTAMP(s.expire) as expireunix, " . "u.username, u.fullname, u.photo, u.email, t.topic, t.imageurl " . "FROM {$_TABLES['stories']} AS s, {$_TABLES['users']} AS u, {$_TABLES['topics']} AS t " . "WHERE (s.uid = u.uid) AND (s.tid = t.tid)" . COM_getPermSQL('AND', $_USER['uid'], 2, 's') . $order . $limit; $result = DB_query($sql); From geeklog-cvs at lists.geeklog.net Sun Jan 25 03:29:44 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 25 Jan 2009 03:29:44 -0500 Subject: [geeklog-cvs] geeklog: Introduced PLG_itemDeleted and call it when deleting a ... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/b75043713337 changeset: 6719:b75043713337 user: Dirk Haun date: Sun Jan 25 09:28:56 2009 +0100 description: Introduced PLG_itemDeleted and call it when deleting a story diffstat: 2 files changed, 34 insertions(+), 4 deletions(-) system/lib-plugins.php | 27 +++++++++++++++++++++++++++ system/lib-story.php | 11 +++++++---- diffs (71 lines): diff -r 07cb671a87f0 -r b75043713337 system/lib-plugins.php --- a/system/lib-plugins.php Sat Jan 24 21:10:21 2009 +0100 +++ b/system/lib-plugins.php Sun Jan 25 09:28:56 2009 +0100 @@ -2089,6 +2089,33 @@ } /** +* "Generic" plugin API: Delete item +* +* To be called (eventually) whenever Geeklog removes an item from the database. +* Plugins can define their own 'itemdeleted' function to be notified whenever +* an item is deleted. +* +* @param string $id ID of the item +* @param string $type type of the item, e.g. 'article' +* @returns void +* +*/ +function PLG_itemDeleted($id, $type) +{ + global $_PLUGINS; + + $plugins = count($_PLUGINS); + for ($del = 0; $del < $plugins; $del++) { + if ($_PLUGINS[$del] != $type) { + $function = 'plugin_itemdeleted_' . $_PLUGINS[$del]; + if (function_exists($function)) { + $function($id, $type); + } + } + } +} + +/** * "Generic" plugin API: Display item * * To be called (eventually) whenever Geeklog displays an item. diff -r 07cb671a87f0 -r b75043713337 system/lib-story.php --- a/system/lib-story.php Sat Jan 24 21:10:21 2009 +0100 +++ b/system/lib-story.php Sun Jan 25 09:28:56 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | lib-story.php | // | | // | Story-related functions needed in more than one place. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -1327,9 +1327,12 @@ // delete Trackbacks DB_query ("DELETE FROM {$_TABLES['trackback']} WHERE sid = '$sid' AND type = 'article';"); + // notify plugins + PLG_itemDeleted($sid, 'article'); + // update RSS feed and Older Stories block - COM_rdfUpToDateCheck (); - COM_olderStuff (); + COM_rdfUpToDateCheck(); + COM_olderStuff(); $output = COM_refresh ($_CONF['site_admin_url'] . '/story.php?msg=10'); From geeklog-cvs at lists.geeklog.net Sun Jan 25 05:10:36 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 25 Jan 2009 05:10:36 -0500 Subject: [geeklog-cvs] geeklog: Implemented PLG_itemSaved and PLG_itemDeleted for the S... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/d7519b7d682a changeset: 6721:d7519b7d682a user: Dirk Haun date: Sun Jan 25 10:29:26 2009 +0100 description: Implemented PLG_itemSaved and PLG_itemDeleted for the Static Pages plugin diffstat: 1 file changed, 10 insertions(+), 4 deletions(-) plugins/staticpages/services.inc.php | 14 ++++++++++---- diffs (50 lines): diff -r 0db6fc3bf268 -r d7519b7d682a plugins/staticpages/services.inc.php --- a/plugins/staticpages/services.inc.php Sun Jan 25 10:14:11 2009 +0100 +++ b/plugins/staticpages/services.inc.php Sun Jan 25 10:29:26 2009 +0100 @@ -2,13 +2,13 @@ // Reminder: always indent with 4 spaces (no tabs). // +---------------------------------------------------------------------------+ -// | Static Pages Plugin 1.5 | +// | Static Pages Plugin 1.6 | // +---------------------------------------------------------------------------+ // | services.inc.php | // | | // | This file implements the services provided by the 'Static Pages' plugin. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Tom Willett - twillett AT users DOT sourceforge DOT net | @@ -32,8 +32,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: services.inc.php,v 1.13 2008/07/28 19:35:46 dhaun Exp $ // this must be kept in synch with the actual size of 'sp_id' in the db ... define('STATICPAGE_MAX_ID_LENGTH', 40); @@ -374,6 +372,12 @@ DB_delete ($_TABLES['staticpage'], 'sp_id', $sp_old_id); } + if (empty($sp_old_id) || ($sp_id == $sp_old_id)) { + PLG_itemSaved($sp_id, 'staticpages'); + } else { + PLG_itemSaved($sp_id, 'staticpages', $sp_old_id); + } + $url = COM_buildURL($_CONF['site_url'] . '/staticpages/index.php?page=' . $sp_id); $output .= PLG_afterSaveSwitch($_SP_CONF['aftersave'], $url, @@ -435,6 +439,8 @@ } DB_delete ($_TABLES['staticpage'], 'sp_id', $sp_id); + + PLG_itemDeleted($sp_id, 'staticpages'); return PLG_RET_OK; } From geeklog-cvs at lists.geeklog.net Sun Jan 25 05:10:36 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 25 Jan 2009 05:10:36 -0500 Subject: [geeklog-cvs] geeklog: Remove the (unused) in_transit flag from the Calendar p... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/0db6fc3bf268 changeset: 6720:0db6fc3bf268 user: Dirk Haun date: Sun Jan 25 10:14:11 2009 +0100 description: Remove the (unused) in_transit flag from the Calendar plugin diffstat: 5 files changed, 3 insertions(+), 101 deletions(-) plugins/calendar/functions.inc | 24 -------------------- plugins/calendar/sql/mssql_install.php | 3 -- plugins/calendar/sql/mssql_updates.php | 37 -------------------------------- plugins/calendar/sql/mysql_install.php | 3 -- plugins/calendar/sql/mysql_updates.php | 37 -------------------------------- diffs (163 lines): diff -r b75043713337 -r 0db6fc3bf268 plugins/calendar/functions.inc --- a/plugins/calendar/functions.inc Sun Jan 25 09:28:56 2009 +0100 +++ b/plugins/calendar/functions.inc Sun Jan 25 10:14:11 2009 +0100 @@ -1435,7 +1435,7 @@ */ function plugin_upgrade_calendar() { - global $_CONF, $_TABLES, $_DB_dbms; + global $_CONF, $_TABLES; $installed_version = DB_getItem($_TABLES['plugins'], 'pi_version', "pi_name = 'calendar'"); @@ -1453,28 +1453,6 @@ $inst_parms = plugin_autoinstall_calendar('calendar'); $pi_gl_version = $inst_parms['info']['pi_gl_version']; - - require_once $_CONF['path'] . 'plugins/calendar/sql/' - . $_DB_dbms . '_updates.php'; - - $current_version = $installed_version; - $done = false; - while (! $done) { - switch ($current_version) { - case '1.0.2': - if (isset($_UPDATES[$current_version])) { - $_SQL = $_UPDATES[$current_version]; - foreach ($_SQL as $sql) { - DB_query($sql); - } - } - $current_version = '1.1.0'; - break; - - default: - $done = true; - } - } DB_query("UPDATE {$_TABLES['plugins']} SET pi_version = '$code_version', pi_gl_version = '$pi_gl_version' WHERE pi_name = 'calendar'"); diff -r b75043713337 -r 0db6fc3bf268 plugins/calendar/sql/mssql_install.php --- a/plugins/calendar/sql/mssql_install.php Sun Jan 25 09:28:56 2009 +0100 +++ b/plugins/calendar/sql/mssql_install.php Sun Jan 25 10:14:11 2009 +0100 @@ -6,7 +6,7 @@ // +---------------------------------------------------------------------------+ // | mssql_install.php | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -57,7 +57,6 @@ [location] [varchar] (128) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [timestart] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , [timeend] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL , - [in_transit] [tinyint] NULL ) ON [PRIMARY] "; diff -r b75043713337 -r 0db6fc3bf268 plugins/calendar/sql/mssql_updates.php --- a/plugins/calendar/sql/mssql_updates.php Sun Jan 25 09:28:56 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ - array( - "ALTER TABLE {$_TABLES['events']} ADD in_transit tinyint NULL" - ) - -); - -?> diff -r b75043713337 -r 0db6fc3bf268 plugins/calendar/sql/mysql_install.php --- a/plugins/calendar/sql/mysql_install.php Sun Jan 25 09:28:56 2009 +0100 +++ b/plugins/calendar/sql/mysql_install.php Sun Jan 25 10:14:11 2009 +0100 @@ -6,7 +6,7 @@ // +---------------------------------------------------------------------------+ // | mysql_install.php | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -56,7 +56,6 @@ location varchar(128) default NULL, timestart time default NULL, timeend time default NULL, - in_transit tinyint(1) unsigned default '0', INDEX events_eid(eid), INDEX events_event_type(event_type), INDEX events_datestart(datestart), diff -r b75043713337 -r 0db6fc3bf268 plugins/calendar/sql/mysql_updates.php --- a/plugins/calendar/sql/mysql_updates.php Sun Jan 25 09:28:56 2009 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +0,0 @@ - array( - "ALTER TABLE {$_TABLES['events']} ADD in_transit tinyint(1) unsigned default '0' AFTER timeend" - ) - -); - -?> From geeklog-cvs at lists.geeklog.net Sun Jan 25 05:10:38 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 25 Jan 2009 05:10:38 -0500 Subject: [geeklog-cvs] geeklog: Implemented PLG_itemSaved and PLG_itemDeleted for the P... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/f91c2eab2efa changeset: 6723:f91c2eab2efa user: Dirk Haun date: Sun Jan 25 10:46:22 2009 +0100 description: Implemented PLG_itemSaved and PLG_itemDeleted for the Polls plugin diffstat: 1 file changed, 8 insertions(+) public_html/admin/plugins/polls/index.php | 8 ++++++++ diffs (25 lines): diff -r f7a22f228d0c -r f91c2eab2efa public_html/admin/plugins/polls/index.php --- a/public_html/admin/plugins/polls/index.php Sun Jan 25 10:40:33 2009 +0100 +++ b/public_html/admin/plugins/polls/index.php Sun Jan 25 10:46:22 2009 +0100 @@ -293,6 +293,12 @@ . "is_open, hideresults, statuscode, commentcode, owner_id, group_id, " . "perm_owner, perm_group, perm_members, perm_anon",$sql); + if (empty($old_pid) || ($old_pid == $pid)) { + PLG_itemSaved($pid, 'polls'); + } else { + PLG_itemSaved($pid, 'polls', $old_pid); + } + if ($_POLL_VERBOSE) { COM_errorLog ('**** Leaving savepoll() in ' . $_CONF['site_admin_url'] . '/plugins/polls/index.php ***'); @@ -528,6 +534,8 @@ DB_delete ($_TABLES['pollquestions'], 'pid', $pid); DB_query ("DELETE FROM {$_TABLES['comments']} WHERE sid = '$pid' AND type = 'polls'"); + PLG_itemDeleted($pid, 'polls'); + return COM_refresh ($_CONF['site_admin_url'] . '/plugins/polls/index.php?msg=20'); } From geeklog-cvs at lists.geeklog.net Sun Jan 25 05:10:37 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 25 Jan 2009 05:10:37 -0500 Subject: [geeklog-cvs] geeklog: Implemented PLG_itemSaved and PLG_itemDeleted for the C... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/f7a22f228d0c changeset: 6722:f7a22f228d0c user: Dirk Haun date: Sun Jan 25 10:40:33 2009 +0100 description: Implemented PLG_itemSaved and PLG_itemDeleted for the Calendar plugin diffstat: 2 files changed, 11 insertions(+), 7 deletions(-) plugins/calendar/functions.inc | 10 +++++++--- public_html/admin/plugins/calendar/index.php | 8 ++++---- diffs (72 lines): diff -r d7519b7d682a -r f7a22f228d0c plugins/calendar/functions.inc --- a/plugins/calendar/functions.inc Sun Jan 25 10:29:26 2009 +0100 +++ b/plugins/calendar/functions.inc Sun Jan 25 10:40:33 2009 +0100 @@ -7,10 +7,10 @@ // | 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 CAlendar | -// | plugin' PHP files. | +// | API method and 2) implements all the common code needed by the Calendar | +// | plugin's PHP files. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Tom Willett - twillett AT users DOT sourceforge DOT net | @@ -594,6 +594,8 @@ 'eid,title,event_type,url,datestart,timestart,dateend,timeend,allday,location,address1,address2,city,state,zipcode,description,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon', "{$A['eid']},'{$A['title']}','{$A['event_type']}','{$A['url']}','{$A['datestart']}','{$A['timestart']}','{$A['dateend']}','{$A['timeend']}',{$A['allday']},'{$A['location']}','{$A['address1']}','{$A['address2']}','{$A['city']}','{$A['state']}','{$A['zipcode']}','{$A['description']}',$owner_id,{$A['group_id']},{$A['perm_owner']},{$A['perm_group']},{$A['perm_members']},{$A['perm_anon']}"); + PLG_itemSaved($A['eid'], 'calendar'); + if (isset($_CA_CONF['notification']) && ($_CA_CONF['notification'] == 1)) { CALENDAR_sendNotification($_TABLES['events'], $A); @@ -827,6 +829,8 @@ DB_delete($_TABLES['events'], 'eid', $eid); DB_delete($_TABLES['personal_events'], 'eid', $eid); + + PLG_itemDeleted($eid, 'calendar'); COM_rdfUpToDateCheck('calendar'); return COM_refresh($_CONF['site_admin_url'] . '/plugins/calendar/index.php?msg=18'); diff -r d7519b7d682a -r f7a22f228d0c public_html/admin/plugins/calendar/index.php --- a/public_html/admin/plugins/calendar/index.php Sun Jan 25 10:29:26 2009 +0100 +++ b/public_html/admin/plugins/calendar/index.php Sun Jan 25 10:40:33 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Calendar Plugin 1.0 | +// | Calendar Plugin 1.1 | // +---------------------------------------------------------------------------+ // | index.php | // | | // | Geeklog Calendar Plugin administration page. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -31,8 +31,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: index.php,v 1.38 2008/08/10 15:29:45 dhaun Exp $ require_once '../../../lib-common.php'; require_once '../../auth.inc.php'; @@ -535,6 +533,8 @@ ."$perm_anon,{$P['uid']},'$location','$timestart','$timeend'"); } } + + PLG_itemSaved($eid, 'calendar'); COM_rdfUpToDateCheck('calendar', $event_type, $eid); return PLG_afterSaveSwitch ( From geeklog-cvs at lists.geeklog.net Sun Jan 25 05:10:39 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 25 Jan 2009 05:10:39 -0500 Subject: [geeklog-cvs] geeklog: Implemented PLG_itemSaved and PLG_itemDeleted for the L... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/952553d86ad1 changeset: 6724:952553d86ad1 user: Dirk Haun date: Sun Jan 25 11:10:01 2009 +0100 description: Implemented PLG_itemSaved and PLG_itemDeleted for the Links plugin diffstat: 2 files changed, 14 insertions(+), 5 deletions(-) plugins/links/functions.inc | 4 +++- public_html/admin/plugins/links/index.php | 15 +++++++++++---- diffs (72 lines): diff -r f91c2eab2efa -r 952553d86ad1 plugins/links/functions.inc --- a/plugins/links/functions.inc Sun Jan 25 10:46:22 2009 +0100 +++ b/plugins/links/functions.inc Sun Jan 25 11:10:01 2009 +0100 @@ -10,7 +10,7 @@ // | API method and 2) implements all the common code needed by the Links | // | Plugins' PHP files. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users.sourceforge DOT net | @@ -1037,6 +1037,8 @@ 'lid,cid,url,description,title,date,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon', "{$A['lid']},'{$A['cid']}','{$A['url']}','{$A['description']}','{$A['title']}',NOW(),$owner_id,{$A['group_id']},{$A['perm_owner']},{$A['perm_group']},{$A['perm_members']},{$A['perm_anon']}"); + PLG_itemSaved($A['lid'], 'links'); + if ($_LI_CONF['notification'] == 1) { LINKS_sendNotification($_TABLES['links'], $A); } diff -r f91c2eab2efa -r 952553d86ad1 public_html/admin/plugins/links/index.php --- a/public_html/admin/plugins/links/index.php Sun Jan 25 10:46:22 2009 +0100 +++ b/public_html/admin/plugins/links/index.php Sun Jan 25 11:10:01 2009 +0100 @@ -2,13 +2,13 @@ // Reminder: always indent with 4 spaces (no tabs). // +---------------------------------------------------------------------------+ -// | Links Plugin 2.0 | +// | Links Plugin 2.1 | // +---------------------------------------------------------------------------+ // | index.php | // | | // | Geeklog Links Plugin administration page. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -31,8 +31,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: index.php,v 1.61 2008/06/07 12:41:45 dhaun Exp $ /** * Geeklog links administration page. @@ -319,6 +317,13 @@ DB_delete ($_TABLES['links'], 'lid', $old_lid); DB_save ($_TABLES['links'], 'lid,cid,url,description,title,date,hits,owner_id,group_id,perm_owner,perm_group,perm_members,perm_anon', "'$lid','$cid','$url','$description','$title',NOW(),'$hits',$owner_id,$group_id,$perm_owner,$perm_group,$perm_members,$perm_anon"); + + if (empty($old_lid) || ($old_lid == $lid)) { + PLG_itemSaved($lid, 'links'); + } else { + PLG_itemSaved($lid, 'links', $old_lid); + } + // Get category for rdf check $category = DB_getItem ($_TABLES['linkcategories'],"category","cid='{$cid}'"); COM_rdfUpToDateCheck ('links', $category, $lid); @@ -461,6 +466,8 @@ DB_delete($_TABLES['links'], 'lid', $lid); + PLG_itemDeleted($lid, 'links'); + return COM_refresh($_CONF['site_admin_url'] . '/plugins/links/index.php?msg=3'); } elseif ($type == 'submission') { From geeklog-cvs at lists.geeklog.net Sun Jan 25 11:28:53 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 25 Jan 2009 11:28:53 -0500 Subject: [geeklog-cvs] geeklog: Add new permissions plugin.install and plugin.upload fo... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/51b1f7bf224c changeset: 6725:51b1f7bf224c user: Dirk Haun date: Sun Jan 25 17:28:17 2009 +0100 description: Add new permissions plugin.install and plugin.upload for more fine-grained control to the plugin admin panel (bug #0000637) diffstat: 7 files changed, 137 insertions(+), 46 deletions(-) public_html/admin/install/lib-upgrade.php | 2 public_html/admin/plugins.php | 81 +++++++++++++++++------------ public_html/docs/history | 26 +++++---- sql/mssql_tableanddata.php | 6 +- sql/mysql_tableanddata.php | 6 +- sql/updates/mssql_1.5.2_to_1.6.0.php | 31 +++++++++++ sql/updates/mysql_1.5.2_to_1.6.0.php | 31 +++++++++++ diffs (truncated from 358 to 300 lines): diff -r 952553d86ad1 -r 51b1f7bf224c public_html/admin/install/lib-upgrade.php --- a/public_html/admin/install/lib-upgrade.php Sun Jan 25 11:10:01 2009 +0100 +++ b/public_html/admin/install/lib-upgrade.php Sun Jan 25 17:28:17 2009 +0100 @@ -461,8 +461,10 @@ case '1.5.2': require_once $_CONF['path'] . 'sql/updates/' . $_DB_dbms . '_1.5.2_to_1.6.0.php'; + INST_updateDB($_SQL); update_ConfValues(); + upgrade_addPluginPermissions(); $current_gl_version = '1.6.0'; $_SQL = ''; diff -r 952553d86ad1 -r 51b1f7bf224c public_html/admin/plugins.php --- a/public_html/admin/plugins.php Sun Jan 25 11:10:01 2009 +0100 +++ b/public_html/admin/plugins.php Sun Jan 25 17:28:17 2009 +0100 @@ -48,7 +48,7 @@ $display = ''; -if (!SEC_hasrights('plugin.edit')) { +if (!SEC_hasRights('plugin.edit')) { $display .= COM_siteHeader('menu', $MESSAGE[30]) . COM_showMessageText($MESSAGE[29], $MESSAGE[30]) . COM_siteFooter(); @@ -65,7 +65,7 @@ * @return string HTML for plugin editor form or error message * */ -function plugineditor ($pi_name, $confirmed = 0) +function plugineditor($pi_name, $confirmed = 0) { global $_CONF, $_TABLES, $_USER, $LANG32, $LANG_ADMIN; @@ -104,9 +104,11 @@ $plg_templates->set_var('lang_cancel', $LANG_ADMIN['cancel']); $plg_templates->set_var('lang_delete', $LANG_ADMIN['delete']); $plg_templates->set_var('pi_icon', PLG_getIcon($pi_name)); - if (!empty($pi_name)) { - $plg_templates->set_var ('delete_option', ''); + if (SEC_hasRights('plugin.install')) { + $plg_templates->set_var('delete_option', ''); + } else { + $plg_templates->set_var('delete_option', ''); } $plugin_code_version = PLG_chkVersion($pi_name); if (empty($plugin_code_version)) { @@ -816,10 +818,13 @@ $token = SEC_createToken(); $retval .= listplugins($token); - $retval .= show_newplugins($token); + if (SEC_hasRights('plugin.install')) { + $retval .= show_newplugins($token); + } // If the web server will allow the user to upload a plugin - if (plugin_upload_enabled()) { + if (plugin_upload_enabled() && + SEC_hasRights('plugin.install,plugin.upload')) { $retval .= plugin_show_uploadform($token); } @@ -1164,23 +1169,28 @@ } if (($mode == $LANG_ADMIN['delete']) && !empty($LANG_ADMIN['delete'])) { $pi_name = COM_applyFilter($_POST['pi_name']); - if (($_POST['confirmed'] == 1) && SEC_checkToken()) { - $msg = do_uninstall($pi_name); - if ($msg === false) { - echo COM_refresh($_CONF['site_admin_url'] . '/plugins.php'); - } else { - echo COM_refresh($_CONF['site_admin_url'] . '/plugins.php?msg=' - . $msg); + if ((! empty($pi_name)) && SEC_hasRights('plugin.install')) { + if (($_POST['confirmed'] == 1) && SEC_checkToken()) { + $msg = do_uninstall($pi_name); + if ($msg === false) { + echo COM_refresh($_CONF['site_admin_url'] . '/plugins.php'); + } else { + echo COM_refresh($_CONF['site_admin_url'] . '/plugins.php?msg=' + . $msg); + } + exit; + } else { // ask user for confirmation + $display .= COM_siteHeader('menu', $LANG32[30]); + $display .= COM_startBlock($LANG32[30], '', + COM_getBlockTemplate('_msg_block', 'header')); + $display .= $LANG32[31]; + $display .= COM_endBlock(COM_getBlockTemplate('_msg_block', + 'footer')); + $display .= plugineditor($pi_name, 1); + $display .= COM_siteFooter(); } - exit; - } else { // ask user for confirmation - $display .= COM_siteHeader('menu', $LANG32[30]); - $display .= COM_startBlock($LANG32[30], '', - COM_getBlockTemplate('_msg_block', 'header')); - $display .= $LANG32[31]; - $display .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer')); - $display .= plugineditor($pi_name, 1); - $display .= COM_siteFooter(); + } else { + $display = COM_refresh($_CONF['site_admin_url'] . '/plugins.php'); } } elseif ((($mode == $LANG32[34]) && !empty($LANG32[34])) && SEC_checkToken()) { // update @@ -1205,19 +1215,24 @@ $enabled, COM_applyFilter($_POST['pi_homepage'])); } elseif (($mode == 'autoinstall') && SEC_checkToken()) { - $plugin = ''; - if (isset($_GET['plugin'])) { - $plugin = COM_applyFilter($_GET['plugin']); - } - if (plugin_autoinstall($plugin)) { - $display .= COM_refresh($_CONF['site_admin_url'] - . '/plugins.php?msg=44'); + if (SEC_hasRights('plugin.install')) { + $plugin = ''; + if (isset($_GET['plugin'])) { + $plugin = COM_applyFilter($_GET['plugin']); + } + if (plugin_autoinstall($plugin)) { + $display .= COM_refresh($_CONF['site_admin_url'] + . '/plugins.php?msg=44'); + } else { + $display .= COM_refresh($_CONF['site_admin_url'] + . '/plugins.php?msg=72'); + } } else { - $display .= COM_refresh($_CONF['site_admin_url'] - . '/plugins.php?msg=72'); + $display = COM_refresh($_CONF['site_admin_url'] . '/plugins.php'); } -} elseif (isset($_FILES['plugin']) && SEC_checkToken()) { +} elseif (isset($_FILES['plugin']) && SEC_checkToken() && + SEC_hasRights('plugin.install,plugin.upload')) { $display .= plugin_upload(); } else { // 'cancel' or no mode at all diff -r 952553d86ad1 -r 51b1f7bf224c public_html/docs/history --- a/public_html/docs/history Sun Jan 25 11:10:01 2009 +0100 +++ b/public_html/docs/history Sun Jan 25 17:28:17 2009 +0100 @@ -1,6 +1,6 @@ Geeklog History/Changes: -??? ??, 2009 (1.6.0) +Mar ??, 2009 (1.6.0) ------------ Geeklog 1.6.0 incorporates the following projects implemented during @@ -11,10 +11,14 @@ + (TBD) Comment moderation and editable comments, by Jared Wenerd Other changes: +- Add new permissions plugin.install and plugin.upload for more fine-grained + control to the plugin admin panel (bug #0000637) [Dirk] +- Introduced new plugin API function PLG_itemDeleted [Dirk] +- Changed API for PLG_itemSaved to make it simpler and easier to use [Dirk] - Updated FCKeditor to version 2.6.4 [Blaine] - Usersettings.php - can not change password when custom membership is enabled. - Modified CUSTOM_userCheck to return both a error message string and Error code. - Updated users.php and usersettings,php (bug #0000776) [Blaine] + Modified CUSTOM_userCheck to return both a error message string and Error + code. Updated users.php and usersettings,php (bug #0000776) [Blaine] - Implemented extended API for PLG_getItemInfo [mystral-kk, Dirk] - Fixed inconsistencies and various small mistakes when displaying "Access denied" messages on the admin pages [Dirk] @@ -32,12 +36,12 @@ Calendar plugin --------------- - Added auto installation support [Dirk] -- Added support for PLG_getItemInfo [Dirk] - -Links plugin ------------- -- Added auto installation support [Dirk] -- Added support for PLG_getItemInfo [Dirk] +- Added support for PLG_getItemInfo, PLG_itemSaved, PLG_itemDeleted [Dirk] + +Links plugin +------------ +- Added auto installation support [Dirk] +- Added support for PLG_getItemInfo, PLG_itemSaved, PLG_itemDeleted [Dirk] - Introduced function LINKS_getCategorySQL and fixed visibility of link categories in the Top 10 Links list and site statistics [Dirk] - Added an option to allow opening external links in a new window (feature @@ -47,7 +51,7 @@ Polls plugin ------------ - Added auto installation support [Dirk] -- Added support for PLG_getItemInfo [Dirk] +- Added support for PLG_getItemInfo, PLG_itemSaved, PLG_itemDeleted [Dirk] - Extended length of poll IDs to 40 characters (feature request #0000754) [Dirk] Spam-X @@ -57,7 +61,7 @@ Static Pages plugin ------------------- - Added auto installation support [Dirk] -- Added support for PLG_getItemInfo [Dirk] +- Added support for PLG_getItemInfo, PLG_itemSaved, PLG_itemDeleted [Dirk] - The printable.thtml template file uses the HTML Strict doctype and print.css now [Dirk] - Display "successfully saved" and "successfully deleted" messages, just like diff -r 952553d86ad1 -r 51b1f7bf224c sql/mssql_tableanddata.php --- a/sql/mssql_tableanddata.php Sun Jan 25 11:10:01 2009 +0100 +++ b/sql/mssql_tableanddata.php Sun Jan 25 17:28:17 2009 +0100 @@ -1178,6 +1178,8 @@ $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (14,11)"; $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (15,11)"; $_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (16,4)"; +$_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (17,10)"; +$_SQL[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (18,10)"; $_SQL[] = " set identity_insert {$_TABLES['blocks']} on; @@ -1254,10 +1256,12 @@ INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (9,'webservices.atompub', 'May use Atompub Webservices (if restricted)', 1) INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (10,'block.edit','Access to block editor',1) INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (11,'topic.edit','Access to topic editor',1) -INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (13,'plugin.edit','Access to plugin editor',1) +INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (13,'plugin.edit','Can change plugin status',1) INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (14,'group.edit','Ability to edit groups',1) INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (15,'group.delete','Ability to delete groups',1) INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (16,'block.delete','Ability to delete a block',1) +INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (17,'plugin.install','Can install/uninstall plugins',1) +INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (18,'plugin.upload','Can upload new plugins',1) set identity_insert {$_TABLES['features']} off "; diff -r 952553d86ad1 -r 51b1f7bf224c sql/mysql_tableanddata.php --- a/sql/mysql_tableanddata.php Sun Jan 25 11:10:01 2009 +0100 +++ b/sql/mysql_tableanddata.php Sun Jan 25 17:28:17 2009 +0100 @@ -506,6 +506,8 @@ $_DATA[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (14,11) "; $_DATA[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (15,11) "; $_DATA[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (16,4) "; +$_DATA[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (17,10) "; +$_DATA[] = "INSERT INTO {$_TABLES['access']} (acc_ft_id, acc_grp_id) VALUES (18,10) "; $_DATA[] = "INSERT INTO {$_TABLES['blocks']} (bid, is_enabled, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (1,1,'user_block','gldefault','User Functions','all',2,'','','0000-00-00 00:00:00',1,'',4,2,3,3,2,2) "; $_DATA[] = "INSERT INTO {$_TABLES['blocks']} (bid, is_enabled, name, type, title, tid, blockorder, content, rdfurl, rdfupdated, onleft, phpblockfn, group_id, owner_id, perm_owner, perm_group, perm_members, perm_anon) VALUES (2,1,'admin_block','gldefault','Admins Only','all',1,'','','0000-00-00 00:00:00',1,'',4,2,3,3,2,2) "; @@ -566,10 +568,12 @@ $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (9,'webservices.atompub', 'May use Atompub Webservices (if restricted)', 1) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (10,'block.edit','Access to block editor',1) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (11,'topic.edit','Access to topic editor',1) "; -$_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (13,'plugin.edit','Access to plugin editor',1) "; +$_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (13,'plugin.edit','Can change plugin status',1) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (14,'group.edit','Ability to edit groups',1) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (15,'group.delete','Ability to delete groups',1) "; $_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (16,'block.delete','Ability to delete a block',1) "; +$_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (17,'plugin.install','Can install/uninstall plugins',1) "; +$_DATA[] = "INSERT INTO {$_TABLES['features']} (ft_id, ft_name, ft_descr, ft_gl_core) VALUES (18,'plugin.upload','Can upload new plugins',1) "; $_DATA[] = "INSERT INTO {$_TABLES['frontpagecodes']} (code, name) VALUES (0,'Show Only in Topic') "; $_DATA[] = "INSERT INTO {$_TABLES['frontpagecodes']} (code, name) VALUES (1,'Show on Front Page') "; diff -r 952553d86ad1 -r 51b1f7bf224c sql/updates/mssql_1.5.2_to_1.6.0.php --- a/sql/updates/mssql_1.5.2_to_1.6.0.php Sun Jan 25 11:10:01 2009 +0100 +++ b/sql/updates/mssql_1.5.2_to_1.6.0.php Sun Jan 25 17:28:17 2009 +0100 @@ -1,7 +1,17 @@ details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/744c064938a0 changeset: 6726:744c064938a0 user: Dirk Haun date: Sun Jan 25 20:25:40 2009 +0100 description: Gave the Groups editor a facelift diffstat: 11 files changed, 98 insertions(+), 33 deletions(-) language/english.php | 3 language/english_utf-8.php | 3 language/german.php | 3 language/german_formal.php | 3 language/german_formal_utf-8.php | 3 language/german_utf-8.php | 3 public_html/admin/group.php | 70 +++++++++----- public_html/docs/history | 2 public_html/docs/theme.html | 3 public_html/layout/professional/admin/lists/inline.thtml | 14 ++ system/lib-admin.php | 24 +++- diffs (truncated from 335 to 300 lines): diff -r 51b1f7bf224c -r 744c064938a0 language/english.php --- a/language/english.php Sun Jan 25 17:28:17 2009 +0100 +++ b/language/english.php Sun Jan 25 20:25:40 2009 +0100 @@ -924,7 +924,8 @@ 82 => "Your account on {$_CONF['site_name']} has not been accesssed since %s and will be disabled if not accessed in the next 30 days.", 83 => "Your account on {$_CONF['site_name']} has not been used since it was created and will be deleted soon if not accessed.", 84 => "Your login name is: %s for our site: {$_CONF['site_url']}", - 85 => 'If you have forgotten the password use the following link: %s' + 85 => 'If you have forgotten the password use the following link: %s', + 86 => 'Include' ); ############################################################################### diff -r 51b1f7bf224c -r 744c064938a0 language/english_utf-8.php --- a/language/english_utf-8.php Sun Jan 25 17:28:17 2009 +0100 +++ b/language/english_utf-8.php Sun Jan 25 20:25:40 2009 +0100 @@ -924,7 +924,8 @@ 82 => "Your account on {$_CONF['site_name']} has not been accesssed since %s and will be disabled if not accessed in the next 30 days.", 83 => "Your account on {$_CONF['site_name']} has not been used since it was created and will be deleted soon if not accessed.", 84 => "Your login name is: %s for our site: {$_CONF['site_url']}", - 85 => 'If you have forgotten the password use the following link: %s' + 85 => 'If you have forgotten the password use the following link: %s', + 86 => 'Include' ); ############################################################################### diff -r 51b1f7bf224c -r 744c064938a0 language/german.php --- a/language/german.php Sun Jan 25 17:28:17 2009 +0100 +++ b/language/german.php Sun Jan 25 20:25:40 2009 +0100 @@ -926,7 +926,8 @@ 82 => "Ihr Account auf der Seite {$_CONF['site_name']} wurde nicht benutzt seit %s und wird innerhalb 30 .", 83 => "Ihr Account auf der Seite {$_CONF['site_name']} wurde seit der Einrichtung nicht benutzt \und wird gel?scht, wenn Sie nicht in K?rze einloggen.", 84 => "Ihr Einlogname ist: %s auf der Site: {$_CONF['site_url']}", - 85 => 'Wenn Du das Passwort vergessen hast, benutze folgenden Link: %s' + 85 => 'Wenn Du das Passwort vergessen hast, benutze folgenden Link: %s', + 86 => 'Enthalten' ); ############################################################################### diff -r 51b1f7bf224c -r 744c064938a0 language/german_formal.php --- a/language/german_formal.php Sun Jan 25 17:28:17 2009 +0100 +++ b/language/german_formal.php Sun Jan 25 20:25:40 2009 +0100 @@ -927,7 +927,8 @@ 82 => "Ihr Account auf der Seite {$_CONF['site_name']} wurde nicht benutzt seit %s und wird innerhalb 30 .", 83 => "Ihr Account auf der Seite {$_CONF['site_name']} wurde seit der Einrichtung nicht benutzt \und wird gel?scht, wenn Sie nicht in K?rze einloggen.", 84 => "Ihr Einlogname ist: %s auf der Site: {$_CONF['site_url']}", - 85 => 'Wenn Sie Ihr Passwort vergessen haben, benutzen Sie folgenden Link: %s' + 85 => 'Wenn Sie Ihr Passwort vergessen haben, benutzen Sie folgenden Link: %s', + 86 => 'Enthalten' ); ############################################################################### diff -r 51b1f7bf224c -r 744c064938a0 language/german_formal_utf-8.php --- a/language/german_formal_utf-8.php Sun Jan 25 17:28:17 2009 +0100 +++ b/language/german_formal_utf-8.php Sun Jan 25 20:25:40 2009 +0100 @@ -927,7 +927,8 @@ 82 => "Ihr Account auf der Seite {$_CONF['site_name']} wurde nicht benutzt seit %s und wird innerhalb 30 .", 83 => "Ihr Account auf der Seite {$_CONF['site_name']} wurde seit der Einrichtung nicht benutzt \und wird gel??scht, wenn Sie nicht in K??rze einloggen.", 84 => "Ihr Einlogname ist: %s auf der Site: {$_CONF['site_url']}", - 85 => 'Wenn Sie Ihr Passwort vergessen haben, benutzen Sie folgenden Link: %s' + 85 => 'Wenn Sie Ihr Passwort vergessen haben, benutzen Sie folgenden Link: %s', + 86 => 'Enthalten' ); ############################################################################### diff -r 51b1f7bf224c -r 744c064938a0 language/german_utf-8.php --- a/language/german_utf-8.php Sun Jan 25 17:28:17 2009 +0100 +++ b/language/german_utf-8.php Sun Jan 25 20:25:40 2009 +0100 @@ -926,7 +926,8 @@ 82 => "Ihr Account auf der Seite {$_CONF['site_name']} wurde nicht benutzt seit %s und wird innerhalb 30 .", 83 => "Ihr Account auf der Seite {$_CONF['site_name']} wurde seit der Einrichtung nicht benutzt \und wird gel??scht, wenn Sie nicht in K??rze einloggen.", 84 => "Ihr Einlogname ist: %s auf der Site: {$_CONF['site_url']}", - 85 => 'Wenn Du das Passwort vergessen hast, benutze folgenden Link: %s' + 85 => 'Wenn Du das Passwort vergessen hast, benutze folgenden Link: %s', + 86 => 'Enthalten' ); ############################################################################### diff -r 51b1f7bf224c -r 744c064938a0 public_html/admin/group.php --- a/public_html/admin/group.php Sun Jan 25 17:28:17 2009 +0100 +++ b/public_html/admin/group.php Sun Jan 25 20:25:40 2009 +0100 @@ -2,13 +2,13 @@ /* Reminder: always indent with 4 spaces (no tabs). */ // +---------------------------------------------------------------------------+ -// | Geeklog 1.5 | +// | Geeklog 1.6 | // +---------------------------------------------------------------------------+ // | group.php | // | | // | Geeklog group administration page. | // +---------------------------------------------------------------------------+ -// | Copyright (C) 2000-2008 by the following authors: | +// | Copyright (C) 2000-2009 by the following authors: | // | | // | Authors: Tony Bibbs - tony AT tonybibbs DOT com | // | Mark Limburg - mlimburg AT users DOT sourceforge DOT net | @@ -31,8 +31,6 @@ // | Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | // | | // +---------------------------------------------------------------------------+ -// -// $Id: group.php,v 1.103 2008/06/07 12:41:44 dhaun Exp $ /** * This file is the Geeklog Group administration page @@ -178,9 +176,9 @@ if (!empty($grp_id)) { $tmp = DB_query("SELECT ug_main_grp_id FROM {$_TABLES['group_assignments']} WHERE ug_grp_id = $grp_id"); $num_groups = DB_numRows($tmp); - for ($x = 1; $x <= $num_groups; $x++) { + for ($x = 0; $x < $num_groups; $x++) { $G = DB_fetchArray($tmp); - if ($x > 1) { + if ($x > 0) { $selected .= ' ' . $G['ug_main_grp_id']; } else { $selected .= $G['ug_main_grp_id']; @@ -192,8 +190,8 @@ $group_templates->set_var('hide_adminoption',' style="display:none;"'); if (!empty($selected)) { - $inclause = str_replace(' ',',',$selected); - $result= DB_query("SELECT grp_id,grp_name FROM {$_TABLES['groups']} WHERE grp_id <> $grp_id AND grp_id in ($inclause) ORDER BY grp_name"); + $inclause = str_replace(' ', ',', $selected); + $result = DB_query("SELECT grp_id,grp_name FROM {$_TABLES['groups']} WHERE grp_id <> $grp_id AND grp_id in ($inclause) ORDER BY grp_name"); $nrows = DB_numRows($result); } else { $nrows = 0; @@ -204,14 +202,17 @@ $group_templates->set_var('group_options', $LANG_ACCESS['nogroupsforcoregroup']); } else { $groupoptions = ''; - for ($i = 1; $i <= $nrows; $i++) { + for ($i = 0; $i < $nrows; $i++) { $GRPS = DB_fetchArray($result); $groupoptions .= $GRPS['grp_name'] . '' .LB; } $group_templates->set_var('group_options', $groupoptions); } } else { - $group_templates->set_var('lang_securitygroupmsg', $LANG_ACCESS['groupmsg']); + require_once $_CONF['path_system'] . 'lib-admin.php'; + + $group_templates->set_var('lang_securitygroupmsg', + $LANG_ACCESS['groupmsg']); $group_templates->set_var('hide_adminoption',''); if ($VERBOSE) { COM_errorLog("SELECTED: $selected"); @@ -221,13 +222,38 @@ // is a member $whereGroups = '(grp_id IN (' . implode (',', $thisUsersGroups) . '))'; - // You can no longer give access to the Root group.... - // it's pointless and doesn't make any sense - if (!empty($grp_id)) { - $group_templates->set_var ('group_options', COM_checkList ($_TABLES['groups'], 'grp_id,grp_name', "(grp_id <> $grp_id) AND (grp_name <> 'Root') AND " . $whereGroups, $selected)); - } else { - $group_templates->set_var ('group_options', COM_checkList ($_TABLES['groups'], 'grp_id,grp_name', "(grp_name <> 'Root') AND " . $whereGroups, '')); + $header_arr = array( + array('text' => $LANG28[86], 'field' => 'checkbox', 'sort' => false), + array('text' => $LANG_ACCESS['groupname'], 'field' => 'grp_name', 'sort' => true), + array('text' => $LANG_ACCESS['description'], 'field' => 'grp_descr', 'sort' => true) + ); + + $defsort_arr = array('field' => 'grp_name', 'direction' => 'asc'); + + $form_url = $_CONF['site_admin_url'] + . '/group.php?mode=edit&grp_id=' . $grp_id; + $text_arr = array('has_menu' => false, + 'title' => '', 'instructions' => '', + 'icon' => '', 'form_url' => $form_url, + 'inline' => true); + + $xsql = ''; + if (! empty($grp_id)) { + $xsql = " AND (grp_id <> $grp_id)"; } + $sql = "SELECT grp_id, grp_name, grp_descr FROM {$_TABLES['groups']} WHERE (grp_name <> 'Root')" . $xsql . ' AND ' . $whereGroups; + $query_arr = array('table' => 'groups', + 'sql' => $sql, + 'query_fields' => array('grp_name'), + 'default_filter' => '', + 'query' => '', + 'query_limit' => 0); + + $options = ADMIN_list('groups', 'ADMIN_getListField_groups', + $header_arr, $text_arr, $query_arr, $defsort_arr, + '', explode(' ', $selected)); + $group_templates->set_var('group_options', $options); + } $group_templates->set_var('lang_rights', $LANG_ACCESS['rights']); @@ -237,7 +263,8 @@ $group_templates->set_var('lang_rightsmsg', $LANG_ACCESS['rightsdescr']); } - $group_templates->set_var('rights_options', printrights($grp_id, $A['grp_gl_core'])); + $group_templates->set_var('rights_options', + printrights($grp_id, $A['grp_gl_core'])); $group_templates->set_var('gltoken_name', CSRF_TOKEN); $group_templates->set_var('gltoken', SEC_createToken()); $group_templates->parse('output','editor'); @@ -308,7 +335,7 @@ * @return string HTML for rights * */ -function printrights ($grp_id = '', $core = 0) +function printrights($grp_id = '', $core = 0) { global $_TABLES, $_USER, $LANG_ACCESS, $VERBOSE; @@ -371,8 +398,8 @@ $ftcount = 0; $retval = '' . LB; for ($i = 1; $i <= $nfeatures; $i++) { - if ($i > 0 AND ($i % 3 == 1)) { - $retval .= "\n"; + if ($i > 0 AND (($ftcount + 1) % 3 == 1)) { + $retval .= '' . LB . ''; } $A = DB_fetchArray($features); @@ -390,7 +417,8 @@ // either this is an indirect right OR this is a core feature if ((($core == 1) AND (isset ($grpftarray[$A['ft_name']]) AND (($grpftarray[$A['ft_name']] == 'indirect') OR ($grpftarray[$A['ft_name']] == 'direct')))) OR ($core != 1)) { $ftcount++; - $retval .= '     ((' . $A['ft_name'] . ')'; } } diff -r 51b1f7bf224c -r 744c064938a0 public_html/docs/history --- a/public_html/docs/history Sun Jan 25 17:28:17 2009 +0100 +++ b/public_html/docs/history Sun Jan 25 20:25:40 2009 +0100 @@ -11,6 +11,8 @@ + (TBD) Comment moderation and editable comments, by Jared Wenerd Other changes: +- Gave the Groups editor a facelift. Requires a new template file, + admin/lists/inline.thtml [Dirk] - Add new permissions plugin.install and plugin.upload for more fine-grained control to the plugin admin panel (bug #0000637) [Dirk] - Introduced new plugin API function PLG_itemDeleted [Dirk] diff -r 51b1f7bf224c -r 744c064938a0 public_html/docs/theme.html --- a/public_html/docs/theme.html Sun Jan 25 17:28:17 2009 +0100 +++ b/public_html/docs/theme.html Sun Jan 25 20:25:40 2009 +0100 @@ -207,6 +207,9 @@ version of the directory name) when using the new variable {pi_display_name} in admin/plugins/editor.thtml. This is a purely cosmetic change. +

    • New template file admin/lists/inline.thtml, used when embedding + lists into an existing HTML <form> (e.g. the new Groups + editor).

    Plugins

    diff -r 51b1f7bf224c -r 744c064938a0 public_html/layout/professional/admin/lists/inline.thtml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/public_html/layout/professional/admin/lists/inline.thtml Sun Jan 25 20:25:40 2009 +0100 @@ -0,0 +1,14 @@ + {search_menu} + {formfields_top} + + + {header_row} + + {item_row} +
    +
    + + {formfields_bottom} +
    +

    {message}

    + {google_paging} diff -r 51b1f7bf224c -r 744c064938a0 system/lib-admin.php --- a/system/lib-admin.php Sun Jan 25 17:28:17 2009 +0100 +++ b/system/lib-admin.php Sun Jan 25 20:25:40 2009 +0100 @@ -263,14 +263,19 @@ $title = $text_arr['title']; } + $inline_form = false; + if (isset($text_arr['inline'])) { + $inline_form = $text_arr['inline']; + } + # get all template fields. $admin_templates = new Template($_CONF['path_layout'] . 'admin/lists'); $admin_templates->set_file (array ( 'search' => 'searchmenu.thtml', - 'list' => 'list.thtml', + 'list' => ($inline_form ? 'inline.thtml' : 'list.thtml'), 'header' => 'header.thtml', - 'row' => 'listitem.thtml', - 'field' => 'field.thtml' + 'row' => 'listitem.thtml', + 'field' => 'field.thtml' From geeklog-cvs at lists.geeklog.net Sun Jan 25 18:01:51 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sun, 25 Jan 2009 18:01:51 -0500 Subject: [geeklog-cvs] geeklog: Changes to support the new 'advanced_html' config setting Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/390045595a8e changeset: 6727:390045595a8e user: blaine Lang date: Sun Jan 25 18:01:20 2009 -0500 description: Changes to support the new 'advanced_html' config setting diffstat: 3 files changed, 4 insertions(+) public_html/admin/install/config-install.php | 2 ++ sql/updates/mssql_1.5.2_to_1.6.0.php | 1 + sql/updates/mysql_1.5.2_to_1.6.0.php | 1 + diffs (34 lines): diff -r 744c064938a0 -r 390045595a8e public_html/admin/install/config-install.php --- a/public_html/admin/install/config-install.php Sun Jan 25 20:25:40 2009 +0100 +++ b/public_html/admin/install/config-install.php Sun Jan 25 18:01:20 2009 -0500 @@ -306,6 +306,8 @@ $c->add('fs_htmlfilter', NULL, 'fieldset', 7, 34, NULL, 0, TRUE); $c->add('user_html',array ('p' => array(), 'b' => array(), 'strong' => array(),'i' => array(), 'a' => array('href' => 1, 'title' => 1, 'rel' => 1),'em' => array(),'br' => array(),'tt' => array(),'hr' => array(), 'li' => array(), 'ol' => array(), 'ul' => array(), 'code' => array(), 'pre' => array()),'**placeholder',7,34,NULL,1710,TRUE); $c->add('admin_html',array ('p' => array('class' => 1, 'id' => 1, 'align' => 1), 'div' => array('class' => 1, 'id' => 1), 'span' => array('class' => 1, 'id' => 1), 'table' => array('class' => 1, 'id' => 1, 'width' => 1, 'border' => 1, 'cellspacing' => 1, 'cellpadding' => 1), 'tr' => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1), 'th' => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1, 'colspan' => 1, 'rowspan' => 1), 'td' => array('class' => 1, 'id' => 1, 'align' => 1, 'valign' => 1, 'colspan' => 1, 'rowspan' => 1)),'**placeholder',7,34,NULL,1720,TRUE); + $c->add('advanced_html',array ('img' => array('width' => 1, 'height' => 1, 'src' => 1, 'align' => 1, 'valign' => 1, 'border' => 1, 'alt' => 1)),'**placeholder',7,34,NULL,1721,TRUE); + $c->add('skip_html_filter_for_root',0,'select',7,34,0,1730,TRUE); $c->add('allowed_protocols',array('http','ftp','https'),'%text',7,34,NULL,1740,TRUE); diff -r 744c064938a0 -r 390045595a8e sql/updates/mssql_1.5.2_to_1.6.0.php --- a/sql/updates/mssql_1.5.2_to_1.6.0.php Sun Jan 25 20:25:40 2009 +0100 +++ b/sql/updates/mssql_1.5.2_to_1.6.0.php Sun Jan 25 18:01:20 2009 -0500 @@ -22,6 +22,7 @@ // new option $c->add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); + $c->add('advanced_html',array ('img' => array('width' => 1, 'height' => 1, 'src' => 1, 'align' => 1, 'valign' => 1, 'border' => 1, 'alt' => 1)),'**placeholder',7,34,NULL,1721,TRUE); return true; } diff -r 744c064938a0 -r 390045595a8e sql/updates/mysql_1.5.2_to_1.6.0.php --- a/sql/updates/mysql_1.5.2_to_1.6.0.php Sun Jan 25 20:25:40 2009 +0100 +++ b/sql/updates/mysql_1.5.2_to_1.6.0.php Sun Jan 25 18:01:20 2009 -0500 @@ -23,6 +23,7 @@ // new option $c->add('jpeg_quality',75,'text',5,23,NULL,1495,FALSE); + $c->add('advanced_html',array ('img' => array('width' => 1, 'height' => 1, 'src' => 1, 'align' => 1, 'valign' => 1, 'border' => 1, 'alt' => 1)),'**placeholder',7,34,NULL,1721,TRUE); return true; } From geeklog-cvs at lists.geeklog.net Mon Jan 26 04:24:49 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 26 Jan 2009 04:24:49 -0500 Subject: [geeklog-cvs] geeklog: Missing label text and documentation the 'advanced_html... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/d9e502027ae4 changeset: 6728:d9e502027ae4 user: Dirk Haun date: Mon Jan 26 10:24:32 2009 +0100 description: Missing label text and documentation the 'advanced_html' config option diffstat: 7 files changed, 17 insertions(+), 4 deletions(-) language/english.php | 1 + language/english_utf-8.php | 1 + language/german.php | 3 ++- language/german_formal.php | 3 ++- language/german_formal_utf-8.php | 3 ++- language/german_utf-8.php | 3 ++- public_html/docs/config.html | 7 +++++++ diffs (119 lines): diff -r 390045595a8e -r d9e502027ae4 language/english.php --- a/language/english.php Sun Jan 25 18:01:20 2009 -0500 +++ b/language/english.php Mon Jan 26 10:24:32 2009 +0100 @@ -1787,6 +1787,7 @@ 'login_speedlimit' => "Login Speed Limit", 'user_html' => "User HTML", 'admin_html' => "Admin HTML", + 'advanced_html' => 'Additional HTML for Adv. Editor', 'skip_html_filter_for_root' => "Skip HTML Filter for Root?", 'allowed_protocols' => "Allowed Protocols", 'disable_autolinks' => "Disable Autolinks?", diff -r 390045595a8e -r d9e502027ae4 language/english_utf-8.php --- a/language/english_utf-8.php Sun Jan 25 18:01:20 2009 -0500 +++ b/language/english_utf-8.php Mon Jan 26 10:24:32 2009 +0100 @@ -1788,6 +1788,7 @@ 'login_speedlimit' => "Login Speed Limit", 'user_html' => "User HTML", 'admin_html' => "Admin HTML", + 'advanced_html' => 'Additional HTML for Adv. Editor', 'skip_html_filter_for_root' => "Skip HTML Filter for Root?", 'allowed_protocols' => "Allowed Protocols", 'disable_autolinks' => "Disable Autolinks?", diff -r 390045595a8e -r d9e502027ae4 language/german.php --- a/language/german.php Sun Jan 25 18:01:20 2009 -0500 +++ b/language/german.php Mon Jan 26 10:24:32 2009 +0100 @@ -1705,7 +1705,7 @@ 'postmode' => 'Default Post Mode', 'speedlimit' => 'Post Speedlimit', 'skip_preview' => 'Vorschau ?berspringen in Posts', - 'advanced_editor' => 'Advanced Editor?', + 'advanced_editor' => 'Erweiterter Editor?', 'wikitext_editor' => 'Wikitext Editor?', 'cron_schedule_interval' => 'Cron Zeitabstand', 'sortmethod' => 'Kategorien sortieren', @@ -1794,6 +1794,7 @@ 'login_speedlimit' => 'Login Speed-Limit', 'user_html' => 'Erlaubtes User HTML', 'admin_html' => 'Erlaubtes Admin HTML', + 'advanced_html' => 'Zus?tzl. HTML f.d. Erw. Editor', 'skip_html_filter_for_root' => 'HTML des Root wird nicht gefiltert?', 'allowed_protocols' => 'Erlaubte Protokolle', 'disable_autolinks' => 'Autolinks ausschalten?', diff -r 390045595a8e -r d9e502027ae4 language/german_formal.php --- a/language/german_formal.php Sun Jan 25 18:01:20 2009 -0500 +++ b/language/german_formal.php Mon Jan 26 10:24:32 2009 +0100 @@ -1706,7 +1706,7 @@ 'postmode' => 'Default Post Mode', 'speedlimit' => 'Post Speedlimit', 'skip_preview' => 'Vorschau ?berspringen in Posts', - 'advanced_editor' => 'Advanced Editor?', + 'advanced_editor' => 'Erweiterter Editor?', 'wikitext_editor' => 'Wikitext Editor?', 'cron_schedule_interval' => 'Cron Zeitabstand', 'sortmethod' => 'Kategorien sortieren', @@ -1795,6 +1795,7 @@ 'login_speedlimit' => 'Login Speed-Limit', 'user_html' => 'Erlaubtes User HTML', 'admin_html' => 'Erlaubtes Admin HTML', + 'advanced_html' => 'Zus?tzl. HTML f.d. Erw. Editor', 'skip_html_filter_for_root' => 'HTML des Root wird nicht gefiltert?', 'allowed_protocols' => 'Erlaubte Protokolle', 'disable_autolinks' => 'Autolinks ausschalten?', diff -r 390045595a8e -r d9e502027ae4 language/german_formal_utf-8.php --- a/language/german_formal_utf-8.php Sun Jan 25 18:01:20 2009 -0500 +++ b/language/german_formal_utf-8.php Mon Jan 26 10:24:32 2009 +0100 @@ -1706,7 +1706,7 @@ 'postmode' => 'Default Post Mode', 'speedlimit' => 'Post Speedlimit', 'skip_preview' => 'Vorschau ??berspringen in Posts', - 'advanced_editor' => 'Advanced Editor?', + 'advanced_editor' => 'Erweiterter Editor?', 'wikitext_editor' => 'Wikitext Editor?', 'cron_schedule_interval' => 'Cron Zeitabstand', 'sortmethod' => 'Kategorien sortieren', @@ -1795,6 +1795,7 @@ 'login_speedlimit' => 'Login Speed-Limit', 'user_html' => 'Erlaubtes User HTML', 'admin_html' => 'Erlaubtes Admin HTML', + 'advanced_html' => 'Zus??tzl. HTML f.d. Erw. Editor', 'skip_html_filter_for_root' => 'HTML des Root wird nicht gefiltert?', 'allowed_protocols' => 'Erlaubte Protokolle', 'disable_autolinks' => 'Autolinks ausschalten?', diff -r 390045595a8e -r d9e502027ae4 language/german_utf-8.php --- a/language/german_utf-8.php Sun Jan 25 18:01:20 2009 -0500 +++ b/language/german_utf-8.php Mon Jan 26 10:24:32 2009 +0100 @@ -1705,7 +1705,7 @@ 'postmode' => 'Default Post Mode', 'speedlimit' => 'Post Speedlimit', 'skip_preview' => 'Vorschau ??berspringen in Posts', - 'advanced_editor' => 'Advanced Editor?', + 'advanced_editor' => 'Erweiterter Editor?', 'wikitext_editor' => 'Wikitext Editor?', 'cron_schedule_interval' => 'Cron Zeitabstand', 'sortmethod' => 'Kategorien sortieren', @@ -1794,6 +1794,7 @@ 'login_speedlimit' => 'Login Speed-Limit', 'user_html' => 'Erlaubtes User HTML', 'admin_html' => 'Erlaubtes Admin HTML', + 'advanced_html' => 'Zus??tzl. HTML f.d. Erw. Editor', 'skip_html_filter_for_root' => 'HTML des Root wird nicht gefiltert?', 'allowed_protocols' => 'Erlaubte Protokolle', 'disable_autolinks' => 'Autolinks ausschalten?', diff -r 390045595a8e -r d9e502027ae4 public_html/docs/config.html --- a/public_html/docs/config.html Sun Jan 25 18:01:20 2009 -0500 +++ b/public_html/docs/config.html Mon Jan 26 10:24:32 2009 +0100 @@ -1327,6 +1327,13 @@ use (in addition to those from user_html). Redefining a tag with additional attributes will overwrite the definition from user_html. + advanced_html + additional HTML tags for use with the Advanced Editor, e.g. + for images + Additional HTML tags and attributes that users are allowed + to use when the Advanced Editor is + enabled. + skip_html_filter_for_root 0 When set to 1, this will allow members of the Root group From geeklog-cvs at lists.geeklog.net Mon Jan 26 11:17:33 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Mon, 26 Jan 2009 11:17:33 -0500 Subject: [geeklog-cvs] geeklog: Turns out the group editor needs more work: Fixed print... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/9c0620199e25 changeset: 6729:9c0620199e25 user: Dirk Haun date: Mon Jan 26 17:17:21 2009 +0100 description: Turns out the group editor needs more work: Fixed printrights() and some consistency issues; more to come ... diffstat: 2 files changed, 113 insertions(+), 94 deletions(-) public_html/admin/group.php | 201 ++++++++++++++++++++++--------------------- system/lib-admin.php | 6 + diffs (truncated from 351 to 300 lines): diff -r d9e502027ae4 -r 9c0620199e25 public_html/admin/group.php --- a/public_html/admin/group.php Mon Jan 26 10:24:32 2009 +0100 +++ b/public_html/admin/group.php Mon Jan 26 17:17:21 2009 +0100 @@ -78,74 +78,76 @@ global $_TABLES, $_CONF, $_USER, $LANG_ACCESS, $LANG_ADMIN, $MESSAGE, $LANG28, $VERBOSE; + require_once $_CONF['path_system'] . 'lib-admin.php'; + $retval = ''; - $thisUsersGroups = SEC_getUserGroups (); - if (!empty ($grp_id) && + $thisUsersGroups = SEC_getUserGroups(); + if (! empty($grp_id) && ($grp_id > 0) && - !in_array ($grp_id, $thisUsersGroups) && + !in_array($grp_id, $thisUsersGroups) && !SEC_groupIsRemoteUserAndHaveAccess($grp_id, $thisUsersGroups)) { - $retval .= COM_startBlock ($LANG_ACCESS['groupeditor'], '', - COM_getBlockTemplate ('_msg_block', 'header')); - if (!SEC_inGroup ('Root') && (DB_getItem ($_TABLES['groups'], + $retval .= COM_startBlock($LANG_ACCESS['groupeditor'], '', + COM_getBlockTemplate('_msg_block', 'header')); + if (!SEC_inGroup('Root') && (DB_getItem($_TABLES['groups'], 'grp_name', "grp_id = $grp_id") == 'Root')) { $retval .= $LANG_ACCESS['canteditroot']; - COM_accessLog ("User {$_USER['username']} tried to edit the Root group with insufficient privileges."); + COM_accessLog("User {$_USER['username']} tried to edit the Root group with insufficient privileges."); } else { $retval .= $LANG_ACCESS['canteditgroup']; } - $retval .= COM_endBlock (COM_getBlockTemplate ('_msg_block', 'footer')); + $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer')); return $retval; } $group_templates = new Template($_CONF['path_layout'] . 'admin/group'); - $group_templates->set_file('editor','groupeditor.thtml'); + $group_templates->set_file('editor', 'groupeditor.thtml'); $group_templates->set_var('site_url', $_CONF['site_url']); $group_templates->set_var('site_admin_url', $_CONF['site_admin_url']); $group_templates->set_var('layout_url', $_CONF['layout_url']); $group_templates->set_var('lang_save', $LANG_ADMIN['save']); $group_templates->set_var('lang_cancel', $LANG_ADMIN['cancel']); - $group_templates->set_var('lang_admingroup',$LANG28[49]); + $group_templates->set_var('lang_admingroup', $LANG28[49]); $group_templates->set_var('lang_admingrp_msg', $LANG28[50]); - $group_templates->set_var( 'xhtml', XHTML ); + $group_templates->set_var('xhtml', XHTML); $showall = 0; - if (isset ($_GET['chk_showall'])) { - $showall = COM_applyFilter ($_GET['chk_showall'], true); + if (isset($_GET['chk_showall'])) { + $showall = COM_applyFilter($_GET['chk_showall'], true); } $group_templates->set_var('show_all', $showall); - if (!empty ($grp_id)) { - $result = DB_query ("SELECT grp_id,grp_name,grp_descr,grp_gl_core FROM {$_TABLES['groups']} WHERE grp_id ='$grp_id'"); - $A = DB_fetchArray ($result); + if (! empty($grp_id)) { + $result = DB_query("SELECT grp_id,grp_name,grp_descr,grp_gl_core FROM {$_TABLES['groups']} WHERE grp_id ='$grp_id'"); + $A = DB_fetchArray($result); if ($A['grp_gl_core'] > 0) { - $group_templates->set_var ('chk_adminuse', 'checked="checked"'); + $group_templates->set_var('chk_adminuse', 'checked="checked"'); } } else { // new group, so it's obviously not a core group $A['grp_gl_core'] = 0; } - $retval .= COM_startBlock ($LANG_ACCESS['groupeditor'], '', - COM_getBlockTemplate ('_admin_block', 'header')); + $retval .= COM_startBlock($LANG_ACCESS['groupeditor'], '', + COM_getBlockTemplate('_admin_block', 'header')); - if (!empty($grp_id)) { + if (! empty($grp_id)) { // Groups tied to Geeklog's functionality shouldn't be deleted if ($A['grp_gl_core'] != 1) { $delbutton = ''; $jsconfirm = ' onclick="return confirm(\'' . $MESSAGE[76] . '\');"'; - $group_templates->set_var ('delete_option', - sprintf ($delbutton, $jsconfirm)); - $group_templates->set_var ('delete_option_no_confirmation', - sprintf ($delbutton, '')); - $group_templates->set_var ('group_core', 0); + $group_templates->set_var('delete_option', + sprintf($delbutton, $jsconfirm)); + $group_templates->set_var('delete_option_no_confirmation', + sprintf($delbutton, '')); + $group_templates->set_var('group_core', 0); } else { - $group_templates->set_var ('group_core', 1); + $group_templates->set_var('group_core', 1); } - $group_templates->set_var ('group_id', $A['grp_id']); + $group_templates->set_var('group_id', $A['grp_id']); } else { - $group_templates->set_var ('group_core', 0); + $group_templates->set_var('group_core', 0); } $group_templates->set_var('lang_groupname', $LANG_ACCESS['groupname']); @@ -171,9 +173,8 @@ } $group_templates->set_var('lang_securitygroups', $LANG_ACCESS['securitygroups']); - //$groups = SEC_getUserGroups('','',$grp_id); $selected = ''; - if (!empty($grp_id)) { + if (! empty($grp_id)) { $tmp = DB_query("SELECT ug_main_grp_id FROM {$_TABLES['group_assignments']} WHERE ug_grp_id = $grp_id"); $num_groups = DB_numRows($tmp); for ($x = 0; $x < $num_groups; $x++) { @@ -185,45 +186,40 @@ } } } + + $groupoptions = ''; if ($A['grp_gl_core'] == 1) { - $group_templates->set_var('lang_securitygroupmsg', $LANG_ACCESS['coregroupmsg']); - $group_templates->set_var('hide_adminoption',' style="display:none;"'); + $group_templates->set_var('lang_securitygroupmsg', + $LANG_ACCESS['coregroupmsg']); + $group_templates->set_var('hide_adminoption', + ' style="display:none;"'); - if (!empty($selected)) { + $count = 0; + if (! empty($selected)) { $inclause = str_replace(' ', ',', $selected); - $result = DB_query("SELECT grp_id,grp_name FROM {$_TABLES['groups']} WHERE grp_id <> $grp_id AND grp_id in ($inclause) ORDER BY grp_name"); - $nrows = DB_numRows($result); - } else { - $nrows = 0; + $result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['groups']} WHERE grp_id <> $grp_id AND grp_id in ($inclause)"); + list($count) = DB_fetchArray($result); } - - if ($nrows == 0) { + if ($count == 0) { // this group doesn't belong to anything...give a friendly message - $group_templates->set_var('group_options', $LANG_ACCESS['nogroupsforcoregroup']); - } else { - $groupoptions = ''; - for ($i = 0; $i < $nrows; $i++) { - $GRPS = DB_fetchArray($result); - $groupoptions .= $GRPS['grp_name'] . '' .LB; - } - $group_templates->set_var('group_options', $groupoptions); + $groupoptions = $LANG_ACCESS['nogroupsforcoregroup']; } } else { - require_once $_CONF['path_system'] . 'lib-admin.php'; - $group_templates->set_var('lang_securitygroupmsg', $LANG_ACCESS['groupmsg']); - $group_templates->set_var('hide_adminoption',''); - if ($VERBOSE) { - COM_errorLog("SELECTED: $selected"); - } + $group_templates->set_var('hide_adminoption', ''); + } + if ($VERBOSE) { + COM_errorLog("SELECTED: $selected"); + } + if (empty($groupoptions)) { // make sure to list only those groups of which the Group Admin // is a member $whereGroups = '(grp_id IN (' . implode (',', $thisUsersGroups) . '))'; $header_arr = array( - array('text' => $LANG28[86], 'field' => 'checkbox', 'sort' => false), + array('text' => $LANG28[86], 'field' => ($A['grp_gl_core'] == 1 ? 'disabled-checkbox' : 'checkbox'), 'sort' => false), array('text' => $LANG_ACCESS['groupname'], 'field' => 'grp_name', 'sort' => true), array('text' => $LANG_ACCESS['description'], 'field' => 'grp_descr', 'sort' => true) ); @@ -237,11 +233,16 @@ 'icon' => '', 'form_url' => $form_url, 'inline' => true); - $xsql = ''; - if (! empty($grp_id)) { - $xsql = " AND (grp_id <> $grp_id)"; + if ($A['grp_gl_core'] == 1) { + $inclause = str_replace(' ', ',', $selected); + $sql = "SELECT grp_id, grp_name, grp_descr FROM {$_TABLES['groups']} WHERE grp_id <> $grp_id AND grp_id in ($inclause)"; + } else { + $xsql = ''; + if (! empty($grp_id)) { + $xsql = " AND (grp_id <> $grp_id)"; + } + $sql = "SELECT grp_id, grp_name, grp_descr FROM {$_TABLES['groups']} WHERE (grp_name <> 'Root')" . $xsql . ' AND ' . $whereGroups; } - $sql = "SELECT grp_id, grp_name, grp_descr FROM {$_TABLES['groups']} WHERE (grp_name <> 'Root')" . $xsql . ' AND ' . $whereGroups; $query_arr = array('table' => 'groups', 'sql' => $sql, 'query_fields' => array('grp_name'), @@ -249,12 +250,11 @@ 'query' => '', 'query_limit' => 0); - $options = ADMIN_list('groups', 'ADMIN_getListField_groups', - $header_arr, $text_arr, $query_arr, $defsort_arr, - '', explode(' ', $selected)); - $group_templates->set_var('group_options', $options); - + $groupoptions = ADMIN_list('groups', 'ADMIN_getListField_groups', + $header_arr, $text_arr, $query_arr, + $defsort_arr, '', explode(' ', $selected)); } + $group_templates->set_var('group_options', $groupoptions); $group_templates->set_var('lang_rights', $LANG_ACCESS['rights']); if ($A['grp_gl_core'] == 1) { @@ -396,36 +396,44 @@ // OK, now loop through and print all the features giving edit rights // to only the ones that are direct features $ftcount = 0; - $retval = '' . LB; - for ($i = 1; $i <= $nfeatures; $i++) { - if ($i > 0 AND (($ftcount + 1) % 3 == 1)) { - $retval .= '' . LB . ''; - } + $retval = ''; + for ($i = 0; $i < $nfeatures; $i++) { $A = DB_fetchArray($features); if ((empty($grpftarray[$A['ft_name']]) OR ($grpftarray[$A['ft_name']] == 'direct')) AND ($core != 1)) { + if (($ftcount > 0) && ($ftcount % 3 == 0)) { + $retval .= '' . LB . ''; + } $ftcount++; - $retval .= '' . $A['ft_name'] - . ''; + $retval .= XHTML . '>' + . $A['ft_name'] . ''; } else { // either this is an indirect right OR this is a core feature - if ((($core == 1) AND (isset ($grpftarray[$A['ft_name']]) AND (($grpftarray[$A['ft_name']] == 'indirect') OR ($grpftarray[$A['ft_name']] == 'direct')))) OR ($core != 1)) { + if ((($core == 1) AND (isset($grpftarray[$A['ft_name']]) AND (($grpftarray[$A['ft_name']] == 'indirect') OR ($grpftarray[$A['ft_name']] == 'direct')))) OR ($core != 1)) { + if (($ftcount > 0) && ($ftcount % 3 == 0)) { + $retval .= '' . LB . ''; + } $ftcount++; - $retval .= '(' . $A['ft_name'] . ')'; + + $retval .= '(' . $A['ft_name'] . ')'; } } } if ($ftcount == 0) { // This group doesn't have rights to any features - $retval .= '' . $LANG_ACCESS['grouphasnorights'] . ''; + $retval .= '' . $LANG_ACCESS['grouphasnorights'] + . ''; } $retval .= '' . LB; @@ -446,7 +454,7 @@ * @return string HTML refresh or error message * */ -function savegroup ($grp_id, $grp_name, $grp_descr, $grp_admin, $grp_gl_core, $features, $groups) +function savegroup($grp_id, $grp_name, $grp_descr, $grp_admin, $grp_gl_core, $features, $groups) { global $_CONF, $_TABLES, $_USER, $LANG_ACCESS, $VERBOSE; @@ -1020,23 +1028,28 @@ echo COM_refresh($_CONF['site_admin_url'] . '/index.php'); } } elseif (($mode == $LANG_ADMIN['save']) && !empty($LANG_ADMIN['save']) && SEC_checkToken()) { - $chk_grpadmin = ''; - if (isset($_POST['chk_grpadmin'])) { - $chk_grpadmin = COM_applyFilter($_POST['chk_grpadmin']); + $grp_gl_core = COM_applyFilter($_POST['grp_gl_core'], true); + if ($grp_gl_core != 1) { + $chk_grpadmin = ''; From geeklog-cvs at lists.geeklog.net Wed Jan 28 14:49:30 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 28 Jan 2009 14:49:30 -0500 Subject: [geeklog-cvs] geeklog: Updated Japanese language file, provided by the Geeklog... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/ae1278566d34 changeset: 6730:ae1278566d34 user: Dirk Haun date: Wed Jan 28 20:49:16 2009 +0100 description: Updated Japanese language file, provided by the Geeklog.jp group diffstat: 1 file changed, 2 insertions(+), 2 deletions(-) language/japanese_utf-8.php | 4 ++-- diffs (21 lines): diff -r f6a30d243a0f -r ae1278566d34 language/japanese_utf-8.php --- a/language/japanese_utf-8.php Sat Jan 24 15:49:23 2009 +0100 +++ b/language/japanese_utf-8.php Wed Jan 28 20:49:16 2009 +0100 @@ -144,7 +144,7 @@ 92 => '???', 93 => 'Copyright', 94 => '?????????????????????????????????????????????????????????????????????????????????????????????', - 95 => 'powered by', + 95 => 'Powered by', 96 => '????????????', 97 => '??????????????????', 98 => '???????????????', @@ -540,7 +540,7 @@ 24 => '??????????????????????????????????????????????????????', 25 => '?????????????????????????????????????????????10??????', 26 => '??????????????????????????????????????????', - 27 => '??????????????????', + 27 => '???????????????????????????', 28 => '', 29 => '', 30 => '?????????', From geeklog-cvs at lists.geeklog.net Wed Jan 28 14:50:30 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Wed, 28 Jan 2009 14:50:30 -0500 Subject: [geeklog-cvs] geeklog: Updated Japanese language file, provided by the Geeklog... Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/6a583eb5a444 changeset: 6731:6a583eb5a444 user: Dirk Haun date: Wed Jan 28 20:49:16 2009 +0100 description: Updated Japanese language file, provided by the Geeklog.jp group diffstat: 1 file changed, 2 insertions(+), 2 deletions(-) language/japanese_utf-8.php | 4 ++-- diffs (21 lines): diff -r 9c0620199e25 -r 6a583eb5a444 language/japanese_utf-8.php --- a/language/japanese_utf-8.php Mon Jan 26 17:17:21 2009 +0100 +++ b/language/japanese_utf-8.php Wed Jan 28 20:49:16 2009 +0100 @@ -144,7 +144,7 @@ 92 => '???', 93 => 'Copyright', 94 => '?????????????????????????????????????????????????????????????????????????????????????????????', - 95 => 'powered by', + 95 => 'Powered by', 96 => '????????????', 97 => '??????????????????', 98 => '???????????????', @@ -540,7 +540,7 @@ 24 => '??????????????????????????????????????????????????????', 25 => '?????????????????????????????????????????????10??????', 26 => '??????????????????????????????????????????', - 27 => '??????????????????', + 27 => '???????????????????????????', 28 => '', 29 => '', 30 => '?????????', From geeklog-cvs at lists.geeklog.net Sat Jan 31 04:21:25 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 31 Jan 2009 04:21:25 -0500 Subject: [geeklog-cvs] geeklog: Fixed handling of indirect rights Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/b047a9ee59aa changeset: 6733:b047a9ee59aa user: Dirk Haun date: Sat Jan 31 09:43:54 2009 +0100 description: Fixed handling of indirect rights diffstat: 1 file changed, 3 insertions(+), 4 deletions(-) public_html/admin/group.php | 7 +++---- diffs (17 lines): diff -r cda48754a713 -r b047a9ee59aa public_html/admin/group.php --- a/public_html/admin/group.php Sat Jan 31 09:22:00 2009 +0100 +++ b/public_html/admin/group.php Sat Jan 31 09:43:54 2009 +0100 @@ -428,10 +428,9 @@ $ftcount++; $retval .= '' - . '(' . $A['ft_name'] . ')'; + . '(' . $A['ft_name'] . ')'; } } } From geeklog-cvs at lists.geeklog.net Sat Jan 31 04:21:24 2009 From: geeklog-cvs at lists.geeklog.net (geeklog-cvs at lists.geeklog.net) Date: Sat, 31 Jan 2009 04:21:24 -0500 Subject: [geeklog-cvs] geeklog: Cosmetics Message-ID: details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/cda48754a713 changeset: 6732:cda48754a713 user: Dirk Haun date: Sat Jan 31 09:22:00 2009 +0100 description: Cosmetics diffstat: 5 files changed, 17 insertions(+), 12 deletions(-) language/german.php | 2 +- language/german_formal.php | 2 +- language/german_formal_utf-8.php | 2 +- language/german_utf-8.php | 2 +- public_html/admin/group.php | 21 +++++++++++++-------- diffs (122 lines): diff -r 6a583eb5a444 -r cda48754a713 language/german.php --- a/language/german.php Wed Jan 28 20:49:16 2009 +0100 +++ b/language/german.php Sat Jan 31 09:22:00 2009 +0100 @@ -1252,7 +1252,7 @@ 'accessdenied' => 'Zugriff verweigert', 'storydenialmsg' => "Du hast nicht die n?tigen Rechte, um diesen Artikel zu lesen. M?glicherweise bist Du kein registrierter User von {$_CONF['site_name']}. Bitte melde Dich als neuer User von {$_CONF['site_name']} an um vollen Zugriff auf alle Bereiche zu bekommen.", 'nogroupsforcoregroup' => 'Diese Gruppe geh?rt zu keiner anderen Gruppe.', - 'grouphasnorights' => 'Diese Gruppe hat keine Rechte f?r die Administration der Website', + 'grouphasnorights' => 'Diese Gruppe hat keine Rechte f?r die Administration der Website.', 'newgroup' => 'Neue Gruppe', 'adminhome' => 'Kommandozentrale', 'save' => 'Speichern', diff -r 6a583eb5a444 -r cda48754a713 language/german_formal.php --- a/language/german_formal.php Wed Jan 28 20:49:16 2009 +0100 +++ b/language/german_formal.php Sat Jan 31 09:22:00 2009 +0100 @@ -1253,7 +1253,7 @@ 'accessdenied' => 'Zugriff verweigert', 'storydenialmsg' => "Sie haben nicht die n?tigen Rechte, um diesen Artikel zu lesen. M?glicherweise sind Sie kein registrierter User von {$_CONF['site_name']}. Bitte melden Sie sich als neuer User von {$_CONF['site_name']} an um vollen Zugriff auf alle Bereiche zu bekommen.", 'nogroupsforcoregroup' => 'Diese Gruppe geh?rt zu keiner anderen Gruppe.', - 'grouphasnorights' => 'Diese Gruppe hat keine Rechte f?r die Administration der Website', + 'grouphasnorights' => 'Diese Gruppe hat keine Rechte f?r die Administration der Website.', 'newgroup' => 'Neue Gruppe', 'adminhome' => 'Kommandozentrale', 'save' => 'Speichern', diff -r 6a583eb5a444 -r cda48754a713 language/german_formal_utf-8.php --- a/language/german_formal_utf-8.php Wed Jan 28 20:49:16 2009 +0100 +++ b/language/german_formal_utf-8.php Sat Jan 31 09:22:00 2009 +0100 @@ -1253,7 +1253,7 @@ 'accessdenied' => 'Zugriff verweigert', 'storydenialmsg' => "Sie haben nicht die n??tigen Rechte, um diesen Artikel zu lesen. M??glicherweise sind Sie kein registrierter User von {$_CONF['site_name']}. Bitte melden Sie sich als neuer User von {$_CONF['site_name']} an um vollen Zugriff auf alle Bereiche zu bekommen.", 'nogroupsforcoregroup' => 'Diese Gruppe geh??rt zu keiner anderen Gruppe.', - 'grouphasnorights' => 'Diese Gruppe hat keine Rechte f??r die Administration der Website', + 'grouphasnorights' => 'Diese Gruppe hat keine Rechte f??r die Administration der Website.', 'newgroup' => 'Neue Gruppe', 'adminhome' => 'Kommandozentrale', 'save' => 'Speichern', diff -r 6a583eb5a444 -r cda48754a713 language/german_utf-8.php --- a/language/german_utf-8.php Wed Jan 28 20:49:16 2009 +0100 +++ b/language/german_utf-8.php Sat Jan 31 09:22:00 2009 +0100 @@ -1252,7 +1252,7 @@ 'accessdenied' => 'Zugriff verweigert', 'storydenialmsg' => "Du hast nicht die n??tigen Rechte, um diesen Artikel zu lesen. M??glicherweise bist Du kein registrierter User von {$_CONF['site_name']}. Bitte melde Dich als neuer User von {$_CONF['site_name']} an um vollen Zugriff auf alle Bereiche zu bekommen.", 'nogroupsforcoregroup' => 'Diese Gruppe geh??rt zu keiner anderen Gruppe.', - 'grouphasnorights' => 'Diese Gruppe hat keine Rechte f??r die Administration der Website', + 'grouphasnorights' => 'Diese Gruppe hat keine Rechte f??r die Administration der Website.', 'newgroup' => 'Neue Gruppe', 'adminhome' => 'Kommandozentrale', 'save' => 'Speichern', diff -r 6a583eb5a444 -r cda48754a713 public_html/admin/group.php --- a/public_html/admin/group.php Wed Jan 28 20:49:16 2009 +0100 +++ b/public_html/admin/group.php Sat Jan 31 09:22:00 2009 +0100 @@ -197,12 +197,13 @@ $count = 0; if (! empty($selected)) { $inclause = str_replace(' ', ',', $selected); - $result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['groups']} WHERE grp_id <> $grp_id AND grp_id in ($inclause)"); + $result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['groups']} WHERE grp_id <> $grp_id AND grp_id IN ($inclause)"); list($count) = DB_fetchArray($result); } if ($count == 0) { // this group doesn't belong to anything...give a friendly message - $groupoptions = $LANG_ACCESS['nogroupsforcoregroup']; + $groupoptions = '

    ' + . $LANG_ACCESS['nogroupsforcoregroup'] . '

    '; } } else { $group_templates->set_var('lang_securitygroupmsg', @@ -235,7 +236,7 @@ if ($A['grp_gl_core'] == 1) { $inclause = str_replace(' ', ',', $selected); - $sql = "SELECT grp_id, grp_name, grp_descr FROM {$_TABLES['groups']} WHERE grp_id <> $grp_id AND grp_id in ($inclause)"; + $sql = "SELECT grp_id, grp_name, grp_descr FROM {$_TABLES['groups']} WHERE grp_id <> $grp_id AND grp_id IN ($inclause)"; } else { $xsql = ''; if (! empty($grp_id)) { @@ -404,9 +405,11 @@ if (($ftcount > 0) && ($ftcount % 3 == 0)) { $retval .= '' . LB . ''; } + $pluginRow = sprintf('pluginRow%d', ($ftcount % 2) + 1); $ftcount++; - $retval .= '' + . ' 0) && ($ftcount % 3 == 0)) { $retval .= '' . LB . ''; } + $pluginRow = sprintf('pluginRow%d', ($ftcount % 2) + 1); $ftcount++; - $retval .= '' + . '(' . $A['ft_name'] . ')'; @@ -432,8 +437,8 @@ } if ($ftcount == 0) { // This group doesn't have rights to any features - $retval .= '' . $LANG_ACCESS['grouphasnorights'] - . ''; + $retval .= '' + . $LANG_ACCESS['grouphasnorights'] . ''; } $retval .= '' . LB; @@ -826,7 +831,7 @@ $filter .= "