db table/data question - for anyone? - Another Web Company
ArcadeDownloadsNewslettersForum MenuNavigationWhat AWC OffersWiki ToolsLogin or Create Account

Log in

You must have cookies enabled to log in to Main Site - Local.

 

db table/data question - for anyone?

From Another Web Company

Viewed 457 times, With a total of 4 Posts
Have a suggestion, improvement, change or non-beta Forum Entension bug ? Please add them to the todo list

Gets Around
Wiki Edits: 4
Threads 28
Posts 161
awc_f_mems contains two table-columns (m_thread_subsrib, m_forum_subsrib) with all threads and forums subscribed too.

table awc_f_watchthreads - watches threads...
table awc_f_watchforums - watches forums...

Why are there two places to track the same thing?

Also, when I delete a thread, the thread ID remains in the awc_f_mems->m_thread_subsrib array() in the db, but is successfully removed in awc_f_watchthreads. Is that correct?

Gets Around
Wiki Edits: 4
Threads 28
Posts 161
To me, from what I could find, it appear that the following is missing which in turn causes an "unset()" later to really do nothing...?
$this->m_thread_subsrib = unserialize($r->m_thread_subsrib);

$this->m_thread_subsrib = unserialize($r->m_thread_subsrib);
..
..
if($thread_forum == 'thread'){
  $wDB->delete( 'awc_f_watchthreads', array( 'wtcht_thread_id'.....
  unset($this->m_thread_subsrib[$this->id]);
..
..
 $wDB->update( 'awc_f_mems', array('m_thread_subsrib' => serialize($this->m_thread_subsrib),
..


I did find, this.. but not sure if its NULL.
$this->m_thread_subsrib = $awcUser->m_thread_subsrib ;

Maybe I'm way off, but I from what it looks like in the code, the array(0 should be getting the tID deleted too...?

Thanks!

Gets Around
Wiki Edits: 4
Threads 28
Posts 161
Update
It appears, from my testing, that the array ids are not removed if the forum(s) are deleted, but are in fact removed if the user "unsubscribed"
Edited On 1:08:19 AM - Saturday 21st, March 2009 by Kenyu73

Forum Vet
Wiki Edits: 2898
Threads 135
Posts 1397
Quote:Kenyu73 Mar 20th 2:14 pm
awc_f_mems contains two table-columns (m_thread_subsrib, m_forum_subsrib) with all threads and forums subscribed too.

table awc_f_watchthreads - watches threads...
table awc_f_watchforums - watches forums...

Why are there two places to track the same thing?


Too much to explain in detail, its mainly for checks (as explained in other threads you have posted).
When the forum loads it always pulls from the awc_f_mems table, mainly for permissions and forum member options; display sigs, display avatars, etc., but there is other info which is handy also like the subscribe info and post counts.

To your question, its seams more effeiant to hold the members subscribe info in the awc_f_mems table also so not to query three big tables. If the forum was to search the awc_f_watchforums and awc_f_watchthreads (with no LIMIT #,# on big and buzy forums this could be ALOT of records to search though) just to see what forums and threads a member is subscribed to reset there emails for subscription. So it seams to make better sense to hold the info in both places. On the flip side, it didnt seam to make sense to search all the members to find out who is subscribed to a forum or thread when a subscription notifaction was to be sent out.

Example 1, all data in the awc_f_watchforums is a sure thing, there could be 100 entries in there and the forum could have 1,000 members, theres no need in searching 1,000 records for "hit and misses" when we know the data in the awc_f_watchforums is a sure thing and what we need.

Example 2, theres no reason for the forum to search the awc_f_watchforums table for the current users logged subscribed info when it can be held in a small field in the awc_f_mems table which is checked anyway.


If you want to see how a forum really works, theres alot of free ones out there:
phpBB, simplemachines, YaBB are acouple, IPB and vbulletin cost money, but they might have trials (its been a long time since ive played with these, but the concept is pretty much the same with most)


Quote:Kenyu73 Mar 20th 2:14 pm

Also, when I delete a thread, the thread ID remains in the awc_f_mems->m_thread_subsrib array() in the db, but is successfully removed in awc_f_watchthreads. Is that correct?

nope... look like i for about it.
Its not a real big deal being most people are not deleting threads (which members have subscribed to) all that much, but i will fix it.

_
~ What was once an opinion, became a fact, to be later proven wrong ~
  • Forum Ver. 2.5.10 has been released (6/19/2010), Download here.


Gets Around
Wiki Edits: 4
Threads 28
Posts 161
I'm pretty much up and running now since I have the hooks to ensure emails go out for all forum members per post..thank you!

I started looking at the db tables originally because I had subscribed threads flipped back to an unsubsctribed mode...basically no id in awc_f_mems but the id existed in awc_f_watchthreads. I'd get emails even though it said I wasnt subscribed in the UI.

Then I deleted some test threads and noticed that the IDs remained in awc_f_mems.. so then preceeded to be all confused...

Still trying to make heads/tails of that one as I dont delete anything via code.

Thanks for all the help!
Eric


Forum Image:Icon-double-arrow.gif AWC's Corner Image:Icon-double-arrow.gif AWC's MediaWiki Forum Extension



Whos here now: Members 0 Guests 0 Bots/Crawlers: 1


AWC's: 2.6.0 MediaWiki - Stand Alone Forum Extension
Forum theme style by: AWC