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
(9) |
Nov
|
Dec
|
From: <tom...@us...> - 2003-08-08 22:02:50
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv12321 Modified Files: serendipity_functions.inc.php Log Message: More trackback fixing, should be working now (I hope) Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.118 retrieving revision 1.119 diff -u -d -r1.118 -r1.119 --- serendipity_functions.inc.php 8 Aug 2003 21:28:26 -0000 1.118 +++ serendipity_functions.inc.php 8 Aug 2003 22:02:47 -0000 1.119 @@ -635,7 +635,7 @@ { global $serendipity; - $query = "SELECT * FROM {$serendipity['dbPrefix']}comments WHERE entry_id=$id AND type LIKE 'TRACKBACK' AND title!='' ORDER BY id"; + $query = "SELECT * FROM {$serendipity['dbPrefix']}comments WHERE entry_id=$id AND type = 'TRACKBACK' ORDER BY id"; if (isset($limit)) { $query .= " LIMIT $limit"; } @@ -1230,11 +1230,17 @@ { global $serendipity; - // We can't accept a trackback if we don't get any URl, basic rule... + // We can't accept a trackback if we don't get any URL + // This is a protocol rule. if ( empty($url) ) { return 0; } - + + // If title is not provided, the value for url will be set as the title + // This is a protocol rule. + if ( empty($title) ) { + $title = $url; + } $comment['title'] = $title; $comment['url'] = $url; $comment['name'] = $name; |
From: <tom...@us...> - 2003-08-08 21:28:29
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv7406 Modified Files: serendipity_functions.inc.php Log Message: Fixed MAJOR bug preventing people from identifying a correct trackback URI Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.117 retrieving revision 1.118 diff -u -d -r1.117 -r1.118 --- serendipity_functions.inc.php 8 Aug 2003 20:52:49 -0000 1.117 +++ serendipity_functions.inc.php 8 Aug 2003 21:28:26 -0000 1.118 @@ -534,7 +534,7 @@ rdf:about="<?php echo $serendipity['baseURL']; ?>feeds/ei_<?php echo $entry['id']; ?>.rdf" trackback:ping="<?php echo $serendipity['baseURL']; ?>comment.php?type=trackback&entry_id=<?php echo $entry['id']; ?>" dc:title="<?php echo $entry['title']; ?>" - dc:identifier="<?php echo serendipity_archiveURL($entry['id'], $entry['$title']); ?>" /> + dc:identifier="<?php echo serendipity_archiveURL($entry['id'], $entry['title']); ?>" /> </rdf:RDF> --> |
From: <tom...@us...> - 2003-08-08 21:01:25
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv3396 Modified Files: serendipity_config.inc.php serendipity_admin_overview.inc.php serendipity_lang_en.inc.php Log Message: * Added english as fallback language. * Added display of current s9y version in Administration Suite Index: serendipity_config.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- serendipity_config.inc.php 8 Aug 2003 20:50:50 -0000 1.19 +++ serendipity_config.inc.php 8 Aug 2003 21:01:22 -0000 1.20 @@ -56,8 +56,11 @@ $serendipity['indexFile'] = 'index.php'; } -// Load basic language information +// Load fallback language, english +include_once("{$serendipity['serendipityPath']}/serendipity_lang_en.inc.php"); +// Load chosen language information include_once("{$serendipity['serendipityPath']}/serendipity_lang_{$serendipity['lang']}.inc.php"); + if (serendipity_LANG_LOADED !== true) { include_once 'serendipity_lang.inc.php'; die(sprintf(INCLUDE_ERROR, "serendipity_lang_{$serendipity['lang']}.inc.php")); Index: serendipity_admin_overview.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_overview.inc.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- serendipity_admin_overview.inc.php 5 Aug 2003 14:07:40 -0000 1.7 +++ serendipity_admin_overview.inc.php 8 Aug 2003 21:01:22 -0000 1.8 @@ -13,8 +13,7 @@ die ("Don't hack!"); } -session_start(); echo WELCOME_BACK . ' ' . $_SESSION['serendipityUser'] . '.'; - +echo '<br /><br />'. RUNNING . $serendipity['version']; /* 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.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- serendipity_lang_en.inc.php 5 Aug 2003 14:07:41 -0000 1.24 +++ serendipity_lang_en.inc.php 8 Aug 2003 21:01:22 -0000 1.25 @@ -52,6 +52,7 @@ define('DONE', 'Done'); define('CLICK_IMAGE_TO_INSERT', 'Click the image you want to insert:'); define('WELCOME_BACK', 'Welcome back,'); +define('RUNNING', 'You are running Serendipity v.'); define('ADD_PLUGIN', 'Add plugin'); define('TITLE', 'Title'); define('PLUGIN', 'Plugin'); |
From: <tom...@us...> - 2003-08-08 20:52:53
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv2337 Modified Files: serendipity_functions.inc.php Log Message: Forgot CRLF Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- serendipity_functions.inc.php 8 Aug 2003 20:50:50 -0000 1.116 +++ serendipity_functions.inc.php 8 Aug 2003 20:52:49 -0000 1.117 @@ -1173,7 +1173,7 @@ fwrite($sock, "POST {$target['path']}{$target['query']} HTTP/1.1\r\n"); fwrite($sock, "Host: {$target['host']}\r\n"); - fwrite($sock, "User-Agent: Serendipity/". $serendipity['version']); + fwrite($sock, "User-Agent: Serendipity/{$serendipity['version']}\r\n"); fwrite($sock, "Content-type: application/x-www-form-urlencoded\r\n"); fwrite($sock, "Content-length: " . strlen($data) . "\r\n"); fwrite($sock, "Connection: close\r\n\r\n"); |
From: <tom...@us...> - 2003-08-08 20:50:56
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv1766 Modified Files: serendipity_functions.inc.php serendipity_config.inc.php Log Message: Be cool like MoveableType and send our User-Agent with our trackbacks Also added $serendipitt['version'] (currently: 0.3-cvs) Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- serendipity_functions.inc.php 8 Aug 2003 14:56:36 -0000 1.115 +++ serendipity_functions.inc.php 8 Aug 2003 20:50:50 -0000 1.116 @@ -1156,6 +1156,7 @@ * Send a trackback ping */ function _serendipity_send($loc, $data) { + global $serendipity; $target = parse_url($loc); if ($target['query'] != '') { $target['query'] = '?' . $target['query']; @@ -1172,6 +1173,7 @@ fwrite($sock, "POST {$target['path']}{$target['query']} HTTP/1.1\r\n"); fwrite($sock, "Host: {$target['host']}\r\n"); + fwrite($sock, "User-Agent: Serendipity/". $serendipity['version']); fwrite($sock, "Content-type: application/x-www-form-urlencoded\r\n"); fwrite($sock, "Content-length: " . strlen($data) . "\r\n"); fwrite($sock, "Connection: close\r\n\r\n"); Index: serendipity_config.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_config.inc.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- serendipity_config.inc.php 5 Aug 2003 14:07:40 -0000 1.18 +++ serendipity_config.inc.php 8 Aug 2003 20:50:50 -0000 1.19 @@ -4,11 +4,14 @@ include_once('compat.php'); ini_set('session.use_trans_sid', 0); +$serendipity['version'] = '0.3-cvs'; $serendipity['production'] = 1; + // Rewrite always on $serendipity['rewrite'] = true; -// We need this if people want to upgrade s9y + +// We need this if people want to upgrade s9y if (!isset($serendipity['templatePath'])) { $serendipity['templatePath'] = 'templates/'; } |
From: <tom...@us...> - 2003-08-08 14:56:41
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv6318 Modified Files: serendipity_functions.inc.php Log Message: Now using <div> tags to display comments. This means you have to replace "TD.serendipity_comment" in style.css with ".serendipity_comment" (In older themes) Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- serendipity_functions.inc.php 8 Aug 2003 14:38:42 -0000 1.114 +++ serendipity_functions.inc.php 8 Aug 2003 14:56:36 -0000 1.115 @@ -653,15 +653,10 @@ global $serendipity; ?> -<table width="100%" border="0"> <?php if (!count($comments)) { ?> - <tr> - <td> - <i><?php echo NO_COMMENTS; ?></i> - </td> - </tr> + <div align="center"><?php echo NO_COMMENTS; ?></div> <?php } @@ -676,8 +671,7 @@ $name = empty($comment['author']) ? ANONYMOUS : $comment['author']; $body = htmlentities($comment['body']); ?> - <tr> - <td class="serendipity_comment"> + <div class="serendipity_comment"> <a <?php echo ($serendipity['XHTML11'] ? 'id' : 'name'); ?>="c<?php echo $comment['id']; ?>"></a> <?php echo nl2br(serendipity_markup_text(serendipity_emoticate($body))); ?><br /> @@ -705,13 +699,10 @@ ?> </div> - </td> - </tr> + </div> + <br /> <?php } -?> -</table> -<?php } function serendipity_printTrackbacks($comments) |
From: <tom...@us...> - 2003-08-08 14:38:45
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv3426 Modified Files: serendipity_functions.inc.php Log Message: Fixed b0rked SQL query sorting comments in the wrong direction Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- serendipity_functions.inc.php 8 Aug 2003 10:00:20 -0000 1.113 +++ serendipity_functions.inc.php 8 Aug 2003 14:38:42 -0000 1.114 @@ -614,14 +614,12 @@ e.id AS entryid, c.category_name FROM - ({$serendipity['dbPrefix']}comments co - LEFT JOIN {$serendipity['dbPrefix']}entries e - ON co.entry_id = e.id - LEFT JOIN {$serendipity['dbPrefix']}category c - ON e.categoryid = c.categoryid) + {$serendipity['dbPrefix']}comments co + LEFT JOIN {$serendipity['dbPrefix']}entries e ON (co.entry_id = e.id) + LEFT JOIN {$serendipity['dbPrefix']}category c ON (e.categoryid = c.categoryid) WHERE co.type LIKE 'NORMAL' $and ORDER BY - co.id DESC + co.id $limit"; $comments = serendipity_db_query($query); |
From: <gar...@us...> - 2003-08-08 10:00:28
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv24881 Modified Files: serendipity_admin_image_selector.php serendipity_admin_images.inc.php serendipity_functions.inc.php Log Message: o Fixed a parse error in serendipity_admin_image_selector o Fixed a quote-sign in serendipity_admin_images.inc.php o Exit-Callback Function now also catches links with any tags before the 'href'. '<a class="..." href="...">' did not work before. o Fixed the entry-id-link in the comments RSS-Feed Index: serendipity_admin_image_selector.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_image_selector.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- serendipity_admin_image_selector.php 5 Aug 2003 14:07:40 -0000 1.9 +++ serendipity_admin_image_selector.php 8 Aug 2003 10:00:18 -0000 1.10 @@ -58,7 +58,7 @@ // Display thumbnails ?> <td height="<?php echo $serendipity['thumbSize']; ?>" align="center" valign="middle"> - <a href="?serendipity[step]=1&serendipity[image]="<?php echo $files[$x]; ?>"> + <a href="?serendipity[step]=1&serendipity[image]=<?php echo $files[$x]; ?>"> <img src="<?php echo $imgsrc; ?>" hspace="15" border="0" /> </a> </td> Index: serendipity_admin_images.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_images.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serendipity_admin_images.inc.php 5 Aug 2003 14:07:40 -0000 1.10 +++ serendipity_admin_images.inc.php 8 Aug 2003 10:00:19 -0000 1.11 @@ -125,7 +125,7 @@ if ( @unlink($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file) ) { printf(DELETE_IMAGE . '<br />', $file); } else { - printf(DELETE_IMAGE_FAIL . '<br />' $file); + printf(DELETE_IMAGE_FAIL . '<br />', $file); } if ( @unlink($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $fThumb) ) { Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.112 retrieving revision 1.113 diff -u -d -r1.112 -r1.113 --- serendipity_functions.inc.php 5 Aug 2003 14:07:40 -0000 1.112 +++ serendipity_functions.inc.php 8 Aug 2003 10:00:20 -0000 1.113 @@ -611,6 +611,7 @@ co.*, co.author AS username, e.title, + e.id AS entryid, c.category_name FROM ({$serendipity['dbPrefix']}comments co @@ -857,7 +858,7 @@ if ($version == '0.91' || $version == '2.0' && is_array($entries)) { foreach ($entries as $entry) { - $guid = serendipity_archiveURL($entry['id'], $entry['title']); + $guid = serendipity_archiveURL(($entry['entryid'] != '' ? $entry['entryid'] : $entry['id']), $entry['title']); if ($comments == true) { // Display username as part of the title for easier feed-readability $entry['title'] = $entry['username'] . ': ' . $entry['title']; @@ -1039,7 +1040,7 @@ $serendipity['encodeExitsCallback_entry_id'] = $entry_id; $ret = preg_replace_callback( - "#<a href=(\"|')http://([^\"']+)(\"|')#im", + "#<a(.*)href=(\"|')http://([^\"']+)(\"|')#im", 'serendipity_encodeExitsCallback', $ret ); @@ -1059,11 +1060,12 @@ global $serendipity; $entry_id = $serendipity['encodeExitsCallback_entry_id']; - $url = 'http://' . $buffer[2]; + $url = 'http://' . $buffer[3]; return sprintf( - '<a href="%sexit.php?url=%s%s" title="%s" onMouseOver="window.status=\'%s\';return true;" onMouseOut="window.status=\'\';return true;"', - $serendipity['baseURL'], + '<a%shref="%sexit.php?url=%s%s" title="%s" onMouseOver="window.status=\'%s\';return true;" onMouseOut="window.status=\'\';return true;"', + $buffer[1], + $serendipity['serendipityHTTPPath'], base64_encode($url), ($entry_id != 0) ? '&entry_id=' . $entry_id : '', $url, |
From: <gar...@us...> - 2003-08-05 14:32:38
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv21311 Modified Files: db.sql Log Message: autoincrement can only be used in conjunction with primary key on mysql Index: db.sql =================================================================== RCS file: /cvsroot/php-blog/serendipity/db.sql,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- db.sql 25 Jul 2003 01:03:18 -0000 1.19 +++ db.sql 5 Aug 2003 14:32:35 -0000 1.20 @@ -56,7 +56,7 @@ create table {PREFIX}references ( id {AUTOINCREMENT} {PRIMARY}, - entry_id {AUTOINCREMENT}, + entry_id int(10) {UNSIGNED} not null default '0', link text, name text ); |
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv16268 Modified Files: NEWS rss.php 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_templates.inc.php serendipity_config.inc.php serendipity_functions.inc.php serendipity_lang_de.inc.php serendipity_lang_en.inc.php serendipity_functions_config.inc.php Added Files: serendipity_lang.inc.php Log Message: o Lots of languages moved to defines o Much code style (this were the only files left) o Some XHTML cleanup o NEWS-update o Allow deleting categories (moving articles to another category) o Autodetect language on installation o RSS feeds: added <webMaster>, <managingEditor>, <comments>, <category> and <generator> tag o RSS feed now contains <image> link to pixel/rss_banner.png (if existing), otherwise use pixel/s9y_banner_tiny.png o enjoy the sun. --- NEW FILE: serendipity_lang.inc.php --- <?php # $Id: serendipity_lang.inc.php,v 1.1 2003/08/05 14:07:41 garvinhicking Exp $ // If no config file is loaded, language includes are not available. // Now include one. Try to auto-guess the language by looking up the HTTP_ACCEPT_LANGUAGE. if (serendipity_LANG_LOADED !== true) { $supported_languages = array('en', 'de'); $possible_languages = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); if (is_array($possible_languages)) { foreach($possible_languages AS $index => $lang) { $preferred_language = preg_replace('|^([^\-_]*)|msU', '\1', $lang); if (in_array($preferred_language, $supported_languages)) { include_once('serendipity_lang_' . $preferred_language . '.inc.php'); break; } } } // What the heck does the user accept, then? Forcing english! if (serendipity_LANG_LOADED !== true) { include_once('serendipity_lang_en.inc.php'); } } /* vim: set sts=4 ts=4 expandtab : */ ?> Index: NEWS =================================================================== RCS file: /cvsroot/php-blog/serendipity/NEWS,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- NEWS 29 Jul 2003 19:41:32 -0000 1.6 +++ NEWS 5 Aug 2003 14:07:40 -0000 1.7 @@ -2,6 +2,15 @@ Version 0.3 () ------------------------------------ + * Allow deleting categories (moving articles to another category) (garvinhicking) + * Autodetect language on installation (garvinhicking) + * RSS feeds properly utf8encoded, added <webMaster>,<managingEditor>,<comments>,<category> and <generator> tag (garvinhicking) + * RSS feed now contains <image> link to pixel/rss_banner.png (if existing), otherwise use pixel/s9y_banner_tiny.png (garvinhicking) + * External Plugin for hotword/acronym replacements, as well as any other content-rewriting plugin (garvinhicking) + * Allow embeding of serendipity in your custom homepage (wrapFile directive - see http://blog.supergarv.de/ for example) (garvinhicking) + * Plugins: Show updated values after submit, remove config entries when a plugin is removed (garvinhicking) + * Added an RSS-feed for comments to entries only (garvinhicking) + * Fixed archives to not properly show entries from the first/last day of a month (garvinhicking) * Fixed the database by separating primary key from {AUTOINCREMENT} (jtate) * Rewrote installer (tomsommer) * Added support for postgres (jtate) Index: rss.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/rss.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- rss.php 2 Aug 2003 15:14:19 -0000 1.8 +++ rss.php 5 Aug 2003 14:07:40 -0000 1.9 @@ -30,6 +30,29 @@ $title = utf8_encode($title); $description = utf8_encode($description); +if (file_exists($serendipity['serendipityPath'] . 'pixel/rss_banner.png')) { + $i = getimagesize($serendipity['serendipityPath'] . 'pixel/rss_banner.png'); + $image = <<<IMAGE +<image> + <url>{$serendipity['baseURL']}pixel/rss_banner.png</url> + <title>RSS: $title - $description</title> + <link>{$serendipity['baseURL']}</link> + <width>{$i[0]}</width> + <height>{$i[1]}</height> +</image> +IMAGE; +} else { + $image = <<<IMAGE +<image> + <url>{$serendipity['baseURL']}pixel/s9y_banner_tiny.png</url> + <title>RSS: $title - $description</title> + <link>{$serendipity['baseURL']}</link> + <width>100</width> + <height>21</height> +</image> +IMAGE; +} + echo '<?xml version="1.0" encoding="utf-8" ?>'; echo "\n"; switch ($version) { @@ -41,6 +64,8 @@ <title>$title</title> <link>{$serendipity['baseURL']}</link> <description>$description</description> +<language>{$serendipity['CONFIG']['lang']}</language> +$image HEAD; break; @@ -54,11 +79,16 @@ xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:robot="http://www.edwardbear.org/def/xml/robot"> <channel> -<title>$title</title> -<link>{$serendipity['baseURL']}</link> -<description>$description</description> -<dc:language>{$serendipity['lang']}</dc:language> + <title>$title</title> + <link>{$serendipity['baseURL']}</link> + <description>$description</description> + <dc:language>{$serendipity['lang']}</dc:language> + <admin:errorReportsTo rdf:resource="mailto:{$serendipity['CONFIG']['email']}" /> + <webMaster>{$serendipity['CONFIG']['email']}</webMaster> + <managingEditor>{$serendipity['CONFIG']['email']}</managingEditor> + <generator>Serendipity - http://www.s9y.org/</generator> + $image HEAD; break; default: Index: serendipity_admin.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- serendipity_admin.php 16 Jul 2003 11:58:24 -0000 1.16 +++ serendipity_admin.php 5 Aug 2003 14:07:40 -0000 1.17 @@ -5,6 +5,9 @@ if (file_exists('./serendipity_config_local.inc.php')) { include('serendipity_config.inc.php'); } else { + // If no config file is loaded, language includes are not available. + // Now include one. Try to auto-guess the language by looking up the HTTP_ACCEPT_LANGUAGE. + include_once 'serendipity_lang.inc.php'; $_SESSION['serendipityAuthedUser'] = true; } Index: serendipity_admin_category.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_category.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serendipity_admin_category.inc.php 8 Jul 2003 09:13:27 -0000 1.5 +++ serendipity_admin_category.inc.php 5 Aug 2003 14:07:40 -0000 1.6 @@ -1,84 +1,113 @@ <?php # $Id$ -if (IN_serendipity !== true) die ("Don't hack!"); +if (IN_serendipity !== true) { + die ("Don't hack!"); +} session_start(); $cat_to_edit = (int)$_GET['serendipity']['cat']['catid']; -$msg = ""; +$msg = ''; if (isset($_POST['SAVE'])) { - $name = addslashes($_POST['serendipity']['cat']['name']); - $desc = addslashes($_POST['serendipity']['cat']['description']); - if ($cat_to_edit == 0) { - $query = "INSERT INTO $serendipity[dbPrefix]category (category_name, category_description, authorid) values ('$name', '$desc', $_SESSION[serendipityAuthorid])"; - } else { - $query = "UPDATE $serendipity[dbPrefix]category SET category_name='$name', category_description='$desc' where categoryid=$cat_to_edit"; - } - - $r = serendipity_db_query($query); - if (is_string($r)) { - $msg = $r; - } else { - $msg = "Category Saved"; - } + $name = addslashes($_POST['serendipity']['cat']['name']); + $desc = addslashes($_POST['serendipity']['cat']['description']); + if ($cat_to_edit == 0) { + $query = "INSERT INTO {$serendipity['dbPrefix']}category (category_name, category_description, authorid) values ('$name', '$desc', {$_SESSION['serendipityAuthorid']})"; + } else { + $query = "UPDATE {$serendipity['dbPrefix']}category SET category_name='$name', category_description='$desc' where categoryid=$cat_to_edit"; + } + + $r = serendipity_db_query($query); + if (is_string($r)) { + $msg = $r; + } else { + $msg = CATEGORY_SAVED; + } +} elseif (isset($_POST['REMOVE'])) { + if ($cat_to_edit != 0) { + $remaining_cat = (int)$_POST['serendipity']['cat']['remaining_catid']; + serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}category WHERE categoryid=$cat_to_edit"); + serendipity_db_query("UPDATE {$serendipity['dbPrefix']}entries SET categoryid=$remaining_cat WHERE categoryid=$cat_to_edit"); + $msg = sprintf(CATEGORY_DELETED, $cat_to_edit, $remaining_cat); + } else { + $msg = INVALID_CATEGORY; + } + + $cat_to_edit = 0; } $cats = serendipity_fetchCategories(); -if ($cat_to_edit > 0 && count($cats)) { - foreach ($cats as $cat_data) { - if ($cat_data['categoryid'] == $cat_to_edit) { - $this_cat = $cat_data; - break; - } - } +$existing_cats_table = ''; +$existing_cats_dropdown = '<select name="serendipity[cat][remaining_catid]">' . "\n"; +if (count($cats)) { + foreach ($cats as $cat_data) { + if ($cat_to_edit > 0 && $cat_data['categoryid'] == $cat_to_edit && !isset($this_cat)) { + $this_cat = $cat_data; + } elseif ($cat_to_edit > 0) { + $existing_cats_dropdown .= '<option value="' . $cat_data['categoryid'] . '">' . htmlentities($cat_data['category_name']) . '</option>' . "\n"; + } + + $name = htmlentities($cat_data['category_name']); + $desc = htmlentities($cat_data['category_description']); + $existing_cats_table .= <<<CAT + <tr> + <td> + • <a href="?serendipity[adminModule]=category&serendipity[cat][catid]={$cat_data['categoryid']}">$name - $desc</a> + </td> + </tr> +CAT; + } } - +$existing_cats_dropdown .= '</select>'; ?> -<font color="red"><?php echo $msg ; ?></font> +<div style="color: red"><?php echo $msg ; ?></div> + <form method="POST" name="serendipityCategory"> <?php if ($cat_to_edit == 0) { - $desc = CREATE_NEW_CAT; - $save = CREATE; + $desc = CREATE_NEW_CAT; + $save = CREATE; + $remove = ''; } else { - $desc = htmlentities(sprintf(EDIT_THIS_CAT, $this_cat[category_name], $this_cat[category_description])); - $save = SAVE; + $desc = htmlentities(sprintf(EDIT_THIS_CAT, $this_cat['category_name'], $this_cat['category_description'])); + $save = SAVE; + $remove = str_repeat(' ', 10) . '<input type="submit" name="REMOVE" value="' . DELETE . '"> <b>>></b> ' . sprintf(CATEGORY_REMAINING, $existing_cats_dropdown); } ?> -<b><?php echo $desc ; ?></b> + +<b><?php echo $desc; ?></b> <table cellpadding="5"> -<tr> -<th><?php echo NAME; ?></th> -<td><input type="text" name="serendipity[cat][name]" value="<?php echo htmlentities($this_cat['category_name']) ; ?>" /></td> -</tr> + <tr> + <th><?php echo NAME; ?></th> + <td><input type="text" name="serendipity[cat][name]" value="<?php echo htmlentities($this_cat['category_name']); ?>" /></td> + </tr> -<tr> -<th><?php echo DESCRIPTION; ?></th> -<td><input type="text" name="serendipity[cat][description]" value="<?php echo htmlentities($this_cat['category_description']) ; ?>"/></td> -</tr> + <tr> + <th><?php echo DESCRIPTION; ?></th> + <td><input type="text" name="serendipity[cat][description]" value="<?php echo htmlentities($this_cat['category_description']); ?>" /></td> + </tr> </table> -<input type="submit" name="SAVE" value="<?php echo $save ; ?>"> + +<div> + <input type="submit" name="SAVE" value="<?php echo $save; ?>"/> + <?php echo $remove; ?> +</div> <br /> <br /> <b><?php echo CLICK_CAT_TO_EDIT; ?></b> <table> -<?php -if (is_array($cats)) { - foreach ($cats as $cat_data) { - $name = htmlentities($cat_data['category_name']); - $desc = htmlentities($cat_data['category_description']); - echo "<tr><td>• <a href=\"?serendipity[adminModule]=category&serendipity[cat][catid]=$cat_data[categoryid]\">$name - $desc</a></td></tr>\n"; - } -} -?> -<tr><td>• <a href="?serendipity[adminModule]=category&serendipity[cat][catid]=0"><?php echo CREATE_NEW_CAT; ?></a></td></tr> +<?php echo $existing_cats_table; ?> + <tr> + <td> + • <a href="?serendipity[adminModule]=category&serendipity[cat][catid]=0"><?php echo CREATE_NEW_CAT; ?></a> + </td> + </tr> </table> - </form> <?php /* vim: set sts=4 ts=4 expandtab : */ Index: serendipity_admin_css.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_css.inc.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- serendipity_admin_css.inc.php 8 Jul 2003 09:13:27 -0000 1.3 +++ serendipity_admin_css.inc.php 5 Aug 2003 14:07:40 -0000 1.4 @@ -1,73 +1,77 @@ <?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!"); +if (IN_serendipity !== true) { + die ("Don't hack!"); +} -// A little helper we don't want in _functions.inc.php -switch($serendipity["GET"]["adminAction"]) { +switch($serendipity['GET']['adminAction']) { + case 'save': + $entry = array( + 'cssid' => $serendipity['POST']['cssid'], + 'name' => $serendipity['POST']['name'], + 'data' => $serendipity['POST']['data'] + ); - case "save": - $entry = array("cssid" => $serendipity["POST"]["cssid"], - "name"=>$serendipity["POST"]["name"], - "data" =>$serendipity["POST"]["data"]); $res = serendipity_updateCSS($entry); - if (is_string($res)) + + if (is_string($res)) { serendipity_printCSSForm("?", "edit", array("serendipity[action]" => "admin", "serendipity[adminModule]" => "css", "serendipity[adminAction]" => "save"), $entry, "Error: <b>$res</b>"); - else + } else { serendipity_printCSSForm("?", "edit", array("serendipity[action]" => "admin", "serendipity[adminModule]" => "css", "serendipity[adminAction]" => "save"), $entry); - break; + } + break; - case "edit": - serendipity_printCSSForm("?", "edit", array("serendipity[action]" => "admin", "serendipity[adminModule]" => "css", + case 'edit': + serendipity_printCSSForm("?", "edit", array("serendipity[action]" => "admin", "serendipity[adminModule]" => "css", "serendipity[adminAction]" => "save"), $entry); - break; + break; default: + if (isset($_POST['NEW'])) { + serendipity_printCSSForm("?", "edit", + array( + "serendipity[action]" => "admin", + "serendipity[adminModule]" => "css", + "serendipity[adminAction]" => "save" + ), + array( + "cssid" => 0, + "name" => "New", + "data" => file_get_contents("serendipity.css") + ) + ); + } else if (isset($_POST['EDIT'])) { + serendipity_printCSSForm("?", "edit", + array( + "serendipity[action]" => "admin", + "serendipity[adminModule]" => "css", + "serendipity[adminAction]" => "save" + ), + $_POST['serendipity']['cssid'] + ); - if (isset($_POST['NEW'])) { - serendipity_printCSSForm("?", "edit", - array( - "serendipity[action]" => "admin", - "serendipity[adminModule]" => "css", - "serendipity[adminAction]" => "save" - ), - array( - "cssid" => 0, - "name" => "New", - "data" => file_get_contents("serendipity.css") - ) - ); - } else if (isset($_POST['EDIT'])) { - serendipity_printCSSForm("?", "edit", - array( - "serendipity[action]" => "admin", - "serendipity[adminModule]" => "css", - "serendipity[adminAction]" => "save" - ), - $_POST['serendipity']['cssid'] - ); - - } else if (isset($_POST['DEFAULT'])) { - $css = serendipity_getCSS($_POST['serendipity']['cssid']); - serendipity_set_config_var("default_css", $css['name']); - } else if (isset($_POST['DELETE'])) { - if (is_numeric($_POST['serendipity']['cssid'])) { - $id = serendipity_db_escape_string($_POST['serendipity']['cssid']); - serendipity_db_query("delete from $serendipity[dbPrefix]css where cssid='$id'"); - } - serendipity_printCSSForm("?", "choose", array("serendipity[action]" => "admin", "serendipity[adminModule]" => "css"), $entry); - } else { + } else if (isset($_POST['DEFAULT'])) { + $css = serendipity_getCSS($_POST['serendipity']['cssid']); + serendipity_set_config_var("default_css", $css['name']); + } else if (isset($_POST['DELETE'])) { + if (is_numeric($_POST['serendipity']['cssid'])) { + $id = serendipity_db_escape_string($_POST['serendipity']['cssid']); + serendipity_db_query("delete from $serendipity[dbPrefix]css where cssid='$id'"); + } + serendipity_printCSSForm("?", "choose", array("serendipity[action]" => "admin", "serendipity[adminModule]" => "css"), $entry); + } else { - serendipity_printCSSForm("?", "choose", array("serendipity[action]" => "admin", "serendipity[adminModule]" => "css"), $entry); - } + serendipity_printCSSForm("?", "choose", array("serendipity[action]" => "admin", "serendipity[adminModule]" => "css"), $entry); + } break; } /* vim: set sts=4 ts=4 expandtab : */ Index: serendipity_admin_entries.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_entries.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serendipity_admin_entries.inc.php 8 Jul 2003 09:13:27 -0000 1.5 +++ serendipity_admin_entries.inc.php 5 Aug 2003 14:07:40 -0000 1.6 @@ -1,132 +1,186 @@ <?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!"); +if (IN_serendipity !== true) { + die ("Don't hack!"); +} // A little helper we don't want in _functions.inc.php function serendipity_drawList($action) { - global $serendipity; - - // Prepare variables - if (!is_numeric($serendipity["GET"]["offset"])) $serendipity["GET"]["offset"] = 0; - $perPage = 30; - - // Fetch the entries - $entries = serendipity_fetchEntries(false, false, serendipity_db_limit($serendipity["GET"]["offset"], $perPage)); - - // Prepare table - echo "<div class='serendipity_admin_list'>"; - echo "<div class='serendipity_admin_list_title'>".ucfirst($action)." Entries:</div>"; - echo "<table width='100%' class='serendipity_admin_list'>"; + global $serendipity; - if ( is_array($entries) ) { - $half = (int) ((count($entries) + 1)/2); - - // Print the browse buttons - echo "<tr><td align='left'>"; - if ($serendipity["GET"]["offset"] > 0) { - echo '<input type="button" value="<<<" onClick="location.href=\'?serendipity[adminModule]=entries&serendipity[adminAction]='.$serendipity["GET"]["adminAction"].'&serendipity[offset]='.max(0,($serendipity["GET"]["offset"]-$perPage)).'\';">'; - } - echo "</td><td align='right'>"; - if (count($entries) == $perPage) { - echo '<input type="button" value=">>>" onClick="location.href=\'?serendipity[adminModule]=entries&serendipity[adminAction]='.$serendipity["GET"]["adminAction"].'&serendipity[offset]='.($serendipity["GET"]["offset"]+$perPage).'\';">'; - } - echo "</td></tr>"; - // Print the entries - $count = count($entries); - for ($x=0; $x<$half; $x++) { - ?> - <tr> - <td class="serendipity_admin_list_item"> - <?php echo date("d.m.y, H:i", $entries[$x]["timestamp"]).": " ; ?> - <br><a href='?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=<?php echo $action ; ?>&serendipity[id]=<?php echo $entries[$x]["id"] ; ?>'> - <?php echo htmlentities(substr(empty($entries[$x]["title"]) ? $entries[$x]['body'] : $entries[$x]['title'],0,40)); ?></a> - </a> - </td> - <td class="serendipity_admin_list_item"> - <?php if ($x + $half < $count) { ?> - <?php echo date("d.m.y, H:i", $entries[$x+$half]["timestamp"]).": "; ?> - <br><a href='?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=<?php echo $action ; ?>&serendipity[id]=<?php echo $entries[$x+$half]["id"] ; ?>'> - <?php echo htmlentities(substr($entries[$x+$half]["title"],0,40)) ; ?></a> - </a> - <?php - } + // Prepare variables + if (!is_numeric($serendipity['GET']['offset'])) { + $serendipity['GET']['offset'] = 0; } - } - else { - //We've got nothing - ?> - <tr><td class="serendipity_admin_list_item" colspan="2"> - <?php echo NO_ENTRIES_TO_PRINT ?></td></tr> - <?php - } + + $perPage = 30; + + // Fetch the entries + $entries = serendipity_fetchEntries( + false, + false, + serendipity_db_limit( + $serendipity['GET']['offset'], + $perPage + ) + ); + $string_action = ($action == 'delete' ? DELETE_ENTRIES : EDIT_ENTRIES); + + // Prepare table ?> - </td> +<div class="serendipity_admin_list"> + <div class="serendipity_admin_list_title"><?php echo $string_action; ?>:</div> + + <table width="100%" class="serendipity_admin_list"> +<?php + if (is_array($entries)) { + $half = (int) ((count($entries) + 1)/2); + + // Print the browse buttons +?> + <tr> + <td> +<?php + if ($serendipity['GET']['offset'] > 0) { +?> + <input type="button" value="<<<" onClick="location.href='?serendipity[adminModule]=entries&serendipity[adminAction]=<?php echo $serendipity['GET']['adminAction']; ?>&serendipity[offset]=<?php echo max(0, ($serendipity['GET']['offset'] - $perPage)); ?>';" /> +<?php + } +?> + </td> + + <td align="right"> +<?php + if (count($entries) == $perPage) { +?> + <input type="button" value=">>>" onClick="location.href='?serendipity[adminModule]=entries&serendipity[adminAction]=<?php echo $serendipity['GET']['adminAction']; ?>&serendipity[offset]=<?php echo $serendipity['GET']['offset'] + $perPage; ?>';" /> +<?php + } +?> + </td> </tr> -<?php - echo "</table></div>"; +<?php + // Print the entries + $count = count($entries); + for ($x=0; $x < $half; $x++) { +?> + <tr> + <td class="serendipity_admin_list_item"> + <?php echo date('d.m.y, H:i', $entries[$x]['timestamp']) . ': '; ?> + <br /> + <a href="?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=<?php echo $action; ?>&serendipity[id]=<?php echo $entries[$x]['id']; ?>"> + <?php echo htmlentities(substr(empty($entries[$x]['title']) ? $entries[$x]['body'] : $entries[$x]['title'], 0, 40)); ?> + </a> + </td> + + <td class="serendipity_admin_list_item"> +<?php + if ($x + $half < $count) { +?> + <?php echo date('d.m.y, H:i', $entries[$x + $half]['timestamp']) . ': '; ?> + <br /> + <a href="?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=<?php echo $action; ?>&serendipity[id]=<?php echo $entries[$x + $half]['id']; ?>"> + <?php echo htmlentities(substr($entries[$x + $half]['title'], 0, 40)); ?> + </a> +<?php + } +?> + </td> + </tr> +<?php + } + } else { + // We've got nothing +?> + <tr> + <td class="serendipity_admin_list_item" colspan="2"> + <?php echo NO_ENTRIES_TO_PRINT ?> + </td> + </tr> +<?php + } +?> + </table> +</div> +<?php } +switch($serendipity['GET']['adminAction']) { + case 'save': + $entry = array( + 'id' => $serendipity['POST']['id'], + 'title' => $serendipity['POST']['title'], + 'timestamp' => $serendipity['POST']['timestamp'], + 'body' => $serendipity['POST']['body'], + 'extended' => $serendipity['POST']['extended'], + 'categoryid' => $serendipity['POST']['categoryid'] + ); -switch($serendipity["GET"]["adminAction"]) { - - case "save": - $entry = array("id" => $serendipity["POST"]["id"], - "title"=>$serendipity["POST"]["title"], - "timestamp" => $serendipity["POST"]["timestamp"], - "body" =>$serendipity["POST"]["body"], - "extended" => $serendipity["POST"]["extended"], - "categoryid" => $serendipity['POST']['categoryid'] - ); - $res = serendipity_updertEntry($entry); - if (is_string($res)) - serendipity_printEntryForm("?", array("serendipity[action]" => "admin", "serendipity[adminModule]" => "entries", - "serendipity[adminAction]" => "save"), $entry, "Error: <b>$res</b>"); - else - echo "Entry saved."; - break; - - case "edit": - $entry = serendipity_fetchEntry("id", $serendipity["GET"]["id"]); - - serendipity_printEntryForm("?", array("serendipity[action]" => "admin", "serendipity[adminModule]" => "entries", - "serendipity[adminAction]" => "save"), $entry); - break; + $res = serendipity_updertEntry($entry); + + if (is_string($res)) { + serendipity_printEntryForm( + '?', + array( + 'serendipity[action]' => 'admin', + 'serendipity[adminModule]' => 'entries', + 'serendipity[adminAction]' => 'save' + ), + $entry, + ERROR . ': <b>' . $res . '</b>'); + } else { + echo ENTRY_SAVED; + } + break; - case "editSelect": - serendipity_drawList("edit"); - break; + case 'editSelect': + serendipity_drawList('edit'); + break; - case "deleteSelect": - serendipity_drawList("delete"); - break; + case 'deleteSelect': + serendipity_drawList('delete'); + break; - case "delete": - echo "Are you sure you want to delete #".$serendipity["GET"]["id"]." permanently?<br>"; - echo "<input type='button' value='Not really...' onClick='history.go(-1);'>"; - echo str_repeat(" ", 10); - $newLoc = "?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=doDelete&serendipity[id]=" - .$serendipity["GET"]["id"]; - echo "<input type='button' value='Dump it!' onClick='location.href=\"$newLoc\"'>"; - break; + case 'delete': + $newLoc = '?serendipity[action]=admin&serendipity[adminModule]=entries&serendipity[adminAction]=doDelete&serendipity[id]=' . $serendipity['GET']['id']; + printf(DELETE_SURE, $serendipity['GET']['id']); +?> +<br /> +<div> + <input type="button" value="<?php echo NOT_REALLY; ?>" onClick="history.go(-1);" /> + <span style="width: 50px;"></span> + <input type="button" value="<?php echo DUMP_IT; ?>" onClick="location.href='<?php echo $newLoc; ?>'" /> +</div> +<?php + break; - case "doDelete": - serendipity_deleteEntry($serendipity["GET"]["id"]); - echo "R.I.P entry #".$serendipity["GET"]["id"]; - break; + case 'doDelete': + serendipity_deleteEntry($serendipity['GET']['id']); + printf(RIP_ENTRY, $serendipity['GET']['id']); + break; - default: - serendipity_printEntryForm("?", array("serendipity[action]" => "admin", "serendipity[adminModule]" => "entries", - "serendipity[adminAction]" => "save"), $entry); + case 'edit': + $entry = serendipity_fetchEntry('id', $serendipity['GET']['id']); + default: + serendipity_printEntryForm( + '?', + array( + 'serendipity[action]' => 'admin', + 'serendipity[adminModule]' => 'entries', + 'serendipity[adminAction]' => 'save' + ), + $entry + ); } /* vim: set sts=4 ts=4 expandtab : */ ?> Index: serendipity_admin_image_selector.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_image_selector.php,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- serendipity_admin_image_selector.php 8 Jul 2003 13:51:19 -0000 1.8 +++ serendipity_admin_image_selector.php 5 Aug 2003 14:07:40 -0000 1.9 @@ -1,110 +1,169 @@ <?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 # # # ########################################################################## + session_start(); -include("serendipity_config.inc.php"); +include('serendipity_config.inc.php'); -if (IN_serendipity !== true) die ("Don't hack!"); +if (IN_serendipity !== true) { + die ("Don't hack!"); +} -if ($_SESSION["serendipityAuthedUser"] !== true) die("Log in..."); +if ($_SESSION['serendipityAuthedUser'] !== true) { + die(HAVE_TO_BE_LOGGED_ON); +} function serendipity_displayImageList($start = 0, $end = 20) { - global $serendipity; - + global $serendipity; serendipity_fetchImages(true); - $inc = $end - $start; - $files = array_slice($serendipity["imageList"], $start, $inc); + $inc = $end - $start; + $files = array_slice($serendipity['imageList'], $start, $inc); if ($start > 0) { - $left = "<input type='button' value='<<<' onClick=\"location.href='?serendipity[start]=" . max(0, $start - $inc) . "&serendipity[end]=$start';\">\n"; + $left = '<input type="button" value="<<<" onClick="location.href=\'?serendipity[start]=' . max(0, $start - $inc) . '&serendipity[end]=' . $start . '\';">' . "\n"; } if (count($serendipity["imageList"]) > $end) { - $right = "<input type='button' value='>>>' onClick=\"location.href='?serendipity[start]=$end&serendipity[end]=" . ($end + $inc) . "'\">\n"; + $right = '<input type="button" value=">>>" onClick="location.href=\'?serendipity[start]=' . $end . '&serendipity[end]=' . ($end + $inc) . '\';">' . "\n"; } - $lineBreak = floor(750/($serendipity["thumbSize"]+20)); - echo "<table border='0'>"; - echo "<tr><td align='left' colspan='".floor($lineBreak/2)."'>$left</td><td align='right' colspan='".ceil($lineBreak/2)."'>$right</td></tr><tr>"; + $lineBreak = floor(750 / ($serendipity['thumbSize'] + 20)); +?> +<table border="0"> + <tr> + <td align="left" colspan="<?php echo floor($linebreak/2); ?>"> + <?php echo $left; ?> + </td> + + <td align="right" colspan="<?php echo ceil($linebreak/2); ?>"> + <?php echo $right; ?> + </td> + </tr> + + <tr> +<?php for ($x=0; $x<count($files); $x++) { - - // Parse filename and image info - $f = serendipity_parseFileName($files[$x]); - $i = getimagesize($serendipity["serendipityPath"].$serendipity["uploadPath"]."/".$files[$x]); - + // Parse filename and image info + $f = serendipity_parseFileName($files[$x]); + $i = getimagesize($serendipity['serendipityPath'] . $serendipity['uploadPath'] . '/' . $files[$x]); + $imgsrc = $serendipity['uploadHTTPPath'] . $f[0] . '.' . $serendipity['thumbSuffix'] . '.' . $f[1]; // Display thumbnails - echo "<td height='".$serendipity["thumbSize"]."' align='center' valign='middle'>"; - echo "<a href='?serendipity[step]=1&serendipity[image]=".$files[$x]."'>"; - echo "<img src='".$serendipity["uploadHTTPPath"].$f[0].".".$serendipity["thumbSuffix"].".".$f[1]."' hspace='15' border='0'>"; - echo "</a>"; - echo "</td>"; - +?> + <td height="<?php echo $serendipity['thumbSize']; ?>" align="center" valign="middle"> + <a href="?serendipity[step]=1&serendipity[image]="<?php echo $files[$x]; ?>"> + <img src="<?php echo $imgsrc; ?>" hspace="15" border="0" /> + </a> + </td> +<?php // Newline? - if (($x+1)%$lineBreak == 0) echo "</tr><tr>"; + if (($x+1)%$lineBreak == 0) { +?> + </tr> + <tr> +<?php + } } - echo "</tr><tr><td align='left' colspan='".floor($lineBreak/2)."'>$left</td><td align='right' colspan='".ceil($lineBreak/2)."'>$right</td></tr>"; - echo "</table>"; +?> + </tr> + <tr> + <td align="left" colspan="<?php echo floor($linebreak/2); ?>"> + <?php echo $left; ?> + </td> + + <td align="right" colspan="<?php echo ceil($linebreak/2); ?>"> + <?php echo $right; ?> + </td> + </tr> +</table> +<?php +} -}?> +?> <html> - <head> - <title><?php echo SELECT_IMAGE; ?></title> - <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php"> - </head> + <head> + <title><?php echo SELECT_IMAGE; ?></title> + <link rel="stylesheet" type="text/css" href="<?php echo $serendipity['serendipityHTTPPath']; ?>serendipity.css.php"> + </head> <body> + <?php +switch ($serendipity['GET']['step']) { + case '1': + $f = serendipity_parseFileName($serendipity["GET"]["image"]); + $imgsrc = $serendipity['serendipityHTTPPath'] . $serendipity['uploadPath'] . $f[0] . '.' . $serendipity['thumbSuffix'] . '.' . $f[1]; + $imgName = $serendipity['serendipityHTTPPath'] . $serendipity['uploadHTTPPath'] . $serendipity['GET']['image']; + $thumbName = $serendipity['serendipityHTTPPath'] . $serendipity['uploadHTTPPath'] . $f[0] . '.' . $serendipity['thumbSuffix'] . '.' . $f[1]; +?> +<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> -switch ($serendipity["GET"]["step"]) { +<div> + <img align="right" src="<?php echo $imgsrc; ?>"> + <h1><?php printf(YOU_CHOSE, $serendipity['GET']['image']); ?></h1> + <p> + <form action="#" method="GET" name="serendipity[selForm]" onSubmit="serendipity_imageSelector_done()"> + <div> + <input type="hidden" name="imgName" value="<?php echo $imgName; ?>" /> + <input type="hidden" name="thumbName" value="<?php echo $thumbName; ?>" /> - case "1": - ?> - <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]."'>"; - echo "<h1>".sprintf(YOU_CHOSE,$serendipity["GET"]["image"])."</h1><p>"; - echo "<form action='#' method='GET' name='serendipity[selForm]' onSubmit='serendipity_imageSelector_done()'>"; - echo "<input type='hidden' name='imgName' value='".$serendipity["serendipityHTTPPath"] . $serendipity["uploadHTTPPath"].$serendipity["GET"]["image"]."'>"; - echo "<input type='hidden' name='thumbName' value='".$serendipity["serendipityHTTPPath"] . $serendipity["uploadHTTPPath"].$f[0].".".$serendipity["thumbSuffix"].".".$f[1]."'>"; + <b><?php echo IMAGE_SIZE; ?>:</b> + <br /> + <input type="radio" name="serendipity[linkThumbnail]" value="no" checked="checked" /><?php echo I_WANT_THUMB; ?><br /> + <input type="radio" name="serendipity[linkThumbnail]" value="yes" /><?php echo I_WANT_BIG_IMAGE; ?><br /> + <br /> - echo "<b>".IMAGE_SIZE.":</b><br>"; - echo "<input type='radio' name='serendipity[linkThumbnail]' value='no' CHECKED>".I_WANT_THUMB."<br>"; - echo "<input type='radio' name='serendipity[linkThumbnail]' value='yes'>".I_WANT_BIG_IMAGE."<p>"; + <b><?php echo IMAGE_ALIGNMENT; ?>:</b> + <br /> + <input type="radio" name="serendipity[align]" value="" /> <img src="<?php echo $serendipity['serendipityHTTPPath']; ?>pixel/img_align_top.png" vspace="5"><br /> + <input type="radio" name="serendipity[align]" value="left" checked="checked" /> <img src="<?php echo $serendipity['serendipityHTTPPath']; ?>pixel/img_align_left.png" vspace="5"><br /> + <input type="radio" name="serendipity[align]" value="right" /> <img src="<?php echo $serendipity['serendipityHTTPPath']; ?>pixel/img_align_right.png" vspace="5"><br /> + <br /> - echo "<b>Image alignment:</b><br>"; - echo "<input type='radio' name='serendipity[align]' value=''> <img src='".$serendipity["serendipityHTTPPath"]."pixel/img_align_top.png' vspace='5'><br>"; - echo "<input type='radio' name='serendipity[align]' value='left' CHECKED> <img src='".$serendipity["serendipityHTTPPath"]."pixel/img_align_left.png' vspace='5'><br>"; - echo "<input type='radio' name='serendipity[align]' value='right'> <img src='".$serendipity["serendipityHTTPPath"]."pixel/img_align_right.png' vspace='5'><p>"; + <b><?php echo IMAGE_AS_A_LINK; ?>:</b> + <br /> + <input type="radio" name="serendipity[isLink]" checked="checked" /> <?php echo I_WANT_NO_LINK; ?><br /> + <input type="radio" name="serendipity[isLink]" /> <?php echo I_WANT_IT_TO_LINK; ?> + <input type="text" name="serendipity[url]" size="30" value="<?php echo $serendipity['serendipityHTTPPath'] . $serendipity['uploadPath'] . $serendipity['GET']['image']; ?>" onfocus="value='';" /><br /> + <br /> - echo "<b>".IMAGE_AS_A_LINK.":</b><br>"; - echo "<input type='radio' name='serendipity[isLink]' CHECKED> ".I_WANT_NO_LINK."<br>"; - echo "<input type='radio' name='serendipity[isLink]' > ".I_WANT_IT_TO_LINK; - echo "<input type='text' name='serendipity[url]' size='30' value='".$serendipity["serendipityHTTPPath"].$serendipity["uploadPath"].$serendipity["GET"]["image"]."' onFocus='value=\"\";'><p>"; - echo "<input type='button' value='".BACK."' onClick='history.go(-1);'> "; - echo "<input type='button' value='".DONE."' onClick='serendipity_imageSelector_done()'>"; - echo "</form>"; + <input type="button" value="<?php echo BACK; ?>" onClick="history.go(-1);" /> + <input type="button" value="<?php echo DONE; ?>" onClick="serendipity_imageSelector_done()" /> + </div> + </form> + </p> +<?php break; - default: - echo "<b>Select an image:</b><p>"; - if (!is_numeric($serendipity["GET"]["start"])) $serendipity["GET"]["start"] = 0; - if (!is_numeric($serendipity["GET"]["end"])) - $serendipity["GET"]["end"] = $serendipity["GET"]["start"]+ - floor(750/($serendipity["thumbSize"]+20))*floor(580/($serendipity["thumbSize"]+20)); - echo CLICK_IMAGE_TO_INSERT."<br>"; - serendipity_displayImageList($serendipity["GET"]["start"], $serendipity["GET"]["end"]); + default: + if (!is_numeric($serendipity['GET']['start'])) { + $serendipity['GET']['start'] = 0; + } + + if (!is_numeric($serendipity['GET']['end'])) { + $serendipity['GET']['end'] = $serendipity['GET']['start']+ floor(750/($serendipity['thumbSize']+20))*floor(580/($serendipity['thumbSize']+20)); + } +?> + <b><?php echo SELECT_IMAGE; ?></b> + <br /> + + <?php echo CLICK_IMAGE_TO_INSERT; ?> + <br /> + + <?php serendipity_displayImageList($serendipity['GET']['start'], $serendipity['GET']['end']); } ?> -</body></html> + +</body> +</html> + <?php /* vim: set sts=4 ts=4 expandtab : */ ?> Index: serendipity_admin_images.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_images.inc.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- serendipity_admin_images.inc.php 8 Jul 2003 09:13:27 -0000 1.9 +++ serendipity_admin_images.inc.php 5 Aug 2003 14:07:40 -0000 1.10 @@ -1,286 +1,359 @@ <?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!"); +if (IN_serendipity !== true) { + die ("Don't hack!"); +} function serendipity_displayImageList($start = 0, $end = 20) { - global $serendipity; + global $serendipity; serendipity_fetchImages(true); $inc = $end - $start; - $files = @array_slice($serendipity["imageList"], $start, $inc); - ?> - <script language="javascript"> - <!-- - function rename(fname) { - if(newname = prompt('Enter the new name for '+fname, fname)) - location.href='?serendipity[adminModule]=images&serendipity[adminAction]=rename&serendipity[oldname]='+ - escape(fname)+'&serendipity[newname]='+escape(newname); - } - //--> - </script> - <div class="serendipity_admin_list"> - <div class="serendipity_admin_list_title">Image manager:</div> - <?php + $files = @array_slice($serendipity['imageList'], $start, $inc); if ($start > 0) { - $left = "<input type='button' value='<<<' onClick=\"location.href='{$_SERVER['REQUEST_URI']}&start=" . max(0, $start - $inc) . "&end=$start';\">\n"; + $left = '<input type="button" value="<<<" onClick="location.href=\'' . $_SERVER['REQUEST_URI'] . '&start=' . max(0, $start - $inc) . '&end=' . $start . '\';" />' . "\n"; } if (count($serendipity["imageList"]) > $end) { - $right = "<input type='button' value='>>>' onClick=\"location.href='{$_SERVER['REQUEST_URI']}&start=$end&end=" . ($end + $inc) . "'\">\n"; + $right = '<input type="button" value=">>>" onClick="location.href=\'' . $_SERVER['REQUEST_URI'] . '&start=' . $end . '&end=' . ($end + $inc) . '\';" />' . "\n"; } - - echo "<table class='serendipity_admin_list'>"; - echo "<tr><td align='left' colspan='2'>$left</td><td align='right' colspan='2'>$right</td></tr><tr>"; - for ($x=0; $x<count($files); $x++) { - - // Parse filename and image info - $f = serendipity_parseFileName($files[$x]); - $i = @getimagesize($serendipity["serendipityPath"].$serendipity["uploadPath"]."/".$files[$x]); - - echo "<td class='serendipity_admin_list_item' width='50%' nowrap>"; - - // Display a thumbnail? - echo "<b>".$files[$x]."</b><br>"; - if (file_exists($serendipity["serendipityPath"] . $serendipity["uploadPath"] . $f[0] . "." . $serendipity["thumbSuffix"] . "." . $f[1])) { - echo "<img align='left' src='".$serendipity['serendipityHTTPPath'] . $serendipity["uploadHTTPPath"].$f[0].".".$serendipity["thumbSuffix"].".".$f[1]."' hspace='15'>"; +?> + <script type="text/javascript" language="javascript"> + <!-- + function rename(fname) { + if(newname = prompt('<?php echo ENTER_NEW_NAME; ?>' + fname, fname)) { + location.href='?serendipity[adminModule]=images&serendipity[adminAction]=rename&serendipity[oldname]='+ escape(fname) + '&serendipity[newname]='+ escape(newname); + } } + //--> + </script> - // Display image name and resolution - echo "<br>". $i[0]."x".$i[1]."<br>"; + <div class="serendipity_admin_list"> + <div class="serendipity_admin_list_title"><?php echo IMAGE_MANAGER; ?></div> - // Display tools - echo "<img class='serendipityImageButton' alt='Fullsize' src='".$serendipity["serendipityHTTPPath"]."pixel/zoom.png' border='0' onClick=\"F1 = window.open('".$serendipity["serendipityHTTPPath"].$serendipity["uploadHTTPPath"].$files[$x]."','Zoom','height=".($i[1]+20).",width=".($i[0]+20).",toolbar=no,menubar=no,location=no');\">"; - echo "<img class='serendipityImageButton' alt='Rename this image' src='".$serendipity["serendipityHTTPPath"]."pixel/rename.png' onClick='rename(\"".addslashes($files[$x])."\")' border='0'>"; - echo "<img class='serendipityImageButton' alt='Resize this image' src='".$serendipity["serendipityHTTPPath"]."pixel/scale.png' border='0' onClick='location.href=\"?serendipity[adminModule]=images&serendipity[adminAction]=scaleSelect&serendipity[fname]=".rawurlencode($files[$x])."\";'>"; - echo "<img class='serendipityImageButton' alt='Delete this image' src='".$serendipity["serendipityHTTPPath"]."pixel/delete.png' onClick='location.href=\"?serendipity[adminModule]=images&serendipity[adminAction]=delete&serendipity[fname]=".rawurlencode($files[$x])."\";' border='0'>"; - echo "</td>"; + <table class="serendipity_admin_list"> + <tr> + <td align="left" colspan="2"> + <?php echo $left; ?> + </td> + + <td align="right" colspan="2"> + <?php echo $right; ?> + </td> + </tr> + + <tr> +<?php + for ($x=0; $x<count($files); $x++) { + // Parse filename and image info + $f = serendipity_parseFileName($files[$x]); + $i = @getimagesize($serendipity['serendipityPath'] . $serendipity['uploadPath'] . '/' . $files[$x]); + $_imgsrc = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $f[0] . '.' . $serendipity['thumbSuffix'] . '.' . $f[1]; + $imgsrc = $serendipity['serendipityHTTPPath'] . $serendipity['uploadHTTPPath'] . $f[0] . '.' . $serendipity['thumbSuffix'] . '.' . $f[1]; + if (file_exists($_imgsrc)) { + $preview = '<img align="left" src="' . $imgsrc . '" hspace="15" alt="" />'; + } else { + $preview = ''; + } +?> + <td class="serendipity_admin_list_item" width="50%" nowrap="nowrap"> + <b><?php echo $files[$x]; ?></b> + <br /> + + <?php echo $preview; ?> + <br /> + <?php echo $i[0] . 'x' . $i[1]; ?> + <br /> + <img class="serendipityImageButton" alt="<?php echo IMAGE_FULLSIZE; ?>" src="<?php echo $serendipity['serendipityHTTPPath']; ?>pixel/zoom.png" border="0" onClick="F1 = window.open('<?php echo $serendipity['serendipityHTTPPath'] . $serendipity['uploadHTTPPath'] . $files[$x]; ?>','Zoom','height=<?php echo ($i[1] + 20); ?>,width=<?php echo ($i[0] + 20); ?>,toolbar=no,menubar=no,location=no');" /> + <img class="serendipityImageButton" alt="<?php echo IMAGE_RENAME; ?>" src="<?php echo $serendipity['serendipityHTTPPath']; ?>pixel/rename.png" border="0" onClick="rename('<?php echo addslashes($files[$x]); ?>')" /> + <img class="serendipityImageButton" alt="<?php echo IMAGE_RESIZE; ?>" src="<?php echo $serendipity['serendipityHTTPPath']; ?>pixel/scale.png" border="0" onClick="location.href='?serendipity[adminModule]=images&serendipity[adminAction]=scaleSelect&serendipity[fname]=<?php echo rawurlencode($files[$x]); ?>';" /> + <img class="serendipityImageButton" alt="<?php echo IMAGE_DELETE; ?>" src="<?php echo $serendipity['serendipityHTTPPath']; ?>pixel/delete.png" border="0" onClick="location.href='?serendipity[adminModule]=images&serendipity[adminAction]=delete&serendipity[fname]=<?php echo rawurlencode($files[$x]); ?>';" /> + </td> +<?php // Linebreak? - if (($x+1)%2 == 0) echo "</tr><tr>"; + if (($x+1)%2 == 0) { +?> + </tr> + <tr> +<?php + } } - echo "</tr><tr><td align='left' colspan='2'>$left</td><td align='right' colspan='2'>$right</td></tr>"; - echo "</table></div>"; +?> + </tr> + <tr> + <td align="left" colspan="2"> + <?php echo $left; ?> + </td> + + <td align="right" colspan="2"> + <?php echo $right; ?> + </td> + </tr> + </table> + </div> +<?php } +switch ($serendipity['GET']['adminAction']) { + case 'genThumbs': + set_time_limit(0); + ignore_user_abort(); + echo '<b>' . RESIZING . '</b><br /><br />'; + flush(); + $i = serendipity_generateThumbs(); + printf(RESIZE_DONE, $i); + break; -switch ($serendipity["GET"]["adminAction"]) { + case 'DoDelete': + $file = $serendipity['GET']['fname']; + $fThumb = serendipity_parseFileName($file); + $fThumb = $fThumb[0] . '.' . $serendipity['thumbSuffix'] . '.' . $fThumb[1]; + if ( file_exists($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file) ) { + if ( @unlink($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $file) ) { + printf(DELETE_IMAGE . '<br />', $file); + } else { + printf(DELETE_IMAGE_FAIL . '<br />' $file); + } - case "genThumbs": - set_time_limit(0); - ignore_user_abort(); - echo "<b>Resizing:</b><p>"; - flush(); - $i = serendipity_generateThumbs(); - echo "Done (resized $i images)."; - break; + if ( @unlink($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $fThumb) ) { + printf(DELETE_THUMBNAIL . '<br />', $fThumb); + } + } else { + printf(FILE_NOT_FOUND, $file); + } + break; - case "DoDelete": - $file = $serendipity['GET']['fname']; - $fThumb = serendipity_parseFileName($file); - $fThumb = $fThumb[0].".".$serendipity["thumbSuffix"].".".$fThumb[1]; - if ( file_exists($serendipity["serendipityPath"].$serendipity["uploadPath"].$file) ) { - if ( @unlink($serendipity["serendipityPath"].$serendipity["uploadPath"].$file) ) { - echo "Deleted the image entitled <b>". $file ."</b>"; - } else { - echo "Unable to delete <b>". $file ."</b>"; - } - if ( @unlink($serendipity["serendipityPath"].$serendipity["uploadPath"].$fThumb) ) { - echo "<br>Deleted the thumbnail entitled <b>". $fThumb ."</b>"; - } - - } else { - echo "I was unable to locate the file entitled <b>". $file ."</b>, maybe it has already been deleted?"; - } + case 'delete': + $file = $serendipity['GET']['fname']; + $abortLoc = $serendipity['serendipityHTTPPath'] . 'serendipity_entries.php?serendipity[adminModule]=images'; + $newLoc = $abortLoc . '&serendipity[adminAction]=DoDelete&serendipity[fname]=' . $file; - break; - case "delete": - $file = $serendipity['GET']['fname']; - - - echo "You are about to delete <b>$file</b><br>"; - echo "If you are using this file in some of your entries, it will cause dead images<br>"; - echo "Are you sure you wish to proceed?<p>"; - - $newLoc = $serendipity['serendipityHTTPPath'] ."serendipity_entries.php?serendipity[adminModule]=images&serendipity[adminAction]=DoDelete&serendipity[fname]=". $file; - echo "<input type='button' value='Delete the image' onClick='location.href=\"$newLoc\"'>"; - - echo str_repeat(" ", 10); - - $newLoc = $serendipity['serendipityHTTPPath'] ."serendipity_entries.php?serendipity[adminModule]=images"; - echo "<input type='button' value='Abort now' onClick='location.href=\"$newLoc\"'>"; - break; - - case "rename": - if ($serendipity["GET"]["oldname"] != "" && $serendipity["GET"]["newname"]!= "" && - file_exists($serendipity["serendipityPath"].$serendipity["uploadPath"].$serendipity["GET"]["oldname"]) && - !file_exists($serendipity["serendipityPath"].$serendipity["uploadPath"].$serendipity["GET"]["newname"])) { + printf(ABOUT_TO_DELETE_FILE, $file); +?> + <form method="get" name="delete_image"> + <div> + <input type="button" value="<?php echo IMAGE_DELETE ?>" onClick="location.href='<?php echo $newLoc; ?>'" /> + + <input type="button" value="<?php echo ABORT_NOW ?>" onClick="location.href='<?php echo $abortLoc; ?>'" /> + </div> + </form> +<?php + break; - // Rename file - rename($serendipity["serendipityPath"].$serendipity["uploadPath"].$serendipity["GET"]["oldname"], - $serendipity["serendipityPath"].$serendipity["uploadPath"].$serendipity["GET"]["newname"]); + case 'rename': + $oldfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $serendipity['GET']['oldname']; + $newfile = $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $serendipity['GET']['newname']; + if ($serendipity['GET']['oldname'] != '' && $serendipity['GET']['newname']!= '' && + file_exists($oldfile) && + !file_exists($newfile)) { + + // Rename file + rename($oldfile, $newfile); + // Rename thumbnail - $f = serendipity_parseFileName($serendipity["GET"]["oldname"]); - $f2= serendipity_parseFileName($serendipity["GET"]["newname"]); - rename($serendipity["serendipityPath"].$serendipity["uploadPath"].$f[0].".".$serendipity["thumbSuffix"].".".$f[1], - $serendipity["serendipityPath"].$serendipity["uploadPath"].$f2[0].".".$serendipity["thumbSuffix"].".".$f2[1]); - + $f = serendipity_parseFileName($serendipity['GET']['oldname']); + $f2= serendipity_parseFileName($serendipity['GET']['newname']); + rename( $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $f[0] . '.' . $serendipity['thumbSuffix'] . '.' . $f[1], + $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $f2[0] . '.' . $serendipity['thumbSuffix'] . '.' . $f2[1]); + // Forward user to overview (we don't want the user's back button to rename things again) - echo "<script language='javascript'>\nlocation.href='?serendipity[adminModule]=images';\n</script>"; - } - else { - if (!file_exists($serendipity["serendipityPath"].$serendipity["uploadPath"].$serendipity["GET"]["oldname"])) - echo ERROR_FILE_NOT_EXISTS; - elseif (file_exists($serendipity["serendipityPath"].$serendipity["uploadPath"].$serendipity["GET"]["newname"])) - echo ERROR_FILE_EXISTS; - else - echo ERROR_SOMETHING; - echo "<br><input type='button' onClick='history.go(-1);' value='".BACK."'>"; +?> + <script language="javascript" type="text/javascript"> + location.href="?serendipity[adminModule]=images"; + </script> +<?php + } else { + if (!file_exists($oldfile)) { + echo ERROR_FILE_NOT_EXISTS; + } elseif (file_exists($newfile)) { + echo ERROR_FILE_EXISTS; + } else { + echo ERROR_SOMETHING; + } +?> + <br /> + <input type="button" onclick="history.go(-1);" value="<?php echo BACK; ?>" /> +<?php } - break; + break; - case "add": - echo "<b>".ADDING_IMAGE."</b><p>"; - // First find out whether to fetch a file or accept an upload - if ($serendipity["POST"]["url"] != "" && $serendipity["POST"]["url"] != "http://") { - if (file_exists($serendipity["serendipityPath"].$serendipity["uploadPath"].basename($serendipity["POST"]["url"]))) { - echo ERROR_FILE_EXISTS_ALREADY; - } - else { - // Fetch file - if ( !$fContent = @file_get_contents($serendipity["POST"]["url"]) ) { - echo "File was not located on the remote server, are you sure the URL: <b>". $serendipity["POST"]["url"] ."</b> is correct?"; - } else { - $fp = fopen($serendipity["serendipityPath"].$serendipity["uploadPath"].basename($serendipity["POST"]["url"]), "w"); - fwrite($fp, $fContent); - fclose($fp); - - echo $serendipity["POST"]["url"]." fetched!<br>"; + case 'add': +?> + <b><?php echo ADDING_IMAGE; ?></b> + <br /><br /> ... [truncated message content] |
From: <gar...@us...> - 2003-08-03 15:19:33
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv31391 Modified Files: serendipity_functions.inc.php Log Message: <category> is only for RSS > 0.91 Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- serendipity_functions.inc.php 2 Aug 2003 15:14:19 -0000 1.110 +++ serendipity_functions.inc.php 3 Aug 2003 15:19:22 -0000 1.111 @@ -866,7 +866,6 @@ <item> <title><?php echo utf8_encode(htmlspecialchars($entry['title'])); ?></title> <link><?php echo $guid; ?></link> - <category><?php echo utf8_encode(htmlspecialchars($entry['category_name'])); ?></category> <?php if ($version == '2.0') { // extract author information @@ -876,6 +875,7 @@ $entry['email'] = $results[0]['email']; } ?> + <category><?php echo utf8_encode(htmlspecialchars($entry['category_name'])); ?></category> <author><?php echo htmlentities($entry['email']) . ' (' . htmlentities($entry['username']) . ')'; ?></author> <content:encoded> <?php echo utf8_encode(htmlspecialchars(serendipity_emoticate(serendipity_markup_text($entry['body'])))); ?> |
From: <gar...@us...> - 2003-08-02 15:14:22
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv31398 Modified Files: .cvsignore rss.php serendipity_admin_installer.inc.php serendipity_functions.inc.php serendipity_lang_de.inc.php serendipity_lang_en.inc.php serendipity_sidebar_items.php Log Message: o Added the 'plugins' directory to CVS to provide some bundled external plugins for examples o Removed creating the plugins directory in the installer, removed plugins from .cvsignore o Fixed the RSS feed for comments to be feeded. Implemented them into the RSS/XML sidebar item plugin. o Fixed some more language issues, outsourced strings to constants. o UTF8encode description and title in the RSS feeds o Implemented 'category' tag for RSS2.0 feed o Optimized RSS-feed SQL queries to be only used if no email was already provided from an earlier query o Added a 'content rewrite' external plugin. Allows any strings to be rewritten to customized strings. See my other posts about this for details. o Force inline display of emoticons (XHTML) Happy testing. :) I checked all changes now for a week in my personal blog (www.supergarv.de/serendipity/) with the new plugin, and without problems . Index: .cvsignore =================================================================== RCS file: /cvsroot/php-blog/serendipity/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- .cvsignore 29 Mar 2003 15:39:03 -0000 1.2 +++ .cvsignore 2 Aug 2003 15:14:19 -0000 1.3 @@ -2,5 +2,4 @@ serendipity_config_local.inc.php .htaccess uploads -archives -plugins +archives \ No newline at end of file Index: rss.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/rss.php,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- rss.php 8 Jul 2003 09:13:27 -0000 1.7 +++ rss.php 2 Aug 2003 15:14:19 -0000 1.8 @@ -9,11 +9,13 @@ $description = $serendipity['blogDescription']; $title = $serendipity['blogTitle']; -switch ($type) { +$comments = FALSE; +switch ($_GET['type']) { case 'comments': - $entries = serendipity_fetchComments(null, true, 15); - $title = $title . ' Comments'; - $description = 'Comments from ' . $description; + $entries = serendipity_fetchComments(null, 15); + $title = $title . ' ' . COMMENTS; + $description = COMMENTS_FROM . ' ' . $description; + $comments = TRUE; break; case 'content': default: @@ -25,6 +27,9 @@ break; } +$title = utf8_encode($title); +$description = utf8_encode($description); + echo '<?xml version="1.0" encoding="utf-8" ?>'; echo "\n"; switch ($version) { @@ -49,9 +54,9 @@ xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:robot="http://www.edwardbear.org/def/xml/robot"> <channel> -<title>{$serendipity['blogTitle']}</title> +<title>$title</title> <link>{$serendipity['baseURL']}</link> -<description>{$serendipity['blogDescription']}</description> +<description>$description</description> <dc:language>{$serendipity['lang']}</dc:language> HEAD; @@ -60,7 +65,7 @@ die("Invalid RSS version specified\n"); } -serendipity_printEntries_rss($entries, $version); +serendipity_printEntries_rss($entries, $version, $comments); switch ($version) { case '0.91': Index: serendipity_admin_installer.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_installer.inc.php,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- serendipity_admin_installer.inc.php 23 Jul 2003 21:12:38 -0000 1.22 +++ serendipity_admin_installer.inc.php 2 Aug 2003 15:14:19 -0000 1.23 @@ -184,12 +184,7 @@ $errs[] = " -> and <i>chmod g+rwx ".$_POST["serendipityPath"]."archives</i>"; } - // Attempt to create the plugins dir - if ( !is_dir($_POST['serendipityPath'] . "plugins") && @mkdir($_POST['serendipityPath'] . "plugins", 0770) !== true ) { - $errs[] = "Couldn't create the plugins directory, you do it:"; - $errs[] = " -> Run <i>mkdir ".$_POST["serendipityPath"]."plugins</i>"; - $errs[] = " -> and <i>chmod g+rwx ".$_POST["serendipityPath"]."plugins</i>"; - } + // plugins directory now part of basic CVS // Check imagick if ($_POST["magick"] == "true" && !is_executable($_POST["convert"])) { Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.109 retrieving revision 1.110 diff -u -d -r1.109 -r1.110 --- serendipity_functions.inc.php 26 Jul 2003 09:04:58 -0000 1.109 +++ serendipity_functions.inc.php 2 Aug 2003 15:14:19 -0000 1.110 @@ -365,6 +365,7 @@ $query = "SELECT e.*, a.username, + a.email, c.category_name FROM ({$serendipity['dbPrefix']}entries AS e @@ -592,16 +593,42 @@ { global $serendipity; - $query = "SELECT * FROM {$serendipity['dbPrefix']}comments WHERE entry_id=$id AND type LIKE 'NORMAL' ORDER BY id"; - if (isset($limit)) { - $query .= " LIMIT $limit"; + if (!empty($limit)) { + if ( strtolower($serendipity['dbType']) == 'postgres' ) { + $limit = 'LIMIT ' . join (' OFFSET ', split(',', $limit)); + } else { + $limit = 'LIMIT '. $limit; + } + } else { + $limit = ''; + } + + if (!empty($id)) { + $and = 'AND co.entry_id=' . $id; } + $query = "SELECT + co.*, + co.author AS username, + e.title, + c.category_name + FROM + ({$serendipity['dbPrefix']}comments co + LEFT JOIN {$serendipity['dbPrefix']}entries e + ON co.entry_id = e.id + LEFT JOIN {$serendipity['dbPrefix']}category c + ON e.categoryid = c.categoryid) + WHERE co.type LIKE 'NORMAL' $and + ORDER BY + co.id DESC + $limit"; + $comments = serendipity_db_query($query); + if (!is_array($comments)) { return array(); } - + return $comments; } @@ -825,23 +852,31 @@ } -function serendipity_printEntries_rss($entries, $version) { +function serendipity_printEntries_rss($entries, $version, $comments = false) { global $serendipity; if ($version == '0.91' || $version == '2.0' && is_array($entries)) { foreach ($entries as $entry) { $guid = serendipity_archiveURL($entry['id'], $entry['title']); + if ($comments == true) { + // Display username as part of the title for easier feed-readability + $entry['title'] = $entry['username'] . ': ' . $entry['title']; + } ?> <item> - <title><?php echo htmlentities($entry['title']); ?></title> + <title><?php echo utf8_encode(htmlspecialchars($entry['title'])); ?></title> <link><?php echo $guid; ?></link> + <category><?php echo utf8_encode(htmlspecialchars($entry['category_name'])); ?></category> <?php if ($version == '2.0') { // extract author information - $query = "select email from {$serendipity['dbPrefix']}authors where username='{$entry['username']}'"; - $results = serendipity_db_query($query); + if (empty($entry['email'])) { + $query = "select email from {$serendipity['dbPrefix']}authors where username='{$entry['username']}'"; + $results = serendipity_db_query($query); + $entry['email'] = $results[0]['email']; + } ?> - <author><?php echo htmlentities($results[0]['email']) . ' (' . htmlentities($entry['username']) . ')'; ?></author> + <author><?php echo htmlentities($entry['email']) . ' (' . htmlentities($entry['username']) . ')'; ?></author> <content:encoded> <?php echo utf8_encode(htmlspecialchars(serendipity_emoticate(serendipity_markup_text($entry['body'])))); ?> </content:encoded> @@ -870,6 +905,102 @@ return('<tt>' . str_replace(' ', ' ', $arg[1]) . '</tt>'); } +function serendipity_content_rewrite($str) { + global $serendipity; + + // Do this only once! + if (!class_exists('serendipity_plugin_api')) { + include_once('serendipity_plugin_api.php'); + } + + // If this variable is not set, this function is called for the first time. + // Now let's search for plugins needing content rewriting + if (!isset($serendipity['content_rewrite']['active'])) { + + // We set this to false, so when this function is called later, it won't have to enumerate all plugins again + $serendipity['content_rewrite']['active'] = false; + + // Get those nifty plugins + $plugins = serendipity_plugin_api::enum_plugins(); + + if (is_array($plugins)) { + + // store the rewrite items in our main container for later usage. + $serendipity['content_rewrite']['data']['rewrite_from'] = array(); + $serendipity['content_rewrite']['data']['rewrite_to'] = array(); + + // load each plugin to make some introspection + foreach ($plugins as $plugin_data) { + $plugin =& serendipity_plugin_api::load_plugin($plugin_data['name']); + $bag = new serendipity_property_bag; + $plugin->introspect($bag); + + if ($bag->get('rewrite_active') === true) { + + // Store necessary data in our main container + $serendipity['content_rewrite']['string'] = $plugin->get_config('rewrite_string'); + + if ($serendipity['content_rewrite']['string'] != '') { + $rewrite_from = $bag->get('rewrite_from'); + $serendipity['content_rewrite']['data']['rewrite_char'][$serendipity['content_rewrite']['string']] = &$plugin->get_config('rewrite_char'); + + foreach($rewrite_from AS $nr => $key) { + $serendipity['content_rewrite']['data']['rewrite_from'][$serendipity['content_rewrite']['string']][] = $plugin->get_config($key); + } + + $rewrite_to = $bag->get('rewrite_to'); + foreach($rewrite_to AS $nr => $key) { + $serendipity['content_rewrite']['data']['rewrite_to'][$serendipity['content_rewrite']['string']][] = $plugin->get_config($key); + } + + // We now have at least one active plugin. + $serendipity['content_rewrite']['active'] = true; + } + } + } + } + } + + // Check if we have any plugin data needing rewrite + if (is_array($serendipity['content_rewrite']['data']['rewrite_from'])) { + foreach($serendipity['content_rewrite']['data']['rewrite_from'] AS $rewrite_string => $rewrite_values) { + foreach($rewrite_values AS $key => $val) { + if (trim($val) != '') { + + // Use the supplied rewrite string and replace the {from} and {to} values with the ones we got from the plugin + $new = + str_replace( + array( + '{from}', + '{to}' + ), + + array( + str_replace( + $serendipity['content_rewrite']['data']['rewrite_char'][$rewrite_string], + '', + $val + ), + + $serendipity['content_rewrite']['data']['rewrite_to'][$rewrite_string][$key] + ), + + $rewrite_string + ); + + // Build a regular expression (ungreedy, multiline) with our quoted value. $val here is the word needing the replacement + $regex = '°([^\d\w])(' . preg_quote($val) . ')([^\d\w])°msU'; + + // \1 and \3 are the prepend/append strings (usually whitespaces) and $new containing the new value + $str = preg_replace($regex, '\1' . $new . '\3', $str); + } + } + } + } + + return $str; +} + function serendipity_markup_text($str, $entry_id = 0) { global $serendipity; @@ -913,6 +1044,9 @@ ); } + // Do some content rewrite, if necessary + $ret = serendipity_content_rewrite($ret); + return $ret; } @@ -943,7 +1077,7 @@ global $serendipity; foreach ($serendipity['smiles'] as $key => $value) { - $str = preg_replace("/([\t\ ]?)" . preg_quote($key, '/') . "([\t\ \!\.\)]?)/m", "$1<img src=\"$value\" alt=\"$key\" />$2", $str); + $str = preg_replace("/([\t\ ]?)" . preg_quote($key, '/') . "([\t\ \!\.\)]?)/m", "$1<img src=\"$value\" alt=\"$key\" style=\"display: inline; vertical-align: bottom;\" />$2", $str); } return $str; Index: serendipity_lang_de.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_lang_de.inc.php,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- serendipity_lang_de.inc.php 16 Jul 2003 11:58:24 -0000 1.16 +++ serendipity_lang_de.inc.php 2 Aug 2003 15:14:19 -0000 1.17 @@ -181,6 +181,7 @@ define('HIDDEN', 'versteckt'); define('REMOVE_TICKED_PLUGINS', 'Markierte plugins entfernen'); define('SAVE_CHANGES_TO_LAYOUT', 'Änderungen am Layout speichern'); +define('COMMENTS_FROM', 'Kommentare von'); 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.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- serendipity_lang_en.inc.php 18 Jul 2003 17:51:15 -0000 1.22 +++ serendipity_lang_en.inc.php 2 Aug 2003 15:14:19 -0000 1.23 @@ -181,6 +181,7 @@ define('HIDDEN', 'hidden'); define('REMOVE_TICKED_PLUGINS', 'Remove ticked plugins'); define('SAVE_CHANGES_TO_LAYOUT', 'Save changes to layout'); +define('COMMENTS_FROM', 'Comments from'); define('serendipity_LANG_LOADED', true); /* vim: set sts=4 ts=4 expandtab : */ Index: serendipity_sidebar_items.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_sidebar_items.php,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- serendipity_sidebar_items.php 16 Jul 2003 12:08:22 -0000 1.22 +++ serendipity_sidebar_items.php 2 Aug 2003 15:14:19 -0000 1.23 @@ -145,6 +145,9 @@ <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> + <br /> + <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>rss.php?version=2.0&type=comments"><img src="<?php echo $serendipity['serendipityHTTPPath']; ?>xml.gif" border="0" alt="XML" /></a> + <a href="<?php echo $serendipity['serendipityHTTPPath']; ?>rss.php?version=2.0&type=comments">RSS 2.0 <?php echo COMMENTS; ?></a> <?php } } |
From: <tom...@us...> - 2003-07-30 16:38:38
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv12078 Modified Files: serendipity_db_mysql.inc.php Log Message: Attempting to fix bug 780149. We select the database during _connect and just use mysql_query() Thereby the _probe function will be the one setting the database for us (during installation), and the rest of the queries will just use that database Index: serendipity_db_mysql.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_db_mysql.inc.php,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- serendipity_db_mysql.inc.php 25 Jul 2003 01:03:18 -0000 1.10 +++ serendipity_db_mysql.inc.php 30 Jul 2003 16:38:35 -0000 1.11 @@ -18,7 +18,7 @@ // highlight_string(var_export($sql, 1)); - $c = mysql_db_query($serendipity['dbName'], $sql); + $c = mysql_query($sql); if (!$c) { if (!$serendipity['production']) { @@ -84,7 +84,7 @@ } $serendipity['dbConn'] = mysql_connect($serendipity['dbHost'], $serendipity['dbUser'], $serendipity['dbPass']); - + mysql_select_db($serendipity['dbName']); return $serendipity['dbConn']; } |
From: <gar...@us...> - 2003-07-30 16:19:15
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv7998 Modified Files: index.php Log Message: Don't continue execution after RSS-feed is displayed. May cause problems on embedded pages. Index: index.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/index.php,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- index.php 9 Jul 2003 18:55:36 -0000 1.22 +++ index.php 30 Jul 2003 16:12:17 -0000 1.23 @@ -112,6 +112,7 @@ } print $data; + exit; } } else if (preg_match('@/admin$@', $uri)) { header("Location: {$serendipity['serendipityHTTPPath']}serendipity_admin.php"); |
From: <tom...@us...> - 2003-07-29 19:53:17
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv22014 Modified Files: NEWS Log Message: Update Index: NEWS =================================================================== RCS file: /cvsroot/php-blog/serendipity/NEWS,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- NEWS 8 Jul 2003 09:13:27 -0000 1.5 +++ NEWS 29 Jul 2003 19:41:32 -0000 1.6 @@ -2,6 +2,47 @@ Version 0.3 () ------------------------------------ + * Fixed the database by separating primary key from {AUTOINCREMENT} (jtate) + * Rewrote installer (tomsommer) + * Added support for postgres (jtate) + * Fixed replacement of {TEMPLATE_PATH} to be relative (tomsommer) + * Major codestyle, HTML and XHTML cleanup (garvinhicking) + * Removed lots of static non-translated text (garvinhicking) + * Remove config entries when a plugin is removed (garvinhicking) + * After plugin update, show the new values for the plugin instead the old ones (garvinhicking) + * After submitting a comment, redirect back to the actual previous page (tomsommer) + * Fixed inclusion of templates vs. database-CSS (tomsommer) + * Fixed CSS not being showed during installation (tomsommer) + * Cleaned up the comment-form (tomsommer) + * Fixes a bug that the last day of a month was not taken into account of the archives (garvinhicking) + * Added the ability to easily integrate serendipity into an existing website using wrappers (garvinhicking) + * Added a new file serendipity_define.js.php which can be pre-included to a Java-script to set some variables (garvinhicking) + * alt tag with '' instead of "" (garvinhicking) + * Added CVS $Id$ headers (garvinhicking) + * Added 'Force XHTML11' config option [not used yet] (garvinhicking) + * Made direct links to each comment, actually point to the right URI (tomsommer) + * Inserted htmlentities() for comments output. Was vulnerable to cross-site scripting attacks (garvinhicking) + * Fixed the "categories listing" so that if there were no categories, it didn't display garbage (jtate) + * XML header should be utf-8, not ISO-8859-1. This should fix the encoding problems (sterling) + * Use ISO-8859-1 Charset to display pages (tomsommer) + * serendipity_date is now an H3, serendipity_title is now an H4 (troutgirl) + * Import stylesheets using @import (troutgirl) + * Made "H" in 'Posted by X in Y at H' a link, like in movabletype (tomsommer) + * The line trailing each entry is now adapted to the "common format" 'Posted by xx in xx at xx | comments (n) | trackbacks (n)' (jhermanns) + * Fixed minor problem with case in generated filenames (jhermanns) + * Removed all short tags '<?=' (jtate) + * Shortened the search field a little (jhermanns) + * Updated INSTALL instructions (troutgirl) + * Solved linebreak problem in "posted by..." via CSS (mueslix) + * Changed CSS class of "View Extended Entry" and "Posted by..." to serendipity_entryFooter (mueslix) + * Default template is now set in the DB during installation (jhermanns) + * Moved includes out of the templates (jhermanns) + * Fixed some problems with CSS not loading a first try (tomsommer) + * Saved lots of SQL queries when fetching config variables from the database (tomsommer) + * Added new template system (tomsommer) + * Enhanced the insertion of emoticons (jhermanns) + * Removed static text and made some RSS regexps case-insensitive (jhermanns) + * Added link to entry in emails, sent when comments or trackbacks are made (tomsommer) * Escape potential HTML characters in <title> in RSS feeds (Joyce P & gschlossnagle) * HTML is no longer allowed in comments, all HTML is formatted to plain-text (tomsommer) * Added direct link, to an entry, in the trackback dialog (tomsommer) @@ -51,6 +92,6 @@ * Added full language support - English, German (jhermanns) * Keep track of which blog entry was linked from or referred to (bergmann) * Regenerate the .htaccess file, if installation fails (sterling & muesli) - + Version 0.2 (April 4, 2003) ------------------------------------ |
From: <ste...@us...> - 2003-07-26 10:47:35
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv25504 Modified Files: serendipity_functions.inc.php Log Message: If we are going to be annoying, why not go all the way? Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.108 retrieving revision 1.109 diff -u -d -r1.108 -r1.109 --- serendipity_functions.inc.php 25 Jul 2003 21:08:40 -0000 1.108 +++ serendipity_functions.inc.php 26 Jul 2003 09:04:58 -0000 1.109 @@ -809,7 +809,7 @@ $signature = "\n--" . "\n" . $serendipity[blogTitle] . ' is powered by Serendipity.' - . "\n" . 'The best PHP blog around, you can use it too.' + . "\n" . 'The best blog around, you can use it too.' . "\n" . 'Check out <http://s9y.org> to find out how.'; mail($to, $subject, $text.$signature, "From: $fromName <$fromEmail>\r\n"); |
From: <jt...@us...> - 2003-07-26 01:49:36
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv6921 Modified Files: serendipity_functions.inc.php Log Message: Fixed a typo Index: serendipity_functions.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v retrieving revision 1.107 retrieving revision 1.108 diff -u -d -r1.107 -r1.108 --- serendipity_functions.inc.php 19 Jul 2003 18:21:15 -0000 1.107 +++ serendipity_functions.inc.php 25 Jul 2003 21:08:40 -0000 1.108 @@ -809,7 +809,7 @@ $signature = "\n--" . "\n" . $serendipity[blogTitle] . ' is powered by Serendipity.' - . "\n" . 'The best PHP blog around, you can use it to.' + . "\n" . 'The best PHP blog around, you can use it too.' . "\n" . 'Check out <http://s9y.org> to find out how.'; mail($to, $subject, $text.$signature, "From: $fromName <$fromEmail>\r\n"); |
From: <jt...@us...> - 2003-07-25 01:03:21
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv10393 Modified Files: db.sql serendipity_db_mysql.inc.php serendipity_db_postgres.inc.php serendipity_db_sqlite.inc.php Log Message: Fixed the database by separating primary key from {AUTOINCREMENT} Index: db.sql =================================================================== RCS file: /cvsroot/php-blog/serendipity/db.sql,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- db.sql 7 Jul 2003 12:23:44 -0000 1.18 +++ db.sql 25 Jul 2003 01:03:18 -0000 1.19 @@ -5,7 +5,7 @@ create table {PREFIX}authors ( username varchar(20) default null, password varchar(32) default null, - authorid {AUTOINCREMENT}, + authorid {AUTOINCREMENT} {PRIMARY}, mail_comments int(1) default '1', mail_trackbacks int(1) default '1', email varchar(128) not null default '' @@ -16,7 +16,7 @@ # create table {PREFIX}comments ( - id {AUTOINCREMENT}, + id {AUTOINCREMENT} {PRIMARY}, entry_id int(10) {UNSIGNED} not null default '0', timestamp int(10) {UNSIGNED} default null, title varchar(150) default null, @@ -35,7 +35,7 @@ # create table {PREFIX}entries ( - id {AUTOINCREMENT}, + id {AUTOINCREMENT} {PRIMARY}, title varchar(200) default null, timestamp int(10) {UNSIGNED} default null, body text, @@ -55,8 +55,8 @@ # create table {PREFIX}references ( - id {AUTOINCREMENT}, - entry_id int(10) {UNSIGNED} not null default '0', + id {AUTOINCREMENT} {PRIMARY}, + entry_id {AUTOINCREMENT}, link text, name text ); @@ -66,6 +66,7 @@ # CREATE TABLE {PREFIX}exits ( + entry_id {AUTOINCREMENT}, day date NOT NULL, count int(11) NOT NULL default '0', scheme varchar(5), @@ -73,7 +74,6 @@ port varchar(5), path varchar(255), query varchar(255), - entry_id int(11) not null, PRIMARY KEY (host,day,entry_id) ); @@ -82,6 +82,7 @@ # CREATE TABLE {PREFIX}referrers ( + entry_id {AUTOINCREMENT}, day date NOT NULL, count int(11) NOT NULL default '0', scheme varchar(5), @@ -89,7 +90,6 @@ port varchar(5), path varchar(255), query varchar(255), - entry_id int(11) not null, PRIMARY KEY (host,day,entry_id) ); @@ -98,7 +98,7 @@ # CREATE TABLE {PREFIX}css ( - cssid {AUTOINCREMENT}, + cssid {AUTOINCREMENT} {PRIMARY}, name varchar(40) default NULL, data text ); @@ -132,7 +132,7 @@ ); CREATE TABLE {PREFIX}category ( - categoryid {AUTOINCREMENT}, + categoryid {AUTOINCREMENT} {PRIMARY}, category_name varchar(255) default NULL, category_description text, authorid int(11) default NULL Index: serendipity_db_mysql.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_db_mysql.inc.php,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- serendipity_db_mysql.inc.php 8 Jul 2003 12:04:22 -0000 1.9 +++ serendipity_db_mysql.inc.php 25 Jul 2003 01:03:18 -0000 1.10 @@ -90,8 +90,10 @@ 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}', '{PRIMARY}', + '{UNSIGNED}', '{FULLTEXT}'); + static $replace = array('int(11) not null auto_increment', 'primary key', + 'unsigned' , 'FULLTEXT'); return serendipity_db_query(str_replace($search, $replace, $query)); } Index: serendipity_db_postgres.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_db_postgres.inc.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- serendipity_db_postgres.inc.php 8 Jul 2003 12:04:22 -0000 1.6 +++ serendipity_db_postgres.inc.php 25 Jul 2003 01:03:18 -0000 1.7 @@ -91,8 +91,10 @@ 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' ); + static $search = array('{AUTOINCREMENT}', '{PRIMARY}', '{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)); } Index: serendipity_db_sqlite.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_db_sqlite.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serendipity_db_sqlite.inc.php 8 Jul 2003 12:04:22 -0000 1.5 +++ serendipity_db_sqlite.inc.php 25 Jul 2003 01:03:18 -0000 1.6 @@ -119,8 +119,8 @@ function serendipity_db_schema_import($query) { - static $search = array('{AUTOINCREMENT}' , '{UNSIGNED}', '{FULLTEXT}'); - static $replace = array('INTEGER PRIMARY KEY', '' , '' ); + static $search = array('{AUTOINCREMENT}', '{PRIMARY}', '{UNSIGNED}', '{FULLTEXT}'); + static $replace = array('INTEGER', 'PRIMARY KEY', '', ''); return serendipity_db_query(str_replace($search, $replace, $query)); } |
From: <jt...@us...> - 2003-07-23 21:12:41
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv30043 Modified Files: serendipity_admin_installer.inc.php Log Message: Fixed some installation errors Index: serendipity_admin_installer.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_installer.inc.php,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- serendipity_admin_installer.inc.php 22 Jul 2003 16:57:50 -0000 1.21 +++ serendipity_admin_installer.inc.php 23 Jul 2003 21:12:38 -0000 1.22 @@ -233,6 +233,7 @@ serendipity_db_query($query); include_once $_POST['serendipityPath'] . '/serendipity_functions_config.inc.php'; + $serendipity['dbPrefix'] = $_POST['dbPrefix']; serendipity_set_config_var('template', 'default'); $text = serendipity_db_escape_string(file_get_contents('./serendipity.css')); @@ -284,12 +285,12 @@ } fwrite($configfp, "<?php\n"); - fwrite($configfp, "\t\$serendipity['dbName'] = '{$serendipity['dbName']}';\n"); - fwrite($configfp, "\t\$serendipity['dbPrefix'] = '{$serendipity['dbPrefix']}';\n"); - fwrite($configfp, "\t\$serendipity['dbHost'] = '{$serendipity['dbHost']}';\n"); - fwrite($configfp, "\t\$serendipity['dbUser'] = '{$serendipity['dbUser']}';\n"); - fwrite($configfp, "\t\$serendipity['dbPass'] = '{$serendipity['dbPass']}';\n"); - fwrite($configfp, "\t\$serendipity['dbType'] = '{$serendipity['dbType']}';\n"); + fwrite($configfp, "\t\$serendipity['dbName'] = '{$_POST['dbName']}';\n"); + fwrite($configfp, "\t\$serendipity['dbPrefix'] = '{$_POST['dbPrefix']}';\n"); + fwrite($configfp, "\t\$serendipity['dbHost'] = '{$_POST['dbHost']}';\n"); + fwrite($configfp, "\t\$serendipity['dbUser'] = '{$_POST['dbUser']}';\n"); + fwrite($configfp, "\t\$serendipity['dbPass'] = '{$_POST['dbPass']}';\n"); + fwrite($configfp, "\t\$serendipity['dbType'] = '{$_POST['dbType']}';\n"); fwrite($configfp, "?>\n"); fclose($configfp); |
From: <tom...@us...> - 2003-07-22 16:57:52
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv28384 Modified Files: serendipity_admin_installer.inc.php Log Message: Add link to newly installed blog Index: serendipity_admin_installer.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_installer.inc.php,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- serendipity_admin_installer.inc.php 22 Jul 2003 16:44:00 -0000 1.20 +++ serendipity_admin_installer.inc.php 22 Jul 2003 16:57:50 -0000 1.21 @@ -342,9 +342,9 @@ include_once "serendipity_plugin_api.php"; serendipity_plugin_api::register_default_plugins(); - echo "<p>Serendipity was successfully installed on your system<br>"; + echo "<p><strong>Serendipity was successfully installed on your system</strong><br>"; echo "Please remember your password: '". $_POST['pass'] ."', your username is '". $_POST['user'] ."'<br>"; - echo "<br>You can find your new PHP blog here"; + echo "<br>You can find your new PHP blog <a href='". $_POST["serendipityHTTPPath"] ."'>right here</a>"; session_destroy(); } |
From: <tom...@us...> - 2003-07-22 16:44:03
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv25904 Modified Files: serendipity_admin_installer.inc.php Log Message: New installer, please test as much as you can... This installer has much better handling of errors during the installation. It has the main steps of the installation split into functions for better overview Please test it! Index: serendipity_admin_installer.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_installer.inc.php,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- serendipity_admin_installer.inc.php 22 Jul 2003 00:53:12 -0000 1.19 +++ serendipity_admin_installer.inc.php 22 Jul 2003 16:44:00 -0000 1.20 @@ -5,71 +5,71 @@ function serendipity_query_default($optname, $default) { - switch ($optname) { - case "serendipityPath": - return dirname(__FILE__) . '/'; + switch ($optname) { + case "serendipityPath": + return dirname(__FILE__) . '/'; - case "serendipityHTTPPath": - return dirname($_SERVER['PHP_SELF']) . '/'; + case "serendipityHTTPPath": + return dirname($_SERVER['PHP_SELF']) . '/'; - case "baseURL": - $ssl = $_SERVER['HTTPS'] == 'on'; - $port = $_SERVER['SERVER_PORT']; + case "baseURL": + $ssl = $_SERVER['HTTPS'] == 'on'; + $port = $_SERVER['SERVER_PORT']; - return sprintf("http%s://%s%s%s/", - $ssl ? 's' : '', - $_SERVER['HTTP_HOST'], - (($ssl && $port != 443) || (!$ssl && $port != 80)) ? (':' . $port) : '', - dirname($_SERVER['PHP_SELF']) - ); - - case "convert": - $path = explode(":", $_ENV['PATH']); - /* add some other possible locations to the path while we are at it, - * as these are not always included in the apache path */ - $path[] = '/usr/X11R6/bin'; + return sprintf("http%s://%s%s%s/", + $ssl ? 's' : '', + $_SERVER['HTTP_HOST'], + (($ssl && $port != 443) || (!$ssl && $port != 80)) ? (':' . $port) : '', + dirname($_SERVER['PHP_SELF']) + ); - foreach ($path as $dir) { - if (@is_executable($dir . '/convert')) { - return $dir . '/convert'; - } - } - return $default; - - default: - return $default; - } + case "convert": + $path = explode(":", $_ENV['PATH']); + /* add some other possible locations to the path while we are at it, + * as these are not always included in the apache path */ + $path[] = '/usr/X11R6/bin'; + + foreach ($path as $dir) { + if (@is_executable($dir . '/convert')) { + return $dir . '/convert'; + } + } + return $default; + + default: + return $default; + } } function serendipity_parseTemplate($n) { - global $serendipity; - $config = array(); + global $serendipity; + $config = array(); $t = file($n); for ($x=0; $x<count($t); $x++) { - $l = $t[$x]; + $l = $t[$x]; $l = trim($l); switch ($l[0]) { - // New Configure section - case "/": - if ($l[1] == "/") { + // New Configure section + case "/": + if ($l[1] == "/") { $current = trim(substr($l, 2)); $config[$current] = array(); } break; // A configure option - case "$": - // Grep out the name, type and default + case "$": + // Grep out the name, type and default preg_match('#\{([^|]+\|[^|]+\|([^}]+)?)\}[^/]+/{2}(.+)#msi', $l, $match); $c = explode("|", $match[1]); $config[$current][] = array("longname" => $c[0], - "name" => $c[1], + "name" => $c[1], "type" => $c[2], "default" => serendipity_query_default($c[1], $c[3]), - "distdefault" => $c[3], + "distdefault" => $c[3], "desc" => $match[3]); break; } @@ -79,54 +79,52 @@ } function serendipity_guessInput($type,$name,$value='',$default='') { - - switch ($type) { - case 'bool' : - echo "<input type='radio' name='".$name."' value='true' "; - echo (($default==true) ? "CHECKED" : "")."> Yes"; - echo "<input type='radio' name='".$name."' value='false' "; - echo (($default==true) ? "" : "CHECKED")."> No"; - break; - case 'protected' : - echo "<input type='password' size='30' name='".$name."' value=\""; - echo htmlentities($default)."\">"; - - break; - default : - echo "<input type='text' size='30' name='".$name."' value=\""; - echo htmlentities($default)."\">"; - break; - } + switch ($type) { + case 'bool' : + echo "<input type='radio' name='".$name."' value='true' "; + echo (($default==true) ? "CHECKED" : "")."> Yes"; + echo "<input type='radio' name='".$name."' value='false' "; + echo (($default==true) ? "" : "CHECKED")."> No"; + break; + case 'protected' : + echo "<input type='password' size='30' name='".$name."' value=\"". htmlentities($default) ."\">"; + + break; + + default : + echo "<input type='text' size='30' name='". $name ."' value=\"". htmlentities($default) ."\">"; + break; + } } function serendipity_printConfigTemplate($t, $from = false) { - global $serendipity; + global $serendipity; echo "<form action='?' method='POST'>"; echo "<input type='hidden' name='serendipity[adminModule]' value='installer'>"; echo "<input type='hidden' name='installAction' value='check'>"; echo "<br>"; foreach ($t as $key => $value) { - echo "<table width='100%' cellspacing='2'>"; - echo "<tr><td colspan='2'><font size='2'>$key:</font></td></tr>"; - echo "<tr><td><table width='100%' cellspacing='2' cellpadding='3'>"; - for ($x=0; $x<count($value); $x++) { - if (@is_array($from)) $value[$x]["default"] = $from[$value[$x]["name"]]; - echo "<tr>"; - echo "<td bgcolor='#D8D8D8' valign='top'><font size='2'><strong>".$value[$x]["longname"]."</strong></font><br><font size='1' color='5E7A94'>(". $value[$x]["type"] .") ".$value[$x]["desc"]."</font></td>"; - echo "<td bgcolor='#E0E0E0' valign='top' width='1'><font size='2'>"; - - echo serendipity_guessInput($value[$x]["type"], $value[$x]["name"], $from[$value[$x]["name"]], $value[$x]["default"]); - - echo "</font></td>"; - echo "</tr>"; - - } - echo "</table>"; - echo "</td></tr>"; - echo "</table>"; - echo "<p>"; + echo "<table width='100%' cellspacing='2'>"; + echo "<tr><td colspan='2'><font size='2'>$key:</font></td></tr>"; + echo "<tr><td><table width='100%' cellspacing='2' cellpadding='3'>"; + for ($x=0; $x<count($value); $x++) { + if (@is_array($from)) $value[$x]["default"] = $from[$value[$x]["name"]]; + echo "<tr>"; + echo "<td bgcolor='#D8D8D8' valign='top'><font size='2'><strong>".$value[$x]["longname"]."</strong></font><br><font size='1' color='5E7A94'>(". $value[$x]["type"] .") ".$value[$x]["desc"]."</font></td>"; + echo "<td bgcolor='#E0E0E0' valign='top' width='1'><font size='2'>"; + + echo serendipity_guessInput($value[$x]["type"], $value[$x]["name"], $from[$value[$x]["name"]], $value[$x]["default"]); + + echo "</font></td>"; + echo "</tr>"; + + } + echo "</table>"; + echo "</td></tr>"; + echo "</table>"; + echo "<p>"; } echo "<input type='submit' value='Check & save'>"; echo "</form>"; @@ -150,10 +148,10 @@ $in_table = 1; $def = $line; } - - if (preg_match('#^create\s*(\{fulltext\}|unique)\s*index#i', $line)) { - array_push($queries, $line); - } + + if (preg_match('#^create\s*(\{fulltext\}|unique)\s*index#i', $line)) { + array_push($queries, $line); + } } } fclose($fp); @@ -161,182 +159,216 @@ return $queries; } -switch ($_POST["installAction"]) { - case "check": - // Check dirs - if (!is_dir($_POST["serendipityPath"])) { - $errs[] = $_POST["serendipityPath"]." does not exist, create it."; - } - elseif (!is_writable($_POST["serendipityPath"])) { - $errs[] = "I can't write to ".$_POST["serendipityPath"]." check permissions!"; - } - elseif (!is_dir($_POST["serendipityPath"].$_POST["uploadPath"]) - && @mkdir($_POST["serendipityPath"].$_POST["uploadPath"], 0770) !== true) { - $errs[] = $_POST["serendipityPath"].$_POST["uploadPath"]." does not exist and I couldn't create it. You do it."; - } +function serendipity_checkInstallation() { + global $serendipity; - // Check paths - elseif (!is_writable($_POST["serendipityPath"].$_POST["uploadPath"])) { - $errs[] = "I can't write to ".$_POST["serendipityPath"].$_POST["uploadPath"]."!"; - $errs[] = " -> run <i>chmod g+rwx ".$_POST["serendipityPath"].$_POST["uploadPath"]."</i>"; - } + // Check dirs + if ( !is_dir($_POST["serendipityPath"]) ) { + $errs[] = $_POST["serendipityPath"]." does not exist, create it."; + } + elseif ( !is_writable($_POST["serendipityPath"]) ) { + $errs[] = "I can't write to ".$_POST["serendipityPath"]." check permissions!"; + } + elseif ( !is_dir($_POST["serendipityPath"].$_POST["uploadPath"] ) && @mkdir($_POST["serendipityPath"].$_POST["uploadPath"], 0770) !== true) { + $errs[] = $_POST["serendipityPath"].$_POST["uploadPath"]." does not exist and I couldn't create it. You do it."; + } + elseif ( !is_writable($_POST["serendipityPath"].$_POST["uploadPath"]) ) { + $errs[] = "I can't write to ".$_POST["serendipityPath"].$_POST["uploadPath"]."!"; + $errs[] = " -> run <i>chmod g+rwx ".$_POST["serendipityPath"].$_POST["uploadPath"]."</i>"; + } - // Attempt to create the archives directory - if (!is_dir($_POST["serendipityPath"]."archives") && - @mkdir($_POST["serendipityPath"]."archives", 0770) !== true) { - $errs[] = "Couldn't create the archives directory, you do it:"; - $errs[] = " -> Run <i>mkdir ".$_POST["serendipityPath"]."archives</i>"; - $errs[] = " -> and <i>chmod g+rwx ".$_POST["serendipityPath"]."archives</i>"; - } + // Attempt to create the archives directory + if ( !is_dir($_POST["serendipityPath"]."archives") && @mkdir($_POST["serendipityPath"]."archives", 0770) !== true ) { + $errs[] = "Couldn't create the archives directory, you do it:"; + $errs[] = " -> Run <i>mkdir ".$_POST["serendipityPath"]."archives</i>"; + $errs[] = " -> and <i>chmod g+rwx ".$_POST["serendipityPath"]."archives</i>"; + } - // Attempt to create the plugins dir - if (!is_dir($_POST['serendipityPath'] . "plugins") && - @mkdir($_POST['serendipityPath'] . "plugins", 0770) !== true) { - $errs[] = "Couldn't create the plugins directory, you do it:"; - $errs[] = " -> Run <i>mkdir ".$_POST["serendipityPath"]."plugins</i>"; - $errs[] = " -> and <i>chmod g+rwx ".$_POST["serendipityPath"]."plugins</i>"; - } + // Attempt to create the plugins dir + if ( !is_dir($_POST['serendipityPath'] . "plugins") && @mkdir($_POST['serendipityPath'] . "plugins", 0770) !== true ) { + $errs[] = "Couldn't create the plugins directory, you do it:"; + $errs[] = " -> Run <i>mkdir ".$_POST["serendipityPath"]."plugins</i>"; + $errs[] = " -> and <i>chmod g+rwx ".$_POST["serendipityPath"]."plugins</i>"; + } - $_POST['dbType'] = strtolower(basename($_POST['dbType'])); - foreach ($_POST as $k => $v) { - if (substr($k, 0, 2) == 'db' || $k == 'serendipityPath') { - $serendipity[$k] = $v; - } - } - $serendipity['dbType'] = $_POST['dbType']; - include_once $_POST['serendipityPath'] . '/serendipity_db.inc.php'; - - // Probe database (do it after the dir stuff, as we need to be able to create the - // sqlite database) - serendipity_db_probe($_POST, $errs); + // Check imagick + if ($_POST["magick"] == "true" && !is_executable($_POST["convert"])) { + $errs[] = "Can't execute convert imagemagick binary!"; + } - // Check imagick - if ($_POST["magick"] == "true" && !is_executable($_POST["convert"])) { - $errs[] = "Can't execute convert binary!"; - } + $serendipity['dbType'] = $_POST['dbType']; + include_once $_POST['serendipityPath'] . '/serendipity_db.inc.php'; - // Something went wrong - if (is_array($errs) && count($errs)) { - echo "<font color='#ff0000'>".implode("<br>", $errs)."</font><p>"; - serendipity_printConfigTemplate(serendipity_parseTemplate("./serendipity_config_local.tpl"), $_POST); - } else { - if (IN_serendipity !== true) { - // Create tables - echo "Attempting to setup Database...<br>"; - $queries = serendipity_parse_sql_tables('./db.sql'); - $queries = str_replace("{PREFIX}", $_POST['dbPrefix'], $queries); - foreach ($queries as $query) { - serendipity_db_schema_import($query); - } - if($_POST['want_mail'] == true) { - $mail_comments = 1; - } else { - $mail_comments = 0; - } - $enc_pass = md5($_POST['pass']); - $query = "INSERT INTO $_POST[dbPrefix]authors - (username, password, email, mail_comments) - VALUES('$_POST[user]', - '$enc_pass', - '$_POST[email]', - $mail_comments) "; - serendipity_db_query($query); - include_once $_POST['serendipityPath'] . '/serendipity_functions_config.inc.php'; - serendipity_set_config_var('template', 'default'); - $text = serendipity_db_escape_string(file_get_contents('./serendipity.css')); - $query = "INSERT into $_POST[dbPrefix]css (name, data) values ('default', '$text')"; - $res = serendipity_db_query($query); - if (is_string($res)) { - echo $res; - } else { - echo " Done"; - } - echo "<br>"; - } - // Create .htaccess - $a = file("./htaccess.tpl"); - $fp = @fopen("./.htaccess", "w"); - if (!$fp) { - echo "<font color='#ff0000'>Error: Could not create <b>.htaccess</b> file, create it yourself\n"; - echo "<br>* Just copy the code below and place it in .htaccess in your serendipity folder:<b><pre>\n"; - echo str_replace("{PREFIX}", $_POST["serendipityHTTPPath"], implode("", $a)); - echo "</pre></b></font>"; - } - else { - for($x = 0; $x < count($a); $x++) { - fwrite($fp, str_replace(array('{PREFIX}','{indexFile}'), array($_POST['serendipityHTTPPath'], $_POST['indexFile']),$a[$x])); - } - fclose($fp); - } + // Probe database + // (do it after the dir stuff, as we need to be able to create the sqlite database) + serendipity_db_probe($_POST, $errs); - // Save all basic config variables to the database - $p = serendipity_parseTemplate("./serendipity_config_local.tpl"); - foreach($p as $key=>$value) { - foreach ($value as $entry) { - serendipity_set_config_var($entry['name'], $_POST[$entry['name']]); - } - } - // Create a basic configuration file which gives enough information to open - // the database and get information from the database tables - $configfp = fopen("./serendipity_config_local.inc.php", "w"); - if (!is_resource($configfp)) { - echo '<font color="#ff0000">Error! Could not write to ./serendipity_config_local.inc.php</font><br>'; - echo "Try <i>chown -R www:www {$_POST['serendipityPath']}</i><br>"; - echo "followd by <i>chmod 770 {$_POST['serendipityPath']}</i> (change www to the"; - echo "user apache runs as.)</font><br />"; - echo "Once you've done this, hit your browser's \"reload\" button."; - exit(); - } + return $errs; +} - fwrite($configfp, "<?php\n"); - fwrite($configfp, "\$serendipity['dbName'] = '{$serendipity['dbName']}';\n"); - fwrite($configfp, "\$serendipity['dbPrefix'] = '{$serendipity['dbPrefix']}';\n"); - fwrite($configfp, "\$serendipity['dbHost'] = '{$serendipity['dbHost']}';\n"); - fwrite($configfp, "\$serendipity['dbUser'] = '{$serendipity['dbUser']}';\n"); - fwrite($configfp, "\$serendipity['dbPass'] = '{$serendipity['dbPass']}';\n"); - fwrite($configfp, "\$serendipity['dbType'] = '{$serendipity['dbType']}';\n"); - fwrite($configfp, "?>\n"); +function serendipity_installDatabase() { + global $serendipity; + // Create tables + $queries = serendipity_parse_sql_tables('./db.sql'); + $queries = str_replace("{PREFIX}", $_POST['dbPrefix'], $queries); - fclose($configfp); + foreach ($queries as $query) { + serendipity_db_schema_import($query); + } - chmod("./serendipity_config_local.inc.php", 0770); + if($_POST['want_mail'] == true) { + $mail_comments = 1; + } else { + $mail_comments = 0; + } - if (IN_serendipity !== true) { - define('IN_serendipity', true); - /* register default plugins */ - $GLOBALS['serendipity']['dbPrefix'] = $_POST['dbPrefix']; - $GLOBALS['serendipity']['dbName'] = $_POST['dbName']; - include_once "serendipity_plugin_api.php"; - serendipity_plugin_api::register_default_plugins(); + $enc_pass = md5($_POST['pass']); + $query = "INSERT INTO $_POST[dbPrefix]authors + (username, password, email, mail_comments) + VALUES('$_POST[user]', + '$enc_pass', + '$_POST[email]', + $mail_comments) "; + serendipity_db_query($query); - echo "<p>Welcome to serendipity!</b><p>"; - echo "Write down your password: ".$_POST["pass"]; - echo "<br>Your blog is now ready... <a href='".$_POST["serendipityHTTPPath"]."'>Check it out</a>"; - session_destroy(); - } else { - echo "Configuration variables saved"; - } - } - break; + include_once $_POST['serendipityPath'] . '/serendipity_functions_config.inc.php'; + serendipity_set_config_var('template', 'default'); + + $text = serendipity_db_escape_string(file_get_contents('./serendipity.css')); + $query = "INSERT into $_POST[dbPrefix]css (name, data) values ('default', '$text')"; + return serendipity_db_query($query); +} + +function serendipity_installFiles() { + + $a = file("./htaccess.tpl"); + $fp = @fopen("./.htaccess", "w"); + if ( !$fp ) { + $errs[] = "Error: Could not create the <b>.htaccess</b> file, create it yourself\n"; + $errs[] = "<br>* Just copy the code below and place it in .htaccess in your serendipity folder:<b><pre>\n"; + $errs[] = str_replace("{PREFIX}", $_POST["serendipityHTTPPath"], implode("", $a)); + $errs[] = "</pre></b>"; + return $errs; + } else { + for($x = 0; $x < count($a); $x++) { + fwrite($fp, str_replace(array('{PREFIX}','{indexFile}'), array($_POST['serendipityHTTPPath'], $_POST['indexFile']),$a[$x])); + } + fclose($fp); + return true; + } + +} + +function serendipity_updateConfiguration() { + global $serendipity; + + // Save all basic config variables to the database + $p = serendipity_parseTemplate("./serendipity_config_local.tpl"); + foreach($p as $key=>$value) { + foreach ($value as $entry) { + serendipity_set_config_var($entry['name'], $_POST[$entry['name']]); + } + } + + // Create a basic configuration file which gives enough information to open + // the database and get information from the database tables + $configfp = fopen("./serendipity_config_local.inc.php", "w"); + + if ( !is_resource($configfp) ) { + $errs[] = 'Could not write to ./serendipity_config_local.inc.php'; + $errs[] = "Try <i>chown -R www:www {$_POST['serendipityPath']}</i>"; + $errs[] = "Followd by <i>chmod 770 {$_POST['serendipityPath']}</i> (change www to the user apache runs as.)"; + $errs[] = "Once you've done this, hit your browser's \"reload\" button."; + return $errs; + } + + fwrite($configfp, "<?php\n"); + fwrite($configfp, "\t\$serendipity['dbName'] = '{$serendipity['dbName']}';\n"); + fwrite($configfp, "\t\$serendipity['dbPrefix'] = '{$serendipity['dbPrefix']}';\n"); + fwrite($configfp, "\t\$serendipity['dbHost'] = '{$serendipity['dbHost']}';\n"); + fwrite($configfp, "\t\$serendipity['dbUser'] = '{$serendipity['dbUser']}';\n"); + fwrite($configfp, "\t\$serendipity['dbPass'] = '{$serendipity['dbPass']}';\n"); + fwrite($configfp, "\t\$serendipity['dbType'] = '{$serendipity['dbType']}';\n"); + fwrite($configfp, "?>\n"); + + fclose($configfp); + + chmod("./serendipity_config_local.inc.php", 0770); + return true; + +} + +switch ( $_POST["installAction"] ) { + case "check": + + /* If we already have serendipity installed, all we need to do is write the configuration again */ + if ( IN_serendipity !== true ) { + + $res = serendipity_checkInstallation(); + if ( is_array($res) ) { + echo "We detected some errors while running some diagnostics on your entered information:<br>"; + echo "<font color='#ff0000'>- ".implode("<br>", $res)."</font><p>"; + serendipity_printConfigTemplate(serendipity_parseTemplate("./serendipity_config_local.tpl"), $_POST); + die(); + } + + echo "All entered information appears to be valid.<br>"; + + /* We are good to go, lets install databases etc. */ + echo "Attemping to setup database..."; + $res = serendipity_installDatabase(); + if ( !is_string($res) ) { + echo " Done<br>"; + } else { + echo $res ."<br>"; + } + + /* Next are the files, .htaccess */ + echo "Attemping to write .htaccess file..."; + $res = serendipity_installFiles(); + if ( is_array($res) ) { + echo "<font color='#ff0000'>- ".implode("<br>", $res)."</font><p>"; + die(); + } + echo " Done<br>"; + + /* We are now installed */ + define('IN_serendipity', true); + + /* register default plugins */ + $GLOBALS['serendipity']['dbPrefix'] = $_POST['dbPrefix']; + $GLOBALS['serendipity']['dbName'] = $_POST['dbName']; + + include_once "serendipity_plugin_api.php"; + serendipity_plugin_api::register_default_plugins(); + echo "<p>Serendipity was successfully installed on your system<br>"; + echo "Please remember your password: '". $_POST['pass'] ."', your username is '". $_POST['user'] ."'<br>"; + echo "<br>You can find your new PHP blog here"; + session_destroy(); + + } + + $res = serendipity_updateConfiguration(); + if ( is_array($res) ) { + echo "We detected some errors while trying to update your configuration"; + echo "<font color='#ff0000'>- ".implode("<br>", $res)."</font><p>"; + } else { + echo "Configuration written & saved"; + } + + break; default: - if (file_exists("./serendipity_config_local.inc.php")) { - $from = &$serendipity; - } - else { - $from = false; - } + if ( file_exists("./serendipity_config_local.inc.php") ) { + $from = &$serendipity; + } + else { + $from = false; + } - serendipity_printConfigTemplate(serendipity_parseTemplate("./serendipity_config_local.tpl"), $from); + serendipity_printConfigTemplate(serendipity_parseTemplate("./serendipity_config_local.tpl"), $from); } -/* - * Local Variables: - * c-basic-offset: 4 - * tab-width: 4 - * indent-tabs-mode: t - * End: - */ /* vim: set sts=4 ts=4 expandtab : */ ?> |
From: <jt...@us...> - 2003-07-22 00:53:16
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv13627 Modified Files: serendipity_admin_installer.inc.php Log Message: Fixed a double insert on the _authors table. This file needs a style check. Index: serendipity_admin_installer.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_admin_installer.inc.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- serendipity_admin_installer.inc.php 9 Jul 2003 17:52:00 -0000 1.18 +++ serendipity_admin_installer.inc.php 22 Jul 2003 00:53:12 -0000 1.19 @@ -242,8 +242,7 @@ $mail_comments) "; serendipity_db_query($query); include_once $_POST['serendipityPath'] . '/serendipity_functions_config.inc.php'; - serendipity_set_config_var('template', 'default'); - serendipity_db_query($query); + serendipity_set_config_var('template', 'default'); $text = serendipity_db_escape_string(file_get_contents('./serendipity.css')); $query = "INSERT into $_POST[dbPrefix]css (name, data) values ('default', '$text')"; $res = serendipity_db_query($query); |
From: <jt...@us...> - 2003-07-21 02:50:33
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv18788 Modified Files: INSTALL serendipity_config_local.tpl serendipity_db.inc.php Log Message: Fixed a broken INSERT statement.\n\n*PLEASE USE Single quotes (') in SQL queries as double quotes (") do not work in postgres. Index: INSTALL =================================================================== RCS file: /cvsroot/php-blog/serendipity/INSTALL,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- INSTALL 8 Jul 2003 09:13:27 -0000 1.4 +++ INSTALL 21 Jul 2003 02:34:36 -0000 1.5 @@ -21,11 +21,12 @@ # REQUIREMENTS # ############################################################################### -1. .htaccess support +1. .htaccess support allowing overrides for DirectoryIndex 2. PHP Version 4 or greater (PHP 4.3.1 or greater recommended) 3. php.ini options: - error_reporting E_ALL & ~E_NOTICE (or lower) - file_uploads on (For import/image upload features) + - magic_quotes_gpc Off 4. php extensions: - None at this time. 5. Supported database engine: @@ -68,4 +69,4 @@ Thanks to: Daniel Freudenberger <be...@or...> -# $Id$ \ No newline at end of file +# $Id$ Index: serendipity_config_local.tpl =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_config_local.tpl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- serendipity_config_local.tpl 13 Jul 2003 16:16:18 -0000 1.11 +++ serendipity_config_local.tpl 21 Jul 2003 02:34:36 -0000 1.12 @@ -1,11 +1,11 @@ <?php # $Id$ // Database Settings -$serendipity['dbType'] = '{Database type|dbType|string|mysql}'; // Database type (mysql|postgres) +$serendipity['dbType'] = '{Database type|dbType|string|postgres}'; // Database type (mysql|postgres) $serendipity['dbHost'] = '{Database host|dbHost|string|localhost}'; // MySQL host -$serendipity['dbUser'] = '{Database user|dbUser|string|serendipity}'; // Username -$serendipity['dbPass'] = '{Database password|dbPass|string|serendipity}'; // Password -$serendipity['dbName'] = '{Database name|dbName|string|serendipity}'; // Name of your database +$serendipity['dbUser'] = '{Database user|dbUser|string|serendipity_test}'; // Username +$serendipity['dbPass'] = '{Database password|dbPass|string|fl@mboy3nt}'; // Password +$serendipity['dbName'] = '{Database name|dbName|string|serendipity_test}'; // Name of your database $serendipity['dbPrefix'] = '{Database prefix|dbPrefix|string|serendipity_}'; // Prefix for the table names, i.e. serendipity_ // Paths (note: don't forget trailing slashes for directories!!!!) @@ -18,16 +18,16 @@ $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 -$serendipity['pass'] = '{Admin password|pass|protected|john}'; // Password for admin login -$serendipity['email'] = '{Admin email|email|string|jo...@ex...}'; // Email for admin login +$serendipity['user'] = '{Admin username|user|string|Joseph Tate}'; // Username for admin login +$serendipity['pass'] = '{Admin password|pass|protected|friendly}'; // Password for admin login +$serendipity['email'] = '{Admin email|email|string|jt...@dr...}'; // 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|Joseph Tate's personal test 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? @@ -35,7 +35,7 @@ // Imageconversion Settings $serendipity['magick'] = '{Use Imagemagick|magick|bool|0}'; // Do you have image magick installed $serendipity['convert'] = '{Path to convert binary|convert|string|/usr/local/bin/convert}'; // Full path & name of your image magick convert binary -$serendipity['thumbSuffix'] = '{Thumbnail suffix|thumbSuffix|string|serendipityThumb}'; // Thumbnails will be named original.Suffix.ext -$serendipity['thumbSize'] = '{Thumbnail dimensions|thumbSize|int|110}'; // Dimensions of auto-generated thumbnails +$serendipity['thumbSuffix'] = '{Thumbnail suffix|thumbSuffix|string|stb}'; // Thumbnails will be named original.Suffix.ext +$serendipity['thumbSize'] = '{Thumbnail dimensions|thumbSize|int|150}'; // Dimensions of auto-generated thumbnails ?> Index: serendipity_db.inc.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_db.inc.php,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- serendipity_db.inc.php 8 Jul 2003 09:13:27 -0000 1.5 +++ serendipity_db.inc.php 21 Jul 2003 02:34:36 -0000 1.6 @@ -11,14 +11,14 @@ foreach ($values as $k => $v) { if (strlen($set)) $set .= ', '; - $set .= $k . '="' . serendipity_db_escape_string($v) . '"'; + $set .= $k . '=\'' . serendipity_db_escape_string($v) . '\''; } $where = ''; foreach ($keys as $k => $v) { if (strlen($where)) $where .= ' AND '; - $where .= $k . '="' . serendipity_db_escape_string($v) . '"'; + $where .= $k . '=\'' . serendipity_db_escape_string($v) . '\''; } if (strlen($where)) { @@ -38,7 +38,7 @@ foreach ($values as $k => $v) { if (strlen($vals)) $vals .= ', '; - $vals .= '"' . serendipity_db_escape_string($v) . '"'; + $vals .= '\'' . serendipity_db_escape_string($v) . '\''; } return serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}$table ($names) values ($vals)"); |
From: <jt...@us...> - 2003-07-21 02:37:20
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv19272 Modified Files: serendipity_config_local.tpl Log Message: Reverting erroneous patch Index: serendipity_config_local.tpl =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity_config_local.tpl,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- serendipity_config_local.tpl 21 Jul 2003 02:34:36 -0000 1.12 +++ serendipity_config_local.tpl 21 Jul 2003 02:37:12 -0000 1.13 @@ -1,11 +1,11 @@ <?php # $Id$ // Database Settings -$serendipity['dbType'] = '{Database type|dbType|string|postgres}'; // Database type (mysql|postgres) +$serendipity['dbType'] = '{Database type|dbType|string|mysql}'; // Database type (mysql|postgres) $serendipity['dbHost'] = '{Database host|dbHost|string|localhost}'; // MySQL host -$serendipity['dbUser'] = '{Database user|dbUser|string|serendipity_test}'; // Username -$serendipity['dbPass'] = '{Database password|dbPass|string|fl@mboy3nt}'; // Password -$serendipity['dbName'] = '{Database name|dbName|string|serendipity_test}'; // Name of your database +$serendipity['dbUser'] = '{Database user|dbUser|string|serendipity}'; // Username +$serendipity['dbPass'] = '{Database password|dbPass|string|serendipity}'; // Password +$serendipity['dbName'] = '{Database name|dbName|string|serendipity}'; // Name of your database $serendipity['dbPrefix'] = '{Database prefix|dbPrefix|string|serendipity_}'; // Prefix for the table names, i.e. serendipity_ // Paths (note: don't forget trailing slashes for directories!!!!) @@ -18,16 +18,16 @@ $serendipity['indexFile'] = '{Index file|indexFile|string|index.php}'; // Which file to use as index // General settings -$serendipity['user'] = '{Admin username|user|string|Joseph Tate}'; // Username for admin login -$serendipity['pass'] = '{Admin password|pass|protected|friendly}'; // Password for admin login -$serendipity['email'] = '{Admin email|email|string|jt...@dr...}'; // Email for admin login +$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|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|Joseph Tate's personal test 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? @@ -35,7 +35,7 @@ // Imageconversion Settings $serendipity['magick'] = '{Use Imagemagick|magick|bool|0}'; // Do you have image magick installed $serendipity['convert'] = '{Path to convert binary|convert|string|/usr/local/bin/convert}'; // Full path & name of your image magick convert binary -$serendipity['thumbSuffix'] = '{Thumbnail suffix|thumbSuffix|string|stb}'; // Thumbnails will be named original.Suffix.ext -$serendipity['thumbSize'] = '{Thumbnail dimensions|thumbSize|int|150}'; // Dimensions of auto-generated thumbnails +$serendipity['thumbSuffix'] = '{Thumbnail suffix|thumbSuffix|string|serendipityThumb}'; // Thumbnails will be named original.Suffix.ext +$serendipity['thumbSize'] = '{Thumbnail dimensions|thumbSize|int|110}'; // Dimensions of auto-generated thumbnails ?> |
From: <tom...@us...> - 2003-07-20 00:28:56
|
Update of /cvsroot/php-blog/serendipity In directory sc8-pr-cvs1:/tmp/cvs-serv32036 Modified Files: serendipity.css.php Log Message: Fixed replacement of {TEMPLATE_PATH} to be relative Index: serendipity.css.php =================================================================== RCS file: /cvsroot/php-blog/serendipity/serendipity.css.php,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- serendipity.css.php 13 Jul 2003 13:09:59 -0000 1.18 +++ serendipity.css.php 20 Jul 2003 00:28:52 -0000 1.19 @@ -3,7 +3,7 @@ header('Content-type: text/css'); function serendipity_printStylesheet($file) { global $serendipity; - echo str_replace('{TEMPLATE_PATH}', dirname($file) .'/', file_get_contents($file)); + echo str_replace('{TEMPLATE_PATH}', $serendipity['serendipityHTTPPath'] . $serendipity['templatePath'] . serendipity_get_config_var('template', 'default') .'/', file_get_contents($file)); } |