コード例 #1
0
 function Msg($msg)
 {
     $smarty = Template();
     $smarty->assign('msg', $msg);
     $smarty->display('msg.tpl');
     die;
 }
コード例 #2
0
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     ## Include functions for Bootstrap: (template choice)
     include_once 'components/com_ticketmaster/assets/functions.php';
     $filter_order = $mainframe->getUserStateFromRequest('filter_ordering', 'filter_ordering_t', 'a.ticketdate', 'cmd');
     ## Model is defined in the controller
     $model = $this->getModel();
     ## Getting the items into a variable
     $items = $this->get('list');
     $data = $this->get('data');
     $pagination = $this->get('pagination');
     $config = $this->get('config');
     $javascript = 'onchange="document.adminForm.submit();"';
     ## Filling the Array() for doors and make a select list for it.
     $ordering = array('a.price' => array('value' => 'a.ticketprice', 'text' => JText::_('COM_TICKETMASTER_ORDER_PRICE')), 'a.ticketdate' => array('value' => 'a.ticketdate', 'text' => JText::_('COM_TICKETMASTER_ORDER_DATE')), 'a.totaltickets' => array('value' => 'a.totaltickets', 'text' => JText::_('COM_TICKETMASTER_AVAILEBILLITY')));
     $lists['ordering'] = JHTML::_('select.genericList', $ordering, 'filter_ordering_t', ' class="inputbox" ' . $javascript, 'value', 'text', $filter_order);
     ## Showing default template or bootstrap?
     $tpl = Template($config->load_bootstrap);
     $uri = JFactory::getURI();
     $this->assignRef('items', $items);
     $this->assignRef('config', $config);
     $this->assignRef('lists', $lists);
     $this->assignRef('data', $data);
     $this->assignRef('pagination', $pagination);
     $this->assign('action', $uri->toString());
     $this->assign('ordering', $filter_order);
     parent::display($tpl);
 }
コード例 #3
0
ファイル: display.php プロジェクト: pombredanne/tuleap
function actionPage(&$request, $action)
{
    global $WikiTheme;
    $pagename = $request->getArg('pagename');
    $version = $request->getArg('version');
    $page = $request->getPage();
    $revision = $page->getCurrentRevision();
    $dbi = $request->getDbh();
    $actionpage = $dbi->getPage($action);
    $actionrev = $actionpage->getCurrentRevision();
    $pagetitle = HTML(fmt("%s: %s", $actionpage->getName(), $WikiTheme->linkExistingWikiWord($pagename, false, $version)));
    $validators = new HTTP_ValidatorSet(array('pageversion' => $revision->getVersion(), '%mtime' => $revision->get('mtime')));
    $request->appendValidators(array('pagerev' => $revision->getVersion(), '%mtime' => $revision->get('mtime')));
    $request->appendValidators(array('actionpagerev' => $actionrev->getVersion(), '%mtime' => $actionrev->get('mtime')));
    $transformedContent = $actionrev->getTransformedContent();
    $template = Template('browse', array('CONTENT' => $transformedContent));
    /*
        if (!headers_sent()) {
            //FIXME: does not work yet. document.write not supported (signout button)
            // http://www.w3.org/People/mimasa/test/xhtml/media-types/results
            if (ENABLE_XHTML_XML 
                and (!isBrowserIE() and
                     strstr($request->get('HTTP_ACCEPT'),'application/xhtml+xml')))
                header("Content-Type: application/xhtml+xml; charset=" . $GLOBALS['charset']);
            else
                header("Content-Type: text/html; charset=" . $GLOBALS['charset']);
        }
    */
    GeneratePage($template, $pagetitle, $revision);
    $request->checkValidators();
    flush();
}
コード例 #4
0
ファイル: themeinfo.php プロジェクト: hugcoday/wiki
 function header()
 {
     global $HTML, $group_id, $group_public_name, $request, $project;
     $pagename = $request->getArg('pagename');
     $submenu = Template('navbar');
     //group is private
     if (!$project->isPublic()) {
         //if it's a private group, you must be a member of that group
         session_require_perm('project_read', $group_id);
     }
     //for dead projects must be member of admin project
     if (!$project->isActive()) {
         //only SF group can view non-active, non-holding groups
         session_require_global_perm('forge_admin');
     }
     $HTML->header(array('title' => $group_public_name . ': ' . htmlspecialchars($pagename), 'group' => $group_id, 'toptab' => 'wiki', 'submenu' => $submenu->asXML()));
     // Display a warning banner for internal users when the wiki is opened
     // to external users.
     if ($project->getIsExternal()) {
         $external_user = false;
         if (session_loggedin()) {
             $user = session_get_user();
             $external_user = $user->getIsExternal();
         }
         if (!$external_user) {
             $page = $request->getPage();
             if ($page->get('external')) {
                 $external_msg = _("This page is external.");
             }
             echo $HTML->warning_msg(_("This project is shared with third-party users (non Alcatel-Lucent users).") . (isset($external_msg) ? ' ' . $external_msg : ''));
         }
     }
 }
コード例 #5
0
 function display($tpl = null)
 {
     $mainframe = JFactory::getApplication();
     ## Include functions for Bootstrap:
     include_once 'components/com_ticketmaster/assets/functions.php';
     $filter_order = $mainframe->getUserStateFromRequest('filter_ordering', 'filter_ordering_t', 'a.ticketdate', 'cmd');
     ## Model is defined in the controller
     $model = $this->getModel();
     ## Getting the items into a variable
     $items = $this->get('list');
     $added = $this->get('added');
     $sold = $this->get('sold');
     $pagination = $this->get('pagination');
     $db = JFactory::getDBO();
     ## Making the query to get the website configuration.
     $sql = "SELECT load_bootstrap, dateformat, priceformat, valuta, show_quantity_eventlist, show_price_eventlist  \n\t\t\t\tFROM #__ticketmaster_config \n\t\t\t\tWHERE configid = 1";
     $db->setQuery($sql);
     $config = $db->loadObject();
     ## Getting the page template for the header to show up.
     $sql = "SELECT mailbody, mailsubject \n\t\t\t\tFROM #__ticketmaster_emails \n\t\t\t\tWHERE emailid = 51";
     $db->setQuery($sql);
     $tmpl = $db->loadObject();
     ## Showing default template or bootstrap?
     $tpl = Template($config->load_bootstrap);
     $this->assignRef('added', $added);
     $this->assignRef('sold', $sold);
     $this->assignRef('items', $items);
     $this->assignRef('config', $config);
     $this->assignRef('tmpl', $tmpl);
     $this->assignRef('pagination', $pagination);
     parent::display($tpl);
 }
