vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   unapproved vs unread messages (https://vborg.vbsupport.ru/showthread.php?t=279728)

tmatrix 03-08-2012 03:17 AM

unapproved vs unread messages
 
Hello,

I'm hoping that someone here could tell me how to tell the difference in the database between an unapproved message and an unread message. For example group messages and visitor messages both have the unread and unapproved messages. How can one tell from poking inside the database which is which.

Thank you incredibly much.
Cheers
Murias

kh99 03-08-2012 08:40 PM

In the visitormessage table, the state column is either 'visible', 'moderation', or 'deleted', so if it's 'moderation' then it hasn't been approved. There's also a 'messageread' column that's either 0 or 1.

It looks like groupmessage has the same state column, but for "has read" there's a groupread table that has a record for each user and group with the last time that user read that group, so I suppose you'd have to compare the message timestamp with the "readtime" for a given userid/groupid.

tmatrix 03-09-2012 05:31 AM

Wish to thank you greatly for this information. It has done an incredible amount in my understanding of the db and how vB works under the hood.

I'm working on getting certain notifications from vBulletin into another site, so users could be aware, then have a suitable link to follow.

I was looking at the groupmessage table, trying to link it to the social group's owner. Linking discussionid to the discussion table, which then provides a groupid. Linking to the socialgroup table where I can get the creatoruserid (moderator/owner of group). Yeah! But.. I saw in both of those tables (discussion and socialgroup) there is a column "modereration", along with visible and deleted. How are these columns used in the discussion and socialgroup tables. I attempted to do the math for some various groups, it does not add up.

Thank you again,
Cheers
Murias


All times are GMT. The time now is 06:52 AM.

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.01316 seconds
  • Memory Usage 1,708KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete