In the main page for the journal; we can see:
1- Journal / Journal Description
2- Last Entry
3- Entries
4- Comments
I want to add one column for the last comment in each journal and to join the Entries and Comments columns in one column. I edit the following code in the journal.php form:
PHP Code:
$fjournals = $db->query_read("
### Journal Listing ###
SELECT
journals.lastentry_uids, journals.journal_id, journals.journalname, journals.journaldesc,
journals.journalist, journals.journalist_id, entrycount, commentcount, usertextfield.jbuddylist, ipaddress, journals.lastentry,
journals.lastentry_date, journals.private, journals.whocanview, journals.lastentry_id, journals.status, journals.allowbuddies, journals.journalviews,
journals.journal_totalrating AS totalrating, journals.journal_totalvotes AS totalvotes
FROM " . TABLE_PREFIX . "journals AS journals
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (journals.journalist_id=usertextfield.userid)
WHERE journals.active=1
AND (journals.journalist_id=" . $vbulletin->userinfo['userid'] . " OR journals.private != 1 OR FIND_IN_SET('" . $vbulletin->userinfo['userid'] . "', journals.allowedusers))
ORDER BY $sort $order
LIMIT $start,$perpage
");
To:
PHP Code:
$fjournals = $db->query_read("
### Journal Listing ###
SELECT
journals.lastentry_uids, journals.journal_id, journals.journalname, journals.journaldesc,
journals.journalist, journals.journalist_id, entrycount, commentcount, usertextfield.jbuddylist, journals.ipaddress, journals.lastentry,
journals.lastentry_date, journals.private, journals.whocanview, journals.lastentry_id, journals.status, journals.allowbuddies, journals.journalviews,
journals.journal_totalrating AS totalrating, journals.journal_totalvotes AS totalvotes,
journal_comments.comment_id, journal_comments.journal_id, journal_comments.entry_id,
journal_comments.commenter, journal_comments.commenter_id, journal_comments.comment_title,
journal_comments.comment_date
FROM " . TABLE_PREFIX . "journals AS journals
LEFT JOIN " . TABLE_PREFIX . "usertextfield AS usertextfield ON (journals.journalist_id=usertextfield.userid)
LEFT JOIN " . TABLE_PREFIX . "journal_comments AS journal_comments ON (journal_comments.journal_id=journals.journal_id)
WHERE journals.active=1
AND (journals.journalist_id=" . $vbulletin->userinfo['userid'] . " OR journals.private != 1 OR FIND_IN_SET('" . $vbulletin->userinfo['userid'] . "', journals.allowedusers))
ORDER BY $sort $order
LIMIT $start,$perpage
");
but there is something wrong! Can someone please guide me how to edit the code and the templates?