Plugin Directory

Changeset 2035670


Ignore:
Timestamp:
02/21/2019 06:27:36 AM (7 years ago)
Author:
alisdee
Message:

v1.0 release.

Location:
journalpress
Files:
21 added
5 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • journalpress/trunk/journalpress.php

    r1798815 r2035670  
    22/*
    33Plugin Name: JournalPress
    4 Plugin URI: https://wordpress.org/plugins/journalpress/
    5 Description: Mirrors your WordPress blog to any number of LiveJournal-based external journalling sites. Supports per-journal-per-post userpics and custom permission levels via the separate WP-Flock plugin.
    6 Version: 0.4
     4Plugin URI: https://github.com/alisinfinite/journalpress/
     5Description: Mirrors your WordPress blog to any number of LiveJournal-based external journalling sites. Supports per-journal-per-post userpics and custom permission levels via the separate WP-Flock plugin. v1.0 is is an almost total rewrite, so please make sure to check your journals and settings are still correct!
     6Version: 1.0
    77Author: Alis
    88Author URI: http://alis.me/
    9 
    10     Copyright (c) 2008-2018 Alis
    11 
    12     Permission is hereby granted, free of charge, to any person obtaining a
    13     copy of this software and associated documentation files (the "Software"),
    14     to deal in the Software without restriction, including without limitation
    15     the rights to use, copy, modify, merge, publish, distribute, sublicense,
    16     and/or sell copies of the Software, and to permit persons to whom the
    17     Software is furnished to do so, subject to the following conditions:
    18 
    19     The above copyright notice and this permission notice shall be included in
    20     all copies or substantial portions of the Software.
    21 
    22     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    23     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    24     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    25     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    26     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    27     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    28     DEALINGS IN THE SOFTWARE.
    299   
    3010    yay for debugging:  mail( 'email', 'subject', print_r( get_defined_vars(), true ) );
    3111*/
     12defined('ABSPATH') or die(':(');
    3213
    33 if( !defined( 'JXP_DOMAIN' ) )
    34   define( 'JXP_DOMAIN', '/ljxp/lang/ljxp' );
    35 if( function_exists( 'load_plugin_textdomain' ) )
    36   load_plugin_textdomain( JXP_DOMAIN );
    3714
    38 if( !defined( 'JPDIR' ) )
    39   define( 'JPDIR', dirname(__FILE__) );
     15if(!class_exists('journalpress')):
     16class journalpress {
    4017
    41 if( defined( 'ABSPATH' ) ){
    42   require_once(ABSPATH . WPINC .'/class-IXR.php' );
    43   require_once(ABSPATH . WPINC .'/class-wp-http-ixr-client.php');
     18//= VARIABLES ===================================================================//
     19  private $admin;
     20  private $install;
     21  private $meta;
     22  private $posts;
     23 
     24
     25//= CLASS AND WORDPRESS STUFF ===================================================//
     26  // constructor
     27  public function __construct() {
     28    // other thingies
     29   
     30    $this->doincludes();
     31   
     32    $this->canadmin();
     33    $this->canpost();
     34   
     35    $this->catchposts();
     36   
     37    return;
     38  }
     39 
     40  private function canadmin(){
     41    if(is_admin()){
     42      $this->admin = new jpadmin();
     43      $this->install = new jpinstall();
     44     
     45      // build us up...
     46      register_activation_hook(plugin_basename(__FILE__), array($this->install, 'init'));
     47      register_deactivation_hook(plugin_basename(__FILE__), array($this->install, 'deinit'));
     48     
     49      // menu pages
     50      add_action('admin_menu', array($this->admin, 'admin_menu'));
     51     
     52      // plugin links
     53      add_filter('plugin_action_links_'. plugin_basename(__FILE__), array($this->admin, 'admin_links'));
     54     
     55      // init stuff
     56      add_action('admin_init', array($this->admin, 'admin_init'));
     57    }
     58  }
     59 
     60  // this should be based on user capability, not just whether or not we're on the admin page
     61  // but we can't access those functions from where this is getting called soooo... thanks, WordPress!
     62  private function canpost(){
     63    if(is_admin()){
     64      $this->meta = new jpmeta();
     65 
     66      // meta box
     67      add_action('add_meta_boxes_post', array($this->meta, 'add_meta'), 10, 2);
     68      //add_action('save_post', array($this->meta, 'save_meta'), 5);
     69      add_action('transition_post_status', array($this->meta, 'save_meta'), 1, 3);
     70    } 
     71  }
     72 
     73  private function catchposts(){
     74    $this->posts = new jpposts();
     75   
     76    add_action('transition_post_status', array($this->posts, 'dopost'), 10, 3);
     77  }
     78 
     79  private function doincludes(){
     80    // wp xmlrpc library
     81    if(defined('ABSPATH')){
     82      require_once(ABSPATH . WPINC .'/class-IXR.php' );
     83      require_once(ABSPATH . WPINC .'/class-wp-http-ixr-client.php');
     84    }
     85   
     86    // include our other files
     87    if(is_admin()){
     88      require_once(dirname(__FILE__) .'/admin/jpadmin.class.php');
     89      require_once(dirname(__FILE__) .'/admin/jpinstall.class.php');
     90      require_once(dirname(__FILE__) .'/admin/jpsettings.class.php');
     91      require_once(dirname(__FILE__) .'/admin/jpmirrors.class.php');
     92      require_once(dirname(__FILE__) .'/admin/jpmeta.class.php');
     93    }
     94   
     95    require_once(dirname(__FILE__) .'/lib/jpposts.class.php');
     96    require_once(dirname(__FILE__) .'/lib/lj.class.php');
     97  }
    4498}
     99endif;
     100//===============================================================================//
    45101
    46 // include our other jp files
    47   include_once( JPDIR . '/jpinstall.php' );
    48   include_once( JPDIR . '/lj.class.php' );
    49   include_once( JPDIR . '/jpconfig.php' );
    50   include_once( JPDIR . '/jpfunctions.php' );
    51 
    52 //** INITIAL STUFFS **************************************************//
    53 // add the extra databases
    54 $wpdb->jpmirrors = $wpdb->prefix . 'jp_journals';
    55 
    56 // activation and deactivation
    57 register_activation_hook( __FILE__, 'jp_install' );
    58 register_deactivation_hook( __FILE__, 'jp_uninstall' );
    59 
    60 // menu pages
    61 add_action( 'admin_menu', 'jp_add_pages' );
    62 add_filter( 'plugin_action_links_'. plugin_basename(__FILE__), 'jp_links' );
    63 
    64 // initial options
    65 add_option( 'jp_installed' );
    66 
    67 // hookit!
    68 add_action( 'save_post', 'jp_save', 5 );
    69 add_action( 'save_post', 'jp_post', 10 );
    70 //add_action( 'publish_post', 'jp_post' );
    71 
    72 add_action( 'edit_post', 'jp_edit' );
    73 add_action( 'delete_post', 'jp_delete' );
    74 
    75 ?>
     102// initalise the class
     103if(class_exists('journalpress'))
     104  { $journalpress = new journalpress(); }
  • journalpress/trunk/readme.txt

    r1798815 r2035670  
    33Tags: livejournal, dreamwidth, crossposting, community, post, posts, social, update
    44Requires at least: 4.9.1
    5 Tested up to: 4.9.1
    6 Stable tag: 0.4
     5Tested up to: 5.0.3
     6Stable tag: 1.0
    77
    88A cross-poster supporting multiple LiveJournal Server journals.
     
    1010== Description ==
    1111
    12 **JournalPress** is a WordPress plugin that enabled cross-posting to sites running LiveJournal Server (i.e. Dreamwidth, LiveJournal, et al.). It is based on the existing LJXP plugin, however it has a raft of new features including:
     12**JournalPress** is a WordPress plugin that enabled cross-posting to sites running LiveJournal Server (i.e. Dreamwidth, LiveJournal, et al.). It is based on the LJXP plugin, however it has a raft of new features including:
    1313
    1414* support for multiple different mirror journals
    15 * support for custom security groups (via [WP-Flock](https://wordpress.org/plugins/wp-flock/ "WP-Flock"))
    1615* support for scheduled posts
    1716* support for posts created from interfaces (i.e. XML-RPC, Atom)
    1817* mood, music and location support
    19 * per-post-per-journal userpic selection
    20 * support for cut text.
     18* per-post-per-journal userpic selection.
    2119
    22 It is currently in its "stable beta" stage, and as such some features may not be available or a little wonky.
    23 
    24 = Version 0.4 =
    25 * A decade, yeesh. But yes, this plugin is still alive!
    26 * Fixed compatibility with Dreanwidth's enforced-HTTPS update.
    27 * Small fixes as proposed by [solarbird](https://wordpress.org/support/topic/two-tiny-patches-to-eliminate-warnings/).
    28 
    29 = Version 0.3.3 =
    30 * More mucking about with `serialize()`, hopefully now backwards-compatible.
    31 
    32 = Version 0.3.2 =
    33 * Fixed the nonsensical use of `serialize()` to work with WordPress v3.0-RC1.
    34 
    35 = Version 0.3.1 =
    36 * More sensible backdating.
    37 
    38 = Version 0.3 =
    39 * Journal pics, finally!
    40 * Batch updates should hopefully no longer spam f-lists.
    41 * Fixes for bugs: [#2](http://code.google.com/p/journalpress/issues/detail?id=2), [#7](http://code.google.com/p/journalpress/issues/detail?id=7) and [#8](http://code.google.com/p/journalpress/issues/detail?id=8).
    42 
    43 = Version 0.2.2 =
    44 * Added an option to allow comments on f-locked crossposts only.
    45 * Made some changes to how the tickyboxes on the post screen behave. Should be more sane now.
    46 * Scheduled posts should now behave a bit better.
    47 * Batch update/delete all posts functionality added, care of [branchandroot](http://www.branchandroot.net/).
    48 
    49 = Version 0.2.1 =
    50 * [WP-Flock](http://beta.void-star.net/projects/wp-flock "WP-Flock") compatibility added.
    51 * Interface post support added.
    52 * Some general menu cleaning done to work prettier with WP 2.7.
    53 
    54 = Version 0.2 =
    55 * WordPress 2.7 RC1 compatible, yay!
    56 * Re-re-fixed the non-Roman character support. Hopefully for the last time.
    57 
    58 = Version 0.1.3 =
    59 * Debugged some of the backdating stuff. It's a bit more brute force now, but hopefully more reliable (maybe).
    60 * Added the ability to tag a post with categories, tags or both (you'll need to re-update your options).
    61 * JournalPress should now accept non-Roman characters in the crosspost text, music and mood field (location and tags still have issues, but I maintain this one is LiveJournal's fault).
    62 * Quotes no longer cause icky backslashes to appear in the mood, music and location fields.
    63 * Thanks to some of the world's most convoluted return code, errors are now no longer silent.
    64 
    65 = Version 0.1.2 =
    66 * Scheduled post support added.
    67 * Basic mood, music and location support added.
    68 * Post are now tagged with tags as well as categories (gogo undocumented functions).
     20= Version 1.0 =
     21* Significant code rewrite, so make sure to check your **settings** and **journals** as some config items may not have migrated exactly as expected!
     22* Support for LJ-style cut plugins on the WordPress end removed. WordPress-native `<!--more-->` still supported.
     23* Support for customer user groups for posting locking removed, since the plugin it relied on is super broken.
     24* Bulk crossposting options removed.
    6925
    7026== Installation ==
     
    9147Communities in LJ-land are a bit finicky. Specifically they won't post if your security is private, and they won't post under certain backdated conditions.
    9248
    93 = Why don't you support per-post security settings? =
    94 
    95 We do, but it's via a separate plugin, [WP-Flock](https://wordpress.org/plugins/wp-flock/ "WP-Flock") (although note it's... currently kinda broken).
    96 
    9749== Credits ==
    9850
    9951**JournalPress** is based off the original [LJXP](http://ebroder.net/livejournal-crossposter/) client by Evan Broder, with the [LJ Crossposter Plus](http://www.alltrees.org/Wordpress/#LCP) modifications made by Ravenwood and Irwin. No disrespect is intended towards any of these authors; without their great work, this plugin wouldn't have been possible (or at least would've taken a hell of a lot longer to write).
    10052
    101 Batch update and delete journal code care of [branchandroot](http://www.branchandroot.net/).
     53Big shout-out to everyone who's kept using this terrible old code all this time. You guys rock!
Note: See TracChangeset for help on using the changeset viewer.