Пример #1
0
<?php

/* * *************************************************
 * 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
 */
// here the request to accept the challenge is being send to the friend
IzapBase::gatekeeper();
$friends = get_input('friend');
$challenge = new IzapChallenge(get_input('challenge_guid'));
if (sizeof($friends)) {
    $challenge->inviteFriends($friends);
}
forward(REFERER);
Пример #2
0
 /**
  * this functions begins the accepted challenge
  */
 public function actionPlay()
 {
     $container_guid = $this->url_vars[1];
     $start = (bool) $_SESSION['proper_started'][$container_guid];
     $contest = new IzapChallenge($container_guid, $start);
     if (!$_SESSION['challenge'][$contest->guid] || $_SESSION['challenge'][$contest->guid]['completed'] == true) {
         forward(IzapBase::setHref(array('context' => GLOBAL_IZAP_CONTEST_CHALLENGE_PAGEHANDLER, 'action' => 'result', 'vars' => array($contest->guid, elgg_get_friendly_title($this->title)))));
     }
     if (!$contest->can_play()) {
         register_error(elgg_echo('izap-contest:challenge:not_accepted_yet'));
         forward($contest->getURL());
     }
     /**
         $exit_action = elgg_view('output/confirmlink', array(
             'text' => elgg_echo('izap-contest:challenge:play:exit'),
             'href' => IzapBase::setHref(array(
                 'context' => GLOBAL_IZAP_CONTEST_CHALLENGE_PAGEHANDLER,
                 'action' => 'saveResults',
                 'page_handler' => FALSE,
                 'vars' => array($this->url_vars[1])
             )),
             'class' => 'elgg-button elgg-button-submit',
             'confirm' => elgg_echo('izap-contest-challenge:are_you_sure')));
     
     **/
     //  $exit_action = '<div style="float:right">' . $exit_action . '</div>';
     $quiz = $contest->current_question();
     $this->page_elements['title'] = elgg_echo('izap-contest:challenge', array($contest->title));
     $this->page_elements['content'] = elgg_view(GLOBAL_IZAP_CONTEST_PLUGIN . '/challenge/playing', array('challenge' => $contest, 'quiz' => $quiz));
     $this->page_elements['content'] .= $exit_action;
     $this->drawPage();
 }
Пример #3
0
<?php

/* * ************************************************
 * PluginLotto.com                                 *
 * Copyrights (c) 2005-2010. iZAP                  *
 * All rights reserved                             *
 * **************************************************
 * @author iZAP Team "<*****@*****.**>"
 * @link http://www.izap.in/
 * @version 1.0
 * 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/pg/forums/
 * Follow us on http://facebook.com/PluginLotto and http://twitter.com/PluginLotto
 */
gatekeeper();
// locks a challenge if user wants it to be unavailable for other users for a particular time
$challenge_guid = get_input('guid');
$challenge_entity = new IzapChallenge($challenge_guid);
$challenge_entity->lock = $challenge_entity->lock ? 0 : 1;
if (!$challenge_entity->save()) {
    register_error("Can not lock/unlock");
}
system_message("Challenge is " . $challenge_entity->lock ? "Locked" : "Unlocked");
forward($_SERVER['HTTP_REFERER']);
exit;
Пример #4
0
 * 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'])) {
    $supproted_media = array('audio/mp3', 'image/jpeg', 'image/gif', 'image/png', 'image/jpg', 'image/jpe', 'image/pjpeg', 'image/x-png');
    if (!in_array($_FILES['related_media']['type'], $supproted_media)) {