iamb-dev Mailing List for IAMB -Iamb A Message Board (Page 2)
Status: Beta
Brought to you by:
rbowen
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(12) |
Dec
(74) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(42) |
Feb
(11) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
|
2002 |
Jan
|
Feb
|
Mar
(1) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Rich B. <rb...@us...> - 2001-01-31 00:43:45
|
Update of /cvsroot/iamb/iamb-dev In directory usw-pr-cvs1:/tmp/cvs-serv6764 Modified Files: IAMB.pm Log Message: Removing some stuff that is no longer needed. Index: IAMB.pm =================================================================== RCS file: /cvsroot/iamb/iamb-dev/IAMB.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** IAMB.pm 2001/01/13 20:57:02 1.1 --- IAMB.pm 2001/01/31 00:43:41 1.2 *************** *** 14,23 **** $self = bless { ! database => 'dbi:mysql:iamb', DBI_username => 'www', DBI_password => 'www', DBI_arg => '', ! base_url => '/cgi-bin/', templates => '/usr/local/apache/cgi-bin/iamb/templates', }, $class; # End object declaration --- 14,23 ---- $self = bless { ! database => 'dbi:mysql:iamb_dev', DBI_username => 'www', DBI_password => 'www', DBI_arg => '', ! base_url => '/cgi-bin/iamb/', templates => '/usr/local/apache/cgi-bin/iamb/templates', }, $class; # End object declaration |
From: Rich B. <rb...@us...> - 2001-01-29 03:49:12
|
Update of /cvsroot/iamb/iamb/Community In directory usw-pr-cvs1:/tmp/cvs-serv17047/Community Modified Files: IAMB.pm Log Message: And here's the other one. The code now works with a fresh database, as specified in the setup directory. Sorry this took all weekend. Index: IAMB.pm =================================================================== RCS file: /cvsroot/iamb/iamb/Community/IAMB.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** IAMB.pm 2000/12/04 16:46:15 1.3 --- IAMB.pm 2001/01/29 03:49:03 1.4 *************** *** 271,275 **** $sth = $self->dbh->prepare("select ID from " . $self->articles . " where parent = $args{article_id} ! order by date_time"); $sth->execute; $kids = $sth->fetchall_arrayref([0]); --- 271,275 ---- $sth = $self->dbh->prepare("select ID from " . $self->articles . " where parent = $args{article_id} ! order by timestamp"); $sth->execute; $kids = $sth->fetchall_arrayref([0]); *************** *** 302,305 **** --- 302,309 ---- Current revision: $Revision$ $Log$ + Revision 1.4 2001/01/29 03:49:03 rbowen + And here's the other one. The code now works with a fresh database, + as specified in the setup directory. Sorry this took all weekend. + Revision 1.3 2000/12/04 16:46:15 rbowen Fixed thread ordering |
From: Rich B. <rb...@rc...> - 2001-01-28 22:32:40
|
I submitted two diffs to the stable branch just now. Apparently I changed a field name in the database, but not in the code. Or something. I'm really confused at a moment. We'll be going to a party in a little bit. I understand that there's a football game of some kind, so I expect I'll have some time to hack on this there. Additionally, two people will be there that can give some insight into fixing the problems. Sorry this has not been resolved yet this weekend. Hopefully I'll have a fix tonight when I get back online. -- Rich Bowen -- Director of Web Application Development http://www.cre8tivegroup.com/ -- ri...@cr... Have trouble remembering things? http://www.mymissinghead.com/ |
From: Rich B. <rb...@us...> - 2001-01-28 22:30:23
|
Update of /cvsroot/iamb/iamb In directory usw-pr-cvs1:/tmp/cvs-serv5581 Modified Files: index.cgi Log Message: Date/Time field name change. Index: index.cgi =================================================================== RCS file: /cvsroot/iamb/iamb/index.cgi,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** index.cgi 2001/01/16 03:11:23 1.28 --- index.cgi 2001/01/28 22:30:14 1.29 *************** *** 95,99 **** $sth = $iamb->dbh->prepare("select $art.ID, $art.title, $art.body, ! $art.date_time, $art.author, $art.email, $art.email, $art.url, $art.parent, $art.link, $art.image, $art.authorID, $art.forumID, $art.threadID, --- 95,99 ---- $sth = $iamb->dbh->prepare("select $art.ID, $art.title, $art.body, ! $art.timestamp, $art.author, $art.email, $art.email, $art.url, $art.parent, $art.link, $art.image, $art.authorID, $art.forumID, $art.threadID, *************** *** 103,107 **** and $art.threadID = $thr.ID and $thr.ID in ( $selected_threads ) ! order by date_time "); --- 103,107 ---- and $art.threadID = $thr.ID and $thr.ID in ( $selected_threads ) ! order by timestamp "); *************** *** 159,163 **** my $article = { posted_time => strftime($timeformat, ! localtime($articles->{$kid}->{date_time})), # count => $details->{unread_count}, article => $articles->{$kid}->{ID}, --- 159,163 ---- my $article = { posted_time => strftime($timeformat, ! localtime($articles->{$kid}->{timestamp})), # count => $details->{unread_count}, article => $articles->{$kid}->{ID}, *************** *** 271,275 **** $details->{body} = join "<br>", @body; $details->{body} =~ s/(<br>){2,}/<p>/g; ! $details->{posted_time} = strftime($iamb->timeformat,localtime($details->{date_time})); if ($details->{image}) { --- 271,275 ---- $details->{body} = join "<br>", @body; $details->{body} =~ s/(<br>){2,}/<p>/g; ! $details->{posted_time} = strftime($iamb->timeformat,localtime($details->{timestamp})); if ($details->{image}) { *************** *** 393,397 **** } $sth = $iamb->dbh->prepare("insert into " . $iamb->articles . " ! (title, body, date_time, author, email, parent, image, authorID, forumID, threadID) values --- 393,397 ---- } $sth = $iamb->dbh->prepare("insert into " . $iamb->articles . " ! (title, body, timestamp, author, email, parent, image, authorID, forumID, threadID) values *************** *** 517,521 **** set title = $form->{title}, body = $form->{body}, ! date_time = $time, image = $form->{image} where ID = $form->{ID} --- 517,521 ---- set title = $form->{title}, body = $form->{body}, ! timestamp = $time, image = $form->{image} where ID = $form->{ID} *************** *** 877,881 **** $thread = "$spacer "; } ! $posted_time = strftime($iamb->timeformat,localtime($articles->{$id}->{date_time})); if ($unread->{$id}) { --- 877,881 ---- $thread = "$spacer "; } ! $posted_time = strftime($iamb->timeformat,localtime($articles->{$id}->{timestamp})); if ($unread->{$id}) { *************** *** 903,906 **** --- 903,909 ---- Current version: $Revision$ $Log$ + Revision 1.29 2001/01/28 22:30:14 rbowen + Date/Time field name change. + Revision 1.28 2001/01/16 03:11:23 rbowen Flat mode should show the entire thread, I think, rather than just this |
From: Rich B. <rb...@us...> - 2001-01-28 22:29:37
|
Update of /cvsroot/iamb/iamb/setup In directory usw-pr-cvs1:/tmp/cvs-serv5474/setup Modified Files: IAMB.mysql Log Message: Time/Date field changed name. I don't remember doing this in the stable branch, but evidentally I did. Index: IAMB.mysql =================================================================== RCS file: /cvsroot/iamb/iamb/setup/IAMB.mysql,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** IAMB.mysql 2001/01/07 21:58:28 1.3 --- IAMB.mysql 2001/01/28 22:29:28 1.4 *************** *** 12,16 **** title varchar(255), body text, ! date_time int(11), author varchar(255), email varchar(255), --- 12,16 ---- title varchar(255), body text, ! timestamp int(11), author varchar(255), email varchar(255), |
From: Rich B. <rb...@rc...> - 2001-01-27 13:13:00
|
Matt Cashner wrote: > > On Fri, 26 Jan 2001, Rich Bowen wrote: > > > The issue appears to be that the database schema is rather different > > between the stable and dev branches. I got the same error messages that > > you saw by using the dev branch database with the stable branch code. > > well yeah i expected this. problem is that i started with a fresh database > using the setup sql file. so do we have a bad database dump? I did a database dump and compared it to the one in CVS, and it had a null diff. However, I think that it is safe to say that I'm sufficiently confused at this point that I'm not sure whether it is correct, because I was working on the dev branch on my laptop. I worked a while last night on trying to reconcile the database differences, but I could not make the errors go away. Yet. This is really truly frustrating, and after the frustrations of the rest of the day, I gave up and went to bed. Maybe I'll have a chance to hack on it some today. -- Rich Bowen -- Director of Web Application Development http://www.cre8tivegroup.com/ -- ri...@cr... Have trouble remembering things? http://www.mymissinghead.com/ |
From: Matt C. <su...@qx...> - 2001-01-27 04:25:58
|
On Fri, 26 Jan 2001, Rich Bowen wrote: > The issue appears to be that the database schema is rather different > between the stable and dev branches. I got the same error messages that > you saw by using the dev branch database with the stable branch code. well yeah i expected this. problem is that i started with a fresh database using the setup sql file. so do we have a bad database dump? > Of course, there are probably other bugs too, but that seems to be the > cause of at least some of the problems. > > -- > Rich Bowen -- Director of Web Application Development > http://www.cre8tivegroup.com/ -- ri...@cr... > Have trouble remembering things? http://www.mymissinghead.com/ > > _______________________________________________ > Iamb-dev mailing list > Iam...@li... > http://lists.sourceforge.net/lists/listinfo/iamb-dev > |
From: Rich B. <rb...@rc...> - 2001-01-27 02:55:47
|
Matt Cashner wrote: > > ok. errors follow. what's up with this? am i moron or is this actually > broken? kinda frustrated at this point... The issue appears to be that the database schema is rather different between the stable and dev branches. I got the same error messages that you saw by using the dev branch database with the stable branch code. Of course, there are probably other bugs too, but that seems to be the cause of at least some of the problems. -- Rich Bowen -- Director of Web Application Development http://www.cre8tivegroup.com/ -- ri...@cr... Have trouble remembering things? http://www.mymissinghead.com/ |
From: Matt C. <su...@qx...> - 2001-01-27 00:29:26
|
ok. errors follow. what's up with this? am i moron or is this actually broken? kinda frustrated at this point... [Fri Jan 26 19:08:58 2001] index.cgi: DBD::mysql::st execute failed: You have an error in your SQL syntax near ' 0, [Fri Jan 26 19:08:58 2001] index.cgi: 0) [Fri Jan 26 19:08:58 2001] index.cgi: ' at line 8 at /usr/local/apache/vhosts/iamb/index.cgi line 403. [Fri Jan 26 19:08:58 2001] index.cgi: DBD::mysql::st execute failed: You have an error in your SQL syntax near 'and articleID = 0 [Fri Jan 26 19:08:58 2001] index.cgi: and marktype = 1 [Fri Jan 26 19:08:58 2001] index.cgi: ' at line 3 at /usr/local/apache/vhosts/iamb/index.cgi line 434. [Fri Jan 26 19:08:58 2001] index.cgi: DBD::mysql::st execute failed: You have an error in your SQL syntax near 'and articleID = 0' at line 2 at /usr/local/apache/vhosts/iamb/index.cgi line 227. [Fri Jan 26 19:08:58 2001] index.cgi: DBD::mysql::st execute failed: You have an error in your SQL syntax near '' at line 2 at /usr/lib/perl5/site_perl/Community/IAMB.pm line 253. [Fri Jan 26 19:08:58 2001] index.cgi: DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/lib/perl5/site_perl/Community/IAMB.pm line 254. [Fri Jan 26 19:08:58 2001] index.cgi: DBD::mysql::st execute failed: You have an error in your SQL syntax near 'and articleID = [Fri Jan 26 19:08:58 2001] index.cgi: ' at line 3 at /usr/lib/perl5/site_perl/Community/IAMB.pm line 264. [Fri Jan 26 19:08:58 2001] index.cgi: DBD::mysql::st fetchrow_array failed: fetch() without execute() at /usr/lib/perl5/site_perl/Community/IAMB.pm line 265. [Fri Jan 26 19:08:58 2001] index.cgi: DBD::mysql::st execute failed: You have an error in your SQL syntax near 'order by date_time' at line 3 at /usr/lib/perl5/site_perl/Community/IAMB.pm line 274. [Fri Jan 26 19:08:58 2001] index.cgi: DBD::mysql::st fetchall_arrayref failed: fetch() without execute() at /usr/lib/perl5/site_perl/Community/IAMB.pm line 275. |
From: Matt C. <su...@qx...> - 2001-01-26 23:37:32
|
so why doesnt an iamb-stable checkout work? adding a new article gets you all sorts of fun errors. *shrug* m. |
From: Rich B. <rb...@us...> - 2001-01-16 03:11:29
|
Update of /cvsroot/iamb/iamb/templates In directory usw-pr-cvs1:/tmp/cvs-serv29822/templates Modified Files: article.html Log Message: Flat mode should show the entire thread, I think, rather than just this article and it's decendants. Index: article.html =================================================================== RCS file: /cvsroot/iamb/iamb/templates/article.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** article.html 2000/12/26 18:55:46 1.2 --- article.html 2001/01/16 03:11:23 1.3 *************** *** 31,36 **** <a href="index.cgi?action=MarkThreadRead&thread=<% $threadID %>">Mark thread read</a> | ! <a href="index.cgi?action=Flat&article=<% $ID %>">Printable view of this ! article and all responses</a> ] --- 31,36 ---- <a href="index.cgi?action=MarkThreadRead&thread=<% $threadID %>">Mark thread read</a> | ! <a href="index.cgi?action=Flat&article=<% $parent %>">Printable view of this ! thread</a> ] |
From: Rich B. <rb...@us...> - 2001-01-16 03:11:29
|
Update of /cvsroot/iamb/iamb In directory usw-pr-cvs1:/tmp/cvs-serv29822 Modified Files: index.cgi Log Message: Flat mode should show the entire thread, I think, rather than just this article and it's decendants. Index: index.cgi =================================================================== RCS file: /cvsroot/iamb/iamb/index.cgi,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** index.cgi 2000/12/25 03:05:10 1.27 --- index.cgi 2001/01/16 03:11:23 1.28 *************** *** 261,264 **** --- 261,265 ---- } + $details->{parent} = $details->{parent} || $form->{article}; $details->{body} =~ s/\n/<br>/g; @body = split /<br>/, $details->{body}; *************** *** 902,905 **** --- 903,910 ---- Current version: $Revision$ $Log$ + Revision 1.28 2001/01/16 03:11:23 rbowen + Flat mode should show the entire thread, I think, rather than just this + article and it's decendants. + Revision 1.27 2000/12/25 03:05:10 rbowen SQL bug |
From: Rich B. <rb...@us...> - 2001-01-16 02:58:41
|
Update of /cvsroot/iamb/iamb-dev/IAMB In directory usw-pr-cvs1:/tmp/cvs-serv28803 Modified Files: Thread.pm Log Message: Docs Index: Thread.pm =================================================================== RCS file: /cvsroot/iamb/iamb-dev/IAMB/Thread.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** Thread.pm 2001/01/14 22:19:59 1.1 --- Thread.pm 2001/01/16 02:58:35 1.2 *************** *** 11,12 **** --- 11,21 ---- 1; + =head1 updated + + $thread->updated( time ); + + Gets or sets the updated time stamp on a thread - that is, when + the most recent article was posted in this thread. + + =cut + |
From: Rich B. <rb...@us...> - 2001-01-16 02:51:08
|
Update of /cvsroot/iamb/iamb-dev/IAMB In directory usw-pr-cvs1:/tmp/cvs-serv28156 Modified Files: User.pm Log Message: Make sure you can only get the password out of the database encrypted. Index: User.pm =================================================================== RCS file: /cvsroot/iamb/iamb-dev/IAMB/User.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** User.pm 2001/01/14 22:20:34 1.2 --- User.pm 2001/01/16 02:51:02 1.3 *************** *** 7,12 **** --- 7,30 ---- package IAMB::User; use base qw( IAMB::StdModule ); + require Digest::MD5; our @STD_FIELDS = qw( username screenname email password ); our $STD_TABLE = 'user'; + + sub password { + my $self = shift; + my ($set, $cryp); + if (@_) { + $set = shift; + $cryp = Digest::MD5::md5_base64($set); + return $cryp if ($cryp eq $self->{password}); + $self->{password} = $cryp; + $self->{modified}->{password} = 1; + } else { + $cryp = $self->{password}; + } + $cryp ||= undef; + return $cryp; + } + 1; |
From: Rich B. <rb...@us...> - 2001-01-14 22:21:15
|
Update of /cvsroot/iamb/iamb-dev/setup In directory usw-pr-cvs1:/tmp/cvs-serv21451/setup Modified Files: IAMB.mysql Log Message: Schema changes. Index: IAMB.mysql =================================================================== RCS file: /cvsroot/iamb/iamb-dev/setup/IAMB.mysql,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** IAMB.mysql 2000/11/17 03:35:25 1.1.1.1 --- IAMB.mysql 2001/01/14 22:21:05 1.2 *************** *** 1,7 **** ! # MySQL dump 6.0 # ! # Host: localhost Database: IAMB #-------------------------------------------------------- ! # Server version 3.22.23b # --- 1,7 ---- ! # MySQL dump 7.1 # ! # Host: localhost Database: iamb #-------------------------------------------------------- ! # Server version 3.22.32 # *************** *** 12,21 **** title varchar(255), body text, ! date_time int(11), ! author varchar(255), ! email varchar(255), ! url varchar(255), ! parent int(11), ! link varchar(255), image varchar(255), authorID int(11), --- 12,17 ---- title varchar(255), body text, ! timestamp int(11), ! parentID int(11), image varchar(255), authorID int(11), *************** *** 25,33 **** ); - CREATE TABLE thread ( - ID int(11), - updated int(11) - ); - # # Table structure for table 'forum' --- 21,24 ---- *************** *** 37,71 **** forum varchar(255), description text, - sort int(11), PRIMARY KEY (ID) ); # ! # Table structure for table 'login' # ! CREATE TABLE login ( ! ID int(11) DEFAULT '0' NOT NULL auto_increment, ! login varchar(50), ! lastvisit int(11), ! screenname varchar(100), ! email varchar(255), ! PRIMARY KEY (ID) ); # ! # Table structure for table 'unread' # ! CREATE TABLE unread ( userID int(11), articleID int(11), ! marktype int(11) ); ! CREATE TABLE lastvisit( ! ID int(11) default '0' not null auto_increment, ! userID int, ! forumID int, ! timestamp int, ! primary key (ID) ); --- 28,70 ---- forum varchar(255), description text, PRIMARY KEY (ID) ); # ! # Table structure for table 'lastvisit' # ! CREATE TABLE lastvisit ( ! userID int(11), ! forumID int(11), ! timestamp int(11) ); # ! # Table structure for table 'mark' # ! CREATE TABLE mark ( userID int(11), articleID int(11), ! mark int(11) ); ! # ! # Table structure for table 'thread' ! # ! CREATE TABLE thread ( ! ID int(11), ! updated int(11) ! ); ! ! # ! # Table structure for table 'user' ! # ! CREATE TABLE user ( ! ID int(11) DEFAULT '0' NOT NULL auto_increment, ! username varchar(50), ! screenname varchar(100), ! email varchar(255), ! password varchar(255), ! PRIMARY KEY (ID) ); |
From: Rich B. <rb...@us...> - 2001-01-14 22:20:44
|
Update of /cvsroot/iamb/iamb-dev/IAMB In directory usw-pr-cvs1:/tmp/cvs-serv21387 Modified Files: User.pm Log Message: Changes for database changes Index: User.pm =================================================================== RCS file: /cvsroot/iamb/iamb-dev/IAMB/User.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** User.pm 2001/01/13 20:57:03 1.1 --- User.pm 2001/01/14 22:20:34 1.2 *************** *** 7,11 **** package IAMB::User; use base qw( IAMB::StdModule ); ! our @STD_FIELDS = qw( fname lname login password ); our $STD_TABLE = 'user'; 1; --- 7,11 ---- package IAMB::User; use base qw( IAMB::StdModule ); ! our @STD_FIELDS = qw( username screenname email password ); our $STD_TABLE = 'user'; 1; |
From: Rich B. <rb...@us...> - 2001-01-14 22:20:09
|
Update of /cvsroot/iamb/iamb-dev/IAMB In directory usw-pr-cvs1:/tmp/cvs-serv21293 Added Files: Thread.pm Log Message: Thread API --- NEW FILE --- =head1 IAMB::Thread; IAMB A Message Board Thread =cut package IAMB::Thread; use base qw( IAMB::StdModule ); our @STD_FIELDS = qw( updated ); our $STD_TABLE = 'login'; 1; |
From: Rich B. <rb...@us...> - 2001-01-14 22:19:33
|
Update of /cvsroot/iamb/iamb-dev/IAMB In directory usw-pr-cvs1:/tmp/cvs-serv21199 Modified Files: StdModule.pm Log Message: Removed some TCG comments Index: StdModule.pm =================================================================== RCS file: /cvsroot/iamb/iamb-dev/IAMB/StdModule.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** StdModule.pm 2001/01/13 20:57:03 1.1 --- StdModule.pm 2001/01/14 22:19:23 1.2 *************** *** 278,302 **** $Log$ Revision 1.1 2001/01/13 20:57:03 rbowen Modules to start off new OO structure. - Revision 1.4 2001/01/12 21:43:22 rbowen - Moved a line up so that we only loop through the fields once. Many - electrons will be saved. - - Revision 1.3 2001/01/11 20:47:17 rbowen - Got rid of earlier change to the accessor method. - Small change in the save method, to take care of data types. - - Revision 1.2 2001/01/10 18:50:24 rbowen - Two changes. - The default accessor methods now only updates a attribute if it has actually - changed. That is, if you pass it an argument that is the same as the - existing value, it just ignores you. - Added an update method that accepts an object and a hash of values. The - object is updated to the new values, accepting only valid attributes. - - Revision 1.1 2001/01/10 15:11:06 rbowen - Shamelessly stolen from NUSA. Let the fun begin. - =cut --- 278,287 ---- $Log$ + Revision 1.2 2001/01/14 22:19:23 rbowen + Removed some TCG comments + Revision 1.1 2001/01/13 20:57:03 rbowen Modules to start off new OO structure. =cut + |
From: Rich B. <rb...@us...> - 2001-01-14 22:19:00
|
Update of /cvsroot/iamb/iamb-dev/IAMB In directory usw-pr-cvs1:/tmp/cvs-serv21143 Added Files: Forum.pm Log Message: Forum API --- NEW FILE --- =head1 IAMB::Forum; IAMB A Message Board Forum =cut package IAMB::Forum; use base qw( IAMB::StdModule ); our @STD_FIELDS = qw( forum description ); our $STD_TABLE = 'forum'; 1; |
From: Rich B. <rb...@us...> - 2001-01-14 22:18:46
|
Update of /cvsroot/iamb/iamb-dev/IAMB In directory usw-pr-cvs1:/tmp/cvs-serv21075 Added Files: Article.pm Log Message: Article API --- NEW FILE --- =head1 IAMB::Article; IAMB A Message Board Article =cut package IAMB::Article; use base qw( IAMB::StdModule ); our @STD_FIELDS = qw( title body timestamp image parentID authorID forumID threadID ); our $STD_TABLE = 'article'; =head1 Get/Set methods $title = $article->title; $article->title("This is the new title"); $body = $article->body; $article->body("New article body"); $time = $article->timestamp; $article->timestamp( time ); $image_url = $article->image; $parentID = $article->parentID; $authorID = $article->authorID; $threadID = $article->threadID; =head1 parent my $parent_article = $article->parent; Returns an article object for the article which is the parent of the current object. =cut sub parent { return IAMB::Article->new( id => $_[0]->parentID ); } =head1 author my $author = $article->author; Returns a user object for the author of the article. =cut sub author { return IAMB::User->new( id => $_[0]->authorID ); } =head1 thread my $thread = $article->thread; Returns a thread object for the thread of which this article is a part. =cut sub thread { return IAMB::Thread->new( id => $_[0]->threadID ); } =head1 delete $article->delete; Removes the article from the database. This method will also need some hooks int the stree manipulation code. =cut sub delete { my $self = shift; $self->dbh->do( "delete from " . $STD_TABLE . " where ID = " . $self->id ); # Delete note from the stree now return 1; } 1; =head1 Standard methods This module provides all the standard methods expected of a StdModule module. See the IAMB::StdModule documentation for more details. =cut |
From: Rich B. <rb...@us...> - 2001-01-13 20:56:35
|
Update of /cvsroot/iamb/iamb-dev/IAMB In directory usw-pr-cvs1:/tmp/cvs-serv4081/IAMB Added Files: StdModule.pm User.pm Log Message: Modules to start off new OO structure. --- NEW FILE --- # $Header: /cvsroot/iamb/iamb-dev/IAMB/StdModule.pm,v 1.1 2001/01/13 20:57:03 rbowen Exp $ package IAMB::StdModule; =head1 NAME IAMB::StdModule =head1 AUTHOR This code was written by The Creative Group, and has been gifted to the IAMB project. All lefts reversed. Live long and prosper. =head1 DATE $Date: 2001/01/13 20:57:03 $ =head1 SYNOPSIS package IAMB::User; use base qw(IAMB::StdModule); our @STD_FIELDS = qw(FName LName Address); our $STD_TABLE = 'user'; 1; # Yes, that's really how easy it all is =head1 DESCRIPTION Standard CRUD methods for a normal CGI application. =head1 DEFAULT METHODS =over 4 =cut use warnings; use strict; no strict qw(refs); use base qw(IAMB); use vars qw($AUTOLOAD $VERSION); ($VERSION = '$Revision: 1.1 $') =~ s/^.*?(\d+\.\d+).*$/$1/g; =head2 new() my $obj = IAMB::StdModule->new(); Instantiates an object in whatever class you happen to be calling this from. In order for an object to be sucessfully created, a @STD_FIELDS array must exist which contains the names of the fields which are allowed to be modified from the database. =cut sub new { my $class = shift; my %args = @_ if @_; my $self = IAMB->new(); # hehehe. yes symrefs are bad. but they're so much fun :) $args{TABLE} = ${"${class}::STD_TABLE"}; foreach(@{"${class}::STD_FIELDS"}) { $args{FIELDS}->{$_}++; } return undef unless $args{TABLE} and $args{FIELDS}; $self->{TABLE} = $args{TABLE}; $self->{FIELDS} = $args{FIELDS}; if($args{id}) { my $sth = $self->dbh->prepare("SELECT * FROM $args{TABLE} where ID = $args{id}"); $sth->execute; my $data = $sth->fetchrow_hashref; $sth->finish; $self->{$_} = $data->{$_} foreach keys %$data; $self->{id} = $args{id}; delete $self->{modified}; } else { foreach (keys %{$self->{FIELDS}}) { if (defined $args{$_}) { $self->{$_} = $args{$_}; $self->{modified}->{$_}++; } } } return bless $self, $class; } =head2 find() my $obj = IAMB::StdModule->find(UserID => 'cashnerm'); Instantiates an object in whatever class you happen to call this from based on the parameters you provide. Valid parameters are any fields in @STD_FIELDS. As the method name indiciates, this will find and return ONE object which mostly closely matches ALL your parameters. =cut sub find { my $class = shift; my $self = new($class); my $sql; if ( (scalar(@_)) > 0) { my %args = @_; $sql = "SELECT * FROM $self->{TABLE} WHERE "; my $count = 0; foreach (sort keys %args) { if($self->{FIELDS}->{$_}) { if ($count) { $sql .= "AND $_ = $args{$_} "; } else { $sql .= "$_ = $args{$_} "; } $count++; } } } else { $sql = "SELECT * FROM $self->{TABLE}"; } if (wantarray) { my @objs; my $entry; my $sth = $self->dbh->prepare($sql); $sth->execute; while ($entry = $sth->fetchrow_hashref) { my $obj = new($class); $obj->{$_} = $entry->{$_} foreach (keys %$entry); $obj->{id} = $obj->{ID}; push @objs, $obj; } return @objs; } else { $sql .= " LIMIT 1"; my $sth = $self->dbh->prepare($sql); $sth->execute; my $entry = $sth->fetchrow_hashref(); $sth->finish(); foreach (keys %$entry) { $self->{$_} = $entry->{$_}; } $self->{id} = $self->{ID}; return $self; } } sub list { return find(@_) } sub load { return new(@_) } sub id { return $_[0]->{id}; } sub ID { return $_[0]->{id}; } =head1 details my $details = $obj->details; Returns a hashref containing all the database field attribute values. Handy for passing to a template when you don't want to have to fetch them all yourself. =cut sub details { my $self = shift; my $return; foreach my $key (keys %{$self->{FIELDS}}) { $return->{$key} = $self->{$key}; } $return->{id} = $self->ID; $return->{ID} = $self->ID; return $return; } =head2 AUTOLOAD() All accessor methods are handled via an AUTOLOAD sub. You will not be able to create or modify elements which are not in the @STD_FIELDS list. =cut sub AUTOLOAD { my $self = shift; my ($method, $set, $ret); ($method = $AUTOLOAD) =~ s/.*:://; if ($self->{FIELDS}->{$method}) { if(@_) { $set = shift; return $set if $set eq $self->{method}; $self->{$method} = $set; $self->{modified}->{$method} = 1; } else { $ret = $self->{$method}; } } $ret ||= undef; return $ret; } =head2 update(); $obj->update( %hash_of_new_values ); Update a bunch of fields at one time, without the pain of doing one per line. =cut sub update { my $self = shift; my %args = @_; foreach my $key (keys %args) { if (defined($self->{FIELDS}->{$key})) { # next if $self->{$key} eq $args{$key}; $self->{$key} = $args{$key}; $self->{modified}->{$key} = 1; } } $self->save; } =head2 save() $obj->save(); Saves the data back to the database. Only modified fields are saved. =cut sub save { my $self = shift; if($self->{modified}) { my $sql; my @values; if($self->{id}) { $sql = "UPDATE $self->{TABLE} SET "; foreach my $key (sort (keys %{$self->{modified}})) { $sql .= "$key = ?, "; push @values, $self->{$key}; } chop $sql; chop $sql; $sql .= " WHERE ID=$self->{id}"; my $sth = $self->dbh->prepare($sql); $sth->execute(@values); } else { my $elements = 0; my @params; $sql = "INSERT INTO $self->{TABLE} ("; foreach (sort keys %{$self->{FIELDS}}) { $sql .= "$_, "; $elements++; push @params, $self->{$_}; } chop $sql; chop $sql; $sql .= ") VALUES ("; $sql .= '?,' x $elements; chop $sql; $sql .= ')'; my $sth = $self->dbh->prepare($sql); $sth->execute(@params); $sth->finish; $self->{id} = $self->GetNewID(); } delete $self->{modified}; } } 1; =head1 HISTORY $Log: StdModule.pm,v $ Revision 1.1 2001/01/13 20:57:03 rbowen Modules to start off new OO structure. Revision 1.4 2001/01/12 21:43:22 rbowen Moved a line up so that we only loop through the fields once. Many electrons will be saved. Revision 1.3 2001/01/11 20:47:17 rbowen Got rid of earlier change to the accessor method. Small change in the save method, to take care of data types. Revision 1.2 2001/01/10 18:50:24 rbowen Two changes. The default accessor methods now only updates a attribute if it has actually changed. That is, if you pass it an argument that is the same as the existing value, it just ignores you. Added an update method that accepts an object and a hash of values. The object is updated to the new values, accepting only valid attributes. Revision 1.1 2001/01/10 15:11:06 rbowen Shamelessly stolen from NUSA. Let the fun begin. =cut --- NEW FILE --- =head1 IAMB::User; IAMB A Message Board User =cut package IAMB::User; use base qw( IAMB::StdModule ); our @STD_FIELDS = qw( fname lname login password ); our $STD_TABLE = 'user'; 1; |
From: Rich B. <rb...@us...> - 2001-01-13 20:56:35
|
Update of /cvsroot/iamb/iamb-dev In directory usw-pr-cvs1:/tmp/cvs-serv4081 Added Files: IAMB.pm Log Message: Modules to start off new OO structure. --- NEW FILE --- package IAMB; use CGI_Lite; use DBI; use Text::Template; =head1 NAME IAMB - IAMB A Message Board =cut sub new { my $class = shift; $self = bless { database => 'dbi:mysql:iamb', DBI_username => 'www', DBI_password => 'www', DBI_arg => '', base_url => '/cgi-bin/', templates => '/usr/local/apache/cgi-bin/iamb/templates', }, $class; # End object declaration return $self; } # End of constructor method sub database {$_[0]->{database}}; sub DBI_username {$_[0]->{DBI_username}}; sub DBI_password {$_[0]->{DBI_password}}; sub DBI_arg {$_[0]->{DBI_arg}}; sub cgi { my $self = shift; $self->{_cgi} = CGI::Lite->new() unless $self->{_cgi}; return $self->{_cgi}; } sub form { my $self = shift; $self->{_form} = $self->cgi->parse_form_data() unless $self->{_form}; return $self->{_form}; } sub templates { return $_[0]->{templates}; } sub base_url { return $_[0]->{base_url}; } sub dbconnect { my $self = shift; $self->{_dbh} = DBI->connect($self->database, $self->DBI_username, $self->DBI_password, $self->DBI_arg) || die ("Could not connect to $self->database\n"); return 1; } =head1 dbh my $dbh = $m->dbh -or- $sth = $m->dbh->prepare("select stuff"); C<dbconnect> and C<dbdisconnect> get called at the right times for you, so The Right Thing happens. =cut sub dbh { my $self = shift; $self->dbconnect unless $self->{_dbh}; return $self->{_dbh}; } sub dbdisconnect { my $self = shift; my $dbh = $self->{_dbh}; $dbh->disconnect if $dbh; } sub DESTROY { my $self=shift; $self->dbdisconnect; } =head1 do_cgi_stuff $content = $m->do_cgi_stuff( TEMPLATE => 'other/template/directory', Default => \&Main, Poop => \&Poop, ); =cut sub do_cgi_stuff { my ($self, %args) = @_; my $templatedir = (exists $args{TEMPLATE}) ? $args{TEMPLATE} : ''; delete $args{TEMPLATE} if exists $args{TEMPLATE}; $templatedir .= '/' if $templatedir; my $routine = (defined($args{$self->form->{action}})) ? $args{$self->form->{action}} : $args{Default} ; my ($template, $details) = $routine->($self); my $fill = new Text::Template ( TYPE => 'FILE', DELIMITERS => [ '<%', '%>' ], SOURCE => $self->templates . '/' . $templatedir . $template . '.html' ); return $fill->fill_in( HASH => $details ); } sub GetNewID { my $self = shift; my $sth = $self->dbh->prepare("SELECT LAST_INSERT_ID()"); $sth->execute(); my ($id) = $sth->fetch; return $id->[0]; } 1; |
From: Rich B. <rb...@us...> - 2001-01-13 20:55:58
|
Update of /cvsroot/iamb/iamb-dev/IAMB In directory usw-pr-cvs1:/tmp/cvs-serv4051/IAMB Log Message: Directory /cvsroot/iamb/iamb-dev/IAMB added to the repository |
From: Wesley <wsh...@qx...> - 2001-01-13 12:36:57
|
I thought RT was wonderful. Assuming the SourceForge site can link to it, so that people who find the project via SourceForge can get to the RT requests that way, it sounds like it would be an overall win. I don't think we would be the first SourceForge project to have a home page or other project resources apart from SourceForge, either. Rich Bowen wrote: > > As discussed at work yesterday, a major shortcoming of SourceForge is > that it does not send out nearly enough email. It's my thought that > EVERY change that happens to the project - bug submissions, patches, > support requests, news items, everything - needs to generate email to > anyone that is interested, particularly to the project admins. > > RT did this. And, frankly, I never grasped what the great UI difficulty > was that people had, so I can't really comment on making it easier to > use. > > So, just throwing this out there for discussion - What do people think > about moving back to RT on iamb.rcbowen.com (or iamb.tm3.org, or > iamb.boxofclue.com or whatever other domain amuses you) so that we can > get the deluge of email that we all crave? > > Which, of course, begs the question of what we actually gained by moving > to SourceForge. I, for one, feel that SourceForge has not measured up to > my rather lofty expectations. Although there are some things that are > vastly easier, there are other things that are just painful. I've been > trying to get CVS auto-diff email working for over a month, and it took > about 10 minutes on my server here at home. > > Anyways, discuss amoungst yourselves. > > -- > Rich Bowen -- Director of Web Application Development > http://www.cre8tivegroup.com/ -- ri...@cr... > Have trouble remembering things? http://www.mymissinghead.com/ -- Wes Sheldahl wsh...@qx... |
From: Rich B. <rb...@rc...> - 2001-01-12 14:15:25
|
I guess I should send this to this mailing list also, since there are a few people on here that are not on the other list. -------- Original Message -------- Subject: [Iamb-dev-internal] RT, SourceForge Date: Fri, 12 Jan 2001 09:11:29 -0500 From: Rich Bowen <rb...@rc...> Reply-To: iam...@li... Organization: RCBowen.com To: iamb internals <iam...@li...> As discussed at work yesterday, a major shortcoming of SourceForge is that it does not send out nearly enough email. It's my thought that EVERY change that happens to the project - bug submissions, patches, support requests, news items, everything - needs to generate email to anyone that is interested, particularly to the project admins. RT did this. And, frankly, I never grasped what the great UI difficulty was that people had, so I can't really comment on making it easier to use. So, just throwing this out there for discussion - What do people think about moving back to RT on iamb.rcbowen.com (or iamb.tm3.org, or iamb.boxofclue.com or whatever other domain amuses you) so that we can get the deluge of email that we all crave? Which, of course, begs the question of what we actually gained by moving to SourceForge. I, for one, feel that SourceForge has not measured up to my rather lofty expectations. Although there are some things that are vastly easier, there are other things that are just painful. I've been trying to get CVS auto-diff email working for over a month, and it took about 10 minutes on my server here at home. Anyways, discuss amoungst yourselves. -- Rich Bowen -- Director of Web Application Development http://www.cre8tivegroup.com/ -- ri...@cr... Have trouble remembering things? http://www.mymissinghead.com/ _______________________________________________ Iamb-dev-internal mailing list Iam...@li... http://lists.sourceforge.net/lists/listinfo/iamb-dev-internal |