コード例 #1
0
ファイル: send_to_friend.php プロジェクト: socialweb/PiGo
/* * ***********************************************
 * PluginLotto.com                                 *
 * Copyrights (c) 2005-2011. iZAP                  *
 * All rights reserved                             *
 * *************************************************
 * @author iZAP Team "<*****@*****.**>"
 * @link http://www.izap.in/
 * Under this agreement, No one has rights to sell this script further.
 * For more information. Contact "Tarun Jangra<*****@*****.**>"
 * For discussion about corresponding plugins, visit http://www.pluginlotto.com/forum/
 * Follow us on http://facebook.com/PluginLotto and http://twitter.com/PluginLotto
 */
// this is the action page of the 'Send to a friend' page
global $CONFIG;
$attribs = IzapBase::getPostedAttributes();
//here the form is being check if all the values have been filled
if (IzapBase::hasFormError()) {
    register_error(elgg_echo("izap_elgg_bridge:error_empty_input_fields"));
    forward(REFERER);
}
// check the input values of the form here email validation is done
if (!filter_var($attribs['send_email'], FILTER_VALIDATE_EMAIL) || !filter_var($attribs['email'], FILTER_VALIDATE_EMAIL)) {
    register_error(elgg_echo('izap-contest:not_valid_email'));
    forward(REFERER);
}
$entity = get_entity($attribs['guid']);
if (!$entity) {
    register_error(elgg_echo('izap-contest:not_valid_entity'));
    forward(REFERER);
}
コード例 #2
0
ファイル: challenge_save.php プロジェクト: socialweb/PiGo
 * For more information. Contact "Tarun Jangra<*****@*****.**>"
 * For discussion about corresponding plugins, visit http://www.pluginlotto.com/pg/forums/
 * Follow us on http://facebook.com/PluginLotto and http://twitter.com/PluginLotto
 */
// here the new challlenge that created by the user is being saved
IzapBase::gatekeeper();
if (IzapBase::hasFormError()) {
    if (sizeof(IzapBase::getFormErrors())) {
        foreach (IzapBase::getFormErrors() as $error) {
            register_error(elgg_echo($error));
        }
    }
    forward(REFERRER);
}
//get all form attributes
$challenge_form = IzapBase::getPostedAttributes();
$_SESSION['zcontest']['challenge'] = $challenge_form;
$challenge_entity = new IzapChallenge((int) $challenge_form['guid']);
IzapBase::updatePostedAttribute('tags', string_to_tag_array($challenge_form['tags']));
$challenge_entity->setAttributes();
if ($challenge_entity->max_quizzes < 2) {
    $challenge_entity->max_quizzes = 2;
}
//save the media for the quiz
$challenge_entity->izap_upload_generate_thumbs($_FILES, $thumb);
if (!$challenge_entity->save()) {
    register_error(elgg_echo("Error in challenge creation"));
    forward(REFERER);
}
// checks the format of the uploaded files, if it is authorised
if (!empty($_FILES['related_media']['name'])) {
コード例 #3
0
ファイル: quiz_save.php プロジェクト: socialweb/PiGo
 * Follow us on http://facebook.com/PluginLotto and http://twitter.com/PluginLotto
 */
// here the new created quiz is being saved
// Make sure we're logged in
IzapBase::gatekeeper();
if (IzapBase::hasFormError()) {
    if (sizeof(IzapBase::getFormErrors())) {
        foreach (IzapBase::getFormErrors() as $error) {
            register_error(elgg_echo($error));
        }
    }
    forward(REFERRER);
    exit;
}
// Get input data
$quiz_form = IzapBase::getPostedAttributes();
if (!isset($quiz_form['correct_option'])) {
    register_error(elgg_echo('izap-contest:quiz:error:no_options'));
    forward(REFERER);
}
$_SESSION['zcontest']['quiz'] = $quiz_form;
// Make sure the title isn't blank
$quiz_entity = new IzapQuiz($quiz_form['guid']);
IzapBase::updatePostedAttribute('tags', string_to_tag_array($quiz_entity['tags']));
$quiz_entity->setAttributes();
if ($quiz_form['qtype'] == 'video') {
    $video_api = new IZAPVideoApi($quiz_form['related_media']);
    $video = $video_api->createVideoEntity();
    if (isset($video_api->errors)) {
        foreach ($video_api->errors as $error) {
            register_error($error);