当前位置: 首页>>代码示例>>PHP>>正文


PHP baseurl函数代码示例

本文整理汇总了PHP中baseurl函数的典型用法代码示例。如果您正苦于以下问题:PHP baseurl函数的具体用法?PHP baseurl怎么用?PHP baseurl使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了baseurl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parse

 function parse()
 {
     $userExists = false;
     if (count($this->argsIndexed) > 0) {
         //Find the user:
         $userResult = $this->db->buildQuery("SELECT * FROM users WHERE username=%s", $this->argsIndexed[0]);
         if ($this->db->getHasRows($userResult)) {
             $userExists = true;
             $user = $this->db->fetchAssoc($userResult);
             $user['gravatarUrl'] = get_gravatar($user['email'], 150);
             //Fetch his objects
             $objectsResult = $this->db->buildQuery("SELECT * FROM objects WHERE seller=%s ORDER BY end_moment DESC", $user['username']);
             $user['objects'] = parseObjects($objectsResult);
             $feedbackResult = $this->db->buildQuery("SELECT isseller, rating, date, comment, buyer, seller AS username FROM feedback F LEFT OUTER JOIN objects O ON F.objectid = O.id WHERE (seller=%s AND isseller=1) OR (buyer=%s AND F.isseller=0)", $user['username'], $user['username']);
             $user['feedback'] = $this->db->fetchAllAssoc($feedbackResult);
             $this->website->assign("profileUser", $user);
         } else {
             $error = "Deze gebruiker bestaat niet";
             $userExists = false;
         }
     }
     if ($userExists) {
         $this->addToBreadcrumbs("Home", baseurl(""));
         $this->addToBreadcrumbs("Profiel");
         $this->render('Profiel', 'users/profile.tpl');
     } else {
         //Render a page here, telling the user that this user doesn't exist
     }
 }
开发者ID:K-4U,项目名称:Pr-IP-P2-02,代码行数:29,代码来源:index.php

示例2: parse

 function parse()
 {
     $displayName = "about";
     $this->addToBreadcrumbs("Home", baseurl(""));
     $this->addToBreadcrumbs("Over ons");
     $this->render($displayName, 'static/about.tpl');
 }
开发者ID:K-4U,项目名称:Pr-IP-P2-02,代码行数:7,代码来源:index.php

示例3: parse

 function parse()
 {
     if ($this->user->isLoggedIn()) {
         header("location: " . baseurl(""));
     } else {
         $_POST = removeHTMLFromPOST($_POST);
         $emailCode = md5($_POST['email'] . date("U"));
         $_POST['emailCode'] = $emailCode;
         if (isset($_POST['saveEmail'])) {
             if (!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) === true) {
                 $_POST['email'] = null;
                 $this->website->assign("emailError", "Ingevulde email was niet valide, ga naar de hoofdpagina en probeer opnieuw te registreren.");
             } else {
                 $emailUsed = $this->db->buildQuery("SELECT email FROM users WHERE email = %s", $_POST['email']);
                 if ($this->db->getHasRows($emailUsed) == 0) {
                     $this->website->assign("email", $_POST['email']);
                     $_SESSION['emailCode'] = $_POST['emailCode'];
                     $this->website->assign("emailVerificationCode", $_POST['emailVerificationCode']);
                     sendMail($_POST['email'], "Uw verificatie code is: " . $emailCode, "Eenmaal andermaal verificatie");
                 } else {
                     $this->website->assign("emailError", "Uw email is al in gebruik genomen.");
                     $emailIsAlreadyUsed = true;
                 }
             }
         }
         $this->addToBreadcrumbs("Home", baseurl(""));
         $this->addToBreadcrumbs("Registratie");
         $this->addToBreadcrumbs("Email Verificatie");
         if ($emailIsAlreadyUsed == false) {
             $this->render("emailVerification", "emailVerification.tpl");
         } else {
             header("location: " . baseurl(""));
         }
     }
 }
开发者ID:K-4U,项目名称:Pr-IP-P2-02,代码行数:35,代码来源:index.php

