PDA

View Full Version : vBJournal Lite enhancements


sabret00the
11-25-2003, 09:12 PM
// display 3 entries per users on most recent entries panel
$j_limit = e.userid = u.userid AND e.userid = j.userid LIMIT 3

$journal_recent_entries = $DB_site->query("SELECT j.enabled, u.username, e.journalid, e.title, e.entry, e.timestamp, e.userid
FROM journal_entry e, journal j, user u
WHERE $j_limit
AND e.private = 0 AND j.enabled = 1
ORDER BY e.timestamp DESC
LIMIT 23");
// find comments per journal entry for most recent entries panel

$j_comments = $DB_site->query_first("SELECT COUNT(commentid) FROM journal_comments where journalid = $journalid AND WHERE e.entry = e.title");

$ jl_comments = if($j_comments = 1){
echo("$j_comments comment")
} else if($j_comments >= 2) {
echo("$j_comments comments") {
else{
echo("")
};

could you please help me to get this to work and tell me where i've gone wrong on my train of thought please :)

MindTrix
11-28-2003, 10:03 PM
} else if($j_comments >= 2) {

should be elseif (you made the same mistake in your other post ;) )

Lol me a php newbie :)