keep unread flags

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
72
75%
Very Good
16
17%
Good
4
4%
Fair
0
No votes
Poor
4
4%
 
Total votes: 96

Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: keep unread flags

Post by Merlin Sythove »

Sorry, that is beyond me. I have noticed that index.php is very slow if you have the birthday mod installed, so there may be another mod that is causing a delay. But if the code executes in X time directly on the SQL server, I expect it to execute in X time via php too. You COULD make a php page with only that query in it, just to see what happens, time wise.
Need custom work done? Pimp My Forum!
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Performance issues?

Post by asinshesq »

scottflory wrote:Here is the query:
SELECT t.forum_id, t.topic_id, p.post_time FROM phpbb_topics t, phpbb_posts p WHERE p.post_id = t.topic_last_post_id AND t.topic_id IN (3219,3146,3975,......MANY OTHER NUMBERS, ABOUT 300 OF THEM......4221,4222,4224) AND (p.post_time <= 1191520768) AND t.topic_moved_id = 0
Where is that from? Is that from function list_unreads() that this mod adds to includes/functions.php?

If so, note that the same function gets called on index.php so it seems interesting that you don't have the same problem on index.php. And, the same function also gets called on all other pages (since it appears in page_header.php) unless you followed the author's note that begins "If you have a really huge board..."
ace2ace
Registered User
Posts: 364
Joined: Sat Aug 14, 2004 3:48 pm

Re: keep unread flags

Post by ace2ace »

Merlin Sythove wrote:In viewtopic.php, look for the word 'newest'. There should be code to translate newest to an actual post id, and then a redirect statement to actually go to that post.
Compare your files with the original phpbb 2.0.22, using a utility such as CompareIT (free) to see the differences.
in viewtopic.php:

Code: Select all

      $post_id = empty($row['post_id']) ? $row['topic_last_post_id'] : $row['post_id'];
      redirect(append_sid("./viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true));
it looks allright...
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: keep unread flags

Post by Merlin Sythove »

So: The link is OK, and the problem is that you become a guest when it is executed.

Replace this:
redirect(append_sid("./viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true));
by this, for testing only:
redirect("./viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id");
and see if that works. I've taken out the append_sid call that appends your session id, maybe something is messed up there.
Need custom work done? Pimp My Forum!
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: keep unread flags

Post by asinshesq »

Merlin Sythove wrote:So: The link is OK, and the problem is that you become a guest when it is executed.

Replace this:
redirect(append_sid("./viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true));
by this, for testing only:
redirect("./viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id");
and see if that works. I've taken out the append_sid call that appends your session id, maybe something is messed up there.
Merlin, how do we even know it gets there?

ace2ace, if you try merlin's test and it doesn't work, try replacing that same code with this just for testing purposes:
die($post_id);

When that gets executed, the code will stop and the screen will display whatever is in $post_id. The idea is to figure out if the script ever gets to that point or messes up somewhere earlier in viewtopic.php (and if it does get that far it will tell you what is in $post_id at that point in the script).
ace2ace
Registered User
Posts: 364
Joined: Sat Aug 14, 2004 3:48 pm

Re: keep unread flags

Post by ace2ace »

1- This problem doesn't exist when I use firefox on the same PC. It only happens with IE and browzar.

2- On another PC, both IE/browzar and firefox work fine.
scottflory
Registered User
Posts: 5
Joined: Wed Nov 15, 2006 9:59 pm

Re: Performance issues?

Post by scottflory »

asinshesq wrote: Where is that from? Is that from function list_unreads() that this mod adds to includes/functions.php?
Yup, its from that function, I expanded it into a test version of index.php for debugging.

I will try the other person's suggestion of just a basic php page that executes that query.... I've been suspecting the ODBC drivers, but don't know how to test that... I found another instance on this setup where a particular query took an inordinate amount of time through php and was very quick in regular ODBC queries from MS Access... or directly in the database.

I'll post again with my test of the simple PHP page executing that query.

thanks
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: keep unread flags

Post by Merlin Sythove »

ace2ace wrote:1- This problem doesn't exist when I use firefox on the same PC. It only happens with IE and browzar.

2- On another PC, both IE/browzar and firefox work fine.
In that case, clean your IE cache, a full cache is a well known cause for this type of problems.
Need custom work done? Pimp My Forum!
scottflory
Registered User
Posts: 5
Joined: Wed Nov 15, 2006 9:59 pm

Re: Performance

Post by scottflory »

Well... ODBC was it.
If you're so inclined, take a look at the mssql-odbc.php code in the base phpbb installation (under the db directory). Compare it to the mssql.php code. The ODBC code not only gets the query result, but parses EVERY ROW AND COLUMN into an array before moving on. The mssql version does not do this, presumably because the mssql php functions allow you to keep a handle to the query and get the rows and columns at a later time (as in, when you need it).
So, I switched to using mssql instead of mssql-odbc and now our forums are flying!!!

Scott
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: keep unread flags

Post by Merlin Sythove »

Glad to hear it is solved and you're happy with a fast forum!
Need custom work done? Pimp My Forum!
paulfurze
Registered User
Posts: 4
Joined: Tue Aug 21, 2007 4:25 pm

Re: keep unread flags

Post by paulfurze »

Superb. Installed a dream. thank you very much for this mod
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: keep unread flags

Post by Merlin Sythove »

Nice to hear, enjoy!
Need custom work done? Pimp My Forum!
rantbot
Registered User
Posts: 83
Joined: Sun May 07, 2006 1:37 pm

Re: keep unread flags

Post by rantbot »

What does "It also activates the new post feature for guests" mean?

I'm not after any new features, I just want the "read" flag to mark posts which I have actually read.
Merlin Sythove
Registered User
Posts: 2339
Joined: Tue Mar 16, 2004 7:42 am

Re: keep unread flags

Post by Merlin Sythove »

The mod files explain that you can give guests the exact same features, i.e. to remember the posts that they have not read. I personally find that a great plus, it means that you don't force guests to become members just to keep up with what is happening on your forum. You can turn this feature off if you like.
Need custom work done? Pimp My Forum!
rantbot
Registered User
Posts: 83
Joined: Sun May 07, 2006 1:37 pm

Re: keep unread flags

Post by rantbot »

The "files to edit" list doesn't mention the database. However I see there is an SQL mod. How is that done? Do I just paste the text

ALTER TABLE phpbb_users ADD user_unread_topics TEXT;

into the Query window Run SQL query/queries on server localhost: in phpMyAdmin and run it from there?
Post Reply

Return to “[2.0.x] MOD Database Releases”