use Friendica\DI;
use Friendica\Util\Strings;
+global $blockem_words;
+
function blockem_install()
{
Hook::register('prepare_body_content_filter', 'addon/blockem/blockem.php', 'blockem_prepare_body_content_filter');
function blockem_conversation_start(App $a, array &$b)
{
+ global $blockem_words;
+
if (!local_user()) {
return;
}
$words = DI::pConfig()->get(local_user(), 'blockem', 'words');
if ($words) {
- $a->data['blockem'] = explode(',', $words);
+ $blockem_words = explode(',', $words);
}
DI::page()['htmlhead'] .= <<< EOT
function blockem_item_photo_menu(App $a, array &$b)
{
+ global $blockem_words;
+
if (!local_user() || $b['item']['self']) {
return;
}
$blocked = false;
$author = $b['item']['author-link'];
- if (!empty($a->data['blockem'])) {
- foreach($a->data['blockem'] as $bloke) {
+ if (!empty($blockem_words)) {
+ foreach($blockem_words as $bloke) {
if (Strings::compareLink($bloke,$author)) {
$blocked = true;
break;
use Friendica\Model\User;
use Friendica\Util\Strings;
+global $forumdirectory_search;
+
function forumdirectory_install()
{
Hook::register('app_menu', 'addon/forumdirectory/forumdirectory.php', 'forumdirectory_app_menu');
function forumdirectory_post(App $a)
{
+ global $forumdirectory_search;
+
if (!empty($_POST['search'])) {
- $a->data['search'] = $_POST['search'];
+ $forumdirectory_search = $_POST['search'];
}
}
function forumdirectory_content(App $a)
{
+ global $forumdirectory_search;
+
if ((DI::config()->get('system', 'block_public')) && (!local_user()) && (!remote_user())) {
notice(DI::l10n()->t('Public access denied.') . EOL);
return;
Nav::setSelected('directory');
- if (!empty($a->data['search'])) {
- $search = Strings::escapeTags(trim($a->data['search']));
+ if (!empty($forumdirectory_search)) {
+ $search = Strings::escapeTags(trim($forumdirectory_search));
} else {
$search = (!empty($_GET['search']) ? Strings::escapeTags(trim(rawurldecode($_GET['search']))) : '');
}
use Friendica\DI;
use Friendica\Util\Strings;
+global $js_upload_jsonresponse;
+global $js_upload_result;
+
function js_upload_install()
{
Hook::register('photo_upload_form', __FILE__, 'js_upload_form');
function js_upload_post_init(App $a, &$b)
{
+ global $js_upload_result, $js_upload_jsonresponse;
+
// list of valid extensions
$allowedExtensions = ['jpeg', 'gif', 'png', 'jpg'];
$result = $uploader->handleUpload();
// to pass data through iframe you will need to encode all html tags
- $a->data['upload_jsonresponse'] = htmlspecialchars(json_encode($result), ENT_NOQUOTES);
+ $js_upload_jsonresponse = htmlspecialchars(json_encode($result), ENT_NOQUOTES);
if (isset($result['error'])) {
Logger::log('mod/photos.php: photos_post(): error uploading photo: ' . $result['error'], Logger::DEBUG);
exit();
}
- $a->data['upload_result'] = $result;
+ $js_upload_result = $result;
}
function js_upload_post_file(App $a, &$b)
{
- $result = $a->data['upload_result'];
+ global $js_upload_result;
+
+ $result = $js_upload_result;
$b['src'] = $result['path'];
$b['filename'] = $result['filename'];
function js_upload_post_end(App $a, &$b)
{
+ global $js_upload_jsonresponse;
+
Logger::log('upload_post_end');
- if (!empty($a->data['upload_jsonresponse'])) {
- echo $a->data['upload_jsonresponse'];
+ if (!empty($js_upload_jsonresponse)) {
+ echo $js_upload_jsonresponse;
exit();
}
}