示例4: parse

 function parse()
 {
     if ($this->user->isLoggedIn()) {
         $result = $this->db->buildQuery("SELECT * FROM objects WHERE id IN (SELECT objectid FROM bids WHERE username =%s GROUP BY objectid)", $this->user->getName());
         $objects = parseObjects($result, $this->user->getName());
         foreach ($objects as &$object) {
             $categoryTree = array();
             $categories = array();
             $catIdResult = $this->db->buildQuery("SELECT category_id FROM object_in_category WHERE object_id =%s ", $object['id']);
             $catId = $this->db->fetchAssoc($catIdResult)['category_id'];
             getCategoryFromBottom($categories, $catId);
             foreach ($categories as $cat) {
                 $temp = array("name" => $cat['name'], "link" => baseurl("Rubriek/" . $cat['id']), "parent" => $cat['parent']);
                 $categoryTree[] = $temp;
             }
             $object['categoryTree'] = $categoryTree;
         }
         $this->website->assign("objects", $objects);
         $this->addToBreadcrumbs("Home", baseurl("/"));
         $this->addToBreadcrumbs("UCP", baseurl("Users/CP"));
         $this->addToBreadcrumbs("Mijn Biedingen");
         $this->render("Bids", "users/bids.tpl");
     } else {
         $this->website->assign("loginError", "U moet ingelogd zijn voordat u uw biedingen kunt bekijken.");
         $this->render("login", "users/login.tpl");
     }
 }
开发者ID:K-4U,项目名称:Pr-IP-P2-02,代码行数:27,代码来源:index.php

示例5: parse

 function parse($query, $p)
 {
     //Fetch number of objects in this category:
     $query = "%" . $query . "%";
     //THANK YOU SILVAN FOR FIXING THIS BUG FOR ME!
     $countResult = $this->db->buildQuery("SELECT COUNT(id) AS c FROM objects WHERE title LIKE ? OR description LIKE ?", $query, $query);
     $c = $this->db->fetchAssoc($countResult)['c'];
     $sql = "SELECT id,title,end_moment,start_bid,city FROM objects WHERE title LIKE ? OR description LIKE ? ORDER BY start_bid ASC";
     $maxPerPage = 18;
     if ($c > $maxPerPage) {
         if ($p > 0) {
             $fo = $p * $maxPerPage;
         } else {
             $fo = 0;
         }
         $fe = $fo + $maxPerPage;
         $sql .= " OFFSET ? ROWS FETCH NEXT ? ROWS ONLY;";
         $result = $this->db->buildQuery($sql, $query, $query, $fo, $fe);
         $this->website->assign("paginationNeeded", true);
         $this->website->assign("page", $p + 1);
         $this->website->assign("maxPages", $c / $maxPerPage - 1);
     } else {
         $result = $this->db->buildQuery($sql, $query, $query);
     }
     $objects = parseObjects($result);
     $this->addToBreadcrumbs("Home", baseurl(""));
     $this->addToBreadcrumbs("Zoeken");
     $this->website->assign("objects", $objects);
     $this->render("Categorie", 'lot/objects.tpl');
 }
开发者ID:K-4U,项目名称:Pr-IP-P2-02,代码行数:30,代码来源:index.php

示例6: spawn_transcoder

