本文整理汇总了PHP中makeUrl函数的典型用法代码示例。如果您正苦于以下问题:PHP makeUrl函数的具体用法?PHP makeUrl怎么用?PHP makeUrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了makeUrl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: replace_html_path
function replace_html_path($arrMatche)
{
$sPath = makeUrl($arrMatche[4]);
if (strtolower($arrMatche[1]) == 'img') {
$sPath .= '&bin=1';
}
return "<{$arrMatche[1]} {$arrMatche[2]} {$arrMatche[3]}=\"{$sPath}\"";
}
示例2: getPolls
function getPolls()
{
global $db, $login;
$polls = $db->selectList('detailedpoll', '*', '1', '`state` ASC, `date` DESC');
$num = count($polls);
for ($i = 0; $i < $num; $i++) {
$polls[$i]['url'] = makeUrl('detailedpoll', array('pollid' => $polls[$i]['detailedpollid']));
if ($polls[$i]['state'] == 0) {
$polls[$i]['url_edit'] = makeUrl('detailedpoll', array('mode' => 'create', 'pollid' => $polls[$i]['detailedpollid']));
}
$polls[$i]['url_delete'] = makeUrl('detailedpoll', array('mode' => 'delete', 'pollid' => $polls[$i]['detailedpollid']));
$polls[$i]['answerCount'] = countAnswers($polls[$i]['detailedpollid']);
$polls[$i]['hasVoted'] = hasVoted($polls[$i]['detailedpollid'], $login->currentUserId());
}
return $polls;
}
示例3: index
public function index()
{
$key = C('QINIU_KEY');
// $qiniu_api = new \Think\Upload\Driver\Qiniu\QiniuApi();
//echo $qiniu_api -> safeBase64Encode('sffdsafdsafdsadsfsfsfsdf');
//原资料图片
//http://kuwuya.qiniudn.com/userid_2014-07-10_53be26b36d146.JPG
//需要处理
//http://kuwuya.qiniudn.com/userid_2014-07-10_53be26b36d146.JPG?imageView/2/w/200/h/200
//另存操作的目标空间与资源名
//$entryURI = "kuwuya:Ship-thumb-200.jpg";
//编码结果
//$base = Qiniu_Encode($entryURI);
//dump($base);
//需要签名
/*
$signingstr = "http://kuwuya.qiniudn.com/userid_2014-07-10_53be26b36d146.JPG?imageView/2/w/200/h/200|saveas/";
$Sign = hash_hmac('sha1',$signingstr,'be607v_8JkDcumrzBV-tXo1VZe26sL4ZJsagwilt',true);
echo $Sign;
$Token = 'be607v_8JkDcumrzBV-tXo1VZe26sL4ZJsagwilt'. ':' . $Sign;
echo $Token;
*/
function makeUrl($url, $bucket, $savekey, $ak = 'be607v_8JkDcumrzBV-tXo1VZe26sL4ZJsagwilt', $sk = 'GF0hJMLoGj-8RwmlEOwPPxN1HWx1DoCmRBiUnob2')
{
$find = array('+', '/');
$replace = array('-', '_');
$encode = str_replace($find, $replace, base64_encode("{$bucket}:{$savekey}"));
$url = $url . "|saveas/" . $encode;
$sha1 = hash_hmac('sha1', $url, $sk, true);
$sign = $ak . ":" . str_replace($find, $replace, base64_encode($sha1));
$data = $url . "/sign/" . $sign;
return $data;
}
echo makeUrl("kuwuya.qiniudn.com/2014-07-14_53c37b05295ba.jpg?imageView/2/w/200/h/200", "userkuwuya", "widuu.png");
//dump($Sign);
//$this->display();
}
示例4: testVerifyFossology
function testVerifyFossology()
{
global $URL;
global $name;
global $safeName;
print "starting verifyFossDirsOnly test\n";
$page = $this->mybrowser->clickLink('Browse');
$this->assertTrue($this->myassertText($page, '/Browse/'), "verifyFossDirsOnly FAILED! Could not find Browse menu\n");
//print "************ Page after upload link *************\n$page\n";
$this->assertTrue($this->myassertText($page, "/{$safeName}/"), "verifyFossDirsOnly FAILED! did not find {$name}\n");
$this->assertTrue($this->myassertText($page, "/>View</"), "verifyFossDirsOnly FAILED! >View< not found\n");
$this->assertTrue($this->myassertText($page, "/>Meta</"), "verifyFossDirsOnly FAILED! >Meta< not found\n");
$this->assertTrue($this->myassertText($page, "/>Download</"), "verifyFossDirsOnly FAILED! >Download< not found\n");
/* Select archive */
$page = $this->mybrowser->clickLink($name);
//print "************ Page after select foss archive *************\n$page\n";
$this->assertTrue($this->myassertText($page, "/empty\\//"), "verifyFossDirsOnly FAILED! 'empty/' not found\n");
$this->assertTrue($this->myassertText($page, "/1 item/"), "verifyFossDirsOnly FAILED! '1 item' not found\n");
/* Select empty link */
$page = $this->mybrowser->clickLink('empty/');
/* need to check that there are 9 items */
$this->assertTrue($this->myassertText($page, "/9 items/"), "verifyFossDirsOnly FAILED! '9 items' not found\n");
$this->assertTrue($this->myassertText($page, "/agents/"), "verifyFossDirsOnly FAILED! did not find 'agents' directory\n");
$this->assertTrue($this->myassertText($page, "/scheduler/"), "verifyFossDirsOnly FAILED! did not find scheduler directory\n");
/* Select the License link to View License Historgram */
$browse = new parseBrowseMenu($page);
$mini = new parseMiniMenu($page);
$miniMenu = $mini->parseMiniMenu();
$url = makeUrl($this->host, $miniMenu['License']);
if ($url === NULL) {
$this->fail("verifyFossDirsOnly Failed, host is not set");
}
$page = $this->mybrowser->get($url);
//print "page after get of $url is:\n$page\n";
$this->assertTrue($this->myassertText($page, '/License Browser/'), "verifyFossDirsOnly FAILED! License Browser Title not found\n");
$this->assertTrue($this->myassertText($page, '/Total licenses: 0/'), "verifyFossDirsOnly FAILED! Total Licenses does not equal 0\n");
$dList = new parseLicenseTblDirs($page);
$dirList = $dList->parseLicenseTblDirs();
//print "dirList is:\n"; print_r($dirList) . "\n";
/*
* the directiory agents has 13 subdirectories all other directories
* are empty. we are going to loop through them, but for now just
* test a few of them out....
*/
$url = makeUrl($this->host, $dirList['scheduler/']);
$page = $this->mybrowser->get($url);
//print "page after scheduler is:\n$page\n";
$fList = new parseFolderPath($page, $url);
$dirCnt = $fList->countFiles();
// should only get one folder path)
$this->assertEqual((int) $dirCnt, 1, "verifyFossDirsOnly FAILED! did not get 1 folder path back, got {$dirCnt} instead\n");
// every entry but the last must have a non-null value (we assume parse
// routine worked)
$fpaths = $fList->parseFolderPath();
$this->assertTrue($this->check4Links($fpaths), "verifyFossDirsOnly FAILED! something wrong with folder path\n" . "See this url:\n{$url}\n");
}
示例5: _createRtnArray
/**
* clean up the links to be usable
*
* @param array $list, the list to clean up
* @param int $matches, the size of the list
*
* @return array, the cleaned up list_bucket_files
*
* @todo fix the docs above to much more detailed.
*/
function _createRtnArray($list, $matches)
{
global $host;
/*
* The last entry in the array is always a leaf name with no link
* but it has to be cleaned up a bit....
*/
for ($i = 0; $i < $matches; $i++) {
$cleanKey = trim($list[$i][2], "\\/<>b");
if (empty($cleanKey)) {
continue;
}
// Make a real link that can be used
$partLink = $list[$i][1];
$link = makeUrl($this->host, $partLink);
$rtnList[$cleanKey] = $link;
/* check for anything in the leaf entry, if there is, remove
* the preceeding /
*/
if (!empty($list[$i][3])) {
$cleanKey = trim($list[$i][3], "\\/ ");
if (empty($cleanKey)) {
continue;
}
$rtnList[$cleanKey] = NULL;
}
}
return $rtnList;
}
示例6: makeUrl
<?output('_header.html.php',$output);?>
<!-- custom javascript -->
<script type="text/javascript" >
var default_url = '<?= makeUrl(cfg('default_uri')) ?>';
</script>
<?=includeJS("jquery-ui-1.8.11.custom.min.js");?>
<?=includeJS("jquery.ui.nestedSortable.js");?>
<?=includeJS("admin_projects_list.js");?>
<?output('_header2.html.php',$output);?>
<div class="pad" >
<a href="#newproject" class="button">add new project</a>
<div id="list-holder" >
<?=projects()->getMenu(false)?>
</div>
</div>
<?output('_footer.html.php',$output);?>
示例7: metaImage
function metaImage($return = false)
{
if ($return) {
return current(makeUrl(array(ENV_META_IMAGE)));
} else {
echo current(makeUrl(array(ENV_META_IMAGE)));
}
}
示例8: session_start
<?php
// Start the session.
session_start();
// Include the functions so you can create an URL.
include_once 'functions.inc.php';
// Include the image handling class.
include_once 'images.inc.php';
include_once 'db.inc.php';
$db = new PDO(DB_INFO, DB_USER, DB_PASS);
// Initial check.
if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['submit'] == 'Save Entry' && !empty($_POST['page']) && !empty($_POST['title']) && !empty($_POST['entry'])) {
// Create an URL to be saved in the database.
$url = makeUrl($_POST['title']);
// Retrieves entries for the given URL.
$e = retrieveEntries($db, $_POST['page'], $url);
// We run a check to see if there already is an image saved for the entry.
// Otherwise we upload one if needed.
if (empty($e['image'])) {
// We check if there is an image to upload.
if (!empty($_FILES['image']['tmp_name'])) {
try {
// Instantiate the class and set a save path.
$img = new ImageHandler("/files/");
// Process the file and store the returned path.
$img_path = $img->processUploadedImage($_FILES['image']);
// Output the uploaded image as it was saved.
echo '<img src=" ', $img_path, ' "/><br/>';
} catch (Exception $e) {
// If an error occurred, output your custom error message.
die($e->getMessage());
示例9: test3filesCopyright
function test3filesCopyright()
{
global $URL;
global $name;
global $safeName;
// Note the entry: COPYRIGHT ,
// should really be:
//
// '* Copyright (c) 2002-2004 Sam Leffler, Errno Consulting, Atheros' => 1,
// Likewise: copyrighted by Affero should be:
// copyrighted by 278 Affero, Inc.
// this string has ossolated between removing the id: and not
// 'id: copyright v 1.2 / / : samleffler exp' => 1,
$copyStd = array('copyright (c) free software foundation inc' => 1, 'copyright (c) free software foundation inc. made with' => 1, 'copyright (c) sam leffler errno consulting atheros' => 1, 'copyright v 1.2 / / : samleffler exp' => 1, 'copyright (c) <year> <name of author' => 1, 'copyright affero inc' => 1);
print "starting Verify3filesCopyright test\n";
$page = $this->mybrowser->clickLink('Browse');
$this->assertTrue($this->myassertText($page, '/Browse/'), "verify3files FAILED! Could not find Browse menu\n");
$page = $this->mybrowser->clickLink('Copyright');
//print "************ Page after upload link *************\n$page\n";
$this->assertTrue($this->myassertText($page, "/Browse/"), "verify3files FAILED! Browse Title not found\n");
$this->assertTrue($this->myassertText($page, "/{$safeName}/"), "verify3files FAILED! did not find {$name}\n");
$this->assertTrue($this->myassertText($page, "/>View</"), "verify3files FAILED! >View< not found\n");
$this->assertTrue($this->myassertText($page, "/>Info</"), "verify3files FAILED! >Info< not found\n");
$this->assertTrue($this->myassertText($page, "/>Download</"), "verify3files FAILED! >Download< not found\n");
/* Select archive */
$page = $this->mybrowser->clickLink($name);
$page = $this->mybrowser->clickLink('3files.tar');
//print "************ Page after select foss archive *************\n$page\n";
$this->assertTrue($this->myassertText($page, "/Affero-v1\\.0/"), "verify3files FAILED! '3files/' not found\n");
$this->assertTrue($this->myassertText($page, "/3 items/"), "verify3files FAILED! '3 items' not found\n");
/* Select the Copyright/Email/URL link */
$mini = new parseMiniMenu($page);
$miniMenu = $mini->parseMiniMenu();
$url = makeUrl($this->host, $miniMenu['Copyright/Email/URL']);
if ($url === NULL) {
$this->fail("FATAL! verify3files Failed, host is not set or url " . "cannot be made, Stopping this test");
exit(1);
}
$page = $this->mybrowser->get($url);
//print "page after get of $url is:\n$page\n";
$this->assertTrue($this->myassertText($page, '/Copyright\\/Email\\/URL Browser/'), "verify3files FAILED! Copyright/Email/URL Browser Title not found\n");
$this->assertTrue($this->myassertText($page, '/Total Copyrights: 6/'), "verify3files FAILED! Total copyrights does not equal 6\n");
$this->assertTrue($this->myassertText($page, '/Unique Copyrights: 6/'), "verify3files FAILED! Unique Copyrights does not equal 6\n");
// get the count, show links and text or link
$copyR = new domParseLicenseTbl($page, 'copyright');
$copyR->parseLicenseTbl();
if (empty($copyR->hList)) {
$this->fail("FATAL! table with id=copyright was not found on" . "the page, nothing to process, stopping test\n");
exit(1);
}
//print "entries in the table:\n";print_r($copyR->hList) . "\n";
// Verify text and counts are correct
$notFound = array();
$found = NULL;
foreach ($copyR->hList as $copyFound) {
$key = $copyFound['textOrLink'];
if (array_key_exists($key, $copyStd)) {
$this->pass("Pass: found {$key} in copyright table\n");
$found = 1;
// found one, check the count
$foundCount = $copyFound['count'];
$count = $copyStd[$key];
$this->assertEqual($count, $foundCount, "verify3files FAILED! the counts are not equal\n\n Expected:{$count}\nGot:{$foundCount}\n");
continue;
} else {
$notFound[] = $key;
}
}
// foreach $copyR->
//} // foreach $copyStd
// this is a hack for now... should be a better way to filter
// Try in_array before insert?
$uniqueNF = array();
$uniqueNF = array_unique($notFound);
if (!empty($uniqueNF)) {
$this->fail("verify3files FAILED! the following items did not" . " match any standard, are any false positives?:\n");
print "\n";
foreach ($uniqueNF as $falsePos) {
print "{$falsePos}\n---------------------\n";
}
}
$email = new domParseLicenseTbl($page, 'copyrightemail');
$email->parseLicenseTbl();
// empty table?, verify counts are zero
if ($email->noRows) {
$this->assertTrue($this->myassertText($page, '/Total Emails: 0/'), "verify3files FAILED! Total Emails does not equal 0\n");
$this->assertTrue($this->myassertText($page, '/Unique Emails: 0/'), "verify3files FAILED! Unique Emails does not equal 0\n");
} else {
if (empty($email->hList)) {
$this->fail("FATAL! table with id=copyrightemail was not found on" . "the page, nothing to process, stopping test\n");
exit(1);
}
}
$urls = new domParseLicenseTbl($page, 'copyrighturl');
$urls->parseLicenseTbl();
// empty table?, verify counts are zero
if ($urls->noRows) {
$this->assertTrue($this->myassertText($page, '/Total URLs: 0/'), "verify3files FAILED! Total URL's does not equal 0\n");
$this->assertTrue($this->myassertText($page, '/Unique URLs: 0/'), "verify3files FAILED! Unique URL's does not equal 0\n");
} else {
//.........这里部分代码省略.........
示例10: Upload
$upload = new Upload();
$upload->dir = 'media/boximages/ad/';
$upload->tag_name = 'image';
$upload->uploadFile();
$imgdir = "./media/boximages/ad/";
include_once './core/simple.image.core.php';
$image = new SimpleImage();
$image->load($imgdir . $upload->file_name);
if ($image->getWidth() > (int) $config->get('ad', 'standard_image_width')) {
$image->resizeToWidth((int) $config->get('ad', 'standard_image_width'));
}
if ($image->getHeight() > (int) $config->get('ad', 'standard_image_height')) {
$image->resizeToHeight((int) $config->get('ad', 'standard_image_height'));
}
unlink($imgdir . $upload->file_name);
$image->save($imgdir . $upload->file_name);
if (substr($_POST['newurl'], 0, 7) != "http://") {
$_POST['newurl'] = "http://" . $_POST['newurl'];
}
$db->insert($tbl_ad, array('img', 'url'), array("'" . $upload->file_name . "'", "'" . $_POST['newurl'] . "'"));
}
}
$allads = $db->selectList($tbl_ad, '*', 1);
$counter = 0;
$ads = array();
foreach ($allads as $ad) {
$ads[$counter] = $ad;
$ads[$counter++]['imgurl'] = makeUrl('ad', array('mode' => 'edit'));
}
$smarty->assign('ads', $ads);
$smarty->assign('path', $template_dir . "/ad.view.tpl");
示例11:
<?output('_header.html.php',$output);?>
<?output('_header2.html.php',$output);?>
<div class="loginform" >
<form name="logform" method=post action="<?=makeUrl("/login/");?>">
<label>Username</label><input type="text" name="username" value="" /><br />
<label>Password</label><input type="password" name="password" value="" /><br />
<div class="buttons" >
<a class="button" href="#" onclick="document.logform.submit();" >login</a>
<a class="button" href="<?=makeUrl("index");?>" >cancel</a>
</div>
</form>
</div>
<?output('_footer.html.php',$output);?>
示例12: detectUrls
/**
* This function will use the resource cache to lookup all controllers and their methods. Then it
* will create a Triumph_Url instance for each method; note that the routes file is
* also consulted and we will generate URLs for the default controller.
*
* @param string $sourceDir the root directory of the project in question
* @param string $resourceDbFileName the location of the resource cache SQLite file; as created by Triumph
* @param string $host the hostname of the application; this will be used a the prefix on all URLs
* @param boolean $doSkip out parameter; if TRUE then this detector does not know how
* to detect URLs for the given source directory; this situation
* is different than zero URLs being detected.
* @return Triumph_Url[] array of Triumph_Url instances the detected URLs
*/
function detectUrls($sourceDir, $resourceDbFileName, $host, &$doSkip)
{
$doSkip = TRUE;
if (!is_file($resourceDbFileName)) {
return array();
}
$sourceDir = \opstring\ensure_ends_with($sourceDir, DIRECTORY_SEPARATOR);
$host = \opstring\ensure_ends_with($host, '/');
// TODO: handle multiple apps
// need this define so that we can include code igniter files directly
if (!defined('BASEPATH')) {
define('BASEPATH', '');
}
if (!is_file($sourceDir . 'application/config/routes.php') || !is_file($sourceDir . 'application/config/config.php')) {
// this source directory does not contain a code igniter directory.
return array();
}
$doSkip = FALSE;
// get the code igniter configuration so that we can use it to build the
// correct routes
$config = array();
$route = array();
include $sourceDir . 'application/config/routes.php';
include $sourceDir . 'application/config/config.php';
$allUrls = array();
// lookup all controller files from the resource cache, only controllers are accessible via URLs
// since file names in the cache are OS dependant, need to use the correct directory separators
$pdo = Zend_Db::factory('Pdo_Sqlite', array("dbname" => $resourceDbFileName));
$fileItemTable = new Triumph_FileItemTable($pdo);
$controllerDir = $sourceDir . 'application' . DIRECTORY_SEPARATOR . 'controllers';
$matchingFiles = $fileItemTable->MatchingFiles($controllerDir);
// lookup all of the methods for all controller files.
$resourceTable = new Triumph_ResourceTable($pdo);
$methods = $resourceTable->PublicMethodsFromFiles($matchingFiles);
foreach ($methods as $resource) {
// need to handle any sub-directories underneath the controllers; as the subdirectory
// is propagated in the URL
$controllerFile = \opstring\after($resource->fullPath, $controllerDir);
$subDirectory = dirname($controllerFile);
if ('\\' == $subDirectory || '/' == $subDirectory) {
// hack to work around special case when there is no subdirectory
$subDirectory = '';
}
// constructors are not web-accessible
// code igniter makes methods that start with underscore
if (\opstring\compare_case('__construct', $resource->identifier) && !\opstring\begins_with($resource->identifier, '_')) {
// TODO: any controller arguments ... should get these from the user somehow
$extra = '';
$appUrl = makeUrl($route, $config, $subDirectory, $resource->fullPath, $resource->className, $resource->identifier, $extra);
$appUrl->url = $host . $appUrl->url;
$allUrls[] = $appUrl;
}
}
return $allUrls;
}
示例13: tournamentTable
function tournamentTable()
{
global $smarty;
global $template_dir;
global $db;
global $config;
$encList = $db->selectList('tournamentencounters', '*', "`tournamentid`=" . $this->tournamentId, "`roundid` ASC, `encounterid` ASC");
foreach ($encList as $encounter) {
$y = $encounter['roundid'];
$x = $encounter['encounterid'];
$curEnc = new EliminationEncounter($this->tournamentId, $y, $x);
$finalList[$x][$y]['round'] = $x;
$finalList[$x][$y]['encid'] = $y;
foreach ($this->participants as $participant) {
if ($participant->getId() == $curEnc->getPlayer1id()) {
$player1 = $participant;
}
if ($participant->getId() == $curEnc->getPlayer2id()) {
$player2 = $participant;
}
}
// Only player 2 (in the last enc) could be a dummy
if ($curEnc->getPlayer2id() == -1) {
$player2 = newDummy();
}
if ($curEnc->getPlayer1id() == 0) {
$player1 = newUnknown();
}
if ($curEnc->getPlayer2id() == 0) {
$player2 = newUnknown();
}
if ($curEnc->getPlayer1id() > 0 && $curEnc->getPlayer2id() > 0) {
$finalList[$x][$y]['link'] = makeUrl('tournament', array('tournamentid' => $this->tournamentId, 'encid' => $x, 'roundid' => $y, 'mode' => 'view'));
}
$finalList[$x][$y]['p1name'] = $player1->getName();
$finalList[$x][$y]['p1url'] = $player1->getUrl();
$finalList[$x][$y]['p2name'] = $player2->getName();
$finalList[$x][$y]['p2url'] = $player2->getUrl();
$finalList[$x][$y]['timestatus'] = $curEnc->getEncTimeState();
if ($curEnc->isFinished()) {
$finalList[$x][$y]['p1points'] = $curEnc->getPoints1();
$finalList[$x][$y]['p2points'] = $curEnc->getPoints2();
$finalList[$x][$y]['winner'] = $curEnc->winner();
}
}
$smarty->assign('roundsandmaps', $this->getRoundsAndMaps($y + 1));
$smarty->assign('table', $finalList);
$smarty->assign('encounterWidth', $config->get('tournament', 'tree-encounter-width'));
$smarty->assign('encTempl', $template_dir . '/kothencounter.tpl');
$smarty->assign('path', $template_dir . '/koth.tpl');
}
示例14: encounter
function encounter($roundId, $encId)
{
global $breadcrumbs, $template_dir, $smarty, $tournamentList, $notify, $lang, $config, $rights;
$tournament = $tournamentList->getTournament($this->tournamentId);
$smarty->assign('tournament', $tournament);
$enc = new EliminationEncounter($this->tournamentId, $roundId, $encId);
foreach ($this->participants as $participant) {
if ($participant->getId() == $enc->getPlayer1id()) {
$player1 = $participant;
}
if ($participant->getId() == $enc->getPlayer2id()) {
$player2 = $participant;
}
}
if (!isset($player1) || !isset($player2)) {
$notify->add($lang->get('encounter'), $lang->get('ntfy_submit_err_player'));
$this->tournamentTable();
return false;
} else {
$breadcrumbs->addElement($player1->getName() . " vs. " . $player2->getName(), makeURL('tournament', array('tournamentid' => $_GET['tournamentid'], 'encid' => $_GET['encid'], 'roundid' => $_GET['roundid'], 'mode' => 'view')));
$smarty->assign('path', $template_dir . "/eliminationencounter_detail.tpl");
$smarty->assign('player1', array('name' => $player1->getName(), 'url' => $player1->getUrl()));
$smarty->assign('player2', array('name' => $player2->getName(), 'url' => $player2->getUrl()));
$enc_arr['points1'] = $enc->getPoints1();
$enc_arr['points2'] = $enc->getPoints2();
$enc_arr['finished'] = $enc->isFinished();
$enc_arr['winner'] = $enc->getPoints1() > $enc->getPoints2() ? 1 : 2;
$enc_arr['map'] = $this->getMap($roundId + 1);
if ($config->get('tournament', 'allow_undoing_encounter_points') && $rights->isAllowed('tournament', 'add_remove_edit') && $enc->isFinished() && $tournament['state'] == 2) {
$enc_arr['undoLink'] = makeHtmlUrl($lang->get('undo_encounter'), makeUrl('tournament', array('tournamentid' => $this->tournamentId, 'encid' => $enc->getId(), 'roundid' => $roundId, 'mode' => 'view', 'undo' => 1)));
}
if ($enc->getStart() != 0) {
$enc_arr['start'] = $enc->getStart() > time() ? timeLeft($enc->getStart()) : formatTime($enc->getStart());
$tEnd = $enc->getStart() + $enc->getDuration();
$enc_arr['end'] = $enc->getStart() < time() && $tEnd > time() ? timeLeft($tEnd) : formatTime($tEnd);
}
$smarty->assign('enc', $enc_arr);
$smarty->assign('user_can_submit', $this->checkSubmitRights($enc, $player1, $player2));
$smarty->assign('_GET', $_GET);
}
}
示例15: makeURL
require_once $mod_dir . "/minitools.function.php";
$lang->addModSpecificLocalization($mod);
/*
$breadcrumbs->addElement($lang->get('stat'), makeURL($mod));
$statistic['config']['visitors_month_enabled'] = (int)$config->get('stat', 'show-visitors-this-month');
*/
$breadcrumbs->addElement($lang->get('minitools'), makeURL($mod));
$mode = @$_GET['mode'];
$availableModes = array('base64', 'roman');
switch ($mode) {
case 'edit':
$breadcrumbs->addElement($lang->get('minitoolsedit'), makeURL($mod, array('mode' => 'edit')));
if (isset($_POST['send'])) {
saveMinitools(@$_POST['data']);
redirect(makeUrl('minitools'));
}
$smarty->assign('minitools', getAllMinitools($availableModes));
$smarty->assign('path', $template_dir . "/edit.tpl");
break;
case 'base64':
$breadcrumbs->addElement($lang->get('base64'), makeURL($mod, array('mode' => 'base64')));
$menu->addSubElement('minitools', $lang->get('base64encode'), 'base64', array('action' => 'encode'));
$menu->addSubElement('minitools', $lang->get('base64decode'), 'base64', array('action' => 'decode'));
$action = @$_GET['action'];
if ($action == 'decode') {
$breadcrumbs->addElement($lang->get('base64decode'), makeURL($mod, array('mode' => 'base64', 'action' => 'decode')));
if (isset($_POST['send'])) {
if (isset($_POST['text']) && trim($_POST['text']) != '') {
$base64decoded = base64_decode(trim($_POST['text']));
$smarty->assign('base64decoded', $base64decoded);