You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(179) |
Apr
(56) |
May
(53) |
Jun
(65) |
Jul
(70) |
Aug
(89) |
Sep
(50) |
Oct
(38) |
Nov
(12) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(57) |
Feb
(226) |
Mar
(172) |
Apr
(194) |
May
(120) |
Jun
(162) |
Jul
(297) |
Aug
(156) |
Sep
(312) |
Oct
(180) |
Nov
(358) |
Dec
(362) |
2005 |
Jan
(275) |
Feb
(224) |
Mar
(202) |
Apr
(157) |
May
(133) |
Jun
(115) |
Jul
(211) |
Aug
(257) |
Sep
(135) |
Oct
(116) |
Nov
(106) |
Dec
(81) |
2006 |
Jan
(74) |
Feb
(94) |
Mar
(59) |
Apr
(125) |
May
(50) |
Jun
(71) |
Jul
(45) |
Aug
(80) |
Sep
(3) |
Oct
(44) |
Nov
(50) |
Dec
(38) |
2007 |
Jan
(46) |
Feb
(33) |
Mar
(24) |
Apr
(28) |
May
(19) |
Jun
(37) |
Jul
(66) |
Aug
(73) |
Sep
(87) |
Oct
(33) |
Nov
(39) |
Dec
(37) |
2008 |
Jan
(20) |
Feb
(54) |
Mar
(47) |
Apr
(68) |
May
(10) |
Jun
(13) |
Jul
(13) |
Aug
(25) |
Sep
(11) |
Oct
(22) |
Nov
(22) |
Dec
(34) |
2009 |
Jan
(34) |
Feb
(35) |
Mar
(11) |
Apr
(10) |
May
(15) |
Jun
(18) |
Jul
(28) |
Aug
(22) |
Sep
(9) |
Oct
(12) |
Nov
(6) |
Dec
(32) |
2010 |
Jan
(11) |
Feb
(7) |
Mar
(9) |
Apr
(3) |
May
(16) |
Jun
(1) |
Jul
(2) |
Aug
(25) |
Sep
(9) |
Oct
(8) |
Nov
(4) |
Dec
(8) |
2011 |
Jan
(17) |
Feb
(1) |
Mar
(6) |
Apr
(7) |
May
(5) |
Jun
(2) |
Jul
(12) |
Aug
(3) |
Sep
(18) |
Oct
(3) |
Nov
(2) |
Dec
|
2012 |
Jan
(92) |
Feb
(74) |
Mar
(64) |
Apr
(55) |
May
(44) |
Jun
(91) |
Jul
(35) |
Aug
(42) |
Sep
(32) |
Oct
(56) |
Nov
(42) |
Dec
(81) |
2013 |
Jan
(117) |
Feb
(130) |
Mar
(33) |
Apr
(36) |
May
(155) |
Jun
(241) |
Jul
(113) |
Aug
(70) |
Sep
(50) |
Oct
(55) |
Nov
(34) |
Dec
(36) |
2014 |
Jan
(94) |
Feb
(67) |
Mar
(177) |
Apr
(67) |
May
(147) |
Jun
(137) |
Jul
(58) |
Aug
(56) |
Sep
(62) |
Oct
(35) |
Nov
(118) |
Dec
(53) |
2015 |
Jan
(204) |
Feb
(165) |
Mar
(275) |
Apr
(42) |
May
(58) |
Jun
(91) |
Jul
(81) |
Aug
(62) |
Sep
(23) |
Oct
(63) |
Nov
(29) |
Dec
(110) |
2016 |
Jan
(82) |
Feb
(55) |
Mar
(48) |
Apr
(92) |
May
(77) |
Jun
(41) |
Jul
(27) |
Aug
(41) |
Sep
(101) |
Oct
(84) |
Nov
(12) |
Dec
(18) |
2017 |
Jan
(44) |
Feb
(40) |
Mar
(23) |
Apr
(79) |
May
(27) |
Jun
(12) |
Jul
(20) |
Aug
(14) |
Sep
(3) |
Oct
(9) |
Nov
(4) |
Dec
(9) |
2018 |
Jan
(5) |
Feb
(23) |
Mar
(150) |
Apr
(114) |
May
(63) |
Jun
(25) |
Jul
(23) |
Aug
(54) |
Sep
(43) |
Oct
(10) |
Nov
(9) |
Dec
(1) |
2019 |
Jan
(1) |
Feb
(27) |
Mar
(27) |
Apr
(64) |
May
(21) |
Jun
(17) |
Jul
(12) |
Aug
(81) |
Sep
(15) |
Oct
(25) |
Nov
(15) |
Dec
(13) |
2020 |
Jan
(5) |
Feb
(4) |
Mar
(95) |
Apr
(59) |
May
(53) |
Jun
(22) |
Jul
(3) |
Aug
(13) |
Sep
(10) |
Oct
(4) |
Nov
(3) |
Dec
(1) |
2021 |
Jan
(20) |
Feb
(32) |
Mar
(34) |
Apr
(22) |
May
(58) |
Jun
(43) |
Jul
(35) |
Aug
(2) |
Sep
(14) |
Oct
(1) |
Nov
(2) |
Dec
|
2022 |
Jan
(2) |
Feb
(6) |
Mar
(4) |
Apr
|
May
(5) |
Jun
(4) |
Jul
(3) |
Aug
(5) |
Sep
(6) |
Oct
(3) |
Nov
(38) |
Dec
(15) |
2023 |
Jan
(26) |
Feb
(12) |
Mar
(3) |
Apr
(9) |
May
(2) |
Jun
(5) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(11) |
Nov
(3) |
Dec
(3) |
2024 |
Jan
(19) |
Feb
(20) |
Mar
(15) |
Apr
(12) |
May
(2) |
Jun
(12) |
Jul
(4) |
Aug
(9) |
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(72) |
Feb
(80) |
Mar
(92) |
Apr
(35) |
May
(19) |
Jun
(26) |
Jul
(30) |
Aug
(2) |
Sep
(35) |
Oct
(2) |
Nov
|
Dec
|
From: <tro...@us...> - 2003-07-18 17:49:33
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv22614 Modified Files: serendipity_genpage.inc.php Log Message: Without the double-quote, no external stylesheets can be loaded. Index: serendipity_genpage.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_genpage.inc.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- serendipity_genpage.inc.php 9 Jul 2003 17:52:00 -0000 1.13 +++ serendipity_genpage.inc.php 18 Jul 2003 17:49:30 -0000 1.14 @@ -7,13 +7,13 @@ <html> <head> <title><?php echo htmlentities($serendipity['blogTitle']); ?></title> - <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php" /> + <!-- <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php" /> --> <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $serendipity['baseURL']; ?>feeds/index.rss" /> <script language="Javascript" type="text/javascript" src="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.js"></script> <?php if (strtolower($serendipity['extCSS'])!='none') { ?> - <style type="text/css">@import <?php echo $serendipity['extCSS']; ?>";</style> + <style type="text/css">@import "<?php echo $serendipity['extCSS']; ?>";</style> <?php } ?> |
From: <gar...@us...> - 2003-07-16 12:08:32
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv16657 Modified Files: serendipity_sidebar_items.php Log Message: Code cleanup: Indentation, single/double quotes. Index: serendipity_sidebar_items.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_sidebar_items.php,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- serendipity_sidebar_items.php 8 Jul 2003 09:13:27 -0000 1.21 +++ serendipity_sidebar_items.php 16 Jul 2003 12:08:22 -0000 1.22 @@ -1,204 +1,229 @@ <?php # $Id$ class serendipity_calendar_plugin extends serendipity_plugin { + function introspect(&$propbag) + { + $propbag->add('name', CALENDAR); + $propbag->add('description', QUICKJUMP_CALENDAR); + } + + function generate_content(&$title) + { + global $serendipity; + + $title = QUICKJUMP; - function introspect(&$propbag) - { - $propbag->add('name', CALENDAR); - $propbag->add('description', QUICKJUMP_CALENDAR); - } - - function generate_content(&$title) - { - global $serendipity; - - $title = QUICKJUMP; - if (!$serendipity["GET"]["calendarZoom"]) { - if (!$serendipity["GET"]["range"]) { - $serendipity["GET"]["calendarZoom"] = date("Y").date("m"); - } - else { - $serendipity["GET"]["calendarZoom"] = $serendipity["GET"]["range"]; - } - } - serendipity_drawCalendar(substr($serendipity["GET"]["calendarZoom"], 4, 2), - substr($serendipity["GET"]["calendarZoom"], 0,4)); + if (!$serendipity['GET']['calendarZoom']) { + if (!$serendipity['GET']['range']) { + $serendipity['GET']['calendarZoom'] = date('Y') . date('m'); + } else { + $serendipity['GET']['calendarZoom'] = $serendipity['GET']['range']; + } + } - } + serendipity_drawCalendar( + substr( + $serendipity['GET']['calendarZoom'], + 4, + 2 + ), + substr( + $serendipity['GET']['calendarZoom'], + 0, + 4 + ) + ); + } } class serendipity_quicksearch_plugin extends serendipity_plugin { - function introspect(&$propbag) - { - $propbag->add('name', QUICKSEARCH); - $propbag->add('description', SEARCH_FOR_ENTRY); - } - - function generate_content(&$title) - { - global $serendipity; - - $title = QUICKSEARCH; - - echo "<form action=\"$serendipity[serendipityHTTPPath]search.php\" METHOD=\"GET\">\n" - . "<input type=\"hidden\" name=\"serendipity[action]\" value=\"search\">\n" - . "<INPUT TYPE=\"TEXT\" name=\"serendipity[searchTerm]\" ONFOCUS=\"value='';\" size=\"13\">\n" - . "</form>"; - } + function introspect(&$propbag) + { + $propbag->add('name', QUICKSEARCH); + $propbag->add('description', SEARCH_FOR_ENTRY); + } + + function generate_content(&$title) + { + global $serendipity; + + $title = QUICKSEARCH; +?> +<form action="<?= $serendipity['serendipityHTTPPath']; ?>search.php" method="get"> + <div> + <input type="hidden" name="serendipity[action]" value="search" /> + <input type="text" name="serendipity[searchTerm]" onfocus="value='';" size="13" /> + </div> +</form> +<?php + } } class serendipity_archives_plugin extends serendipity_plugin { - function introspect(&$propbag) - { - $propbag->add('name', ARCHIVES); - $propbag->add('description', BROWSE_ARCHIVES); - } + function introspect(&$propbag) + { + $propbag->add('name', ARCHIVES); + $propbag->add('description', BROWSE_ARCHIVES); + } + + function generate_content(&$title) + { + global $serendipity; + + $title = ARCHIVES; - function generate_content(&$title) - { - global $serendipity; + $ts = mktime(0, 0, 0, (date('m')+1), 1, date('Y')); - $title = ARCHIVES; - $ts = mktime(0,0,0,(date("m")+1), 1, date("Y")); - for($x=0; $x<3; $x++) { - $ts-=1; - if ($serendipity["rewrite"] === true) - $link = $serendipity["serendipityHTTPPath"]."archives/".date("Ym", $ts).".html"; - else - $link = "fixme"; - echo "<a href='$link'>".$serendipity["months"][date("n", $ts)]." ".date("Y", $ts)."</a><br />"; - $ts = mktime(0,0,0,date("m", $ts), 1, date("Y", $ts)); + for($x = 0; $x < 3; $x++) { + $ts -= 1; - } - echo "<a href='{$serendipity['serendipityHTTPPath']}'>".RECENT."</a><br />"; - echo "<a href='{$serendipity['serendipityHTTPPath']}archive'>".OLDER."</a>"; - } -} + if ($serendipity['rewrite'] === true) { + $link = $serendipity['serendipityHTTPPath'] . 'archives/' . date('Ym', $ts) . '.html'; + } else { + $link = 'fixme'; + } + + $ts_title = $serendipity['months'][date('n', $ts)] . ' ' . date('Y', $ts); + + echo '<a href="' . $link . '" title="' . $ts_title . '">' . $ts_title . '</a><br />' . "\n"; -class serendipity_topreferrers_plugin extends serendipity_plugin { - function introspect(&$propbag) - { - $propbag->add('name', TOP_REFERRER); - $propbag->add('description', SHOWS_TOP_SITES); - } + $ts = mktime(0, 0, 0, date('m', $ts), 1, date('Y', $ts)); + } - function generate_content(&$title) - { - global $serendipity; + echo "<a href='{$serendipity['serendipityHTTPPath']}'>" . RECENT . "</a><br />\n"; + echo "<a href='{$serendipity['serendipityHTTPPath']}archive'>" . OLDER . "</a>\n"; + } +} - $title = TOP_REFERRER; - echo serendipity_displayTopReferrers(); - } +class serendipity_topreferrers_plugin extends serendipity_plugin { + function introspect(&$propbag) + { + $propbag->add('name', TOP_REFERRER); + $propbag->add('description', SHOWS_TOP_SITES); + } + + function generate_content(&$title) + { + global $serendipity; + + $title = TOP_REFERRER; + echo serendipity_displayTopReferrers(); + } } class serendipity_topexits_plugin extends serendipity_plugin { - function introspect(&$propbag) - { - $propbag->add('name', TOP_EXITS); - $propbag->add('description', SHOWS_TOP_EXIT); - } - - function generate_content(&$title) - { - global $serendipity; - - $title = TOP_EXITS; - echo serendipity_displayTopExits(); - } + function introspect(&$propbag) + { + $propbag->add('name', TOP_EXITS); + $propbag->add('description', SHOWS_TOP_EXIT); + } + + function generate_content(&$title) + { + global $serendipity; + + $title = TOP_EXITS; + echo serendipity_displayTopExits(); + } } class serendipity_syndication_plugin extends serendipity_plugin { - function introspect(&$propbag) - { - $propbag->add('name', SYNDICATION); - $propbag->add('description', SHOWS_RSS_BLAHBLAH); - } - - function generate_content(&$title) - { - global $serendipity; - - $title = SYNDICATE_THIS_BLOG; + function introspect(&$propbag) + { + $propbag->add('name', SYNDICATION); + $propbag->add('description', SHOWS_RSS_BLAHBLAH); + } + + function generate_content(&$title) + { + global $serendipity; + + $title = SYNDICATE_THIS_BLOG; ?> - <a href='<?php echo $serendipity['serendipityHTTPPath'] ; ?>rss.php?version=0.91'><img src="<?php echo $serendipity['serendipityHTTPPath'] ; ?>xml.gif" border=0></a> - <a href='<?php echo $serendipity['serendipityHTTPPath'] ; ?>rss.php?version=0.91'>RSS 0.91 feed</a> - <br/> - <a href='<?php echo $serendipity['serendipityHTTPPath'] ; ?>rss.php?version=2.0'><img src="<?php echo $serendipity['serendipityHTTPPath'] ; ?>xml.gif" border=0></a> - <a href='<?php echo $serendipity['serendipityHTTPPath'] ; ?>rss.php?version=2.0'>RSS 2.0 feed</a> + <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>rss.php?version=0.91"><img src="<?php echo $serendipity['serendipityHTTPPath']; ?>xml.gif" border="0" alt="XML" /></a> + <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>rss.php?version=0.91">RSS 0.91 feed</a> + <br /> + <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>rss.php?version=2.0"><img src="<?php echo $serendipity['serendipityHTTPPath']; ?>xml.gif" border="0" alt="XML" /></a> + <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>rss.php?version=2.0">RSS 2.0 feed</a> <?php - } + } } class serendipity_superuser_plugin extends serendipity_plugin { - function introspect(&$propbag) - { - $propbag->add('name', SUPERUSER); - $propbag->add('description', ALLOWS_YOU_BLAHBLAH); - } - - function generate_content(&$title) - { - global $serendipity; - - $title = SUPERUSER.":"; - echo "<a href=\"$serendipity[serendipityHTTPPath]entries\">\$ su -</a>"; - } + function introspect(&$propbag) + { + $propbag->add('name', SUPERUSER); + $propbag->add('description', ALLOWS_YOU_BLAHBLAH); + } + + function generate_content(&$title) + { + global $serendipity; + + $title = SUPERUSER . ':'; + echo "<a href=\"{$serendipity['serendipityHTTPPath']}entries\" title=\"$title\">\$ su -</a>"; + } } class serendipity_plug_plugin extends serendipity_plugin { - function introspect(&$propbag) - { - $propbag->add('name', POWERED_BY); - $propbag->add('description', ADVERTISES_BLAHBLAH); - } - - function generate_content(&$title) - { - global $serendipity; - - $title = POWERED_BY.":"; - echo "<div class=\"serendipityPlug\"><a href=\"http://www.s9y.org\"><img src=\"{$serendipity['serendipityHTTPPath']}pixel/s9y_banner_tiny.png\" alt=\":serendipity\" border=\"0\"/></a></div>"; - } + function introspect(&$propbag) + { + $propbag->add('name', POWERED_BY); + $propbag->add('description', ADVERTISES_BLAHBLAH); + } + + function generate_content(&$title) + { + global $serendipity; + + $title = POWERED_BY . ":"; +?> +<div class="serendipityPlug"> + <a title=":serendipity" href="http://www.s9y.org/"><img src="<?= $serendipity['serendipityHTTPPath']; ?>pixel/s9y_banner_tiny.png" alt=":serendipity" border="0" /></a> +</div> +<?php + } } class serendipity_html_nugget_plugin extends serendipity_plugin { - function introspect(&$propbag) - { - $propbag->add('name', HTML_NUGGET); - $propbag->add('description', HOLDS_A_BLAHBLAH); - $propbag->add('configuration', array( - 'title', - 'content', - )); - } - - function introspect_config_item($name, &$propbag) - { - switch($name) { - case 'title': - $propbag->add('type', 'string'); - $propbag->add('name', 'Title'); - $propbag->add('description', TITLE_FOR_NUGGET); - break; - - case 'content': - $propbag->add('type', 'html'); - $propbag->add('name', 'Content'); - $propbag->add('description', THE_NUGGET); - break; - default: - return false; - } - return true; - } - - function generate_content(&$title) - { - $title = $this->get_config('title', $title); - echo serendipity_markup_text($this->get_config('content')); - } + function introspect(&$propbag) + { + $propbag->add('name', HTML_NUGGET); + $propbag->add('description', HOLDS_A_BLAHBLAH); + $propbag->add('configuration', array( + 'title', + 'content', + ) + ); + } + + function introspect_config_item($name, &$propbag) + { + switch($name) { + case 'title': + $propbag->add('type', 'string'); + $propbag->add('name', 'Title'); + $propbag->add('description', TITLE_FOR_NUGGET); + break; + + case 'content': + $propbag->add('type', 'html'); + $propbag->add('name', 'Content'); + $propbag->add('description', THE_NUGGET); + break; + default: + return false; + } + return true; + } + + function generate_content(&$title) + { + $title = $this->get_config('title', $title); + echo serendipity_markup_text($this->get_config('content')); + } } -/* vim: set sts=4 ts=4 expandtab : */ +/* vim: set sts=4 ts=4 expandtab : */ ?> |
From: <gar...@us...> - 2003-07-16 12:05:45
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv16202 Modified Files: serendipity_plugin_api.php Log Message: Changes accopampanying serendipity_admin_plugins.inc.php Index: serendipity_plugin_api.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_plugin_api.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serendipity_plugin_api.php 8 Jul 2003 12:14:17 -0000 1.5 +++ serendipity_plugin_api.php 16 Jul 2003 12:05:40 -0000 1.6 @@ -74,6 +74,7 @@ { global $serendipity; serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}plugins where name='$plugin_instance_id'"); + serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}config where name LIKE '$plugin_instance_id/%'"); } /* Retrieves a list of available plugins */ @@ -123,7 +124,7 @@ $sql .= "WHERE placement='$filter' "; } - $sql .= " ORDER BY placement, sort_order"; + $sql .= ' ORDER BY placement, sort_order'; return serendipity_db_query($sql); } |
From: <gar...@us...> - 2003-07-16 12:03:27
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv15776 Modified Files: serendipity_admin_plugins.inc.php Log Message: o Code style (double/single quotes, html) o Moved function declarations to the top of the file o Now remove config entries when a plugin is removed o After update, show the new values for the plugin instead the old ones. Index: serendipity_admin_plugins.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_plugins.inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- serendipity_admin_plugins.inc.php 8 Jul 2003 09:13:27 -0000 1.6 +++ serendipity_admin_plugins.inc.php 16 Jul 2003 12:03:22 -0000 1.7 @@ -1,253 +1,292 @@ <?php # $Id$ -if (IN_serendipity !== true) die ("Don't hack!"); +if (IN_serendipity !== true) { + die ('Don\'t hack!'); +} session_start(); -include_once "serendipity_plugin_api.php"; -include_once "serendipity_sidebar_items.php"; - -if (isset($_GET['serendipity']['plugin_to_move']) && isset($_GET['submit'])) { - $plugins = serendipity_plugin_api::enum_plugins(); - /* Renumber the sort order to be certain that one actually exists - Also look for the one we're going to move */ - $idx_to_move = -1; - for($idx=0; $idx<count($plugins); $idx++) { - $plugins[$idx]['sort_order'] = $idx; - if ($plugins[$idx]['name'] == $_GET['serendipity']['plugin_to_move']) - $idx_to_move = $idx; - } - /* If idx_to_move is still -1 then we never found it (shouldn't happen under normal conditions) - Also make sure the swaping idx is around */ - if ($idx_to_move >= 0 && (($_GET['submit'] == 'move down' && $idx_to_move < (count($plugins)-1)) || ($_GET['submit'] == 'move up' && $idx_to_move > 0))) { - /* Swap the one were moving with the one that's in the spot we're moving to */ - $tmp = $plugins[$idx_to_move]['sort_order']; - $plugins[$idx_to_move]['sort_order'] = (int)$plugins[$idx_to_move+($_GET['submit'] == 'move down' ? 1 : -1)]['sort_order']; - $plugins[$idx_to_move+($_GET['submit'] == 'move down' ? 1 : -1)]['sort_order'] = (int)$tmp; - - /* Update table */ - foreach($plugins as $plugin) { - $key = serendipity_db_escape_string($plugin['name']); - serendipity_db_query("UPDATE $serendipity[dbPrefix]plugins SET sort_order=$plugin[sort_order] WHERE name='$key'"); - } - } +include_once 'serendipity_plugin_api.php'; +include_once 'serendipity_sidebar_items.php'; - /* TODO: Moving The first Right oriented plugin up, - or the last left oriented plugin down - should not be displayed to the user as an option. - It's a behavior which really has no meaning. */ +function placement_box($name, $val) +{ + static $opts = array( + 'left' => LEFT, + 'right' => RIGHT, + 'hide' => HIDDEN + ); + + $x = "\n<select name=\"$name\">\n"; + foreach ($opts as $k => $v) { + $x .= " <option value=\"$k\"" . ($k == $val ? ' selected="selected"' : '') . ">$v</option>\n"; + } + return $x . "</select>\n"; } -if (isset($_GET['serendipity']['plugin_to_conf'])) { - /* configure a specific instance */ +if (isset($_GET['serendipity']['plugin_to_move']) && isset($_GET['submit'])) { + $plugins = serendipity_plugin_api::enum_plugins(); - $plugin =& serendipity_plugin_api::load_plugin($_GET['serendipity']['plugin_to_conf']); + /* Renumber the sort order to be certain that one actually exists + Also look for the one we're going to move */ + $idx_to_move = -1; + for($idx = 0; $idx < count($plugins); $idx++) { + $plugins[$idx]['sort_order'] = $idx; - $bag = new serendipity_property_bag; - $plugin->introspect($bag); - $name = htmlentities($bag->get('name')); - $desc = htmlentities($bag->get('description')); - - $config_names = $bag->get('configuration'); + if ($plugins[$idx]['name'] == $_GET['serendipity']['plugin_to_move']) { + $idx_to_move = $idx; + } + } - if (isset($_POST['SAVECONF'])) { - /* enum properties and set their values */ + /* If idx_to_move is still -1 then we never found it (shouldn't happen under normal conditions) + Also make sure the swaping idx is around */ + if ($idx_to_move >= 0 && (($_GET['submit'] == 'move down' && $idx_to_move < (count($plugins)-1)) || ($_GET['submit'] == 'move up' && $idx_to_move > 0))) { - foreach ($config_names as $config_item) { - $cbag = new serendipity_property_bag; - if ($plugin->introspect_config_item($config_item, $cbag)) { - $plugin->set_config($config_item, $_POST['serendipity']['plugin'][$config_item]); - } - } - } + /* Swap the one were moving with the one that's in the spot we're moving to */ + $tmp = $plugins[$idx_to_move]['sort_order']; + $plugins[$idx_to_move]['sort_order'] = (int)$plugins[$idx_to_move + ($_GET['submit'] == 'move down' ? 1 : -1)]['sort_order']; + $plugins[$idx_to_move + ($_GET['submit'] == 'move down' ? 1 : -1)]['sort_order'] = (int)$tmp; + + /* Update table */ + foreach($plugins as $plugin) { + $key = serendipity_db_escape_string($plugin['name']); + serendipity_db_query("UPDATE {$serendipity['dbPrefix']}plugins SET sort_order = {$plugin['sort_order']} WHERE name='$key'"); + } + } + + /* TODO: Moving The first Right oriented plugin up, + or the last left oriented plugin down + should not be displayed to the user as an option. + It's a behavior which really has no meaning. */ +} + +if (isset($_GET['serendipity']['plugin_to_conf'])) { + /* configure a specific instance */ + $plugin =& serendipity_plugin_api::load_plugin($_GET['serendipity']['plugin_to_conf']); + + $bag = new serendipity_property_bag; + $plugin->introspect($bag); + $name = htmlentities($bag->get('name')); + $desc = htmlentities($bag->get('description')); + + $config_names = $bag->get('configuration'); - + if (isset($_POST['SAVECONF'])) { + /* enum properties and set their values */ + + foreach ($config_names as $config_item) { + $cbag = new serendipity_property_bag; + if ($plugin->introspect_config_item($config_item, $cbag)) { + $plugin->set_config($config_item, $_POST['serendipity']['plugin'][$config_item]); + } + } + } ?> -<form method="POST" name="serendipityPluginConfigure"> +<form method="post" name="serendipityPluginConfigure"> + <table cellpadding="5"> + <tr> + <th><?php echo NAME; ?></th> + <td><?php echo $name; ?></td> + </tr> -<table cellpadding="5"> -<tr> -<th>Name</th> -<td><?php echo $name ; ?></td> -</tr> -<tr> -<th>Description</th> -<td><?php echo $desc ; ?></td> -</tr> -</table> + <tr> + <th><?php echo DESCRIPTION; ?></th> + <td><?php echo $desc; ?></td> + </tr> + </table> -<table border="0" cellspacing="5" cellpadding="5"> + <table border="0" cellspacing="5" cellpadding="5"> <?php + foreach ($config_names as $config_item) { + $cbag = new serendipity_property_bag; + $plugin->introspect_config_item($config_item, $cbag); + + $cname = htmlentities($cbag->get('name')); + $cdesc = htmlentities($cbag->get('description')); + $value = $plugin->get_config($config_item); + $hvalue = (isset($_POST['serendipity']['plugin'][$config_item]) ? htmlentities($_POST['serendipity']['plugin'][$config_item]) : htmlentities($value)); - - foreach ($config_names as $config_item) { - $cbag = new serendipity_property_bag; - $plugin->introspect_config_item($config_item, $cbag); - - $cname = htmlentities($cbag->get('name')); - $cdesc = htmlentities($cbag->get('description')); - $value = $plugin->get_config($config_item); - $hvalue = htmlentities($value); - - switch ($cbag->get('type')) { - case 'string': - echo "<tr><td>$cname</td><td><input type=\"text\" name=\"serendipity[plugin][$config_item]\" value=\"$hvalue\"> <font color='#bbbbbb'>//$cdesc</font></td></tr>\n"; - break; - case 'html': - echo "<tr><td colspan=\"2\">$cname <font color='#bbbbbb'>//$cdesc</font></td></tr>\n<tr><td colspan=\"2\"><textarea name=\"serendipity[plugin][$config_item]\" rows=\"20\" cols=\"80\">$hvalue</textarea></td></tr>"; - serendipity_emit_htmlarea_code("document.forms['serendipityPluginConfigure']['serendipity[plugin][$config_item]']"); - break; - } - - } + switch ($cbag->get('type')) { + case 'string': ?> -</table> -<input type="submit" name="SAVECONF" value="Save"> -</form> + <tr> + <td><?php echo $cname; ?></td> + <td> + <div> + <input type="text" name="serendipity[plugin][<?php echo $config_item; ?>]" value="<?php echo $hvalue; ?>" /> <span style="color: #bbbbbb">// <?php echo $cdesc; ?></span> + </div> + </td> + </tr> <?php + break; + case 'html': +?> + <tr> + <td colspan="2"> + <?php echo $cname; ?> <span style="color: #bbbbbb">// <?php echo $cdesc; ?></span> + </td> + </tr> + + <tr> + <td colspan="2"> + <div> + <textarea name="serendipity[plugin][<?php echo $config_item; ?>]" rows="20" cols="80"><?php echo $hvalue; ?></textarea> + </div> + </td> + </tr> +<?php + serendipity_emit_htmlarea_code("document.forms['serendipityPluginConfigure']['serendipity[plugin][$config_item]']"); + break; + } + } +?> + </table> + <div> + <input type="submit" name="SAVECONF" value="<?php echo SAVE; ?>" /> + </div> +</form> +<?php } else { - /* show general plugin list */ + /* show general plugin list */ -if (isset($_POST['SAVE']) && isset($_POST['serendipity']['placement'])) { - foreach ($_POST['serendipity']['placement'] as $plugin_name => $placement) { - serendipity_plugin_api::update_plugin_placement( - addslashes($plugin_name), - addslashes($placement) - ); - } -} -if (isset($_POST['NEW']) && $_POST['serendipity']['plugin_to_add'] != '0') { - $inst = serendipity_plugin_api::create_plugin_instance($_POST['serendipity']['plugin_to_add']); - /* TODO: redirect to configuration for that instance */ -} -if (isset($_POST['REMOVE'])) { - foreach ($_POST['serendipity']['plugin_to_remove'] as $key) { - serendipity_plugin_api::remove_plugin_instance($key); - } -} + if (isset($_POST['SAVE']) && isset($_POST['serendipity']['placement'])) { + foreach ($_POST['serendipity']['placement'] as $plugin_name => $placement) { + serendipity_plugin_api::update_plugin_placement( + addslashes($plugin_name), + addslashes($placement) + ); + } + } -/* list of classes for creating instances */ -$classes = serendipity_plugin_api::enum_plugin_classes(); + if (isset($_POST['NEW']) && $_POST['serendipity']['plugin_to_add'] != '0') { + $inst = serendipity_plugin_api::create_plugin_instance($_POST['serendipity']['plugin_to_add']); + /* TODO: redirect to configuration for that instance */ + } + if (isset($_POST['REMOVE'])) { + foreach ($_POST['serendipity']['plugin_to_remove'] as $key) { + serendipity_plugin_api::remove_plugin_instance($key); + } + } + /* list of classes for creating instances */ + $classes = serendipity_plugin_api::enum_plugin_classes(); ?> <form action="?serendipity[adminModule]=plugins" method="post"> - -<select name="serendipity[plugin_to_add]"> -<option value="0">[ <?php echo SELECT_A_PLUGIN_TO_ADD; ?> ]</option> + <div> + <select name="serendipity[plugin_to_add]"> + <option value="0">[ <?php echo SELECT_A_PLUGIN_TO_ADD; ?> ]</option> <?php -foreach ($classes as $class_name) { - $plugin =& serendipity_plugin_api::load_plugin($class_name); - - /* query for its name, description and configuration data */ - $bag = new serendipity_property_bag; - $plugin->introspect($bag); - - $name = htmlentities($bag->get('name')); - $desc = htmlentities($bag->get('description')); - - echo "<option value=\"$class_name\">$name - $desc</option>\n"; -} - - + foreach ($classes as $class_name) { + $plugin =& serendipity_plugin_api::load_plugin($class_name); + + /* query for its name, description and configuration data */ + $bag = new serendipity_property_bag; + $plugin->introspect($bag); + + $name = $bag->get('name'); + $desc = $bag->get('description'); +?> + <option value="<?php echo $class_name; ?>"><?php echo $name . ' - ' . $desc; ?></option> +<?php + } ?> -</select> - -<input name="NEW" value="<?php echo ADD_PLUGIN; ?>" type="submit" /> - -<br /> -<br /> + </select> + <input name="NEW" value="<?php echo ADD_PLUGIN; ?>" type="submit" /> + <br /> + <br /> -<table border="1" cellpadding="5"> -<tr> -<th> </th> -<th><?php echo TITLE; ?></th> -<th><?php echo PLUGIN; ?></th> -<th><?php echo DESCRIPTION; ?></th> -<th><?php echo PLACEMENT; ?></th> -</tr> + <table border="1" cellpadding="5"> + <tr> + <th> </th> + <th><?php echo TITLE; ?></th> + <th><?php echo PLUGIN; ?></th> + <th><?php echo DESCRIPTION; ?></th> + <th><?php echo PLACEMENT; ?></th> + </tr> <?php -function placement_box($name, $val) -{ - static $opts = array( - 'left' => 'Left', - 'right' => 'Right', - 'hide' => 'Hidden' - ); - - $x = "<select name=\"$name\">"; - foreach ($opts as $k => $v) { - $x .= "<option value=\"$k\""; - if ($k == $val) - $x .= " selected"; - $x .= ">$v</option>"; - } - return $x . "</select>"; -} - -$sort_order = 0; - -/* Block display the plugins per placement location. */ -$plugin_placements = array('left','right','hide'); -foreach ($plugin_placements as $plugin_placement) { - $plugins = serendipity_plugin_api::enum_plugins($plugin_placement); - if (!is_array($plugins)) { - continue; - } - $sort_idx = 0; - foreach ($plugins as $plugin_data) { - $plugin =& serendipity_plugin_api::load_plugin($plugin_data['name']); - - $key = urlencode($plugin_data['name']); - - /* query for its name, description and configuration data */ - $bag = new serendipity_property_bag; - $plugin->introspect($bag); - - $name = htmlentities($bag->get('name')); - $desc = htmlentities($bag->get('description')); - $place = placement_box("serendipity[placement][" . $plugin_data['name'] . "]", $plugin_data['placement']); - - $title = ""; - ob_start(); - $plugin->generate_content($title); - ob_end_clean(); - if (strlen(trim($title)) == 0) { - $title = " "; - } - - if ($bag->is_set('configuration')) { - $url = "?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]=$key"; - $desc = "<a href=\"$url\">$desc</a>"; - $name = "<a href=\"$url\">$name</a>"; - $title = "<a href=\"$url\">$title</a>"; - } + $sort_order = 0; + + /* Block display the plugins per placement location. */ + $plugin_placements = array('left', 'right', 'hide'); - /* Only display UP/DOWN links if there's somewhere for the plugin to go */ - if ($sort_idx == 0) - $moveup = " "; - else - $moveup = "<a href=\"?serendipity[adminModule]=plugins&submit=move+up&serendipity[plugin_to_move]=$key\">".UP."</a>"; + foreach ($plugin_placements as $plugin_placement) { + $plugins = serendipity_plugin_api::enum_plugins($plugin_placement); - if ($sort_idx == (count($plugins)-1)) - $movedown = ""; - else - $movedown = "<a href=\"?serendipity[adminModule]=plugins&submit=move+down&serendipity[plugin_to_move]=$key\">".DOWN."</a>"; + if (!is_array($plugins)) { + continue; + } + $sort_idx = 0; + foreach ($plugins as $plugin_data) { + $plugin =& serendipity_plugin_api::load_plugin($plugin_data['name']); + $key = urlencode($plugin_data['name']); + + /* query for its name, description and configuration data */ + $bag = new serendipity_property_bag; + $plugin->introspect($bag); + + $name = htmlentities($bag->get('name')); + $desc = htmlentities($bag->get('description')); + $place = placement_box('serendipity[placement][' . $plugin_data['name'] . ']', $plugin_data['placement']); + + $title = ''; - echo "<tr><td><input type=\"checkbox\" name=\"serendipity[plugin_to_remove][]\" value=\"$plugin_data[name]\"></td><td>$title</td><td>$name</td><td>$desc</td><td>$place $moveup $movedown</td></tr>\n"; + ob_start(); + $plugin->generate_content($title); + ob_end_clean(); - $sort_idx++; - } -} + if (strlen(trim($title)) == 0) { + $title = ' '; + } + + if ($bag->is_set('configuration')) { + $url = '?serendipity[adminModule]=plugins&serendipity[plugin_to_conf]=' . $key; + $desc = '<a href="' . $url . '">' . $desc . '</a>'; + $name = '<a href="' . $url . '">' . $name . '</a>'; + $title = '<a href="' . $url . '">' . $title . '</a>'; + } + + /* Only display UP/DOWN links if there's somewhere for the plugin to go */ + if ($sort_idx == 0) { + $moveup = ''; + } else { + $moveup = '<a href="?serendipity[adminModule]=plugins&submit=move+up&serendipity[plugin_to_move]=' . $key . '">' . UP . '</a>'; + } + + if ($sort_idx == (count($plugins)-1)) { + $movedown = ''; + } else { + $movedown = ($moveup != '' ? ' ' : '') . '<a href="?serendipity[adminModule]=plugins&submit=move+down&serendipity[plugin_to_move]=' . $key . '">' . DOWN . '</a>'; + } ?> -</table> -<br /> + <tr> + <td> + <div> + <input type="checkbox" name="serendipity[plugin_to_remove][]" value="<?php echo $plugin_data['name']; ?>"> + </div> + </td> + + <td><?php echo $title; ?></td> + <td><?php echo $name; ?></td> + <td><?php echo $desc; ?></td> + <td> + <div><?php echo $place . $moveup . $movedown; ?></div> + </td> + </tr> +<?php + $sort_idx++; + } + } +?> + </table> + <br /> -<input type="submit" name="REMOVE" title="Remove Ticked Plugins" value="<?php echo DELETE; ?>"> -<input type="submit" name="SAVE" title="Save changes to layout" value="<?php echo SAVE; ?>"> + <input type="submit" name="REMOVE" title="<?php echo REMOVE_TICKED_PLUGINS; ?>" value="<?php echo DELETE; ?>" /> + <input type="submit" name="SAVE" title="<?php echo SAVE_CHANGES_TO_LAYOUT; ?>" value="<?php echo SAVE; ?>" /> + </div> </form> <?php } |
From: <gar...@us...> - 2003-07-16 11:59:31
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv15296 Modified Files: serendipity_entries.php Log Message: Code style Index: serendipity_entries.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_entries.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- serendipity_entries.php 8 Jul 2003 12:14:17 -0000 1.13 +++ serendipity_entries.php 16 Jul 2003 11:59:28 -0000 1.14 @@ -94,7 +94,7 @@ • <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>" ><?php echo BACK_TO_BLOG; ?></a><br /> • <a href="?serendipity[adminModule]=logout" ><?php echo LOGOUT; ?></a><br /> - <img src="<?php echo $serendipity['baseURL'] . 'templates/default/img/leer.png'; ?>" height="1" width="130" alt="" /> + <img src="<?php echo $serendipity['baseURL']; ?>templates/default/img/leer.png" height="1" width="130" alt="" /> </div> </td> |
From: <gar...@us...> - 2003-07-16 11:58:29
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv15123 Modified Files: serendipity_lang_de.inc.php serendipity_lang_en.inc.php serendipity_admin.php Log Message: More code style, language separation. Index: serendipity_lang_de.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_de.inc.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- serendipity_lang_de.inc.php 8 Jul 2003 14:40:00 -0000 1.15 +++ serendipity_lang_de.inc.php 16 Jul 2003 11:58:24 -0000 1.16 @@ -173,6 +173,14 @@ define('ENTRIES_FOR', 'Einträge am %s'); define('TOPICS_FOR', 'Themen am %s'); define('DOCUMENT_NOT_FOUND', 'Das Dokument %s wurde nicht gefunden.'); +define('USERNAME', 'Benutzername'); +define('PASSWORD', 'Passwort'); +define('SERENDIPITY_INSTALLATION', 'Serendipity-Installation'); +define('LEFT', 'links'); +define('RIGHT', 'rechts'); +define('HIDDEN', 'versteckt'); +define('REMOVE_TICKED_PLUGINS', 'Markierte plugins entfernen'); +define('SAVE_CHANGES_TO_LAYOUT', 'Änderungen am Layout speichern'); define('serendipity_LANG_LOADED', true); /* vim: set sts=4 ts=4 expandtab : */ Index: serendipity_lang_en.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_en.inc.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- serendipity_lang_en.inc.php 8 Jul 2003 14:40:00 -0000 1.19 +++ serendipity_lang_en.inc.php 16 Jul 2003 11:58:24 -0000 1.20 @@ -173,6 +173,14 @@ define('ENTRIES_FOR', 'Entries for %s'); define('TOPICS_FOR', 'Topics for %s'); define('DOCUMENT_NOT_FOUND', 'The document %s was not found.'); +define('USERNAME', 'username'); +define('PASSWORD', 'password'); +define('SERENDIPITY_INSTALLATION', 'Serendipity installation'); +define('LEFT', 'left'); +define('RIGHT', 'right'); +define('HIDDEN', 'hidden'); +define('REMOVE_TICKED_PLUGINS', 'Remove ticked plugins'); +define('SAVE_CHANGES_TO_LAYOUT', 'Save changes to layout'); define('serendipity_LANG_LOADED', true); /* vim: set sts=4 ts=4 expandtab : */ Index: serendipity_admin.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- serendipity_admin.php 8 Jul 2003 09:13:27 -0000 1.15 +++ serendipity_admin.php 16 Jul 2003 11:58:24 -0000 1.16 @@ -1,130 +1,144 @@ <?php # $Id$ -ini_set("session.use_trans_sid",1); +ini_set('session.use_trans_sid', 1); session_start(); -if (file_exists("./serendipity_config_local.inc.php")) { - include("serendipity_config.inc.php"); +if (file_exists('./serendipity_config_local.inc.php')) { + include('serendipity_config.inc.php'); } else { $_SESSION['serendipityAuthedUser'] = true; } + // User logs in? -if($_SESSION['serendipityAuthedUser'] || serendipity_authenticate_author($serendipity["POST"]["user"], $serendipity["POST"]["pass"])) { - $_SESSION["serendipityAuthedUser"] = true; - $serendipity["authorid"] = $_SESSION["serendipityAuthorid"]; +if($_SESSION['serendipityAuthedUser'] + || serendipity_authenticate_author($serendipity['POST']['user'], $serendipity['POST']['pass'])) { + + $_SESSION['serendipityAuthedUser'] = true; + $serendipity['authorid'] = $_SESSION['serendipityAuthorid']; } ?> <html> - <head> - <title><?php echo SERENDIPITY_ADMIN_SUITE; ?></title> - <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php"> + <head> + <title><?php echo SERENDIPITY_ADMIN_SUITE; ?></title> + <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php" /> <?php - if (strtolower($serendipity['extCSS'])!='none') echo "<link rel='stylesheet' type='text/css' href='{$serendipity['extCSS']}'>"; +if (strtolower($serendipity['extCSS'])!='none') { +?> + <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['extCSS']; ?>" /> +<?php +} ?> - </head> - <body> -<div id="serendipity_banner"> - <h1><?php echo $serendipity['blogTitle'] ; ?></h1> + +<body> + <div id="serendipity_banner"> + <h1><?php echo $serendipity['blogTitle'] ; ?></h1> <?php - $sub = isset($serendipity['blogSubTitle']) ? $serendipity['blogSubTitle'] : $serendipity['blogDescription']; - if (strlen($sub)) { +$sub = isset($serendipity['blogSubTitle']) ? $serendipity['blogSubTitle'] : $serendipity['blogDescription']; +if (strlen($sub)) { ?> - <h2><?php echo $sub ; ?></h2> + <h2><?php echo $sub ; ?></h2> <?php - } +} ?> -</div> + </div> + <?php - // User has to log in - if ($_SESSION["serendipityAuthedUser"] !== true - && file_exists($serendipity["serendipityPath"]."serendipity_config_local.inc.php")) { +// User has to log in +if ($_SESSION['serendipityAuthedUser'] !== true + && file_exists($serendipity['serendipityPath'] . 'serendipity_config_local.inc.php')) { ?> - <div class='serendipity_auth_required'> - <?php echo HAVE_TO_BE_LOGGED_ON; ?> - <form action="?" method="post"> - <input type="hidden" name="serendipity[action]" value="admin"> - <input type="text" value="username" name="serendipity[user]" onfocus="value='';"> - <input type="password" value="password" name="serendipity[pass]" onfocus="value='';"> - <input type="submit" value=">"> - </form> - </div> + <div class='serendipity_auth_required'> + <?php echo HAVE_TO_BE_LOGGED_ON; ?> + <form action="?" method="post"> + <div> + <input type="hidden" name="serendipity[action]" value="admin" /> + <input type="text" name="serendipity[user]" value="<?php echo USERNAME; ?>" onfocus="value='';" /> + <input type="password" name="serendipity[pass]" value="<?php echo PASSWORD ?>" onfocus="value='';" /> + <input type="submit" name="submit" value=">" /> + </form> + </div> <?php - } elseif (!file_exists($serendipity["serendipityPath"]."serendipity_config_local.inc.php")) { - // User just installed serendipity, let him go to configure mode - echo "<div class='serendipity_date'>Serendipity Installation</div><p>"; - include("./serendipity_admin_installer.inc.php"); - } else { - // User is logged in +} elseif (!file_exists($serendipity['serendipityPath'] . 'serendipity_config_local.inc.php')) { + // User just installed serendipity, let him go to configure mode ?> + <div class="serendipity_date"><?php echo SERENDIPITY_INSTALLATION; ?></div> + <p><?php include('serendipity_admin_installer.inc.php'); ?> +<?php +} else { + // User is logged in +?> + <table id="mainpane"> + <tr id="content" valign="top"> + <td class="serendipitySideBar"> + <div class="serendipitySideBarItem"> + <div class="serendipitySideBarTitle"><?php echo APPEARANCE; ?>:</div> + <div class="serendipitySideBarContent"> + • <a href="?serendipity[adminModule]=templates"><?php echo MANAGE_STYLES; ?></a><br /> + • <a href="?serendipity[adminModule]=plugins"><?php echo CONFIGURE_PLUGINS; ?></a><br /> + </div> + </div> - <table id="mainpane"> - <tr id="content" valign="top"> - <td class="serendipitySideBar"> - - <div class="serendipitySideBarItem"> - <div class="serendipitySideBarTitle"><?php echo APPEARANCE; ?>:</div> - <div class="serendipitySideBarContent"> - • <a href='?serendipity[adminModule]=templates'><?php echo MANAGE_STYLES; ?></a><br> - • <a href='?serendipity[adminModule]=plugins'><?php echo CONFIGURE_PLUGINS; ?></a><br> - </div> - </div> - - <div class="serendipitySideBarItem"> - <div class="serendipitySideBarTitle"><?php echo ADMIN; ?></div> - <div class="serendipitySideBarContent"> - • <a href='?serendipity[adminModule]=installer'><?php echo CONFIGURATION; ?></a><br /> - • <a href="?serendipity[adminModule]=interop"><?php echo IMPORT_EXPORT_ENTRIES; ?></a><br /> - </div> - </div> - • <a href='<?php echo $serendipity['serendipityHTTPPath']; ?>entries'><?php echo AUTHOR_SUITE; ?></a><br /> - • <a href='<?php echo $serendipity['serendipityHTTPPath'] ; ?>'><?php echo BACK_TO_BLOG; ?></a><br /> - • <a href='?serendipity[adminModule]=logout'><?php echo LOGOUT; ?></a><br /> - <img src="<?php echo $serendipity[baseURL]."templates/default/img/leer.png"?>" height="1" width="130" /> - </td> - <td class="serendipity_admin"> - <div class="serendipity_admin_title"><?php echo SERENDIPITY_ADMIN_SUITE; ?></div> - <?php - if (!$serendipity["GET"]["adminModule"]) $serendipity["GET"]["adminModule"] = $serendipity["POST"]["adminModule"]; - switch($serendipity["GET"]["adminModule"]) { + <div class="serendipitySideBarItem"> + <div class="serendipitySideBarTitle"><?php echo ADMIN; ?></div> + <div class="serendipitySideBarContent"> + • <a href="?serendipity[adminModule]=installer"><?php echo CONFIGURATION; ?></a><br /> + • <a href="?serendipity[adminModule]=interop"><?php echo IMPORT_EXPORT_ENTRIES; ?></a><br /> + </div> + </div> - case "installer": - include("./serendipity_admin_installer.inc.php"); - break; + <div class="serendipitySideBarContent"> + • <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>entries"><?php echo AUTHOR_SUITE; ?></a><br /> + • <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>"><?php echo BACK_TO_BLOG; ?></a><br /> + • <a href="?serendipity[adminModule]=logout"><?php echo LOGOUT; ?></a><br /> + <img src="<?php echo $serendipity['baseURL']; ?>templates/default/img/leer.png" height="1" width="130" alt="" /> + </div> + </td> - case "images": - include("serendipity_admin_images.inc.php"); - break; + <td class="serendipity_admin"> + <div class="serendipity_admin_title"><?php echo SERENDIPITY_ADMIN_SUITE; ?></div> +<?php + if (!$serendipity['GET']['adminModule']) { + $serendipity['GET']['adminModule'] = $serendipity['POST']['adminModule']; + } + + switch($serendipity['GET']['adminModule']) { + case 'installer': + include './serendipity_admin_installer.inc.php'; + break; - case "templates": - include("serendipity_admin_templates.inc.php"); - break; + case 'images': + include 'serendipity_admin_images.inc.php'; + break; - case "plugins": - include "serendipity_admin_plugins.inc.php"; - break; + case 'templates': + include 'serendipity_admin_templates.inc.php'; + break; - case "interop": - include "serendipity_admin_interop.inc.php"; - break; + case 'plugins': + include 'serendipity_admin_plugins.inc.php'; + break; - case "logout": - session_destroy(); - echo LOGGEDOUT; - break; + case 'interop': + include 'serendipity_admin_interop.inc.php'; + break; - default: - include("serendipity_admin_overview.inc.php"); + case 'logout': + session_destroy(); + echo LOGGEDOUT; + break; - } - ?> - </td> - </tr> - </table> - <?php - } - ?> + default: + include 'serendipity_admin_overview.inc.php'; + } +?> + </td> + </tr> + </table> +<?php +} +?> - </body> +</body> </html> <?php /* vim: set sts=4 ts=4 expandtab : */ |
From: <tom...@us...> - 2003-07-13 16:16:21
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv16684 Modified Files: serendipity_config_local.tpl Log Message: Removed unwanted slash Added better email example Index: serendipity_config_local.tpl =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_config_local.tpl,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serendipity_config_local.tpl 9 Jul 2003 17:52:00 -0000 1.10 +++ serendipity_config_local.tpl 13 Jul 2003 16:16:18 -0000 1.11 @@ -20,14 +20,14 @@ // General settings $serendipity['user'] = '{Admin username|user|string|John Doe}'; // Username for admin login $serendipity['pass'] = '{Admin password|pass|protected|john}'; // Password for admin login -$serendipity['email'] = '{Admin email|email|string|j}'; // Email for admin login -$serendipity['want_mail'] = '{Send mails to admin?|want_mail|bool|true}'; // Do you want to receive emails when comments are posted to your entries? +$serendipity['email'] = '{Admin email|email|string|jo...@ex...}'; // Email for admin login +$serendipity['want_mail'] = '{Send mails to admin?|want_mail|bool|1}'; // Do you want to receive emails when comments are posted to your entries? $serendipity['extCSS'] = '{External Stylesheet|extCSS|string|none}'; // You can define a stylesheet uri here, aditionally to the settings adjustable in the admin interface (enter 'none' if you don't need this) $serendipity['wysiwyg'] = '{Use WYSIWYG editor|wysiwyg|bool|0}'; // Do you want to use the WYSIWYG editor (CAUTION: only turn this on if you use Microsoft's Internet Explorer!!!)? $serendipity['XHTML11'] = '{Force XHTML 1.1 compliance|XHTML11|bool|0}'; // Do you want to force XHTML 1.1 compliance (may cause problems for back-/frontend on older 4th generation browsers) $serendipity['embed'] = '{Is serendipity embedded?|embed|bool|0}'; // If you want to embed serendipity within a regular page, set to true to discard any headers and just print the contents. You can make use of the indexFile option to use a wrapper class where you put your normal webpage headers. -$serendipity['blogTitle'] = '{Blog name|blogTitle|string|John Doe\'s personal blog}'; // The title of your blog +$serendipity['blogTitle'] = '{Blog name|blogTitle|string|John Doe's personal blog}'; // The title of your blog $serendipity['blogDescription'] = '{Blog description|blogDescription|string|Welcome to my blog...}'; // Description of your blog $serendipity['lang'] = '{Language file|lang|string|en}'; // Language (for 'en' you need serendipity_lang_en.inc.php). $serendipity['track_exits'] = '{Track exit URLs|track_exits|bool|1}'; // Do you want to track exit targets? |
From: George S. <ge...@om...> - 2003-07-13 16:15:48
|
a) won't your new improvement here throw errors to the user during install if display_errors is set? b) We do have ONE template solution. It just happens to have multiple manifestations and allow for multiple css per blog (in the absence of an existing default). Sorry if you don't like it, but some people do. On Sunday, July 13, 2003, at 08:41 AM, tom...@us... wrote: > Update of /cvsroot/php-blog/serendipity > In directory sc8-pr-cvs1:/tmp/cvs-serv18983 > > Modified Files: > serendipity.css.php > Log Message: > This file is getting far to complicated. > > We need to decide on ONE template solution... > > > Index: serendipity.css.php > =================================================================== > RCS file: /cvsroot/php-blog/serendipity/serendipity.css.php,v > retrieving revision 1.15 > retrieving revision 1.16 > diff -u -d -r1.15 -r1.16 > --- serendipity.css.php 13 Jul 2003 12:21:41 -0000 1.15 > +++ serendipity.css.php 13 Jul 2003 12:41:51 -0000 1.16 > @@ -1,8 +1,8 @@ > <?php # $Id$ > > header('Content-type: text/css'); > - > -if ( !@include_once('serendipity_config_local.inc.php') ) { > +include_once('serendipity_config.inc.php'); > +if ( !@file_exists('serendipity_config_local.inc.php') ) { > if ( file_exists('templates/default/style.css') ) { > readfile('templates/default/style.css'); > } else { > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > php-blog-cvs mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-blog-cvs > -- George Schlossnagle -- Principal Consultant -- OmniTI Computer Consulting, Inc. -- +1.410.872.4910 x202 -- 1024D/1100A5A0 1370 F70A 9365 96C9 2F5E 56C2 B2B9 262F 1100 A5A0 |
From: <tom...@us...> - 2003-07-13 13:10:02
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv22162 Modified Files: serendipity.css.php Log Message: Fatal typo Index: serendipity.css.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.css.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- serendipity.css.php 13 Jul 2003 12:54:15 -0000 1.17 +++ serendipity.css.php 13 Jul 2003 13:09:59 -0000 1.18 @@ -6,7 +6,8 @@ echo str_replace('{TEMPLATE_PATH}', dirname($file) .'/', file_get_contents($file)); } -if ( !file_exists('serendippity_config_local.inc.php') ) { + +if ( !file_exists('serendipity_config_local.inc.php') ) { if ( file_exists('templates/default/style.css') ) { serendipity_printStylesheet('templates/default/style.css'); } else { @@ -14,12 +15,9 @@ } die(); } - include_once('serendipity_config.inc.php'); -if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css') ) { +if ( file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css') ) { serendipity_printStylesheet($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css'); -} else if (file_exists($serendipity['templatePath'] . 'default/style.css')) { - readfile ($serendipity['templatePath'] . 'default/style.css'); } else { $css = serendipity_getCSS($_REQUEST['style']); echo $css['data']; |
From: <tom...@us...> - 2003-07-13 12:54:19
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv20046 Modified Files: serendipity.css.php Log Message: Basically we first have a section which deals with the CSS during the installation After that we include the configuration and use the selected template We have a function which replaces the TEMPLATE_PATH in the stylesheets, and prints the output Index: serendipity.css.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.css.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- serendipity.css.php 13 Jul 2003 12:41:51 -0000 1.16 +++ serendipity.css.php 13 Jul 2003 12:54:15 -0000 1.17 @@ -1,19 +1,26 @@ <?php # $Id$ header('Content-type: text/css'); -include_once('serendipity_config.inc.php'); -if ( !@file_exists('serendipity_config_local.inc.php') ) { +function serendipity_printStylesheet($file) { + global $serendipity; + echo str_replace('{TEMPLATE_PATH}', dirname($file) .'/', file_get_contents($file)); + +} +if ( !file_exists('serendippity_config_local.inc.php') ) { if ( file_exists('templates/default/style.css') ) { - readfile('templates/default/style.css'); + serendipity_printStylesheet('templates/default/style.css'); } else { readfile('serendipity.css'); } -} else if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css') ) { - echo str_replace('{TEMPLATE_PATH}', $serendipity['baseURL'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default'). '/', file_get_contents($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css')); + die(); +} + +include_once('serendipity_config.inc.php'); +if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css') ) { + serendipity_printStylesheet($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css'); } else if (file_exists($serendipity['templatePath'] . 'default/style.css')) { readfile ($serendipity['templatePath'] . 'default/style.css'); } else { - include_once('serendipity_config.inc.php'); $css = serendipity_getCSS($_REQUEST['style']); echo $css['data']; } |
From: <tom...@us...> - 2003-07-13 12:41:54
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv18983 Modified Files: serendipity.css.php Log Message: This file is getting far to complicated. We need to decide on ONE template solution... Index: serendipity.css.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.css.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- serendipity.css.php 13 Jul 2003 12:21:41 -0000 1.15 +++ serendipity.css.php 13 Jul 2003 12:41:51 -0000 1.16 @@ -1,8 +1,8 @@ <?php # $Id$ header('Content-type: text/css'); - -if ( !@include_once('serendipity_config_local.inc.php') ) { +include_once('serendipity_config.inc.php'); +if ( !@file_exists('serendipity_config_local.inc.php') ) { if ( file_exists('templates/default/style.css') ) { readfile('templates/default/style.css'); } else { |
From: <tom...@us...> - 2003-07-13 12:21:45
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv16680 Modified Files: serendipity.css.php Log Message: Fixed CSS not being showed during installation of s9y Index: serendipity.css.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.css.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- serendipity.css.php 9 Jul 2003 17:52:00 -0000 1.14 +++ serendipity.css.php 13 Jul 2003 12:21:41 -0000 1.15 @@ -2,8 +2,12 @@ header('Content-type: text/css'); -if (!@include_once('serendipity_config.inc.php')) { - readfile('serendipity.css'); +if ( !@include_once('serendipity_config_local.inc.php') ) { + if ( file_exists('templates/default/style.css') ) { + readfile('templates/default/style.css'); + } else { + readfile('serendipity.css'); + } } else if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css') ) { echo str_replace('{TEMPLATE_PATH}', $serendipity['baseURL'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default'). '/', file_get_contents($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css')); } else if (file_exists($serendipity['templatePath'] . 'default/style.css')) { |
From: <tom...@us...> - 2003-07-12 18:55:31
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv18639 Modified Files: serendipity_functions.inc.php Log Message: Cleaned up the comment-form a little Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.103 retrieving revision 1.104 diff -u -d -r1.103 -r1.104 --- serendipity_functions.inc.php 9 Jul 2003 18:55:36 -0000 1.103 +++ serendipity_functions.inc.php 12 Jul 2003 18:55:28 -0000 1.104 @@ -130,13 +130,10 @@ <td class="serendipity_commentsLabel"><?php echo COMMENT; ?></td> <td class="serendipity_commentsValue"><textarea rows="10" cols="40" name="serendipity[comment]"></textarea></td> </tr> - </table> - - <div> - <span class="serendipity_comment_source" style="vertical-align: middle"><?php echo REMEMBER_INFO; ?></span> - <input type="checkbox" name="serendipity[remember]" <?php echo $serendipity['COOKIE']['remember'] ; ?> /><br /> - <input type="submit" value="<?php echo SUBMIT_COMMENT; ?>" /> - </div> + <tr> + <td> </td> + <td class="serendipity_commentsLabel"><input type="submit" value="<?php echo SUBMIT_COMMENT; ?>" /> <input type="checkbox" name="serendipity[remember]" <?php echo $serendipity['COOKIE']['remember'] ; ?> /> <?php echo REMEMBER_INFO; ?></td> + </table> </form> <?php } @@ -225,7 +222,7 @@ $link = 'fixme'; } ?> -<table width="100%" class='serendipity_calendar' cellspacing="1"> +<table width="100%" class="serendipity_calendar" cellspacing="1"> <tr> <td align="left" class="serendipity_calendarHeader"> <a title="<?php echo BACK; ?>" href="<?php echo $serendipity['serendipityHTTPPath'] . $serendipity['indexFile']; ?>?serendipity[calendarZoom]=<?php echo $previousYear . sprintf('%02d',$previousMonth); ?>"><img alt="<?php echo BACK; ?>" src="<?php echo serendipity_getTemplateFile('img/back.png'); ?>" border="0" /></a></td> |
From: <gar...@us...> - 2003-07-09 18:55:39
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv9578 Modified Files: index.php serendipity_functions.inc.php Log Message: Adjusted mktime() start/end timestamps to correctly return dates for a whole dayspan. Fixes a bug that the last day of a month was not taken into account of the archives. Index: index.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/index.php,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- index.php 9 Jul 2003 17:52:00 -0000 1.21 +++ index.php 9 Jul 2003 18:55:36 -0000 1.22 @@ -15,11 +15,11 @@ if (strlen($range) == 6) { - $date = date('m/Y', mktime(0,0,0, substr($range, 4, 6), 2, substr($range, 0, 4))); + $date = date('m/Y', mktime(0, 0, 0, substr($range, 4, 6), 2, substr($range, 0, 4))); } else { $date = date('d/m/Y', strtotime($range)); } - + $serendipity['blogSubTitle'] = sprintf(ENTRIES_FOR, $date); ob_start(); include_once('serendipity_genpage.inc.php'); Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- serendipity_functions.inc.php 9 Jul 2003 17:52:00 -0000 1.102 +++ serendipity_functions.inc.php 9 Jul 2003 18:55:36 -0000 1.103 @@ -206,7 +206,7 @@ $nextYear = $year+1; } - $endts = mktime(0, 0, 0, $month + 1, 1, $year); + $endts = mktime(23, 59, 59, $month + 1, 1, $year); // Find out about diary entries $querystring = "SELECT timestamp from $serendipity[dbPrefix]entries WHERE timestamp >= $ts and timestamp <= $endts"; @@ -341,15 +341,15 @@ $year = (int)substr($range, 0, 4); $month = (int)substr($range, 4, 2); $day = (int)substr($range, 6, 2); - - $startts = mktime(0, 0, 0, $month, $day, $year); + + $startts = mktime(0, 0, 0, $month, ($day == 0 ? 1 : $day), $year); if ( $day == 0 ) { $month++; } else { $day++; } - $endts = mktime(0, 0, 0, $month, $day, $year); - + $endts = mktime(0, 0, 0, $month, ($day == 0 ? 1 : $day), $year); + $and = " WHERE timestamp >= $startts AND timestamp <= $endts "; } else { $and = ""; @@ -376,6 +376,7 @@ ORDER BY timestamp DESC $limit"; + $ret = serendipity_db_query($query); if (is_string($ret)) { die("Query failed: $ret"); @@ -1832,10 +1833,11 @@ function serendipity_postAmount($year, $month) { global $serendipity; - $s = mktime(0,0,0, $month, 1, $year); - $e = mktime(23,59,59, $month, date("t",$s) , $year); - $querystring = "SELECT count(id) FROM {$serendipity['dbPrefix']}entries WHERE timestamp>$s AND timestamp<$e"; + $s = mktime(0, 0, 0, $month, 1, $year); + $e = mktime(23, 59, 59, $month, date('t', $s), $year); + $querystring = "SELECT count(id) FROM {$serendipity['dbPrefix']}entries WHERE timestamp >= $s AND timestamp <= $e"; $query = serendipity_db_query($querystring); + return $query[0][0]; } @@ -1857,7 +1859,7 @@ // echo "<h2>$currYear</h2><div class='serendipity_entry'>"; for($x=1; $x<13; $x++) { $entries = serendipity_postAmount($currYear, $x); - if ($entries>0) { + if ($entries > 0) { $a = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear" . sprintf('%02s', $x) . '.html\'>'; $b = '</a>'; $c = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear" . sprintf('%02s', $x) . '_short.html\'>'; @@ -1867,7 +1869,7 @@ $b = $d = '</span>'; } - if ($x<=date("m") || $currYear < date('Y')) { + if ($x <= date('m') || $currYear < date('Y')) { $out[$currYear][$x] = array($entries, $a, $b, $c, $d); } |
From: <gar...@us...> - 2003-07-09 17:52:03
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv31047 Modified Files: htaccess.tpl index.php serendipity.css.php serendipity.inc.php serendipity_admin_installer.inc.php serendipity_config.inc.php serendipity_config_local.tpl serendipity_functions.inc.php serendipity_genpage.inc.php Log Message: o Added the ability to easily integrate serendipity into an existing website. For this to work, you need your existing layout and an additional wrapper file. You specify the additional wrapper file in the serendipity configuration ('indexFile') and set the 'embed' option to true. The wrapper file is then used as the 404-Document and as the DirectoryIndex file. When using the embedding parameter, the sidebars in the default layout will not get generated, nor will html- headers/footers be outputted. A simple wrapper file I use for my homepage could be like this: <?php ob_start(); require 'index.php'; $redirect_data = ob_get_contents(); ob_end_clean(); chdir ($_SERVER['DOCUMENT_ROOT']); require './inhalt.php'; ?> My mainfile (inhalt.php) then takes care of the $redirect_data variable and prints it inside my table structure. You can have a look at http://www.garvinhicking.de/serendipity/ to see a result of this. Be warned that the serendipity stylesheet is not yet modified to meet my page's style yet. To get this to work I had to modify the getTemplate-Functions to use the fully qualified path to the templates, otherwise the chdir() command in my wrapper class gets serious problems. o Corrected some indents/double quotes o Replaced the hardcoded '/templates/' reference by the $serendipity['templatePath'] variable o Cut down the no longer used serendipity.inc.php to include the valid serendipity_config.inc.php file. For backwards compatibility of existing installations it now includes the latter file and I did not move the filenames from serendipity_config.inc.php to serendipity.inc.php (as shortly discussed on the mailinglist) o Neither did nor seen any such detailed, oversized changelog entry. Guess nobody even reads it, though. ;) Index: htaccess.tpl =================================================================== RCS file: /cvsroot/php-blog/serendipity/htaccess.tpl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- htaccess.tpl 7 Jul 2003 12:25:14 -0000 1.4 +++ htaccess.tpl 9 Jul 2003 17:52:00 -0000 1.5 @@ -1,4 +1,5 @@ -ErrorDocument 404 {PREFIX}index.php +ErrorDocument 404 {PREFIX}{indexFile} +DirectoryIndex {PREFIX}{indexFile} <Files *.tpl> deny from all @@ -13,5 +14,5 @@ </Files> <Files sqlite.db> - deny from all + deny from all </Files> Index: index.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/index.php,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- index.php 8 Jul 2003 14:40:00 -0000 1.20 +++ index.php 9 Jul 2003 17:52:00 -0000 1.21 @@ -123,7 +123,7 @@ header('Content-Type: text/html; charset=ISO-8859-1'); $serendipity['GET']['action'] = 'archives'; include_once('serendipity_genpage.inc.php'); -} else if (preg_match('@/(index\.(php|html))?@', $uri)) { +} else if (preg_match('@/(index\.(php|html))?@', $uri) || preg_match('@/(' . preg_quote($serendipity['indexFile']) . ')?@')) { header('Content-Type: text/html; charset=ISO-8859-1'); if (count($serendipity['GET']) == 2) { ob_start(); @@ -141,7 +141,7 @@ $serendipity['GET']['action'] = 'read'; $serendipity['GET']['range'] = $serendipity['GET']['calendarZoom']; } - include_once("serendipity_genpage.inc.php"); + include_once('serendipity_genpage.inc.php'); } } else { printf(DOCUMENT_NOT_FOUND, $uri); Index: serendipity.css.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.css.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- serendipity.css.php 8 Jul 2003 09:13:27 -0000 1.13 +++ serendipity.css.php 9 Jul 2003 17:52:00 -0000 1.14 @@ -5,7 +5,7 @@ if (!@include_once('serendipity_config.inc.php')) { readfile('serendipity.css'); } else if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css') ) { - echo str_replace('{TEMPLATE_PATH}', $serendipity['baseURL'] . '/templates/' . serendipity_get_config_var('template', 'default'). '/', file_get_contents($serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css')); + echo str_replace('{TEMPLATE_PATH}', $serendipity['baseURL'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default'). '/', file_get_contents($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/style.css')); } else if (file_exists($serendipity['templatePath'] . 'default/style.css')) { readfile ($serendipity['templatePath'] . 'default/style.css'); } else { Index: serendipity.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serendipity.inc.php 9 Jul 2003 07:53:17 -0000 1.5 +++ serendipity.inc.php 9 Jul 2003 17:52:00 -0000 1.6 @@ -1,118 +1,7 @@ <?php # $Id$ -########################################################################## -# serendipity - another blogger... # -########################################################################## -# # -# (c) 2003 Jannis Hermanns <J...@ha...> # -# http://www.jannis.to/programming/serendipity.html # -# # -########################################################################## -define('IN_serendipity', true); -include_once('compat.php'); - -// For security reasons (serendipity relies on register_globals on) -$serendipity = array(); - -if (!file_exists('./serendipity_config_local.inc.php')) { - die ('serendipity is not yet installed! Go to the <a href="serendipity_admin.php">Installation</a>'); -} -include_once('./serendipity_config_local.inc.php'); - -// Put your emoticons here -$serendipity['smiles'] = array( ":'(" => $serendipity['serendipityHTTPPath'] . 'pixel/cry_smile.gif', - ':-)' => $serendipity['serendipityHTTPPath'] . 'pixel/regular_smile.gif', - ':-O' => $serendipity['serendipityHTTPPath'] . 'pixel/embaressed_smile.gif', - ':O' => $serendipity['serendipityHTTPPath'] . 'pixel/embaressed_smile.gif', - ':-(' => $serendipity['serendipityHTTPPath'] . 'pixel/sad_smile.gif', - ':(' => $serendipity['serendipityHTTPPath'] . 'pixel/sad_smile.gif', - ':)' => $serendipity['serendipityHTTPPath'] . 'pixel/regular_smile.gif', - '8-)' => $serendipity['serendipityHTTPPath'] . 'pixel/shades_smile.gif', - ':-D' => $serendipity['serendipityHTTPPath'] . 'pixel/teeth_smile.gif', - ':D' => $serendipity['serendipityHTTPPath'] . 'pixel/teeth_smile.gif', - '8)' => $serendipity['serendipityHTTPPath'] . 'pixel/shades_smile.gif', - ':-P' => $serendipity['serendipityHTTPPath'] . 'pixel/tounge_smile.gif', - ';-)' => $serendipity['serendipityHTTPPath'] . 'pixel/wink_smile.gif', - ';)' => $serendipity['serendipityHTTPPath'] . 'pixel/wink_smile.gif', - ':P' => $serendipity['serendipityHTTPPath'] . 'pixel/tounge_smile.gif', -); - -// You're done :) - -/************************************************************************* -* You shouldn't need to touch anything here. * -*************************************************************************/ - -// Make sure sessioning is running -if (strlen(@session_id()) < 5) { - die ('serendipity error: you _have_ to run session_start() before including serendipity_config.inc.php - exiting'); -} - -include($serendipity['serendipityPath'] . '/serendipity_functions.inc.php'); -if (serendipity_FUNCTIONS_LOADED!== true) { - die ('serendipity error: could not include serendipity_functions.inc.php - exiting'); -} - -include($serendipity['serendipityPath'] . '/serendipity_lang_' . $serendipity['lang'] . '.inc.php'); -if (serendipity_LANG_LOADED !== true) { - die ('serendipity error: could not include serendipity_lang_' . $serendipity['lang'] . '.inc.php - exiting'); -} - -// Connect to database -if (!serendipity_db_connect()) { - die ('serendipity error: unable to connect to database - exiting'); -} - -// Avoid magic_quotes_gpc issues -// courtesy of il...@ph... -function serendipity_strip_quotes(&$var) { - if (is_array($var)) { - foreach ($var as $k => $v) { - if (is_array($v)) { - array_walk($var[$k], 'serendipity_strip_quotes'); - } else { - $var[$k] = stripslashes($v); - } - } - } else { - $var = stripslashes($var); - } -} - -if (ini_get('magic_quotes_gpc')) { - if (@count($_GET)) { - array_walk($_GET, 'serendipity_strip_quotes'); - } - if (@count($_POST)) { - array_walk($_POST, 'serendipity_strip_quotes'); - } - if (@count($_COOKIES)) { - array_walk($_COOKIES, 'serendipity_strip_quotes'); - } - if (@count($_FILES)) { - array_walk($_FILES, 'serendipity_strip_quotes'); - } -} - -// Merge get and post into the serendipity array -$serendipity['GET'] = &$_GET['serendipity']; -$serendipity['POST'] = &$_POST['serendipity']; - -// We don't care who tells us what to do -if (!$serendipity['GET']['action']) { - $serendipity['GET']['action'] = $serendipity['POST']['action']; -} - -if (!$serendipity['GET']['adminAction']) { - $serendipity['GET']['adminAction'] = $serendipity['POST']['adminAction']; -} - -// Some stuff... -if (!$_SESSION['serendipityAuthedUser']) { - $_SESSION['serendipityAuthedUser'] = false; -} +// This file has been replaced by serendipity_config.inc.php. It will get deleted eventually. Soon. Maybe. +include_once 'serendipity_config.inc.php'; -$serendipity['user'] = $_SESSION['serendipityUser']; -$serendipity['email'] = $_SESSION['serendipityEmail']; /* vim: set sts=4 ts=4 expandtab : */ ?> Index: serendipity_admin_installer.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_installer.inc.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- serendipity_admin_installer.inc.php 8 Jul 2003 09:13:27 -0000 1.17 +++ serendipity_admin_installer.inc.php 9 Jul 2003 17:52:00 -0000 1.18 @@ -265,7 +265,7 @@ } else { for($x = 0; $x < count($a); $x++) { - fwrite($fp, str_replace("{PREFIX}", $_POST["serendipityHTTPPath"],$a[$x])."\n"); + fwrite($fp, str_replace(array('{PREFIX}','{indexFile}'), array($_POST['serendipityHTTPPath'], $_POST['indexFile']),$a[$x])); } fclose($fp); } Index: serendipity_config.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- serendipity_config.inc.php 9 Jul 2003 07:53:17 -0000 1.16 +++ serendipity_config.inc.php 9 Jul 2003 17:52:00 -0000 1.17 @@ -45,6 +45,11 @@ $serendipity[$row['name']] = isset($translation[$row['value']]) ? $translation[$row['value']] : $row['value']; } +// defaults for newly added configuration directives. Should be removed after first release. +if (!isset($serendipity['indexFile'])) { + $serendipity['indexFile'] = 'index.php'; +} + // Load basic language information include_once("{$serendipity['serendipityPath']}/serendipity_lang_{$serendipity['lang']}.inc.php"); if (serendipity_LANG_LOADED !== true) { Index: serendipity_config_local.tpl =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_config_local.tpl,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- serendipity_config_local.tpl 8 Jul 2003 09:13:27 -0000 1.9 +++ serendipity_config_local.tpl 9 Jul 2003 17:52:00 -0000 1.10 @@ -15,6 +15,7 @@ $serendipity['templatePath'] = '{Relative template path|templatePath|string|templates/}'; // The path to the folder containing your templates - Relative to the 'relative path' $serendipity['uploadHTTPPath'] = '{Relative upload path|uploadHTTPPath|string|uploads/}'; // Path to your uploads for browsers - Relative to the 'relative path'. $serendipity['baseURL'] = '{URL to blog|baseURL|string|http://www.example.com/serendipity/}'; // Base URL to your serendipity installation +$serendipity['indexFile'] = '{Index file|indexFile|string|index.php}'; // Which file to use as index // General settings $serendipity['user'] = '{Admin username|user|string|John Doe}'; // Username for admin login @@ -24,6 +25,7 @@ $serendipity['extCSS'] = '{External Stylesheet|extCSS|string|none}'; // You can define a stylesheet uri here, aditionally to the settings adjustable in the admin interface (enter 'none' if you don't need this) $serendipity['wysiwyg'] = '{Use WYSIWYG editor|wysiwyg|bool|0}'; // Do you want to use the WYSIWYG editor (CAUTION: only turn this on if you use Microsoft's Internet Explorer!!!)? $serendipity['XHTML11'] = '{Force XHTML 1.1 compliance|XHTML11|bool|0}'; // Do you want to force XHTML 1.1 compliance (may cause problems for back-/frontend on older 4th generation browsers) +$serendipity['embed'] = '{Is serendipity embedded?|embed|bool|0}'; // If you want to embed serendipity within a regular page, set to true to discard any headers and just print the contents. You can make use of the indexFile option to use a wrapper class where you put your normal webpage headers. $serendipity['blogTitle'] = '{Blog name|blogTitle|string|John Doe\'s personal blog}'; // The title of your blog $serendipity['blogDescription'] = '{Blog description|blogDescription|string|Welcome to my blog...}'; // Description of your blog Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -r1.101 -r1.102 --- serendipity_functions.inc.php 8 Jul 2003 13:51:19 -0000 1.101 +++ serendipity_functions.inc.php 9 Jul 2003 17:52:00 -0000 1.102 @@ -7,19 +7,19 @@ function serendipity_getTemplateFile($file) { global $serendipity; - if ( file_exists($serendipity['templatePath'] . $serendipity['CONFIG']['template'] . '/'. $file) ) { + if ( file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $serendipity['CONFIG']['template'] . '/'. $file) ) { return $serendipity['serendipityHTTPPath'] . $serendipity['templatePath'] . $serendipity['CONFIG']['template'] . '/' . $file; } - if ( file_exists($serendipity['templatePath'] . 'default/'. $file) ) { + if ( file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . 'default/'. $file) ) { return $serendipity['serendipityHTTPPath'] . $serendipity['templatePath'] . 'default/' . $file; } } function serendipity_fetchTemplates() { global $serendipity; - $dir = opendir($serendipity['templatePath']); + $dir = opendir($serendipity['serendipityPath'] . $serendipity['templatePath']); while ( ($file = readdir($dir)) !== false ) { - if ( is_dir($serendipity['templatePath'] . $file) && !ereg('^(\.|CVS)', $file) ) { + if ( is_dir($serendipity['serendipityPath'] . $serendipity['templatePath'] . $file) && !ereg('^(\.|CVS)', $file) ) { $rv[] = $file; } } @@ -29,7 +29,7 @@ function serendipity_fetchTemplateInfo($theme) { global $serendipity; /* Blame jannis */ - $lines = file($serendipity['templatePath'] . $theme . '/info.txt'); + $lines = file($serendipity['serendipityPath'] . $serendipity['templatePath'] . $theme . '/info.txt'); for($x=0; $x<count($lines); $x++) { $j = preg_split('/([^\:]+)\:/', $lines[$x], -1, PREG_SPLIT_DELIM_CAPTURE); @@ -61,7 +61,7 @@ <?php foreach ($themelist as $theme) { $info = serendipity_fetchTemplateInfo($theme); - if ( file_exists($serendipity['templatePath'] . $theme . '/preview.png') ) { + if ( file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . $theme . '/preview.png') ) { $preview = '<img src="templates/' . $theme . '/preview.png" width="100" style="border: 1px #000000 solid" />'; } else { $preview = ' '; @@ -228,14 +228,14 @@ <table width="100%" class='serendipity_calendar' cellspacing="1"> <tr> <td align="left" class="serendipity_calendarHeader"> - <a title="<?php echo BACK; ?>" href="<?php echo $serendipity['serendipityHTTPPath']; ?>index.php?serendipity[calendarZoom]=<?php echo $previousYear . sprintf('%02d',$previousMonth); ?>"><img alt="<?php echo BACK; ?>" src="<?php echo serendipity_getTemplateFile('img/back.png'); ?>" border="0" /></a></td> + <a title="<?php echo BACK; ?>" href="<?php echo $serendipity['serendipityHTTPPath'] . $serendipity['indexFile']; ?>?serendipity[calendarZoom]=<?php echo $previousYear . sprintf('%02d',$previousMonth); ?>"><img alt="<?php echo BACK; ?>" src="<?php echo serendipity_getTemplateFile('img/back.png'); ?>" border="0" /></a></td> <td colspan="5" align="center" valign="bottom" class="serendipity_calendarHeader"> <b><nobr><a href="<?php echo $link; ?>"><?php echo $serendipity["months"][$month] . ' \'' . substr($year, 2); ?></a></nobr></b> </td> <td align="right" class="serendipity_calendarHeader"> - <a title="<?php echo FORWARD; ?>"href="<?php echo $serendipity['serendipityHTTPPath']; ?>index.php?serendipity[calendarZoom]=<?php echo $nextYear . sprintf('%02d', $nextMonth); ?>"><img alt="<?php echo FORWARD; ?>" src="<?php echo serendipity_getTemplateFile('img/forward.png'); ?>" border="0" /></a></td> + <a title="<?php echo FORWARD; ?>" href="<?php echo $serendipity['serendipityHTTPPath'] . $serendipity['indexFile']; ?>?serendipity[calendarZoom]=<?php echo $nextYear . sprintf('%02d', $nextMonth); ?>"><img alt="<?php echo FORWARD; ?>" src="<?php echo serendipity_getTemplateFile('img/forward.png'); ?>" border="0" /></a></td> </tr> <tr> Index: serendipity_genpage.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_genpage.inc.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- serendipity_genpage.inc.php 8 Jul 2003 12:14:17 -0000 1.12 +++ serendipity_genpage.inc.php 9 Jul 2003 17:52:00 -0000 1.13 @@ -1,4 +1,7 @@ -<?php # $Id$ ?> +<?php # $Id$ +if (!$serendipity['embed']) { + // serendipity is embedded into an existing structure. No need to output headers then. +?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> @@ -8,28 +11,33 @@ <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $serendipity['baseURL']; ?>feeds/index.rss" /> <script language="Javascript" type="text/javascript" src="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.js"></script> <?php - if (strtolower($serendipity['extCSS'])!='none') { + if (strtolower($serendipity['extCSS'])!='none') { ?> <style type="text/css">@import <?php echo $serendipity['extCSS']; ?>";</style> <?php - } + } ?> </head> <body> <?php +} // end if (is serendipity embedded?) + include_once('serendipity_config.inc.php'); include_once('serendipity_plugin_api.php'); include_once('serendipity_sidebar_items.php'); if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/layout.php')) { - include $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/layout.php'; + include $serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/layout.php'; } else { - include $serendipity['templatePath'] . 'default/layout.php'; + include $serendipity['serendipityPath'] . $serendipity['templatePath'] . 'default/layout.php'; } + +if (!$serendipity['embed']) { ?> </body> </html> <?php +} /* vim: set sts=4 ts=4 expandtab : */ ?> |
From: <gar...@us...> - 2003-07-09 07:53:20
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv16580 Modified Files: serendipity.inc.php serendipity_config.inc.php Log Message: Removed temporary smiley-outsircing in a file in favor of a latter removal of serendipity.inc.php. Index: serendipity.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serendipity.inc.php 8 Jul 2003 09:13:27 -0000 1.4 +++ serendipity.inc.php 9 Jul 2003 07:53:17 -0000 1.5 @@ -20,7 +20,23 @@ include_once('./serendipity_config_local.inc.php'); // Put your emoticons here -include_once('./serendipity_smiles.inc.php'); +$serendipity['smiles'] = array( ":'(" => $serendipity['serendipityHTTPPath'] . 'pixel/cry_smile.gif', + ':-)' => $serendipity['serendipityHTTPPath'] . 'pixel/regular_smile.gif', + ':-O' => $serendipity['serendipityHTTPPath'] . 'pixel/embaressed_smile.gif', + ':O' => $serendipity['serendipityHTTPPath'] . 'pixel/embaressed_smile.gif', + ':-(' => $serendipity['serendipityHTTPPath'] . 'pixel/sad_smile.gif', + ':(' => $serendipity['serendipityHTTPPath'] . 'pixel/sad_smile.gif', + ':)' => $serendipity['serendipityHTTPPath'] . 'pixel/regular_smile.gif', + '8-)' => $serendipity['serendipityHTTPPath'] . 'pixel/shades_smile.gif', + ':-D' => $serendipity['serendipityHTTPPath'] . 'pixel/teeth_smile.gif', + ':D' => $serendipity['serendipityHTTPPath'] . 'pixel/teeth_smile.gif', + '8)' => $serendipity['serendipityHTTPPath'] . 'pixel/shades_smile.gif', + ':-P' => $serendipity['serendipityHTTPPath'] . 'pixel/tounge_smile.gif', + ';-)' => $serendipity['serendipityHTTPPath'] . 'pixel/wink_smile.gif', + ';)' => $serendipity['serendipityHTTPPath'] . 'pixel/wink_smile.gif', + ':P' => $serendipity['serendipityHTTPPath'] . 'pixel/tounge_smile.gif', +); + // You're done :) /************************************************************************* Index: serendipity_config.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- serendipity_config.inc.php 8 Jul 2003 09:13:27 -0000 1.15 +++ serendipity_config.inc.php 9 Jul 2003 07:53:17 -0000 1.16 @@ -52,8 +52,6 @@ } // A Set of emoticons to rewrite -include_once('./serendipity_smiles.inc.php'); - $serendipity['smiles'] = array( ":'(" => $serendipity['serendipityHTTPPath'] . 'pixel/cry_smile.gif', ':-)' => $serendipity['serendipityHTTPPath'] . 'pixel/regular_smile.gif', ':-O' => $serendipity['serendipityHTTPPath'] . 'pixel/embaressed_smile.gif', @@ -69,7 +67,7 @@ ';-)' => $serendipity['serendipityHTTPPath'] . 'pixel/wink_smile.gif', ';)' => $serendipity['serendipityHTTPPath'] . 'pixel/wink_smile.gif', ':P' => $serendipity['serendipityHTTPPath'] . 'pixel/tounge_smile.gif', - ); +); // Avoid magic_quotes_gpc issues |
From: <gar...@us...> - 2003-07-08 14:40:03
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv20432 Modified Files: comment.php index.php serendipity_lang_de.inc.php serendipity_lang_en.inc.php Log Message: XHTML (lowercase attributes) More language replacements. Indenting/spacing. Index: comment.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/comment.php,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- comment.php 8 Jul 2003 13:51:19 -0000 1.15 +++ comment.php 8 Jul 2003 14:40:00 -0000 1.16 @@ -108,14 +108,14 @@ '<a href="' . $_SERVER['PHP_SELF'] . '?serendipity[entry_id]=' . $serendipity['POST']['entry_id'] . '">', '</a>', - '<a href="#" onClick="self.close()">', + '<a href="#" onclick="self.close()">', '</a>' ); } else { printf( EMPTY_COMMENT, - '<a href="#" onClick="history.go(-1)">', + '<a href="#" onclick="history.go(-1)">', '</a>' ); } Index: index.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/index.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- index.php 8 Jul 2003 09:13:27 -0000 1.19 +++ index.php 8 Jul 2003 14:40:00 -0000 1.20 @@ -11,7 +11,7 @@ header('Content-Type: text/html; charset=ISO-8859-1'); $range = $matches[1]; $_GET['serendipity']['action'] = 'read'; - $_GET['serendipity']['range'] = $range; + $_GET['serendipity']['range'] = $range; if (strlen($range) == 6) { @@ -20,7 +20,7 @@ $date = date('d/m/Y', strtotime($range)); } - $serendipity['blogSubTitle'] = "Entries for $date"; + $serendipity['blogSubTitle'] = sprintf(ENTRIES_FOR, $date); ob_start(); include_once('serendipity_genpage.inc.php'); $data = ob_get_contents(); @@ -37,8 +37,8 @@ header('Content-Type: text/html; charset=ISO-8859-1'); $range = $matches[1]; $_GET['serendipity']['action'] = 'read'; - $_GET['serendipity']['range'] = $range; - $_GET['serendipity']['short'] = true; + $_GET['serendipity']['range'] = $range; + $_GET['serendipity']['short'] = true; if (strlen($range) == 6) { $date = date('m/Y', mktime(0,0,0, substr($range, 4, 6), 2, substr($range, 0, 4))); @@ -46,7 +46,7 @@ $date = date('d/m/Y', strtotime($range)); } - $serendipity['blogSubTitle'] = "Topics for $date"; + $serendipity['blogSubTitle'] = sprintf(ENTRIES_FOR, $date); ob_start(); include_once('serendipity_genpage.inc.php'); $data = ob_get_contents(); @@ -67,7 +67,7 @@ $track_referer = false; $_GET['serendipity']['action'] = 'read'; - $_GET['serendipity']['id'] = $id; + $_GET['serendipity']['id'] = $id; $title = serendipity_db_query("SELECT title FROM {$serendipity['dbPrefix']}entries " . 'WHERE id=' . serendipity_db_escape_string($id), true); @@ -144,9 +144,7 @@ include_once("serendipity_genpage.inc.php"); } } else { -?> -The document, <?php echo $uri; ?> was not found. -<?php + printf(DOCUMENT_NOT_FOUND, $uri); } if ($track_referer) { Index: serendipity_lang_de.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_de.inc.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- serendipity_lang_de.inc.php 8 Jul 2003 13:51:19 -0000 1.14 +++ serendipity_lang_de.inc.php 8 Jul 2003 14:40:00 -0000 1.15 @@ -170,6 +170,9 @@ define('DIRECT_LINK', 'Direkter Link zu diesem Eintrag'); define('COMMENT_ADDED', 'Dein Kommentar wurde hinzugefügt. Klick %shier um zu den Kommentaren zurückzukehren%s und %shier um das Fenster zu schließen%s.'); define('EMPTY_COMMENT', 'Dein Kommentar enthielt nichts, bitte %sgeh zurück%s und versuch\'s nochmal'); +define('ENTRIES_FOR', 'Einträge am %s'); +define('TOPICS_FOR', 'Themen am %s'); +define('DOCUMENT_NOT_FOUND', 'Das Dokument %s wurde nicht gefunden.'); define('serendipity_LANG_LOADED', true); /* vim: set sts=4 ts=4 expandtab : */ Index: serendipity_lang_en.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_en.inc.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- serendipity_lang_en.inc.php 8 Jul 2003 13:51:19 -0000 1.18 +++ serendipity_lang_en.inc.php 8 Jul 2003 14:40:00 -0000 1.19 @@ -170,6 +170,9 @@ define('DIRECT_LINK', 'Direct link to this entry'); define('COMMENT_ADDED', 'Your comment was successfully added. Click %shere to return%s to the comments, and %shere to close%s this window.'); define('EMPTY_COMMENT', 'Your comment did not contain anything, please %sgo back%s and try again'); +define('ENTRIES_FOR', 'Entries for %s'); +define('TOPICS_FOR', 'Topics for %s'); +define('DOCUMENT_NOT_FOUND', 'The document %s was not found.'); define('serendipity_LANG_LOADED', true); /* vim: set sts=4 ts=4 expandtab : */ |
From: <gar...@us...> - 2003-07-08 13:51:22
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv10839 Modified Files: comment.php serendipity_admin_image_selector.php serendipity_editor.js serendipity_functions.inc.php serendipity_lang_de.inc.php serendipity_lang_en.inc.php Added Files: serendipity_define.js.php Log Message: o Added a new file serendipity_define.js.php which can be pre-included to a javascript to set some variables. In my case I'm using it to loop the XHTML11 compliance variable to be used within the serendipity_editor.js file o Made comment.php XHTML 1.1 (optionally) compliant. o Made some more XHTML conformance entries (no 'name' attribute for forms, but 'id'. No 'target' attribute to any <a> tag. Made a serendipity_xhtml_traget() function to select which attribute to use) o Added some missing language entries. --- NEW FILE: serendipity_define.js.php --- <?php # $Id: serendipity_define.js.php,v 1.1 2003/07/08 13:51:19 garvinhicking Exp $ header('Content-type: application/x-javascript'); include_once('serendipity_config.inc.php'); ?> <!-- // Hide from older browsers // This page serves to carry through any variables without having to parse a complete .js file as .php var XHTML11 = <?php echo ($serendipity['XHTML11'] ? 'true' : 'false'); ?>; // --> <?php /* vim: set sts=4 ts=4 expandtab : */ ?> Index: comment.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/comment.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- comment.php 8 Jul 2003 09:13:27 -0000 1.14 +++ comment.php 8 Jul 2003 13:51:19 -0000 1.15 @@ -46,10 +46,18 @@ } } else { $id = $serendipity['GET']['entry_id']; + + if ($serendipity['XHTML11']) { + echo '<?xml version="1.0" encoding="iso-8859-1" ?>' . "\n"; ?> -<html> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" + "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<?php + } +?> +<html<?php echo ($serendipity['XHTML11'] ? ' xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" dir="ltr"' : ''); ?>> <head> - <title>Comments</title> + <title><?php echo COMMENTS; ?></title> <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php?mode=comments" /> </head> <body> @@ -66,12 +74,12 @@ . '_' . serendipity_makeFilename($entry[0]['title']) . '.html'; ?> <div id="serendipity_bodyLevel"> - <div class="serendipity_commentsTitle">Trackbacks</div><br /> + <div class="serendipity_commentsTitle"><?php echo TRACKBACKS; ?></div><br /> <dl> - <dt><b>Trackback specific URI for this entry:</b><br /></dt> + <dt><b><?php echo TRACKBACK_SPECIFIC; ?>:</b><br /></dt> <dd><a href="<?php echo $tbu; ?>"><?php echo $tbu; ?></a><br /></dd> - <dt><b>Direct link to this entry:</b><br /></dt> + <dt><b><?php echo DIRECT_LINK; ?>:</b><br /></dt> <dd><a href="<?php echo $entry; ?>"><?php echo $entry; ?></a> <?php serendipity_printTrackbacks(serendipity_fetchTrackbacks($id)); ?> </dd> @@ -79,12 +87,12 @@ <?php } else { ?> - <div class="serendipity_commentsTitle">Comments</div> + <div class="serendipity_commentsTitle"><?php echo COMMENTS; ?></div> <?php serendipity_printComments(serendipity_fetchComments($id)); ?> - <div class="serendipity_commentsTitle">Add A Comment</div> + <div class="serendipity_commentsTitle"><?php echo ADD_COMMENT; ?></div> <?php serendipity_displayCommentForm($id); } @@ -95,15 +103,21 @@ $comment['email'] = $serendipity['POST']['email']; if ( !empty($comment['comment']) ) { serendipity_saveComment($serendipity['POST']['entry_id'], $comment, 'NORMAL'); -?> - Your comment was successfully added. - Click <a href="<?php echo $_SERVER['PHP_SELF']; ?>?serendipity[entry_id]=<?php echo $serendipity['POST']['entry_id']; ?>">here to return</a> to - the comments, and <a href="#" onClick="self.close()">here to close</a> this window. -<?php + printf( + COMMENT_ADDED, + + '<a href="' . $_SERVER['PHP_SELF'] . '?serendipity[entry_id]=' . $serendipity['POST']['entry_id'] . '">', + '</a>', + '<a href="#" onClick="self.close()">', + '</a>' + ); } else { -?> - Your comment did not contain anything, please <a href="#" onClick="history.go(-1)">go back</a> and try again -<?php + printf( + EMPTY_COMMENT, + + '<a href="#" onClick="history.go(-1)">', + '</a>' + ); } } ?> Index: serendipity_admin_image_selector.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_image_selector.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- serendipity_admin_image_selector.php 8 Jul 2003 09:13:27 -0000 1.7 +++ serendipity_admin_image_selector.php 8 Jul 2003 13:51:19 -0000 1.8 @@ -66,7 +66,8 @@ case "1": ?> - <script src="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity_editor.js" language="Javascript" ></script> + <script type="text/javascript" language="JavaScript" src="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity_define.js.php"></script> + <script type="text/javascript" language="Javascript" src="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity_editor.js"></script> <?php $f = serendipity_parseFileName($serendipity["GET"]["image"]); echo "<img align='right' src='".$serendipity["serendipityHTTPPath"] . $serendipity["uploadPath"].$f[0].".".$serendipity["thumbSuffix"].".".$f[1]."'>"; Index: serendipity_editor.js =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_editor.js,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serendipity_editor.js 8 Jul 2003 12:58:26 -0000 1.5 +++ serendipity_editor.js 8 Jul 2003 13:51:19 -0000 1.6 @@ -141,14 +141,23 @@ img = f['imgName'].value; } - if (f['serendipity[align]'][0].checked == true) { - img = "<img border='0' hspace='5' src='" + img + "' alt='' />\n"; - } else if (f['serendipity[align]'][1].checked == true) { - img = "<img border='0' hspace='5' align='left' src='" + img + "' alt='' />"; - } else if (f['serendipity[align]'][2].checked == true) { - img = "<img border='0' hspace='5' align='right' src='" + img + "' alt='' />"; + if (XHTML11) { + if (f['serendipity[align]'][0].checked == true) { + img = "<img style='border: 0px; padding-left: 5px; padding-right: 5px;' src='" + img + "' alt='' />\n"; + } else if (f['serendipity[align]'][1].checked == true) { + img = "<img style='border: 0px; padding-left: 5px; padding-right: 5px; float: left; vertical-align: top' src='" + img + "' alt='' />"; + } else if (f['serendipity[align]'][2].checked == true) { + img = "<img style='border: 0px; padding-left: 5px; padding-right: 5px; float: right; vertical-align: top' src='" + img + "' alt='' />"; + } + } else { + if (f['serendipity[align]'][0].checked == true) { + img = "<img border='0' hspace='5' src='" + img + "' alt='' />\n"; + } else if (f['serendipity[align]'][1].checked == true) { + img = "<img border='0' hspace='5' align='left' src='" + img + "' alt='' />"; + } else if (f['serendipity[align]'][2].checked == true) { + img = "<img border='0' hspace='5' align='right' src='" + img + "' alt='' />"; + } } - if (f['serendipity[isLink]'][1].checked == true) { insert = "<a href='" + f['serendipity[url]'].value + "'>" + img + "</a>"; Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- serendipity_functions.inc.php 8 Jul 2003 12:05:21 -0000 1.100 +++ serendipity_functions.inc.php 8 Jul 2003 13:51:19 -0000 1.101 @@ -107,8 +107,8 @@ global $serendipity; ?> <div class="serendipityCommentForm"> - <form name="serendipity_comment" action="<?php echo $serendipity['serendipityHTTPPath']; ?>comment.php" method="post" onsubmit="if (this.serendipity_remember.checked) rememberMe(this, '<?php echo $_SERVER['HTTP_HOST']; ?>')"> - <input type="hidden" name="serendipity[entry_id]" value="<?php echo $id; ?>" /> + <form <?php echo ($serendipity['XHTML11'] ? 'id' : 'name'); ?>="serendipity_comment" action="<?php echo $serendipity['serendipityHTTPPath']; ?>comment.php" method="post" onsubmit="if (this.serendipity_remember.checked) rememberMe(this, '<?php echo $_SERVER['HTTP_HOST']; ?>')"> + <div><input type="hidden" name="serendipity[entry_id]" value="<?php echo $id; ?>" /></div> <table border="0" width="100%" cellpadding="3"> <tr> @@ -132,12 +132,12 @@ </tr> </table> - <?php echo REMEMBER_INFO; ?> - - <input type="checkbox" name="serendipity[remember]" <?php echo $serendipity['COOKIE']['remember'] ; ?> /><br /> - <input type="submit" value="<?php echo SUBMIT_COMMENT; ?>" /> + <div> + <span class="serendipity_comment_source" style="vertical-align: middle"><?php echo REMEMBER_INFO; ?></span> + <input type="checkbox" name="serendipity[remember]" <?php echo $serendipity['COOKIE']['remember'] ; ?> /><br /> + <input type="submit" value="<?php echo SUBMIT_COMMENT; ?>" /> + </div> </form> -</div> <?php } @@ -493,7 +493,7 @@ $html_extended = ''; if ($extended && strlen($entry['extended'])) { - $html_extended = '<a name="#extended"></a>'; + $html_extended = '<a ' . ($serendipity['XHTML11'] ? 'id' : 'name') . '="#extended"></a>'; $html_extended .= nl2br(serendipity_emoticate(serendipity_markup_text($entry['extended'], $entry['id']))); } @@ -652,7 +652,7 @@ ?> <tr> <td class="serendipity_comment"> - <a name="c<?php echo $comment['id']; ?>"></a> + <a <?php echo ($serendipity['XHTML11'] ? 'id' : 'name'); ?>="c<?php echo $comment['id']; ?>"></a> <?php echo nl2br(serendipity_markup_text(serendipity_emoticate($body))); ?><br /> <div class="serendipity_comment_source"> @@ -660,14 +660,14 @@ <?php /* Link to the user's email */ if ( !empty($comment['email']) ) { - echo '<a href="mailto:' . htmlentities($comment['email']) . '" title="' . SEND_MAIL_TO . '" ' . htmlentities($name) . '(' . $comment['email'] . ')">' . htmlentities($name) . '</a>'; + echo '<a href="mailto:' . htmlentities($comment['email']) . '" title="' . SEND_MAIL_TO . ' ' . htmlentities($name) . '(' . $comment['email'] . ')">' . htmlentities($name) . '</a>'; } else { echo htmlentities($name); } /* Link to the user's website, if the URL is valid */ if ( $comment['type'] != 'trackback' && !empty($comment['url']) && $comment['url'] != 'http://' && eregi('^http://', $comment['url']) ) { - echo ' (<a href="' . str_replace('"', '"', $comment['url']) . '" target="_blank" title="' . htmlentities($comment['url']) . '">Link</a>)'; + echo ' (<a href="' . str_replace('"', '"', $comment['url']) . '" ' . serendipity_xhtml_target('_blank') . ' title="' . htmlentities($comment['url']) . '">Link</a>)'; } /* Show when the entry was made */ @@ -712,7 +712,7 @@ ?> <tr> <td class="serendipity_comment"> - <a href="<?php echo strip_tags($link); ?>" target="_blank"><?php echo $title; ?></a><br /> + <a href="<?php echo strip_tags($link); ?>" <?php echo serendipity_xhtml_target('_blank'); ?>><?php echo $title; ?></a><br /> <b><?php echo EXCERPT; ?>: </b> <?php echo htmlentities(strip_tags($comment['body'])); ?><br /> <div class="serendipity_comment_source"> @@ -1531,7 +1531,7 @@ $hidden .= ' <input type="hidden" name="serendipity[timestamp]" value="' . $entry['timestamp'] . '" />' . $n; ?> <span style="color: #FF0000;"><?php echo $errMsg; ?></span> - <form action="<?php echo $targetURL; ?>" method="post" name="serendipityEntry" style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px"> + <form action="<?php echo $targetURL; ?>" method="post" <?php echo ($serendipity['XHTML11'] ? 'id' : 'name'); ?>="serendipityEntry" style="margin-top: 0px; margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px"> <?php echo $hidden; ?> <table class="serendipityEntryEdit"> @@ -1611,6 +1611,7 @@ serendipity_emit_htmlarea_code('document.forms[\'serendipityEntry\'][\'serendipity[body]\']'); serendipity_emit_htmlarea_code('document.forms[\'serendipityEntry\'][\'serendipity[extended]\']'); } else { + echo ' <script type="text/javascript" language="JavaScript" src="serendipity_define.js.php"></script>'; echo ' <script type="text/javascript" language="JavaScript" src="serendipity_editor.js"></script>'; } } @@ -1915,6 +1916,17 @@ ?> </table> <?php +} + +function serendipity_xhtml_target($target) +{ + global $serendipity; + + if ($serendipity['XHTML11']) { + return ' onclick="window.open(this.href, \'target' . time() . '\'); return false;" '; + } else { + return ' target="' . $target . '" '; + } } define("serendipity_FUNCTIONS_LOADED", true); Index: serendipity_lang_de.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_de.inc.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- serendipity_lang_de.inc.php 8 Jul 2003 09:13:27 -0000 1.13 +++ serendipity_lang_de.inc.php 8 Jul 2003 13:51:19 -0000 1.14 @@ -75,6 +75,7 @@ define('MANAGE_IMAGES', 'Bilder verwalten'); define('ADMIN_INTERFACE', 'Verwaltungsoberfläche'); define('SERENDIPITY_AUTHORING_SUITE', 'Serendipity Autorenoberfläche'); +define('AUTHOR_SUITE', 'Serendipity Autorenoberfläche'); define('NAME', 'Name'); define('EMAIL', 'Email'); define('HOMEPAGE', 'Homepage'); @@ -158,13 +159,17 @@ define('EXCERPT', 'Auszug'); define('TRACKED', 'Aufgenommen'); define('LINK_TO_ENTRY', 'Link zum Eintrag'); -define('LINK_TO_REMOTE_ENTRY', 'Link to remote-entry'); +define('LINK_TO_REMOTE_ENTRY', 'Link zum Remote-Eintrag'); define('IP_ADDRESS', 'IP-Adresse'); define('USER', 'Benutzer'); define('THUMBNAIL_USING_OWN', 'Using %s as it\'s own thumbnail because it is so small already.'); define('THUMBNAIL_FAILED_COPY', 'Wanted to use %s as it\'s own thumbnail, but failed to copy!'); define('AUTHOR', 'Author'); define('LAST_UPDATED', 'Zuletzt aktualisiert'); +define('TRACKBACK_SPECIFIC', 'Trackback für spezifische URI dieses Eintrags'); +define('DIRECT_LINK', 'Direkter Link zu diesem Eintrag'); +define('COMMENT_ADDED', 'Dein Kommentar wurde hinzugefügt. Klick %shier um zu den Kommentaren zurückzukehren%s und %shier um das Fenster zu schließen%s.'); +define('EMPTY_COMMENT', 'Dein Kommentar enthielt nichts, bitte %sgeh zurück%s und versuch\'s nochmal'); define('serendipity_LANG_LOADED', true); /* vim: set sts=4 ts=4 expandtab : */ Index: serendipity_lang_en.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_en.inc.php,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- serendipity_lang_en.inc.php 8 Jul 2003 09:13:27 -0000 1.17 +++ serendipity_lang_en.inc.php 8 Jul 2003 13:51:19 -0000 1.18 @@ -159,13 +159,17 @@ define('EXCERPT', 'Excerpt'); define('TRACKED', 'Tracked'); define('LINK_TO_ENTRY', 'Link to entry'); -define('LINK_TO_REMOTE_ENTRY', 'Link zum Remote-Eintrag'); +define('LINK_TO_REMOTE_ENTRY', 'Link to remote-entry'); define('IP_ADDRESS', 'IP-address'); define('USER', 'User'); define('THUMBNAIL_USING_OWN', 'Using %s as it\'s own thumbnail because it is so small already.'); define('THUMBNAIL_FAILED_COPY', 'Wanted to use %s as it\'s own thumbnail, but failed to copy!'); define('AUTHOR', 'Author'); define('LAST_UPDATED', 'Last Updated'); +define('TRACKBACK_SPECIFIC', 'Trackback specific URI for this entry'); +define('DIRECT_LINK', 'Direct link to this entry'); +define('COMMENT_ADDED', 'Your comment was successfully added. Click %shere to return%s to the comments, and %shere to close%s this window.'); +define('EMPTY_COMMENT', 'Your comment did not contain anything, please %sgo back%s and try again'); define('serendipity_LANG_LOADED', true); /* vim: set sts=4 ts=4 expandtab : */ |
From: <gar...@us...> - 2003-07-08 12:58:28
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv2728 Modified Files: serendipity_editor.js Log Message: alt tag with '' instead of "" Index: serendipity_editor.js =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_editor.js,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serendipity_editor.js 8 Jul 2003 12:10:09 -0000 1.4 +++ serendipity_editor.js 8 Jul 2003 12:58:26 -0000 1.5 @@ -142,11 +142,11 @@ } if (f['serendipity[align]'][0].checked == true) { - img = "<img border='0' hspace='5' src='" + img + "' alt="" />\n"; + img = "<img border='0' hspace='5' src='" + img + "' alt='' />\n"; } else if (f['serendipity[align]'][1].checked == true) { - img = "<img border='0' hspace='5' align='left' src='" + img + "' alt="" />"; + img = "<img border='0' hspace='5' align='left' src='" + img + "' alt='' />"; } else if (f['serendipity[align]'][2].checked == true) { - img = "<img border='0' hspace='5' align='right' src='" + img + "' alt="" />"; + img = "<img border='0' hspace='5' align='right' src='" + img + "' alt='' />"; } |
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv26830 Modified Files: serendipity_entries.php serendipity_entries_overview.inc.php serendipity_genpage.inc.php serendipity_plugin_api.php Log Message: Code style Index: serendipity_entries.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_entries.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- serendipity_entries.php 8 Jul 2003 09:13:27 -0000 1.12 +++ serendipity_entries.php 8 Jul 2003 12:14:17 -0000 1.13 @@ -1,126 +1,139 @@ <?php # $Id$ session_start(); -if (file_exists("./serendipity_config_local.inc.php")) { - include("serendipity_config.inc.php"); +if (file_exists('./serendipity_config_local.inc.php')) { + include('serendipity_config.inc.php'); } else { $_SESSION['serendipityAuthedUser'] = true; } + // User logs in? -if($_SESSION['serendipityAuthedUser'] || serendipity_authenticate_author($serendipity["POST"]["user"], $serendipity["POST"]["pass"])) { - $_SESSION["serendipityAuthedUser"] = true; - $serendipity["authorid"] = $_SESSION["serendipityAuthorid"]; +if ($_SESSION['serendipityAuthedUser'] + || serendipity_authenticate_author($serendipity['POST']['user'], $serendipity['POST']['pass'])) { + $_SESSION['serendipityAuthedUser'] = true; + $serendipity['authorid'] = $_SESSION['serendipityAuthorid']; } ?> <html> - <head> - <title>Serendipity Authoring Suite</title> - <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php"> +<head> + <title><?php echo SERENDIPITY_AUTHORING_SUITE; ?></title> + <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php" /> <?php - if (strtolower($serendipity['extCSS'])!='none') echo "<link rel='stylesheet' type='text/css' href='{$serendipity['extCSS']}'>"; +if (strtolower($serendipity['extCSS']) != 'none' && $serendipity['extCSS'] != '') { +?> + <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['extCSS']; ?>" /> +<?php +} ?> - </head> - <body> -<div id="serendipity_banner"> - <h1><?php echo $serendipity['blogTitle'] ; ?></h1> +</head> + +<body> + <div id="serendipity_banner"> + <h1><?php echo $serendipity['blogTitle'] ; ?></h1> <?php - $sub = isset($serendipity['blogSubTitle']) ? $serendipity['blogSubTitle'] : $serendipity['blogDescription']; - if (strlen($sub)) { +$sub = isset($serendipity['blogSubTitle']) ? $serendipity['blogSubTitle'] : $serendipity['blogDescription']; +if (strlen($sub)) { ?> - <h2><?php echo $sub ; ?></h2> + <h2><?php echo $sub ; ?></h2> <?php - } +} ?> -</div> - <table id="mainpane"> - <tr id="content" valign="top"> + + </div> + + <table id="mainpane"> + <tr id="content" valign="top"> <?php - // User has to log in - if ($_SESSION["serendipityAuthedUser"] !== true - && file_exists($serendipity["serendipityPath"]."serendipity_config_local.inc.php")) { +// User has to log in +if ($_SESSION['serendipityAuthedUser'] !== true + && file_exists($serendipity['serendipityPath'] . 'serendipity_config_local.inc.php')) { ?> - <td class="serendipity_admin"> - <div class='serendipity_auth_required'> - <?php echo HAVE_TO_BE_LOGGED_ON; ?> - <form action="?" method="post"> - <input type="hidden" name="serendipity[action]" value="admin"> - <input type="text" value="username" name="serendipity[user]" onfocus="value='';"> - <input type="password" value="password" name="serendipity[pass]" onfocus="value='';"> - <input type="submit" value=">"> - </form> - </div> + <td class="serendipity_admin"> + <div class='serendipity_auth_required'> + <?php echo HAVE_TO_BE_LOGGED_ON; ?> + <form action="?" method="post"> + <input type="hidden" name="serendipity[action]" value="admin" /> + <input type="text" name="serendipity[user]" value="username" onfocus="value='';" /> + <input type="password" name="serendipity[pass]" value="password" onfocus="value='';" /> + <input type="submit" name="submit" value=">"> + </form> + </div> <?php - } else { - // User is logged in +} else { + // User is logged in ?> - <td class="serendipitySideBar"> + <td class="serendipitySideBar"> + <div class="serendipitySideBarItem"> + <div class="serendipitySideBarTitle"><?php echo ENTRIES; ?></div> + <div class="serendipitySideBarContent"> + • <a href="?serendipity[adminModule]=entries&serendipity[adminAction]=new"><?php echo NEW_ENTRY; ?></a><br /> + • <a href="?serendipity[adminModule]=entries&serendipity[adminAction]=editSelect"><?php echo EDIT_ENTRIES; ?></a><br /> + • <a href="?serendipity[adminModule]=entries&serendipity[adminAction]=deleteSelect"><?php echo DELETE_ENTRIES; ?></a><br /> + </div> + </div> - <div class="serendipitySideBarItem"> - <div class="serendipitySideBarTitle"><?php echo ENTRIES; ?></div> - <div class="serendipitySideBarContent"> - • <a href='?serendipity[adminModule]=entries&serendipity[adminAction]=new'><?php echo NEW_ENTRY; ?></a><br> - • <a href='?serendipity[adminModule]=entries&serendipity[adminAction]=editSelect'><?php echo EDIT_ENTRIES; ?></a><br> - • <a href='?serendipity[adminModule]=entries&serendipity[adminAction]=deleteSelect'><?php echo DELETE_ENTRIES; ?></a><br> - </div> - </div> + <div class="serendipitySideBarItem"> + <div class="serendipitySideBarTitle"><?php echo CATEGORIES; ?></div> + <div class="serendipitySideBarContent"> + • <a href="?serendipity[adminModule]=category&serendipity[adminAction]=editSelect"><?php echo EDIT_CATEGORIES; ?></a><br /> + </div> + </div> - <div class="serendipitySideBarItem"> - <div class="serendipitySideBarTitle"><?php echo CATEGORIES; ?></div> - <div class="serendipitySideBarContent"> - • <a href='?serendipity[adminModule]=category&serendipity[adminAction]=editSelect'><?php echo EDIT_CATEGORIES; ?></a><br> - </div> - </div> + <div class="serendipitySideBarItem"> + <div class="serendipitySideBarTitle"><?php echo IMAGES; ?></div> + <div class="serendipitySideBarContent"> + • <a href="?serendipity[adminModule]=images&serendipity[adminAction]=addSelect"><?php echo ADD_IMAGES; ?></a><br /> + • <a href="?serendipity[adminModule]=images"><?php echo MANAGE_IMAGES; ?></a><br /> + • <a href="?serendipity[adminModule]=images&serendipity[adminAction]=genThumbs" onClick="return confirm('<?php echo WARNING_THIS_BLAHBLAH; ?>');"><?php echo CREATE_THUMBS; ?></a><br /> + </div> + </div> - <div class="serendipitySideBarItem"> - <div class="serendipitySideBarTitle"><?php echo IMAGES; ?></div> - <div class="serendipitySideBarContent"> - • <a href='?serendipity[adminModule]=images&serendipity[adminAction]=addSelect'><?php echo ADD_IMAGES; ?></a><br> - • <a href='?serendipity[adminModule]=images'><?php echo MANAGE_IMAGES; ?></a><br> - • <a href='?serendipity[adminModule]=images&serendipity[adminAction]=genThumbs' onClick="return confirm('<?php echo WARNING_THIS_BLAHBLAH; ?>');"><?php echo CREATE_THUMBS; ?></a><br> - </div> - </div> - • <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity_admin.php"><?php echo ADMIN_INTERFACE; ?></a><br /> - • <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>"><?php echo BACK_TO_BLOG; ?></a><br /> - • <a href="?serendipity[adminModule]=logout"><?php echo LOGOUT; ?></a><br /> - <img src="<?php echo $serendipity[baseURL]."templates/default/img/leer.png"?>" height="1" width="130" /> - </td> - <td class="serendipity_admin"> - <div class="serendipity_admin_title"><?php echo SERENDIPITY_AUTHORING_SUITE; ?></div> - <?php - if (!$serendipity["GET"]["adminModule"]) $serendipity["GET"]["adminModule"] = $serendipity["POST"]["adminModule"]; - switch($serendipity["GET"]["adminModule"]) { + <div class="serendipitySideBarContent"> + • <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity_admin.php"><?php echo ADMIN_INTERFACE; ?></a><br /> + • <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>" ><?php echo BACK_TO_BLOG; ?></a><br /> + • <a href="?serendipity[adminModule]=logout" ><?php echo LOGOUT; ?></a><br /> + + <img src="<?php echo $serendipity['baseURL'] . 'templates/default/img/leer.png'; ?>" height="1" width="130" alt="" /> + </div> + </td> - case "entries": - include("serendipity_admin_entries.inc.php"); - break; + <td class="serendipity_admin"> + <div class="serendipity_admin_title"><?php echo SERENDIPITY_AUTHORING_SUITE; ?></div> +<?php + if (!$serendipity['GET']['adminModule']) { + $serendipity['GET']['adminModule'] = $serendipity['POST']['adminModule']; + } - case "images": - include("serendipity_admin_images.inc.php"); - break; + switch($serendipity['GET']['adminModule']) { + case 'entries': + include 'serendipity_admin_entries.inc.php'; + break; - case "category": - include "serendipity_admin_category.inc.php"; - break; + case 'images': + include 'serendipity_admin_images.inc.php'; + break; - case "logout": - session_destroy(); - echo "Logged out."; - break; + case 'category': + include 'serendipity_admin_category.inc.php'; + break; - default: - include("serendipity_entries_overview.inc.php"); + case 'logout': + session_destroy(); + echo LOGGEDOUT; + break; - } - ?> - <?php - } - ?> + default: + include 'serendipity_entries_overview.inc.php'; + } +?> </td> - </tr> - </table> - - </body> + </tr> + </table> +<?php +} +?> +</body> </html> <?php /* vim: set sts=4 ts=4 expandtab : */ Index: serendipity_entries_overview.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_entries_overview.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serendipity_entries_overview.inc.php 8 Jul 2003 09:13:27 -0000 1.5 +++ serendipity_entries_overview.inc.php 8 Jul 2003 12:14:17 -0000 1.6 @@ -1,17 +1,19 @@ <?php # $Id$ ########################################################################## -# serendipity - another blogger... # +# serendipity - another blogger... # ########################################################################## # # # (c) 2003 Jannis Hermanns <J...@ha...> # -# http://www.jannis.to/programming/serendipity.html # +# http://www.jannis.to/programming/serendipity.html # # # ########################################################################## -if (IN_serendipity !== true) die ("Don't hack!"); -?> -Welcome back, <?php echo $_SESSION['serendipityUser'] ; ?>. -<?php +if (IN_serendipity !== true) { + die ('Don\'t hack!'); +} + +echo WELCOME_BACK . ' ' . $_SESSION['serendipityUser']; + /* vim: set sts=4 ts=4 expandtab : */ ?> Index: serendipity_genpage.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_genpage.inc.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- serendipity_genpage.inc.php 8 Jul 2003 09:13:27 -0000 1.11 +++ serendipity_genpage.inc.php 8 Jul 2003 12:14:17 -0000 1.12 @@ -3,29 +3,31 @@ "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> -<title><?php echo htmlentities($serendipity['blogTitle']); ?></title> -<link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php" /> + <title><?php echo htmlentities($serendipity['blogTitle']); ?></title> + <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php" /> + <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $serendipity['baseURL']; ?>feeds/index.rss" /> + <script language="Javascript" type="text/javascript" src="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.js"></script> <?php - if (strtolower($serendipity['extCSS'])!='none') echo "<style type='text/css'>@import \"{$serendipity['extCSS']}\";</style>\n"; + if (strtolower($serendipity['extCSS'])!='none') { +?> + <style type="text/css">@import <?php echo $serendipity['extCSS']; ?>";</style> +<?php + } ?> -<link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $serendipity['baseURL']; ?>feeds/index.rss" /> -<script language="Javascript" type="text/javascript" src="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.js"></script> </head> - <body> <?php -include_once("serendipity_config.inc.php"); -include_once("serendipity_plugin_api.php"); -include_once("serendipity_sidebar_items.php"); +include_once('serendipity_config.inc.php'); +include_once('serendipity_plugin_api.php'); +include_once('serendipity_sidebar_items.php'); -if ( file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') ."/layout.php") ) { - include $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') ."/layout.php"; +if (file_exists($serendipity['serendipityPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/layout.php')) { + include $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') . '/layout.php'; } else { - include ($serendipity['templatePath'] ."default/layout.php"); + include $serendipity['templatePath'] . 'default/layout.php'; } ?> - </body> </html> <?php Index: serendipity_plugin_api.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_plugin_api.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serendipity_plugin_api.php 8 Jul 2003 09:13:27 -0000 1.4 +++ serendipity_plugin_api.php 8 Jul 2003 12:14:17 -0000 1.5 @@ -1,15 +1,16 @@ <?php # $Id$ -if (IN_serendipity !== true) die ("Don't hack!"); +if (IN_serendipity !== true) { + die ('Don\'t hack!'); +} include_once 'serendipity_functions.inc.php'; /* This file defines the plugin API for serendipity. * By extending these classes, you can add your own code * to appear in the sidebar(s) of serendipity. - */ - -/* + * + * * The system defines a number of built-in plugins; these are * identified by @class_name. * @@ -26,265 +27,301 @@ class serendipity_plugin_api { - function register_default_plugins() - { - $classes = serendipity_plugin_api::enum_plugin_classes(); - foreach ($classes as $class_name) { - if ($class_name{0} == '@') { - serendipity_plugin_api::create_plugin_instance($class_name); - } - } - } - - /* Create an instance of a plugin. - * $plugin_class_id is of the form: - * @class_name for a built-in plugin - * or - * plugin_dir_name for a third-party plugin - * returns the instance identifier for the newly created plugin. - * - * TO BE IMPLEMENTED: - * If $copy_from_instance is not null, and identifies another plugin - * of the same class, then the persistent state will be copied. - * This allows the user to clone a plugin. - */ - function create_plugin_instance($plugin_class_id, $copy_from_instance=null) - { - global $serendipity; - - $id = md5(uniqid("")); - - $key = $plugin_class_id . ":" . $id; - - $rs = serendipity_db_query("SELECT MAX(sort_order) as sort_order_max FROM $serendipity[dbPrefix]plugins",true,'num'); - - if (is_array($rs)) - $nextidx = intval($rs[0]+1); - else - $nextidx = 0; - - serendipity_db_query("INSERT INTO $serendipity[dbPrefix]plugins (name, sort_order) values ('$key', $nextidx)"); + function register_default_plugins() + { + $classes = serendipity_plugin_api::enum_plugin_classes(); + foreach ($classes as $class_name) { + if ($class_name{0} == '@') { + serendipity_plugin_api::create_plugin_instance($class_name); + } + } + } + + /* Create an instance of a plugin. + * $plugin_class_id is of the form: + * @class_name for a built-in plugin + * or + * plugin_dir_name for a third-party plugin + * returns the instance identifier for the newly created plugin. + * + * TO BE IMPLEMENTED: + * If $copy_from_instance is not null, and identifies another plugin + * of the same class, then the persistent state will be copied. + * This allows the user to clone a plugin. + */ + function create_plugin_instance($plugin_class_id, $copy_from_instance = null) + { + global $serendipity; + + $id = md5(uniqid('')); + + $key = $plugin_class_id . ':' . $id; + + $rs = serendipity_db_query("SELECT MAX(sort_order) as sort_order_max FROM {$serendipity['dbPrefix']}plugins", true, 'num'); + + if (is_array($rs)) { + $nextidx = intval($rs[0]+1); + } else { + $nextidx = 0; + } + + serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}plugins (name, sort_order) values ('$key', $nextidx)"); + + return $key; + } + + function remove_plugin_instance($plugin_instance_id) + { + global $serendipity; + serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}plugins where name='$plugin_instance_id'"); + } + + /* Retrieves a list of available plugins */ + function enum_plugin_classes() + { + global $serendipity; + + $classes = array(); + + /* built-in classes first */ + $cls = get_declared_classes(); + foreach ($cls as $class_name) { + if (strncmp($class_name, 'serendipity_', 6)) { + continue; + } - return $key; - } - - function remove_plugin_instance($plugin_instance_id) - { - global $serendipity; - serendipity_db_query("DELETE FROM $serendipity[dbPrefix]plugins where name='$plugin_instance_id'"); - } + $p = get_parent_class($class_name); + while ($p != 'serendipity_plugin' && $p !== false) { + $p = get_parent_class($p); + } - /* Retrieves a list of available plugins */ - function enum_plugin_classes() - { - global $serendipity; + if ($p == 'serendipity_plugin') { + $classes[] = '@' . $class_name; + } + } - $classes = array(); + /* third-party classes next */ + $d = opendir($serendipity['serendipityPath'] . 'plugins'); + while (($f = readdir($d)) !== false) { + if ($f{0} == '.' || $f == 'CVS') { + continue; + } - /* built-in classes first */ - $cls = get_declared_classes(); - foreach ($cls as $class_name) { - if (strncmp($class_name, 'serendipity_', 6)) { - continue; - } - $p = get_parent_class($class_name); - while ($p != 'serendipity_plugin' && $p !== false) { - $p = get_parent_class($p); - } - if ($p == 'serendipity_plugin') { - $classes[] = '@' . $class_name; - } - } - /* third-party classes next */ - $d = opendir($serendipity['serendipityPath'] . "plugins"); - while (($f = readdir($d)) !== false) { - if ($f{0} == '.' || $f == 'CVS') - continue; - $classes[] = $f; - } - return $classes; - } + $classes[] = $f; + } + return $classes; + } + + /* Retrieves a list of plugin instances */ + function enum_plugins($filter = '*') + { + global $serendipity; - /* Retrieves a list of plugin instances */ - function enum_plugins($filter = '*') - { - global $serendipity; - $sql = "SELECT * from $serendipity[dbPrefix]plugins "; - if ($filter !== '*') { - $sql .= "WHERE placement='$filter' "; - } - $sql .= " ORDER BY placement, sort_order"; + $sql = "SELECT * from {$serendipity['dbPrefix']}plugins "; - return serendipity_db_query($sql); - } + if ($filter !== '*') { + $sql .= "WHERE placement='$filter' "; + } - /* Creates an instance of a named plugin */ - function &load_plugin($instance_id) - { - global $serendipity; + $sql .= " ORDER BY placement, sort_order"; + + return serendipity_db_query($sql); + } + + /* Creates an instance of a named plugin */ + function &load_plugin($instance_id) + { + global $serendipity; + + list($name, $uniq) = explode(':', $instance_id); + + if ($name{0} == '@') { + $class_name = substr($name, 1); + } else { + /* plugin from the plugins/ dir */ + if (!class_exists($name)) { + + include $serendipity['serendipityPath'] . 'plugins/' . $name . '/' . $name . '.php'; + + if (!class_exists($name)) { + return false; + } + } - list($name, $uniq) = explode(":", $instance_id); + $class_name = $name; + } + + $p =& new $class_name($instance_id); + + return $p; + } + + function update_plugin_placement($name, $placement, $order=null) + { + global $serendipity; - if ($name{0} == '@') { - $class_name = substr($name, 1); - } else { - /* plugin from the plugins/ dir */ - if (!class_exists($name)) { + $sql = "UPDATE {$serendipity['dbPrefix']}plugins set placement='$placement' "; - include $serendipity['serendipityPath'] . 'plugins/' . $name . '/' . $name . '.php'; + if ($order !== null) { + $sql .= ", sort_order=$order "; + } + + $sql .= "WHERE name='$name'"; - if (!class_exists($name)) { - return false; - } - } - $class_name = $name; - } + return serendipity_db_query($sql); + } + + function generate_plugins($side, $tagname = 'div') + { + $plugins = serendipity_plugin_api::enum_plugins($side); - $p =& new $class_name($instance_id); - - return $p; - } + if (!is_array($plugins)) { + return; + } + + echo "<$tagname id=\"serendipity" . ucfirst($side) . "SideBar\">\n"; + foreach ($plugins as $plugin_data) { + $plugin =& serendipity_plugin_api::load_plugin($plugin_data['name']); + $title = get_class($plugin); - function update_plugin_placement($name, $placement, $order=null) - { - global $serendipity; - $sql = "UPDATE $serendipity[dbPrefix]plugins set placement='$placement' "; - if ($order !== null) - $sql .= ", sort_order=$order "; - $sql .= "WHERE name='$name'"; - return serendipity_db_query($sql); - } + ob_start(); + $plugin->generate_content($title); + $content = ob_get_contents(); + ob_end_clean(); - function generate_plugins($side, $tagname='div') - { - $plugins = serendipity_plugin_api::enum_plugins($side); - if (!is_array($plugins)) - return; - echo "<$tagname id=\"serendipity" . ucfirst($side) . "SideBar\">\n"; - foreach ($plugins as $plugin_data) { - $plugin =& serendipity_plugin_api::load_plugin($plugin_data['name']); - $title = get_class($plugin); - ob_start(); - $plugin->generate_content($title); - $content = ob_get_contents(); - ob_end_clean(); - echo " <div class=\"$plugin->wrap_class\">\n <h3 class=\"$plugin->title_class\">$title</h3>\n <div class=\"$plugin->content_class\">$content\n </div>\n </div>\n"; - } - echo "</$tagname>\n"; - } + echo " <div class=\"$plugin->wrap_class\">\n"; + echo " <h3 class=\"$plugin->title_class\">$title</h3>\n"; + echo " <div class=\"$plugin->content_class\">\n"; + echo " $content\n"; + echo " </div>\n"; + echo " </div>\n"; + } + echo "</$tagname>\n"; + } } /* holds a bunch of properties; you can have multiple - * properties with the same name */ +* properties with the same name */ class serendipity_property_bag { - var $properties = array(); - var $name = null; - - function add($name, $value) - { - $this->properties[] = array( - 'name' => $name, - 'value' => $value - ); - } + var $properties = array(); + var $name = null; - function get($name) - { - $v = array(); - foreach ($this->properties as $data) { - if ($data['name'] == $name) { - $v[] = $data['value']; - } - } - if (count($v) == 1) - return $v[0]; + function add($name, $value) + { + $this->properties[] = array( + 'name' => $name, + 'value' => $value + ); + } + + function get($name) + { + $v = array(); + foreach ($this->properties as $data) { + if ($data['name'] == $name) { + $v[] = $data['value']; + } + } - return implode(", ", $v); - } + if (count($v) == 1) { + return $v[0]; + } + + return implode(', ', $v); + } + + function is_set($name) + { + foreach ($this->properties as $data) { + if ($data['name'] == $name) { + return true; + } + } - function is_set($name) - { - foreach ($this->properties as $data) { - if ($data['name'] == $name) { - return true; - } - } - return false; - } + return false; + } } class serendipity_plugin { - var $instance = null; - var $wrap_class = 'serendipitySideBarItem'; - var $title_class = 'serendipitySideBarTitle'; - var $content_class = 'serendipitySideBarContent'; - /* Be sure to call this method from your derived classes constructors, - * otherwise your config data will not be stored or retrieved correctly */ - function serendipity_plugin($instance) - { - $this->instance = $instance; - } - - /* Called by serendipity when it wants to display information - * about your plugin. - * You need to override this method in your child class. - */ - function introspect(&$propbag) - { - $propbag->add('copyright', 'MIT License'); - $propbag->add('name', get_class($this)); - -// $propbag->add('configuration', array( -// 'text field', -// 'foo bar' -// )); - return true; - } - - /* Called by serendipity when it wants to display the configuration - * editor for your plugin. - * $name is the name of a configuration item you added in - * your instrospect method. - * You need to fill the property bag with appropriate items - * that describe the type and value(s) for that particular - * configuration option. - * You need to override this method in your child class if - * you have configuration options. - */ - function introspect_config_item($name, &$propbag) - { - return false; - } + var $instance = null; + var $wrap_class = 'serendipitySideBarItem'; + var $title_class = 'serendipitySideBarTitle'; + var $content_class = 'serendipitySideBarContent'; - /* Called by serendipity when it wants your plugin to display itself. - * You need to set $title to be whatever text you want want to - * appear in the item caption space. - * Simply echo/print your content to the output; serendipity will - * capture it and make things work. - * You need to override this method in your child class. - */ - function generate_content(&$title) - { - $title = "Sample!"; - echo "This is a sample!"; - } + /* Be sure to call this method from your derived classes constructors, + * otherwise your config data will not be stored or retrieved correctly + */ - /* Fetches a configuration value for this plugin */ - function get_config($name, $defaultvalue = null) - { - $name = $this->instance . "/" . $name; - return serendipity_get_config_var($name, $defaultvalue); - } + function serendipity_plugin($instance) + { + $this->instance = $instance; + } + + /* Called by serendipity when it wants to display information + * about your plugin. + * You need to override this method in your child class. + */ + function introspect(&$propbag) + { + $propbag->add('copyright', 'MIT License'); + $propbag->add('name' , get_class($this)); + + // $propbag->add( + // 'configuration', + // array( + // 'text field', + // 'foo bar' + // ) + // ); + return true; + } + + /* Called by serendipity when it wants to display the configuration + * editor for your plugin. + * $name is the name of a configuration item you added in + * your instrospect method. + * You need to fill the property bag with appropriate items + * that describe the type and value(s) for that particular + * configuration option. + * You need to override this method in your child class if + * you have configuration options. + */ + function introspect_config_item($name, &$propbag) + { + return false; + } + + /* Called by serendipity when it wants your plugin to display itself. + * You need to set $title to be whatever text you want want to + * appear in the item caption space. + * Simply echo/print your content to the output; serendipity will + * capture it and make things work. + * You need to override this method in your child class. + */ + function generate_content(&$title) + { + $title = 'Sample!'; + echo 'This is a sample!'; + } + + /* Fetches a configuration value for this plugin */ + function get_config($name, $defaultvalue = null) + { + $name = $this->instance . '/' . $name; - function set_config($name, $value) - { - $name = $this->instance . "/" . $name; - return serendipity_set_config_var($name, $value); - } + return serendipity_get_config_var($name, $defaultvalue); + } + + function set_config($name, $value) + { + $name = $this->instance . '/' . $name; + return serendipity_set_config_var($name, $value); + } } -include_once "serendipity_sidebar_items.php"; +include_once 'serendipity_sidebar_items.php'; + /* vim: set sts=4 ts=4 expandtab : */ ?> |
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv26176 Modified Files: serendipity_editor.js serendipity_functions_config.inc.php serendipity_lang_es.inc.php serendipity_rss_exchange.inc.php Log Message: ...take a wild guess...: XHTML conformance, code style. Index: serendipity_editor.js =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_editor.js,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serendipity_editor.js 8 Jul 2003 09:13:27 -0000 1.3 +++ serendipity_editor.js 8 Jul 2003 12:10:09 -0000 1.4 @@ -2,109 +2,115 @@ /* $Id$ */ /* - Written by chris wetherell - http://www.massless.org - chris [THE AT SIGN] massless.org - - warning: it only works for IE4+/Win and Moz1.1+ - feel free to take it for your site - if there are any problems, let chris know. + Written by chris wetherell + http://www.massless.org + chris [THE AT SIGN] massless.org + + warning: it only works for IE4+/Win and Moz1.1+ + feel free to take it for your site + if there are any problems, let chris know. */ - + var thisForm; function getMozSelection(txtarea) { - var selLength = txtarea.textLength; - var selStart = txtarea.selectionStart; - var selEnd = txtarea.selectionEnd; - if (selEnd==1 || selEnd==2) selEnd=selLength; - return (txtarea.value).substring(selStart, selEnd); + var selLength = txtarea.textLength; + var selStart = txtarea.selectionStart; + var selEnd = txtarea.selectionEnd; + if (selEnd==1 || selEnd==2) { + selEnd=selLength; + } + return (txtarea.value).substring(selStart, selEnd); } function mozWrap(txtarea, lft, rgt) { - var selLength = txtarea.textLength; - var selStart = txtarea.selectionStart; - var selEnd = txtarea.selectionEnd; - if (selEnd==1 || selEnd==2) selEnd=selLength; - var s1 = (txtarea.value).substring(0,selStart); - var s2 = (txtarea.value).substring(selStart, selEnd) - var s3 = (txtarea.value).substring(selEnd, selLength); - txtarea.value = s1 + lft + s2 + rgt + s3; + var selLength = txtarea.textLength; + var selStart = txtarea.selectionStart; + var selEnd = txtarea.selectionEnd; + if (selEnd==1 || selEnd==2) selEnd=selLength; + var s1 = (txtarea.value).substring(0,selStart); + var s2 = (txtarea.value).substring(selStart, selEnd) + var s3 = (txtarea.value).substring(selEnd, selLength); + txtarea.value = s1 + lft + s2 + rgt + s3; } function IEWrap(lft, rgt) { - strSelection = document.selection.createRange().text; - if (strSelection!="") { - document.selection.createRange().text = lft + strSelection + rgt; - } + strSelection = document.selection.createRange().text; + if (strSelection != "") { + document.selection.createRange().text = lft + strSelection + rgt; + } } function wrapSelection(txtarea, lft, rgt) { - if (document.all) {IEWrap(lft, rgt);} - else if (document.getElementById) {mozWrap(txtarea, lft, rgt);} + if (document.all) { + IEWrap(lft, rgt); + } else if (document.getElementById) { + mozWrap(txtarea, lft, rgt); + } } function wrapSelectionWithLink(txtarea) { - var my_link = prompt("Enter URL:","http://"); - if (getMozSelection(txtarea) == "") { - var my_desc = prompt("Enter Description"); - } - if (my_link != null) { - lft = "<a href=\"" + my_link + "\">"; - if (my_desc != null && my_desc != "") { - rgt = my_desc +"</a>"; - } else { - rgt = "</a>"; - } - wrapSelection(txtarea, lft, rgt); - } - return; -} + var my_link = prompt("Enter URL:","http://"); + + if (getMozSelection(txtarea) == "") { + var my_desc = prompt("Enter Description"); + } + + if (my_link != null) { + lft = "<a href=\"" + my_link + "\">"; + if (my_desc != null && my_desc != "") { + rgt = my_desc +"</a>"; + } else { + rgt = "</a>"; + } + wrapSelection(txtarea, lft, rgt); + } + + return; +} /* end chris w. script */ function mozInsert(txtarea, str) { - var selLength = txtarea.textLength; - var selStart = txtarea.selectionStart; - var selEnd = txtarea.selectionEnd; - if (selEnd==1 || selEnd==2) selEnd=selLength; - var s1 = (txtarea.value).substring(0,selStart); - var s2 = (txtarea.value).substring(selStart, selEnd) - var s3 = (txtarea.value).substring(selEnd, selLength); - txtarea.value = s1 + str + s2 + s3; + var selLength = txtarea.textLength; + var selStart = txtarea.selectionStart; + var selEnd = txtarea.selectionEnd; + if (selEnd==1 || selEnd==2) { + selEnd=selLength; + } + var s1 = (txtarea.value).substring(0,selStart); + var s2 = (txtarea.value).substring(selStart, selEnd) + var s3 = (txtarea.value).substring(selEnd, selLength); + txtarea.value = s1 + str + s2 + s3; } -function wrapInsImage (area) -{ +function wrapInsImage(area) { var loc = prompt('Enter the Image Location: '); if (!loc) { return; } - mozInsert(area,'<img src="'+ loc + '" />'); + mozInsert(area,'<img src="'+ loc + '" alt="" />'); } /* end Better-Editor functions */ -function serendipity_insImage (area) -{ +function serendipity_insImage (area) { var loc = prompt('Enter the Image Location: '); if (!loc) { area.focus(); return; } - area.value = area.value + '<img src="' + loc + '" />'; + area.value = area.value + '<img src="' + loc + '" alt="" />'; area.focus(); } -function serendipity_insBasic (area, tag) -{ +function serendipity_insBasic (area, tag) { area.value = area.value + "<" + tag + "></" + tag + ">"; area.focus(); } -function serendipity_insLink (area) -{ - var loc = prompt('Enter Location: '); +function serendipity_insLink (area) { + var loc = prompt('Enter Location: '); var text = prompt('Enter Description: '); if (!loc) { @@ -124,9 +130,8 @@ function serendipity_imageSelector_done() { - - var insert = ''; - var img = ''; + var insert = ''; + var img = ''; var src = ''; var f = document.forms['serendipity[selForm]'].elements; @@ -137,16 +142,16 @@ } if (f['serendipity[align]'][0].checked == true) { - img = "<img border='0' hspace='5' src='"+img+"'>\n"; + img = "<img border='0' hspace='5' src='" + img + "' alt="" />\n"; } else if (f['serendipity[align]'][1].checked == true) { - img = "<img border='0' hspace='5' align='left' src='"+img+"'>"; + img = "<img border='0' hspace='5' align='left' src='" + img + "' alt="" />"; } else if (f['serendipity[align]'][2].checked == true) { - img = "<img border='0' hspace='5' align='right' src='"+img+"'>"; + img = "<img border='0' hspace='5' align='right' src='" + img + "' alt="" />"; } - if (f['serendipity[isLink]'][1].checked == true) { - insert = "<a href='"+f['serendipity[url]'].value+"'>"+img+"</a>"; + if (f['serendipity[isLink]'][1].checked == true) { + insert = "<a href='" + f['serendipity[url]'].value + "'>" + img + "</a>"; } else { insert = img; } @@ -154,5 +159,5 @@ self.opener.serendipity_imageSelector_addToBody(insert); self.close(); } - + // --> Index: serendipity_functions_config.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions_config.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serendipity_functions_config.inc.php 7 Jul 2003 19:29:11 -0000 1.2 +++ serendipity_functions_config.inc.php 8 Jul 2003 12:10:09 -0000 1.3 @@ -1,23 +1,24 @@ <?php # $Id$ - function serendipity_set_config_var($name, $val) { global $serendipity; - serendipity_db_query("DELETE FROM $serendipity[dbPrefix]config where name='" . serendipity_db_escape_string($name) . "'"); - $r = serendipity_db_insert("config", array("name"=>$name, "value"=>$val)); - if (is_string($r)) { - echo $r; - } + serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}config where name='" . serendipity_db_escape_string($name) . "'"); + $r = serendipity_db_insert("config", array("name"=>$name, "value"=>$val)); + + if (is_string($r)) { + echo $r; + } } function serendipity_get_config_var($name, $defval = false) { global $serendipity; - if ( isset($serendipity['CONFIG'][$name]) ) { - return $serendipity['CONFIG'][$name]; - } else { - return $defval; - } + if ( isset($serendipity['CONFIG'][$name]) ) { + return $serendipity['CONFIG'][$name]; + } else { + return $defval; + } } + /* vim: set sts=4 ts=4 expandtab : */ ?> Index: serendipity_lang_es.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_es.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serendipity_lang_es.inc.php 8 Jul 2003 09:13:27 -0000 1.3 +++ serendipity_lang_es.inc.php 8 Jul 2003 12:10:09 -0000 1.4 @@ -1,16 +1,17 @@ <?php # $Id$ ########################################################################## -# serendipity - un otro blogger... # +# serendipity - un otro blogger... # ########################################################################## // Spanish language file -$serendipity["months"] = array("", "Enero", "Febrero", "Marzo", - "Abril", "Mayo", "Junio", "Julio", "Augusto", "Septiembre", - "Octobre", "Noviembre", "Deciembre"); +$serendipity['months'] = array('', 'Enero', 'Febrero', 'Marzo', + 'Abril', 'Mayo', 'Junio', 'Julio', 'Augusto', 'Septiembre', + 'Octobre', 'Noviembre', 'Deciembre'); -$serendipity["weekDayAbb"] = array("L", "Ma", "Mi", "J", "V", "S", "D"); +$serendipity['weekDayAbb'] = array('L', 'Ma', 'Mi', 'J', 'V', 'S', 'D'); + +define('serendipity_LANG_LOADED', true); -define("serendipity_LANG_LOADED", true); /* vim: set sts=4 ts=4 expandtab : */ ?> Index: serendipity_rss_exchange.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_rss_exchange.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serendipity_rss_exchange.inc.php 8 Jul 2003 09:13:27 -0000 1.3 +++ serendipity_rss_exchange.inc.php 8 Jul 2003 12:10:09 -0000 1.4 @@ -49,5 +49,6 @@ return true; } + /* vim: set sts=4 ts=4 expandtab : */ ?> |
From: <gar...@us...> - 2003-07-08 12:05:23
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv25754 Modified Files: serendipity_functions.inc.php Log Message: Code style, printf usage. Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- serendipity_functions.inc.php 8 Jul 2003 09:13:27 -0000 1.99 +++ serendipity_functions.inc.php 8 Jul 2003 12:05:21 -0000 1.100 @@ -1484,14 +1484,14 @@ $checkfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $f[0] . '.' . $serendipity['thumbSuffix'] . '.' . $f[1]; if (!file_exists($checkfile) && ($fdim[0] > $serendipity['thumbSize'] || $fdim[1] > $serendipity['thumbSize'])) { - sprintf(RESIZE_BLAHBLAH, $files[$x] . ': ' . serendipity_makeThumbnail($files[$x])); + printf(RESIZE_BLAHBLAH, $files[$x] . ': ' . serendipity_makeThumbnail($files[$x])); $i++; } elseif (!file_exists($checkfile) && $fdim[0] < $serendipity['thumbSize'] && $fdim[1] < $serendipity['thumbSize']) { $res = copy ($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $files[$x], $checkfile); if ($res === true) { - sprintf(THUMBNAIL_USING_OWN . '<br />', $files[$x]); + printf(THUMBNAIL_USING_OWN . '<br />', $files[$x]); } else { - sprintf('<span style="color: #ff0000">' . THUMBNAIL_FAILED_COPY . '</span><br />', $files[$x]); + printf('<span style="color: #ff0000">' . THUMBNAIL_FAILED_COPY . '</span><br />', $files[$x]); } } } @@ -1857,10 +1857,10 @@ for($x=1; $x<13; $x++) { $entries = serendipity_postAmount($currYear, $x); if ($entries>0) { - $a = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear".sprintf("%02s",$x).".html'>"; - $b = "</a>"; - $c = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear".sprintf("%02s",$x)."_short.html'>"; - $d = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear".sprintf("%02s",$x).".html'>"; + $a = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear" . sprintf('%02s', $x) . '.html\'>'; + $b = '</a>'; + $c = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear" . sprintf('%02s', $x) . '_short.html\'>'; + $d = "<a href='{$serendipity['serendipityHTTPPath']}archives/$currYear" . sprintf('%02s', $x) . '.html\'>'; } else { $a = $c = '<span style="color: #CDCDCD">'; $b = $d = '</span>'; |
From: <gar...@us...> - 2003-07-08 12:04:25
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv25556 Modified Files: serendipity_db_mysql.inc.php serendipity_db_postgres.inc.php serendipity_db_sqlite.inc.php Log Message: Code style Index: serendipity_db_mysql.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_db_mysql.inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- serendipity_db_mysql.inc.php 8 Jul 2003 09:13:27 -0000 1.8 +++ serendipity_db_mysql.inc.php 8 Jul 2003 12:04:22 -0000 1.9 @@ -9,110 +9,114 @@ */ function serendipity_db_query($sql, $single = false, $result_type = "both", $reportErr=false) { - global $serendipity; - static $type_map = array( - 'assoc' => MYSQL_ASSOC, - 'num' => MYSQL_NUM, - 'both' => MYSQL_BOTH - ); + global $serendipity; + static $type_map = array( + 'assoc' => MYSQL_ASSOC, + 'num' => MYSQL_NUM, + 'both' => MYSQL_BOTH + ); -// highlight_string(var_export($sql, 1)); + // highlight_string(var_export($sql, 1)); - $c = mysql_db_query($serendipity['dbName'], $sql); - if (!$c) { - if (!$serendipity['production']) { - print mysql_error(); - if (function_exists("debug_backtrace") && $reportErr==true) { - highlight_string(var_export(debug_backtrace(), 1)); - } - } - return false; - } - if ($c === true) { - return true; - } + $c = mysql_db_query($serendipity['dbName'], $sql); - $result_type = $type_map[$result_type]; - - switch(mysql_num_rows($c)) { - case 0: - if ($single) { - return false; - } - return true; - case 1: - if ($single) { - return mysql_fetch_array($c, $result_type); - } - default: - $rows = array(); - while (($row = mysql_fetch_array($c, $result_type))) { - $rows[] = $row; - } - return $rows; - } + if (!$c) { + if (!$serendipity['production']) { + print mysql_error(); + if (function_exists('debug_backtrace') && $reportErr == true) { + highlight_string(var_export(debug_backtrace(), 1)); + } + } + + return false; + } + if ($c === true) { + return true; + } + + $result_type = $type_map[$result_type]; + + switch(mysql_num_rows($c)) { + case 0: + if ($single) { + return false; + } + return true; + case 1: + if ($single) { + return mysql_fetch_array($c, $result_type); + } + default: + $rows = array(); + while (($row = mysql_fetch_array($c, $result_type))) { + $rows[] = $row; + } + return $rows; + } } function serendipity_db_insert_id() { - return mysql_insert_id(); + return mysql_insert_id(); } function serendipity_db_affected_rows() { - return mysql_affected_rows(); + return mysql_affected_rows(); } function serendipity_db_escape_string($string) { - return mysql_escape_string($string); + return mysql_escape_string($string); } function serendipity_db_limit($start, $offset) { - return "$start, $offset"; + return $start . ', ' . $offset; } function serendipity_db_connect() { - global $serendipity; + global $serendipity; - if ($serendipity['dbConn']) { - return; - } + if ($serendipity['dbConn']) { + return; + } - $serendipity['dbConn'] = mysql_connect($serendipity['dbHost'], $serendipity['dbUser'], $serendipity['dbPass']); - return $serendipity['dbConn']; + $serendipity['dbConn'] = mysql_connect($serendipity['dbHost'], $serendipity['dbUser'], $serendipity['dbPass']); + + return $serendipity['dbConn']; } function serendipity_db_schema_import($query) { - static $search = array('{AUTOINCREMENT}', '{UNSIGNED}', '{FULLTEXT}'); - static $replace = array('int(11) not null auto_increment primary key', 'unsigned', 'FULLTEXT'); + static $search = array('{AUTOINCREMENT}' , '{UNSIGNED}', '{FULLTEXT}'); + static $replace = array('int(11) not null auto_increment primary key', 'unsigned' , 'FULLTEXT' ); - return serendipity_db_query(str_replace($search, $replace, $query)); + return serendipity_db_query(str_replace($search, $replace, $query)); } /* probes the usability of the DB during installation */ function serendipity_db_probe($hash, &$errs) { - global $serendipity; - - if (!($c = @mysql_connect($hash['dbHost'], $hash['dbUser'], $hash['dbPass']))) { - $errs[] = "Could not connect to database; check your settings."; - $errs[] = "The mySQL error was: " . mysql_error(); - return false; - } - - $serendipity['dbConn'] = $c; - - if (!@mysql_select_db($hash['dbName'])) { - $errs[] = "The database you specified does not exist."; - $errs[] = "The mySQL error was: " . mysql_error(); - return false; - } - - return true; + global $serendipity; + + if (!($c = @mysql_connect($hash['dbHost'], $hash['dbUser'], $hash['dbPass']))) { + $errs[] = 'Could not connect to database; check your settings.'; + $errs[] = 'The mySQL error was: ' . mysql_error(); + return false; + } + + $serendipity['dbConn'] = $c; + + if (!@mysql_select_db($hash['dbName'])) { + $errs[] = 'The database you specified does not exist.'; + $errs[] = 'The mySQL error was: ' . mysql_error(); + return false; + } + + return true; } + /* vim: set sts=4 ts=4 expandtab : */ ?> Index: serendipity_db_postgres.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_db_postgres.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serendipity_db_postgres.inc.php 7 Jul 2003 19:29:11 -0000 1.5 +++ serendipity_db_postgres.inc.php 8 Jul 2003 12:04:22 -0000 1.6 @@ -2,106 +2,123 @@ function serendipity_db_connect() { - global $serendipity; - - $serendipity['dbConn'] = pg_connect(sprintf("%sdbname=%s user=%s password=%s", - strlen($serendipity['dbHost']) ? ('host=' . $serendipity['dbHost'] . ' ') : '', - $serendipity['dbName'], $serendipity['dbUser'], $serendipity['dbPass'])); + global $serendipity; - return $serendipity['dbConn']; + $serendipity['dbConn'] = pg_connect( + sprintf( + '%sdbname=%s user=%s password=%s', + + strlen($serendipity['dbHost']) ? ('host=' . $serendipity['dbHost'] . ' ') : '', + $serendipity['dbName'], + $serendipity['dbUser'], + $serendipity['dbPass'] + ) + ); + + return $serendipity['dbConn']; } function serendipity_db_escape_string($string) { - return pg_escape_string($string); + return pg_escape_string($string); } function serendipity_db_limit($start, $offset) { - return "$offset, $start"; + return $offset . ', ' . $start; } function serendipity_db_affected_rows() { - global $serendipity; - return pg_affected_rows($serendipity['dbLastResult']); + global $serendipity; + return pg_affected_rows($serendipity['dbLastResult']); } function serendipity_db_insert_id() { - global $serendipity; - return pg_last_oid($serendipity['dbLastResult']); + global $serendipity; + return pg_last_oid($serendipity['dbLastResult']); } function serendipity_db_query($sql, $single = false, $result_type = "both") { - global $serendipity; - static $type_map = array( - 'assoc' => PGSQL_ASSOC, - 'num' => PGSQL_NUM, - 'both' => PGSQL_BOTH - ); + global $serendipity; + static $type_map = array( + 'assoc' => PGSQL_ASSOC, + 'num' => PGSQL_NUM, + 'both' => PGSQL_BOTH + ); - $serendipity['dbLastResult'] = pg_query($serendipity['dbConn'], $sql); + $serendipity['dbLastResult'] = pg_query($serendipity['dbConn'], $sql); - if (!$serendipity['dbLastResult']) { - if (!$serendipity['production']) { - print pg_last_error($serendipity['dbConn']); - if (function_exists("debug_backtrace")) { - highlight_string(var_export(debug_backtrace(), 1)); - } - print "<br><code>$sql</code>\n"; - } - return false; - } - if ($serendipity['dbLastResult'] === true) { - return true; - } + if (!$serendipity['dbLastResult']) { + if (!$serendipity['production']) { + print pg_last_error($serendipity['dbConn']); + if (function_exists('debug_backtrace')) { + highlight_string(var_export(debug_backtrace(), 1)); + } + print "<br><code>$sql</code>\n"; + } + return false; + } - $result_type = $type_map[$result_type]; + if ($serendipity['dbLastResult'] === true) { + return true; + } - $n = pg_num_rows($serendipity['dbLastResult']); + $result_type = $type_map[$result_type]; - switch ($n) { - case 0: - if ($single) { - return false; - } - return true; - - case 1: - if ($single) { - return pg_fetch_array($serendipity['dbLastResult'], 0, $result_type); - } - default: - $rows = array(); - for ($i = 0; $i < $n; $i++) { - $rows[] = pg_fetch_array($serendipity['dbLastResult'], $i, $result_type); - } - return $rows; - } + $n = pg_num_rows($serendipity['dbLastResult']); + + switch ($n) { + case 0: + if ($single) { + return false; + } + return true; + case 1: + if ($single) { + return pg_fetch_array($serendipity['dbLastResult'], 0, $result_type); + } + default: + $rows = array(); + for ($i = 0; $i < $n; $i++) { + $rows[] = pg_fetch_array($serendipity['dbLastResult'], $i, $result_type); + } + return $rows; + } } function serendipity_db_schema_import($query) { - static $search = array('{AUTOINCREMENT}', '{UNSIGNED}', '{FULLTEXT}', 'int(1)', 'int(10)', 'int(11)', 'int(4)'); - static $replace = array('SERIAL primary key', '', '', 'int2', 'int4', 'int4', 'int4'); - - return serendipity_db_query(str_replace($search, $replace, $query)); + static $search = array('{AUTOINCREMENT}' , '{UNSIGNED}', '{FULLTEXT}', 'int(1)', 'int(10)', 'int(11)', 'int(4)'); + static $replace = array('SERIAL primary key', '' , '' , 'int2' , 'int4' , 'int4' , 'int4' ); + + return serendipity_db_query(str_replace($search, $replace, $query)); } function serendipity_db_probe($hash, &$errs) { - global $serendipity; + global $serendipity; + + $serendipity['dbConn'] = pg_connect( + sprintf( + '%sdbname=%s user=%s password=%s', - $serendipity['dbConn'] = pg_connect(sprintf("%sdbname=%s user=%s password=%s", - strlen($hash['dbHost']) ? ('host=' . $hash['dbHost'] . ' ') : '', - $hash['dbName'], $hash['dbUser'], $hash['dbPass'])); - if (!$serendipity['dbConn']) { - $errs[] = "Could not connect to database; check your settings."; - return false; - } - return true; + strlen($hash['dbHost']) ? ('host=' . $hash['dbHost'] . ' ') : '', + $hash['dbName'], + $hash['dbUser'], + $hash['dbPass'] + ) + ); + + if (!$serendipity['dbConn']) { + $errs[] = 'Could not connect to database; check your settings.'; + return false; + } + + return true; } + /* vim: set sts=4 ts=4 expandtab : */ ?> Index: serendipity_db_sqlite.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_db_sqlite.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serendipity_db_sqlite.inc.php 8 Jul 2003 09:13:27 -0000 1.4 +++ serendipity_db_sqlite.inc.php 8 Jul 2003 12:04:22 -0000 1.5 @@ -2,122 +2,128 @@ function serendipity_db_connect() { - global $serendipity; - - $serendipity['dbConn'] = sqlite_open($serendipity['serendipityPath'] . "sqlite.db"); + global $serendipity; + + $serendipity['dbConn'] = sqlite_open($serendipity['serendipityPath'] . 'sqlite.db'); } function serendipity_db_escape_string($string) { - static $search = array("\x00", '%', '\'', '\"'); - static $replace = array('%00', '%25', '\\\'', '\\\"'); - - return str_replace($search, $replace, $string); + static $search = array("\x00", '%', '\'', '\"'); + static $replace = array('%00', '%25', '\\\'', '\\\"'); + + return str_replace($search, $replace, $string); } function serendipity_db_affected_rows() { - return sqlite_changes($GLOBALS['serendipity']['dbConn']); + return sqlite_changes($GLOBALS['serendipity']['dbConn']); } function serendipity_db_insert_id() { - return sqlite_last_insert_rowid($GLOBALS['serendipity']['dbConn']); + return sqlite_last_insert_rowid($GLOBALS['serendipity']['dbConn']); } function serendipity_db_sqlite_fetch_array($res) { - static $search = array('%00', '%25'); - static $replace = array("\x00", '%'); - - $row = sqlite_fetch_array($res); - if (!is_array($row)) - return $row; - /* strip any slashes */ - $r = array(); - foreach ($row as $i => $v) { - $r[$i] = str_replace($search, $replace, $v); - } - return $r; + static $search = array('%00', '%25'); + static $replace = array("\x00", '%'); + + $row = sqlite_fetch_array($res); + if (!is_array($row)) { + return $row; + } + + /* strip any slashes */ + $r = array(); + foreach ($row as $i => $v) { + $r[$i] = str_replace($search, $replace, $v); + } + + return $r; } function serendipity_db_query($sql, $single = false, $result_type = "both") { - global $serendipity; - - $res = sqlite_exec($sql, $serendipity['dbConn']); - if (!$res) { - if (!$serendipity['production']) { - var_dump($res); - var_dump($sql); - return "problem with query"; - } - return false; - } - - if ($res === true) { - return true; - } - - $rows = array(); - - if ($result_type == 'num') { - while (($row = serendipity_db_sqlite_fetch_array($res))) { - $rows[] = $row; - } - } else { - - $field_names = serendipity_db_sqlite_fetch_array($res); - - if ($result_type == 'both') { - while (($row = sqlite_fetch_array($res))) { - foreach ($field_names as $i => $name) { - $row[$name] = $row[$i]; - } - $rows[] = $row; - } - } else { - /* string keys only */ - while (($row = serendipity_db_sqlite_fetch_array($res))) { - $r = array(); - foreach ($field_names as $i => $name) { - $r[$name] = $row[$i]; - } - $rows[] = $r; - } - } - } - - if ($single && count($rows) == 0) { - return false; - } - - if ($single && count($rows) == 1) { - return $rows[0]; - } + global $serendipity; + + $res = sqlite_exec($sql, $serendipity['dbConn']); + if (!$res) { + if (!$serendipity['production']) { + var_dump($res); + var_dump($sql); + return "problem with query"; + } + return false; + } + + if ($res === true) { + return true; + } + + $rows = array(); + + if ($result_type == 'num') { + while (($row = serendipity_db_sqlite_fetch_array($res))) { + $rows[] = $row; + } + } else { + + $field_names = serendipity_db_sqlite_fetch_array($res); + + if ($result_type == 'both') { + while (($row = sqlite_fetch_array($res))) { + foreach ($field_names as $i => $name) { + $row[$name] = $row[$i]; + } + $rows[] = $row; + } + } else { - return $rows; + /* string keys only */ + while (($row = serendipity_db_sqlite_fetch_array($res))) { + $r = array(); + foreach ($field_names as $i => $name) { + $r[$name] = $row[$i]; + } + $rows[] = $r; + } + } + } + + if ($single && count($rows) == 0) { + return false; + } + + if ($single && count($rows) == 1) { + return $rows[0]; + } + + return $rows; } function serendipity_db_probe($hash, &$errs) { - global $serendipity; + global $serendipity; + + $serendipity['dbConn'] = sqlite_open($serendipity['serendipityPath'] . 'sqlite.db'); - $serendipity['dbConn'] = sqlite_open($serendipity['serendipityPath'] . "sqlite.db"); - if ($serendipity['dbConn']) { - return true; - } - $errs[] = "Unable to open \"$serendipity[serendipityPath]sqlite.db\" - check permissions!"; - return false; + if ($serendipity['dbConn']) { + return true; + } + + $errs[] = "Unable to open \"{$serendipity['serendipityPath']}sqlite.db\" - check permissions!"; + return false; } function serendipity_db_schema_import($query) { - static $search = array('{AUTOINCREMENT}', '{UNSIGNED}', '{FULLTEXT}'); - static $replace = array('INTEGER PRIMARY KEY', '', ''); - - return serendipity_db_query(str_replace($search, $replace, $query)); + static $search = array('{AUTOINCREMENT}' , '{UNSIGNED}', '{FULLTEXT}'); + static $replace = array('INTEGER PRIMARY KEY', '' , '' ); + return serendipity_db_query(str_replace($search, $replace, $query)); } + /* vim: set sts=4 ts=4 expandtab : */ ?> |
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv2573 Modified Files: INSTALL NEWS comment.php compat.php exit.php index.php rss.php search.php serendipity.css serendipity.css.php serendipity.inc.php serendipity.js serendipity_admin.php serendipity_admin_category.inc.php serendipity_admin_css.inc.php serendipity_admin_entries.inc.php serendipity_admin_image_selector.php serendipity_admin_images.inc.php serendipity_admin_installer.inc.php serendipity_admin_interop.inc.php serendipity_admin_overview.inc.php serendipity_admin_plugins.inc.php serendipity_admin_templates.inc.php serendipity_config.inc.php serendipity_config_local.tpl serendipity_db.inc.php serendipity_db_mysql.inc.php serendipity_db_sqlite.inc.php serendipity_editor.js serendipity_entries.php serendipity_entries_overview.inc.php serendipity_functions.inc.php serendipity_genpage.inc.php serendipity_lang_de.inc.php serendipity_lang_en.inc.php serendipity_lang_es.inc.php serendipity_layout.inc.php serendipity_layout_table.inc.php serendipity_plugin_api.php serendipity_rss_exchange.inc.php serendipity_sidebar_items.php serendipity_xmlrpc.php Log Message: Added CVS $Id$ headers Index: INSTALL =================================================================== RCS file: /cvsroot/php-blog/serendipity/INSTALL,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- INSTALL 24 Jun 2003 19:11:37 -0000 1.3 +++ INSTALL 8 Jul 2003 09:13:27 -0000 1.4 @@ -67,3 +67,5 @@ Thanks to: Daniel Freudenberger <be...@or...> + +# $Id$ \ No newline at end of file Index: NEWS =================================================================== RCS file: /cvsroot/php-blog/serendipity/NEWS,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- NEWS 20 Jun 2003 21:39:26 -0000 1.4 +++ NEWS 8 Jul 2003 09:13:27 -0000 1.5 @@ -1,3 +1,5 @@ +# $Id$ + Version 0.3 () ------------------------------------ * Escape potential HTML characters in <title> in RSS feeds (Joyce P & gschlossnagle) Index: comment.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/comment.php,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- comment.php 7 Jul 2003 19:29:10 -0000 1.13 +++ comment.php 8 Jul 2003 09:13:27 -0000 1.14 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + session_start(); include_once('serendipity_config.inc.php'); Index: compat.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/compat.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- compat.php 7 Jul 2003 19:29:11 -0000 1.3 +++ compat.php 8 Jul 2003 09:13:27 -0000 1.4 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + if (!function_exists('file_get_contents')) { function file_get_contents($file) { $fp = fopen($file, 'rb'); Index: exit.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/exit.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- exit.php 7 Jul 2003 19:29:11 -0000 1.4 +++ exit.php 8 Jul 2003 09:13:27 -0000 1.5 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + include_once 'serendipity_config.inc.php'; $entry_id = 0; Index: index.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/index.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- index.php 7 Jul 2003 19:29:11 -0000 1.18 +++ index.php 8 Jul 2003 09:13:27 -0000 1.19 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + // We need to set this to return a 200 since we use .htaccess ErrorDocument // rules to handle archives. header('HTTP/1.0 200\r\n'); Index: rss.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/rss.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- rss.php 7 Jul 2003 19:29:11 -0000 1.6 +++ rss.php 8 Jul 2003 09:13:27 -0000 1.7 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ header('Content-Type: text/xml'); include_once('serendipity_config.inc.php'); Index: search.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/search.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- search.php 7 Jul 2003 19:29:11 -0000 1.5 +++ search.php 8 Jul 2003 09:13:27 -0000 1.6 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ include_once('serendipity_config.inc.php'); include_once('serendipity_genpage.inc.php'); Index: serendipity.css =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.css,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serendipity.css 7 Jul 2003 12:41:17 -0000 1.2 +++ serendipity.css 8 Jul 2003 09:13:27 -0000 1.3 @@ -1,3 +1,5 @@ +/* $Id$ */ + #mainpane { width: 100%; } Index: serendipity.css.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.css.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- serendipity.css.php 7 Jul 2003 19:29:11 -0000 1.12 +++ serendipity.css.php 8 Jul 2003 09:13:27 -0000 1.13 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + header('Content-type: text/css'); if (!@include_once('serendipity_config.inc.php')) { Index: serendipity.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serendipity.inc.php 7 Jul 2003 19:29:11 -0000 1.3 +++ serendipity.inc.php 8 Jul 2003 09:13:27 -0000 1.4 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + ########################################################################## # serendipity - another blogger... # ########################################################################## @@ -19,22 +20,7 @@ include_once('./serendipity_config_local.inc.php'); // Put your emoticons here -$serendipity['smiles'] = array( ":'(" => $serendipity['serendipityHTTPPath'] . 'pixel/cry_smile.gif', - ':-)' => $serendipity['serendipityHTTPPath'] . 'pixel/regular_smile.gif', - ':-O' => $serendipity['serendipityHTTPPath'] . 'pixel/embaressed_smile.gif', - ':O' => $serendipity['serendipityHTTPPath'] . 'pixel/embaressed_smile.gif', - ':-(' => $serendipity['serendipityHTTPPath'] . 'pixel/sad_smile.gif', - ':(' => $serendipity['serendipityHTTPPath'] . 'pixel/sad_smile.gif', - ':)' => $serendipity['serendipityHTTPPath'] . 'pixel/regular_smile.gif', - '8-)' => $serendipity['serendipityHTTPPath'] . 'pixel/shades_smile.gif', - ':-D' => $serendipity['serendipityHTTPPath'] . 'pixel/teeth_smile.gif', - ':D' => $serendipity['serendipityHTTPPath'] . 'pixel/teeth_smile.gif', - '8)' => $serendipity['serendipityHTTPPath'] . 'pixel/shades_smile.gif', - ':-P' => $serendipity['serendipityHTTPPath'] . 'pixel/tounge_smile.gif', - ';-)' => $serendipity['serendipityHTTPPath'] . 'pixel/wink_smile.gif', - ';)' => $serendipity['serendipityHTTPPath'] . 'pixel/wink_smile.gif', - ':P' => $serendipity['serendipityHTTPPath'] . 'pixel/tounge_smile.gif', - ); +include_once('./serendipity_smiles.inc.php'); // You're done :) /************************************************************************* Index: serendipity.js =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.js,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- serendipity.js 28 Mar 2003 20:05:24 -0000 1.1.1.1 +++ serendipity.js 8 Jul 2003 09:13:27 -0000 1.2 @@ -1,4 +1,6 @@ <!-- // Hide from older browsers +/* $Id$ */ + // Copyright (c) 1996-1997 Athenia Associates. // http://www.webreference.com/js/ // License is granted if and only if this entire Index: serendipity_admin.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- serendipity_admin.php 7 Jul 2003 19:29:11 -0000 1.14 +++ serendipity_admin.php 8 Jul 2003 09:13:27 -0000 1.15 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + ini_set("session.use_trans_sid",1); session_start(); if (file_exists("./serendipity_config_local.inc.php")) { Index: serendipity_admin_category.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_category.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serendipity_admin_category.inc.php 7 Jul 2003 19:29:11 -0000 1.4 +++ serendipity_admin_category.inc.php 8 Jul 2003 09:13:27 -0000 1.5 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + if (IN_serendipity !== true) die ("Don't hack!"); session_start(); Index: serendipity_admin_css.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_css.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serendipity_admin_css.inc.php 7 Jul 2003 19:29:11 -0000 1.2 +++ serendipity_admin_css.inc.php 8 Jul 2003 09:13:27 -0000 1.3 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ ########################################################################## # serendipity - another blogger... # Index: serendipity_admin_entries.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_entries.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serendipity_admin_entries.inc.php 7 Jul 2003 19:29:11 -0000 1.4 +++ serendipity_admin_entries.inc.php 8 Jul 2003 09:13:27 -0000 1.5 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ ########################################################################## # serendipity - another blogger... # Index: serendipity_admin_image_selector.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_image_selector.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- serendipity_admin_image_selector.php 7 Jul 2003 19:29:11 -0000 1.6 +++ serendipity_admin_image_selector.php 8 Jul 2003 09:13:27 -0000 1.7 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ ########################################################################## # serendipity - another blogger... # Index: serendipity_admin_images.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_images.inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- serendipity_admin_images.inc.php 7 Jul 2003 19:29:11 -0000 1.8 +++ serendipity_admin_images.inc.php 8 Jul 2003 09:13:27 -0000 1.9 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ ########################################################################## # serendipity - another blogger... # Index: serendipity_admin_installer.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_installer.inc.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- serendipity_admin_installer.inc.php 7 Jul 2003 19:29:11 -0000 1.16 +++ serendipity_admin_installer.inc.php 8 Jul 2003 09:13:27 -0000 1.17 @@ -1,4 +1,5 @@ - <?php +<?php # $Id$ + umask(0000); include_once('compat.php'); Index: serendipity_admin_interop.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_interop.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serendipity_admin_interop.inc.php 7 Jul 2003 19:29:11 -0000 1.3 +++ serendipity_admin_interop.inc.php 8 Jul 2003 09:13:27 -0000 1.4 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + include_once 'serendipity_rss_exchange.inc.php'; if (IN_serendipity !== true) die ("Don't hack!"); session_start(); Index: serendipity_admin_overview.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_overview.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serendipity_admin_overview.inc.php 7 Jul 2003 19:29:11 -0000 1.5 +++ serendipity_admin_overview.inc.php 8 Jul 2003 09:13:27 -0000 1.6 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ ########################################################################## # serendipity - another blogger... # Index: serendipity_admin_plugins.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_plugins.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serendipity_admin_plugins.inc.php 7 Jul 2003 19:29:11 -0000 1.5 +++ serendipity_admin_plugins.inc.php 8 Jul 2003 09:13:27 -0000 1.6 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + if (IN_serendipity !== true) die ("Don't hack!"); session_start(); Index: serendipity_admin_templates.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_templates.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serendipity_admin_templates.inc.php 7 Jul 2003 19:29:11 -0000 1.2 +++ serendipity_admin_templates.inc.php 8 Jul 2003 09:13:27 -0000 1.3 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ if (IN_serendipity !== true) die ("Don't hack!"); // A little helper we don't want in _functions.inc.php Index: serendipity_config.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- serendipity_config.inc.php 8 Jul 2003 09:00:16 -0000 1.14 +++ serendipity_config.inc.php 8 Jul 2003 09:13:27 -0000 1.15 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + define('IN_serendipity', true); include_once('compat.php'); ini_set('session.use_trans_sid', 0); Index: serendipity_config_local.tpl =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_config_local.tpl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- serendipity_config_local.tpl 8 Jul 2003 09:00:17 -0000 1.8 +++ serendipity_config_local.tpl 8 Jul 2003 09:13:27 -0000 1.9 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ // Database Settings $serendipity['dbType'] = '{Database type|dbType|string|mysql}'; // Database type (mysql|postgres) Index: serendipity_db.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_db.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serendipity_db.inc.php 8 Jul 2003 09:00:17 -0000 1.4 +++ serendipity_db.inc.php 8 Jul 2003 09:13:27 -0000 1.5 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ include_once("./serendipity_db_{$serendipity['dbType']}.inc.php"); Index: serendipity_db_mysql.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_db_mysql.inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- serendipity_db_mysql.inc.php 7 Jul 2003 19:29:11 -0000 1.7 +++ serendipity_db_mysql.inc.php 8 Jul 2003 09:13:27 -0000 1.8 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ /* Issues a query to the underlying database; * returns: Index: serendipity_db_sqlite.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_db_sqlite.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serendipity_db_sqlite.inc.php 7 Jul 2003 19:29:11 -0000 1.3 +++ serendipity_db_sqlite.inc.php 8 Jul 2003 09:13:27 -0000 1.4 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ function serendipity_db_connect() { Index: serendipity_editor.js =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_editor.js,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serendipity_editor.js 24 May 2003 22:04:22 -0000 1.2 +++ serendipity_editor.js 8 Jul 2003 09:13:27 -0000 1.3 @@ -1,4 +1,5 @@ <!-- // Hide from older browsers +/* $Id$ */ /* Written by chris wetherell Index: serendipity_entries.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_entries.php,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- serendipity_entries.php 7 Jul 2003 19:29:11 -0000 1.11 +++ serendipity_entries.php 8 Jul 2003 09:13:27 -0000 1.12 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + session_start(); if (file_exists("./serendipity_config_local.inc.php")) { include("serendipity_config.inc.php"); Index: serendipity_entries_overview.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_entries_overview.inc.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- serendipity_entries_overview.inc.php 7 Jul 2003 19:29:11 -0000 1.4 +++ serendipity_entries_overview.inc.php 8 Jul 2003 09:13:27 -0000 1.5 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ ########################################################################## # serendipity - another blogger... # Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- serendipity_functions.inc.php 8 Jul 2003 07:49:59 -0000 1.98 +++ serendipity_functions.inc.php 8 Jul 2003 09:13:27 -0000 1.99 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + include_once('./serendipity_db.inc.php'); include_once('./compat.php'); include_once('./serendipity_functions_config.inc.php'); Index: serendipity_genpage.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_genpage.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serendipity_genpage.inc.php 7 Jul 2003 19:29:11 -0000 1.10 +++ serendipity_genpage.inc.php 8 Jul 2003 09:13:27 -0000 1.11 @@ -1,3 +1,4 @@ +<?php # $Id$ ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> Index: serendipity_lang_de.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_de.inc.php,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- serendipity_lang_de.inc.php 7 Jul 2003 19:29:11 -0000 1.12 +++ serendipity_lang_de.inc.php 8 Jul 2003 09:13:27 -0000 1.13 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ ########################################################################## # serendipity - another blogger... # Index: serendipity_lang_en.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_en.inc.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- serendipity_lang_en.inc.php 7 Jul 2003 19:29:11 -0000 1.16 +++ serendipity_lang_en.inc.php 8 Jul 2003 09:13:27 -0000 1.17 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ ########################################################################## # serendipity - another blogger... # Index: serendipity_lang_es.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_es.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serendipity_lang_es.inc.php 7 Jul 2003 19:29:11 -0000 1.2 +++ serendipity_lang_es.inc.php 8 Jul 2003 09:13:27 -0000 1.3 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ ########################################################################## # serendipity - un otro blogger... # Index: serendipity_layout.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_layout.inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- serendipity_layout.inc.php 7 Jul 2003 19:29:11 -0000 1.7 +++ serendipity_layout.inc.php 8 Jul 2003 09:13:27 -0000 1.8 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ ########################################################################## # serendipity - another blogger... # Index: serendipity_layout_table.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_layout_table.inc.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- serendipity_layout_table.inc.php 7 Jul 2003 19:29:11 -0000 1.8 +++ serendipity_layout_table.inc.php 8 Jul 2003 09:13:27 -0000 1.9 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ ########################################################################## # serendipity - another blogger... # Index: serendipity_plugin_api.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_plugin_api.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serendipity_plugin_api.php 7 Jul 2003 19:29:11 -0000 1.3 +++ serendipity_plugin_api.php 8 Jul 2003 09:13:27 -0000 1.4 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + if (IN_serendipity !== true) die ("Don't hack!"); include_once 'serendipity_functions.inc.php'; Index: serendipity_rss_exchange.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_rss_exchange.inc.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serendipity_rss_exchange.inc.php 7 Jul 2003 19:29:11 -0000 1.2 +++ serendipity_rss_exchange.inc.php 8 Jul 2003 09:13:27 -0000 1.3 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + require_once 'bundled-libs/Onyx/RSS.php'; function serendipity_rss_buildEntry($item, &$entry) Index: serendipity_sidebar_items.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_sidebar_items.php,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- serendipity_sidebar_items.php 7 Jul 2003 19:29:11 -0000 1.20 +++ serendipity_sidebar_items.php 8 Jul 2003 09:13:27 -0000 1.21 @@ -1,4 +1,4 @@ -<?php +<?php # $Id$ class serendipity_calendar_plugin extends serendipity_plugin { Index: serendipity_xmlrpc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_xmlrpc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- serendipity_xmlrpc.php 7 Jul 2003 19:29:11 -0000 1.6 +++ serendipity_xmlrpc.php 8 Jul 2003 09:13:27 -0000 1.7 @@ -1,4 +1,5 @@ -<?php +<?php # $Id$ + session_start(); require_once 'serendipity_config.inc.php'; require_once 'bundled-libs/XML/RPC/Server.php'; |
From: <gar...@us...> - 2003-07-08 09:12:55
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv2510 Modified Files: TODO Log Message: Added CVS $Id$ headers Index: TODO =================================================================== RCS file: /cvsroot/php-blog/serendipity/TODO,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TODO 23 May 2003 23:55:50 -0000 1.3 +++ TODO 8 Jul 2003 09:12:52 -0000 1.4 @@ -1,3 +1,5 @@ +# $Id$ + * Split up serendipity_functions.inc.php * Move the library files out of the docroot * Unify the configuration system |