コード例 #6
0
    function display($tpl = null)
    {
        ## Model is defined in the controller
        $model = $this->getModel('payment');
        $db = JFactory::getDBO();
        ## Getting the global DB session
        $session = JFactory::getSession();
        ## Gettig the orderid if there is one.
        $ordercode = $session->get('ordercode');
        ## Check if there are any tickets on the waiting list.
        $sql = 'SELECT COUNT(id) AS total
			  FROM #__ticketmaster_waitinglist
			  WHERE ordercode = ' . $ordercode . '
			  AND processed = 0';
        $db->setQuery($sql);
        $waitlist = $db->loadObject();
        ## Count the tickets in the order table:
        $sql = 'SELECT COUNT(orderid) AS total
			  FROM #__ticketmaster_orders
			  WHERE ordercode = ' . $ordercode . '';
        $db->setQuery($sql);
        $orders = $db->loadObject();
        if ($orders->total == 0 && $waitlist->total > 0) {
            $model = $this->getModel('payment');
            $msg = $this->get('msg');
            $this->assignRef('msg', $msg);
            $tpl = 'message';
            parent::display($tpl);
        } else {
            ## Getting the items into a variable
            $items = $this->get('data');
            $price = $this->get('price');
            $config = $this->get('config');
            $tos = $this->get('tos');
            if ($config->pro_installed == 1) {
                ## will only be loaded if PRO is installed.
                ## it won't work if you don't have the pro tables and views.
                $coords = $this->get('extdata');
                $require = $this->get('datacheck');
                $failed = $this->get('datafailed');
                ## Assign data to the view ;)
                $this->assignRef('coords', $coords);
                $this->assignRef('required', $require);
                $this->assignRef('failed', $failed);
            }
            ## Include functions for Bootstrap: (template choice)
            include_once 'components/com_ticketmaster/assets/functions.php';
            ## Showing default template or bootstrap?
            $tpl = Template($config->load_bootstrap);
            $this->assignRef('items', $items);
            $this->assignRef('waitlist', $waitlist);
            $this->assignRef('config', $config);
            $this->assignRef('price', $price);
            $this->assignRef('tos', $tos);
            parent::display($tpl);
        }
    }
コード例 #7
0
/**
 * Function used to display flash player for ClipBucket video
 */
function flashPlayer($param)
{
    global $Cbucket, $swfobj;
    $param['player_div'] = $param['player_div'] ? $param['player_div'] : 'videoPlayer';
    $key = $param['key'];
    $flv = $param['flv'] . '.flv';
    $code = $param['code'];
    $flv_url = $file;
    $embed = $param['embed'];
    $code = $param['code'];
    $height = $param['height'] ? $param['height'] : config('player_height');
    $width = $param['width'] ? $param['width'] : config('player_width');
    $param['height'] = $height;
    $param['width'] = $width;
    $param['enlarge_button'] = config('enlarge_button');
    $param['player_logo_url'] = config('player_logo_url');
    //dump($code);
    if (!$param['autoplay']) {
        $param['autoplay'] = config('autoplay_video');
    }
    assign('player_params', $param);
    if (count($Cbucket->actions_play_video) > 0) {
        foreach ($Cbucket->actions_play_video as $funcs) {
            if (function_exists($funcs)) {
                $func_data = $funcs($param);
            }
            if ($func_data) {
                $player_code = $func_data;
                $show_player = true;
                break;
            }
        }
    }
    if (function_exists('cbplayer') && empty($player_code)) {
        $player_code = cbplayer($param, true);
    } elseif (function_exists('cbplayer')) {
        return $player_code;
    }
    global $pak_player;
    if ($player_code) {
        if (!$pak_player && $show_player && !is_bool($player_code)) {
            assign("player_js_code", $player_code);
            Template(PLAYER_DIR . '/player.html', false);
            return false;
        } else {
            return false;
        }
    }
    return blank_screen($param);
}
コード例 #8
0
ファイル: cbplayer.php プロジェクト: Coding110/cbvideo
 function cb_player($in)
 {
     global $cb_player;
     $cb_player = true;
     $vdetails = $in['vdetails'];
     $vid_file = get_video_file($vdetails, true, true);
     //Checking for YT Referal
     if (function_exists('get_refer_url_from_embed_code')) {
         $ref_details = get_refer_url_from_embed_code(unhtmlentities(stripslashes($vdetails['embed_code'])));
         $ytcode = $ref_details['ytcode'];
     }
     if ($vid_file || $ytcode) {
         $hd = $data['hq'];
         if ($hd == 'yes') {
             $file = get_hq_video_file($vdetails);
         } else {
             $file = get_video_file($vdetails, true, true);
         }
         $hd_file = get_hq_video_file($vdetails);
         if ($ytcode) {
             assign('youtube', true);
             assign('ytcode', $ytcode);
         }
         if (!strstr($in['width'], "%")) {
             $in['width'] = $in['width'] . 'px';
         }
         if (!strstr($in['height'], "%")) {
             $in['height'] = $in['height'] . 'px';
         }
         if ($in['autoplay'] == 'yes' || $in['autoplay'] === true || $_COOKIE['auto_play_playlist'] && ($_GET['play_list'] || $_GET['playlist'])) {
             $in['autoplay'] = true;
         } else {
             $in['autoplay'] = false;
         }
         //Logo Placement
         assign('logo_placement', cb_player_logo_position());
         assign('logo_margin', config('logo_padding'));
         //Setting Skin
         assign('cb_skin', 'glow/glow.xml');
         assign('player_data', $in);
         assign('player_logo', website_logo());
         assign('normal_vid_file', $vid_file);
         assign("hq_vid_file", $hd_file);
         assign('vdata', $vdetails);
         Template(CB_PLAYER_DIR . '/cbplayer.html', false);
         return true;
     }
 }
