browsing by section

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
The Public Knowledge Project Support Forum is moving to

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
Posts: 13
Joined: Thu May 27, 2004 5:51 am
Location: Italia

browsing by section

Postby bollini » Wed Sep 01, 2004 7:46 am

I suggest a piece of code I created to implement article browsing by sections (if used) for example see
//return if are more section available for view in index
function sectionAvailable(){
global $db;
$sql = "SELECT nSectionID FROM tblsections WHERE bMetaIndex = '1'";
$results = $db->query($sql);
if ($db->num_rows($results)) return true;
else return false;

add to line 52:
case "sectionIndex":

add to line 590:
// show section index
// shows all paper by sections set to display in index
function sectionIndex($secID = 0) {
global $db,$bHTML,$bPDF,$bPostScript;

<span class="title"><b><?php echo _tr('SECTION_INDEX')?></b></span><br />
<li><a href="search.php?op=index"><b><?php echo _tr('AUTHOR_INDEX') ?></b></a></li>
<?php if ($secID) {?><li><a href="search.php?op=sectionIndex"><b><?php echo _tr('SECTION_INDEX') ?></b></a></li><?php }?>
<br />
if ($secID == 0) $sql = "SELECT nSectionID, chTitle, chIntro FROM tblsections WHERE bMetaIndex = '1'ORDER by nRank";
else $sql = "SELECT nSectionID, chTitle, chIntro, bContentsLinkPage FROM tblsections WHERE bMetaIndex = '1' AND nSectionID = '$secID' ORDER by nRank";
$sections = $db->query($sql);
for ($i = 0; $i < $db->num_rows($sections);$i++){
$section = $db->assoc_array($sections,$i);
<span class="subtitle">
if (!$secID) { ?>
<a href="search.php?op=sectionIndex&secID=<?php echo $section['nSectionID']?>">
<b><?php echo $section['chTitle']?></b></a>
<?php }
else echo "<b>".$section['chTitle']."</b>"?>
</span><br />
if (!$section['chIntro']) echo $section['chIntro']."</ br>\n";
if ($secID) {?>
<span class="subtitle"><?php
$sql = "SELECT nArticleID, chMetaTitle, nIssueID, nVolume, nNumber, nYear,
FROM tblarticles AS a, tblissues AS i
WHERE a.fkSectionID = '$secID' AND fkIssueID = nIssueID
AND a.bPublished = '1'
ORDER BY nYear DESC , nVolume DESC , nNumber DESC";
$results = $db->query($sql);
$numresults = $db->num_rows($results);
echo "<ul>\n";
for ($j = 0; $j < $numresults;$j++){
$result = $db->assoc_array($results,$j);
$year = date("Y", strtotime($result[dtDatePublished]));
$bContentsLinkPage = $section[bContentsLinkPage];
$dtDateHTMLGalleyCreated = $result[dtDateHTMLGalleyCreated];
$dtDatePDFGalleyCreated = $result[dtDatePDFGalleyCreated];
$dtDatePostScriptGalleyCreated = $result[dtDatePostScriptGalleyCreated];
$fkFilePDFID = $result[fkFilePDFID];
$fkFilePostScriptID = $result[fkFilePostScriptID];
$chHTML = $result[chHTML];
show_record($result[chMetaTitle], $nArticleID,
$bHTML,$bPDF,$bPostScript,$section[bContentsLinkPage],$result[fkPublishStatusID] != 2,"browsing");
echo "</ul>\n";


NOTE: this function require the architecture solution for display record that I have posted today.
If you want use my solution see:

Return to “OJS Editorial Support and Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest