2011-05-25 05:40:52 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once('include/attach.php');
|
|
|
|
require_once('include/datetime.php');
|
|
|
|
|
|
|
|
function wall_attach_post(&$a) {
|
|
|
|
|
2012-10-24 00:14:50 +00:00
|
|
|
// Figure out who owns the page and if they allow attachments
|
|
|
|
|
|
|
|
if(argc() > 1) {
|
|
|
|
$nick = argv(1);
|
|
|
|
$r = q("SELECT channel.* from channel where channel_address = '%s' limit 1",
|
2011-05-25 05:40:52 +00:00
|
|
|
dbesc($nick)
|
|
|
|
);
|
2013-01-23 03:36:14 +00:00
|
|
|
if(! $r)
|
|
|
|
killme();
|
2012-10-24 00:14:50 +00:00
|
|
|
$channel = $r[0];
|
2011-05-25 05:40:52 +00:00
|
|
|
|
|
|
|
}
|
2013-02-01 07:56:46 +00:00
|
|
|
|
2011-05-25 05:40:52 +00:00
|
|
|
else
|
2013-01-23 03:36:14 +00:00
|
|
|
killme();
|
2011-05-25 05:40:52 +00:00
|
|
|
|
2013-02-01 00:13:44 +00:00
|
|
|
$r = attach_store($channel,get_observer_hash());
|
2013-02-01 07:56:46 +00:00
|
|
|
|
2013-02-01 00:13:44 +00:00
|
|
|
if(! $r['success']) {
|
|
|
|
notice( $r['message'] . EOL);
|
2013-01-23 03:36:14 +00:00
|
|
|
killme();
|
2011-05-25 05:40:52 +00:00
|
|
|
}
|
|
|
|
|
2013-02-01 00:13:44 +00:00
|
|
|
echo "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n";
|
2011-05-25 05:40:52 +00:00
|
|
|
killme();
|
2013-02-01 00:13:44 +00:00
|
|
|
|
2011-05-25 05:40:52 +00:00
|
|
|
}
|