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
This forum is meant for general questions about the usability of OJS from an everyday user's perspective: journal managers, authors, and editors are welcome to post questions here, as are librarians and other support staff. We welcome general questions about the role of OJS and how the workflow works, as well as specific function- or user-related questions.

What to do if you have general, workflow or usability questions about OJS:

1. Read the documentation. We've written documentation to cover from OJS basics to system administration and code development, and we encourage you to read it.

2. take a look at the tutorials. We will continue to add tutorials covering OJS basics as time goes on.

3. Post a question. Questions are always welcome here, but if it's a technical question you should probably post to the OJS Technical Support subforum; if you have a development question, try the OJS Development subforum.

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: jfrmgr and 1 guest

cron