Page 69 of 133

Posted: Wed May 24, 2006 2:38 am
by asinshesq
WhataMack wrote: I've tried a couple times tonight to install the 2.0.4 version of the mod on a completely new phpBB2 2.0.20 site (new and clean database, no mods, no posts except one I try to add to the "This is a test forum" forum, no users besides myself), and this error message comes back whenever I try to submit that post:

Code: Select all

phpBB : Critical Error 

Failed to update users table for unread topics

DEBUG MODE

SQL Error : 1054 Unknown column 'user_unread_topics' in 'field list'

UPDATE phpbb_users SET user_unread_topics = '0//1148436751//' WHERE user_id = 0

Line : 1106
File : functions.php
I've copied the "contrib/changed files" from the 2.0.4 release to the appropriate locations.

I can most likely wait until the 2.0.5 mod comes out to start putting this installation up, but thought I'd at least post this info in the meantime. Any ideas what's causing this?


2.0.4 works fine. That error message is telling you that you didn't run the sql to add the new column to your database. The second instruction in the mod is:

Code: Select all

#
#-----[ SQL ]-------------------------------------------------
#
ALTER TABLE phpbb_users ADD user_unread_topics TEXT;
and that''s what you didn't do. If you're not installing with easymod you'll have to run that sql manually using phpmyadmin or whatever gui you use to change the database.

Posted: Wed May 24, 2006 2:45 am
by WhataMack
OK, thanks, I'll start over. I didn't install any other mods prior to Keep Flags Unread, including EasyMod, because it sounded in "keep_unread_2-0-4.txt" that the easiest install would be just to copy the contrib/changed files onto a completely virgin 2.0.20 site. Guess I didn't bother reading all that much after that...sorry! :oops: Should have known that sounded too easy. :wink:

EDIT: Just a quick heads-up that 2.0.4 is now running just fine. Thanks for your help, and for putting together one of the most useful mods available! 8)

Posted: Wed May 24, 2006 2:54 am
by asinshesq
WhataMack wrote: OK, thanks, I'll start over. I didn't install any other mods prior to Keep Flags Unread, including EasyMod, because it sounded in "keep_unread_2-0-4.txt" that the easiest install would be just to copy the contrib/changed files onto a completely virgin 2.0.20 site. Guess I didn't bother reading all that much after that...sorry! :oops: Should have known that sounded too easy. :wink:


