phpBB integrated in my site.. Needing help with stuff.

The 2.0.x discussion forum has been locked; this will remain read-only. The 3.0.x discussion forum has been renamed phpBB Discussion.
Locked
ChambeRFienD
Registered User
Posts: 39
Joined: Wed Jan 26, 2005 9:41 pm

phpBB integrated in my site.. Needing help with stuff.

Post by ChambeRFienD »

Well, I'm able to show how many new PMs someone has by using $userdata['user_new_privmsg'], but I can't find a way to count total PMs.. New and old.

Also, I'm looking for a way to show additional information within user profiles, and I would like to add a page to the admin section.. If anyone could point me in the right direction I would be greatly appreciative.

ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Post by ckwalsh »

You need a query to the phpbb_privmsgs table in your database looking for messages where the userID is the same as the current username. The number of results you get is the number there are.

ChambeRFienD
Registered User
Posts: 39
Joined: Wed Jan 26, 2005 9:41 pm

Post by ChambeRFienD »

Brainy wrote: You need a query to the phpbb_privmsgs table in your database looking for messages where the userID is the same as the current username. The number of results you get is the number there are.


Using this:

Code: Select all

$userid = $userdata['user_id'];
			$sql_count = mysql_query("SELECT * FROM phpbb_privmsgs WHERE privmsgs_to_userid='$userid'");
			$count = mysql_num_rows($sql_count);
			echo $count;
It says I have 3 PMs instead of 2, which is all I have in my inbox.

ChambeRFienD
Registered User
Posts: 39
Joined: Wed Jan 26, 2005 9:41 pm

Post by ChambeRFienD »

Figured out is has to do with the privmsgs_type column.. If someone could tell me what each type meant I could easily solve this. =P

User avatar
pentapenguin
Former Team Member
Posts: 11030
Joined: Thu Jul 01, 2004 4:15 am
Location: GA, USA

Post by pentapenguin »

Support Resources: Support Request Template
If you need professional assistance with your board, please contact me for my reasonable rates.

ckwalsh
Former Team Member
Posts: 1837
Joined: Wed Mar 15, 2006 1:50 am
Location: Seattle, USA
Name: Cullen Walsh
Contact:

Post by ckwalsh »

From constants.php:

Code: Select all

define('PRIVMSGS_READ_MAIL', 0);
define('PRIVMSGS_NEW_MAIL', 1);
define('PRIVMSGS_SENT_MAIL', 2);
define('PRIVMSGS_SAVED_IN_MAIL', 3);
define('PRIVMSGS_SAVED_OUT_MAIL', 4);
define('PRIVMSGS_UNREAD_MAIL', 5);

Locked

Return to “2.0.x Discussion”