All unread topics -> nothing shown

Started by wormbox, November 26, 2006, 06:54:46 PM

Previous topic - Next topic

SleePy

#20
You are welcome.

Give this file a try and see if it works. I found the variable I think is coming up blank and made a check to set it if it was.

Edit..
Had a Small Typo needed fixed in the File.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

3nd3r

#21
IT WORKS!!!!!  :D :D :D :) :) :)

Thank you very very much!!!

[I've deleted some code shown here to prevent security issues]

MacDo

I've the same problem with your new Recent.php... but I don't get the error messages I got with the original version of Recent.php... :-(

SleePy

MacDo,

Try this..
Quote from: SleePy on January 10, 2007, 06:31:40 PM
Open up Settings.php

In your database section add this:
$db_show_debug = true;

Try that page again. a bigger error message should occur.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

MacDo

Yes, I tried, but I cannot find any error message in the error log. The only things I see is in the bottom of each forum page. And these informations does not contain any error message...
Excuse me for this stupid question but... where should I find this "bigger error message" ?

SleePy

When you are at the Recent.php.
It should provide a bigger error message if any.
Make sure you are using the Default Recent.php before trying my edited one.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

MacDo

The only things I can see are
Code (when accessing recent messages list or any forum page) Select
Templates: 2: index (mytemplate), Recent (default).
Sub templates: 4: init, main_above, unread, main_below.
Language files: 2: index.french-utf8 (mytemplate), Modifications.french-utf8 (mytemplate).
Files included: 10 - 401KB. (show./index.php, ./Settings.php, ./Sources/QueryString.php, ./Sources/Subs.php, ./Sources/Errors.php, ./Sources/Load.php, ./Sources/Security.php, ./Sources/Recent.php, ./Themes/mytemplate/topmenu.php, /home/mydomain/domains/mydomain.tld/public_html/scripts/misc.php)
Queries used: 9.
[show queries]

And I was using the original SMF source file...

SleePy

No error means everything went though correctly. You may just not have any new posts to read since your last visit to the forum.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

MacDo

Yes, I have... When I log as a test user, the icons at the left column of the index board shows that there is unread messages in three different boards. But when I click on "Show all unread messages", it displays only one unread message, and forgets in his list many unread messages... which are shown separatedly if I click on the icons at the left column of the index board...

Of course, the test with "$db_show_debug = true;" has been done as this user (and not as admin), since it's problematic...

Thank you for your help...

SleePy

Can you click the queries used link at bottom and past them here.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

MacDo

Here you are, sir :-) Thank you once more !
  SET NAMES utf8
in /home/myname/domains/mydomain.tld/public_html/forum/Sources/Load.php line 150, which took 0.00015903 seconds.
SELECT variable, value
FROM smf_settings
which took 0.00054502 seconds.
SELECT data
FROM smf_sessions
WHERE session_id = '578223564ab58ba9929939e5c7304b89'
LIMIT 1
in /home/myname/domains/mydomain.tld/public_html/forum/Sources/Load.php line 1984, which took 0.00050902 seconds.
SELECT mem.*, IFNULL(a.ID_ATTACH, 0) AS ID_ATTACH, a.filename, a.attachmentType
FROM smf_members AS mem
   LEFT JOIN smf_attachments AS a ON (a.ID_MEMBER = 1)
WHERE mem.ID_MEMBER = 1
LIMIT 1
in /home/myname/domains/mydomain.tld/public_html/forum/Sources/Load.php line 390, which took 0.00042915 seconds.
SELECT variable, value, ID_MEMBER, ID_THEME
FROM smf_themes
WHERE ID_MEMBER IN (-1, 0, 1)
   AND ID_THEME IN (4, 1)
in /home/myname/domains/mydomain.tld/public_html/forum/Sources/Load.php line 1163, which took 0.00024986 seconds.
DELETE FROM smf_log_online
WHERE logTime < NOW() - INTERVAL 900 SECOND
   AND session != '578223564ab58ba9929939e5c7304b89'
in /home/myname/domains/mydomain.tld/public_html/forum/Sources/Subs.php line 2513, which took 0.00046301 seconds.
UPDATE smf_log_online
SET logTime = NOW(), ip = IFNULL(INET_ATON('83.182.25.30'), 0), url = 'a:4:{s:6:\"action\";s:6:\"unread\";s:3:\"all\";s:0:\"\";s:5:\"start\";s:1:\"0\";s:10:\"USER_AGENT\";s:102:\"Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.8.1.2pre) Gecko/20061023 SUSE/2.0.0.1-0.1 Firefox/2.0.0.2pre\";}'
WHERE session = '578223564ab58ba9929939e5c7304b89'
LIMIT 1
in /home/myname/domains/mydomain.tld/public_html/forum/Sources/Subs.php line 2521, which took 0.00059009 seconds.
SELECT b.ID_BOARD
FROM smf_boards AS b
WHERE 1
in /home/myname/domains/mydomain.tld/public_html/forum/Sources/Recent.php line 513, which took 0.00018787 seconds.
SELECT MIN(lmr.ID_MSG)
FROM smf_boards AS b
   LEFT JOIN smf_log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = 1)
