KBD

Keith Devens .com

Wednesday, July 9, 2008 Flag waving
Although at the beginning the paradigm was worth consideration, now the entire effort in the primeval soup paradigm is self-... – Hubert P. Yockey (Information Theory and Molecular Biology, p336)
← Entry 1559Entry 1561 →

Daily link icon Tuesday, March 5, 2002

Entry 1560

I've decided to try adding comments to my weblog. I purposely didn't elaborate on this post because I think it'd be interesting to get comments from people. Too bad I won't be finished with the comments feature tonight.

Ok, I'm trying to get joins with MySQL to work right...

Alrighty, anyway, comments are in place and you can have fun with them. The only problem is that I have no indication of that here on my home page. Click on the chain link icon to go to an individual weblog entry with its comments.

Ok, I put a little comments link, just without a count Smiley

← Entry 1559Entry 1561 →

Comments XML gif

anonymous wrote:

aoueaoeu

∴ anonymous | 30-Nov-1999 12:00am est | #1

Keith (http://www.keithdevens.com) wrote:

This is a test comment

Keith | 30-Nov-1999 12:00am est | http://www.keithdevens.com | #2

testing (http://www.yahoo.com) wrote:

this is a test comment

∴ testing | 30-Nov-1999 12:00am est | http://www.yahoo.com | #3

blah (blah) wrote:

oeauoa

∴ blah | 5-Mar-2002 5:02am est | blah | #4

anonymous wrote:

testing

∴ anonymous | 5-Mar-2002 5:12am est | #5

Matt (http://www.yaysoft.com) wrote:

Hey Keith, looks good so far.

Oh yeah, and thanks for the remark about my comments system... I've been busy setting up my new personal site and just got back around to checking your blog.

The only problem with my little system is that it only works in newer versions of IE. I know how to make it work in Mozilla, but I'm too lazy to fix it.

But I do like this discussion-thread style comments method you have going.

∴ Matt | 5-Mar-2002 7:08am est | http://www.yaysoft.com | #8

'Matt' ('http://www.yaysoft.com') wrote:

<center><b>testing HTML<i>!!!</i></b></center><br>
<br>
Test<br>
Again.

∴ 'Matt' | 5-Mar-2002 7:09am est | 'http://www.yaysoft.com' | #9

Matt (http://www.yaysoft.com/) wrote:

Aside from the crazy quote escaping errors, which I'm pretty sure you're well aware of, you might also want to throw in an nl2br()...

∴ Matt | 5-Mar-2002 7:11am est | http://www.yaysoft.com/ | #10

The Other Keith&trade; (http://hereticmessiah.weblogs.com/) wrote:

I've got a better function (you can rip it out of the common.php file in Slant-PHP if you want) called paragraphise() that I use in preference to nl2br(). Any chance of putting some whitespace between the comments or something?

∴ The Other Keith&trade; | 5-Mar-2002 9:41am est | http://hereticmessiah.weblogs.com/ | #14

Matt (http://www.yaysoft.com/) wrote:

<?php
echo "hopefully this won't work";

?>
∴ Matt | 5-Mar-2002 10:03am est | http://www.yaysoft.com/ | #15

Keith (http://www.keithdevens.com/) wrote:

Yeah, in the hour or so I wrote the feature I forgot a lot of the nicities like making sure people don't break my HTML by adding their own, and using nl2br. I'll add those and a few other features later, like remembering your name, email, etc, in a cookie so you don't have to fill it out every time. I definitely would like to see your paragraphise function, Keith. Though I do have my own markup thing (http://www.keithdevens.com/weblog/?id1349), (http://www.keithdevens.com/weblog/?id1341) that would be perfect to use for the comments here, since it won't slow down my main weblog page. I've been meaning to check out Slant-PHP but haven't had a chance yet. Finally, in case any of you are worried about spam-bots getting your e-mail addresses from posting on my site, I encode them so it makes it a little less likely that they'll be harvested. Do a view source and you'll see what I mean.

Keith | 5-Mar-2002 12:44pm est | http://www.keithdevens.com/ | #17

Keith wrote:

testing

Keith | 5-Mar-2002 1:15pm est | #19

Keith wrote:

testing's with quotes '' " and stuff

Keith | 5-Mar-2002 1:16pm est | #20

The Other Keith&trade; (http://hereticmessiah.weblogs.com/) wrote:

Here's the code. I'm sure it'll get mangled, but hopefully not too badly. I've included setDefault 'cause it's just so small and incredibly useful. I must post my calendar code up on my website for you. I'll do that by the end of the week, I hope.

/**
* Converts any double newlines to <p> tags.
*
* $string String to paragraphise.
*
* @returns Paragraphised version of the string passed in.
*
* @author Keith Gaughan <kmgaughan@eircom.net>
* @version 0.1 (2001-01-22)
*/
function paragraphise($string)
{
// We need to be able to cope with dumb Windows browsers too.
if (strstr($string, "\r\n") != "")
return str_replace("\r\n\r\n", "\n<p>\n", $string);

return str_replace("\n\n", "\n<p>\n", $string);
}

/**
* Checks if $var is already defined and if not, sets it to $default.
*
* $var Variable to check.
* $default Value to give the checked variable if found to be null; "" by default.
* $catchNulls TRUE: treat empty strings as null; FALSE by default.
*
* @note It's a lot like ColdFusion's <CFPARAM> tag.
* @author Keith Gaughan <kmgaughan@eircom.net>
* @version 0.1 (2001-01-23)
*/
function setDefault(&$var, $default="", $catchNulls=false)
{
if (!isset($var) || ($catchNulls && $var == ""))
$var = $default;
}

∴ The Other Keith&trade; | 5-Mar-2002 1:26pm est | http://hereticmessiah.weblogs.com/ | #21

Keith (http://www.keithdevens.com/) wrote:

Testing cookie. It should remember my name, e-mail, and website from now on.

Keith | 5-Mar-2002 1:26pm est | http://www.keithdevens.com/ | #22

a (a) wrote:

a

∴ a | 5-Mar-2002 1:28pm est | a | #23

a (a) wrote:

a

∴ a | 5-Mar-2002 1:29pm est | a | #24

a (a) wrote:

a

∴ a | 5-Mar-2002 1:29pm est | a | #25

a (a) wrote:

a

∴ a | 5-Mar-2002 1:30pm est | a | #26

a (a) wrote:

a

∴ a | 5-Mar-2002 1:30pm est | a | #27

Keith (http://www.keithdevens.com/) wrote:

I tried to do the cookie and I broke it Smiley Gotta fix it when I get back from school.

Keith | 5-Mar-2002 1:32pm est | http://www.keithdevens.com/ | #28

The Other Keith&trade; (http://hereticmessiah.weblogs.com/) wrote:

As far as the counter goes, you could cheat for now and add an extra field to the posts table to count how many comments are associated with it. I'm refitting Slant-PHP into a personal weblog right now and I'll be faced with the same problem when I have time to refit the comments section.

∴ The Other Keith&trade; | 5-Mar-2002 1:33pm est | http://hereticmessiah.weblogs.com/ | #29

anonymous wrote:

testing

∴ anonymous | 5-Mar-2002 5:44pm est | #30

Keith (http://www.keithdevens.com/) wrote:

testing

Keith | 5-Mar-2002 5:47pm est | http://www.keithdevens.com/ | #31

Keith Devens (http://www.keithdevens.com/) wrote:

testing again

∴ Keith Devens | 5-Mar-2002 5:54pm est | http://www.keithdevens.com/ | #32

Keith (http://www.keithdevens.com/) wrote:

Cool, now it remembers your username and stuff that you put in last time.

Keith | 5-Mar-2002 5:54pm est | http://www.keithdevens.com/ | #33

Keith (http://www.keithdevens.com/) wrote:

This is a test... I'm trying to get it to send a cookie that won't expire when you close your browser.

Keith | 6-Mar-2002 12:35am est | http://www.keithdevens.com/ | #38

Keith (http://www.keithdevens.com/) wrote:

Testing again. It won't remember my cookie stuff Smiley

Keith | 6-Mar-2002 3:23am est | http://www.keithdevens.com/ | #39

Keith - Testing (blah website) wrote:

Testing again

∴ Keith - Testing | 8-Mar-2002 3:10pm est | blah website | #55

Keith (http://www.keithdevens.com/) wrote:

Testing again

Keith | 8-Mar-2002 3:10pm est | http://www.keithdevens.com/ | #56

Some Dude (http://dcortesi.com) wrote:

Testing cookies

∴ Some Dude | 30-Oct-2002 3:19am est | http://dcortesi.com | #955

Mishka (http://www.mishka.com/) wrote:

Mishka rules !

∴ Mishka | 23-Sep-2003 11:52am est | http://www.mishka.com/ | #2980

Feel free to post a comment below. Please see my comment policy.

Formatting Rules (No HTML):

  • **bold**, *italic*, _underlined_, --strikeout--
  • "text"="url" creates a link, and URLs are auto-highlighted
  • Blockquote: Like e-mail, begin paragraph with > (greater-than sign)
  • Lists: begin paragraph with *,-, or + (unordered), or # (ordered)
  • Code block: ?!code:language=perl|php|sql|javascript|etc.{\n}...{\n}?!/code

:
(will be your IP address if blank)
: (optional)
(Will not be shown on site)

: (optional)
:

July 2008
SunMonTueWedThuFriSat
 12345
6789101112
13141516171819
20212223242526
2728293031 



RSS feed RSS feed for Keith's Weblog
Atom feed Atom feed for Keith's Weblog
Weblog archive
Recent comments
  on 2 posts

Recent comments XML

getElementsByClass function

http://pitfalls.wordpress.com/2008/​07/07/querying-it-jquery-way-getele​ments...

maxgandalf: Jul 7, 5:50am

Generated in about 0.189s.

(Used 8 db queries)

mobile phone