Changeset 428 for branches/XPressMU/xpressme_integration_kit/include
- Timestamp:
- Oct 31, 2009, 11:36:52 PM (15 years ago)
- Location:
- branches/XPressMU/xpressme_integration_kit/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/XPressMU/xpressme_integration_kit/include/oninstall.php
r406 r428 100 100 } 101 101 $views_queries ="CREATE TABLE $views_table ( 102 blog_id bigint(20) unsigned NOT NULL default '0', 102 103 post_id bigint(20) unsigned NOT NULL default '0', 103 104 post_views bigint(20) unsigned NOT NULL default '0', -
branches/XPressMU/xpressme_integration_kit/include/onupdate.php
r384 r428 175 175 $msgs = array(); 176 176 177 $views_table = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_views' ; 177 178 if (! enhanced_table_check($mydirname,'views')){ 178 $views_table = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_views' ;179 179 $queries ="CREATE TABLE $views_table ( 180 blog_id bigint(20) unsigned NOT NULL default '0', 180 181 post_id bigint(20) unsigned NOT NULL default '0', 181 182 post_views bigint(20) unsigned NOT NULL default '0', … … 184 185 $db->queryF( $queries ) ; 185 186 $msgs[] = "$views_table table of XPressME was made."; 187 } else { 188 if (!is_found_table_column($views_table,'blog_id')){ 189 $queries ="ALTER TABLE $views_table ADD blog_id bigint(20) FIRST"; 190 $db->queryF( $queries ) ; 191 $msgs[] = "$views_table ADD blog_id ."; 192 } 186 193 } 187 194 … … 261 268 endif; 262 269 270 if( ! function_exists( 'is_found_table_column' ) ) : 271 function is_found_table_column($table,$column){ 272 global $xoopsModule; 273 $xoopsDB =& Database::getInstance(); 274 275 $sql = "DESCRIBE $table $column"; 276 $res = $xoopsDB->queryF($sql, 0, 0); 277 if ($res === false){ 278 return false; 279 } else { 280 if ($xoopsDB->getRowsNum($res) > 0) 281 return true; 282 else 283 return false; 284 } 285 } 286 endif; 263 287 264 288
Note: See TracChangeset
for help on using the changeset viewer.