コード例 #9
0
ファイル: loadsave.php プロジェクト: pombredanne/tuleap
function StartLoadDump(&$request, $title, $html = '')
{
    // MockRequest is from the unit testsuite, a faked request. (may be cmd-line)
    // We are silent on unittests.
    if (isa($request, 'MockRequest')) {
        return;
    }
    // FIXME: This is a hack. This really is the worst overall hack in phpwiki.
    if ($html) {
        $html->pushContent('%BODY%');
    }
    $tmpl = Template('html', array('TITLE' => $title, 'HEADER' => $title, 'CONTENT' => $html ? $html : '%BODY%'));
    echo ereg_replace('%BODY%.*', '', $tmpl->getExpansion($html));
    $request->chunkOutput();
    // set marker for sendPageChangeNotification()
    $request->_deferredPageChangeNotification = array();
}
コード例 #10
0
/**
 * Loads ClipBucket players...
 * 
 * @global type $Cbucket
 * @global type $swfobj
 * @param type $param
 * @return boolean
 * 
 * @todo Write documentation on this function..
 */
function cb_video_player($param)
{
    global $Cbucket, $swfobj;
    $param['player_div'] = $param['player_div'] ? $param['player_div'] : 'videoPlayer';
    $key = $param['key'];
    $code = $param['code'];
    $flv_url = $file;
    $embed = $param['embed'];
    $code = $param['code'];
    $height = $param['height'] ? $param['height'] : config('player_height');
    $width = $param['width'] ? $param['width'] : config('player_width');
    $param['height'] = $height;
    $param['width'] = $width;
    if (!$param['autoplay']) {
        $param['autoplay'] = config('autoplay_video');
    }
    if (!$param['files']) {
        global $cbvid;
        $files = $cbvid->get_video_files($param['video']);
        $param['files'] = $files;
    }
    assign('player_params', $param);
    $param = apply_filters($param, 'play_video');
    //Calling actions for play_video
    $output = call_actions('play_video', $param);
    if ($output) {
        $player_code = $output;
        return $output;
    }
    if (function_exists('cbplayer') && empty($player_code)) {
        $player_code = cbplayer($param, true);
    }
    if ($player_code) {
        if (!$pak_player && $show_player) {
            assign("player_js_code", $player_code);
            Template(PLAYER_DIR . '/player.html', false);
            return false;
        } else {
            return false;
        }
    }
    return blank_screen($param);
}
コード例 #11
0
 function display($tpl = null)
 {
     $db = JFactory::getDBO();
     $app = JFactory::getApplication();
     ## Model is defined in the controller
     $model = $this->getModel('venue');
     ## Getting the items into a variable
     $data = $this->get('data');
     $items = $this->get('items');
     $config = $this->get('config');
     ## Include functions for Bootstrap: (template choice)
     include_once 'components/com_ticketmaster/assets/functions.php';
     ## Showing default template or bootstrap?
     $tpl = Template($config->load_bootstrap);
     $this->assignRef('data', $data);
     $this->assignRef('items', $items);
     $this->assignRef('config', $config);
     parent::display($tpl);
 }
コード例 #12
0
ファイル: cb_video_js.php プロジェクト: reactvideos/Website
 function cb_video_js($in)
 {
     global $cb_video_js;
     $cb_video_js = true;
     $vdetails = $in['vdetails'];
     $video_play = get_video_files($vdetails, true, true);
     if (!strstr($in['width'], "%")) {
         $in['width'] = $in['width'] . 'px';
     }
     if (!strstr($in['height'], "%")) {
         $in['height'] = $in['height'] . 'px';
     }
     assign('height', $in['height']);
     assign('width', $in['width']);
     assign('player_config', $in);
     assign('vdata', $vdetails);
     assign('cb_logo', cb_logo());
     assign('video_files', $video_play);
     Template(CB_VJS_PLAYER_DIR . '/cb_video_js.html', false);
     return true;
 }
コード例 #13
0
 /**
  * Compiles code for the {extends} tag
  *
  * @param array $args     array with attributes from parser
  * @param object $compiler compiler object
  * @return string compiled code
  */
 public function compile($args, $compiler)
 {
     // check and get attributes
     $_attr = $this->getAttributes($compiler, $args);
     if (strpos($_attr['file'], '$_tmp') !== false) {
         $compiler->trigger_template_error('illegal value for file attribute', $compiler->lex->taglineno);
     }
     $_smarty_tpl = $compiler->template;
     $name = $_attr['file'];
     if ($name[0] === "'" && $name[strlen($name) - 1] === "'") {
         $name = '"' . substr($name, 1, -1) . '"';
     }
     $tpl_name = json_decode($name);
     // create template object
     $_template = Template($tpl_name, $compiler->smarty, $compiler->template);
     // check for recursion
     $uid = $_template->source->uid;
     if (isset($compiler->extends_uid[$uid])) {
         $compiler->trigger_template_error("illegal recursive call of \"{$name}\"", $this->lex->line - 1);
     }
     $compiler->extends_uid[$uid] = true;
     if (empty($_template->source->components)) {
         array_unshift($compiler->sources, $_template->source);
     } else {
         foreach ($_template->source->components as $source) {
             array_unshift($compiler->sources, $source);
             $uid = $source->uid;
             if (isset($compiler->extends_uid[$uid])) {
                 $compiler->trigger_template_error("illegal recursive call of \"{$source->filepath}\"", $this->lex->line - 1);
             }
             $compiler->extends_uid[$uid] = true;
         }
     }
     unset($_template);
     $compiler->inheritance_child = true;
     $compiler->lex->yypushstate(\Box\Brainy\Compiler\Lexer::CHILDBODY);
     return '';
 }
