1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14:
15:
16:
17: if (class_exists("ArtObject")) return;
18:
19:
20: 21: 22: 23: 24: 25: 26: 27: 28:
29:
30: class ArtObject extends XoopsObject
31: {
32: 33: 34:
35: var $plugin_path;
36:
37: 38: 39: 40:
41: function ArtObject()
42: {
43: }
44: }
45:
46: 47: 48: 49: 50: 51: 52: 53: 54: 55:
56:
57: class ArtObjectHandler extends XoopsPersistableObjectHandler
58: {
59:
60: var $db;
61:
62: 63: 64: 65: 66:
67:
68: function __construct($db, $table, $className, $keyName, $identifierName)
69: {
70: $this->db = $db;
71: parent::__construct($db, $table, $className, $keyName, $identifierName);
72: }
73:
74: function ArtObjectHandler($db, $table = "", $className = "", $keyName = "", $identifierName = false)
75: {
76: $this->__construct( $db, $table, $className, $keyName, $identifierName );
77: }
78:
79: 80: 81: 82: 83:
84: function mysql_server_version($conn = null)
85: {
86: if (!is_null($conn)) {
87: return mysql_get_server_info($conn);
88: } else {
89: return mysql_get_server_info();
90: }
91: }
92:
93: 94: 95: 96: 97:
98: function mysql_major_version()
99: {
100: $version = $this->mysql_server_version();
101: if (version_compare( $version, "5.0.0", "ge" ) ) $mysql_version = 5;
102: elseif (version_compare( $version, "4.1.0", "ge" ) ) $mysql_version = 4;
103: else $mysql_version = 3;
104: return $mysql_version;
105: }
106:
107: function insert(&$object, $force = true)
108: {
109: if ($ret = parent::insert($object, $force)) {
110: $object->unsetNew();
111: }
112: return $ret;
113: }
114: }
115:
116: