/legacy/code/include/classes/BASE/content.php

https://github.com/brettjamin/appleseed · PHP · 341 lines · 241 code · 53 blank · 47 comment · 0 complexity · cc0d31a11772cc14b9c7ae90f3930b67 MD5 · raw file

  1. <?php
  2. // +-------------------------------------------------------------------+
  3. // | Appleseed Web Community Management Software |
  4. // | http://appleseed.sourceforge.net |
  5. // +-------------------------------------------------------------------+
  6. // | FILE: content.php CREATED: 09-04-2006 +
  7. // | LOCATION: /code/include/classes/BASE/ MODIFIED: 09-05-2006 +
  8. // +-------------------------------------------------------------------+
  9. // | Copyright (c) 2004-2008 Appleseed Project |
  10. // +-------------------------------------------------------------------+
  11. // | This program is free software; you can redistribute it and/or |
  12. // | modify it under the terms of the GNU General Public License |
  13. // | as published by the Free Software Foundation; either version 2 |
  14. // | of the License, or (at your option) any later version. |
  15. // | |
  16. // | This program is distributed in the hope that it will be useful, |
  17. // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
  18. // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
  19. // | GNU General Public License for more details. |
  20. // | |
  21. // | You should have received a copy of the GNU General Public License |
  22. // | along with this program; if not, write to: |
  23. // | |
  24. // | The Free Software Foundation, Inc. |
  25. // | 59 Temple Place - Suite 330, |
  26. // | Boston, MA 02111-1307, USA. |
  27. // | |
  28. // | http://www.gnu.org/copyleft/gpl.html |
  29. // +-------------------------------------------------------------------+
  30. // | AUTHORS: Michael Chisari <michael.chisari@gmail.com> |
  31. // +-------------------------------------------------------------------+
  32. // | Part of the Appleseed BASE API |
  33. // | VERSION: 0.7.7 |
  34. // | DESCRIPTION: Content class definitions. Reusable functions not |
  35. // | specifically tied to Appleseed. |
  36. // +-------------------------------------------------------------------+
  37. // Content pages class.
  38. class cCONTENTPAGES extends cBASEDATACLASS {
  39. var $tID, $Title, $Output, $Formatting, $Location, $Language;
  40. function cCONTENTPAGES ($pDEFAULTCONTEXT = '') {
  41. global $gTABLEPREFIX;
  42. $this->TableName = $gTABLEPREFIX . 'contentPages';
  43. $this->tID = '';
  44. $this->Title = '';
  45. $this->Output = '';
  46. $this->Location = '';
  47. $this->Formatting = 0;
  48. $this->Language = '';
  49. $this->PageContext = '';
  50. $this->Error = 0;
  51. $this->Message = '';
  52. $this->Result = '';
  53. $this->FieldNames = '';
  54. $this->PrimaryKey = 'tID';
  55. // Create extended field definitions
  56. $this->FieldDefinitions = array (
  57. 'tID' => array ('max' => '',
  58. 'min' => '',
  59. 'illegal' => '',
  60. 'required' => '',
  61. 'relation' => 'unique',
  62. 'null' => NO,
  63. 'sanitize' => YES,
  64. 'datatype' => 'INTEGER'),
  65. 'Title' => array ('max' => '64',
  66. 'min' => '3',
  67. 'illegal' => '',
  68. 'required' => '',
  69. 'relation' => '',
  70. 'null' => NO,
  71. 'sanitize' => YES,
  72. 'datatype' => 'STRING'),
  73. 'Output' => array ('max' => '65536',
  74. 'min' => '2',
  75. 'illegal' => '',
  76. 'required' => '',
  77. 'relation' => '',
  78. 'null' => NO,
  79. 'sanitize' => YES,
  80. 'datatype' => 'STRING'),
  81. 'Style' => array ('max' => '4096',
  82. 'min' => '2',
  83. 'illegal' => '',
  84. 'required' => '',
  85. 'relation' => '',
  86. 'null' => '',
  87. 'sanitize' => NO,
  88. 'datatype' => 'STRING'),
  89. 'Location' => array ('max' => '64',
  90. 'min' => '2',
  91. 'illegal' => '/ * \ < > ( ) [ ] & ^ $ # @ ! ? ; \' " { } | ~ + =',
  92. 'required' => '',
  93. 'relation' => 'unique',
  94. 'null' => '',
  95. 'sanitize' => YES,
  96. 'datatype' => 'STRING'),
  97. 'Template' => array ('max' => '32',
  98. 'min' => '4',
  99. 'illegal' => '',
  100. 'required' => '',
  101. 'relation' => '',
  102. 'null' => NO,
  103. 'sanitize' => NO,
  104. 'datatype' => 'STRING'),
  105. 'Formatting' => array ('max' => '',
  106. 'min' => '',
  107. 'illegal' => '',
  108. 'required' => '',
  109. 'relation' => '',
  110. 'null' => '',
  111. 'sanitize' => NO,
  112. 'datatype' => 'INTEGER'),
  113. 'Language' => array ('max' => '2',
  114. 'min' => '0',
  115. 'illegal' => '',
  116. 'required' => '',
  117. 'relation' => '',
  118. 'null' => NO,
  119. 'sanitize' => NO,
  120. 'datatype' => 'STRING'),
  121. );
  122. // Assign context from paramater.
  123. $this->PageContext = $pDEFAULTCONTEXT;
  124. // Grab the fields from the database.
  125. $this->Fields();
  126. } // Constructor
  127. } // cCONTENTPAGES
  128. // Content articles class.
  129. class cCONTENTARTICLES extends cBASEDATACLASS {
  130. var $tID, $Title, $Output, $Formatting, $Language;
  131. var $Submitted_Username, $Submitted_Domain;
  132. var $Verification;
  133. function cCONTENTARTICLES ($pDEFAULTCONTEXT = '') {
  134. global $gTABLEPREFIX;
  135. $this->TableName = $gTABLEPREFIX . 'contentArticles';
  136. $this->tID = '';
  137. $this->Title = '';
  138. $this->Output = '';
  139. $this->Formatting = 0;
  140. $this->Language = '';
  141. $this->Submitted_Username = '';
  142. $this->Submitted_Domain = '';
  143. $this->Verification = '';
  144. $this->PageContext = '';
  145. $this->Error = 0;
  146. $this->Message = '';
  147. $this->Result = '';
  148. $this->FieldNames = '';
  149. $this->PrimaryKey = 'tID';
  150. // Create extended field definitions
  151. $this->FieldDefinitions = array (
  152. 'tID' => array ('max' => '',
  153. 'min' => '',
  154. 'illegal' => '',
  155. 'required' => '',
  156. 'relation' => 'unique',
  157. 'null' => NO,
  158. 'sanitize' => YES,
  159. 'datatype' => 'INTEGER'),
  160. 'Title' => array ('max' => '64',
  161. 'min' => '3',
  162. 'illegal' => '',
  163. 'required' => '',
  164. 'relation' => '',
  165. 'null' => NO,
  166. 'sanitize' => YES,
  167. 'datatype' => 'STRING'),
  168. 'Full' => array ('max' => '65536',
  169. 'min' => '2',
  170. 'illegal' => '',
  171. 'required' => '',
  172. 'relation' => '',
  173. 'null' => NO,
  174. 'sanitize' => YES,
  175. 'datatype' => 'STRING'),
  176. 'Submitted_Username' => array ('max' => '64',
  177. 'min' => '2',
  178. 'illegal' => '',
  179. 'required' => '',
  180. 'relation' => '',
  181. 'null' => '',
  182. 'sanitize' => YES,
  183. 'datatype' => 'STRING'),
  184. 'Submitted_Domain' => array ('max' => '64',
  185. 'min' => '2',
  186. 'illegal' => '',
  187. 'required' => '',
  188. 'relation' => '',
  189. 'null' => '',
  190. 'sanitize' => YES,
  191. 'datatype' => 'STRING'),
  192. 'Verification' => array ('max' => '32',
  193. 'min' => '4',
  194. 'illegal' => '',
  195. 'required' => '',
  196. 'relation' => '',
  197. 'null' => NO,
  198. 'sanitize' => NO,
  199. 'datatype' => 'STRING'),
  200. 'Formatting' => array ('max' => '',
  201. 'min' => '',
  202. 'illegal' => '',
  203. 'required' => '',
  204. 'relation' => '',
  205. 'null' => '',
  206. 'sanitize' => NO,
  207. 'datatype' => 'INTEGER'),
  208. 'Language' => array ('max' => '2',
  209. 'min' => '0',
  210. 'illegal' => '',
  211. 'required' => '',
  212. 'relation' => '',
  213. 'null' => NO,
  214. 'sanitize' => NO,
  215. 'datatype' => 'STRING'),
  216. );
  217. // Assign context from paramater.
  218. $this->PageContext = $pDEFAULTCONTEXT;
  219. // Grab the fields from the database.
  220. $this->Fields();
  221. } // Constructor
  222. } // cCONTENTARTICLES
  223. // Content nodes class.
  224. class cBASECONTENTNODES extends cBASEDATACLASS {
  225. var $tID, $Domain, $Summary, $Stamp, $Users;
  226. function cBASECONTENTNODES ($pDEFAULTCONTEXT = '') {
  227. global $gTABLEPREFIX;
  228. $this->TableName = $gTABLEPREFIX . 'contentNodes';
  229. $this->tID = '';
  230. $this->Summary = '';
  231. $this->Domain = '';
  232. $this->Stamp = '';
  233. $this->Users = 0;
  234. $this->PageContext = '';
  235. $this->Error = 0;
  236. $this->Message = '';
  237. $this->Result = '';
  238. $this->FieldNames = '';
  239. $this->PrimaryKey = 'tID';
  240. // Create extended field definitions
  241. $this->FieldDefinitions = array (
  242. 'tID' => array ('max' => '',
  243. 'min' => '',
  244. 'illegal' => '',
  245. 'required' => '',
  246. 'relation' => 'unique',
  247. 'null' => NO,
  248. 'sanitize' => YES,
  249. 'datatype' => 'INTEGER'),
  250. 'Domain' => array ('max' => '128',
  251. 'min' => '0',
  252. 'illegal' => '',
  253. 'required' => '',
  254. 'relation' => '',
  255. 'null' => NO,
  256. 'sanitize' => YES,
  257. 'datatype' => 'STRING'),
  258. 'Summary' => array ('max' => '128',
  259. 'min' => '0',
  260. 'illegal' => '',
  261. 'required' => '',
  262. 'relation' => '',
  263. 'null' => NO,
  264. 'sanitize' => YES,
  265. 'datatype' => 'STRING'),
  266. 'Stamp' => array ('max' => '',
  267. 'min' => '',
  268. 'illegal' => '',
  269. 'required' => '',
  270. 'relation' => '',
  271. 'null' => NO,
  272. 'sanitize' => NO,
  273. 'datatype' => 'DATETIME'),
  274. 'Users' => array ('max' => '',
  275. 'min' => '',
  276. 'illegal' => '',
  277. 'required' => '',
  278. 'relation' => '',
  279. 'null' => NO,
  280. 'sanitize' => NO,
  281. 'datatype' => 'INTEGER'),
  282. );
  283. // Assign context from paramater.
  284. $this->PageContext = $pDEFAULTCONTEXT;
  285. // Grab the fields from the database.
  286. $this->Fields();
  287. } // Constructor
  288. } // cBASECONTENTNODES