本文整理汇总了PHP中getPageTitle函数的典型用法代码示例。如果您正苦于以下问题:PHP getPageTitle函数的具体用法?PHP getPageTitle怎么用?PHP getPageTitle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getPageTitle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHeader
function getHeader($pVar)
{
echo "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" /><title>";
getPageTitle($pVar);
echo "</title>";
echo "<link href=\"";
echo $pVar['StylePath'];
echo "\" type=\"text/css\" rel=\"stylesheet\"></style></head><body>";
}
示例2: modifyPost
function modifyPost($id)
{
global $wpdb;
$post = $wpdb->get_results("SELECT post_title, post_content, FROM wp_posts WHERE id = {$id}");
$content = $post[0]->post_content;
$url = getUrlFromPost($content);
$new_title = getPageTitle($url);
$new_title = str_replace("NewsPicks - ", "", $new_title);
$link = '<a href="' . $url . '" target="_blank" class="read">詳しい記事を読む</a>';
$image = getPageImage($url);
$wpdb->query("UPDATE wp_posts SET post_title = '{$new_title}' WHERE id = {$id} ");
$wpdb->query("UPDATE wp_posts SET post_thumbnail = '{$image}' WHERE id = {$id} ");
if (stristr($content, " / ") != FALSE) {
$comment = explode(' / ', $content);
$content = $comment[0] . $link;
} else {
$content = $link;
}
$wpdb->query("UPDATE wp_posts SET post_content = '{$content}' WHERE id = {$id} ");
}
示例3: getNodeHtml
function getNodeHtml($pageId, $userId, $module, $action, $parentPath)
{
$htmlOut = '';
if (getPermissions($userId, $pageId, $action, $module)) {
$pageInfo = getPageInfo($pageId);
$pagePath = $parentPath;
if ($pageInfo['page_name'] != '') {
$pagePath .= $pageInfo['page_name'] . '/';
}
$htmlOut .= "<li><a href=\"{$pagePath}\">" . getPageTitle($pageId) . "</a>\n";
$childrenQuery = 'SELECT `page_id` FROM `' . MYSQL_DATABASE_PREFIX . 'pages` WHERE `page_parentid` <> `page_id` AND `page_parentid` = \'' . $pageId . '\' AND `page_displayinsitemap` = 1';
$childrenResult = mysql_query($childrenQuery);
$childrenHtml = '';
while ($childrenRow = mysql_fetch_row($childrenResult)) {
$childrenHtml .= $this->getNodeHtml($childrenRow[0], $userId, $module, $action, $pagePath);
}
if ($childrenHtml != '') {
$htmlOut .= "<ul>{$childrenHtml}</ul>\n";
}
$htmlOut .= "</li>\n";
}
return $htmlOut;
}
示例4: submitRegistrationForm
function submitRegistrationForm($moduleCompId, $userId, $silent = false, $disableCaptcha = false)
{
///-------------------------Get anonymous unique negative user id---------------
if ($userId == 0) {
$useridQuery = "SELECT MIN(`user_id`) - 1 AS MIN FROM `form_regdata` WHERE 1";
$useridResult = mysql_query($useridQuery);
if (mysql_num_rows($useridResult) > 0) {
$useridRow = mysql_fetch_assoc($useridResult);
$userId = $useridRow['MIN'];
} else {
$userId = -1;
}
}
///-----------------------------Anonymous user id ends-------------------------------
///---------------------------- CAPTCHA Validation ----------------------------------
if (!$disableCaptcha) {
$captchaQuery = 'SELECT `form_usecaptcha` FROM `form_desc` WHERE `page_modulecomponentid` = \'' . $moduleCompId . "'";
$captchaResult = mysql_query($captchaQuery);
$captchaRow = mysql_fetch_row($captchaResult);
if ($captchaRow[0] == 1) {
if (!submitCaptcha()) {
return false;
}
}
}
///------------------------ CAPTCHA Validation Ends Here ----------------------------
$query = "SELECT `form_elementid`,`form_elementtype` FROM `form_elementdesc` WHERE `page_modulecomponentid`='{$moduleCompId}'";
$result = mysql_query($query);
$allFieldsUpdated = true;
while ($elementRow = mysql_fetch_assoc($result)) {
$type = $elementRow['form_elementtype'];
$elementId = $elementRow['form_elementid'];
$postVarName = "form_" . $moduleCompId . "_element_" . $elementRow['form_elementid'];
$functionName = "submitRegistrationForm" . ucfirst(strtolower($type));
$elementDescQuery = "SELECT `form_elementname`,`form_elementsize`,`form_elementtypeoptions`,`form_elementmorethan`," . "`form_elementlessthan`,`form_elementcheckint`,`form_elementisrequired` FROM `form_elementdesc` " . "WHERE `page_modulecomponentid`='{$moduleCompId}' AND `form_elementid` ='{$elementId}'";
$elementDescResult = mysql_query($elementDescQuery);
if (!$elementDescResult) {
displayerror('E69 : Invalid query: ' . mysql_error());
return false;
}
$elementDescRow = mysql_fetch_assoc($elementDescResult);
$elementName = $elementDescRow['form_elementname'];
$elementSize = $elementDescRow['form_elementsize'];
$elementTypeOptions = $elementDescRow['form_elementtypeoptions'];
$elementMoreThan = $elementDescRow['form_elementmorethan'];
$elementLessThan = $elementDescRow['form_elementlessthan'];
$elementCheckInt = $elementDescRow['form_elementcheckint'] == 1 ? true : false;
$elementIsRequired = $elementDescRow['form_elementisrequired'] == 1 ? true : false;
if ($functionName($moduleCompId, $elementId, $userId, $postVarName, $elementName, $elementSize, $elementTypeOptions, $elementMoreThan, $elementLessThan, $elementCheckInt, $elementIsRequired) == false) {
// displayerror("Error in inputting data in function $functionName.");
$allFieldsUpdated = false;
break;
}
}
if (!$allFieldsUpdated) {
if ($userId < 0) {
unregisterUser($moduleCompId, $userId);
} else {
if (!verifyUserRegistered($moduleCompId, $userId)) {
$deleteelementdata_query = "DELETE FROM `form_elementdata` WHERE `user_id` = '{$userId}' AND `page_modulecomponentid` ='{$moduleCompId}' ";
$deleteelementdata_result = mysql_query($deleteelementdata_query);
}
return false;
}
} else {
if (!verifyUserRegistered($moduleCompId, $userId)) {
registerUser($moduleCompId, $userId);
} else {
updateUser($moduleCompId, $userId);
}
if (!$silent) {
$footerQuery = "SELECT `form_footertext`, `form_sendconfirmation` FROM `form_desc` WHERE `page_modulecomponentid` = '{$moduleCompId}'";
$footerResult = mysql_query($footerQuery);
$footerRow = mysql_fetch_row($footerResult);
$footerText = $footerRow[0];
$footerTextLength = strlen($footerText);
if ($footerTextLength > 7) {
if (substr($footerText, 0, 4) == '<!--' && substr($footerText, $footerTextLength - 3) == '-->') {
$footerText = substr($footerText, 4, $footerTextLength - 7);
} else {
$footerText = '';
}
} else {
$footerText = '';
}
displayinfo($footerText == '' ? "User successfully registered!" : $footerText);
// send mail code starts here - see common.lib.php for more
if ($footerRow[1]) {
$from = '';
// Default CMS email will be added automatically if this is left blank
$to = getUserEmail($userId);
$pageId = getPageIdFromModuleComponentId('form', $moduleCompId);
$parentPage = getParentPage($pageId);
$formname = getPageTitle($parentPage);
$keyid = $finalName = str_pad($userId, 5, '0', STR_PAD_LEFT);
$key = '';
$mailtype = "form_registration_mail";
$messenger = new messenger(false);
global $onlineSiteUrl;
$messenger->assign_vars(array('FORMNAME' => "{$formname}", 'KEY' => "{$key}", 'WEBSITE' => CMS_TITLE, 'DOMAIN' => $onlineSiteUrl, 'NAME' => getUserFullName($userId)));
//.........这里部分代码省略.........
示例5: printPageHeader
/**
* Displays the page header
*
* @since 1.0
* @package facileManager
*
* @param string $response Page form response
* @param string $title The page title
* @param bool $allowed_to_add Whether the user can add new
* @param string $name Name value of plus sign
* @param string $rel Rel value of plus sign
* @return string
*/
function printPageHeader($response = null, $title = null, $allowed_to_add = false, $name = null, $rel = null)
{
global $__FM_CONFIG;
if (empty($title)) {
$title = getPageTitle();
}
echo '<div id="body_container">' . "\n";
if (!empty($response)) {
echo '<div id="response"><p class="error">' . $response . "</p></div>\n";
} else {
echo '<div id="response" style="display: none;"></div>' . "\n";
}
echo '<h2>' . $title;
if ($allowed_to_add) {
echo displayAddNew($name, $rel);
}
echo '</h2>' . "\n";
}
示例6: checkPage
<!DOCTYPE html>
<?php
require 'utilities/utils.php';
if (array_key_exists('page', $_GET)) {
$askedPage = $_GET['page'];
} else {
$askedPage = "accueil";
}
$authorized = checkPage($askedPage);
if ($authorized) {
$pageTitle = getPageTitle($askedPage);
} else {
$pageTitle = "Cette page n'est pas accessible";
$askedPage = "erreur";
}
generateHTMLHeader($pageTitle);
?>
<div class="container">
<?php
generateMenu($askedPage);
?>
<div class="jumbotron">
<?php
echo "<h1>{$pageTitle}</h1>";
?>
<p>Ceci est le site du binet photo</p>
</div>
<div id="content">
<?php
if ($authorized) {
示例7: actionView
public function actionView()
{
global $sourceFolder, $cmsFolder, $templateFolder, $moduleFolder, $urlRequestRoot;
require_once "{$sourceFolder}/{$moduleFolder}/faculty/template_edit.php";
$viewDetail = "";
$templateId = getTemplateId($this->moduleComponentId);
$sectionDetail = getTemplateDataFromModuleComponentId($this->moduleComponentId);
$title = getPageTitle(getPageIdFromModuleComponentId("faculty", $this->moduleComponentId));
$getImage = "SELECT * FROM `faculty_module` WHERE `page_moduleComponentId`={$this->moduleComponentId}";
$getImageQuery = mysql_query($getImage);
$isExistPh = mysql_fetch_assoc($getImageQuery);
$viewDetail .= <<<IMG
\t <div style="text-align:center;">
\t <img src="{$isExistPh['photo']}" />
\t </div>
IMG;
require_once $sourceFolder . "/pngRender.class.php";
$render = new pngrender();
$emailId = getEmailForFaculty($this->moduleComponentId);
$ret = $render->transform("[tex]" . $emailId . "[/tex]");
$viewDetail .= "<h3 style='text-align:center;'>Email:{$ret}</h3>";
while ($sectionDetailArray = mysql_fetch_assoc($sectionDetail)) {
$sectionId = $sectionDetailArray['template_sectionId'];
$printFacData = printFacultyData($sectionId, $this->moduleComponentId, 0);
if ($printFacData != "") {
$viewDetail .= <<<facultyName
\t\t<h2>{$sectionDetailArray['template_sectionName']}</h2><hr>
facultyName;
}
$viewDetail .= "<br/><br/>";
$sectionChildNode1DetailQuery = "SELECT * FROM `faculty_template` WHERE `template_id`={$templateId} AND ";
$sectionChildNode1DetailQuery .= "`template_sectionParentId`={$sectionDetailArray['template_sectionId']}";
$sectionChildNode1DetailResult = mysql_query($sectionChildNode1DetailQuery);
$viewDetail .= $printFacData;
while ($sectionChildNode1DetailArray = mysql_fetch_assoc($sectionChildNode1DetailResult)) {
$facultyData = printFacultyData($sectionChildNode1DetailArray['template_sectionId'], $this->moduleComponentId, 1);
$viewDetail .= <<<facultyName
\t\t<h3>{$facultyData}</h3>
facultyName;
$sectionChildNode2DetailQuery = "SELECT * FROM `faculty_template` WHERE `template_id`={$templateId} AND ";
$sectionChildNode2DetailQuery .= "`template_sectionParentId`={$sectionChildNode1DetailArray['template_sectionId']}";
$sectionChildNode2DetailResult = mysql_query($sectionChildNode2DetailQuery);
while ($sectionChildNode2DetailArray = mysql_fetch_assoc($sectionChildNode2DetailResult)) {
$facultyDataChild = printFacultyData($sectionChildNode2DetailArray['template_sectionId'], $this->moduleComponentId, 1);
$viewDetail .= <<<facultyName
\t\t <h4>{$facultyDataChild}</h4>
facultyName;
}
$viewDetail .= "<br/>";
}
}
return $viewDetail;
}
示例8: session_start
<?php
include_once "{$_SERVER['DOCUMENT_ROOT']}/phase5/inc/inc.info.php";
session_start();
# Checks if logged in. If NOT logged in, the login button stays the same.
# If IS logged in, the login button changes to logout.
if (isset($_SESSION['loggedin'])) {
$loggedin = $_SESSION['loggedin'];
}
# Gets ID. ID is passed as a GET method. Creates a Title class
# this class contains all the title data
if (isset($_GET['id'])) {
getTitleData($_GET['id']);
$_SESSION['title_id'] = $_GET['id'];
}
$pageTitle = getPageTitle();
// To get the title for favoriting
$_SESSION['title'] = $pageTitle;
if (isset($_SESSION['favorites'])) {
if (in_array($_SESSION['title'], $_SESSION['favorites'])) {
$isFavorite = true;
}
}
include_once "{$_SERVER['DOCUMENT_ROOT']}/phase5/inc/header.php";
// Body content
?>
<div class="wrap">
<div class="row">
<div class="col-md-8">
<img class="img-responsive img-rounded pull-right" src="../images/info_banner_1.jpg" alt="<?php
getTitle();
示例9: checkIfUserAlreadyHasThisUrl
function checkIfUserAlreadyHasThisUrl($url, $userID)
{
$query = "SELECT * from links where url = ? and userID = ?";
$params = [$url, $userID];
$result = selectQuery($query, $params);
if (count($result) == 1) {
return 0;
} else {
return 1;
}
}
if (checkIfUserAlreadyHasThisUrl($url, $userID) == 0) {
echo "link already exists";
break;
} else {
$title = getPageTitle($url);
$query = "INSERT into links (userID, url, title, timestamp) VALUES (?, ?, ?, now())";
$params = [$userID, $url, $title];
$lastInserted = editQuery($query, $params);
if (strlen($tags) > 0) {
$tagString = strtolower($tags);
$tags = stringToArray($tagString);
$tags = array_unique($tags);
foreach ($tags as $tag) {
$query = "SELECT * from tags WHERE tag = ?";
$params = [$tag];
$res = selectQuery($query, $params);
if (count($res) == 0) {
$query = "INSERT into tags (tag) VALUES (?)";
$params = [$tag];
editQuery($query, $params);
示例10: create_quiz_list
function create_quiz_list($php_filename)
{
global $interface_lang;
$html_filename = "./html/" . substr($php_filename, 0, -4) . "-list.html";
$base_filename = basename($php_filename, ".php");
$page_title = getPageTitle($php_filename);
ob_start();
include $php_filename;
echo <<<_END
<!DOCTYPE html>
<html lang="{$interface_lang}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Μελετώ: {$page_title}</title>
<link rel="stylesheet" href="/css/greek-visual-keyboard.css">
<link rel="stylesheet" href="/css/quiz.css">
<link rel="stylesheet" href="/css/styles.css">
</head>
<body>
_END;
navbar(dirname($php_filename));
echo <<<_END
<div class="center">
{$page_title}<br>
<p id="quizTitle"></p>
<div id="loading"><img src="/img/icons/spin.gif" alt="spinner"></div>
<table id="list">
</table>
<p>
<a href="index.html"><img src="/img/icons/revert.png" alt="back"></a>
<img src="/img/icons/spacer.png" alt=" ">
<a href="{$base_filename}.html"><img src="/img/icons/pencil_plain.png" alt="pencil"></a>
<img src="/img/icons/spacer.png" alt=" ">
<a href="/html/{$interface_lang}/index.html"><img src="/img/icons/home.png" alt="home"></a>
</p>
</div> <!-- end center -->
<script src="/js/jquery.js"></script>
<!-- preload icons -->
<script src="/js/preload-icons.js"></script>
<!-- quiz scripts -->
<script src="{$base_filename}.js"></script>
<script src="/js/list.js"></script>
<script>
\$(window).load(function () {
\$("#loading").hide();
});
</script>
</body>
</html>
_END;
file_put_contents($html_filename, ob_get_clean());
}
示例11: getHeader
<?php
getHeader($pVar);
getPageTitle($pVar);
?>
<h1>Vediamo se funziona davvero questa pagina di Template</h1>
<?php
testing();
getFooter();
closePage();
示例12: session_destroy
include 'db_connect.php';
include 'core.php';
if (isset($_GET['logout'])) {
session_destroy();
echo "<script>\n\n\n setTimeout(window.location.replace('/scc/'), 300);\n\n </script>";
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title><?php
if (isset($_GET['page'])) {
echo getPageTitle($_GET['page']);
}
?>
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="layout" content="main"/>
<script src="js/jquery/jquery-1.8.2.min.js" type="text/javascript" ></script>
<link href="css/customize-template.css" type="text/css" media="screen, projection" rel="stylesheet" />
<link href="css/treeview.css" type="text/css" media="screen, projection" rel="stylesheet" />
<style>
</style>
<script src="js/bootstrap/bootstrap-transition.js" type="text/javascript" ></script>
示例13: userAuth
<?php
# Include files required for the site to work properly.
require_once "includes/scripts/php/config.php";
require_once "includes/scripts/php/functions.php";
# Get some information that will be needed to render the page properly.
$validUser = userAuth($connection);
# If a page has been requested, get the information for it.
if (isset($_GET['p'])) {
$page = getPage($_GET['p']);
$pageTitle = getPageTitle($_GET['p']);
} else {
$page = "home.php";
$pageTitle = "- Home";
}
# If the user is logged into a valid account, get information needed to
# display the page.
if ($validUser) {
# Get the account's username from the active session.
session_start();
$username = $_SESSION['user'][0];
session_write_close();
# Get the name associated with the user's account.
$name = getName($username, $connection);
# Determine if there are any active, unaccepted challenges for the
# account.
$hasChallenges = hasChallenges($username, $connection);
}
?>
<!DOCTYPE html>
示例14: die
die('not found');
}
foreach ($fql_query_obj as $key => $row) {
$like_count[$key] = $row['like_count'];
}
array_multisort($like_count, SORT_DESC, $fql_query_obj);
$ranking = array_slice($fql_query_obj, 0, $limit);
apc_store($hash_key, $ranking);
}
$string = "<tr>\n";
$string .= "<th>title</th>\n";
$string .= "<th>liked</th>\n";
$string .= "</tr>\n";
foreach ($ranking as &$val) {
//if ($val['like_count'] == 0) continue;
$val['title'] = getPageTitle($val['url']);
$string .= "<tr>";
$string .= '<td><a href="' . $val['url'] . '" target="_blank">' . $val['title'] . "</a></td>\n";
$string .= "<td>" . $val['like_count'] . "</td>\n";
$string .= "</tr>\n";
}
echo $string;
exit;
function getPageTitle($url)
{
// なぜか file_get_contentsが動かないのでとりあえず…
return $url;
$html = file_get_contents($url);
$html = mb_convert_encoding($html, mb_internal_encoding(), "auto");
if (preg_match("/<title>(.*?)<\\/title>/i", $html, $matches)) {
return $matches[1];
示例15: groupManagementForm
//.........这里部分代码省略.........
\t\t\t\t</form>
\t\t\t</fieldset>
\t\t\t<br />
\t\t\t<fieldset style="padding: 8px">
\t\t\t\t<legend>{$ICONS['User Groups']['small']}Existing Users in Group:</legend>
GROUPEDITFORM;
$userCount = mysql_num_rows($userResult);
global $urlRequestRoot, $cmsFolder, $templateFolder, $sourceFolder;
$deleteImage = "<img src=\"{$urlRequestRoot}/{$cmsFolder}/{$templateFolder}/common/icons/16x16/actions/edit-delete.png\" alt=\"Remove user from the group\" title=\"Remove user from the group\" />";
for ($i = 0; $i < $userCount; $i++) {
$isntAssociatedWithForm = $groupRow['form_id'] == 0;
if ($isntAssociatedWithForm) {
$groupEditForm .= '<a onclick="return confirm(\'Are you sure you wish to remove this user from this group?\')" href="./+admin&subaction=editgroups&subsubaction=deleteuser&groupname=' . $groupRow['group_name'] . '&useremail=' . $userEmails[$i] . '">' . $deleteImage . "</a>";
}
$groupEditForm .= " {$userEmails[$i]} - {$userFullnames[$i]}<br />\n";
}
$associateForm = '';
if ($groupRow['form_id'] == 0) {
$associableForms = getAssociableFormsList($currentUserId, !isGroupEmpty($groupId));
$associableFormCount = count($associableForms);
$associableFormsBox = '<select name="selFormPath">';
for ($i = 0; $i < $associableFormCount; ++$i) {
$associableFormsBox .= '<option value="' . $associableForms[$i][2] . '">' . $associableForms[$i][1] . ' - ' . $associableForms[$i][2] . '</option>';
}
$associableFormsBox .= '</select>';
$associateForm = <<<GROUPASSOCIATEFORM
\t\t\tSelect a form to associate the group with: {$associableFormsBox}
\t\t\t<input type="submit" name="btnAssociateGroup" value="Associate Group with Form" />
GROUPASSOCIATEFORM;
} else {
$associatedFormPageId = getPageIdFromModuleComponentId('form', $groupRow['form_id']);
$associateForm = 'This group is currently associated with the form: ' . getPageTitle($associatedFormPageId) . ' (' . getPagePath($associatedFormPageId) . ')<br />' . '<input type="submit" name="btnUnassociateGroup" value="Unassociate" />';
}
$groupEditForm .= '</fieldset>';
if ($groupRow['form_id'] == 0) {
$groupEditForm .= <<<GROUPEDITFORM
\t\t\t\t<br />
\t\t\t\t<fieldset style="padding: 8px">
\t\t\t\t\t<legend>{$ICONS['Add']['small']}Add Users to Group</legend>
\t\t\t\t\t<form name="addusertogroup" method="POST" action="./+admin&subaction=editgroups&groupname={$groupRow['group_name']}">
\t\t\t\t\t\tEmail ID: <input type="text" name="txtUserEmail" id="txtUserEmail" value="" style="width: 256px" autocomplete="off" />
\t\t\t\t\t\t<div id="suggestionDiv" class="suggestionbox"></div>
\t\t\t\t\t\t<script language="javascript" type="text/javascript" src="{$scriptsFolder}/ajaxsuggestionbox.js"></script>
\t\t\t\t\t\t<script language="javascript" type="text/javascript">
\t\t\t\t\t\t<!--
\t\t\t\t\t\t\tvar addUserBox = new SuggestionBox(document.getElementById('txtUserEmail'), document.getElementById('suggestionDiv'), "./+admin&doaction=getsuggestions&forwhat=%pattern%");
\t\t\t\t\t\t\taddUserBox.loadingImageUrl = '{$imagesFolder}/ajaxloading.gif';
\t\t\t\t\t\t-->
\t\t\t\t\t\t</script>
\t\t\t\t\t\t<input type="submit" name="btnAddUserToGroup" value="Add User to Group" />
\t\t\t\t\t</form>
\t\t\t\t</fieldset>
GROUPEDITFORM;
}
$groupEditForm .= <<<GROUPEDITFORM
\t\t\t<br />
\t\t\t<fieldset style="padding: 8px">
\t\t\t\t<legend>{$ICONS['Group Associate Form']['small']}Associate With Form</legend>
\t\t\t\t<form name="groupassociationform" action="./+admin&subaction=editgroups&subsubaction=associateform&groupname={$groupRow['group_name']}" method="POST">
\t\t\t\t\t{$associateForm}
\t\t\t\t</form>
\t\t\t</fieldset>