Website:Comments

From MatureAsskickers Wiki

Jump to: navigation, search

« Home

Contents

Comments Table

The comments table stores all of the comment data.

Data Structure

Fields

Descriptions

commentid

  • (integer, unique)
  • A unique identification number for the comment. No other comment will have the same number and it is used to refer to the comment from other table's. This value is assigned when the comment is created and is read-only.
  • Read Permission: comments.read.commentid (all)
  • Write Permission: comments.write.commentid (none)

datetime_insert

datetime_update

datetime_expire

  • (YY-MM-DD hh:mm:ss)
  • The timestamp of when the comment has/will expire. Once the current date-time has surpassed this value the comment is effectively deleted, however the comment can still be edited. Expiring a comment will disable general display within XML feeds.
  • Read Permission: comments.read.datetime_expire (defined, self)
  • Write Permission: comments.write.datetime_expire (defined)

author_recruitid

author_userid

awardid_list

commentid_list

eventid_list

inodeid_list

groupid_list

recruitid_list

userid_list

customkey_list

comment

data

  • (array)
  • This is special array of custom unreserved key value pairs. It is an optional field and any comments.data.* value can be made empty when editing a comment.
  • Read Permission: comments.read.data (all)
  • Write Permission: comments.write.data (defined, self)
  • See Custom Data

Reading Data

See XML Data

XML

Sample XML output

/xml/comments.xml

 <?xml version = "1.0" encoding="UTF-8" standalone="yes"?>
 <comments>
   <commentid id="1">
     <commentid>1</commentid>
     <datetime_insert>2006-10-10 07:55:29</datetime_insert>
     <datetime_update>2007-02-19 19:02:14</datetime_update>
     <datetime_expire>2008-08-05 12:00:00</datetime_expire>
     <author>
       <recruit id="1">
         <recruitid>1</recruitid>
          <username>recruit</username>
       </recruit>
       <user id="1">
         <userid>1</userid>
          <username>user</username>
       </recruit>
     </author>
     <comment><![CDATA[ The first comment! ]]></comment>
     <awardids csv="1,2,3">
       <awardid>1</awardid>
       <awardid>2</awardid>
       <awardid>3</awardid>
     </awardids>
     <commentids csv="1,2,3">
       <commentid>1</commentid>
       <commentid>2</commentid>
       <commentid>3</commentid>
     </commentids>
     <eventids csv="1,2,3">
       <eventid>1</eventid>
       <eventid>2</eventid>
       <eventid>3</eventid>
     </eventids>
     <inodes csv="4833368,4833369,4833370">
       <inode>4833368</inode>
       <inode>4833369</inode>
       <inode>4833370</inode>
     </inodes>
     <groupids csv="1,2,3">
       <groupid>1</groupid>
       <groupid>2</groupid>
       <groupid>3</groupid>
     </groupids>
     <recruitids csv="1,2,3">
       <recruitid>1</recruitid>
       <recruitid>2</recruitid>
       <recruitid>3</recruitid>
     </recruitids>
     <userids csv="1,2,3">
       <userid>1</userid>
       <userid>2</userid>
       <userid>3</userid>
     </userids>
     <customkeys csv="1,a,99zyx">
       <customkey>1</customkey>
       <customkey>a</customkey>
       <customkey>99xyz</customkey>
     </customkeys>
     <data>
       <key>value</key>
       <...>...</...>
     </data>
   </comment>
   <comment id="...">
     ...
   </comment>
 </comments>


The Request

The following url keys can be used in the HTTP GET request to filter and/or sort the XML.

  • commentid (default all) - Filter by a single commentid or CSV of multiple commentid's.
/xml/comments.xml?commentid=1,2,3
  • awardids (default all) - Filter by a single awardid or CSV of multiple awardid's.
/xml/comments.xml?awardids=1,2,3
/xml/comments.xml?commentids=1,2,3
  • eventids (default all) - Filter by a single eventid or CSV of multiple eventid's.
/xml/comments.xml?eventids=1,2,3
  • inodes (default all) - Filter by a single inodeid or CSV of multiple inode's.
/xml/comments.xml?inodes=4833368,4833369,4833370
  • groupids (default all) - Filter by a single groupid or CSV of multiple groupid's.
/xml/comments.xml?groupids=1,2,3
/xml/comments.xml?recruitids=1,2,3
  • userids (default all) - Filter by a single userid or CSV of multiple userid's.
/xml/comments.xml?userids=1,2,3
  • customkeys (default all) - Filter by a single customkey or CSV of multiple customkey's.
/xml/comments.xml?customkeys=shoutbox,complaints
  • expired (default 0) - Filter by 0 for non-expired, 1 for expired.
/xml/comments.xml?expired=1

Writing Data

HTTP POST

See HTTP POST Data

Adding a comment (_comment_add)

A simple example of adding a new comment.

 <form action="/xml/httppost.xml" method="post">
 <input type="hidden" name="_action" value="_comment_add">
   user: <select name="userid">
     <option value="1">user 1</option>
     <option value="2">user 2</option>
     <option value="3">user 3</option>
   </select>
   <textarea name="comment"></textarea>
   <input type="submit" value="add">
 </form>

Editing a comment (_comment_edit)

A simple example of adding a comment.

 <form action="/xml/httppost.xml" method="post">
 <input type="hidden" name="_action" value="_comment_edit">
   <input type="hidden" name="commentid" value="99">
   user: <select name="userid">
     <option value="1">user 1</option>
     <option value="2">user 2</option>
     <option value="3">user 3</option>
   </select>
   <textarea name="comment"></textarea>
   <input type="submit" value="edit">
 </form>

Deleting a comment (_comment_delete)

A simple example of deleting a comment.

 <form action="/xml/httppost.xml" method="post">
 <input type="hidden" name="_action" value="_comment_delete">
   <input type="hidden" name="commentid" value="99">
   <input type="submit" value="delete">
 </form>
Personal tools