⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 comment.pm

📁 1. 记录每个帖子的访问人情况
💻 PM
字号:
# Copyright 2001-2005 Six Apart.# SCRiPTMAFiA 2005 - THE DiRTY HANDS ON YOUR SCRiPTS## $Id: Comment.pm 10197 2005-03-09 00:27:57Z ezra $package MT::Comment;use strict;use MT::Object;@MT::Comment::ISA = qw( MT::Object );__PACKAGE__->install_properties({    columns => [        'id', 'blog_id', 'entry_id', 'author', 'commenter_id', 	'visible', 'email', 'url', 'text', 'ip',    ],    indexes => {	ip => 1,        created_on => 1,        entry_id => 1,        blog_id => 1,	email => 1,	commenter_id => 1,	visible => 1,    },    audit => 1,    datasource => 'comment',    primary_key => 'id',});sub visible {    my $this = shift;    if (@_ == 1) { 	return $this->set_values({visible => $_[0]});    }    return $this->column('visible');}1;__END__=head1 NAMEMT::Comment - Movable Type comment record=head1 SYNOPSIS    use MT::Comment;    my $comment = MT::Comment->new;    $comment->blog_id($entry->blog_id);    $comment->entry_id($entry->id);    $comment->author('Foo');    $comment->text('This is a comment.');    $comment->save        or die $comment->errstr;=head1 DESCRIPTIONAn I<MT::Comment> object represents a comment in the Movable Type system. Itcontains all of the metadata about the comment (author name, email address,homepage URL, IP address, etc.), as well as the actual body of the comment.=head1 USAGEAs a subclass of I<MT::Object>, I<MT::Comment> inherits all of thedata-management and -storage methods from that class; thus you should lookat the I<MT::Object> documentation for details about creating a new object,loading an existing object, saving an object, etc.=head1 DATA ACCESS METHODSThe I<MT::Comment> object holds the following pieces of data. These fields canbe accessed and set using the standard data access methods described in theI<MT::Object> documentation.=over 4=item * idThe numeric ID of the comment.=item * blog_idThe numeric ID of the blog in which the comment is found.=item * entry_idThe numeric ID of the entry on which the comment has been made.=item * authorThe name of the author of the comment.=item * commenter_idThe author_id for the commenter; this will only be defined if thecommenter is registered, which is only required if the blog configoption allow_unreg_comments is false.=item * ipThe IP address of the author of the comment.=item * emailThe email address of the author of the comment.=item * urlThe URL of the author of the comment.=item * textThe body of the comment.=item * visibleReturns a true value if the comment should be displayed. Comments canbe hidden if comment registration is required and the commenter ispending approval.=item * created_onThe timestamp denoting when the comment record was created, in the formatC<YYYYMMDDHHMMSS>. Note that the timestamp has already been adjusted for theselected timezone.=item * modified_onThe timestamp denoting when the comment record was last modified, in theformat C<YYYYMMDDHHMMSS>. Note that the timestamp has already been adjustedfor the selected timezone.=back=head1 DATA LOOKUPIn addition to numeric ID lookup, you can look up or sort records by anycombination of the following fields. See the I<load> documentation inI<MT::Object> for more information.=over 4=item * created_on=item * entry_id=item * blog_id=back=head1 AUTHOR & COPYRIGHTSPlease see the I<MT> manpage for author, copyright, and license information.=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -