Example #1
0
<?php

@session_start();
if (!@(require "Config/Main.php")) {
    die;
}
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Templates/{$MainTemplate}/PagSeguro.tpl.php")) {
    require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/LoggedOnly.class.php";
    new LoggedOnly();
    require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/MuDatabase.class.php";
    $db = new MuDatabase();
    require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Account.class.php";
    $acc = new Account($db);
    $my_array['Feedback'] = "";
    $my_array['memb___id'] = $acc->memb___id;
    $my_array['mail_addr'] = $acc->mail_addr;
    $my_array['memb_name'] = $acc->memb_name;
    $tpl = new Template();
    $tpl->Assign($my_array);
    $tpl->Display($_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Templates/{$MainTemplate}/PagSeguro.tpl.php");
} else {
    echo "ERROR: File Templates/{$MainTemplate}/PagSeguro.tpl.php doesnt exists";
}
Example #2
0
<?php

#-------------------------------------------------------------------#
# TubeX - Copyright � 2009 JMB Software, Inc. All Rights Reserved.  #
# This file may not be redistributed in whole or significant part.  #
# TubeX IS NOT FREE SOFTWARE                                        #
#-------------------------------------------------------------------#
# http://www.jmbsoft.com/           http://www.jmbsoft.com/license/ #
#-------------------------------------------------------------------#
require_once 'classes/Config.php';
require_once 'classes/Template.php';
$video_sorters = array('popular_today' => '`today_num_views` DESC', 'popular_week' => '`week_num_views` DESC', 'popular_month' => '`month_num_views` DESC', 'popular_all-time' => '`total_num_views` DESC', 'top-rated_today' => '`today_avg_rating` DESC', 'top-rated_week' => '`week_avg_rating` DESC', 'top-rated_month' => '`month_avg_rating` DESC', 'top-rated_all-time' => '`total_avg_rating` DESC', 'most-rated_today' => '`today_num_ratings` DESC', 'most-rated_week' => '`week_num_ratings` DESC', 'most-rated_month' => '`month_num_ratings` DESC', 'most-rated_all-time' => '`total_num_ratings` DESC', 'most-discussed_today' => '`today_num_comments` DESC', 'most-discussed_week' => '`week_num_comments` DESC', 'most-discussed_month' => '`month_num_comments` DESC', 'most-discussed_all-time' => '`total_num_comments` DESC', 'top-favorited_today' => '`today_num_favorited` DESC', 'top-favorited_week' => '`week_num_favorited` DESC', 'top-favorited_month' => '`month_num_favorited` DESC', 'top-favorited_all-time' => '`total_num_favorited` DESC');
$t = new Template(true, 3600);
$t->Assign('g_config', Config::GetAll());
$t->Assign('g_logged_in', isset($_COOKIE[LOGIN_COOKIE]));
$cookie = null;
if (isset($_COOKIE[LOGIN_COOKIE])) {
    parse_str($_COOKIE[LOGIN_COOKIE], $cookie);
    $t->Assign('g_username', $cookie['username']);
}
$functions = array('videos' => 'tbxDisplayVideos', 'video-comments' => 'tbxDisplayVideoComments', 'tag' => 'tbxDisplayVideosByTag', 'search' => 'tbxDisplayVideosBySearch', 'category' => 'tbxDisplayVideosByCategory', 'videos-newest' => 'tbxDisplayVideosNewest', 'categories' => 'tbxDisplayCategories', 'profile' => 'tbxDisplayProfile', 'video' => 'tbxDisplayVideo', 'private' => 'tbxDisplayPrivateVideo');
if (isset($functions[$_REQUEST['r']])) {
    call_user_func($functions[$_REQUEST['r']]);
} else {
    tbxDisplayIndex();
}
function tbxDisplayIndex()
{
    global $t;
    $t->cache_lifetime = Config::Get('cache_main');
    $t->Assign('g_loc_home', true);
Example #3
0
 require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Account.class.php";
 $acc = new Account($db);
 require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/WebTrade.class.php";
 $wt = new WebTrade($acc);
 $my_array['WarningMessage'] = "";
 $my_array['WebTradeContent'] = "";
 if ($WebTradeSnoCheck && (!isset($_SESSION['sno__numb']) || $_SESSION['sno__numb'] === false)) {
     $sno_tpl['url'] = $_SERVER['REQUEST_URI'];
     if (!isset($_SESSION['sno__numb'])) {
         $sno_tpl['Feedback'] = "";
     } else {
         if ($_SESSION['sno__numb'] === false) {
             $sno_tpl['Feedback'] = $GenericMessage09;
         }
     }
     $tpl->Assign($sno_tpl);
     $tpl->Display("Templates/{$MainTemplate}/SNO.tpl.php");
 } else {
     if (!$WebTradeBlockCheck || $WebTradeBlockCheck && $acc->CheckBlockStatus($acc->memb___id) == 0) {
         if (substr_count($_GET['c'], "/") > 0) {
             $my_url = explode("/", $_GET['c']);
             $action = $my_url[1];
             if (isset($my_url[2])) {
                 $data = $my_url[2];
             }
         }
         if (isset($action)) {
             switch ($action) {
                 case "Sell":
                     if (isset($_POST['SellItem'])) {
                         $my_array['WebTradeContent'] = $wt->SendSellItem($db, $acc->memb___id);
Example #4
0
// Copyright 2011 JMB Software, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
require_once 'includes/global.php';
$t = new Template();
$t->Assign('g_config', Config::GetAll());
$t->Assign('g_loc_upload', true);
$t->Assign('g_logged_in', isset($_COOKIE[LOGIN_COOKIE]));
if (!Config::Get('flag_allow_uploads')) {
    $t->Display('upload-disabled.tpl');
    return;
}
// For flash uploads, cookie sent through post vars
if (isset($_GET['flash'])) {
    if (isset($_POST['cookie'])) {
        $_COOKIE[LOGIN_COOKIE] = html_entity_decode($_POST['cookie']);
    } else {
        $t->Assign('g_errors', array(_T('Validation:PHP post_max_size exceeded')));
        $t->Display('upload-flash-errors.tpl');
        exit;
    }
Example #5
0
/**
 * Smarty {privacee} function plugin
 *
 * Type:     		function<br>
 * Name:     		privacee<br>
 * Purpose:  	
 * @link 
 * @author 		许健 (xujianmac@gmail.com)
 * @param 		array
 * @param 		Smarty
 * 
 */
function smarty_function_privacee($params, &$smarty)
{
    $link = $params['link'];
    if (!isset($link)) {
        $smarty->trigger_error('Smarty plugin privacee error: parameter "link" expected.');
    }
    $origin = $params['origin'];
    if (!isset($origin)) {
        $origin = 'null';
    }
    $oncomplete = $params['oncomplete'];
    if (!isset($oncomplete) || $oncomplete == '') {
        $oncomplete = 'function(){ return;}';
    } else {
        if (strchr($oncomplete, '(') || strchr($oncomplete, 'return')) {
            $oncomplete = 'function(){' . $oncomplete . '}';
        }
    }
    $onengage = $params['onengage'];
    if (strchr($onengage, '(') || strchr($onengage, 'return')) {
        $onengage = 'function(){' . $onengage . '}';
    }
    $ondismiss = $params['ondismiss'];
    if (strchr($ondismiss, '(') || strchr($ondismiss, 'return')) {
        $ondismiss = 'function(){' . $ondismiss . '}';
    }
    //var_dump($origin);
    $onload = $params['onload'];
    $onabort = $params['onabort'];
    $onerror = $params['onerror'];
    $origin = explode(';', $origin);
    //var_dump($origin);
    $html = '<link href="' . Asset::GetAssetUrl('/css/components/privacy.css') . '" rel="stylesheet" type="text/css" />';
    $html .= "\n";
    Template::Assign('oringin', $origin);
    Template::Assign('oringin_type', $origin[0]);
    Template::Assign('oringin_data', $origin[1]);
    $html .= Template::Render('section/privacy_setting.tpl');
    $html = Template::RequireJsCode($html);
    Template::ScriptHolder('', $html);
    $script = Template::RequireJs('/lib/jquery/jquery.form.js');
    $script .= "\n";
    $script .= <<<EOF
<script type="text/javascript">
EOF;
    if (isset($onengage)) {
        $script .= "\n__privacee__onengage = {$onengage};";
    }
    if (isset($ondismiss)) {
        $script .= "\n__privacee__ondismiss = {$ondismiss};";
    }
    $script .= <<<EOF

\$('{$link}').click(function(){
\t\$(this).blur();
\tvar p = \$(this).position();
  \$('#privacy-spring').show().css('left', p.left + 44).css('top', p.top - 3);
  __privacee__onengage.call();
\t__privacee__oncomplete = {$oncomplete};
\twindow.setTimeout(function(){
\t\t\$(window).resize(function(){
\t\t\t\$('#privacy-spring').hide();
\t\t});
\t}, 500);
\treturn false;
});
</script>

EOF;
    Template::ScriptHolder('', $script);
    return '';
}
Example #6
0
function tbxAdministratorEmail($administrator, $xtable, $template = null)
{
    $DB = GetDB();
    if (empty($template)) {
        $template = array();
        $template['subject'] = Request::Get('subject');
        $template['message'] = Request::Get('message');
    }
    $t = new Template();
    $t->Assign('g_config', Config::GetAll());
    $t->AssignByRef('g_administrator', $administrator);
    $mailer = new Mailer();
    $mailer->Mail($template, $t, $administrator['email'], $administrator['name']);
}
Example #7
0
function build_toplist($toplist)
{
    global $g_stats, $g_time, $compiler, $C;
    require_once 'dirdb.php';
    require_once 'compiler.php';
    require_once 'template.php';
    require_once 'stats.php';
    if (empty($toplist)) {
        return;
    }
    // Check that source file exists and is readable
    if ($toplist['source'] == TOPLIST_SOURCE_FILE) {
        if (!is_file($toplist['infile']) || !is_readable($toplist['infile'])) {
            return log_toplist_error("Input file '{$toplist['infile']}' does not exist or is not readable");
        }
        $toplist['template'] = file_get_contents($toplist['infile']);
    }
    // Check that the destination file exists and is writeable, or the directory exists and is writeable
    if (!file_exists($toplist['outfile'])) {
        $directory = dirname($toplist['outfile']);
        if (!is_dir($directory) || !is_writeable($directory)) {
            return log_toplist_error("Output directory '{$directory}' does not exist or is not writeable");
        }
    } else {
        if (!is_writeable($toplist['outfile'])) {
            return log_toplist_error("Output file '{$toplist['outfile']}' is not writeable");
        }
    }
    // Compile and check for errors
    if (($compiled = $compiler->Compile($toplist['template'])) === false) {
        return log_toplist_error("Toplist template for '{$toplist['outfile']}' contains errors");
    }
    // Load and cache overall stats
    if (!isset($g_stats)) {
        $_REQUEST['status'] = STATUS_ACTIVE;
        $g_stats = load_overall_stats(DIR_TRADE_STATS, get_trades(), TRUE);
    }
    // Get time
    if (!isset($g_time)) {
        $g_time = time();
    }
    // Prepare categories and groups
    $toplist['categories'] = empty($toplist['categories']) ? null : explode(',', $toplist['categories']);
    $toplist['groups'] = empty($toplist['groups']) ? null : explode(',', $toplist['groups']);
    // Prepare requirements & sources
    $toplist['trade_sources'] = unserialize($toplist['trade_sources']);
    $toplist['req_field'] = unserialize($toplist['req_field']);
    $toplist['req_operator'] = unserialize($toplist['req_operator']);
    $toplist['req_value'] = unserialize($toplist['req_value']);
    // Sort
    $_REQUEST['sort_by'] = $toplist['sort_by'];
    $_REQUEST['trade_sources'] = $toplist['trade_sources'];
    usort($g_stats, 'cmp_overall_stats');
    $t = new Template();
    $rank = 1;
    $trades = array();
    foreach ($g_stats as $so) {
        // Allowed in toplist?
        if (!$so->trade['flag_toplist']) {
            continue;
        }
        // Check categories
        if (!empty($toplist['categories']) && count(array_intersect($toplist['categories'], explode(',', $so->trade['categories']))) == 0) {
            continue;
        }
        // Check groups
        if (!empty($toplist['groups']) && count(array_intersect($toplist['groups'], explode(',', $so->trade['groups']))) == 0) {
            continue;
        }
        // Only trades with thumbnails
        if ($toplist['flag_thumbs_only'] && $so->trade['thumbnails'] < 1) {
            continue;
        }
        // Check requirement
        if (!empty($toplist['req_field']) && !$so->ignore_requirements) {
            for ($i = 0; $i < count($toplist['req_field']); $i++) {
                $req_failed = FALSE;
                switch ($toplist['req_operator'][$i]) {
                    case '>=':
                        $req_failed = !($so->{$toplist['req_field'][$i]} >= $toplist['req_value'][$i]);
                        break;
                    case '<':
                        $req_failed = !($so->{$toplist['req_field'][$i]} < $toplist['req_value'][$i]);
                        break;
                    case '<=':
                        $req_failed = !($so->{$toplist['req_field'][$i]} <= $toplist['req_value'][$i]);
                        break;
                    case '>':
                        $req_failed = !($so->{$toplist['req_field'][$i]} > $toplist['req_value'][$i]);
                        break;
                    default:
                        $req_failed = FALSE;
                        break;
                }
                if ($req_failed) {
                    break;
                }
            }
            if ($req_failed) {
                continue;
            }
        }
        $trade = get_object_vars($so);
        $trade = array_merge($trade, $trade['trade']);
        unset($trade['trade']);
        $trades[$rank] = $trade;
        $rank++;
    }
    $t->AssignByRef('g_trades', $trades);
    $t->AssignByRef('g_config', $C);
    $t->Assign('g_timestamp', $g_time);
    $t->Assign('g_date', date($C['date_format'], $g_time));
    $t->Assign('g_datetime', date($C['date_format'] . ' ' . $C['time_format'], $g_time));
    $output = $t->Parse($compiled);
    file_write($toplist['outfile'], $output);
}
Example #8
0
if (!@(require "Config/Main.php")) {
    die;
}
if (substr_count($_GET['c'], "/") > 0) {
    $my_url = explode("/", $_GET['c']);
    $code = $my_url[1];
    $memb___id = $my_url[2];
} else {
    $code = $memb___id = false;
}
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Templates/{$MainTemplate}/MailActivate.tpl.php")) {
    require $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "Language/{$MainLanguage}/MailActivate.php";
    require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/MuDatabase.class.php";
    $db = new MuDatabase();
    require_once $_SERVER['DOCUMENT_ROOT'] . "/" . $_SESSION['SiteFolder'] . "System/Account.class.php";
    $acc = new Account($db);
    $tpl = new Template();
    if ($memb___id || $code) {
        $tpl->Assign(array('MailActivateMessage' => $acc->MailActivate($memb___id, $code)));
    } else {
        if (isset($_POST['proceed'])) {
            $tpl->Assign(array('MailActivateMessage' => $acc->MailActivateSend($db)));
        } else {
            $tpl->Assign(array('MailActivateMessage' => $acc->MailActivateForm()));
        }
    }
    $tpl->Display("Templates/{$MainTemplate}/MailActivate.tpl.php");
    $db->Disconnect();
} else {
    echo "ERROR: File Templates/{$MainTemplate}/MailActivate.tpl.php doesnt exists";
}
Example #9
0
<?php

// Copyright 2011 JMB Software, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//    http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
require_once 'includes/global.php';
Request::Setup();
$page_num = empty($_GET['p']) ? 1 : $_GET['p'];
$template = preg_replace('~[^a-z0-9\\-]~i', '', $_GET['t']);
$t = new Template(true, Config::Get('cache_custom'));
$t->Assign('g_config', Config::GetAll());
$t->Assign('g_logged_in', isset($_COOKIE[LOGIN_COOKIE]));
if (isset($_COOKIE[LOGIN_COOKIE])) {
    parse_str($_COOKIE[LOGIN_COOKIE], $cookie);
    $t->Assign('g_username', $cookie['username']);
}
$t->Assign('g_page_number', $page_num);
$t->Assign('g_get_vars', $_GET);
$t->Display('custom-' . $template . '.tpl', $template . $page_num . serialize($_GET));
Example #10
0
require $GLOBALS['PATH_model'] . 'unit_c.php';
require $GLOBALS['PATH_model'] . 'post_c.php';
require $GLOBALS['PATH_model'] . 'seo_c.php';
require $GLOBALS['PATH_model'] . 'NP2.php';
require $GLOBALS['PATH_model'] . 'IntimeApi2.php';
require $GLOBALS['PATH_model'] . 'specification_c.php';
require $GLOBALS['PATH_model'] . 'segmentation_c.php';
require $GLOBALS['PATH_model'] . 'config_c.php';
require $GLOBALS['PATH_model'] . 'newsletter_c.php';
require $GLOBALS['PATH_model'] . 'simple_html_dom_c.php';
require $GLOBALS['PATH_model'] . 'parser_c.php';
require $GLOBALS['PATH_model'] . 'promo_c.php';
// Получение SEO данных для адреса
$Seo = new SEO();
if ($Seo->SetFieldsByUrl(_base_url . $_SERVER['REQUEST_URI'])) {
    if ($Seo->fields['visible'] == 1) {
        $tpl->Assign('seotext', $Seo->fields);
    }
}
// почтовая конфигурация
$GLOBALS['MAIL_CONFIG']['from_name'] = $GLOBALS['CONFIG']['mail_caption'];
// from (от) имя
$GLOBALS['MAIL_CONFIG']['from_email'] = $GLOBALS['CONFIG']['mail_email'];
// from (от) email адрес
// На всякий случай указываем настройки для дополнительного (внешнего) SMTP сервера.
$GLOBALS['MAIL_CONFIG']['smtp_mode'] = 'disabled';
// enabled or disabled (включен или выключен)
$GLOBALS['MAIL_CONFIG']['smtp_host'] = null;
$GLOBALS['MAIL_CONFIG']['smtp_port'] = null;
$GLOBALS['MAIL_CONFIG']['smtp_username'] = null;
// unset($theme, $sql, $profiles, $admin_controllers, $profile, $unwatch, $block, $arr, $i, $ips);