Skip to content

Commit

Permalink
app fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
voitto committed Oct 20, 2008
1 parent 85d88ac commit 6fe766f
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 49 deletions.
18 changes: 10 additions & 8 deletions app/plugins/omb.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,21 +107,23 @@ function catch_invite_token(&$request,&$route) {
}


// fix this so it happens AFTER all filters XXX

// this is a filter to redirect to the post that was replied to

after_filter( 'forward_after_reply', 'insert_from_post' );
//after_filter( 'forward_after_reply', 'insert_from_post' );

function forward_after_reply( &$model, &$rec ) {
//function forward_after_reply( &$model, &$rec ) {

global $request,$db;
// global $request,$db;

if (!($model->table == 'posts'))
return;
// if (!($model->table == 'posts'))
// return;

if (isset($request->params['post']['parent_id']))
redirect_to(array('resource'=>'posts','id'=>$request->params['post']['parent_id']));
// if (isset($request->params['post']['parent_id']))
// redirect_to(array('resource'=>'posts','id'=>$request->params['post']['parent_id']));

}
//}


// this is a filter to redirect to the reviewed resource
Expand Down
4 changes: 1 addition & 3 deletions db/library/dbscript/_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2354,7 +2354,7 @@ function load_apps() {

while ($s = $i->NextChild('settings')){
$s = $Setting->find($s->id);
if ($s->name = 'app')
if ($s->name == 'app')
app_init( $s->value );
}

Expand All @@ -2377,8 +2377,6 @@ function app_init($appname) {
require_once $startfile;
}

load_plugin( 'twitter_notice' );

$events = array(
'admin_head' => 'head',
'admin_menu' => 'menu',
Expand Down
38 changes: 0 additions & 38 deletions identica/controllers/dents.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,42 +144,4 @@ function dent_login_test($username, $password) {
}


function do_dent($tweet = '') {

global $aktt;


if (empty($aktt->twitter_username)
|| empty($aktt->twitter_password)
|| empty($tweet)
|| empty($tweet->tw_text)
) {
return;
}
require_once(ABSPATH.WPINC.'/class-snoopy.php');
$snoop = new Snoopy;
$snoop->agent = 'Twitter Tools http://alexking.org/projects/wordpress';
$snoop->rawheaders = array(
'X-Twitter-Client' => 'Twitter Tools'
, 'X-Twitter-Client-Version' => $aktt->version
, 'X-Twitter-Client-URL' => 'http://alexking.org/projects/wordpress/twitter-tools.xml'
);
$snoop->user = $aktt->twitter_username;
$snoop->pass = $aktt->twitter_password;
$snoop->submit(
'http://identi.ca/api/statuses/update.json'
, array(
'status' => $tweet->tw_text
, 'source' => 'twittertools'
)
);
if (strpos($snoop->response_code, '200')) {
update_option('aktt_last_dent_download', strtotime('-28 minutes'));
return true;
}
return false;
}




38 changes: 38 additions & 0 deletions identica/identica.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,41 @@ function identica_post() {
// publish_post
}


function do_dent($tweet = '') {

global $aktt;


if (empty($aktt->twitter_username)
|| empty($aktt->twitter_password)
|| empty($tweet)
|| empty($tweet->tw_text)
) {
return;
}
require_once(ABSPATH.WPINC.'/class-snoopy.php');
$snoop = new Snoopy;
$snoop->agent = 'Twitter Tools http://alexking.org/projects/wordpress';
$snoop->rawheaders = array(
'X-Twitter-Client' => 'Twitter Tools'
, 'X-Twitter-Client-Version' => $aktt->version
, 'X-Twitter-Client-URL' => 'http://alexking.org/projects/wordpress/twitter-tools.xml'
);
$snoop->user = $aktt->twitter_username;
$snoop->pass = $aktt->twitter_password;
$snoop->submit(
'http://identi.ca/api/statuses/update.json'
, array(
'status' => $tweet->tw_text
, 'source' => 'twittertools'
)
);
if (strpos($snoop->response_code, '200')) {
update_option('aktt_last_dent_download', strtotime('-28 minutes'));
return true;
}
return false;
}


0 comments on commit 6fe766f

Please sign in to comment.