function spawn_transcoder($source, $config_file = 'default', $timeout = 20)
{
    // Because we employ "AllowEncodedSlashes NoDecode", the local file must only have slashes encoded in the filename
    $source_escaped = str_replace("/", "%2f", $source);
    // In the substitution, we must ensure that the hls_segment_filename value is percent-escaped as it represents a sprintf string
    $source_escaped_pct_escaped = str_replace("%", "%%", $source_escaped);
    $exec_subst = array('[SOURCE]' => $source, '[SOURCE-ESCAPED]' => $source_escaped, '[SOURCE-ESCAPED-PCT-ESCAPED]' => $source_escaped_pct_escaped, '[BASEURL]' => baseurl() . '/data/');
    if (!($exec = @file_get_contents($config_file, FILE_USE_INCLUDE_PATH))) {
        if (!($exec = file_get_contents($config_file . '.conf', FILE_USE_INCLUDE_PATH))) {
            header(HTTP_CUSTOM_HEADER_RESPONDING_TO . urlencode($config_file));
            http_response_code(400);
            return FALSE;
        }
    }
    $exec = trim(preg_replace('/\\s+/', ' ', $exec));
    // the exec command should not have newlines in it
    $exec = str_replace(array_keys($exec_subst), array_values($exec_subst), $exec);
    // to allow token substitution
    $process = new MyBackgroundProcess($exec);
    $process->run();
    // first check to see if we have obvious error coming back from the job spawn
    null;
    // if not, wait for the creation of the playlist file
    $filename = dirname($_SERVER["SCRIPT_FILENAME"]) . "/data/{$source_escaped}.m3u8";
    // sleep in EXEC_TIMEOUT_POLL_MS millisecond increments as we wait for exec to start output...
    for ($waits = $timeout * 1000000; $waits > 0 && !file_exists($filename); $waits = $waits - EXEC_TIMEOUT_POLL_MS) {
        usleep(EXEC_TIMEOUT_POLL_MS);
    }
    if (file_exists($filename)) {
        passthru_m3u8($filename, $filename);
        return $process;
    } else {
        $process->stop();
        header(HTTP_CUSTOM_HEADER_RESPONDING_TO . urlencode($exec));
        http_response_code(408);
        return FALSE;
    }
}
开发者ID:BitingChaos,项目名称:punch,代码行数:38,代码来源:SpawnTranscoder.php

示例7: run

 public function run()
 {
     // Se não for crítico, apenas lança o erro como exception
     if ($this->_is_fatal === false) {
         // Se for uma exceção normal
         if ($this->_special_exception === false) {
             throw new core_exception(null, $this->_error_code, $this);
         }
         // Senão, lança uma exceção de núcleo
         $classname = $this->_args['classname'];
         eval("class {$classname} extends core_exception {}");
         throw new $classname(null, $this->_error_code, $this);
     }
     // Armazena as informações do erro em uma sessão
     $_SESSION['last-error'] = (object) array('error_code' => $this->_error_code, 'backtrace' => $this->_backtrace, 'globals' => $this->_globals, 'args' => $this->_args, 'id' => $this->_id);
     //TODO: registrar a ocorrência e alterara a página
     header('Location: ' . baseurl(false) . 'core/error');
 }
开发者ID:rentalhost,项目名称:core,代码行数:18,代码来源:core_error.php

示例8: base_url

function base_url()
{
    return baseurl();
}
开发者ID:yukisky,项目名称:clipbucket,代码行数:4,代码来源:functions.php

示例9: parseObjects

/**
 * Fetches the objects given in $result
 * @param $result
 * @return array
 */
function parseObjects($result, $username = null)
{
    global $db;
    $objects = array();
    while ($row = $db->fetchAssoc($result)) {
        $row['description'] = bb2html(nl2br(str_replace("\\n", "\n", $row['description'])));
        //Fetch latest bid
        $bidResult = $db->buildQuery("SELECT TOP 1 * FROM bids WHERE objectid=%d ORDER BY bidvalue DESC", $row['id']);
        if ($db->getHasRows($bidResult)) {
            $res = $db->fetchAssoc($bidResult);
            $row['currentBid'] = $res['bidvalue'];
            $row['currentBidName'] = $res['username'];
        } else {
            $row['currentBid'] = $row['start_bid'];
        }
        $imageResult = $db->buildQuery("SELECT TOP 1 filename FROM files WHERE objectid=%d", $row['id']);
        if ($db->getHasRows($imageResult)) {
            if ($row['city'] == 'batch') {
                $row['image'] = "http://iproject2.icasites.nl/pics/" . $db->fetchAssoc($imageResult)['filename'];
            } else {
                $row['image'] = baseurl("upload/" . $db->fetchAssoc($imageResult)['filename']);
            }
        } else {
            $row['image'] = "https://placehold.it/150x110";
        }
        if ($username != null) {
            $ownBidResult = $db->buildQuery("SELECT TOP 1 bidvalue FROM bids WHERE username =%s AND objectid=%d ORDER BY bidvalue DESC", $username, $row['id']);
            $row['ownBid'] = $db->fetchAssoc($ownBidResult)['bidvalue'];
        }
        $row['timeRemaining'] = $row['end_moment']->getTimeStamp() - time();
        $objects[] = $row;
    }
    return $objects;
}
开发者ID:K-4U,项目名称:Pr-IP-P2-02,代码行数:39,代码来源:functions.php