WHERE 1
in /home/myname/domains/mydomain.tld/public_html/forum/Sources/Recent.php line 629, which took 0.00056911 seconds.
SELECT COUNT(*), MIN(t.ID_LAST_MSG)
FROM smf_topics AS t
   LEFT JOIN smf_log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = 1)
   LEFT JOIN smf_log_mark_read AS lmr ON (lmr.ID_BOARD = t.ID_BOARD AND lmr.ID_MEMBER = 1)
WHERE t.ID_BOARD IN (1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13)
   AND t.ID_LAST_MSG > 145
   AND IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) < t.ID_LAST_MSG
in /home/myname/domains/mydomain.tld/public_html/forum/Sources/Recent.php line 758, which took 0.00017715 seconds.
SELECT code, filename, description
FROM smf_smileys
in /home/myname/domains/mydomain.tld/public_html/forum/Sources/Subs.php line 2403, which took 0.00019193 seconds.

SleePy

There is nothing wrong with the MySQL commands. They are being done correctly.
The only reason for not seeing them is if you already read them.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Tan

Found this on another thread from 2005

Re: Show unread topics since last visit
« Reply #11 on: March 23, 2005, 08:26:53 AM » Quote 

--------------------------------------------------------------------------------

Anyway, we've worked out the problem. The people who were having trouble with the 'show unread posts since last visit' link were all those who chose the 'forever' option when signing in. Those who have  been signing in 'forever' never got any unread posts showing from that link. Is there anyway to change the default from 'forever' to '1 hour' in the admin panel, or do I have to edit the code to do that?


Poss could be the reason?

Major Truth

So there is no way that feature will work for those always logged in ??

I would rather not change the "forever" option to something else, as people prefer this due to not having to log in every time they come to the site.

MacDo

Quote from: SleePy on January 15, 2007, 05:54:15 PM
There is nothing wrong with the MySQL commands. They are being done correctly.
The only reason for not seeing them is if you already read them.
Well, No, I'm really sorry... I've already explained that the test user logged in did not read some messages but those messages doesn't appear in the "unread posts" list. Sorry...

But, yes, when I logged as test user, I used the "forever" option. I tried to log in as the test user with the option 'one hour' but the problem is exactly the same...

If you want, I could give you login+pwd of the test user by private mail so that you could check the problem... You'll see by yourself that there is three boards containing unread messages but none of them are shown when I load the page "forum/index.php?action=unread;all;start=0"...

Thank you once more for your interest in this problem.

ps. Oh, there is maybe something you need to know... I'm using SSI in my website. But the SSI include (<?php require("forum/SSI.php"); ?>) is correctly placed, on the very top of the file, before any other line. Sorry if it is very important... I don't know  ::)

Tan

Same for my users Major, They want to not have to log in every time but also want a list of al the unread posts so they don't have to go through each board looking for them.

If each board shows the new posts you haven't read even with forever logon, wouldn't it be possible to have a list of those posts?

Tan

Does the unread posts script work with Cookies if you are forever logged on?

Is it possible to change this to all unread posts (leaving out the since last visit) so members can have a list of all the posts they haven't read. My forum is still young so would like to do this if poss. What would i need to change in the script?

Thanks for all the help.

Tan

#37
Been havin a scout at an old version of SMF 1.0.9 still on one of my closed sites. In that forum the "show all post since last visit" link has an "all unread topics" link at the top which leads to Index. php action = unread;all
When i go into this i get 7 pages of all my unread topics since the forum started (only 8 weeks ago). So this is what i would like in the updated 1.1.1 version.

When i click on the "all unread topics" at the bottom of the "Show all post since last visit "link in the 1.1.1 version it leads to Index.php action = unread; all; start = 0. I only get 2 pages from today!!
It is the same database used for both forums but we transfered it to a new server.


The difference is this start = 0

How do i change the recent php file to take out this start = 0 and make it the same as the SMF version 1.0.9?

Thanks

Grudge

Is everyone here using SSI on the same page as the forum in some form?

Not sure why this would cause a problem but what happens if in Load.php you find:

$username = $user_settings['memberName'];


And add before it:

elseif (empty($_SESSION['ID_MSG_LAST_VISIT']))
$_SESSION['ID_MSG_LAST_VISIT'] = $user_settings['ID_MSG_LAST_VISIT'];
I'm only a half geek really...

Major Truth

Thanks for that line of code.  :)

We are testing it now.

I will let you know what happens.....

Advertisement: