OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



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 http://forum.pkp.sfu.ca

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.

browsing by section

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

Hello,
I suggest a piece of code I created to implement article browsing by sections (if used) for example see http://bibliolinux.cilea.it:7000/demo-ojs/search.php:
*********************
include/function.inc.php
*********************
add
//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;
}

***********
search.php
***********
add to line 52:
case "sectionIndex":
sectionIndex($HTTP_GET_VARS['secID']);
break;

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;
include("include/header.php");

?>
<span class="title"><b><?php echo _tr('SECTION_INDEX')?></b></span><br />
<ul>
<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 }?>
</ul>
<br />
<?php
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">
<?php
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 />
<?php
if (!$section['chIntro']) echo $section['chIntro']."</ br>\n";
if ($secID) {?>
<span class="subtitle"><?php
$sql = "SELECT nArticleID, chMetaTitle, nIssueID, nVolume, nNumber, nYear,
a.dtDatePublished,dtDateHTMLGalleyCreated,dtDatePDFGalleyCreated,
dtDatePostScriptGalleyCreated,fkFilePDFID,fkFilePostScriptID,chHTML,
fkPublishStatusID
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,
$result[nIssueID],$result[nNumber],$result[nVolume],$year,$section[chTitle],
$fkFilePDFID,$fkFilePostScriptID,$dtDateHTMLGalleyCreated,
$dtDatePDFGalleyCreated,$dtDatePostScriptGalleyCreated,
$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:
http://www.aepic.it/docs/ojs/function.inc.php.txt
http://www.aepic.it/docs/ojs/search.php.txt
http://www.aepic.it/docs/ojs/viewissue.php.txt
bollini
 
Posts: 13
Joined: Thu May 27, 2004 5:51 am
Location: Italia

Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: No registered users and 2 guests