示例10: smarty_function_baseurl

function smarty_function_baseurl($params, &$smarty)
{
    return baseurl($params['url']);
}
开发者ID:K-4U,项目名称:Pr-IP-P2-02,代码行数:4,代码来源:function.baseurl.php

示例11: smarty_function_csstag

function smarty_function_csstag($params, &$smarty)
{
    return "<link rel='stylesheet' type='text/css' href='" . baseurl("css/" . $params['url']) . "' />";
}
开发者ID:K-4U,项目名称:Pr-IP-P2-02,代码行数:4,代码来源:function.csstag.php

示例12: smarty_function_jstag

function smarty_function_jstag($params, &$smarty)
{
    return "<script type='text/javascript' src='" . baseurl("js/" . $params['url']) . "'></script>";
}
开发者ID:K-4U,项目名称:Pr-IP-P2-02,代码行数:4,代码来源:function.jstag.php

示例13: parse

 function parse()
 {
     if ($this->user->isSeller()) {
         $_POST = removeHTMLFromPOST($_POST);
         if (isset($_POST['submit'])) {
             if (isset($_POST['title']) && isset($_POST['description']) && isset($_POST['start_bid']) && isset($_POST['location']) && isset($_POST['duration']) && isset($_POST['payment_method'])) {
                 $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
                 $errors = array();
                 if ($check !== false) {
                     //echo "File is an image - " . $check["mime"] . ".";
                     $uploadOk = 1;
                 } else {
                     $errors['imageErr'] = "U moet een afbeelding uploaden.";
                     //echo "File is not an image.";
                     $uploadOk = 0;
                 }
                 if (strlen($_POST['title']) > 4 && strlen($_POST['title']) < 60) {
                 } else {
                     $errors['titleErr'] = "Lengte van titel bestaat niet uit 4 tot 60 tekens.";
                 }
                 if (trim(strlen($_POST['description'])) > 1 && trim(strlen($_POST['description'])) < 4000) {
                 } else {
                     $errors['descriptionErr'] = "Lengte van de beschrijving bestaat niet uit 1 tot 4000 tekens.";
                 }
                 if (number_format($_POST['start_bid'], 2) > 0 && number_format($_POST['start_bid'], 2) < 100000) {
                 } else {
                     $errors['start_bidErr'] = "Vul een startbod in wat minimaal 1 karakter en maximaal 99999,99 is.";
                 }
                 if (trim(strlen($_POST['location'])) > 1 && trim(strlen($_POST['location'])) < 163) {
                 } else {
                     $errors['locationErr'] = "Vul een plaatsnaam in van minimaal 1 en maximaal 163 karakters.";
                 }
                 if ($_POST['duration'] > 0) {
                 } else {
                     $errors['durationErr'] = "Looptijd niet geldig.";
                 }
                 if (!empty($_POST['payment_method'])) {
                 } else {
                     $errors['payment_methodErr'] = "Kies een betaalmethode.";
                 }
                 //var_dump($_POST['start_bid']);
                 //var_dump("fwsbjkfewghkfewu");
                 //var_dump($_POST);
                 $insertArray = array("title" => $_POST['title'], "description" => $_POST['description'], "start_bid" => intval(number_format($_POST['start_bid'], 2)), "city" => $_POST['location'], "country" => 'Nederland', "duration" => intval($_POST['duration']), "payment_method" => $_POST['payment_method'], "payment_instructions" => $_POST['payment_instructions'], "shipment_instructions" => $_POST['shipment_instructions'], "shipment_costs" => intval($_POST['shipment_costs']), "seller" => $this->user->getName());
                 if ($errors) {
                     $this->website->assign("errors", $errors);
                     $this->website->assign("values", $_POST);
                 } else {
                     //var_dump($_FILES);
                     $target_dir = getcwd() . "/upload/";
                     $imageFileType = pathinfo($_FILES['fileToUpload']['name'], PATHINFO_EXTENSION);
                     $target_file = md5(date(U) . $this->user->getName()) . '.' . $imageFileType;
                     //md5
                     $uploadOk = 1;
                     rename($_FILES['fileToUpload']['tmp_name'], $target_dir . $target_file);
                     $this->db->insert("objects", $insertArray);
                     $errors['databaseErr1'] = $this->db->getLastError();
                     $objectId = $this->db->getLastInsertedId();
                     $insertFileNameArray = array("filename" => $target_file, "objectid" => $objectId);
                     $this->db->insert("files", $insertFileNameArray);
                     $errors['databaseErr'] = $this->db->getLastError();
                     //Insert into the category that they chose:
                     $categoryInsertArray = array("object_id" => $objectId, "category_id" => $_POST['category']);
                     $this->db->insert("object_in_category", $categoryInsertArray);
                     $errors['databaseErr2'] = $this->db->getLastError();
                     if (sizeof($errors) > 0) {
                         header("Location: " . baseurl("Kavel/Item/" . $objectId));
                     }
                 }
             }
         }
         $displayName = "Kavel aanbieden";
         if (!$this->user->isLoggedIn()) {
             $this->website->assign("loginError", "U moet ingelogd zijn voordat u een kavel kan aanbieden.");
             $this->render('Login', 'users/login.tpl');
         } else {
             $categoryList = getCategory(array());
             $endCategoryList = array();
             foreach ($categoryList as $category) {
                 $this->parseCategoryList($category, $endCategoryList);
             }
             $this->addToBreadcrumbs("Home", baseurl(""));
             $this->addToBreadcrumbs("Kavel aanbieden");
             $this->website->assign("categoryList", $endCategoryList);
             $this->render($displayName, 'lot/newlot.tpl');
         }
     } else {
         $this->website->assign("error", "U moet een verkopers account aanmaken voordat u een kavel kan aanbieden. <br> Klik <a href=https://veiling.k-4u.nl/Users/CP/SellerRequest>hier</a> om een aacount aan te maken.");
         $this->render("", "error.tpl");
     }
 }