コード例 #14
0
ファイル: upload_forms.php プロジェクト: reactvideos/Website
function load_remote_upload_form($params = NULL)
{
    global $file_name;
    assign('params', $params);
    Template(STYLES_DIR . '/global/remote_upload_form.html', false);
    return false;
    echo '<div class="alert alert-info marginTop">
			' . lang('upload_remote_video_msg') . '
			</div>';
    echo '<div class="upload_form_div clearfix form-group' . $class . '" id="remoteUploadFormDiv">
        <label for="remote_file_url" class="label">' . lang('please_enter_remote_file_url') . '</label>
        <input name="remote_file_url" type="textfield"  class="remoteUrlInput form-control" 
        id="remote_file_url" value="' . lang('remote_upload_example') . '"
        onclick="if($(this).val()==\'' . lang('remote_upload_example') . '\') $(this).val(\'\')"/>
        <input name="submit_upload" type="hidden" value="' . lang('upload_data_now') . '">
        
        <div id="remote_upload_result_cont"></div>
        <div class="remote_main_bar" id="main_bar">
            <div id="prog_bar" class="remote_prog_bar"></div>
        </div>
        <div align="center" id="loading" style="margin:5px 0px"></div>
        <div>
            ' . lang('remoteDownloadStatusDiv') . '
        </div>                
        <div align="right">
		
			<input type="button" name="ytUploadBttn" id="ytUploadBttn" 
			value="' . lang('grab_from_youtube') . '" onClick="youtube_upload()" class="cbSubmitUpload">
            <input type="button" name="remoteUploadBttn" id="remoteUploadBttn" value="' . lang('upload') . '" 
			onClick="_cb.' . get_remote_url_function() . '" class="cbSubmitUpload">
            <input type="button" name="remoteUploadBttnStop" id="remoteUploadBttnStop" value="' . lang('cancel') . '"   
			class="cbSubmitUpload" style="display:none"/>
        </div>
   	 	</div>
   	 	<div id="remoteForm"></div> ';
}
コード例 #15
0
    $Record2 = mysql_fetch_array($DataSet2);
    $gcp_nb = $Record2["gcp_nb"];
    $nb_max_product = pow(10, 12 - $length);
    $perc_num = $nb_rc_0 / $nb_num * 100;
    $perc = number_format($perc_num, 2, '.', ' ');
    $nb = number_format($nb_num, 0, '.', ' ');
    $nb_rc_0 = number_format($nb_rc_0, 0, '.', ' ');
    $nb_max_product = number_format($nb_max_product, 0, '.', ' ');
    if ($gcp_nb == $nb_num) {
        // if all gcp have been checked, green background
        $style_nb = 'background-color:rgb(190, 247, 190);';
    } else {
        if ($length > 7) {
            $style_nb = 'background-color:rgb(213, 211, 211);';
        } else {
            $style_nb = '';
        }
    }
    if ($perc_num > 2) {
        $style_perc = '';
    } else {
        $style_perc = 'color:red;';
    }
    $Corps .= Template("template-stats-gcp-length", 2, $Params = array("VALUE_PREFIX" => $prefix, "VALUE_LENGTH" => $length, "VALUE_NB_NUM" => $nb_num, "VALUE_NB" => $nb, "VALUE_NB_RC_0" => $nb_rc_0, "VALUE_PREFIX_NM" => $prefix_nm, "VALUE_COUNTRY" => $country, "VALUE_GCP_NB" => $gcp_nb, "VALUE_NB_MAX_PRODUCT" => $nb_max_product, "VALUE_PERC_NUM" => $perc_num, "VALUE_PERC" => $perc, "VALUE_STYLE_NB" => $style_nb, "VALUE_STYLE_PERC" => $style_perc, "VALUE_IMG_COUNTRY" => DOSSIER_IMG_COUNTRY . strtolower($country)));
}
$Corps .= Template("template-stats-gcp-length", 3, $Params = array());
$FileName = $DataFolder . "stats-gcp-length.html";
$file = fopen($FileName, 'w');
fputs($file, $Corps);
fclose($file);
echo "File generated<hr/>";
コード例 #16
0
ファイル: style.php プロジェクト: BackupTheBerlios/thwc
        $data['work'] = '<font color="#990000">Kein Style angelegt.</font>';
    } else {
        $data['work'] .= '<a href="style.php?action=publicStyle&styleid=all">Alle als &ouml;ffendlich makieren</a> |
          <a href="style.php?action=publicStyle&styleid=no">Alle als nicht &ouml;ffendlich makieren</a><br /><br />
          <table cellpadding="3" cellspacing="0" border="0">';
        while ($list = db_result($r_list)) {
            $data['work'] .= '<tr>
              <td>' . $list['stylename'] . '</td>
              <td>&nbsp;</td>
              <td><font color="#FF0000">' . ($list['styleisdefault'] == 1 ? '*' : '&nbsp;') . '</font></td>
              <td><font color="#0000FF">' . ($list['styleispublic'] == 1 ? '*' : '&nbsp;') . '</font></td>
              <td>&nbsp;</td>
              <td>
               <a href="style.php?action=editStyle&styleid=' . $list['styleid'] . '">Editieren</a> |
               <a href="style.php?action=deleStyle&styleid=' . $list['styleid'] . '">L&ouml;schen</a> |
               <a href="style.php?action=defaultStyle&styleid=' . $list['styleid'] . '">Als global makieren</a> |
               <a href="style.php?action=exStyle&styleid=' . $list['styleid'] . '">Exportieren</a>
              </td>
             </tr>';
        }
        $data['work'] .= '</table><br /><br />
          <font color="#FF0000">*</font> Globaler Style. Dieser Wird auf der Indexseite und in allen Foren genutzt, es sei denn
          f&uuml;r ein Forum<br />&nbsp;&nbsp; ist ein anderer Style makiert.<br /><br />
          <font color="#0000FF">*</font> &Ouml;ffendlicher Style. Diese Styles k&ouml;nnen vom User im Profil ausgew&auml;hlt werden.<br />
          &nbsp;&nbsp; Dann wird f&uuml;r ihn das gesammte Board mit diesem Style angezeigt.
         ';
    }
}
$data['javascript'] = '';
echo Template(Get_Template('templates/admin.html'));
tb_footer();
コード例 #17
0
ファイル: main.php プロジェクト: neymanna/fusionforge
 function handleAction()
 {
     $action = $this->getArg('action');
     if ($this->isPost() and !$this->_user->isAdmin() and $action != 'browse') {
         $page = $this->getPage();
         if ($page->get('moderation')) {
             require_once "lib/WikiPlugin.php";
             $loader = new WikiPluginLoader();
             $plugin = $loader->getPlugin("ModeratedPage");
             if ($plugin->handler($this, $page)) {
                 $CONTENT = HTML::div(array('class' => 'wiki-edithelp'), fmt("%s: action forwarded to a moderator.", $action), HTML::br(), _("This action requires moderator approval. Please be patient."));
                 if (!empty($plugin->_tokens['CONTENT'])) {
                     $plugin->_tokens['CONTENT']->pushContent(HTML::br(), _("You must wait for moderator approval."));
                 } else {
                     $plugin->_tokens['CONTENT'] = $CONTENT;
                 }
                 require_once "lib/Template.php";
                 $title = WikiLink($page->getName());
                 $title->pushContent(' : ', WikiLink(_("ModeratedPage")));
                 GeneratePage(Template('browse', $plugin->_tokens), $title, $page->getCurrentRevision());
                 $this->finish();
             }
         }
     }
     $method = "action_{$action}";
     if (method_exists($this, $method)) {
         $this->{$method}();
     } elseif ($page = $this->findActionPage($action)) {
         $this->actionpage($page);
     } else {
         $this->finish(fmt("%s: Bad action", $action));
     }
 }
