[Comoblog-commit] comoblog .cvsignore, NONE, 1.1 htaccess, 1.1, 1.2 pictureboard.php, 1.1, 1.2 VERS
Status: Inactive
Brought to you by:
markwallis
|
From: iamdecal <iam...@us...> - 2006-10-22 11:44:35
|
Update of /cvsroot/comoblog/comoblog In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27709 Modified Files: htaccess pictureboard.php VERSION add_comment.php index.php list_comments.php Added Files: .cvsignore Log Message: work in progress, ditching this server cos its borked ;( --- NEW FILE: .cvsignore --- .project Index: add_comment.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/add_comment.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- add_comment.php 24 Feb 2006 00:27:40 -0000 1.4 +++ add_comment.php 22 Oct 2006 11:44:01 -0000 1.5 @@ -17,45 +17,52 @@ else exit(); $form['comment_author'] = ''; -if (isset($_POST['comment_author'])) $form['comment_author'] = $_POST['comment_author']; +if (isset($_POST['comment_author'])) +{ $form['comment_author'] = $_POST['comment_author'];} $form['comment_author_email'] == ''; -if (isset($_POST['comment_author_email'])) $form['comment_author_email'] = $_POST['comment_author_email']; +if (isset($_POST['comment_author_email'])) +{ $form['comment_author_email'] = $_POST['comment_author_email'];} -$form['comment_text'] == ''; -if (isset($_POST['comment_text'])) $form['comment_text'] = $_POST['comment_text']; +$form['comment_author_url'] == ''; +if (isset($_POST['comment_author_url'])) +{ $form['comment_author_url'] = $_POST['comment_author_url'];} + +$form['comment_text'] == '';{ +if (isset($_POST['comment_text'])) $form['comment_text'] = $_POST['comment_text'];} // addition to allow HTML in comments if flagged - needs an admin option to turn on or off $form['comment_convert'] == ''; -if (isset($_POST['comment_convert'])) $form['comment_convert'] = $_POST['comment_convert']; +if (isset($_POST['comment_convert'])) { $form['comment_convert'] = $_POST['comment_convert'];} if ($_SERVER['REQUEST_METHOD'] == 'POST') { $errors = array(); - + if ($form['comment_author'] == '') array_push ($errors, 'Please type your name'); - + if ($form['comment_author_email'] != '' && !is_valid_email($form['comment_author_email'])) - array_push ($errors, 'Invalid email address'); - + array_push ($errors, 'Invalid email address'); + if ($form['comment_text'] == '') array_push ($errors, 'Please write your comment'); - + if (count($errors) == 0) { $comment = $form; - + $comment = comment_add ($comment); - $cookie_period = 60*60*24*365; + $cookie_period = 60*60*24*365; $domain = parse_url(CFG_SITE_URL); $domain = $domain['host']; - setcookie("comment-name", $form['comment_author'], time() + $cookie_period, "/", $domain, 0); - setcookie("comment-email", $form['comment_author_email'], time() + $cookie_period, "/", $domain, 0); + setcookie("comment_name", $form['comment_author'], time() + $cookie_period, "/", $domain, 0); + //TODO: why wont this one save? + setcookie("comment_url", $form['comment_author_url'], time() + $cookie_period, "/", $domain, 0); + setcookie("comment_email", $form['comment_author_email'], time() + $cookie_period, "/", $domain, 0); + - setcookie("comment-url", $form['comment_author_url'], time() + $cookie_period, "/", $domain, 0); - Header ("Location: list_comments.php?i=".$comment['post_id']); exit(); } @@ -74,14 +81,14 @@ $tpl->assign("ACTION", basename($_SERVER['PHP_SELF'])); -if (isset($_COOKIE['comment-name'])) - $form['comment_author'] = $_COOKIE['comment-name']; -if (isset($_COOKIE['comment-email'])) - $form['comment_author_email'] = $_COOKIE['comment-email']; -if (isset($_COOKIE['comment-url'])) - $form['comment_author_url'] = $_COOKIE['comment-url']; +if (isset($_COOKIE['comment_name'])) + $form['comment_author'] = $_COOKIE['comment_name']; +if (isset($_COOKIE['comment_email'])) + $form['comment_author_email'] = $_COOKIE['comment_email']; +if (isset($_COOKIE['comment_url'])) + $form['comment_author_url'] = $_COOKIE['comment_url']; $tpl->assign("FORM", $form); - + // html comments are allowed if (CFG_INTERACTION_HTML_COMMENTS == 'yes'){ Index: index.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/index.php,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- index.php 16 Aug 2006 16:46:36 -0000 1.6 +++ index.php 22 Oct 2006 11:44:01 -0000 1.7 @@ -1,5 +1,5 @@ <?php -if (!file_exists('include/param.inc.php')) { +if (!file_exists('include/param.inc.'. $_SERVER['SERVER_NAME'].'.php')) { Header ('Location: _install/install.php'); exit; } @@ -32,12 +32,12 @@ $y = substr($current_date,0,4); $m = substr($current_date,4,2); $d = substr($current_date,6,2); - + $current_timestamp = mktime(0,0,0,$m,$d,$y); if ($current_timestamp > time() || $current_timestamp <= 0) $current_timestamp = time(); } - else + else $current_timestamp = time(); } else { @@ -78,11 +78,11 @@ $posts[$c]['post_mail_date'] = strftime($CAL_DATE_FORMAT." %H:%M", $posts[$c]['post_mail_date']); $tpl->assign('POST', $posts[$c]); - + // topic icon if ($posts[$c]['topic_id'] != 0) $tpl->parse('main.post.topic'); - + // images if ($posts[$c]['post_images'] > 0) { $query = " @@ -92,7 +92,7 @@ and img_display = 'attach' "; $res = mysql_query($query); - + while ($row = mysql_fetch_assoc($res)) { if (eregi('\.3g2',$row['img_name'])) { $tpl->assign('IMAGE', $row); @@ -105,14 +105,14 @@ else { $tpl->assign('IMAGE', $row); $tpl->parse('main.post.img'); - } + } } } - + // author email if (CFG_INTERACTION_AUTHOR == 'yes') $tpl->parse('main.post.author'); - + // interaction bar if (CFG_INTERACTION_COMMENTS == 'yes') $tpl->parse('main.post.comment_button'); @@ -121,7 +121,7 @@ $tpl->parse('main.post.trackback_button'); } - + $tpl->parse('main.post'); } } @@ -144,7 +144,7 @@ if (count($TOP_MODULES) > 0) { for ($mod_cnt = 0; $mod_cnt < count($TOP_MODULES); $mod_cnt++) { // TODO get from cache - // or run query and store in cache + // or run query and store in cache include_once (CFG_BASE_PATH.'/modules/'.$TOP_MODULES[$mod_cnt].'/'.$TOP_MODULES[$mod_cnt].'.php'); $tpl->assign('TOP_MODULE',$mod_contents); $tpl->parse('main.top_bar.top_module'); Index: list_comments.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/list_comments.php,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- list_comments.php 16 Aug 2005 05:49:43 -0000 1.1.1.1 +++ list_comments.php 22 Oct 2006 11:44:01 -0000 1.2 @@ -1,45 +1,47 @@ -<?php -require_once ("include/config.inc.php"); - -if (CFG_INTERACTION_COMMENTS != 'yes') { - error_404(); -} - -$tpl = new XTemplate ("templates/list_comments.tpl.htm"); - -$tpl->assign('TXT', $TXT); - -$tpl->assign('CFG_BODY_BGCOLOR', CFG_BODY_BGCOLOR); -$tpl->assign('CFG_BACKGROUND_COLOR', CFG_BACKGROUND_COLOR); - -$post_id = ''; -if (isset($_GET['i'])) $post_id = $_GET['i']; - -$post = post_details ($post_id); -$tpl->assign("POST", $post); - -$comments = comment_list($post_id); - -if ($comments) { - for ($c = 0; $c < count($comments); $c++) { - $comments[$c]['comment_author_email'] = antispam ($comments[$c]['comment_author_email'], true); - - $tpl->assign("COMMENT", $comments[$c]); - - if ($comments[$c]['comment_author_email'] != '') - $tpl->parse("main.comments.comment.email"); - - $tpl->parse("main.comments.comment"); - } - $tpl->parse("main.comments"); -} -else { - $tpl->parse("main.nocomments"); -} - -$tpl->parse("main"); -$tpl->out("main"); - -// close db connection -mysql_close (); +<?php +require_once ("include/config.inc.php"); + +if (CFG_INTERACTION_COMMENTS != 'yes') { + error_404(); +} + +$tpl = new XTemplate ("templates/list_comments.tpl.htm"); + +$tpl->assign('TXT', $TXT); + +$tpl->assign('CFG_BODY_BGCOLOR', CFG_BODY_BGCOLOR); +$tpl->assign('CFG_BACKGROUND_COLOR', CFG_BACKGROUND_COLOR); + +$post_id = ''; +if (isset($_GET['i'])) $post_id = $_GET['i']; + +$post = post_details ($post_id); +$tpl->assign("POST", $post); + +$comments = comment_list($post_id); + +if ($comments) { + error_log ("got comment_id" . $comments[$c]['comment_id'] ); + + for ($c = 0; $c < count($comments); $c++) { + $comments[$c]['comment_author_email'] = antispam ($comments[$c]['comment_author_email'], true); + + $tpl->assign("COMMENT", $comments[$c]); + + if ($comments[$c]['comment_author_email'] != '') + $tpl->parse("main.comments.comment.email"); + + $tpl->parse("main.comments.comment"); + } + $tpl->parse("main.comments"); +} +else { + $tpl->parse("main.nocomments"); +} + +$tpl->parse("main"); +$tpl->out("main"); + +// close db connection +mysql_close (); ?> \ No newline at end of file Index: htaccess =================================================================== RCS file: /cvsroot/comoblog/comoblog/htaccess,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- htaccess 17 Feb 2006 15:16:36 -0000 1.1 +++ htaccess 22 Oct 2006 11:44:01 -0000 1.2 @@ -6,16 +6,10 @@ <IfModule mod_rewrite.c> RewriteEngine on - # Modify the RewriteBase - # If you are using comoblog in a subdirectory and - # the rewrite rules are not working properly, - # you may need to change this to the direcotory - #RewriteBase /comoblog - - # make sure what we're looking for donsnt exist + # make sure what we're looking for dosn't exist RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d - + # we map urls in to form of # /123/abcdefghijklmon # or Index: VERSION =================================================================== RCS file: /cvsroot/comoblog/comoblog/VERSION,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- VERSION 23 Feb 2006 12:57:52 -0000 1.2 +++ VERSION 22 Oct 2006 11:44:01 -0000 1.3 @@ -1 +1 @@ -1.2 +1.3 Index: pictureboard.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/pictureboard.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pictureboard.php 16 Aug 2006 11:06:14 -0000 1.1 +++ pictureboard.php 22 Oct 2006 11:44:01 -0000 1.2 @@ -1,9 +1,9 @@ <?php /* ADDED in 1.3 * Picture board shows a page full of images in a random or chronological order - * + * */ - + /* TODO add these constants to xml and upgrade * $limit = CFG_PICTURE_BOARD_LIMIT; * $order =""; @@ -11,14 +11,14 @@ $order= "post_date asc"; }else{ $order="rand()"; - } + } $dont_show_these =0; * $dont_show_these= CFG_PICTURE_BOARD_NO_SHOW; */ -if (!file_exists('include/param.inc.php')) { +if (!file_exists('include/param.inc'. $_SERVER['SERVER_NAME'].'.php')) { Header ('Location: _install/install.php'); exit; } @@ -30,7 +30,7 @@ exit; } - + $xtpl = new XTemplate ("templates/pictureboard.tpl.html"); //TODO - move to paramater $tpl->assign ('PAGE_TITLE', "Picture Board"); @@ -38,7 +38,7 @@ $images = get_images($limit); while ($row = mysql_fetch_assoc($images)) { - + $row['hasthumb'] =""; if ($row['img_thumb'] =="Y"){$row['hasthumb'] ="_thumb";} @@ -56,7 +56,7 @@ $query =" select " . "i.* ,p.post_mail_subject " . "from " . - "easymoblog_images i, easymoblog_posts p " . + "comoblog_images i, comoblog_posts p " . "where " . "i.post_id > 0 and " . "i.post_id not in ($dont_show_these) and " . |