BlameThePixel!

BTForum » Other Stuff » BlameTheSuggestions » A Detailed Users Online List?

Page: [] [2]
[S]ReadMe
Absent
Send PM
Posts: 2820
Threads: 85
Money: £43.42 (D)
(+ Friend)
Not online within the last half an hour
heh, you should see the forumindex query, it's huge. I dont even understand how the new posts thing works. I've tried reading it and i've spent plenty of time trying to figure out how I'd do it.

Funny thing is, of the admins i'm possibly the best at queries lol

________________
Cant be arsed to remake my sig.
01.09.04 22:55
Post #16
[Hide Sig (7)] [Profile] [Quote]
[UA]tundraH
Statusless
Send PM
Posts: 566
Threads: 20
Money: £1.26 (D)
(+ Friend)
Not online within the last half an hour
:o
(At the query in the menu) I never realised you could have that many JOINs...
02.09.04 07:01
Post #17
[tundraH.com] [Hide Sig (0)] [Profile] [Quote]
[S]Zogger!
Looking For Status
Send PM
Posts: 3954
Threads: 62
Money: £93.82 (D)
(+ Friend)
Not online within the last half an hour
Nah MySQL / Joins are easy with a bit of practice, although I believe there are some other methods not available in this mySQL version that would make this query much easier. The original query at the base of this one was much simpler, and I had to get my brother to help, but this one is much more complicated and I wrote it.. heh. Here is a documented version for all the hackers out there

\n
//select unique rows only (don't think that matters for the new posts marker...) from the forums SELECT DISTINCT f_forums.id AS id FROM f_forums
//Get all the threads in the forum INNER JOIN f_threads ON f_threads.forum = f_forums.id //Get the row for the "read posts" table for this thread provided the user in the f_read table is the logged in user LEFT OUTER JOIN f_read ON f_read.thread = f_threads.id AND f_read.name='$loggedin' //Get special access stuff (to determine whether this person can view the forum) for this forum, again where the user is the logged in one LEFT OUTER JOIN f_saccess ON f_forums.id = f_saccess.forum AND f_saccess.user='$loggedin' //Check whether the user has the forum ignored, same as above really LEFT OUTER JOIN f_ignore ON f_ignore.forum = f_forums.id AND f_ignore.user='$loggedin' //Keep this row in if the current last post is later than the last read time, or the user hasn't viewed the thread at-all yet WHERE (f_read.time < f_threads.time OR f_read.thread IS NULL) // ( if the user has a status lower than the minimum access to the forum AND If the access type is 1 [the type for allowing access to special forums]) OR (the user has a status greater than the minimum or they are an admin) AND ((f_saccess.type=1 AND f_forums.minstatview > $status) OR f_forums.minstatview <= $status OR $status = 2) // (if they're not banned from the forum, OR there is no special access record for this user) AND ((f_saccess.type != -1) OR f_saccess.type IS NULL) // if they're no ignoring the forum
AND f_ignore.user IS NULL //if the last post time for the thread is greater than the cut-off time for marking posts as read (or when they clicked the "mark all posts as read" button) AND f_threads.time > $earliest
\n

Note that this is just for that red 'Posts' you see on the side of the menu, so don't think that by finding some little mistake I may have made in this query you can gain access to all sorts of forums, it checks in different way in the forums, which are much less complicated. heh.

________________
You know I'm a dancing machine
02.09.04 09:38
Post #18
Last edited: 02.09.04 09:43 (ZoGgEr! - 3 times) [Hide Sig (8)] [Profile] [Quote]
Page: [] [2]

Post Reply

Jump To:


Your Comments:

Donate to BlameThePixel:
Donate to BTP Via PayPal


[22 Queries, Page Loaded in 0.230734 Seconds]

ShoutMeUp

Xmas Greetings from waka waka waka waka []Unvalidated EmailChristmasRiddle MERRY CHRISTMAS EVERYONE! []Spleet Except for Spleet. []TheAbdBoy Always bummin' a brother out. []Spleet Happy New Year everyone! But Spleet. []TheAbdBoy

Word Association

All

-10 Ago-

MiddleEastern []AlphaWolf camel [S]Bloopy toe []TheAbdBoy moose knuckle [S]Bloopy MeatLoaf []Spleet IdDoAnything4Lo ve []AlphaWolf rub n tug []TheAbdBoy tugboat []The Pope rope [S]Bloopy race []TheAbdBoy

-Latest-


Must be logged in to add new words

FictoLeague

You have to be logged in to vote...

Member Stats

Date: 17.05.24.
Members: 4731.
Latest: []Unvalidated Emailsdsakldsaldklasdsdsa
Active:
0 user(s)
1 guest(s)

On chat:
Lots of people

Files: 3330

Bloopy's Site
Get Firefox Get Opera Donate to BTP Via PayPal