PageRenderTime 49ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/NukeViet3.2/admin/modules/siteinfo/main.php

http://nuke-viet.googlecode.com/
PHP | 149 lines | 119 code | 16 blank | 14 comment | 11 complexity | 7c633e16b22fd5b993a9a8d9388b9448 MD5 | raw file
Possible License(s): BSD-3-Clause, LGPL-2.1, GPL-2.0
  1. <?php
  2. /**
  3. * @Project NUKEVIET 3.0
  4. * @Author VINADES.,JSC (contact@vinades.vn)
  5. * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
  6. * @Createdate 2-1-2010 22:5
  7. */
  8. if ( ! defined( 'NV_IS_FILE_SITEINFO' ) ) die( 'Stop!!!' );
  9. $page_title = $lang_global['mod_siteinfo'];
  10. /**
  11. * nv_get_lang_module()
  12. *
  13. * @param mixed $mod
  14. * @return
  15. */
  16. function nv_get_lang_module ( $mod )
  17. {
  18. global $site_mods;
  19. $lang_module = array();
  20. if ( isset( $site_mods[$mod] ) )
  21. {
  22. if ( file_exists( NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_INTERFACE . ".php" ) )
  23. {
  24. include ( NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_INTERFACE . ".php" );
  25. }
  26. elseif ( file_exists( NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_DATA . ".php" ) )
  27. {
  28. include ( NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_" . NV_LANG_DATA . ".php" );
  29. }
  30. elseif ( file_exists( NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_en.php" ) )
  31. {
  32. include ( NV_ROOTDIR . "/modules/" . $site_mods[$mod]['module_file'] . "/language/admin_en.php" );
  33. }
  34. }
  35. return $lang_module;
  36. }
  37. //Noi dung chinh cua trang
  38. $info = array();
  39. foreach ( $site_mods as $mod => $value )
  40. {
  41. if ( file_exists( NV_ROOTDIR . "/modules/" . $value['module_file'] . "/siteinfo.php" ) )
  42. {
  43. $siteinfo = array();
  44. $mod_data = $value['module_data'];
  45. include ( NV_ROOTDIR . "/modules/" . $value['module_file'] . "/siteinfo.php" );
  46. if ( ! empty( $siteinfo ) )
  47. {
  48. $info[$mod]['caption'] = $value['custom_title'];
  49. $info[$mod]['field'] = $siteinfo;
  50. }
  51. }
  52. }
  53. if ( ! empty( $info ) )
  54. {
  55. $xtpl = new XTemplate( "main.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_file );
  56. $xtpl->assign( 'LANG', $lang_module );
  57. $xtpl->assign( 'CAPTION', $lang_module['moduleInfo'] );
  58. $a = 0;
  59. foreach ( $info as $if )
  60. {
  61. foreach ( $if['field'] as $field )
  62. {
  63. $xtpl->assign( 'CLASS', ( $a % 2 ) ? " class=\"second\"" : "" );
  64. $xtpl->assign( 'KEY', $field['key'] );
  65. $xtpl->assign( 'VALUE', $field['value'] );
  66. $xtpl->assign( 'MODULE', $if['caption'] );
  67. $xtpl->parse( 'main.main1.loop' );
  68. $a ++;
  69. }
  70. }
  71. $xtpl->parse( 'main.main1' );
  72. //Thong tin phien ban NukeViet
  73. if ( defined( 'NV_IS_GODADMIN' ) )
  74. {
  75. $field = array();
  76. $field[] = array(
  77. 'key' => $lang_module['version_user'], 'value' => $global_config['version'].'.r'.$global_config['revision']
  78. );
  79. if ( $global_config['autocheckupdate'] )
  80. {
  81. $new_version = nv_geVersion( $global_config['autoupdatetime'] * 3600 );
  82. }
  83. elseif ( file_exists( NV_ROOTDIR . '/' . NV_CACHEDIR . '/nukeviet.version.' . NV_LANG_INTERFACE . '.xml' ) )
  84. {
  85. $new_version = simplexml_load_file( NV_ROOTDIR . '/' . NV_CACHEDIR . '/nukeviet.version.' . NV_LANG_INTERFACE . '.xml' );
  86. }
  87. else
  88. {
  89. $new_version = array();
  90. }
  91. $info = "";
  92. if ( ! empty( $new_version ) )
  93. {
  94. $field[] = array( //
  95. 'key' => $lang_module['version_news'], //
  96. 'value' => sprintf( $lang_module['newVersion_detail'], ( string )$new_version->version, nv_date( "d-m-Y H:i", strtotime( $new_version->date ) ) )
  97. );
  98. if ( nv_version_compare( $global_config['version'], $new_version->version ) < 0 )
  99. {
  100. $info = sprintf( $lang_module['newVersion_info'], NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=webtools&amp;" . NV_OP_VARIABLE . "=checkupdate" );
  101. }
  102. }
  103. $xtpl->assign( 'CAPTION', $lang_module['version'] );
  104. $xtpl->assign( 'ULINK', NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=webtools&amp;" . NV_OP_VARIABLE . "=checkupdate" );
  105. $xtpl->assign( 'CHECKVERSION', $lang_module['checkversion'] );
  106. foreach ( $field as $key => $value )
  107. {
  108. $xtpl->assign( 'CLASS', ( $key % 2 ) ? " class=\"second\"" : "" );
  109. $xtpl->assign( 'KEY', $value['key'] );
  110. $xtpl->assign( 'VALUE', $value['value'] );
  111. $xtpl->parse( 'main.main2.loop' );
  112. }
  113. if ( ! empty( $info ) )
  114. {
  115. $xtpl->assign( 'INFO', $info );
  116. $xtpl->parse( 'main.main2.inf' );
  117. }
  118. $xtpl->parse( 'main.main2' );
  119. }
  120. $xtpl->parse( 'main' );
  121. $contents = $xtpl->text( 'main' );
  122. }
  123. elseif ( ! defined( 'NV_IS_SPADMIN' ) and ! empty( $site_mods ) )
  124. {
  125. $arr_mod = array_keys( $site_mods );
  126. $module_name = $arr_mod[0];
  127. Header( "Location: " . NV_BASE_ADMINURL . "index.php?" . NV_NAME_VARIABLE . "=" . $module_name );
  128. die();
  129. }
  130. include ( NV_ROOTDIR . "/includes/header.php" );
  131. echo nv_admin_theme( $contents );
  132. include ( NV_ROOTDIR . "/includes/footer.php" );
  133. ?>