コード例 #18
0
/**
 * This function includes the file containing user custom background
 * if uploaded. This code should run after opening html <body> tag.
 * This will spread the background cross the window.
 * 
 * @global OBJECT $userquery
 * @param MIX $uid
 * @return custom_background.html Template
 */
function display_user_custom_background($uid = null)
{
    global $userquery;
    if (is_null($uid)) {
        return false;
    }
    if (is_numeric($uid)) {
        $user = $userquery->get_user_details($uid);
    } else {
        $user = $uid;
    }
    if (empty($user)) {
        return false;
    }
    assign('u', $user);
    Template(STYLES_DIR . '/global/blocks/view_channel/custom_background.html', false);
}
コード例 #19
0
ファイル: file_uploader.php プロジェクト: reactvideos/Website
     if (!$tags) {
         $tags = $title;
     }
     $vidDetails = array('title' => $title, 'description' => $desc, 'tags' => $tags, 'category' => array($cbvid->get_default_cid()));
     assign("objId", $_POST['objId']);
     assign('input', $vidDetails);
     $vid = $_POST['vid'];
     assign('videoid', $vid);
     $videoFields = $Upload->load_video_fields($vidDetails);
     //$requiredFields = array_shift($videoFields);
     // echo "<pre>";
     // var_dump($videoFields[0]);
     // echo "</pre>";
     //echo json_encode($videoFields);
     //Template('blocks/upload/form.html');
     Template('blocks/upload/upload_form.html');
     break;
 case "upload":
     $file_name = time() . RandomString(5);
     $tempFile = $_FILES['Filedata']['tmp_name'];
     $file_directory = date('Y/m/d');
     $targetFileName = $file_name . '.' . getExt($_FILES['Filedata']['name']);
     $targetFile = TEMP_DIR . "/" . $targetFileName;
     $logFile = $file_name . ".log";
     logData('Checking Server configurations to start for filename : ' . $file_name . '', 'checkpoints');
     $max_file_size_in_bytes = config('max_upload_size') * 1024 * 1024;
     $types = strtolower(config('allowed_types'));
     //Checking filesize
     $POST_MAX_SIZE = ini_get('post_max_size');
     $unit = strtoupper(substr($POST_MAX_SIZE, -1));
     $multiplier = $unit == 'M' ? 1048576 : ($unit == 'K' ? 1024 : ($unit == 'G' ? 1073741824 : 1));
