i'm just learning how to hack up vbulletin. as you can see in the private messages inbox category is some blank cells. i'm trying to add the date sent and who in the the "last post" cell...like how it is with the forums.
i tried $privatemessage[datesent], and $privatemessage[displayusername] which i took from the official private message page code...but no luck.
could somebody help me?
-Chief Corn
*update* i just realized that you would have to be register to see the private message category...but to give you a visual: it would look like the next main forum category but it says Private Messages and the "sub-forum" is called Inbox. the cells next to it are blank...
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
$privatemessage=$DB_site->query_first("SELECT privatemessage.*, user.username FROM privatemessage LEFT JOIN user ON (user.userid=privatemessage.fromuserid) WHERE userid=$bbuserinfo[userid] LIMIT 1 ORDER BY privatemessageid DESC");
entered it exactly as you typed it...but i get a error page that says:
----------------------------------------
Invalid SQL: SELECT privatemessage.*, user.username FROM privatemessage LEFT JOIN user ON (user.userid=privatemessage.fromuserid) WHERE userid=1 LIMIT 1 ORDER BY privatemessageid DESC
mysql error: You have an error in your SQL syntax near 'ORDER BY privatemessageid DESC' at line 1
mysql error number: 1064
-----------------------------------------
tried it twice...once below that line, and once above it. i'm pretty sure this can be done...and you have it....but possibly a typo somewhere?
---------------------------------
Invalid SQL: SELECT privatemessage.*, user.username FROM privatemessage LEFT JOIN user ON (user.userid=privatemessage.fromuserid) WHERE userid=1 ORDER BY privatemessageid DESC LIMIT 1
mysql error: Column: 'userid' in where clause is ambiguous
mysql error number: 1052
----------------------------------
$privatemessage=$DB_site->query_first("SELECT privatemessage.*, user.username FROM privatemessage LEFT JOIN user ON (user.userid=privatemessage.fromuserid) WHERE user.userid=$bbuserinfo[userid] LIMIT 1 ORDER BY privatemessageid DESC LIMIT 1");
hmm erwin i think asuming userid to PM-table would be better:
PHP Code:
$privatemessage=$DB_site->query_first("SELECT privatemessage.*, user.username FROM privatemessage LEFT JOIN user ON (user.userid=privatemessage.fromuserid) WHERE privatemessage.userid=$bbuserinfo[userid] ORDER BY privatemessageid DESC LIMIT 1");
-----------------------------
Invalid SQL: SELECT privatemessage.*, user.username FROM privatemessage LEFT JOIN user ON (user.userid=privatemessage.fromuserid) WHERE user.userid=1 LIMIT 1 ORDER BY privatemessageid DESC LIMIT 1
mysql error: You have an error in your SQL syntax near 'ORDER BY privatemessageid DESC LIMIT 1' at line 1
mysql error number: 1064
------------------------------