any Hint!!!

windows

Guest
I'm currently developing a web forum for my self, i have 3 problems remaining in my forum:

How to view how many viewing a specific Topic ex: (7 viewing), my idea is to create application variable for the topic when the user enters it, and increase it by 1 each time a user enter it, but the problem is how to know that the user left that topic!!!!
I sent my DB Schema picture, so how can i get last post user name for each thread?!
How can i create a numbers custom paging?!, currently i'm using normal custom paging: Page 1 of 8 (10 Item's') Next LastPage. If you need the code i can post it.

So any hint please about any?!1) Same as that last thread with the 20 min time out thing. Select where time < 20 mins.
2) Can't you return the top 1 post and extract the name form it?
3) Thats omething ive been thinking about for some time. Was curious to know if it's a double query. Can i see the code please?

If you want an email i can pm one to you if you dont wanted it posted.Well i didnt get what you meant for first two questions, would be nice if you can explain more, and here's the code i used for the paging:

after binding to datagrid:

Dim TotalThreads As Integer = dstThreads.Tables("Threads").Rows.Count

'Pages Count Label
PagesLabel.Text = "Page " & DataGrid1.CurrentPageIndex + 1 & " of " & DataGrid1.PageCount & " (" & TotalThreads & " item's')"

'Prev Page Button
If DataGrid1.CurrentPageIndex <> 0 Then
PrevButton.Visible = True
Else
PrevButton.Visible = False
End If

'Next Page Button
If DataGrid1.CurrentPageIndex <> (DataGrid1.PageCount - 1) Then
NextButton.Visible = True
Else
NextButton.Visible = False
End If

'First Page Button
If DataGrid1.CurrentPageIndex > 1 Then
FirstButton.Visible = True
Else
FirstButton.Visible = False
End If

'Last Page Button
If DataGrid1.CurrentPageIndex < DataGrid1.PageCount - 2 Then
LastButton.Visible = True
Else
LastButton.Visible = False
End If

so all of this to determine which buttons to view, and here's the function for these button:

Protected Sub PagerButton(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim btn As LinkButton = CType(sender, LinkButton)
Dim Cond As String = CType(btn.CommandArgument, String)
Select Case Cond
Case "next"
If DataGrid1.CurrentPageIndex < (DataGrid1.PageCount - 1) Then
DataGrid1.CurrentPageIndex += 1
End If
Case "prev"
If DataGrid1.CurrentPageIndex > 0 Then
DataGrid1.CurrentPageIndex -= 1
End If
Case "last"
DataGrid1.CurrentPageIndex = (DataGrid1.PageCount - 1)
Case Else
DataGrid1.CurrentPageIndex = 0
End Select

Bind()
End Sub

Thanks too much for helpok, you want to keep track of how many people are viewing a thread. This is like the recent thread of keeping track of someone at your site. We came up with a possible solution that you could have 2 fields, 1 with a time, 1 with a status.

Could you not do a similar type of thing?
[user,thread,time]???
Then select all threads that match a id with the time < 20mins. Then you would need a cleaner program to get rid of the expired ones.

Does thia make more sence?


now Q2) "how can i get last post user name for each thread"
-get last name from thread-
get all the names fromthe thread then pic the latest

Something like select TOP 1 and do a search for all posts in a thread. then get the lastest post, and pull the user name from that?

Is that what your trying to do?
 
Back
Top