WordPress.org

Plugin Directory

Changeset 165366


Ignore:
Timestamp:
10/21/09 03:19:20 (4 years ago)
Author:
ikailo
Message:
 
Location:
wp-hive/tags/0.5.1
Files:
1 added
13 edited

Legend:

Unmodified
Added
Removed
  • wp-hive/tags/0.5.1/add-ons/root-files-rewriter.php

    r163862 r165366  
    1717 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    1818 
    19  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     19 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2020 */ 
    2121 
  • wp-hive/tags/0.5.1/admin/add.php

    r163862 r165366  
    1717 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    1818 
    19  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     19 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2020 */ 
    2121 
  • wp-hive/tags/0.5.1/admin/edit.php

    r163862 r165366  
    1717 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    1818 
    19  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     19 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2020 */ 
    2121 
  • wp-hive/tags/0.5.1/admin/settings.php

    r163862 r165366  
    1717 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    1818 
    19  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     19 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2020 */ 
    2121 
  • wp-hive/tags/0.5.1/db.php

    r163862 r165366  
    1717 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    1818 
    19  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     19 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2020 */ 
    2121 
     
    2424 */ 
    2525 
     26if ( ! defined('ABSPATH') ) die("Hmmm..."); 
     27 
     28require_once( ABSPATH . WPINC . '/wp-db.php' ); 
     29 
    2630if ( ! defined( 'WP_PLUGIN_DIR' ) ) 
    2731    define( 'WP_PLUGIN_DIR', WP_CONTENT_DIR . '/plugins' ); 
    2832 
    29 require_once( ABSPATH . WPINC . '/wp-db.php' ); 
    30 require_once( WP_PLUGIN_DIR . '/wp-hive/do-prefix.php'); 
     33if ( file_exists(WP_PLUGIN_DIR . '/wp-hive/do-prefix.php'))  
     34    require_once( WP_PLUGIN_DIR . '/wp-hive/do-prefix.php'); 
     35 
    3136?> 
  • wp-hive/tags/0.5.1/do-prefix.php

    r163862 r165366  
    1717 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    1818 
    19  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     19 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2020 */ 
     21 
     22if ( ! defined('ABSPATH') ) die("Hmmm..."); 
    2123 
    2224global $wpdb, $table_prefix, $hostname, $pathname, $wphive; 
     
    7779if (empty ($prefix)) { 
    7880// get all the sites possible for the hostname 
    79     $possible_sites = $wpdb->get_results($wpdb->prepare("SELECT prefix, path FROM wphive_hosts WHERE host = %s", $hostname)); 
    80     // None? Try to add one. 
     81    $possible_sites = $wpdb->get_results($wpdb->prepare("SELECT prefix, path FROM wphive_hosts WHERE host = %s", $hostname));    
    8182    if (!$possible_sites) { 
    8283    // TODO: Premium Feature - Redirect to alternate site. 
     84        echo "Here"; 
    8385        wp_die("Unknown Host"); 
    8486    } else { 
  • wp-hive/tags/0.5.1/includes/class.wphive.php

    r163862 r165366  
    1717 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    1818 
    19  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     19 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2020 */ 
    2121 
     
    4040 * @var string 
    4141 */ 
    42     var $version = '0.5'; 
     42    var $version = '0.5.1'; 
    4343 
    4444    /** 
     
    5757     * 
    5858     */ 
    59     public function wphive ( ) { 
    60  
    61     } 
     59    function wphive ( ) { } 
    6260 
    6361    /** 
     
    6765     * @return The version of WP Hive that is installed 
    6866     */ 
    69     public function get_installed_version() { 
     67    function get_installed_version() { 
    7068        global $wpdb; 
    7169        $suppress = $wpdb->suppress_errors(); 
     
    8987     * @return boolean True if the site has subdirectories 
    9088     */ 
    91     public function site_has_subdirs( $site ) { 
     89    function site_has_subdirs( $site ) { 
    9290        global $wpdb; 
    9391        if ($site->path == '/') { 
     
    108106     * @return An object representing the site record 
    109107     */ 
    110     public function get_site_by_id ( $id ) { 
     108    function get_site_by_id ( $id ) { 
    111109        global $wpdb; 
    112110        return $wpdb->get_row($wpdb->prepare("SELECT * FROM wphive_hosts WHERE id = %d ", $id) ); 
     
    124122     * @return An object representing the site record 
    125123     */ 
    126     public function get_site_by_prefix ( $prefix ) { 
     124    function get_site_by_prefix ( $prefix ) { 
    127125        global $wpdb; 
    128126        return $wpdb->get_row($wpdb->prepare("SELECT * FROM wphive_hosts WHERE prefix = %s ", $prefix)); 
     
    141139     * @return Result of the database query 
    142140     */ 
    143     public function remove_site ( $id ) { 
     141    function remove_site ( $id ) { 
    144142        global $wpdb; 
    145143        return $wpdb->query($wpdb->prepare("DELETE FROM wphive_hosts WHERE id = %d", $id )); 
     
    159157     * @return boolean true if site is active 
    160158     */ 
    161     public function is_site_installed ( $id = -1 ) { 
     159    function is_site_installed ( $id = -1 ) { 
    162160        global $wpdb; 
    163161        $id = $id == -1 ? $current_site->id : $id; 
     
    182180     * @return string $prefix 
    183181     */ 
    184     public function get_prefix_by_id ( $id ) { 
     182    function get_prefix_by_id ( $id ) { 
    185183        global $wpdb; 
    186184        return $wpdb->get_var($wpdb->prepare("SELECT prefix FROM wphive_hosts WHERE id = %s", $id)); 
     
    199197     * @return An array containing the site prefixes 
    200198     */ 
    201     public function get_all_prefixes( $only_active = false ) { 
     199    function get_all_prefixes( $only_active = false ) { 
    202200        global $wpdb; 
    203201        $where_string = $only_active ? " WHERE is_active = 1" : ""; 
     
    217215     * @return An array containing the information for all the sites 
    218216     */ 
    219     public function get_all_sites ( $only_active = false ) { 
     217    function get_all_sites ( $only_active = false ) { 
    220218        global $wpdb; 
    221219        $where_string = $only_active ? " WHERE is_active = 1" : ""; 
     
    236234     * @return Result of the database query 
    237235     */ 
    238     public function add_option($key, $value) { 
     236    function add_option($key, $value) { 
    239237        global $wpdb; 
    240238        return $wpdb->query($wpdb->prepare("INSERT INTO wphive_config (item, val) VALUES (%s, %s)", $key, $value ) ); 
     
    255253     * @return Result of the database query 
    256254     */ 
    257     public function upsert_site ( $site ) { 
     255    function upsert_site ( $site ) { 
    258256        global $wpdb; 
    259257        if ( isset($site['id']) && (!empty($site['id'])) ) { 
     
    282280     * @return Result of the database query 
    283281     */ 
    284     public function update_option($key, $value) { 
     282    function update_option($key, $value) { 
    285283        global $wpdb; 
    286284        return $wpdb->query($wpdb->prepare("UPDATE wphive_config SET val=%s WHERE item=%s", $value, $key)); 
     
    299297     * @return mixed Value set for the option. False if the option is empty 
    300298     */ 
    301     public function get_option($key) { 
     299    function get_option($key) { 
    302300        global $wpdb; 
    303301        // TODO: Verify the wphive_options table exists 
     
    319317     * @return mixed Result of Query 
    320318     */ 
    321     public function delete_option($key) { 
     319    function delete_option($key) { 
    322320        global $wpdb; 
    323321        return $wpdb->query($wpdb->prepare("DELETE FROM wphive_config WHERE item=%s", $key )); 
     
    337335     * @return mixed Result of Query 
    338336     */ 
    339     public function upsert_option($key, $value) { 
     337    function upsert_option($key, $value) { 
    340338        if ($this->option_exists($key)) { 
    341339            return $this->update_option($key, $value); 
     
    359357     * @return boolean True if the option exists 
    360358     */ 
    361     public function option_exists($key) { 
     359    function option_exists($key) { 
    362360        global $wpdb; 
    363361        return $wpdb->get_var($wpdb->prepare("SELECT count(*) FROM wphive_config WHERE item=%s", $key)) > 0; 
     
    380378     * @return string A unique prefix 
    381379     */ 
    382     public function get_unique_prefix($hostname) { 
     380    function get_unique_prefix($hostname) { 
    383381 
    384382    // Create a prefix from the hostname 
     
    410408     * @return boolean True if the prefix exists 
    411409     */ 
    412     public function prefix_exists($prefix) { 
     410    function prefix_exists($prefix) { 
    413411        global $wpdb; 
    414412        return $wpdb->get_var($wpdb->prepare("SELECT count(*) FROM wphive_hosts WHERE prefix=%s", $prefix)) > 0; 
     
    425423     * @return string Sanitized hostname 
    426424     */ 
    427     public function clean_hostname( $hostname ) { 
     425    function clean_hostname( $hostname ) { 
    428426        if (substr($hostname, 0, 8) == "https://") { $hostname = substr($hostname, 8); } // Strip https:// 
    429427        if (substr($hostname, 0, 7) == "http://") { $hostname = substr($hostname, 7); } // Strip http:// 
     
    444442     * @return string Sanitized pathname 
    445443     */ 
    446     public function clean_pathname( $pathname ) { 
     444    function clean_pathname( $pathname ) { 
    447445        $pathname = preg_replace('|([a-z0-9-]+.php.*)|', '', $pathname); // Ignore calling php file (eg: index.php) 
    448446        if (substr($pathname, 0, 9) == "/wp-admin") { $pathname = '/'; } // Ignore wp-admin, assume root path 
  • wp-hive/tags/0.5.1/includes/functions.php

    r163862 r165366  
    1717 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    1818 
    19  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     19 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2020 */ 
    2121 
  • wp-hive/tags/0.5.1/includes/install.php

    r163862 r165366  
    1717 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    1818 
    19  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     19 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2020 */ 
    2121 
     
    2727        case '0.4': 
    2828            wphive_upgrade_0_4($to_version); 
     29            break; 
     30        case '0.5': 
     31            wphive_upgrade_0_5($to_version); 
     32            break; 
    2933    } 
    3034} 
     
    9296    $wphive->add_option('default_permalinks', '/archives/%post_id%'); 
    9397 
    94     // Remove unused options 
    95     $wphive->delete_option('installed'); 
    96     $wphive->delete_option('allow_new_hosts'); 
     98// Depreceated Options 
     99//$wphive->delete_option('installed'); 
     100//$wphive->delete_option('allow_new_hosts'); 
     101} 
     102 
     103function wphive_upgrade_0_5($to_version) { 
     104    global $wphive; 
     105    $wphive->update_option('version', '0.5.1'); 
    97106} 
    98107 
  • wp-hive/tags/0.5.1/includes/plugin.php

    r163862 r165366  
    1717 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    1818 
    19  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     19 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2020 */ 
     21 
     22if ( ! defined('ABSPATH') ) die("Hmmm..."); 
    2123 
    2224/* 
  • wp-hive/tags/0.5.1/readme.txt

    r163862 r165366  
    55Tags: multiple blog, single installation 
    66Requires at least: 2.5 
    7 Tested up to: 2.8.4 
    8 Stable tag: 0.5 
     7Tested up to: 2.8.5 
     8Stable tag: 0.5.1 
    99 
    1010WP Hive is a WordPress Plugin that allows multiple WordPress sites to run on a single installation. 
     
    4141 
    4242== Screenshots == 
    43  
    44431. The WP Hive Administration Console showing a list of installed sites. 
    45442. The WP Hive Administration Console for adding a new site. 
    4645 
    4746== Changelog == 
     47= 0.5.1 = 
     48* Resolve php4 compatability 
     49* Resolve plugin activation issues 
     50* Ignore orphaned db.php 
    4851 
    4952= 0.5 = 
  • wp-hive/tags/0.5.1/resources/mime-content-type.php

    r163862 r165366  
    1717 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    1818 
    19  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     19 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2020 */ 
    2121 
  • wp-hive/tags/0.5.1/wp-hive.php

    r163862 r165366  
    22/* 
    33 Plugin Name: WP Hive 
    4  Plugin URI: http://wp-hive.com/overview/ 
     4 Plugin URI: http://wp-hive.com/ 
    55 Description: Run multiple blogs using a single installation of WordPress. 
    6  Version: 0.5 
     6 Version: 0.5.1 
    77 Author: ikailo 
    8  Author URI: http://wp-hive.com 
     8 Author URI: http://ikailo.com 
    99 */ 
    1010 
     
    2626 along with WP Hive.  If not, see <http://www.gnu.org/licenses/>. 
    2727 
    28  Copyright (C) 2009 John Sessford - john@wp-hive.com 
     28 Copyright (C) 2009 John Sessford - john@ikailo.com 
    2929 */ 
     30 
     31if ( ! defined('ABSPATH') ) die("Hmmm..."); 
    3032 
    3133/* 
     
    5961} 
    6062else { 
    61 // db.php his not in place. Must deactivate this plugin. 
     63// db.php is not in place. Must deactivate this plugin. 
    6264    $current = get_option('active_plugins'); 
    6365    $plugin_name = 'wp-hive/wp-hive.php'; 
    64     array_splice($current, array_search( $plugin, $current), 1 ); 
    65     update_option('active_plugins', $current); 
     66    $i = array_search($plugin, $current); 
     67    if ($i !== false) { 
     68        array_splice($current, $i, 1 ); 
     69        update_option('active_plugins', $current); 
     70    } 
    6671} 
    6772 
Note: See TracChangeset for help on using the changeset viewer.