コード例 #20
0
ファイル: loadsave.php プロジェクト: neymanna/fusionforge
function RevertPage(&$request)
{
    $mesg = HTML::dd();
    $pagename = $request->getArg('pagename');
    $version = $request->getArg('version');
    if (!$version) {
        PrintXML(HTML::dt(fmt("Revert"), " ", WikiLink($pagename)), HTML::dd(_("missing required version argument")));
        return;
    }
    $dbi =& $request->_dbi;
    $page = $dbi->getPage($pagename);
    $current = $page->getCurrentRevision();
    $currversion = $current->getVersion();
    if ($currversion == 0) {
        $mesg->pushContent(' ', _("no page content"));
        PrintXML(HTML::dt(fmt("Revert"), " ", WikiLink($pagename)), $mesg);
        flush();
        return;
    }
    if ($currversion == $version) {
        $mesg->pushContent(' ', _("same version page"));
        PrintXML(HTML::dt(fmt("Revert"), " ", WikiLink($pagename)), $mesg);
        flush();
        return;
    }
    if ($request->getArg('cancel')) {
        $mesg->pushContent(' ', _("Cancelled"));
        PrintXML(HTML::dt(fmt("Revert"), " ", WikiLink($pagename)), $mesg);
        flush();
        return;
    }
    if (!$request->getArg('verify')) {
        $mesg->pushContent(HTML::br(), _("Are you sure?"), HTML::br(), HTML::form(array('action' => $request->getPostURL(), 'method' => 'post'), HiddenInputs($request->getArgs(), false, array('verify')), HiddenInputs(array('verify' => 1)), Button('submit:verify', _("Yes"), 'button'), HTML::Raw('&nbsp;'), Button('submit:cancel', _("Cancel"), 'button')));
        $rev = $page->getRevision($version);
        $html = HTML(HTML::dt(fmt("Revert %s to version {$version}", WikiLink($pagename))), $mesg, $rev->getTransformedContent());
        $template = Template('browse', array('CONTENT' => $html));
        GeneratePage($template, $pagename, $rev);
        $request->checkValidators();
        flush();
        return;
    }
    $rev = $page->getRevision($version);
    $content = $rev->getPackedContent();
    $versiondata = $rev->_data;
    $versiondata['summary'] = sprintf(_("revert to version %d"), $version);
    $new = $page->save($content, $currversion + 1, $versiondata);
    $dbi->touch();
    $pagelink = WikiLink($pagename);
    $mesg->pushContent(fmt("Revert: %s", $pagelink), fmt("- version %d saved to database as version %d", $version, $new->getVersion()));
    // Force browse of current page version.
    $request->setArg('version', false);
    $template = Template('savepage', array());
    $template->replace('CONTENT', $new->getTransformedContent());
    GeneratePage($template, $mesg, $new);
    flush();
}
コード例 #21
0
ファイル: cb_link_video.php プロジェクト: reactvideos/Website
/**
 * Function used to load embed form
 */
function load_link_video_form($params)
{
    global $file_name;
    if ($params['class']) {
        $class = ' ' . $params['class'];
    }
    assign('objId', RandomString(5));
    assign('class', $class);
    Template(PLUG_DIR . '/cb_link_video/form.html', false);
}
コード例 #22
0
 function run($dbi, $argstr, &$request, $basepage)
 {
     $args = $this->getArgs($argstr, $request);
     $user =& $request->_user;
     if (isa($request, 'MockRequest')) {
         return '';
     }
     if (!$request->isActionPage($request->getArg('pagename')) and (!isset($user->_prefs->_method) or !in_array($user->_prefs->_method, array('ADODB', 'SQL'))) or in_array($request->getArg('action'), array('zip', 'ziphtml', 'dumphtml')) or isa($user, '_ForbiddenUser')) {
         $no_args = $this->getDefaultArguments();
         // ?
         //            foreach ($no_args as $key => $value) {
         //                $no_args[$value] = false;
         //            }
         $no_args['errmsg'] = HTML(HTML::h2(_("Error: The user HomePage must be a valid WikiWord. Sorry, UserPreferences cannot be saved."), HTML::hr()));
         $no_args['isForm'] = false;
         return Template('userprefs', $no_args);
     }
     $userid = $user->UserName();
     if ($user->isAuthenticated() and !empty($userid)) {
         $pref =& $request->_prefs;
         $args['isForm'] = true;
         //trigger_error("DEBUG: reading prefs from getPreferences".print_r($pref));
         if ($request->isPost()) {
             $errmsg = '';
             $delete = $request->getArg('delete');
             if ($delete and $request->getArg('verify')) {
                 // deleting prefs, verified
                 $default_prefs = $pref->defaultPreferences();
                 $default_prefs['userid'] = $user->UserName();
                 $user->setPreferences($default_prefs);
                 $request->_setUser($user);
                 $request->setArg("verify", false);
                 $request->setArg("delete", false);
                 $alert = new Alert(_("Message"), _("Your UserPreferences have been successfully deleted."));
                 $alert->show();
                 return;
             } elseif ($delete and !$request->getArg('verify')) {
                 return HTML::form(array('action' => $request->getPostURL(), 'method' => 'post'), HiddenInputs(array('verify' => 1)), HiddenInputs($request->getArgs()), HTML::p(_("Do you really want to delete all your UserPreferences?")), HTML::p(Button('submit:delete', _("Yes"), 'delete'), HTML::Raw('&nbsp;'), Button('cancel', _("Cancel"))));
             } elseif ($rp = $request->getArg('pref')) {
                 // replace only changed prefs in $pref with those from request
                 if (!empty($rp['passwd']) and $rp['passwd2'] != $rp['passwd']) {
                     $errmsg = _("Wrong password. Try again.");
                 } else {
                     //trigger_error("DEBUG: reading prefs from request".print_r($rp));
                     //trigger_error("DEBUG: writing prefs with setPreferences".print_r($pref));
                     if (empty($rp['passwd'])) {
                         unset($rp['passwd']);
                     }
                     // fix to set system pulldown's. empty values don't get posted
                     if (empty($rp['theme'])) {
                         $rp['theme'] = '';
                     }
                     if (empty($rp['lang'])) {
                         $rp['lang'] = '';
                     }
                     $num = $user->setPreferences($rp);
                     if (!empty($rp['passwd'])) {
                         $passchanged = false;
                         if ($user->mayChangePass()) {
                             if (method_exists($user, 'storePass')) {
                                 $passchanged = $user->storePass($rp['passwd']);
                             }
                             if (!$passchanged and method_exists($user, 'changePass')) {
                                 $passchanged = $user->changePass($rp['passwd']);
                             }
                             if ($passchanged) {
                                 $errmsg = _("Password updated.");
                             } else {
                                 $errmsg = _("Password was not changed.");
                             }
                         } else {
                             $errmsg = _("Password cannot be changed.");
                         }
                     }
                     if (!$num) {
                         $errmsg .= " " . _("No changes.");
                     } else {
                         $request->_setUser($user);
                         $pref = $user->_prefs;
                         $errmsg .= sprintf(_("%d UserPreferences fields successfully updated."), $num);
                     }
                 }
                 $args['errmsg'] = HTML(HTML::h2($errmsg), HTML::hr());
             }
         }
         $args['available_themes'] = listAvailableThemes();
         $args['available_languages'] = listAvailableLanguages();
         return Template('userprefs', $args);
     } else {
         // wrong or unauthenticated user
         return $request->_notAuthorized(WIKIAUTH_BOGO);
         //return $user->PrintLoginForm ($request, $args, false, false);
     }
 }
