Plankton has asked for the wisdom of the Perl Monks concerning the following question:
This code results in a page that looks kinda like this ...[% my $limit; $limit = int($$VARS{newnodes_limit}) if (exists $$VARS{newnodes_limit}); $limit ||= 15; my $str; my $ref = getNodeWhere({}, "", "createtime DESC", $limit); foreach my $N (@$ref) { $str .= linkNode($N) . ":" . $N->{type_nodetype} . "<BR>\n" if $N- +>hasAccess($USER, 'r'); } $str; %]
I would prefer not listing nodes ...TEST_FRONT_PAGE:23 Re: Welcome to Everything!:286 Re: Welcome to Everything!:286 does not exist yet:6 root needs to add the chatterbox for you:6 dogface:27 good dim sum duck!:6 ENoteAndPreview:15 shownote:8 parsetimestamp:8 note display page:9 parsecodeonlydoc display page:9 parselinksinfield:19 insert:19 displaynote:19
... which are replies to the "Welcome to Everything!" node. I noticed that these two nodes have a type_nodetype of 286. So the question I have is this ...Re: Welcome to Everything!:286 Re: Welcome to Everything!:286
... or is the value 286 too arbitrary to be used like that and result in a bug? Or do I need to check the "note" table? Something like this ...my $ref = getNodeWhere( "type_nodetype != 286" , "", "createtime DESC" +, $limit);
I have looked at the everything bible I couldn't find where it talks about using the type_nodetype field.my $ref = getNodeWhere({}, "", "createtime DESC", $limit); foreach my $N (@$ref) { my $isNote = 0; next if getNodeWhere( "$N->node_id = note_id", "notes" ); $str .= linkNode($N) . ":" . $N->{type_nodetype} . "<BR>\n" if $N- +>hasAccess($USER, 'r'); }
mysql> desc node; +--------------------------+-----------+------+-----+----------------- +----+----------------+ | Field | Type | Null | Key | Default + | Extra | +--------------------------+-----------+------+-----+----------------- +----+----------------+ | node_id | int(11) | | PRI | NULL + | auto_increment | | type_nodetype | int(11) | | MUL | 0 + | | | title | char(240) | | MUL | + | | | author_user | int(11) | | MUL | 0 + | | | createtime | datetime | | | 0000-00-00 00:00 +:00 | | | modified | datetime | | | 0000-00-00 00:00 +:00 | | | hits | int(11) | YES | | 0 + | | | loc_location | int(11) | YES | | 0 + | | | reputation | int(11) | | | 0 + | | | lockedby_user | int(11) | | | 0 + | | | locktime | datetime | | | 0000-00-00 00:00 +:00 | | | authoraccess | char(4) | | | iiii + | | | groupaccess | char(5) | | | iiiii + | | | otheraccess | char(5) | | | iiiii + | | | guestaccess | char(5) | | | iiiii + | | | dynamicauthor_permission | int(11) | | | -1 + | | | dynamicgroup_permission | int(11) | | | -1 + | | | dynamicother_permission | int(11) | | | -1 + | | | dynamicguest_permission | int(11) | | | -1 + | | | group_usergroup | int(11) | | | -1 + | | +--------------------------+-----------+------+-----+----------------- +----+----------------+ 20 rows in set (0.01 sec)
| Plankton: 1% Evil, 99% Hot Gas. |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Filtering out replies in Everything Engine
by chromatic (Archbishop) on Sep 01, 2004 at 15:58 UTC | |
by Plankton (Vicar) on Sep 01, 2004 at 16:23 UTC |