Dear Alec,
thank you for your quick respond, this information helps me in understanding and solving the problem.
I see the PKPAnnouncementDAO.inc.php and I have found several clauses that read ORDER BY announcement_id DESC; just to be sure to act correctly, may you confirm that I must change each of them to ORDER BY date_posted DESC?
In details:
function &getByAssocId($assocType, $assocId, $rangeInfo = null) {
$result =& $this->retrieveRange(
'SELECT *
FROM announcements
WHERE assoc_type = ? AND assoc_id = ?
ORDER BY announcement_id DESC',
array((int) $assocType, (int) $assocId),
$rangeInfo
function &getByTypeId($typeId, $rangeInfo = null) {
$result =& $this->retrieveRange(
'SELECT * FROM announcements WHERE type_id = ? ORDER BY announcement_id DESC',
(int) $typeId,
$rangeInfo
);
function &getNumAnnouncementsByAssocId($assocType, $assocId, $numAnnouncements, $rangeInfo = null) {
$result =& $this->retrieveRange(
'SELECT *
FROM announcements
WHERE assoc_type = ?
AND assoc_id = ?
ORDER BY announcement_id DESC LIMIT ?',
array((int) $assocType, (int) $assocId, (int) $numAnnouncements),
$rangeInfo
);
function &getAnnouncementsNotExpiredByAssocId($assocType, $assocId, $rangeInfo = null) {
$result =& $this->retrieveRange(
'SELECT *
FROM announcements
WHERE assoc_type = ?
AND assoc_id = ?
AND (date_expire IS NULL OR DATE(date_expire) > CURRENT_DATE)
AND (DATE(date_posted) <= CURRENT_DATE)
ORDER BY announcement_id DESC',
array((int) $assocType, (int) $assocId),
$rangeInfo
);
function &getNumAnnouncementsNotExpiredByAssocId($assocType, $assocId, $numAnnouncements, $rangeInfo = null) {
$result =& $this->retrieveRange(
'SELECT *
FROM announcements
WHERE assoc_type = ?
AND assoc_id = ?
AND (date_expire IS NULL OR DATE(date_expire) > CURRENT_DATE)
AND (DATE(date_posted) <= CURRENT_DATE)
ORDER BY announcement_id DESC LIMIT ?',
array((int) $assocType, (int) $assocId, (int) $numAnnouncements),
$rangeInfo
);
function &getMostRecentPublishedAnnouncementByAssocId($assocType, $assocId) {
$result =& $this->retrieve(
'SELECT *
FROM announcements
WHERE assoc_type = ?
AND assoc_id = ?
AND (date_expire IS NULL OR DATE(date_expire) > CURRENT_DATE)
AND (DATE(date_posted) <= CURRENT_DATE)
ORDER BY announcement_id DESC LIMIT 1',
array((int) $assocType, (int) $assocId)
);
Thanks again for your kind support.
Best regards
logo nuova cultura giallo.png
Edizioni Nuova Cultura
Chiara Mastrantonio
Uff. Comunicazione
T e F (+39) 06 89566851
http://www.nuovacultura.it/ www.nuovacultura.it
download cid:image002.jpg@01D25A1A.DC16D8A0
Ai sensi del D. Lgs n. 196 del 30.06.03 si precisa che le informazioni contenute in questo messaggio sono riservate e ad uso esclusivo del destinatario. Qualora il messaggio in parola Le fosse pervenuto per errore, La preghiamo di eliminarlo senza copiarlo e di non inoltrarlo a terzi, dandocene gentilmente comunicazione. Grazie
This message, for the D. Lgs n. 196 / 30.06.03, may contain confidential and/or privileged informations. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for cooperation.


