本文整理汇总了PHP中encodeHTML函数的典型用法代码示例。如果您正苦于以下问题:PHP encodeHTML函数的具体用法?PHP encodeHTML怎么用?PHP encodeHTML使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了encodeHTML函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: citeRecord
function citeRecord($row, $citeStyle, $citeType, $markupPatternsArray, $encodeHTML)
{
global $alnum, $alpha, $cntrl, $dash, $digit, $graph, $lower, $print, $punct, $space, $upper, $word, $patternModifiers;
// defined in 'transtab_unicode_charset.inc.php' and 'transtab_latin1_charset.inc.php'
static $uspsStateAbbreviations;
// Official USPS state abbreviations:
// see <http://www.usps.com/ncsc/lookups/usps_abbreviations.htm>
$uspsStateAbbreviations = "AL|AK|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MT|" . "NE|NV|NH|NJ|NM|NY|NC|ND|MP|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY";
$record = "";
// make sure that our buffer variable is empty
// --- BEGIN TYPE = JOURNAL ARTICLE / MAGAZINE ARTICLE / NEWSPAPER ARTICLE --------------------------------------------------------------
if (preg_match("/^(Journal Article|Magazine Article|Newspaper Article)\$/", $row['type'])) {
if (!empty($row['author'])) {
// Call the 'reArrangeAuthorContents()' function (defined in 'include.inc.php') in order to re-order contents of the author field. Required Parameters:
// 1. input: contents of the author field
// 2. input: boolean value that specifies whether the author's family name comes first (within one author) in the source string
// ('true' means that the family name is followed by the given name (or initials), 'false' if it's the other way around)
//
// 3. input: pattern describing old delimiter that separates different authors
// 4. output: for all authors except the last author: new delimiter that separates different authors
// 5. output: for the last author: new delimiter that separates the last author from all other authors
//
// 6. input: pattern describing old delimiter that separates author name & initials (within one author)
// 7. output: for the first author: new delimiter that separates author name & initials (within one author)
// 8. output: for all authors except the first author: new delimiter that separates author name & initials (within one author)
// 9. output: new delimiter that separates multiple initials (within one author)
// 10. output: for the first author: boolean value that specifies if initials go *before* the author's name ['true'], or *after* the author's name ['false'] (which is the default in the db)
// 11. output: for all authors except the first author: boolean value that specifies if initials go *before* the author's name ['true'], or *after* the author's name ['false'] (which is the default in the db)
// 12. output: boolean value that specifies whether an author's full given name(s) shall be shortened to initial(s)
//
// 13. output: if the total number of authors is greater than the given number (integer >= 1), only the number of authors given in (14) will be included in the citation along with the string given in (15); keep empty if all authors shall be returned
// 14. output: number of authors (integer >= 1) that is included in the citation if the total number of authors is greater than the number given in (13); keep empty if not applicable
// 15. output: string that's appended to the number of authors given in (14) if the total number of authors is greater than the number given in (13); the actual number of authors can be printed by including '__NUMBER_OF_AUTHORS__' (without quotes) within the string
//
// 16. output: boolean value that specifies whether the re-ordered string shall be returned with higher ASCII chars HTML encoded
$author = reArrangeAuthorContents($row['author'], true, "/ *; */", ", ", ", ", "/ *, */", " ", " ", "", false, false, true, "6", "6", ", et al.", $encodeHTML);
if (!preg_match("/\\. *\$/", $author)) {
$record .= $author . ".";
} else {
$record .= $author;
}
}
if (!empty($row['title'])) {
if (!empty($row['author'])) {
$record .= " ";
}
$record .= $row['title'];
}
// From here on we'll assume that at least either the 'author' or the 'title' field did contain some contents
// if this is not the case, the output string will begin with a space. However, any preceding/trailing whitespace will be removed at the cleanup stage (see below)
if (!preg_match("/[?!.] *\$/", $record)) {
$record .= ".";
}
if (!empty($row['abbrev_journal'])) {
// abbreviated journal name
$record .= " " . preg_replace("/\\./", "", $row['abbrev_journal']);
} elseif (!empty($row['publication'])) {
// publication (= journal) name
$record .= " " . $row['publication'];
}
if ($row['online_publication'] == "yes") {
// this record refers to an online publication
$record .= " [Internet]";
}
// NOTE: some of the above mentioned resources use "[serial online]", "[serial on the Internet]" or just "[online]" instead
// NOTE: the formatting of year/volume/issue is meant for journal articles (TODO: newspaper/magazine articles)
if (!empty($row['year'])) {
// year
$record .= ". " . $row['year'];
}
if ($row['online_publication'] == "yes") {
// append the current date if this record refers to an online publication
$record .= " [cited " . date("Y M j") . "]";
}
if (!empty($row['volume']) || !empty($row['issue'])) {
$record .= ";";
}
if (!empty($row['volume'])) {
// volume (=month)
$record .= $row['volume'];
}
if (!empty($row['issue'])) {
// issue (=day)
$record .= "(" . $row['issue'] . ")";
}
if (!empty($row['pages'])) {
if (!empty($row['year']) || !empty($row['volume']) || !empty($row['issue']) || !empty($row['abbrev_journal']) || !empty($row['publication'])) {
// only add ": " if either year, volume, issue, abbrev_journal or publication isn't empty
$record .= ":";
}
$record .= formatPageInfo($row['pages'], $markupPatternsArray["endash"], "", "", "", "", "", "", true);
// function 'formatPageInfo()' is defined in 'cite.inc.php'
}
if ($row['online_publication'] == "yes") {
// append an optional string (given in 'online_citation') plus the DOI (or URL):
if (!empty($row['online_citation'])) {
if (!empty($row['year']) || !empty($row['volume']) || !empty($row['issue']) || !empty($row['abbrev_journal']) || !empty($row['publication'])) {
if (empty($row['pages'])) {
$record .= ":";
} else {
//.........这里部分代码省略.........
示例2: showQueryPage
function showQueryPage($operation, $viewType, $showRows, $rowOffset)
{
global $officialDatabaseName;
// defined in 'ini.inc.php'
global $displayType;
global $loc;
// defined in 'locales/core.php'
global $client;
// If there's no stored message available:
if (!isset($_SESSION['HeaderString'])) {
$HeaderString = $loc["SearchDB"] . ":";
} else {
$HeaderString = $_SESSION['HeaderString'];
// extract 'HeaderString' session variable (only necessary if register globals is OFF!)
// Note: though we clear the session variable, the current message is still available to this script via '$HeaderString':
deleteSessionVariable("HeaderString");
// function 'deleteSessionVariable()' is defined in 'include.inc.php'
}
// For HTML output, we'll need to reset the value of the '$displayType' variable
// (which, by default, is set to "Export"; see above); otherwise, the 'originalDisplayType'
// parameter in the 'quickSearch' form of the page header would be incorrectly set to "Export"
$displayType = "";
// if '$displayType' is empty, 'show.php' will use the default view that's given in session variable 'userDefaultView'
// Show the login status:
showLogin();
// (function 'showLogin()' is defined in 'include.inc.php')
// DISPLAY header:
// call the 'displayHTMLhead()' and 'showPageHeader()' functions (which are defined in 'header.inc.php'):
displayHTMLhead(encodeHTML($officialDatabaseName) . " -- " . $loc["Search"], "index,follow", "Search the " . encodeHTML($officialDatabaseName), "", true, "", $viewType, array());
if (!preg_match("/^Mobile\$/i", $viewType) and !preg_match("/^inc/i", $client)) {
// Note: we omit the visible header in mobile view ('viewType=Mobile') and for include mechanisms!
showPageHeader($HeaderString);
}
// Define variables holding common drop-down elements, i.e. build properly formatted <option> tag elements:
$dropDownConditionals1Array = array("contains" => $loc["contains"], "does not contain" => $loc["contains not"], "is equal to" => $loc["equal to"], "is not equal to" => $loc["equal to not"], "starts with" => $loc["starts with"], "ends with" => $loc["ends with"]);
$dropDownItems1 = buildSelectMenuOptions($dropDownConditionals1Array, "//", "\t\t\t", true);
// function 'buildSelectMenuOptions()' is defined in 'include.inc.php'
$dropDownConditionals2Array = array("is greater than" => $loc["is greater than"], "is less than" => $loc["is less than"], "is within range" => $loc["is within range"], "is within list" => $loc["is within list"]);
$dropDownItems2 = buildSelectMenuOptions($dropDownConditionals2Array, "//", "\t\t\t", true);
$dropDownFieldNames1Array = array("author" => $loc["DropDownFieldName_Author"], "address" => $loc["DropDownFieldName_Address"], "corporate_author" => $loc["DropDownFieldName_CorporateAuthor"], "thesis" => $loc["DropDownFieldName_Thesis"], "", "title" => $loc["DropDownFieldName_Title"], "orig_title" => $loc["DropDownFieldName_OrigTitle"], "", "year" => $loc["DropDownFieldName_Year"], "publication" => $loc["DropDownFieldName_Publication"], "abbrev_journal" => $loc["DropDownFieldName_AbbrevJournal"], "editor" => $loc["DropDownFieldName_Editor"], "", "volume_numeric" => $loc["DropDownFieldName_Volume"], "issue" => $loc["DropDownFieldName_Issue"], "pages" => $loc["DropDownFieldName_Pages"], "", "series_title" => $loc["DropDownFieldName_SeriesTitle"], "abbrev_series_title" => $loc["DropDownFieldName_AbbrevSeriesTitle"], "series_editor" => $loc["DropDownFieldName_SeriesEditor"], "series_volume_numeric" => $loc["DropDownFieldName_SeriesVolume"], "series_issue" => $loc["DropDownFieldName_SeriesIssue"], "", "publisher" => $loc["DropDownFieldName_Publisher"], "place" => $loc["DropDownFieldName_Place"], "", "edition" => $loc["DropDownFieldName_Edition"], "medium" => $loc["DropDownFieldName_Medium"], "issn" => $loc["DropDownFieldName_Issn"], "isbn" => $loc["DropDownFieldName_Isbn"], "", "language" => $loc["DropDownFieldName_Language"], "summary_language" => $loc["DropDownFieldName_SummaryLanguage"], "", "keywords" => $loc["DropDownFieldName_Keywords"], "abstract" => $loc["DropDownFieldName_Abstract"], "", "area" => $loc["DropDownFieldName_Area"], "expedition" => $loc["DropDownFieldName_Expedition"], "conference" => $loc["DropDownFieldName_Conference"], "", "doi" => $loc["DropDownFieldName_Doi"], "url" => $loc["DropDownFieldName_Url"]);
if (isset($_SESSION['loginEmail'])) {
// we only include the 'file' field if the user is logged in
$dropDownFieldNames1Array["file"] = $loc["DropDownFieldName_File"];
}
$dropDownFieldNames1Array[] = "";
$dropDownFieldNames1Array["notes"] = $loc["DropDownFieldName_Notes"];
if (isset($_SESSION['loginEmail'])) {
// we only include the 'location' field if the user is logged in
$dropDownFieldNames1Array["location"] = $loc["DropDownFieldName_Location"];
}
$dropDownFieldNames2Array = array("call_number" => $loc["DropDownFieldName_CallNumber"], "", "serial" => $loc["DropDownFieldName_Serial"], "type" => $loc["DropDownFieldName_Type"], "approved" => $loc["DropDownFieldName_Approved"], "", "created_date" => $loc["DropDownFieldName_CreatedDate"], "created_time" => $loc["DropDownFieldName_CreatedTime"]);
if (isset($_SESSION['loginEmail'])) {
// we only include the 'created_by' field if the user is logged in
$dropDownFieldNames2Array["created_by"] = $loc["DropDownFieldName_CreatedBy"];
}
$dropDownFieldNames2Array[] = "";
$dropDownFieldNames2Array["modified_date"] = $loc["DropDownFieldName_ModifiedDate"];
$dropDownFieldNames2Array["modified_time"] = $loc["DropDownFieldName_ModifiedTime"];
if (isset($_SESSION['loginEmail'])) {
// we only include the 'modified_by' field if the user is logged in
$dropDownFieldNames2Array["modified_by"] = $loc["DropDownFieldName_ModifiedBy"];
}
$dropDownItems3 = buildSelectMenuOptions(array_merge($dropDownFieldNames1Array, $dropDownFieldNames2Array), "//", "\t\t\t", true);
$dropDownConditionals3Array = array("html" => "html", "atom" => "Atom XML", "rss" => "RSS XML", "srw_dc" => "SRW_DC XML", "srw_mods" => "SRW_MODS XML");
$dropDownItems4 = buildSelectMenuOptions($dropDownConditionals3Array, "//", "\t\t\t", true);
// Map CQL indexes to refbase field names:
$indexNamesArray = mapCQLIndexes();
// function 'mapCQLIndexes()' is defined in 'webservice.inc.php'
// --------------------------------------------------------------------
// TODO: when the simple CQL Query Builder interface is done, a call to 'opensearch.php' (or 'opensearch.php?operation=simple')
// should activate that simple GUI-based interface (currently, it activates the advanced interface that you'd normally only
// get via 'opensearch.php?operation=cql' or 'opensearch.php?operation=advanced')
// if (preg_match("/^(advanced|CQL)$/i", $operation))
showQueryFormAdvanced($dropDownItems1, $dropDownItems2, $dropDownItems3, $dropDownItems4, $showRows, $rowOffset, $indexNamesArray, $viewType);
// let's you enter a standard CQL query directly
// else
// showQueryFormSimple($dropDownItems1, $dropDownItems2, $dropDownItems3, $dropDownItems4, $showRows, $rowOffset, $indexNamesArray, $viewType); // let's you build a CQL query via dropdown menues
// --------------------------------------------------------------------
// DISPLAY THE HTML FOOTER:
// call the 'showPageFooter()' and 'displayHTMLfoot()' functions (which are defined in 'footer.inc.php')
if (!preg_match("/^Mobile\$/i", $viewType) and !preg_match("/^inc/i", $client)) {
// Note: we omit the visible footer in mobile view ('viewType=Mobile') and for include mechanisms!
showPageFooter($HeaderString);
}
displayHTMLfoot();
}
示例3: encodeHTML
<form method="post" action="default_toolbar2.php" id="Form1">
<textarea id="txtContent" name="txtContent" rows=4 cols=30>
<?php
function encodeHTML($sHTML)
{
$sHTML = ereg_replace("&", "&", $sHTML);
$sHTML = ereg_replace("<", "<", $sHTML);
$sHTML = ereg_replace(">", ">", $sHTML);
return $sHTML;
}
if (isset($_POST["txtContent"])) {
$sContent = stripslashes($_POST['txtContent']);
/*** remove (/) slashes ***/
echo encodeHTML($sContent);
}
?>
</textarea>
<script>
var oEdit1 = new InnovaEditor("oEdit1");
oEdit1.width=700;
oEdit1.height=450;
/***************************************************
ADDING CUSTOM BUTTONS
***************************************************/
oEdit1.arrCustomButtons = [["CustomName1","alert('Command 1 here.')","Caption 1 here","btnCustom1.gif"],
示例4: citeRecord
function citeRecord($row, $citeStyle, $citeType, $markupPatternsArray, $encodeHTML)
{
$record = "";
// make sure that our buffer variable is empty
// --- BEGIN TYPE = JOURNAL ARTICLE / MAGAZINE ARTICLE / NEWSPAPER ARTICLE --------------------------------------------------------------
if (preg_match("/^(Journal Article|Magazine Article|Newspaper Article)\$/", $row['type'])) {
if (!empty($row['author'])) {
// Call the 'reArrangeAuthorContents()' function (defined in 'include.inc.php') in order to re-order contents of the author field. Required Parameters:
// 1. input: contents of the author field
// 2. input: boolean value that specifies whether the author's family name comes first (within one author) in the source string
// ('true' means that the family name is followed by the given name (or initials), 'false' if it's the other way around)
//
// 3. input: pattern describing old delimiter that separates different authors
// 4. output: for all authors except the last author: new delimiter that separates different authors
// 5. output: for the last author: new delimiter that separates the last author from all other authors
//
// 6. input: pattern describing old delimiter that separates author name & initials (within one author)
// 7. output: for the first author: new delimiter that separates author name & initials (within one author)
// 8. output: for all authors except the first author: new delimiter that separates author name & initials (within one author)
// 9. output: new delimiter that separates multiple initials (within one author)
// 10. output: for the first author: boolean value that specifies if initials go *before* the author's name ['true'], or *after* the author's name ['false'] (which is the default in the db)
// 11. output: for all authors except the first author: boolean value that specifies if initials go *before* the author's name ['true'], or *after* the author's name ['false'] (which is the default in the db)
// 12. output: boolean value that specifies whether an author's full given name(s) shall be shortened to initial(s)
//
// 13. output: if the total number of authors is greater than the given number (integer >= 1), only the number of authors given in (14) will be included in the citation along with the string given in (15); keep empty if all authors shall be returned
// 14. output: number of authors (integer >= 1) that is included in the citation if the total number of authors is greater than the number given in (13); keep empty if not applicable
// 15. output: string that's appended to the number of authors given in (14) if the total number of authors is greater than the number given in (13); the actual number of authors can be printed by including '__NUMBER_OF_AUTHORS__' (without quotes) within the string
//
// 16. output: boolean value that specifies whether the re-ordered string shall be returned with higher ASCII chars HTML encoded
$author = reArrangeAuthorContents($row['author'], true, "/ *; */", ", ", ", and ", "/ *, */", ", ", " ", ". ", false, true, false, "3", "1", ", et al.", $encodeHTML);
// 16.
if (!preg_match("/\\. *\$/", $author)) {
$record .= $author . ".";
} else {
$record .= $author;
}
}
if (!empty($row['title'])) {
if (!empty($row['author'])) {
$record .= " ";
}
$record .= '"' . $row['title'];
if (!preg_match("/[?!.]\$/", $row['title'])) {
$record .= ".";
}
$record .= '"';
}
// From here on we'll assume that at least either the 'author' or the 'title' field did contain some contents
// if this is not the case, the output string will begin with a space. However, any preceding/trailing whitespace will be removed at the cleanup stage (see below)
if (!empty($row['abbrev_journal'])) {
// abbreviated journal name
$record .= " " . $markupPatternsArray["italic-prefix"] . $row['abbrev_journal'] . $markupPatternsArray["italic-suffix"];
} elseif (!empty($row['publication'])) {
// publication (= journal) name
$record .= " " . $markupPatternsArray["italic-prefix"] . $row['publication'] . $markupPatternsArray["italic-suffix"];
}
if (!empty($row['volume'])) {
if (!empty($row['abbrev_journal']) || !empty($row['publication'])) {
$record .= ".";
}
$record .= " " . $row['volume'];
}
if (!empty($row['issue'])) {
// issue
$record .= "." . $row['issue'];
}
if (!empty($row['year'])) {
$record .= " (" . $row['year'] . ")";
}
if ($row['online_publication'] == "yes") {
// instead of any pages info (which normally doesn't exist for online publications) we append
// an optional string (given in 'online_citation') plus the current date and the DOI (or URL):
$today = date("j M. Y");
if (!empty($row['online_citation'])) {
if (!empty($row['volume']) || !empty($row['issue']) || !empty($row['abbrev_journal']) || !empty($row['publication'])) {
// only add ":" if either volume, issue, abbrev_journal or publication isn't empty
$record .= ":";
}
$record .= " " . $row['online_citation'];
}
if (!empty($row['doi'])) {
if (!empty($row['online_citation']) or empty($row['online_citation']) and !empty($row['volume']) || !empty($row['issue']) || !empty($row['abbrev_journal']) || !empty($row['publication'])) {
// only add "." if online_citation isn't empty, or else if either volume, issue, abbrev_journal or publication isn't empty
$record .= ".";
}
if ($encodeHTML) {
$record .= " " . $today . encodeHTML(" <http://dx.doi.org/" . $row['doi'] . ">");
} else {
$record .= " " . $today . " <http://dx.doi.org/" . $row['doi'] . ">";
}
} elseif (!empty($row['url'])) {
if (!empty($row['online_citation']) or empty($row['online_citation']) and !empty($row['volume']) || !empty($row['issue']) || !empty($row['abbrev_journal']) || !empty($row['publication'])) {
// only add "." if online_citation isn't empty, or else if either volume, issue, abbrev_journal or publication isn't empty
$record .= ".";
}
if ($encodeHTML) {
$record .= " " . $today . encodeHTML(" <" . $row['url'] . ">");
} else {
$record .= " " . $today . " <" . $row['url'] . ">";
}
//.........这里部分代码省略.........
示例5: showLogin
} else {
$skipBadRecords = "";
}
} else {
$sourceText = "";
$showSource = "1";
$importRecordsRadio = "only";
$importRecords = "1";
$skipBadRecords = "";
}
// Show the login status:
showLogin();
// (function 'showLogin()' is defined in 'include.inc.php')
// (2a) Display header:
// call the 'displayHTMLhead()' and 'showPageHeader()' functions (which are defined in 'header.inc.php'):
displayHTMLhead(encodeHTML($officialDatabaseName) . $pageTitle, "index,follow", "Search the " . encodeHTML($officialDatabaseName), "", false, "", $viewType, array());
showPageHeader($HeaderString);
// (2b) Start <form> and <table> holding the form elements:
echo "\n<form action=\"import_csa_modify.php\" method=\"POST\">";
echo "\n<input type=\"hidden\" name=\"formType\" value=\"importCSA\">" . "\n<input type=\"hidden\" name=\"submit\" value=\"Import\">" . "\n<input type=\"hidden\" name=\"showLinks\" value=\"1\">";
// embed '$showLinks=1' so that links get displayed on any 'display details' page
if (isset($errors['badRecords'])) {
if ($errors['badRecords'] == "all") {
if (!empty($errors['skipBadRecords'])) {
$skipBadRecordsInput = "<br>" . fieldError("skipBadRecords", $errors);
} else {
$skipBadRecordsInput = "";
}
} elseif ($errors['badRecords'] == "some") {
if (!empty($skipBadRecords)) {
$skipBadRecordsCheckBoxIsChecked = " checked";
示例6: showPageFooter
function showPageFooter($HeaderString)
{
global $officialDatabaseName;
// usage example: <a href="index.php">[? echo encodeHTML($officialDatabaseName); ?]</a>
global $adminLoginEmail;
global $hostInstitutionAbbrevName;
// usage example: <a href="[? echo $hostInstitutionURL; ?]">[? echo encodeHTML($hostInstitutionAbbrevName); ?] Home</a>
global $hostInstitutionName;
// (note: in the examples above, square brackets must be replaced by their respective angle brackets)
global $hostInstitutionURL;
global $helpResourcesURL;
global $librarySearchPattern;
global $loginWelcomeMsg;
// these variables are globally defined in function 'showLogin()' in 'include.inc.php'
global $loginStatus;
global $loginLinks;
global $loginEmail;
global $loc;
// '$loc' is made globally available in 'core.php'
?>
<table class="pagefooter" align="center" border="0" cellpadding="0" cellspacing="10" width="95%" summary="This table holds the footer">
<tr>
<td class="small" width="105"><a href="index.php"<?php
echo addAccessKey("attribute", "home");
?>
title="<?php
echo $loc["LinkTitle_Home"] . addAccessKey("title", "home");
?>
"><?php
echo $loc["Home"];
?>
</a></td>
<td class="small" align="center"><?php
// -------------------------------------------------------
// ... include a link to 'opensearch.php':
?>
<a href="opensearch.php"<?php
echo addAccessKey("attribute", "cql_search");
?>
title="<?php
echo $loc["LinkTitle_CQLSearch"] . addAccessKey("title", "cql_search");
?>
"><?php
echo $loc["CQLSearch"];
?>
</a><?php
// -------------------------------------------------------
if (isset($_SESSION['user_permissions']) and preg_match("/allow_sql_search/", $_SESSION['user_permissions'])) {
// ... include a link to 'sql_search.php':
?>
|
<a href="sql_search.php"<?php
echo addAccessKey("attribute", "sql_search");
?>
title="<?php
echo $loc["LinkTitle_SQLSearch"] . addAccessKey("title", "sql_search");
?>
"><?php
echo $loc["SQLSearch"];
?>
</a><?php
}
// -------------------------------------------------------
if (!empty($librarySearchPattern)) {
// ... include a link to 'library_search.php':
?>
|
<a href="library_search.php"<?php
echo addAccessKey("attribute", "lib_search");
?>
title="<?php
echo $loc["LinkTitle_LibrarySearch_Prefix"] . encodeHTML($hostInstitutionName) . $loc["LinkTitle_LibrarySearch_Suffix"] . addAccessKey("title", "lib_search");
?>
"><?php
echo $loc["LibrarySearch"];
?>
</a><?php
}
// -------------------------------------------------------
if (isset($_SESSION['user_permissions']) and preg_match("/allow_details_view/", $_SESSION['user_permissions'])) {
// ... include a link to 'show.php':
?>
|
<a href="show.php"<?php
echo addAccessKey("attribute", "show_rec");
?>
title="<?php
echo $loc["LinkTitle_ShowRecord"] . addAccessKey("title", "show_rec");
?>
"><?php
echo $loc["ShowRecord"];
?>
</a><?php
}
// -------------------------------------------------------
//.........这里部分代码省略.........
示例7: showUsers
//.........这里部分代码省略.........
// call the 'buildFieldNameLinks()' function (defined in 'include.inc.php'), which will return a properly formatted table header tag holding the current field's name
// as well as the URL encoded query with the appropriate ORDER clause:
$tableHeaderLink = buildFieldNameLinks("users.php", $query, "", $result, $i, $showQuery, $showLinks, $rowOffset, $showRows, "1", $defaultCiteStyle, $HTMLbeforeLink, $HTMLafterLink, "sqlSearch", $displayType, "", "", "", $viewType);
echo $tableHeaderLink;
// print the attribute name as link
}
if ($showLinks == "1") {
$newORDER = "ORDER BY user_id";
// Build the appropriate ORDER BY clause to facilitate sorting by Links column
$HTMLbeforeLink = "\n\t<th align=\"left\" valign=\"top\">";
// start the table header tag
$HTMLafterLink = "</th>";
// close the table header tag
// call the 'buildFieldNameLinks()' function (defined in 'include.inc.php'), which will return a properly formatted table header tag holding the current field's name
// as well as the URL encoded query with the appropriate ORDER clause:
$tableHeaderLink = buildFieldNameLinks("users.php", $query, $newORDER, $result, $i, $showQuery, $showLinks, $rowOffset, $showRows, "1", $defaultCiteStyle, $HTMLbeforeLink, $HTMLafterLink, "sqlSearch", $displayType, $loc["Links"], "user_id", "", $viewType);
echo $tableHeaderLink;
// print the attribute name as link
}
// Finish the row
echo "\n</tr>";
// END RESULTS HEADER ----------------------
// display default user
echo "<tr class=\"odd\">";
echo "<td align=\"left\" valign=\"top\" width=\"10\"><input DISABLED type=\"checkbox\"</td>";
echo "<td valign=\"top\"colspan=2>Account options for anyone who isn't logged in</td>";
echo "<td valign=\"top\">-</td><td valign=\"top\">-</td><td valign=\"top\">-</td><td valign=\"top\">-</td>";
echo "<td><a href=\"user_options.php?userID=0" . "\"><img src=\"img/options.gif\" alt=\"" . $loc["options"] . "\" title=\"" . $loc["LinkTitle_EditOptions"] . "\" width=\"11\" height=\"17\" hspace=\"0\" border=\"0\"></a></td>";
echo "</tr>";
// BEGIN RESULTS DATA COLUMNS --------------
for ($rowCounter = 0; $rowCounter < $showRows && ($row = @mysql_fetch_array($result)); $rowCounter++) {
if (is_integer($rowCounter / 2)) {
// if we currently are at an even number of rows
$rowClass = "even";
} else {
$rowClass = "odd";
}
// ... start a TABLE ROW ...
echo "\n<tr class=\"" . $rowClass . "\">";
// ... print a column with a checkbox
if (!preg_match("/^(Print|Mobile)\$/i", $viewType)) {
// Note: we omit the marker column in print/mobile view! ('viewType=Print' or 'viewType=Mobile')
echo "\n\t<td align=\"left\" valign=\"top\" width=\"10\"><input type=\"checkbox\" name=\"marked[]\" value=\"" . $row["user_id"] . "\"></td>";
}
// ... and print out each of the attributes
// in that row as a separate TD (Table Data)
for ($i = 0; $i < $fieldsToDisplay; $i++) {
// fetch the current attribute name:
$orig_fieldname = getMySQLFieldInfo($result, $i, "name");
// function 'getMySQLFieldInfo()' is defined in 'include.inc.php'
if (preg_match("/^email\$/", $orig_fieldname)) {
echo "\n\t<td valign=\"top\"><a href=\"mailto:" . $row["email"] . "\">" . $row["email"] . "</a></td>";
} elseif (preg_match("/^url\$/", $orig_fieldname) and !empty($row["url"])) {
echo "\n\t<td valign=\"top\"><a href=\"" . $row["url"] . "\">" . $row["url"] . "</a></td>";
} else {
echo "\n\t<td valign=\"top\">" . encodeHTML($row[$i]) . "</td>";
}
}
// embed appropriate links (if available):
if ($showLinks == "1") {
echo "\n\t<td valign=\"top\">";
echo "\n\t\t<a href=\"user_receipt.php?userID=" . $row["user_id"] . "\"><img src=\"img/details.gif\" alt=\"" . $loc["details"] . "\" title=\"" . $loc["LinkTitle_ShowDetailsAndOptions"] . "\" width=\"9\" height=\"17\" hspace=\"0\" border=\"0\"></a> ";
echo "\n\t\t<a href=\"user_details.php?userID=" . $row["user_id"] . "\"><img src=\"img/edit.gif\" alt=\"" . $loc["edit"] . "\" title=\"" . $loc["LinkTitle_EditDetails"] . "\" width=\"11\" height=\"17\" hspace=\"0\" border=\"0\"></a> ";
echo "\n\t\t<a href=\"user_options.php?userID=" . $row["user_id"] . "\"><img src=\"img/options.gif\" alt=\"" . $loc["options"] . "\" title=\"" . $loc["LinkTitle_EditOptions"] . "\" width=\"11\" height=\"17\" hspace=\"0\" border=\"0\"></a> ";
$adminUserID = getUserID($adminLoginEmail);
// ...get the admin's 'user_id' using his/her 'adminLoginEmail' (function 'getUserID()' is defined in 'include.inc.php')
if ($row["user_id"] != $adminUserID) {
// we only provide a delete link if this user isn't the admin:
echo "\n\t\t<a href=\"user_receipt.php?userID=" . $row["user_id"] . "&userAction=Delete" . "\"><img src=\"img/delete.gif\" alt=\"" . $loc["delete"] . "\" title=\"" . $loc["LinkTitle_DeleteUser"] . "\" width=\"11\" height=\"17\" hspace=\"0\" border=\"0\"></a>";
}
echo "\n\t</td>";
}
// Finish the row
echo "\n</tr>";
}
// Then, finish the table
echo "\n</table>";
// END RESULTS DATA COLUMNS ----------------
// BEGIN RESULTS FOOTER --------------------
// Note: we omit the results footer in print/mobile view! ('viewType=Print' or 'viewType=Mobile')
if (!preg_match("/^(Print|Mobile)\$/i", $viewType)) {
// Again, insert the (already constructed) BROWSE LINKS
// (i.e., a TABLE with links for "previous" & "next" browsing, as well as links to intermediate pages)
echo $BrowseLinks;
// Insert a divider line (which separates the results data from the results footer):
echo "\n<hr class=\"resultsfooter\" align=\"center\" width=\"93%\">";
// Build a TABLE containing rows with buttons which will trigger actions that act on the selected users
// Call the 'buildUserResultsFooter()' function (which does the actual work):
$userResultsFooter = buildUserResultsFooter($NoColumns);
echo $userResultsFooter;
}
// END RESULTS FOOTER ----------------------
// Finally, finish the form
echo "\n</form>";
} else {
// Report that nothing was found:
echo "\n<table id=\"error\" class=\"results\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"10\" width=\"95%\" summary=\"This table displays users of this database\">" . "\n<tr>" . "\n\t<td valign=\"top\">Sorry, but your query didn't produce any results! <a href=\"javascript:history.back()\">Go Back</a></td>" . "\n</tr>" . "\n</table>";
}
// end if $rowsFound body
}
示例8: encodeHTML
echo "\n<tr>" . "\n\t<td width=\"74\" class=\"otherfieldsbg\"> </td>" . "\n\t<td colspan=\"3\" class=\"otherfieldsbg\">\n\t\t<input type=\"checkbox\" id=\"onlinePublicationCheckBox\" name=\"onlinePublicationCheckBox\" value=\"1\"{$onlinePublicationCheckBoxIsChecked} title=\"" . $loc["DescriptionOnlinePublicationCheckbox"] . "\"> " . "\n\t\t" . $loc["Online publication. Cite with this text:"] . " " . "\n\t\t<input type=\"text\" id=\"onlineCitationName\" name=\"onlineCitationName\" value=\"{$onlineCitationName}\" size=\"7\" title=\"" . $loc["DescriptionOnlinePublicationCitation"] . "\">" . $onlineCitationSuggestElements . "\n\t</td>";
if (isset($loginEmail)) {
// ...we'll show a checkbox where the user can state that the current publication stems form his own institution
if ($contributionIDCheckBox == "1" or preg_match("/{$abbrevInstitution}/", $contributionID)) {
// if the '$contributionIDCheckBox' variable is set to 1 -OR- if the currrent user's abbreviated institution name is listed within the 'contribution_id' field
$contributionIDCheckBoxIsChecked = " checked";
} else {
$contributionIDCheckBoxIsChecked = "";
}
if ($origRecord > 0) {
// if the current record has been identified as duplicate entry...
$contributionIDCheckBoxLock = " disabled";
} else {
$contributionIDCheckBoxLock = "";
}
echo "\n\t<td colspan=\"2\" class=\"otherfieldsbg\">\n\t\t<input type=\"checkbox\" id=\"contributionIDCheckBox\" name=\"contributionIDCheckBox\" value=\"1\"{$contributionIDCheckBoxIsChecked} title=\"" . $loc["DescriptionOwnPublication"] . "\"{$contributionIDCheckBoxLock}> " . "\n\t\t" . encodeHTML($abbrevInstitution) . " " . $loc["publication"] . "\n\t</td>";
// we make use of the session variable '$abbrevInstitution' here
} else {
echo "\n\t<td colspan=\"2\" class=\"otherfieldsbg\"> </td>";
}
echo "\n</tr>" . "\n<tr>" . "\n\t<td width=\"74\"> </td>" . "\n\t<td colspan=\"5\"> </td>" . "\n</tr>";
echo "\n<tr>" . "\n\t<td width=\"74\">" . $loc["Location Field"] . ":</td>";
$locationSelector = "\n\t<td colspan=\"3\">\n\t\t<select id=\"locationSelectorName\" name=\"locationSelectorName\" title=\"" . $loc["DescriptionLocationSelector"] . "\">\n\t\t\t<option value=\"don't touch\">" . $loc["don't touch"] . "</option>\n\t\t\t<option value=\"add\">" . $loc["add"] . "</option>\n\t\t\t<option value=\"remove\">" . $loc["remove"] . "</option>\n\t\t</select> \n\t\t" . $loc["my name & email address"] . "\n\t</td>";
if ($recordAction == "edit" and !empty($locationSelectorName)) {
$locationSelector = preg_replace("/<option(.*?)>" . $loc[$locationSelectorName] . "/", "<option\\1 selected>" . $loc[$locationSelectorName], $locationSelector);
} elseif ($recordAction == "add") {
$locationSelector = preg_replace("/<option(.*?)>" . $loc["add"] . "/", "<option\\1 selected>" . $loc["add"], $locationSelector);
// select the appropriate menu entry ...
if (!isset($loginEmail) or isset($loginEmail) and $loginEmail != $adminLoginEmail) {
// ... and if the user isn't logged in -OR- any normal user is logged in (not the admin) ...
$locationSelector = preg_replace("/<select/i", "<select disabled", $locationSelector);
示例9: displayHTMLhead
displayHTMLhead(encodeHTML($officialDatabaseName) . " -- Query History", "noindex,nofollow", "Displays links to previous search results", "", false, "", $viewType, array());
if (!preg_match("/^(Print|Mobile)\$/i", $viewType)) {
// Note: we omit the visible header in print/mobile view ('viewType=Print' or 'viewType=Mobile')
showPageHeader($HeaderString);
}
echo "\n";
}
// (4b) DISPLAY results:
echo "<div id=\"queryhistory\">";
// Print a link to the current query:
if (!empty($oldQuery)) {
echo "\n\t<div id=\"currentquery\">" . "\n\t\t<h5>Current Query</h5>";
// Extract the 'WHERE' clause from the current SQL query:
$queryWhereClause = extractWHEREclause($oldQuery["sqlQuery"]);
// function 'extractWHEREclause()' is defined in 'include.inc.php'
$queryTitle = encodeHTML(explainSQLQuery($queryWhereClause));
// functions 'encodeHTML()' and 'explainSQLQuery()' are defined in 'include.inc.php'
// Generate a 'search.php' URL that points to the current query:
$queryURL = generateURL("search.php", "html", $oldQuery, true);
// function 'generateURL()' is defined in 'include.inc.php'
echo "\n\t\t<div class=\"even\">" . "\n\t\t\t<a href=\"" . $queryURL . "\">" . $queryTitle . "</a>" . "\n\t\t</div>" . "\n\t</div>";
}
// Print links to any previous search results:
if (!empty($queryHistory)) {
echo "\n\t<div id=\"previousqueries\">" . "\n\t\t<h5>Previous Queries</h5>";
$queryHistory = array_reverse($queryHistory);
// Display links to previous search results:
for ($i = 0; $i < count($queryHistory); $i++) {
if (is_integer($i / 2)) {
// if we currently are at an even number of rows
$rowClass = "even";
示例10: displayHTMLhead
// (function 'showLogin()' is defined in 'include.inc.php')
// (4a) DISPLAY header:
// call the 'displayHTMLhead()' and 'showPageHeader()' functions (which are defined in 'header.inc.php'):
displayHTMLhead(encodeHTML($officialDatabaseName) . " -- Error", "noindex,nofollow", "Feedback page that shows any error that occurred while using the " . encodeHTML($officialDatabaseName), "", false, "", $viewType, array());
showPageHeader($HeaderString);
// Generate a 'search.php' URL that points to the formerly displayed results page:
if (!empty($oldQuery)) {
$oldQueryURL = generateURL("search.php", "html", $oldQuery, true);
}
// function 'generateURL()' is defined in 'include.inc.php'
// Build appropriate links:
$links = "\n<tr>" . "\n\t<td>" . "\n\t\tChoose how to proceed: ";
// - provide a 'go back' link (the following would only work with javascript: <a href=\"javascript:history.back()\">Go Back</a>")
$links .= "\n\t\t<a href=\"" . str_replace('&', '&', $referer) . "\">Go Back</a>";
// variable '$referer' is globally defined in function 'start_session()' in 'include.inc.php'
// - provide a link to any previous search results:
if (!empty($oldQuery)) {
$links .= "\n\t\t -OR- " . "\n\t\t<a href=\"" . $oldQueryURL . "\">Display previous search results</a>";
}
// - we also include a link to the home page here:
$links .= "\n\t\t -OR- " . "\n\t\t<a href=\"index.php\">Goto " . encodeHTML($officialDatabaseName) . " Home</a>" . "\n\t</td>" . "\n</tr>";
// SHOW ERROR MESSAGE:
echo "\n<table class=\"error\" align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"10\" width=\"95%\">\n<tr>\n\t<td valign=\"top\"> Error " . $errorNo . " : <b>" . encodeHTML($errorMsg) . "</b>" . "</td>\n</tr>" . $links . "\n</table>";
// --------------------------------------------------------------------
// DISPLAY THE HTML FOOTER:
// call the 'showPageFooter()' and 'displayHTMLfoot()' functions (which are defined in 'footer.inc.php')
showPageFooter($HeaderString);
displayHTMLfoot();
// --------------------------------------------------------------------
exit;
// die
示例11: ob_start
// Repository: $HeadURL: http://svn.code.sf.net/p/refbase/code/trunk/locales/core.php $
// Author(s): Jochen Wendebaum <mailto:wendebaum@users.sourceforge.net>
//
// Created: 01-Oct-04, 12:00
// Modified: $Date: 2007-02-16 17:10:14 -0800 (Fri, 16 Feb 2007) $
// $Author: msteffens $
// $Revision: 894 $
// Get filename:
if ($contentTypeCharset == "UTF-8") {
// variable '$contentTypeCharset' is defined in 'ini.inc.php'
$f = "locales/" . $locale . "/common_utf8.inc";
} else {
$f = "locales/" . $locale . "/common.inc";
}
// Get locales:
ob_start();
readfile($f);
// read the file contents
$s = "\$loc=array(" . ob_get_contents() . ");";
eval($s);
// ...and store everything into $loc
ob_end_clean();
// HTML encode higher ASCII characters in locales:
foreach ($loc as $locKey => $locValue) {
$loc[$locKey] = encodeHTML($locValue);
// function 'encodeHTML()' is defined in 'include.inc.php'
if (preg_match("/<a href=".+?">.+?<\\/a>/", $loc[$locKey])) {
// dirty hack to allow URLs within (otherwise HTML encoded) locales
$loc[$locKey] = preg_replace("/<a href="(.+?)">(.+?)<\\/a>/", "<a href=\"\\1\">\\2</a>", $loc[$locKey]);
}
}
示例12: encodeField
function encodeField($fieldName, $fieldValue, $localSearchReplaceActionsArray = array(), $encodingExceptionsArray = array(), $encode = true, $targetFormat = "HTML")
{
global $contentTypeCharset;
// these variables are defined in 'ini.inc.php'
global $convertExportDataToUTF8;
global $searchReplaceActionsArray;
if ($encode and !in_array($fieldName, $encodingExceptionsArray)) {
if ($targetFormat == "HTML") {
// Encode non-ASCII chars as HTML entities:
$fieldValue = encodeHTML($fieldValue);
} elseif ($targetFormat == "XML") {
// Only convert those special chars to entities which are supported by XML:
$fieldValue = encodeHTMLspecialchars($fieldValue);
// Convert field data to UTF-8:
if ($convertExportDataToUTF8 == "yes" and $contentTypeCharset != "UTF-8") {
$fieldValue = convertToCharacterEncoding("UTF-8", "IGNORE", $fieldValue);
}
}
}
// Apply *locally* defined search & replace 'actions' to all fields that are listed
// in the 'fields' element of the arrays contained in '$localSearchReplaceActionsArray':
foreach ($localSearchReplaceActionsArray as $fieldActionsArray) {
if (in_array($fieldName, $fieldActionsArray['fields'])) {
$fieldValue = searchReplaceText($fieldActionsArray['actions'], $fieldValue, true);
}
}
if ($targetFormat == "HTML") {
// Apply *globally* defined search & replace 'actions' to all fields that are listed
// in the 'fields' element of the arrays contained in '$searchReplaceActionsArray':
foreach ($searchReplaceActionsArray as $fieldActionsArray) {
if (in_array($fieldName, $fieldActionsArray['fields'])) {
$fieldValue = searchReplaceText($fieldActionsArray['actions'], $fieldValue, true);
}
}
}
return $fieldValue;
}
示例13: original
" size="10" title="enter the serial number of the original (master) record">
</td>
</tr>
<tr>
<td width="120">
<div class="sect"><?php
echo $loc["Duplicates"];
?>
:</div>
</td>
<td><?php
echo fieldError("dupRecords", $errors);
?>
<input type="text" name="dupRecords" value="<?php
echo encodeHTML($dupRecords);
?>
" size="50" title="enter the serial number(s) of all records that are duplicate entries of the above specified record; separate multiple serials with any non-digit characters">
</td>
</tr>
<tr>
<td> </td>
<td>
<input type="submit" name="submit" value="Flag Duplicates" title="mark the given records as original/duplicate entries">
</td>
</tr>
</table>
<table class="showhide" align="center" border="0" cellpadding="0" cellspacing="10" width="95%">
<tr>
<td class="small" width="120" valign="top">
<a href="javascript:toggleVisibility('helptxt','helpToggleimg','helpToggletxt','<?php
示例14: connectToMySQLDatabase
exit;
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> !EXIT! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
} else {
connectToMySQLDatabase();
// function 'connectToMySQLDatabase()' is defined in 'include.inc.php'
// CONSTRUCT SQL QUERY:
// Fetch all saved settings for the user's query from the 'queries' table:
$query = "SELECT query_id, display_type, view_type, query, show_query, show_links, show_rows, cite_style_selector, cite_order FROM {$tableQueries} WHERE user_id = " . quote_smart($loginUserID) . " AND query_name = " . quote_smart($querySearchSelector);
// the global variable '$loginUserID' gets set in function 'start_session()' within 'include.inc.php'
$result = queryMySQLDatabase($query);
// RUN the query on the database through the connection (function 'queryMySQLDatabase()' is defined in 'include.inc.php')
$rowsFound = @mysql_num_rows($result);
if ($rowsFound == 1) {
$row = mysql_fetch_array($result);
// redirect the browser to 'query_manager.php':
if (encodeHTML($submitAction) == $loc["ButtonTitle_Edit"]) {
header("Location: query_manager.php?queryAction=edit&queryID=" . $row['query_id']);
exit;
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> !EXIT! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
}
} else {
if ($rowsFound > 1) {
// if there were more than one row found ...
$HeaderString = "<b><span class=\"warning\">There's more than one saved query matching your query title!</span></b>";
} else {
// if ($rowsFound == 0) // nothing found
$HeaderString = "<b><span class=\"warning\">Your saved query couldn't be found!</span></b>";
}
// update the 'userQueries' session variable:
getUserQueries($loginUserID);
// function 'getUserQueries()' is defined in 'include.inc.php'
示例15: citeRecord
function citeRecord($row, $citeStyle, $citeType, $markupPatternsArray, $encodeHTML)
{
$record = "";
// make sure that our buffer variable is empty
// --- BEGIN TYPE = JOURNAL ARTICLE / MAGAZINE ARTICLE / NEWSPAPER ARTICLE --------------------------------------------------------------
if (preg_match("/^(Journal Article|Magazine Article|Newspaper Article)\$/", $row['type'])) {
if (!empty($row['author'])) {
// Call the 'reArrangeAuthorContents()' function (defined in 'include.inc.php') in order to re-order contents of the author field. Required Parameters:
// 1. input: contents of the author field
// 2. input: boolean value that specifies whether the author's family name comes first (within one author) in the source string
// ('true' means that the family name is followed by the given name (or initials), 'false' if it's the other way around)
//
// 3. input: pattern describing old delimiter that separates different authors
// 4. output: for all authors except the last author: new delimiter that separates different authors
// 5. output: for the last author: new delimiter that separates the last author from all other authors
//
// 6. input: pattern describing old delimiter that separates author name & initials (within one author)
// 7. output: for the first author: new delimiter that separates author name & initials (within one author)
// 8. output: for all authors except the first author: new delimiter that separates author name & initials (within one author)
// 9. output: new delimiter that separates multiple initials (within one author)
// 10. output: for the first author: boolean value that specifies if initials go *before* the author's name ['true'], or *after* the author's name ['false'] (which is the default in the db)
// 11. output: for all authors except the first author: boolean value that specifies if initials go *before* the author's name ['true'], or *after* the author's name ['false'] (which is the default in the db)
// 12. output: boolean value that specifies whether an author's full given name(s) shall be shortened to initial(s)
//
// 13. output: if the total number of authors is greater than the given number (integer >= 1), only the number of authors given in (14) will be included in the citation along with the string given in (15); keep empty if all authors shall be returned
// 14. output: number of authors (integer >= 1) that is included in the citation if the total number of authors is greater than the number given in (13); keep empty if not applicable
// 15. output: string that's appended to the number of authors given in (14) if the total number of authors is greater than the number given in (13); the actual number of authors can be printed by including '__NUMBER_OF_AUTHORS__' (without quotes) within the string
//
// 16. output: boolean value that specifies whether the re-ordered string shall be returned with higher ASCII chars HTML encoded
$author = reArrangeAuthorContents($row['author'], true, "/ *; */", ", ", " " . $markupPatternsArray["ampersand"] . " ", "/ *, */", ", ", ", ", ".", false, false, true, "4", "1", " et al", $encodeHTML);
// 16.
$record .= $author;
}
if (!empty($row['year'])) {
if (!empty($row['author'])) {
$record .= ", ";
}
if (!empty($row['year'])) {
$record .= $row['year'];
}
}
if (!empty($row['title'])) {
if (!empty($row['author']) || !empty($row['year'])) {
$record .= ". ";
}
$record .= $row['title'];
$record .= ",";
}
// From here on we'll assume that at least one of the fields 'author', 'year' or 'title' did contain some contents
if (!empty($row['publication'])) {
// publication (= journal) name
$record .= " " . $markupPatternsArray["italic-prefix"] . $row['publication'] . $markupPatternsArray["italic-suffix"];
} elseif (!empty($row['abbrev_journal'])) {
// abbreviated journal name
$record .= " " . $markupPatternsArray["italic-prefix"] . $row['abbrev_journal'] . $markupPatternsArray["italic-suffix"];
}
if ((!empty($row['abbrev_journal']) || !empty($row['publication'])) && (!empty($row['volume']) || !empty($row['issue']))) {
$record .= ",";
}
// NOTE: for newspaper articles, the above mentioned guide uses a dot instead of a comma ("The Times, 3 Sep. p.4-5.") but this seems incorrect/inconsistent to me
if ($row['online_publication'] == "yes") {
// this record refers to an online publication
$record .= " [Online]";
}
if ($row['type'] == "Journal Article") {
if (!empty($row['volume'])) {
// volume
$record .= " " . $row['volume'];
}
if (!empty($row['issue'])) {
if (!empty($row['volume'])) {
$record .= " ";
}
$record .= "(" . $row['issue'] . ")";
}
} elseif (preg_match("/^(Newspaper Article|Magazine Article)\$/", $row['type'])) {
if (!empty($row['issue'])) {
// issue (=day)
$record .= " " . $row['issue'];
}
if (!empty($row['volume'])) {
// volume (=month)
$record .= " " . $row['volume'];
}
}
if (!empty($row['pages'])) {
if (!empty($row['volume']) || !empty($row['issue']) || !empty($row['abbrev_journal']) || !empty($row['publication'])) {
// only add ", " if either volume, issue, abbrev_journal or publication isn't empty
$record .= ", ";
}
$record .= formatPageInfo($row['pages'], $markupPatternsArray["endash"], "p. ", "p. ");
// function 'formatPageInfo()' is defined in 'cite.inc.php' (NOTE: from the examples in the above mentioned guide it's unclear whether "p." should be followed by a space or not)
}
if ($row['online_publication'] == "yes") {
// append an optional string (given in 'online_citation') plus the current date and the DOI (or URL):
if (!empty($row['online_citation'])) {
if (!empty($row['volume']) || !empty($row['issue']) || !empty($row['abbrev_journal']) || !empty($row['publication'])) {
// only add "," if either volume, issue, abbrev_journal or publication isn't empty
$record .= ",";
}
//.........这里部分代码省略.........