Beispiel #1
0
<?php

session_start();
include "class_lib.php";
include "template.php";
$template = new template('html');
//=========
if (!$_POST['login'] && !$_SESSION['islogin']) {
    $template->set_filenames(array('login' => 'login.html'));
    $template->pparse('login');
} else {
    if ($_POST['login']) {
        include "classes/login.php";
        $login = new login();
        $test = $login->logger($_POST['log'], $_POST['pass']);
        if (!$test) {
            $template->set_filenames(array('login' => 'login.html'));
            $template->assign_block_vars('switch_login_fails', array());
            $template->pparse('login');
            $template->set_filenames(array('footer' => 'footer.html'));
            $template->pparse('footer');
            exit;
        }
        if ($test) {
            $_SESSION['islogin'] = $login->islogin;
            $_SESSION['access'] = $login->access;
            $_SESSION['emp'] = $login->EMP;
            $_SESSION['zone'] = $login->zone;
            $session = new session_info();
            $page = new layout();
            $page->call_info($_GET['pageload'], $session->access);
Beispiel #2
0
$template->assign_var('T_TEMPLATE_PATH', '../adm/style');

// the acp template is never stored in the database
$user->theme['template_storedb'] = false;

$install = new module();

$install->create('install', "index.$phpEx", $mode, $sub);
$install->load();

// Generate the page
$install->page_header();
$install->generate_navigation();

$template->set_filenames(array(
	'body' => $install->get_tpl_name())
);

$install->page_footer();

/**
* @package install
*/
class module
{
	var $id = 0;
	var $type = 'install';
	var $module_ary = array();
	var $filename;
	var $module_url = '';
	var $tpl_name = '';
Beispiel #3
0
 /**
  * @param string|string[] $files
  * @param bool|false $template
  * @param bool|false $template_path
  *
  * @return template
  *
  * (c) Gorlum 2015
  */
 public static function get($files, $template = false, $template_path = false)
 {
     !is_object($template) ? $template = new template() : false;
     //$template->set_custom_template($template_path ? $template_path : TEMPLATE_DIR, TEMPLATE_NAME, TEMPLATE_DIR);
     // $tmpl_name = gettemplatename($user['dpath']);
     $template->set_custom_template(($template_path ? $template_path : SN_ROOT_PHYSICAL . 'design/templates/') . DEFAULT_TEMPLATE . '/', DEFAULT_TEMPLATE, TEMPLATE_DIR);
     // TODO ГРЯЗНЫЙ ХАК! Это нужно, что бы по возможности перезаписать инфу из языковых пакетов модулей там, где она была перезаписана раньше инфой из основного пакета. Почему?
     //  - сначала грузятся модули и их языковые пакеты
     //  - затем по ходу дела ОСНОВНОЙ языковой пакет может перезаписать данные из МОДУЛЬНОГО языкового пакета
     // Поэтому и нужен этот грязный хак
     // В норме же - страницы заявляют сами, какие им пакеты нужны. Так что сначала всегда должны грузится основные языковые пакеты, а уже ПОВЕРХ них - пакеты модулей
     //    global $sn_mvc, $sn_page_name;
     //    !empty($sn_mvc['i18n']['']) ? lng_load_i18n($sn_mvc['i18n']['']) : false;
     //    $sn_page_name ? lng_load_i18n($sn_mvc['i18n'][$sn_page_name]) : false;
     if (!empty($files)) {
         is_string($files) ? $files = array(basename($files) => $files) : false;
         foreach ($files as &$filename) {
             $filename = $filename . TEMPLATE_EXTENSION;
         }
         $template->set_filenames($files);
     }
     return $template;
 }
Beispiel #4
0
function gettemplate($files, $template = false, $template_path = false)
{
    global $user;
    $template_ex = '.tpl.html';
    if ($template === false) {
        return sys_file_read(TEMPLATE_DIR . '/' . $files . $template_ex);
    }
    if (is_string($files)) {
        //    $files = array('body' => $files);
        $files = array(basename($files) => $files);
    }
    if (!is_object($template)) {
        $template = new template();
    }
    //$template->set_custom_template($template_path ? $template_path : TEMPLATE_DIR, TEMPLATE_NAME, TEMPLATE_DIR);
    $tmpl_name = gettemplatename($user['dpath']);
    $template->set_custom_template(($template_path ? $template_path : SN_ROOT_PHYSICAL . 'design/templates/') . $tmpl_name . '/', $tmpl_name, TEMPLATE_DIR);
    foreach ($files as &$filename) {
        $filename = $filename . $template_ex;
    }
    $template->set_filenames($files);
    return $template;
}
Beispiel #5
0
<?php

session_start();
if (!$_SESSION['islogin']) {
    include "template.php";
    $template = new template('html');
    $template->set_filenames(array('login' => 'login.html'));
    $template->assign_block_vars('switch_login_fails', array());
    $template->pparse('login');
    $template->set_filenames(array('footer' => 'footer.html'));
    $template->pparse('footer');
    exit;
}
if ($_GET['zid']) {
    unset($_SESSION['zone']);
    $_SESSION['zone'] = $_GET['zid'];
}
if (!$_SESSION['zone']) {
    if ($_SESSION['access'] > 1) {
        include_once "view_all_clients.php";
    } else {
        $template->set_filenames(array('body' => 'zone_error.html'));
        $template->pparse('body');
    }
} else {
    include 'classes/my_customers.php';
    $List = new client();
    if ($_GET['pageload'] == 7) {
        $template->set_filenames(array('body' => 'view_client.html'));
        if ($_GET['cid'] || $_POST['cid'] || $_POST['scid']) {
            include "classes/deposit.php";
Beispiel #6
0
<?php

session_start();
header('Expires: Fri, 25 Dec 1980 00:00:00 GMT');
// time in the past
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
include "class_lib.php";
include "template.php";
$template = new template('templates/square/html');
//=========
if (!$_POST['login'] && !$_SESSION['islogin']) {
    $template->set_filenames(array('login' => 'login.html'));
    $template->pparse('login');
    exit;
} else {
    if ($_POST['login']) {
        include "classes/login.php";
        $login = new login();
        $test = $login->logger($_POST['log'], $_POST['pass']);
        if (!$test) {
            $template->set_filenames(array('login' => 'login.html'));
            $template->assign_block_vars('switch_login_fails', array());
            $template->pparse('login');
            $template->set_filenames(array('footer' => 'footer.html'));
            exit;
        }
        if ($test) {
            $_SESSION['islogin'] = $login->islogin;
            $_SESSION['access'] = $login->access;
Beispiel #7
0
<?php

session_start();
if (!$_SESSION['islogin']) {
    include "template.php";
    $template = new template('html');
    $template->set_filenames(array('login' => 'login.html'));
    $template->assign_block_vars('switch_login_fails', array());
    $template->pparse('login');
    $template->set_filenames(array('footer' => 'footer.html'));
    $template->pparse('footer');
    exit;
}
include 'classes/my_customers.php';
$data = array();
$List = new client();
?>
	
	 <div class="verify">
    <form action = "confirm.php" method="POST">

      <fieldset>
      	<legend>
			Donnee a Verifier
		</legend>
		<table class="tabl" width="100%" cellspacing="0" summary="Data set of deposits to be approved from a given day.">
          <caption>
          <a href="#" onClick="return displayMenu('30 -- 9 -- 2009');">30 -- 9 -- 2009</a>
          </caption>

          <thead class="hat" id="30 -- 9 -- 20091">
Beispiel #8
0
<?php

session_start();
header('Expires: Fri, 25 Dec 1980 00:00:00 GMT');
// time in the past
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
if ($_SESSION['validinstall'] != 1) {
    header("location: ../");
} else {
    include "../template.php";
    $template = new template('../templates/square/html');
    if ($_POST['submit']) {
    } else {
        $template->set_filenames(array('body' => 'new.html'));
        $template->pparse('body');
    }
}
Beispiel #9
0
    /**
     * 
     * Displays a poll
     * 
     */
    public function get_poll($topicID = 0, $showLink = false, $template = 'prosilver')
    {
        global $db, $user, $auth, $config, $phpEx, $wpUnited, $phpbbForum;
        static $pollHasGenerated = false;
        $fStateChanged = $phpbbForum->foreground();
        if (!$pollHasGenerated) {
            $user->add_lang('viewtopic');
            $pollHasGenerated = true;
        }
        $display = false;
        $ajax = false;
        $inboundVote = array();
        // Is this an AJAX request?
        if ($topicID == 0) {
            $topicID = (int) request_var('pollid', 0);
            $template = (string) request_var('polltemplate', 'prosilver');
            $inboundVote = request_var('vote_id', array('' => 0));
            $display = (int) request_var('display', 0) == 1;
            $ajax = (int) request_var('ajax', 0) == 1;
            $showLink = (int) request_var('showlink', 0) == 1;
        }
        if (!$topicID) {
            return '';
        }
        // Or was this form submitted without JS? If so, which poll was it for? (Unlike in phpBB, there could be more than one)
        if (!$ajax) {
            // submitted:
            if (isset($_POST['update']) && isset($_POST['vote_id'])) {
                $pollID = (int) request_var('pollid', 0);
                if ($pollID == $topicID) {
                    $inboundVote = request_var('vote_id', array('' => 0));
                    // the same poll block could be on the page multiple times. We only want to register the vote once.
                    unset($_POST['update']);
                    unset($_POST['vote_id']);
                }
            }
            // view results link:
            if (isset($_GET['wpupolldisp'])) {
                $pollID = (int) request_var('pollid', 0);
                if ($pollID == $topicID) {
                    $display = 1;
                }
            }
        }
        if (trim($template) == '') {
            $template = 'prosilver';
        }
        $currURL = wpu_get_curr_page_link();
        $pollMarkup = '';
        $actionMsg = '';
        $sql = '
			SELECT t.topic_id, t.topic_title, t.topic_status, t.poll_title, t.poll_start, t.poll_length, 
						t.poll_max_options, t.poll_last_vote, t.poll_vote_change, 
						p.bbcode_bitfield, p.bbcode_uid, 
						t.forum_id, u.user_id, f.forum_name, f.forum_status, u.username, u.user_colour, u.user_type
			FROM ' . TOPICS_TABLE . ' AS t, ' . USERS_TABLE . ' AS u, ' . FORUMS_TABLE . ' AS f, ' . POSTS_TABLE . ' AS p
			WHERE t.topic_poster = u.user_id 
				AND t.forum_id = f.forum_id
				AND t.topic_id = ' . (int) $topicID . ' 
				AND p.post_id = t.topic_first_post_id';
        if (!($result = $db->sql_query($sql))) {
            $phpbbForum->restore_state($fStateChanged);
            wp_die(__('Could not access the database.', 'wp-united'));
        }
        $topicData = $db->sql_fetchrow($result);
        $db->sql_freeresult($result);
        if (!$topicData['poll_start'] || !$auth->acl_get('f_read', $topicData['forum_id'])) {
            $phpbbForum->restore_state($fStateChanged);
            return $pollMarkup;
        }
        $pollOptions = array();
        $sql = '
			SELECT * 
			FROM ' . POLL_OPTIONS_TABLE . ' 
			WHERE topic_id = ' . (int) $topicID;
        $result = $db->sql_query($sql);
        while ($row = $db->sql_fetchrow($result)) {
            $pollOptions[] = $row;
        }
        $db->sql_freeresult($result);
        $currVotedID = array();
        if ($user->data['is_registered']) {
            $sql = '
				SELECT poll_option_id
				FROM ' . POLL_VOTES_TABLE . '
				WHERE topic_id = ' . (int) $topicID . '
				AND vote_user_id = ' . $user->data['user_id'];
            $result = $db->sql_query($sql);
            while ($row = $db->sql_fetchrow($result)) {
                $currVotedID[] = $row['poll_option_id'];
            }
            $db->sql_freeresult($result);
        } else {
            // Cookie based guest tracking ...
            if (isset($_COOKIE[$config['cookie_name'] . '_poll_' . $topicID])) {
                $currVotedID = explode(',', $_COOKIE[$config['cookie_name'] . '_poll_' . $topicID]);
                $currVotedID = array_map('intval', $currVotedID);
            }
        }
        // Can not vote at all if no vote permission
        $userCanVote = $auth->acl_get('f_vote', $topicData['forum_id']) && ($topicData['poll_length'] != 0 && $topicData['poll_start'] + $topicData['poll_length'] > time() || $topicData['poll_length'] == 0) && $topicData['topic_status'] != ITEM_LOCKED && $topicData['forum_status'] != ITEM_LOCKED && (!sizeof($currVotedID) || $auth->acl_get('f_votechg', $topicData['forum_id']) && $topicData['poll_vote_change']) ? true : false;
        $displayResults = !$userCanVote || $userCanVote && sizeof($currVotedID) || $display ? true : false;
        if (sizeof($inboundVote) && $userCanVote) {
            //  ********   register vote here ********
            if (sizeof($inboundVote) > $topicData['poll_max_options'] || in_array(VOTE_CONVERTED, $currVotedID)) {
                if (!sizeof($inboundVote)) {
                    $actionMsg = $user->lang['NO_VOTE_OPTION'];
                } else {
                    if (sizeof($inboundVote) > $topicData['poll_max_options']) {
                        $actionMsg = $user->lang['TOO_MANY_VOTE_OPTIONS'];
                    } else {
                        if (in_array(VOTE_CONVERTED, $currVotedID)) {
                            $actionMsg = $user->lang['VOTE_CONVERTED'];
                        }
                    }
                }
            } else {
                foreach ($inboundVote as $option) {
                    if (in_array($option, $currVotedID)) {
                        continue;
                    }
                    $sql = '
						UPDATE ' . POLL_OPTIONS_TABLE . '
						SET poll_option_total = poll_option_total + 1
						WHERE poll_option_id = ' . (int) $option . '
							AND topic_id = ' . (int) $topicID;
                    $db->sql_query($sql);
                    if ($user->data['is_registered']) {
                        $sql_ary = array('topic_id' => (int) $topicID, 'poll_option_id' => (int) $option, 'vote_user_id' => (int) $user->data['user_id'], 'vote_user_ip' => (string) $user->ip);
                        $sql = 'INSERT INTO ' . POLL_VOTES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
                        $db->sql_query($sql);
                    }
                }
                foreach ($currVotedID as $option) {
                    if (!in_array($option, $inboundVote)) {
                        $sql = '
							UPDATE ' . POLL_OPTIONS_TABLE . '
							SET poll_option_total = poll_option_total - 1
							WHERE poll_option_id = ' . (int) $option . '
								AND topic_id = ' . (int) $topicID;
                        $db->sql_query($sql);
                        if ($user->data['is_registered']) {
                            $sql = '
								DELETE FROM ' . POLL_VOTES_TABLE . '
								WHERE topic_id = ' . (int) $topicID . '
									AND poll_option_id = ' . (int) $option . '
									AND vote_user_id = ' . (int) $user->data['user_id'];
                            $db->sql_query($sql);
                        }
                    }
                }
                if ($user->data['user_id'] == ANONYMOUS && !$user->data['is_bot']) {
                    $user->set_cookie('poll_' . $topicID, implode(',', $inboundVote), time() + 31536000);
                }
                $sql = '
					UPDATE ' . TOPICS_TABLE . '
					SET poll_last_vote = ' . time() . "\n\t\t\t\t\tWHERE topic_id = {$topicID}";
                $db->sql_query($sql);
                $actionMsg = $user->lang['VOTE_SUBMITTED'] . '<br />';
                // Reload vote state:
                $pollOptions = array();
                $sql = '
					SELECT * 
					FROM ' . POLL_OPTIONS_TABLE . ' 
					WHERE topic_id = ' . (int) $topicID;
                $result = $db->sql_query($sql);
                while ($row = $db->sql_fetchrow($result)) {
                    $pollOptions[] = $row;
                }
                $db->sql_freeresult($result);
                $currVotedID = $inboundVote;
                $userCanVote = $auth->acl_get('f_votechg', $topicData['forum_id']) && $topicData['poll_vote_change'];
                $displayResults = true;
            }
            // ***** end of vote registration ******
        }
        $pollTotal = 0;
        foreach ($pollOptions as $pollOption) {
            $pollTotal += $pollOption['poll_option_total'];
        }
        $pollBBCode = false;
        if ($topicData['bbcode_bitfield']) {
            require_once $wpUnited->get_setting('phpbb_path') . 'includes/functions_posting.' . $phpEx;
            require_once $wpUnited->get_setting('phpbb_path') . 'includes/bbcode.' . $phpEx;
            $pollBBCode = new bbcode();
        }
        for ($i = 0, $size = sizeof($pollOptions); $i < $size; $i++) {
            $pollOptions[$i]['poll_option_text'] = censor_text($pollOptions[$i]['poll_option_text']);
            if ($pollBBCode !== false) {
                $pollBBCode->bbcode_second_pass($pollOptions[$i]['poll_option_text'], $topicData['bbcode_uid'], $topicData['bbcode_bitfield']);
            }
            $pollOptions[$i]['poll_option_text'] = bbcode_nl2br($pollOptions[$i]['poll_option_text']);
            $pollOptions[$i]['poll_option_text'] = $phpbbForum->parse_phpbb_text_for_smilies($pollOptions[$i]['poll_option_text']);
        }
        $topicData['poll_title'] = $phpbbForum->censor($topicData['poll_title']);
        if ($pollBBCode !== false) {
            $pollBBCode->bbcode_second_pass($topicData['poll_title'], $topicData['bbcode_uid'], $topicData['bbcode_bitfield']);
        }
        $topicData['poll_title'] = bbcode_nl2br($topicData['poll_title']);
        $topicData['poll_title'] = $phpbbForum->parse_phpbb_text_for_smilies($topicData['poll_title']);
        unset($pollBBCode);
        $pollEnd = $topicData['poll_length'] + $topicData['poll_start'];
        $pollLength = $topicData['poll_length'] ? sprintf($user->lang[$pollEnd > time() ? 'POLL_RUN_TILL' : 'POLL_ENDED_AT'], $user->format_date($pollEnd)) : '';
        $topicLink = $phpbbForum->seo ? "topic{$topicID}.html" : "viewtopic.{$phpEx}?t={$topicID}";
        $pTemplate = new template();
        $pTemplate->set_custom_template($wpUnited->get_plugin_path() . 'extras/quickpoll/templates/', 'wpupoll');
        $pTemplate->set_filenames(array('poll' => "{$template}.html"));
        $pTemplate->assign_vars(array('POLL_QUESTION' => $topicData['poll_title'], 'TOTAL_VOTES' => $pollTotal, 'POLL_LEFT_CAP_IMG' => str_replace($wpUnited->get_setting('phpbb_path'), $phpbbForum->get_board_url(), $user->img('poll_left')), 'POLL_RIGHT_CAP_IMG' => str_replace($wpUnited->get_setting('phpbb_path'), $phpbbForum->get_board_url(), $user->img('poll_right')), 'POLL_ID' => $topicID, 'L_MAX_VOTES' => $topicData['poll_max_options'] == 1 ? $user->lang['MAX_OPTION_SELECT'] : sprintf($user->lang['MAX_OPTIONS_SELECT'], $topicData['poll_max_options']), 'L_POLL_LENGTH' => $actionMsg . $pollLength, 'POLL_TEMPLATE' => $template, 'S_CAN_VOTE' => $userCanVote, 'S_DISPLAY_RESULTS' => $displayResults, 'S_SHOW_LINK' => $showLink, 'U_TOPIC_LINK' => $phpbbForum->get_board_url() . $topicLink, 'L_TOPIC_LINK' => __('View poll in forum', 'wp-united'), 'S_IS_MULTI_CHOICE' => $topicData['poll_max_options'] > 1 ? true : false, 'S_POLL_ACTION' => $currURL, 'U_VIEW_RESULTS' => !strstr($currURL, '?') ? $currURL . '?wpupolldisp=1' : $currURL . '&amp;wpupolldisp=1'));
        foreach ($pollOptions as $pollOption) {
            $optionPct = $pollTotal > 0 ? $pollOption['poll_option_total'] / $pollTotal : 0;
            $optionPctTxt = sprintf("%.1d%%", round($optionPct * 100));
            $pTemplate->assign_block_vars('poll_option', array('POLL_OPTION_ID' => $pollOption['poll_option_id'], 'POLL_OPTION_CAPTION' => $pollOption['poll_option_text'], 'POLL_OPTION_RESULT' => $pollOption['poll_option_total'], 'POLL_OPTION_PERCENT' => $optionPctTxt, 'POLL_OPTION_PCT' => round($optionPct * 100), 'POLL_OPTION_IMG' => str_replace($wpUnited->get_setting('phpbb_path'), $phpbbForum->get_board_url(), $user->img('poll_center', $optionPctTxt, round($optionPct * 250))), 'POLL_OPTION_VOTED' => in_array($pollOption['poll_option_id'], $currVotedID) ? true : false));
        }
        ob_start();
        $pTemplate->display('poll');
        $pollMarkup = ob_get_contents();
        unset($pTemplate);
        ob_end_clean();
        $phpbbForum->restore_state($fStateChanged);
        if ($ajax) {
            wpu_ajax_header();
            echo '<wpupoll>';
            echo '<newnonce>' . wp_create_nonce('wpu-poll-submit') . '</newnonce>';
            echo '<pollid>' . $topicID . '</pollid>';
            echo '<markup><![CDATA[' . base64_encode($pollMarkup) . ']]></markup>';
            echo '</wpupoll>';
            exit;
        }
        return $pollMarkup;
    }
Beispiel #10
0
function gettemplate($templatename, $is_phpbb = false)
{
    $templatename .= '.tpl';
    if ($is_phpbb) {
        $template = new template();
        $template->set_custom_template(TEMPLATE_DIR, TEMPLATE_NAME);
        $template->set_filenames(array('body' => $templatename));
        return $template;
    } else {
        return ReadFromFile(TEMPLATE_DIR . '/' . $templatename);
    }
}
Beispiel #11
0
$template = new template();
$template->set_custom_template('templates', 'default');
/* Find the pot size to entice viewers */
try {
    $pot_size = number_format($bc->getbalance("Lottery Pot"), 2) . " BTC";
} catch (Exception $e) {
    if ($debug) {
        echo "EXCEPTION: " . $e->getMessage();
    } else {
        die("Sorry, an error occured and we cannot continue processing this page.");
    }
}
/* Site name */
$template->assign_vars(array('SITENAME' => 'BitLuck', 'DONATE' => '16nCPK6mx4WxSzbAQQCU7Sh9XTzDHDwB63', 'TOTALPOT' => $pot_size, 'OWNERPERCENTAGE' => $owner_fee * 100, 'WINNERPERCENTAGE' => 100 - $owner_fee * 100, 'DRAWTIME' => $draw_time, 'COST' => $ticket_cost));
/* Load up the header to be used on each page */
$template->set_filenames(array('header' => 'site_header.html'));
if (isset($_POST['submit'])) {
    /* Check if the address was valid */
    try {
        $resp = $bc->validateaddress($_POST['address']);
    } catch (Exception $e) {
        if ($debug) {
            echo "EXCEPTION: " . $e->getMessage();
        } else {
            die("Sorry, an error occured and we cannot continue processing this page.");
        }
    }
    if ($resp['isvalid']) {
        /* Find or generate the key for them to send to, save it */
        try {
            $addr = $bc->getaccountaddress("Incoming from " . $_POST['address']);