コード例 #23
0
ファイル: index.php プロジェクト: kelsh/classic
# Image
session_start();
include_once 'template.php';
include_once 'mysql.php';
include_once 'functions.php';
$Vowels = array('a', 'e', 'i', 'o', 'u');
shuffle($Vowels);
$Blog = "Bl{$Vowels[0]}g";
$TotalQuery = mysql_query("Select `ID` from `Images` order by `ID` desc limit 1");
list($Total) = mysql_fetch_array($TotalQuery);
$RandomID = rand(1, $Total);
while ($_SESSION['Seen'][$RandomID]) {
    if ($Total <= count($_SESSION['Seen'])) {
        unset($_SESSION['Seen']);
    }
    $RandomID = rand(1, $Total);
}
$_SESSION['Seen'][$RandomID] = true;
$RandomQuery = mysql_query("Select `URL`, `Caption`, `Permalink` from `Images` where `ID`='{$RandomID}'");
list($URL, $Caption, $Permalink) = mysql_fetch_array($RandomQuery);
$Title = "<a href='/view/{$RandomID}/{$Permalink}/'>{$Caption}</a>";
$Image = "{$URL}";
$Time = time();
$Content = "<center><a href='/'><img src='{$Image}' /></a></center>";
$Extra = "<a href='{$Image}' target='_blank'>View Full Size</a>";
$Tags = DisplayTags($RandomID);
echo Template('template.html');
?>


コード例 #24
0
ファイル: index.php プロジェクト: BackupTheBerlios/thwc
        }
        // if
    }
    // while
    if ($_SESSION['openclose'] == 0) {
        $_SESSION['openclose'] = 1;
    }
    // openclose Variablen als gesetzt makieren
}
// else
$data['boards'] = $boards;
$data['user'] = U_NAME;
$data['PMreport'] = '';
if (U_ID > 0) {
    if (U_PM_NEW == 0) {
        $data['PMreport'] = 'Du hast keine neuen Nachrichten.';
    }
    if (U_PM_NEW == 1 && U_PM_COUNT == 1) {
        $data['PMreport'] = 'Du hast eine neue Nachricht.';
    }
    if (U_PM_NEW == 1 && U_PM_COUNT > 1) {
        $data['PMreport'] = 'Du hast ' . U_PM_COUNT . ' neue Nachrichten.';
    }
}
$data['nav_path'] .= '&nbsp;&gt;&gt;&nbsp;Foren&uuml;bersicht';
$data['time'] = 'Serverzeit: ' . date("d.M.Y\\, H:i \\U\\h\\r", $board_time);
$data['onlinebox'] = Template($onlinebox);
$data['statbox'] = Template($statbox);
$data['boardtable'] = Template($TIndex);
echo Output(Template($TBoard));
コード例 #25
0
ファイル: video.class.php プロジェクト: yukisky/clipbucket
 /**
  * Function used to display rating option for videos
  * this is an OLD TYPICAL RATING SYSTEM
  * and yes, still with AJAX
  */
 function show_video_rating($params)
 {
     $rating = $params['rating'];
     $ratings = $params['ratings'];
     $total = $params['total'];
     $id = $params['id'];
     $type = $params['type'];
     //Checking Percent
     if ($total <= 10) {
         $total = 10;
     }
     $perc = $rating * 100 / $total;
     $disperc = 100 - $perc;
     if ($ratings <= 0 && $disperc == 100) {
         $disperc = 0;
     }
     $perc = $perc . '%';
     $disperc = $disperc . '%';
     $likes = round($ratings * $perc / 100);
     // get lowest integer
     if ($params['is_rating']) {
         if (error()) {
             $rating_msg = error();
             $rating_msg = '<span class="error">' . $rating_msg[0] . '</span>';
         }
         if (msg()) {
             $rating_msg = msg();
             $rating_msg = '<span class="msg">' . $rating_msg[0] . '</span>';
         }
     }
     assign('perc', $perc);
     assign('disperc', $disperc);
     assign('id', $id);
     assign('type', $type);
     assign('id', $id);
     assign('rating_msg', $rating_msg);
     assign("likes", $likes);
     assign('rating', $rating);
     assign('ratings', $ratings);
     assign("dislikes", $ratings - $likes);
     assign('disable', $params['disable']);
     Template('blocks/rating.html');
 }
