PageRenderTime 59ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/core/plugins.php

https://bitbucket.org/mpercy/deeemm-cms
PHP | 49 lines | 20 code | 19 blank | 10 comment | 2 complexity | 695e10eec3716732dfbb71d1dfc7dac4 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause
  1. <?php
  2. defined( '_INDM' ) or die( 'POSSIBLE HACK ATTEMPT!' );
  3. /*===========================================================================
  4. Get registered plugins
  5. ===========================================================================*/
  6. $plugin_list = array();
  7. $sql_query = mysql_query("SELECT * FROM `" . $db_table_prefix . "plugin_list`");
  8. while($row = mysql_fetch_assoc( $sql_query )){
  9. $plugin_list[$row[name]] = $row[is_registered];
  10. }
  11. mysql_free_result($sql_query);
  12. /*===========================================================================
  13. Get plugin config variables from database
  14. ===========================================================================*/
  15. $plugin_conf = array();
  16. $sql_query = mysql_query("SELECT * FROM `" . $db_table_prefix . "plugin_conf`");
  17. while($row = mysql_fetch_assoc( $sql_query )){
  18. $plugin_conf[$row[name]] = $row[value];
  19. }
  20. mysql_free_result($sql_query);
  21. /*===========================================================================
  22. load registered plugins
  23. ===========================================================================*/
  24. foreach ($plugin_list as $plugin => $enabled){
  25. if ($enabled == 'TRUE'){
  26. //get plugin files
  27. require $abs_path . $plugins_dir . $plugin . '/index.php';
  28. }
  29. }
  30. ?>