Changeset 1637822
- Timestamp:
- 04/14/2017 05:16:30 PM (9 years ago)
- Location:
- wpsid-shortcode/trunk
- Files:
-
- 1 added
- 8 edited
-
ci-bootstrap.php (modified) (2 diffs)
-
classes/class-ci-model.php (modified) (1 diff)
-
classes/class-model.php (modified) (1 diff)
-
classes/class-opensid.php (modified) (3 diffs)
-
classes/class-shortcode.php (modified) (1 diff)
-
controllers/controller-admin.php (added)
-
init.php (modified) (1 diff)
-
opensid.php (modified) (3 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wpsid-shortcode/trunk/ci-bootstrap.php
r1633985 r1637822 1 1 <?php 2 2 defined( 'ABSPATH' ) || die( 'No direct script access allowed!' ); 3 $application_folder = OPENSID_APPPATH .'/donjo-app';4 $system_path = OPENSID_APPPATH .'/donjo-sys/';3 $application_folder = OPENSID_APPPATH . '/donjo-app'; 4 $system_path = OPENSID_APPPATH . '/donjo-sys/'; 5 5 6 6 if( !defined('BASEPATH') ) … … 21 21 include_once OPENSID_APPPATH . '/donjo-sys/database/DB.php'; 22 22 23 function &opensid_ci_load_database($ params = '', $active_record_override = false){24 $database =& DB( $params, $active_record_override);23 function &opensid_ci_load_database($active_record_override = true){ 24 $database =& DB(OPENSID_CONNECT, $active_record_override); 25 25 return $database; 26 26 } -
wpsid-shortcode/trunk/classes/class-ci-model.php
r1633860 r1637822 7 7 8 8 public function __construct(){ 9 $this->db =& opensid_ci_load_database( 'mysqli://' . DB_USER . ':' . DB_PASSWORD . '@' . DB_HOST . '/' . DB_NAME, true);9 $this->db =& opensid_ci_load_database(); 10 10 11 11 $this->load = new OPENSID___FAKE_LOAD; -
wpsid-shortcode/trunk/classes/class-model.php
r1633860 r1637822 6 6 public function __construct() { 7 7 8 $this->db =& opensid_ci_load_database( 'mysqli://' . DB_USER . ':' . DB_PASSWORD . '@' . DB_HOST . '/' . DB_NAME, true);8 $this->db =& opensid_ci_load_database(); 9 9 } 10 10 } // class OpenSID_Model -
wpsid-shortcode/trunk/classes/class-opensid.php
r1633860 r1637822 6 6 public static $controller; 7 7 public static function run() { 8 do_action( 'opensid_run' ); 9 if ( ( 'wp-login.php' === basename( $_SERVER['SCRIPT_FILENAME'] ) ) // Login screen 10 || ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) 11 || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) { 12 return; 8 9 if(OPENSID_READY){ 10 11 12 do_action( 'opensid_run' ); 13 14 self::$model_opensid = self::load_model( 'opensid' ); 13 15 } 14 include( ABSPATH . WPINC . '/version.php' ); // Include an unmodified $wp_version. 15 if ( version_compare( str_replace( '-src', '', $wp_version ), '4.3', '<' ) ) { 16 if ( current_user_can( 'update_plugins' ) ) { 17 add_action( 'admin_notices', array( 'OpenSID', 'show_minimum_requirements_error_notice' ) ); 18 } 19 return; 20 } 21 self::$model_opensid = self::load_model( 'opensid' ); 16 22 17 if ( is_admin() ) { 23 18 $controller = 'admin'; … … 25 20 $controller .= '_ajax'; 26 21 } 22 self::$controller = self::load_controller( $controller ); 27 23 } else { 28 $controller = 'frontend'; 29 Disable: self::$controller = self::load_controller( $controller ); 24 if(OPENSID_READY){ 25 $controller = 'frontend'; 26 self::$controller = self::load_controller( $controller ); 27 } 30 28 } 31 29 } … … 43 41 return $the_class; 44 42 } 45 46 47 43 public static function load_shortcode( $shortcode, array $data = array() ) { 48 44 self::load_file( 'class-shortcode.php', 'classes' ); -
wpsid-shortcode/trunk/classes/class-shortcode.php
r1633860 r1637822 7 7 8 8 public function __construct() { 9 $this->db =& opensid_ci_load_database( 'mysqli://' . DB_USER . ':' . DB_PASSWORD . '@' . DB_HOST . '/' . DB_NAME, true);9 $this->db =& opensid_ci_load_database(); 10 10 11 11 -
wpsid-shortcode/trunk/init.php
r1636430 r1637822 1 1 <?php 2 2 defined( 'ABSPATH' ) || die( 'No direct script access allowed!' ); 3 define( 'OPENSID_ABSPATH', plugin_dir_path( __FILE__ ) );4 define( 'OPENSID_DIR_URL', plugin_dir_url( __FILE__ ) );5 define( 'OPENSID__FILE__', __FILE__ );6 define( 'OPENSID_BASENAME', plugin_basename( OPENSID__FILE__ ) );7 3 load_plugin_textdomain( 'wpsid-shortcode', false, basename( dirname( __FILE__ ) ) . '/locale' ); 8 if( is_dir( ABSPATH . 'opensid/donjo-sys') ) { 9 define( 'OPENSID_APPPATH', ABSPATH . 'opensid' ); 10 define( 'OPENSID_HOMEURL', esc_url(site_url()) . '/opensid' ); 11 } else echo(printf( 12 __( '<b>ERROR</b>: Can\'t find opensid!.<br>This plugin require to opensid installed in <b>`%sopensid/`</b>. <br>Please read <b>`%sreadme.txt`</b> file for installation detail.', 'wpsid-shortcode'), 13 ABSPATH, 14 OPENSID_ABSPATH 15 )); 16 if( defined('OPENSID_APPPATH') ) { 4 register_activation_hook( OPENSID__FILE__, 'opensid_init' ); 5 6 function opensid_init() { 7 $options = get_option( OPENSID_OPTION_KEY ); 8 9 if ( !isset($options['db_name']) ) $options['db_name'] = DB_NAME; 10 if ( !isset($options['db_user']) ) $options['db_user'] = DB_USER; 11 if ( !isset($options['db_host']) ) $options['db_host'] = DB_HOST; 12 if ( !isset($options['sid_path']) ) $options['sid_path'] = esc_attr( ABSPATH . 'opensid' ); 13 if ( !isset($options['sid_home']) ) $options['sid_home'] = esc_url( site_url() . '/opensid' ); 14 15 if ( !isset($options['db_pass']) ) $options['db_pass'] = DB_PASSWORD; 16 17 update_option( OPENSID_OPTION_KEY, $options ); 18 } 19 function opensid_set_option($key, $value) { 20 $options = get_option( OPENSID_OPTION_KEY ); 21 22 $options[$key] = $value; 23 24 update_option( OPENSID_OPTION_KEY, $options ); 25 26 } 27 function opensid_get_option($key) { 28 $options = get_option( OPENSID_OPTION_KEY ); 29 30 if( !isset($options[$key]) ) 31 return; 32 33 return $options[$key]; 34 } 35 defined('OPENSID_DB_NAME') or 36 define( 'OPENSID_DB_NAME', opensid_get_option('db_name') ); 37 38 defined('OPENSID_DB_USER') or 39 define( 'OPENSID_DB_USER', opensid_get_option('db_user') ); 40 41 defined('OPENSID_DB_PASS') or 42 define( 'OPENSID_DB_PASS', opensid_get_option('db_pass') ); 43 44 defined('OPENSID_DB_HOST') or 45 define( 'OPENSID_DB_HOST', opensid_get_option('db_host') ); 46 defined('OPENSID_APPPATH') or 47 define( 'OPENSID_APPPATH', opensid_get_option('sid_path') ); 48 49 defined('OPENSID_HOMEURL') or 50 define( 'OPENSID_HOMEURL', opensid_get_option('sid_home') ); 51 define( 'OPENSID_CONNECT', 'mysqli://' . OPENSID_DB_USER . ':' . OPENSID_DB_PASS . '@' . OPENSID_DB_HOST . '/' . OPENSID_DB_NAME); 52 53 if( is_dir( opensid_get_option('sid_path') . '/donjo-sys') ) { 54 17 55 require_once OPENSID_ABSPATH . 'ci-bootstrap.php'; 18 require_once OPENSID_ABSPATH . 'classes/class-opensid.php'; 19 add_action( 'init', array( 'OpenSID', 'run' ) ); 20 } 56 57 $connection = opensid_ci_load_database(); 58 59 if( $connection->initialize() ) 60 define( 'OPENSID_READY', true ); 61 else define( 'OPENSID_READY', false ); 62 63 unset($connection); 64 65 } else define( 'OPENSID_READY', false ); 66 require_once OPENSID_ABSPATH . 'classes/class-opensid.php'; 67 add_action( 'init', array( 'OpenSID', 'run' ) ); -
wpsid-shortcode/trunk/opensid.php
r1636430 r1637822 9 9 * Author: Simasta 10 10 * Author URI: http://simasta.siini.com 11 * Version: 1.0. 511 * Version: 1.0.6 12 12 * Text Domain: wpsid-shortcode 13 13 * Domain Path: /locale/ … … 18 18 19 19 /** 20 * Copyright (C) 2017 Simasta (email: simasta@siini.com)20 * Copyright (C) 2017 Simasta (email: masta@siini.com) 21 21 * 22 22 * This program is free software; you can redistribute it and/or … … 38 38 defined( 'ABSPATH' ) || die( 'No direct script access allowed!' ); 39 39 40 41 // Define certain plugin variables as constants. 42 define( 'OPENSID_ABSPATH', plugin_dir_path( __FILE__ ) ); 43 define( 'OPENSID_DIR_URL', plugin_dir_url( __FILE__ ) ); 44 define( 'OPENSID__FILE__', __FILE__ ); 45 define( 'OPENSID_BASENAME', plugin_basename( OPENSID__FILE__ ) ); 46 define( 'OPENSID_OPTION_KEY', 'wpsid_config' ); 47 40 48 require_once 'init.php'; -
wpsid-shortcode/trunk/readme.txt
r1633999 r1637822 5 5 Requires at least: 4.3 6 6 Tested up to: 4.7.3 7 Stable tag: 1.0. 57 Stable tag: 1.0.6 8 8 License: GPLv2 or later 9 9 … … 14 14 WPSID Shortcode integrate OpenSID and SID to Wrodpress with shortcodes. You can display statistics data from OpenSID and SID into wordpress. Visit [**demo site**](http://wpsid-shortcode.plugin.demo.siini.com/) for detail. 15 15 16 If you find this useful, [**please consider donating**](http://www.siini.com/wordpress/plugins/wpsid-shortcode/) whatever sum you choose, **even just 10 cents**. It's been downloaded thousands of times: just a few cents from every user would help me develop the plugin and improve support.16 If you find this useful, [**please consider donating**](http://www.siini.com/wordpress/plugins/wpsid-shortcode/) whatever sum you choose, **even just 10 cents**. 17 17 18 18 == Installation == … … 113 113 2. How to usage shortcode 114 114 3. Example directory structure 115 4. Admin page 115 116 116 117 117 118 == Changelog == 119 120 = 1.0.6 = 121 *Release Date - 2017/04/14* 122 * Added admin page 123 * Support custom path & database 124 125 = 1.0.5.1 = 126 *Release Date - 2017/04/13* 127 * Added localization 118 128 119 129 = 1.0.5 =
Note: See TracChangeset
for help on using the changeset viewer.