Changeset 604 for trunk/xpressme_integration_kit/xoops_version.php
- Timestamp:
- May 1, 2010, 2:59:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/xoops_version.php
r600 r604 21 21 22 22 if (!function_exists('mod_access_level')){ 23 function mod_access_level(){ 24 global $current_user; 25 26 $level = @$current_user->user_level; 27 $role = @$current_user->roles[0]; 28 switch ($role){ 29 case 'administrator': 30 $role_level = 10; 31 break; 32 case 'editor': 33 $role_level = 7; 34 break; 35 case 'author': 36 $role_level = 2; 37 break; 38 case 'contributor': 39 $role_level = 1; 40 break; 41 default: 42 $role_level = 0; 23 function mod_access_level(){ 24 global $current_user; 25 26 $level = @$current_user->user_level; 27 $role = @$current_user->roles[0]; 28 switch ($role){ 29 case 'administrator': 30 $role_level = 10; 31 break; 32 case 'editor': 33 $role_level = 7; 34 break; 35 case 'author': 36 $role_level = 2; 37 break; 38 case 'contributor': 39 $role_level = 1; 40 break; 41 default: 42 $role_level = 0; 43 } 44 45 if ($level > $role_level){ 46 return $level; 47 } else { 48 return $role_level; 49 } 43 50 } 44 45 if ($level > $role_level){ 46 return $level; 47 } else { 48 return $role_level; 51 } 52 if (!function_exists('is_show_multi_blog_block')){ 53 function is_show_multi_blog_block($mydirname = ''){ 54 if(empty($mydirname)) return false; 55 // Before loading xpressme. 56 // The multi blog is judged by the presence of the blogs table. 57 global $xoopsDB; 58 $wp_prefix = preg_replace('/wordpress/','wp',$mydirname); 59 $wp_blogs_tbl = $xoopsDB->prefix($wp_prefix) . '_blogs'; 60 $sql = "SELECT * FROM " . $wp_blogs_tbl; 61 $result = $xoopsDB->query($sql, 0, 0); 62 if ($xoopsDB->getRowsNum($result)) return true; 63 return false; 49 64 } 50 }51 }52 if (!function_exists('is_show_multi_blog_block')){53 function is_show_multi_blog_block($mydirname = ''){54 if(empty($mydirname)) return false;55 // Before loading xpressme.56 // The multi blog is judged by the presence of the blogs table.57 global $xoopsDB;58 $wp_prefix = preg_replace('/wordpress/','wp',$mydirname);59 $wp_blogs_tbl = $xoopsDB->prefix($wp_prefix) . '_blogs';60 $sql = "SELECT * FROM " . $wp_blogs_tbl;61 $result = $xoopsDB->query($sql, 0, 0);62 if ($xoopsDB->getRowsNum($result)) return true;63 return false;64 }65 65 } 66 66
Note: See TracChangeset
for help on using the changeset viewer.