开发者ID:K-4U,项目名称:Pr-IP-P2-02,代码行数:91,代码来源:index.php

示例14: baseurl

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
	<head>
		<title><?php 
echo $lang->head_title;
?>
</title>
		<meta http-equiv="Content-type" content="text/html" />
		<base href="<?php 
echo baseurl();
?>
" />
		<link href="publics/default.css" rel="stylesheet" type="text/css" />
		<link href="publics/default-extra.css" rel="stylesheet" type="text/css" />
		<link href="publics/default-error.css" rel="stylesheet" type="text/css" />
		<link href="publics/images/error-icon-small.png" rel="shortcut icon" type="image/png" />
		<script src="publics/jquery.js"></script>
		<script src="publics/jquery.css.js"></script>
		<script src="publics/default.js"></script>
	</head>
	<body>
		<div id="header">
			<div class="content">
				<img src="publics/images/error-icon.png" title="Icon by Gnome Project" width="50" height="50" />
				<span class="labs-title"><?php 
echo $lang->head_title;
?>
</span>
			</div>
		</div>
开发者ID:rentalhost,项目名称:core,代码行数:30,代码来源:error.php

示例15: do_html_header

<?php

//session_start();
do_html_header('Changing password');
check_admin_user();
if (!filled_out($_POST)) {
    echo 'You have not filled out the form completely.
         Please try again.';
    do_html_url(baseurl() . 'cart/admin', 'Back to administration menu');
    exit;
} else {
    $new_passwd = $_POST['new_passwd'];
    $new_passwd2 = $_POST['new_passwd2'];
    $old_passwd = $_POST['old_passwd'];
    if ($new_passwd != $new_passwd2) {
        echo 'Passwords entered were not the same.  Not changed.';
    } else {
        if (strlen($new_passwd) > 16 || strlen($new_passwd) < 6) {
            echo 'New password must be between 6 and 16 characters.  Try again.';
        } else {
            // attempt update
            if (change_password($_SESSION['admin_user'], $old_passwd, $new_passwd)) {
                echo 'Password changed.';
            } else {
                echo 'Password could not be changed.';
            }
        }
    }
}
do_html_url(baseurl() . 'cart/admin', 'Back to administration menu');
开发者ID:jamaBHacker,项目名称:cart,代码行数:30,代码来源:change_password.php


注:本文中的baseurl函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。