本文整理汇总了PHP中getTitle函数的典型用法代码示例。如果您正苦于以下问题:PHP getTitle函数的具体用法?PHP getTitle怎么用?PHP getTitle使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getTitle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseFile
function parseFile($path, $baseUrl, $docID)
{
echo " parse file ";
$content = file_get_contents($path, true);
$title = getTitle($content);
deleteFacts($title);
$GLOBALS["paragraphs"] = array();
$contentParse = $content;
while ($contentParse != null) {
$contentParse = parseText($contentParse);
}
echo "got paragraphs, ";
$paragraphs = $GLOBALS["paragraphs"];
$factsExist = count($paragraphs) > 0;
logSubject($title, $factsExist);
foreach ($paragraphs as $text) {
logFact($text, $title, $docID);
}
echo "logged facts";
/*$GLOBALS["urls"] = array();
$contentParse = $content;
while($contentParse != null) {
$contentParse = parseURL($contentParse, $baseUrl);
}/*/
//logURLs($GLOBALS["urls"]);
//echo "<pre>"; print_r($GLOBALS["urls"]); echo "</pre>";
}
示例2: parserArray
function parserArray($array_xml)
{
$_level_key_name = $_SESSION['_level_key_name'];
$image_url = "../../pixmaps/theme/";
foreach ($array_xml as $key => $value) {
$size = count($array_xml);
if (is_array($value) && !isset($value['@attributes']) && $key !== '@attributes') {
$json .= parserArray($value, '');
continue;
} elseif (is_array($value) && isset($value['@attributes'])) {
$icon = $image_url . getIcon($key, $value);
$title = getTitle($key, $value);
$json .= "{title: '{$title}', addClass: 'size10', key:'" . $value['@attributes'][$_level_key_name] . "', isFolder:'true', icon:'{$icon}'";
$aux = parserArray($value);
$json .= !empty($aux) ? ", children: [" . $aux . "]" : '';
$json .= "},\n";
} elseif (is_array($value) && $key === '@attributes') {
$keys = array_keys($value);
if (!(count($keys) == 1 && $keys[0] == $_level_key_name)) {
$json .= "{title: '<span>" . _("Attributes") . "</span>', addClass: 'size10', key:'attr_" . $value[$_level_key_name] . "', icon:'" . $image_url . "gear-small.png', children: [";
foreach ($value as $k => $v) {
if ($k !== $_level_key_name) {
$json .= "{title: '<span>" . clean_string($k) . "</span>=" . clean_string($v) . "', addClass: 'size10', key:'" . $value[$_level_key_name] . "', icon:'" . $image_url . "ticket-small.png'},\n";
}
}
$json = preg_replace('/,$/', '', $json);
$json .= "]";
$json .= "},\n";
}
}
}
return $json;
}
示例3: user_verify
public function user_verify()
{
session_id($_GET[session_name()]);
session_start();
$data = $_SESSION;
session_destroy();
//Aqui se debiesen hacer validaciones para que el usuario pueda ingresar a la aplicación
$this->load->model('User_model');
$this->load->library('session');
$user = $this->User_model->getUserById($data['rut']);
if (!$user) {
$this->session->set_flashdata("error", 1);
redirect('');
}
if (!$user->name) {
$this->User_model->modifyUser(array('id' => $user->id, 'name' => $data['nombre_completo']));
}
//Aqui se debe agregar las variables de sesion que seran consultadas a futuro en la aplicacion.
$this->session->set_userdata('rut', $data['rut']);
$this->session->set_userdata('name', $data['nombre_completo']);
$this->session->set_userdata('email', $user->email);
$permits = $this->User_model->getPermitByUser($user->id);
$permits_array = getPermits($permits);
$permits_array['title'] = getTitle($user);
$this->session->set_userdata($permits_array);
redirect('inicio');
}
示例4: getBacklink
function getBacklink($id, $type, $category = true)
{
$db =& JFactory::getDBO();
if (!$category) {
$query = "SELECT articleid from #__fieldsattach_values WHERE (value LIKE '%," . $id . ",%' OR value LIKE '" . $id . ",%' OR value LIKE '%," . $id . "' OR value LIKE '" . $id . "') AND fieldsid = 23";
} else {
$query = "SELECT catid from #__fieldsattach_categories_values WHERE (value LIKE '%," . $id . ",%' OR value LIKE '" . $id . ",%' OR value LIKE '%," . $id . "' OR value LIKE '" . $id . "') AND fieldsid = 22";
}
$db->setQuery($query);
$result = $db->loadObjectList();
$function = '';
foreach ($result as $item) {
if (!$category) {
$parent = getParent(getCategory($item->articleid));
} else {
$parent = getParent($item->catid);
}
if ($parent == $type) {
if (!$category) {
$function .= '<li><a href="' . ContentHelperRoute::getArticleRoute($item->articleid, $parent) . '">' . getTitle($item->articleid, $category) . '</a></li>';
} else {
$function .= '<li><a href="' . ContentHelperRoute::getCategoryRoute($item->catid, $parent) . '">' . getTitle($item->catid, $category) . '</a></li>';
}
}
}
return $function;
}
示例5: renderInterfaceHTML
function renderInterfaceHTML($pageno, $tabno, $payload)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title><?php
echo getTitle($pageno);
?>
</title>
<?php
printPageHeaders();
?>
</head>
<body>
<table border=0 cellpadding=0 cellspacing=0 width="100%" height="100%" class="maintable">
<tr class="mainheader"><td>
<?php
echo getConfigVar('enterprise');
?>
RackTables <a href="http://racktables.org" title="Visit RackTables site"><?php
echo CODE_VERSION;
?>
</a><?php
renderQuickLinks();
?>
<div style="float: right" class=greeting><a href='index.php?page=myaccount&tab=default'><?php
global $remote_displayname;
echo $remote_displayname;
?>
</a> [ <a href='?logout'>logout</a> ]</div>
</td></tr>
<tr><td class="menubar">
<table border="0" width="100%" cellpadding="3" cellspacing="0">
<tr><?php
showPathAndSearch($pageno);
?>
</tr>
</table>
</td></tr>
<tr><td><?php
showTabs($pageno, $tabno);
?>
</td></tr>
<tr><td><?php
showMessageOrError();
?>
</td></tr>
<tr><td><?php
echo $payload;
?>
</td></tr>
</table>
</body>
</html>
<?php
}
示例6: showlist
function showlist($path)
{
global $ignore, $ignore_dirs, $id, $divs, $imgpath, $types, $startin, $url_domain;
$dirs = array();
$files = array();
if (is_dir($path)) {
if ($dir = @opendir($path)) {
//if(!in_dirs($path, $ignore_dirs)){
while (($file = readdir($dir)) !== false) {
if ($file != "." && $file != ".." && !in_array($file, $ignore)) {
if (is_dir("{$path}/{$file}")) {
if (file_exists("{$path}/{$file}/index.php")) {
$dirs[$file] = getTitle("{$path}/{$file}/index.php");
} elseif (file_exists("{$path}/{$file}/index.html")) {
$dirs[$file] = getTitle("{$path}/{$file}/index.html");
} elseif (file_exists("{$path}/{$file}/index.htm")) {
$dirs[$file] = getTitle("{$path}/{$file}/index.htm");
} else {
$dirs[$file] = $file;
}
} else {
if (ereg("{$types}\$", $file)) {
$files[$file] = getTitle("{$path}/{$file}");
if (strlen($files[$file]) == 0) {
$files[$file] = $file;
}
}
}
}
}
//}
closedir($dir);
}
natcasesort($dirs);
$url = str_replace($_SERVER['DOCUMENT_ROOT'], "", $path);
$n = substr_count("{$url}/\$", "/");
$base = substr_count($startin, "/") + 1;
$indent = str_pad("", $n - 1, "\t");
if ($n > $base) {
$divs[] = "{$id}";
}
$imgsrc = "minus";
natcasesort($files);
$id++;
foreach ($files as $f => $t) {
$f = retira_extensao($f);
echo $url_domain . '/' . $f . ' 0.5000 ';
}
}
}
示例7: fillUrlCache
function fillUrlCache()
{
echo " Filling URL Cache...";
$mapper = new Application_Model_UrlcacheMapper();
foreach ($mapper->findAllUntitled() as $urlcache) {
$url = $urlcache->getDomain() . $urlcache->getPath();
$title = getTitle($url);
if ($title == null) {
$title = $urlcache->getPath();
}
echo "Setting title of {$url} to {$title}...\n";
$urlcache->setTitle($title);
$mapper->save($urlcache);
}
}
示例8: getMainTemplate
function getMainTemplate()
{
global $settings, $sql;
// Haupt-Template
$template = '{..doctype..}
<html lang="' . $settings['language'] . '">
<head>
{..title..}{..meta..}{..link..}{..script..}
</head>
{..body..}
</html>';
// Dynamischen Titel laden
$template_title = getTitle();
// Metadaten laden
$template_meta = '
<meta name="title" content="' . $template_title . '">
<meta name="description" content="' . $settings['description'] . '">
<meta name="keywords" lang="' . $settings['language'] . '" content="' . $settings['keywords'] . '">
<meta name="robots" content="index,follow">
<meta name="Revisit-after" content="3 days">
<meta http-equiv="content-language" content="' . $settings['language'] . '">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="DC.Title" content="' . $template_title . '">
<meta name="DC.Description" content="' . $settings['description'] . '">
<meta name="DC.Language" content="' . $settings['language'] . '">
<meta name="DC.Format" content="text/html">
';
// link's + CSS einbinden
$template_link = '
<link rel="shortcut icon" href="style/icons/favicon.ico">' . getCSS();
// Platzhalter ersetzen
$template = str_replace("{..title..}", "<title>" . $template_title . "</title>", $template);
$template = str_replace("{..meta..}", $template_meta, $template);
$template = str_replace("{..link..}", $template_link, $template);
$template = str_replace("{..script..}", getJS(), $template);
// Haupt-Template zurückgeben
return $template;
}
示例9: parseURL
/**
* Gets a title from a remote URL.
* @param [type] $url The URL to fetch a readable title from.
* @param [type] $comment A comment, if you need one.
* @return [type] Returns nothing; pushes data directly into $_SESSION
* (This may change later)
*/
function parseURL($url, $comment)
{
session_name('pubTool');
header('P3P: CP="CAO PSA OUR"');
if (verifyURL($url) == false) {
die("That doesn't look like an URL to me. Click <a href=\"index.php\">here</a> and try again!");
}
$url = HttpUri::createFromString($url);
$url = sanitizeURL($url);
$title = getTitle($url);
$domain = getDomain($url);
$_SESSION["linkList"][] = ['url' => strval($url), 'title' => strval($title), 'domain' => strval($domain), 'comment' => strval($comment)];
}
示例10: get_meta_tags
$tags = get_meta_tags($url);
} catch (ErrorException $e) {
}
// At this version we only need description.
if (isset($tags['description'])) {
$description = $tags['description'];
}
return $description;
}
// Get title by URL.
function getTitle($url)
{
$title = '';
$str = '';
try {
$str = file_get_contents($url);
} catch (ErrorException $e) {
$title = $url;
}
if (strlen($str) > 0) {
preg_match("/\\<title(.*)\\>(.*)\\<\\/title\\>/", $str, $titleArray);
if (isset($titleArray[2])) {
$title = $titleArray[2];
}
}
return $title;
}
$title = getTitle($url);
$description = getDescription($url);
$meta = (object) array('title' => $title, 'description' => $description);
print json_encode($meta);
示例11: getSongID
echo $DOKU_TPL;
?>
images/cornerblack.png" alt="" id="cornerblack" />
<img src="<?php
echo $DOKU_TPL;
?>
images/cornerwhite.png" alt="" id="cornerwhite" />
<div id="content">
<div class="scrollarea">
<?php
if (checkNS('songs')) {
$songid = getSongID();
echo '<ul id="nav"><li>';
tpl_pagelink(':songs:' . $songid, getTitle());
echo '</li><li>';
tpl_pagelink(':songs:' . $songid . ':lyrics', 'Lyrics');
echo '</li><li>';
tpl_pagelink(':songs:' . $songid . ':tab', 'Tab');
echo '</li><li>';
tpl_pagelink(':songs:' . $songid . ':archive', 'Archive');
echo '</li></ul>';
}
?>
<div class="xt"> </div>
<div class="content">
<!-- wikipage start -->
<?php
示例12: filter_input
$x = filter_input(INPUT_GET, 'IDs');
//vl unique machn
$movingIDs = explode(",", $x);
$ID01 = $movingIDs[0];
$ID02 = filter_input(INPUT_GET, 'ID');
$found = checkIFparent($ID02, $ID01, false, $storyID);
echo json_encode($found);
} else {
if ($functionName == "getContent") {
getContent($storyID);
} else {
if ($functionName == "saveContent") {
saveContent($storyID);
} else {
if ($functionName == "getTitle") {
getTitle($storyID);
} else {
if ($functionName == "getStoryDetails") {
getStoryDetails($storyID);
} else {
if ($functionName == "saveStory") {
saveStory($storyID);
} else {
if ($functionName == "addConnection") {
addConnection($localhost, $user, $pw, $db, $storyID);
}
}
}
}
}
}
示例13: foreach
<?php
} else {
?>
<ul class="row gallery-files"><?php
foreach ($ADK_GALLERY->docs as $doc) {
?>
<li class="gallery" data-peaks="<?php
echo $doc->peaks;
?>
">
<a href="#" onclick="getFile(<?php
echo $doc->id;
?>
);">
<span title="<?php
echo getTitle($doc);
?>
" data-toggle="tooltip" data-container="body" data-placement="right"><?php
echo $doc->name;
?>
</span>
</a>
</li>
<?php
}
?>
</ul><?php
}
?>
</div>
示例14: Data
if ($sqlcmd) {
$data = new Data();
$data->execSql($sqlcmd);
$sqldata = $data->getArray();
$output .= "<pre>" . print_r($sqldata, 1) . "</pre>";
}
break;
case 'sql':
foreach ($tables as $key) {
$output .= genSQL($key);
}
break;
case 'dd':
foreach ($tables as $key) {
$dd = genDD($key);
$output .= "\n" . '<tr align="center"><td colspan="5" bgcolor="#f0f0f0"><br/>' . getTitle($key) . " ({$key})</br><br/></td></tr>\n";
$output .= "\n<tr><th>Nombre</th><th>Tipo</th><th>Tamaño</th><th>Referencias</th><th>Descripción</th></tr>\n";
foreach ($dd as $col) {
$color = $col[5] ? '#bbbbbb' : '#ffffff';
unset($col[5]);
unset($col[6]);
$output .= "<tr bgcolor=\"{$color}\">";
foreach ($col as $val) {
$output .= "<td>{$val} </td>";
}
$output .= "</tr>\n";
}
}
$output = "\n<table border=\"1\" cellpadding=\"1\" cellspacing=\"1\">{$output}</table>\n";
break;
case 'erdcol':
示例15:
<?foreach ($arResult["ITEMS"] as $key => $arItems) :?>
<div class="item js-item mainBlock" data-id="<?=$arItems["ID"]?>">
<div class="shadowBlockBottom" style="display:none;">
<input class="item-count js-item-count" value="1" type="text" name="item1-count" id="item1-count" style="display:none;" />
<div class="item-actions-cnt common_list">
<a class="btn important js-add-to-cart" href="#" onclick="ga('send', 'event', 'adtocart', '<?=$arItems["PROPERTIES"]["ARTIKUL"]["VALUE"]?>'); return true;">Купить</a>
</div>
</div>
<a href="<?=$arItems["DETAIL_PAGE_URL"]?>">
<?
//$waterImage = waterImage($arItems["~PREVIEW_PICTURE"]);
// $waterImage["src"]
$waterImage["src"] = CFIle::GetPath($arItems["~PREVIEW_PICTURE"]);
?>
<div class="img-cnt">
<img src="<?=$waterImage["src"]?>" alt="<?=getAlt($arItems)?>" title="<?=getTitle($arItems)?>"/>
</div>
<div class="item-info">
<p class="item-name">Артикул <?=$arItems["PROPERTIES"]["ARTIKUL"]["VALUE"]?></p>
<p class="item-desc"><?=$arItems["NAME"]?></p>
<?if ($arItems["PRICES"]["BASE"]["DISCOUNT_VALUE"] < $arItems["PRICES"]["BASE"]["VALUE"]){?>
<div class="item-price oneline"><span><?=number_format($arItems["PRICES"]["BASE"]["DISCOUNT_VALUE"], 0, 0, " ")?></span> <span class="rub">a</span> | </div>
<div class="old-price oneline"><span><?=number_format($arItems["PRICES"]["BASE"]["VALUE"], 0, 0, " ")?></span> <span class="rub">a</span></div>
<?} else {?>
<div class="item-price"><span><?=number_format($arItems["PRICES"]["BASE"]["DISCOUNT_VALUE"], 0, 0, " ")?></span> <span class="rub">a</span></div>
<?}?>
</div>
<?if ($arItems["PROPERTIES"]["HIT"]["VALUE"]):?>
<div class="item-card-badge hit">Хит продаж</div>
<?endif?>
<?if ($arItems["PROPERTIES"]["NEW"]["VALUE"]):?>