vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Making Private Messages Show on Forum Home... (https://vborg.vbsupport.ru/showthread.php?t=46435)

Chief Corn 12-06-2002 07:25 PM

Making Private Messages Show on Forum Home...
 
here's my forum...
Forum2kTree

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...

Xenon 12-06-2002 09:47 PM

setting up a test account for us would help more i think ;)

also du you just copy the vars into forumhome template, or have you modified index.php (you have to or it cannot work ;))

Chief Corn 12-06-2002 09:53 PM

here's a test account...

username: vbhelp
password: vbhelp

...no i didn't edit the index.php. don't know what to put.

Xenon 12-06-2002 10:03 PM

ahh, that helps :)

well you have to edit index.php

find this code:
PHP Code:

  eval("\$pminfo = \"".gettemplate('forumhome_pmloggedin')."\";"); 

below add:
PHP Code:

$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"); 

now you can use the vars...

Chief Corn 12-06-2002 10:22 PM

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?

-Chief Corn

Erwin 12-06-2002 10:42 PM

Try changing the end of that PHP code from

PHP Code:

ORDER BY privatemessageid DESC"); 

to:

PHP Code:

ORDER BY privatemessageid DESC LIMIT 1"); 


Chief Corn 12-06-2002 11:31 PM

this is the new error... :confused:

---------------------------------
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
----------------------------------

-Chief Corn

Erwin 12-07-2002 06:12 AM

Try this:

PHP Code:

$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"); 


Xenon 12-07-2002 11:27 AM

damn, what hav i done ;)

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"); 


Chief Corn 12-07-2002 01:34 PM

i tried both of those lines and i get:

-----------------------------
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
------------------------------

http://forum.2ktree.com doesn't work anymore...but http://www.2ktree.com/forum does which is strange.

-Chief Corn


All times are GMT. The time now is 10:48 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01093 seconds
  • Memory Usage 1,746KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete