OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Version 1.x - Policies.php - Sugestion

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

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.

Version 1.x - Policies.php - Sugestion

Postby ramon » Mon Dec 05, 2005 7:54 am

Dear OJSers,

On version 1.x, whenever a new item is added, its link on the ojs/policies.php page is not added, even though the content is.

There are many ways to implement this, but this is the way I did it. It adds another select, but keeps things cleaner to read...

Near line 53, add:
Code: Select all
<?
//added
// printing additional titles
//added
// select additional link titles
$links = $db->query("SELECT chTitle FROM tblaboutjournal ORDER BY chTitle");
for($i=0, $max=$db->num_rows($links); $i<$max; $i++) {
  $link = $db->assoc_array($links, $i);
?>
<a href="#other_<?php echo $i+1 ?>"><?php echo stripslashes($link[chTitle]) ?></a><br />
<?
}
?>


If you want the list of new items to be in alphabetical order, either input them in order in the form, or change the SQL in ojs/policies.php, near line 269, and ojs/about.php, near line 78:

Code: Select all
From
// show additional items
$result = $db->query("SELECT chTitle, chContent FROM tblaboutjournal ORDER BY nItemID");

To
// show additional items
$result = $db->query("SELECT chTitle, chContent FROM tblaboutjournal ORDER BY chTitle");

About.php
From
// show additional items
$result = $db->query("SELECT chTitle FROM tblaboutjournal ORDER BY nItemID");

To
// show additional items
$result = $db->query("SELECT chTitle FROM tblaboutjournal ORDER BY chTitle");
ramon
 
Posts: 945
Joined: Wed Oct 15, 2003 6:15 am
Location: Brasí­lia/DF - Brasil

Return to OJS Development

Who is online

Users browsing this forum: No registered users and 2 guests