Changeset 741 for branches/Ver3.0
- Timestamp:
- May 9, 2011, 9:10:31 PM (14 years ago)
- Location:
- branches/Ver3.0/xpressme_integration_kit
- Files:
-
- 6 added
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Ver3.0/xpressme_integration_kit/module_icon.php
r232 r741 1 1 <?php 2 $xoopsOption['nocommon'] = true ; 3 require '../../mainfile.php' ; 2 4 $mydirpath = dirname(__FILE__); 3 $mydirname = basename( $mydirpath);5 $mydirname = basename(dirname(__FILE__)); 4 6 $icon_cache_limit = 3600 ; // default 3600sec == 1hour 5 7 … … 10 12 header("Content-type: image/png"); 11 13 12 $icon_fullpath = $mydirpath.'/module_icon.png' ; 14 // file name 15 if( ! empty( $_GET['file'] ) ) { 16 $file_base = preg_replace( '/[^0-9a-z_]/' , '' , $_GET['file'] ) ; 17 } else { 18 $file_base = 'module_icon' ; 19 } 13 20 14 if(function_exists( 'imagecreatefrompng' ) && function_exists( 'imagecolorallocate' ) && function_exists( 'imagestring' ) && function_exists( 'imagepng' ) ) { 21 // branches by cores 22 if( defined( 'ICMS_TRUST_PATH' ) ) { 23 $draw_dirname = false ; 24 $file_base .= '_icms' ; 25 } else if( defined( 'XOOPS_CUBE_LEGACY' ) ) { 26 $draw_dirname = true ; 27 $file_base .= '_xcl' ; 28 $title = '('.$mydirname.')'; 29 $px = ( 112 - 6 * strlen( $title ) ) ; 30 $py = 14; 31 $font = 3; 32 33 } else { 34 $draw_dirname = true ; 35 $title = $mydirname; 36 $px = ( 92 - 6 * strlen( $title ) ) / 2 ; 37 $py = 36; 38 $font = 3; 39 } 40 41 // icon files must be PNG 42 $file = $file_base . '.png' ; 43 44 // custom icon 45 if( file_exists( $mydirpath.'/'.$file ) ) { 46 $draw_dirname = false ; 47 $icon_fullpath = $mydirpath.'/module_icon.png' ; 48 } else { 49 $icon_fullpath = dirname(__FILE__).'/images/'.$file ; 50 } 51 52 if( $draw_dirname && function_exists( 'imagecreatefrompng' ) && function_exists( 'imagecolorallocate' ) && function_exists( 'imagestring' ) && function_exists( 'imagepng' ) ) { 15 53 16 54 $im = imagecreatefrompng( $icon_fullpath ) ; 17 55 18 56 $color = imagecolorallocate( $im , 0 , 0 , 0 ) ; // black 19 $px = ( 92 - 6 * strlen( $mydirname ) ) / 2 ; 20 imagestring( $im , 3 , $px , 34 , $mydirname , $color ) ; 57 imagestring( $im , $font , $px , $py , $title , $color ) ; 21 58 imagepng( $im ) ; 22 59 imagedestroy( $im ) ; -
branches/Ver3.0/xpressme_integration_kit/xoops_version.php
r725 r741 88 88 $modversion['license'] = "GPL see LICENSE"; 89 89 $modversion['official'] = 0 ; 90 $modversion['image'] = 'module_icon.php' ; 90 $modversion['image'] = file_exists( $mydirpath.'/module_icon.png' ) ? 'module_icon.png' : 'module_icon.php' ; 91 $modversion['iconbig'] = 'module_icon.php?file=iconbig' ; 92 $modversion['iconsmall'] = 'module_icon.php?file=iconsmall' ; 91 93 $modversion['dirname'] = $mydirname; 92 94
Note: See TracChangeset
for help on using the changeset viewer.