source: temp/test-xoops.ec-cube.net/html/modules/tinyd0/include/onupdate.inc.php @ 405

Revision 405, 1.5 KB checked in by root, 20 years ago (diff)
Line 
1<?php
2
3if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;
4
5// referer check
6$ref = xoops_getenv('HTTP_REFERER');
7if( $ref == '' || strpos( $ref , XOOPS_URL.'/modules/system/admin.php' ) === 0 ) {
8    /* TinyD specific part */
9
10    // update D blocks's edit_func
11    global $xoopsDB ;
12    $query = "SELECT mid FROM ".$xoopsDB->prefix('modules')." WHERE dirname='".$modversion['dirname']."' ";
13    $result = $xoopsDB->query( "SELECT mid FROM ".$xoopsDB->prefix('modules')." WHERE dirname='{$modversion['dirname']}'" ) ;
14    list( $mid ) = $xoopsDB->fetchRow( $result ) ;
15    $xoopsDB->query( "UPDATE ".$xoopsDB->prefix("newblocks")." SET edit_func='b_tinycontent_content_edit' WHERE show_func='b_tinycontent_content_show' AND mid='$mid'" ) ;
16
17    // last_modified from TinyContent
18    if( $xoopsDB->query( "SELECT last_modified FROM ".$xoopsDB->prefix("tinycontent{$mydirnumber}") ) === false ) {
19        $xoopsDB->queryF( "ALTER TABLE ".$xoopsDB->prefix("tinycontent{$mydirnumber}")." ADD last_modified timestamp(14)" ) ;
20    }
21
22    // created & html_header from TinyD <= 2.0x
23    if( $xoopsDB->query( "SELECT created,html_header FROM ".$xoopsDB->prefix("tinycontent{$mydirnumber}") ) === false ) {
24        $xoopsDB->queryF( "ALTER TABLE ".$xoopsDB->prefix("tinycontent{$mydirnumber}")." ADD created datetime NOT NULL default '2001-1-1 00:00:00', ADD html_header text default NULL" ) ;
25    }
26
27    /* General part */
28
29    // Keep the values of block's options when module is updated (by nobunobu)
30    include dirname( __FILE__ ) . "/updateblock.inc.php" ;
31
32}
33
34?>
Note: See TracBrowser for help on using the repository browser.