streams/mod/wall_attach.php

35 lines
630 B
PHP
Raw Normal View History

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)
);
if(! $r)
killme();
2012-10-24 00:14:50 +00:00
$channel = $r[0];
2011-05-25 05:40:52 +00:00
}
2011-05-25 05:40:52 +00:00
else
killme();
2011-05-25 05:40:52 +00:00
$r = attach_store($channel,get_observer_hash());
if(! $r['success']) {
notice( $r['message'] . EOL);
killme();
2011-05-25 05:40:52 +00:00
}
echo "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n";
2011-05-25 05:40:52 +00:00
killme();
2011-05-25 05:40:52 +00:00
}