'php',
);
$post_data = array(
'method' => 'pwg.showcase.subscribe',
'url' => get_absolute_root_url(),
'date_creation' => $date_creation,
'name' => stripslashes($_POST['title']),
'comment' => stripslashes($_POST['description']),
'tags' => stripslashes($_POST['tags']),
'author' => stripslashes($_POST['author']),
'email' => $_POST['email'],
);
if (fetchRemote($url, $result, $get_data, $post_data))
{
$result = @unserialize($result);
// echo '
'; print_r($result); echo '
';
}
else
{
echo 'fetchRemote has failed
';
}
}
// +-----------------------------------------------------------------------+
// | template init |
// +-----------------------------------------------------------------------+
$template->set_filenames(
array(
'plugin_admin_content' => dirname(__FILE__).'/admin.tpl'
)
);
// +-----------------------------------------------------------------------+
// | subscription state |
// +-----------------------------------------------------------------------+
$url = $conf['showcase_subscribe_url'].'/ws.php';
$get_data = array(
'format' => 'php',
);
$post_data = array(
'method' => 'pwg.showcase.exists',
'url' => get_absolute_root_url(),
);
if (fetchRemote($url, $result, $get_data, $post_data))
{
$exists_result = @unserialize($result);
$subscription_status = $exists_result['result']['status'];
}
if (!isset($subscription_status))
{
$subscription_status = 'connectionFailure';
array_push(
$page['errors'],
sprintf(
l10n('An error has occured, no connection to %s'),
$conf['showcase_subscribe_url']
)
);
}
if ('pending' == $subscription_status)
{
array_push(
$page['infos'],
l10n('Your subscription is currently pending, if you have provided an email, you will be notified as soon as your gallery is registered')
);
}
if ('registered' == $subscription_status)
{
array_push(
$page['infos'],
sprintf(
l10n('Your gallery is already registered in Piwigo Showcase, see it →'),
$exists_result['result']['picture_url']
)
);
}
// +-----------------------------------------------------------------------+
// | prepare data for template |
// +-----------------------------------------------------------------------+
$template->assign(
array(
'CURRENT_STATUS' => $subscription_status,
'URL' => get_absolute_root_url(),
'DATE_CREATION' => format_date($date_creation),
'EMAIL' => get_webmaster_mail_address(),
'TITLE' => strip_tags($conf['gallery_title']),
'TAGS' => '',
'DESCRIPTION' => '',
)
);
// +-----------------------------------------------------------------------+
// | sending html code |
// +-----------------------------------------------------------------------+
$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
?>