Plugin Directory

Changeset 490630


Ignore:
Timestamp:
01/16/2012 04:11:11 PM (14 years ago)
Author:
SpeakFeel
Message:

Added comment to header output to indicate active JoeMobi installation.

Location:
joemobi/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • joemobi/trunk/controllers/core.php

    r460683 r490630  
    5656      return $joemobi_api->controller_info($joemobi_api->query->controller);
    5757    } else {
    58       $dir = joemobi_api_dir();
    59       if (file_exists("$dir/joemobi-api.php")) {
    60         $php = file_get_contents("$dir/joemobi-api.php");
    61       } else {
    62         // Check one directory up, in case joemobi-api.php was moved
    63         $dir = dirname($dir);
    64         if (file_exists("$dir/joemobi-api.php")) {
    65           $php = file_get_contents("$dir/joemobi-api.php");
    66         }
    67       }
    68       if (preg_match('/^\s*Version:\s*(.+)$/m', $php, $matches)) {
    69         $version = $matches[1];
    70       } else {
    71         $version = '(Unknown)';
    72       }
    7358      $active_controllers = explode(',', get_option('joemobi_api_controllers', 'core'));
    7459      $controllers = array_intersect($joemobi_api->get_controllers(), $active_controllers);
    7560      return array(
    76         'joemobi_api_version' => $version,
     61        'joemobi_api_version' => joemobi_get_version(),
    7762        'controllers' => array_values($controllers)
    7863      );
  • joemobi/trunk/joemobi-api.php

    r489391 r490630  
    4040@include_once "$dir/models/attachment.php";
    4141
     42function joemobi_get_version() {
     43    $php = file_get_contents(__FILE__);
     44    if (preg_match('/^\s*Version:\s*(.+)$/m', $php, $matches)) {
     45      $version = $matches[1];
     46    } else {
     47      $version = '(Unknown)';
     48    }
     49    return $version;
     50}
     51
    4252function joemobi_api_init() {
    4353  global $joemobi_api;
     
    5262  add_filter('rewrite_rules_array', 'joemobi_api_rewrites');
    5363  $joemobi_api = new JOEMOBI_API();
     64}
     65
     66function joemobi_wp_head() {
     67    echo '<!-- JoeMobi (http://joemobi.com) v:' .  joemobi_get_version() . ' -->';
    5468}
    5569
     
    124138add_action( 'publish_post', 'joemobi_post_notification' );
    125139add_action( 'comment_duplicate_trigger', 'joemobi_comment_duplicate_trigger' );
     140add_action('wp_head', 'joemobi_wp_head');
    126141
    127142
Note: See TracChangeset for help on using the changeset viewer.