No need to start over, and no need to apologize. All you need to do is to run that query with whatever db GUI you use. If you don't know how to do that you can either try to figure that out (shouldn't be too hard) or start over and install this with easymod (though it's probably easier to just do the db change).

It never occurred to me that people would make the mistake you made, but now that you've called my attention to it I think I should revise those instructions to remind people who install the premodded files the way you did that they need to run the sql query to add the column to that table,

Posted: Wed May 24, 2006 3:49 am
by teevee
I'm running into problems installing v. 2.0.3c with EasyMOD. It can't find a line in viewtopic.php and then breaks. According to the EasyMOD FAQ, this is most likely because my viewtopic.php has been modified by a previous mod. Is there some easy way around this? To me this seems like a critical problem with the mod system used by phpBB, if it's this problematic to install mods when the board has been previously modded... any advice would be appreciated.

Posted: Wed May 24, 2006 7:34 am
by net83it
did you update the database?

Posted: Wed May 24, 2006 7:56 am
by Merlin Sythove
teevee wrote: I'm running into problems installing v. 2.0.3c with EasyMOD. It can't find a line in viewtopic.php and then breaks. According to the EasyMOD FAQ, this is most likely because my viewtopic.php has been modified by a previous mod. Is there some easy way around this?


Probably

To me this seems like a critical problem with the mod system used by phpBB, if it's this problematic to install mods when the board has been previously modded...


Yes. But this is a given fact of life. If you are not satisfied with phpBB "out of the box" and start altering it by installing Mods, eventually you will get these types of problems. Nothing wrong with phpBB as it is, nor with the mod system, but with users wanting umpteen thousand different options and expecting them to work together flawlessly :D
any advice would be appreciated.


If you write down WHICH line is being complained about, then you can try and solve the problem yourself, by trying to find that line in viewtopic.php.

If that line REALLY is not there, not just a question of an added space here or there, then yes, you may have altered it yourself by installing another mod previously.

In that case, come back here, tell us which line cannot be found, and where you suspect it should be, what you have there now and so on and so forth.

Posted: Wed May 24, 2006 9:04 am
by asinshesq
teevee wrote: I'm running into problems installing v. 2.0.3c with EasyMOD. It can't find a line in viewtopic.php and then breaks. According to the EasyMOD FAQ, this is most likely because my viewtopic.php has been modified by a previous mod. Is there some easy way around this? To me this seems like a critical problem with the mod system used by phpBB, if it's this problematic to install mods when the board has been previously modded... any advice would be appreciated.


As we've repeatedly said in this thread ever since phpbb2.0.20 was released, 2.0.20 changed things so that you have to change this mod to dovetail. I posted a new version which you can find in the very first real post in this thread after the validators message releasing the mod ( http://www.phpbb.com/phpBB/viewtopic.ph ... 17#1684517 ), and I used huge red letters so that you couldn't miss it. Same thing as recently as several days ago (in a post you will find on the last page before this one).

Next time you ask for help, it might be useful to actually give some information to aid people in helping. Are you using phpbb2.0.20? And don't just say it doesn't work (totalkly unhelpful)...say what doesn't work. What lines is easymod having trouble finding. But if it's just that you have a 2.0.20 board and it can't find some preg_replace lines, the answer is that you should be using the newer version of this mod that works with 2.0.20.

All initially unread for new members?

Posted: Wed May 24, 2006 8:49 pm
by scigametools.net
Ordinarily, nothing on the board is unread for a new member, from what I can tell.

In most cases, this is fine. However, I have certain forums where I want posts that were made before the user was a member or before the user had access to that forum, to show as unread. (Hopefully the number of posts are not unreasonable, so the 300 limit won't kick in, or I up the limit a bit..)

Any suggestions on the easiest way to get this functionality? (I'm a programmer, but don't know PHP very well (usually use C/C++/MASM).. had a look at the code, and if I am to change it myself, it's gonna take me some time to figure out... :))

Thanks
Kevin

Re: All initially unread for new members?

Posted: Wed May 24, 2006 11:33 pm
by drumstix42
scigametools.net wrote: Ordinarily, nothing on the board is unread for a new member, from what I can tell.

In most cases, this is fine. However, I have certain forums where I want posts that were made before the user was a member or before the user had access to that forum, to show as unread. (Hopefully the number of posts are not unreasonable, so the 300 limit won't kick in, or I up the limit a bit..)

Any suggestions on the easiest way to get this functionality? (I'm a programmer, but don't know PHP very well (usually use C/C++/MASM).. had a look at the code, and if I am to change it myself, it's gonna take me some time to figure out... :))

Thanks
Kevin


That's acctually a cool idea. I'd say you would have to add some custom code somewhere to registration process or something. Or maybe make something with a "login counter", and have it so when the first time a user logs in, it sets "x" posts as unread. That's something I'd like to figure out as well. I'm sure there are ways to make it configurable through like the ACP, but that would take some extra work.

Posted: Wed May 24, 2006 11:59 pm
by teevee
Sorry, this is my bad. I actually tried both versions 2.0.3c and 2.0.4 and had errors (not the same errors mind you) with both. I took a look at the EasyMOD FAQ, saw the mention of previous mods being a problem, suspected I'd found my problem, posted only very quickly, expected an equally quick "yup, the mods are the problem, you need to start over." I should have provided more detail.

Using EasyMOD 0.3.0, phpBB 2.0.19 and v. 2.0.4 of the mod, I get this error:

Code: Select all

Critical Error

FIND FAILED: In file [viewtopic.php] could not find:

if (!$topic_id && !$post_id)
{
message_die(GENERAL_MESSAGE, 'Topic_post_not_exist');
}
//
// Find topic id if user requested a newer
// or older topic
//
if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
{
if ( $HTTP_GET_VARS['view'] == 'newest' )
{
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid']) )
{
$session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $HTTP_GET_VARS['sid'];
if (!preg_match('/^[A-Za-z0-9]*$/', $session_id))
{
$session_id = '';
}
if ( $session_id )
{
$sql = "SELECT p.post_id
FROM " . POSTS_TABLE . " p, " . SESSIONS_TABLE . " s, " . USERS_TABLE . " u
WHERE s.session_id = '$session_id'
AND u.user_id = s.session_user_id
AND p.topic_id = $topic_id
AND p.post_time >= u.user_lastvisit
ORDER BY p.post_time ASC
LIMIT 1";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit');
}
$post_id = $row['post_id'];
if (isset($HTTP_GET_VARS['sid']))
{
redirect("viewtopic.$phpEx?sid=$session_id&" . POST_POST_URL . "=$post_id#$post_id");
}
else
{
redirect("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id");
}
}
}
redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
} 
Let me know what you think, based on this new info.

Re: All initially unread for new members?

Posted: Thu May 25, 2006 1:19 am
by scigametools.net
drumstix42 wrote: That's acctually a cool idea. I'd say you would have to add some custom code somewhere to registration process or something. Or maybe make something with a "login counter", and have it so when the first time a user logs in, it sets "x" posts as unread...


tnx :) A better (though probably not easier) place to put it would be wherever the forum index is viewed. This is because the user might not be new when they are given access to a given forum. You don't want to give users unread flags for forums they can't access, being that it might lead to them being told they have unread messages, but being unable to find them.

Unfortunately, this also means the check for whether this has to be done for a given forum would be a bit more involved. You might have to keep a list of the forums the user has been init'd for.

As for admin, I'd be happy enough with a flag that has to be set manually in the forum's table via SQL admin, but if you wanted it generally useful for most users, you'd want to put something in the edit forum page.

After looking over the code briefly (and looking up some PHP syntax), I tried to give myself an unread message through SQL admin, just to see if it works the way I assumed from my superficial look. When it didn't work, I figured I'm probably in for more time here than I really ought to be spending... :?

Re: All initially unread for new members?

Posted: Thu May 25, 2006 6:54 am
by Merlin Sythove
scigametools.net wrote: However, I have certain forums where I want posts that were made before the user was a member or before the user had access to that forum, to show as unread. (Hopefully the number of posts are not unreasonable, so the 300 limit won't kick in, or I up the limit a bit..)


My question is whether you are barking up the right tree.

If you really want to go this way, you can "construct" a database field with a list of unread posts the way you want them to be, and insert that for all new applications. But "construct" is the right word, it won't be intuitive and it will be very difficult for you to insert an extra topic or post later, since that field is not meant to be human-editable. Plus, nothing prevents the user from pressing "mark everything as read" and then you are no further.

A simple way to solve it is to install "PM on registration" mod, and provide a list of links to "must read" posts and topics with your welcome message.
At least in an email or PM you can explain WHY the user should read topic X.

You could even make a "forum introduction html" file in the form of a portal, you know, small intro's with "read more..." links to the forum topics, in order to help new users get up to speed. Personally, I would do something like this, combined with a single fixed link in the "Welcome" email new users get from the forum
That is a set of emails in language/lang_english/email/ folder:
user_welcome*.tpl
admin_welcome*.tpl
coppa_welcome*.tpl
and you can edit the welcome message and add a link to a welcome page.
Such a html page has the added advantage of being easily referred to since you only have to remember one link, and it also being accessible to anyone who has NOT yet joined the forum. Links that unregistered users cannot follow could be marked by "(members only)" or something.
Hope this helps

Posted: Thu May 25, 2006 9:57 am
by asinshesq
teevee wrote: ...Using EasyMOD 0.3.0, phpBB 2.0.19 and v. 2.0.4 of the mod, I get this error...


Let's start with the versions point: 2.0.4 is for phpbb2.0.20, not 2.0.19. You need to upgrade to 2.0.20 to use version 2.0.4 of this mod (and you should be doing that anyway). You could alternatively use 2.0.3c with 2.0.19 but I don't see why you would be doing that.

However, the lines in viewtopic that easymod is telling you it can't find are the same in 2.0.19 and 2.0.20 so uopgrading or using 2.0.3c that won't fix that. You need to figure out how your prior mods have changed those line in viewtopic and then adjust the keep unread mod script so that it adapts to the way your board really looks. It is normally not hard to find the part of your code that the mod is looking for, since most mods don't make wholesale changes but just tinker at the edges. So, do a little detective work...take a look at a clean viewtopic.php, see where these lines the mod is looking for are, and tehn compare that to your actual viewtopic and see what's changed. If you have a little bit of programming skill you should be able to adapt the mod script to dovetail with what you find on your board. If not, come back here and post the relevant lines from viewtopic and we'll see if we can help you.

Posted: Thu May 25, 2006 6:01 pm
by Trunks81
Thnx now this mod works perfect, Tried to install 2.0.3c a while ago and didn't work wel now with 2.0.4 it is perfect

Posted: Tue May 30, 2006 5:16 pm
by j45on
Hi, I have come across this Mod and requires a few clarification to see if it is to my expectation. Currently, my forum will lost track of latest unread post the moment I close my IE.

My question is, does this Mod still keep tab of unread posts even though you have closed your IE with some posts unread?