Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post The 'New' Link And Display Page 
 
Having updated a web site with IP 2.0.0.86 there are a couple of strange problems with the New link. This also happens on this site - though you'll have to switch stile to Icy Phoenix.

If you login and go to the Forum page, the New link shows the number of new topics in parentheses (but not with the default style). In my case it says 'New (20)'. But if I click on the link, it takes me to the search result page which shows 'Search found 10 matches'.

It may be that this problem existed in previous releases - I haven't checked.

A further problem, though I don't think it is related, is that some users are still seeing threads uin the 'New' page from 14/08/2012 - a couple of days before I upgraded the site. I think this is due to these users not logging out. It doesn't happen to me, because I do log out. In fact, if I log out then log in, the search results page shows 0 matches. Now I know that IP logs people out 'virtually' after a couple of hours, and logs them in again the next time they access the site.

I haven't had time to check the code yet, but perhaps someone else has also found these problems?

John
 



 
jhlSend private message  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: The 'New' Link And Display Page 
 
Are you sure these aren't 20 posts in 10 threads John?

I'm sure there was a big discussion about the new way new posts are handled regarding the new upi2db system and the normal way but I could not find it as fast as I wanted TBH.

It had a lot to do with session length and loggin in/out
 




____________
www.DutchaGoGo.com (development/under construction ...Forever?¿?)
 
Joshua203Send private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: The 'New' Link And Display Page 
 
Joshua203 wrote: [View Post]
Are you sure these aren't 20 posts in 10 threads John?


Could well be Joshua. But I wonder why there are two different queries for the same (or similar) information.

Joshua203 wrote: [View Post]
I'm sure there was a big discussion about the new way new posts are handled regarding the new upi2db system and the normal way but I could not find it as fast as I wanted TBH.
It had a lot to do with session length and loggin in/out


If you can find that discussion, I will read it thoroughly, thanks.

John
 



 
jhlSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: The 'New' Link And Display Page 
 
It took me a while   but I guess this is it..
http://www.icyphoenix.com/viewtopic.php?f=10&t=8136&start=0
 




____________
www.DutchaGoGo.com (development/under construction ...Forever?¿?)
 
Joshua203Send private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: The 'New' Link And Display Page 
 
Joshua203 wrote: [View Post]
It took me a while   but I guess this is it..
http://www.icyphoenix.com/viewtopic.php?f=10&t=8136&start=0


Yes, I think you're right. There seems to be a bit of confusion though. Meanwhile I took a look at the code, which has a few discrepancies...
First of all, let's see if I can clear things up a little (or possibly confuse everyone more).

Overview
There are two systems for new/unread/et al messages - cookie based and DB based (UPI2DB). I haven't looked at UPI2DB at all, so I won't mention it further here.

The number of new posts appears only in specified pages (all forums and single forum usually) to reduce DB hits, but always displays the number of new posts since you last logged in (irrespective of using cookies or UPI2DB).
So if you want to reduce the list you must log out, then log in again. Here 'New' refers to posts published after you logged in, even if you've read one or more of the posts.

That's just how it is, and that's what I'll explain to my users. New != Unread.

Discrepancies
Now to the discrepancies. I'm making reference to the PHP code, mostly.
The 'New' count in the link is calculated using an SQL query (includes/functions.php, line 4539):
Code: [Download] [Hide] [Select]
$sql = "SELECT COUNT(post_id) as total FROM " . POSTS_TABLE . " WHERE post_time >= " . $user->data['user_lastvisit'] . AND poster_id != " . $user->data['user_id'];

which basically says "get the post counts since you last logged in, that aren't yours".

However, in the actual search page, the SQL query is (search.php, line 329):
Code: [Download] [Hide] [Select]
$sql = "SELECT post_id FROM " . POSTS_TABLE . " WHERE post_time >= " . $user->data['user_lastvisit'];

this says "get every post since you last logged in".
This will (or should) produce more results, because it will also include your own posts, whereas the counter didn't.

But, then the results page uses the topic format to display the results. This will mean that although there could have been say 20 new posts, if they were all in a single topic, you'll only see one line of results.

Possible alternatives
The first discrepancy is very minor - either add the 'your posts' filter to the search query, or remove it from the count query. I don't see this being a problem. Personally, I'd remove the filter from the count query.

The second discrepancy seems more 'conceptual' than mathematical. If New refers to posts, why show the results using the topics format? Wouldn't it be more reasonable to show the results using the posts format?
Or, if the results are shown as topics (which displays less information, when there are many new posts), shouldn't the count refer to the number of topics with new posts?

(For those who might not know these two formats, you can choose one or the other in the search panel, see below, where the cursor is)
search


Thoughts?

John
 



 
Edited by Joshua203, Sat 25 Aug, 2012 13:58: bbcode FONT replaced by bbcode CODE tags
jhlSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: The 'New' Link And Display Page 
 
Well, without getting technical, it's all pretty confusing (even at phpbb as far as i can see)

I think if people want accuracy they should use upi2db, for me this is too much as I like to be able to see the new even after I visited them.

I also would not want to see 10 posts in 1 thread shown separately either (but i do want to see them counted)
 




____________
www.DutchaGoGo.com (development/under construction ...Forever?¿?)
 
Joshua203Send private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: The 'New' Link And Display Page 
 
You are right about the discrepancies. At the moment I have added the filter over own posts (I don't want that counter to increase because of my posts) and I have implemented the view of the result following posts instead of topics.

I'll have a try and decide if keeping it as is or change again.

Thanks for the analysis and reporting.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: The 'New' Link And Display Page 
 
Mighty Gorgon wrote: [View Post]
You are right about the discrepancies. At the moment I have added the filter over own posts (I don't want that counter to increase because of my posts) and I have implemented the view of the result following posts instead of topics.

I'll have a try and decide if keeping it as is or change again.

Thanks for the analysis and reporting.


Let (us) me know if this added to the latest release...

John
 



 
jhlSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: The 'New' Link And Display Page 
 
Yes, I have to finish to mess up with the code and I will update GIT.
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events