コード例 #26
0
        case "uploaded":
        default:
            $limit = create_query_limit($page, config('collection_user_collections'));
            assign("the_title", $user['username'] . " " . lang('collections'));
            $collections = get_collections(array("limit" => $limit, "user" => $user['userid']));
            $total_rows = get_collections(array("count_only" => true, "user" => $user['userid']));
            $total_pages = count_pages($total_rows, config('collection_user_collections'));
            break;
        case "favorites":
        case "fav_collections":
        case "favorite":
            $limit = create_query_limit($page, config('collection_user_favorites'));
            assign("the_title", $user['username'] . " " . lang('favorite') . " " . lang('collections'));
            $favC = array("user" => $user['userid'], "limit", $limit);
            $collections = $cbcollection->action->get_favorites($favC);
            $favC['count_only'] = true;
            $total_rows = $cbcollection->action->get_favorites($favC);
            $total_pages = count_pages($total_rows, config('collection_user_favorites'));
            break;
    }
    assign('collections', $collections);
    $pages->paginate($total_pages, $page);
} else {
    e(lang("usr_exist_err"));
    $Cbucket->show_page = false;
}
if ($Cbucket->show_page) {
    Template('user_collections.html');
} else {
    display_it();
}
コード例 #27
0
ファイル: user_videos.php プロジェクト: reactvideos/Website
            subtitle(sprintf(lang("title_usr_fav_vids"), $udetails['username']));
            $total_pages = count_pages($total_rows, config('videos_items_ufav_page'));
            //pr($total_pages,true);
            break;
        case 'playlists':
            $get_limit = create_query_limit($page, 10);
            $params = array('userid' => $udetails['userid'], 'limit' => $get_limit);
            $playlists = get_playlists($params);
            /*$items = $cbvid->get_playlist_items( $pid, 'playlist_items.date_added DESC' );
            		pr($items,true);
                       assign('items',$items);*/
            assign('playlist_mode', 'on');
            assign('playlists', $playlists);
            $params['count_only'] = true;
            $total_rows = get_playlists($params);
            $total_pages = count_pages($total_rows, config('videos_items_ufav_page'));
            //pr($videos,true);
            break;
    }
    Assign('videos', $videos);
    //Pagination
    $pages->paginate($total_pages, $page);
} else {
    e(lang("usr_exist_err"));
    $Cbucket->show_page = false;
}
if ($Cbucket->show_page) {
    Template('user_videos.html');
} else {
    display_it();
}
コード例 #28
0
ファイル: WikiUserNew.php プロジェクト: hugcoday/wiki
 function PrintLoginForm(&$request, $args, $fail_message = false, $seperate_page = false)
 {
     include_once 'lib/Template.php';
     // Call update_locale in case the system's default language is not 'en'.
     // (We have no user pref for lang at this point yet, no one is logged in.)
     if ($GLOBALS['LANG'] != DEFAULT_LANGUAGE) {
         update_locale(DEFAULT_LANGUAGE);
     }
     $userid = $this->_userid;
     $require_level = 0;
     extract($args);
     // fixme
     $require_level = max(0, min(WIKIAUTH_ADMIN, (int) $require_level));
     $pagename = $request->getArg('pagename');
     $nocache = 1;
     $login = Template('login', compact('pagename', 'userid', 'require_level', 'fail_message', 'pass_required', 'nocache'));
     // check if the html template was already processed
     $seperate_page = $seperate_page ? true : !alreadyTemplateProcessed('html');
     if ($seperate_page) {
         $page = $request->getPage($pagename);
         $revision = $page->getCurrentRevision();
         return GeneratePage($login, _("Sign In"), $revision);
     } else {
         return $login->printExpansion();
     }
 }
コード例 #29
0
        $GTIN_M_G = $Record["M_G"];
        $GTIN_M_OZ = $Record["M_OZ"];
        $GTIN_M_ML = $Record["M_ML"];
        $GTIN_M_FLOZ = $Record["M_FLOZ"];
        $GTIN_M_ABV = $Record["M_ABV"];
        $GTIN_M_ABW = $Record["M_ABW"];
        $GTIN_PKG_UNIT = $Record["PKG_UNIT"];
        $GTIN_IMG = "gtin/gtin-" . substr($GTIN_CD, 0, 3) . "/" . $GTIN_CD . ".jpg";
        $SQL = "select * from nutrition_us where GTIN_CD = '" . $GTIN_CD . "'";
        $DataSet_NUS = mysql_query($SQL);
        $NUTRI_FLAG = mysql_num_rows($DataSet_NUS);
        if (substr($GTIN_CD, 0, 1) == "0") {
            //echo $GTIN_CD;
            $UPC_CD = substr($GTIN_CD, 1, 12);
            $HTML_UPC_CD = " / UPC " . $UPC_CD;
        } else {
            $HTML_UPC_CD = "";
        }
        $Corps .= Template("template_list_brand_item", 2, $Params = array("VALUE_GTIN_CD" => $GTIN_CD, "VALUE_UPC_CD" => $HTML_UPC_CD, "VALUE_GTIN_NM" => $GTIN_NM, "VALUE_GCP_CD" => $GCP_CD, "VALUE_GPC_S_IMG" => $GPC_S_IMG, "VALUE_GPC_S_NM" => $GPC_S_NM, "VALUE_REG_N" => $REG_N, "VALUE_REG_C" => $REG_C, "VALUE_BRAND_NM" => $BRAND_NM, "VALUE_PRODUCT_LINE" => $PL_NM, "VALUE_M_G" => $GTIN_M_G, "VALUE_M_OZ" => $GTIN_M_OZ, "VALUE_M_ML" => $GTIN_M_ML, "VALUE_M_FLOZ" => $GTIN_M_FLOZ, "VALUE_M_ABV" => $GTIN_M_ABV, "VALUE_M_ABW" => $GTIN_M_ABW, "VALUE_PKG_UNIT" => $GTIN_PKG_UNIT, "VALUE_NUTRI_FLAG" => $NUTRI_FLAG, "VALUE_GTIN_IMG" => $GTIN_IMG));
    }
    // while
    $Corps .= Template("template_list_brand_item", 3, $Params = array());
    $FileName = $DataFolder . "product-brand-" . $BSIN . ".html";
    $file = fopen($FileName, 'w');
    fputs($file, $Corps);
    fclose($file);
    echo "File generated : " . $BRAND_NM . "<hr/>";
    ob_flush();
    flush();
}
// while
コード例 #30
0
ファイル: privacy.php プロジェクト: yukisky/clipbucket
<?php

/* 
 ****************************************************************************************************
 | Copyright (c) 2007-2008 Clip-Bucket.com. All rights reserved.											|
 | @ Author : ArslanHassan																			|
 | @ Software : ClipBucket , © PHPBucket.com														|
 ****************************************************************************************************
*/
require 'includes/config.inc.php';
$pages->page_redir();
subtitle('privacy');
Template('header.html');
Template('message.html');
Template('privacy.html');
Template('footer.html');