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

Trunks81
Registered User
Posts: 25
Joined: Sat Apr 15, 2006 6:42 pm

Post by Trunks81 »

Yes this is the right mod for you
[Hazard]Rowan
Registered User
Posts: 504
Joined: Mon Jan 09, 2006 2:19 pm
Location: United Kingdom
Contact:

Post by [Hazard]Rowan »

Thanks man ill install this just now, and if it does what you said it would lol, which it will, Congratulations to the Author of the mod :)
http://www.hazardforum.co.uk
Come and Join The Community :)
christian001
Registered User
Posts: 12
Joined: Sun Apr 23, 2006 3:12 am

Post by christian001 »

I have a problem installing Keep Unread...

I'm asked to find in search.php:
#-----[ FIND ]------------------------------------------------
#
if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
{
$search_author = '';
}

$search_author = str_replace('*', '%', trim($search_author));

#
#-----[ REPLACE WITH ]------------------------------------------------
#
$search_author = str_replace('*', '%', trim($search_author));


But when I look at my search.php I find:

if (preg_match('#^[\*%]+$#', trim($split_search[$i])) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($split_search[$i]))))
{
$split_search[$i] = '';
continue;
}

switch ( $split_search[$i] )
..........

(You can see the code in a standard search.php file... split_search is used again and again after those lines)

I'm confused... is this an error in the Mod? Or I missed something? What to do?
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

christian001 wrote: I have a problem installing Keep Unread...


No, you're in teh wrong part of search.php. Here's your answer: http://www.phpbb.com/phpBB/viewtopic.ph ... 58#2082858
christian001
Registered User
Posts: 12
Joined: Sun Apr 23, 2006 3:12 am

Post by christian001 »

Thanks a LOT asinshesq. :)
Bullmax
Registered User
Posts: 2016
Joined: Fri Jan 30, 2004 3:36 pm

Post by Bullmax »

This is sorta long so bare with me. I read the post for the search file but this is different I think. I have a brand new version of 2.0.20 so I am confused on what to do with these problems:

in templates/subSilver/index_body.tpl

Code: Select all

#
#-----[ FIND ]------------------------------------------------
#
	<!-- BEGIN switch_user_logged_in -->
	{LAST_VISIT_DATE}<br />
	<!-- END switch_user_logged_in -->
I did not have this at all

in search.php

Code: Select all

#
#-----[ FIND ]------------------------------------------------
#
				if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
				{
					$search_author = '';
				}

				$search_author = str_replace('*', '%', trim($search_author));
Closest thing I had was this and it was the only occurance that has preg_match:

Code: Select all

if (preg_match('#^[\*%]+$#', trim($split_search[$i])) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($split_search[$i]))))

Code: Select all

#
#-----[ FIND ]------------------------------------------------
#
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql);
			}

			$search_ids = array();
			while( $row = $db->sql_fetchrow($result) )
			{
				$search_ids[] = $row['post_id'];
			}
			$db->sql_freeresult($result);

			$total_match_count = count($search_ids);

I had this:

Code: Select all

if ( !($result = $db->sql_query($sql)) )
				{
					message_die(GENERAL_ERROR, "Couldn't obtain list of matching users (searching for: $search_author)", "", __LINE__, __FILE__, $sql);
				}

				$matching_userids = '';
				if ( $row = $db->sql_fetchrow($result) )
				{
					do
					{
						$matching_userids .= ( ( $matching_userids != '' ) ? ', ' : '' ) . $row['user_id'];
					}
					while( $row = $db->sql_fetchrow($result) );
				}
				else
				{
					message_die(GENERAL_MESSAGE, $lang['No_search_match']);
				}

I did have this which looks the same but the "Could not obtain matched posts" is not the same:

Code: Select all

if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not obtain matched posts list', '', __LINE__, __FILE__, $sql);
			}

			$search_ids = array();
			while( $row = $db->sql_fetchrow($result) )
			{
				$search_ids[] = $row['post_id'];
			}
			$db->sql_freeresult($result);

			$total_match_count = count($search_ids);

Code: Select all

#
#-----[ FIND ]------------------------------------------------
#
			if (preg_match('#^[\*%]+$#', trim($search_author)) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($search_author))))
			{
				$search_author = '';
			}

			$search_author = str_replace('*', '%', trim(str_replace("\'", "''", $search_author)));


This is what I have (same as the one above and only one occourance):

Code: Select all

if (preg_match('#^[\*%]+$#', trim($split_search[$i])) || preg_match('#^[^\*]{1,2}$#', str_replace(array('*', '%'), '', trim($split_search[$i]))))
Thanks to anyone that can help!!
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

Bullmax wrote: This is sorta long so bare with me. I read the post for the search file but this is different I think. I have a brand new version of 2.0.20 so I am confused on what to do with these problems...


Sigh. Plesse look two posts over your post and you will have your answer.
Bullmax
Registered User
Posts: 2016
Joined: Fri Jan 30, 2004 3:36 pm

Post by Bullmax »

asinshesq wrote: Sigh. Plesse look two posts over your post and you will have your answer.


Hi, I read that post again and found the fix for the preg_match problems.

The other problems I have figured out as well.

By the time I got to the search.php edits, my head was spinning so all the code changes started to look the same lol.

Thanks for the great mod and help.
AltaGame
Registered User
Posts: 35
Joined: Tue Nov 29, 2005 1:51 am

Problems installing using easymod

Post by AltaGame »

Hey everyone, I really want to get this mod working as I think it is perfect for what I was looking for. However, when trying to install the script using easymod, I get the following error and it will not let me install it.

I am using the Morpheus template and also tried changing it back to the subsilver but still got the error message...

I tried to search the boards, but the search isnt working, I also looked back a few pages to see if this was a common error, but came up empty.

Any help would be appreciated;

Code: Select all

Critical Error

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

// 
// Obtain a list of topic ids which contain 
// posts made since user last visited 
// 
if ($userdata['session_logged_in']) 
{ 
// 60 days limit 
if ($userdata['user_lastvisit'] < (time() - 5184000)) 
{ 
$userdata['user_lastvisit'] = time() - 5184000; 
} 
$sql = "SELECT t.forum_id, t.topic_id, p.post_time 
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p 
WHERE p.post_id = t.topic_last_post_id 
AND p.post_time > " . $userdata['user_lastvisit'] . " 
AND t.topic_moved_id = 0"; 
if ( !($result = $db->sql_query($sql)) ) 
{ 
message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql); 
} 
$new_topic_data = array(); 
while( $topic_data = $db->sql_fetchrow($result) ) 
{ 
$new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time']; 
} 
$db->sql_freeresult($result); 
} 

MOD script line #306 :: FAQ :: Report

Thanks, Chris
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Re: Problems installing using easymod

Post by asinshesq »

AltaGame, are you sure you are on phpbb2.0.20 now? The code that easymod says it can't find was introduced in phpbb2.0.18 so if you are on a version earlier than 2.0.18 you won't see it (in which case you need to upgrade anyway to avoid getting hacked).

Otherwise, some other mod has already changed that code in index.php. In that case, post your index.php code here (use the [code] tag before and the [/code] tag after so it remains legible) and we'll see if we can figure out what the story is.
User avatar
oshawapilot
Registered User
Posts: 126
Joined: Fri Mar 24, 2006 8:40 pm
Location: Ontario Canada
Contact:

Post by oshawapilot »

Hmm.. Ok, I searched the (now really, really long) thread for an answer before posting this, so hopefully I'm not just being obtuse and am missing something.

I tried installing this to my board this evening, and received an installation failed message.

I'm running the latest version of PhpBB as well as Easymod.

Based on the error messages, it seems perhaps it's my installed (and primary) theme (Apollo, from http://www.hvmdesign.com) that is causing the install to choke.

Are there some themes that either this mod, or perhaps Easymod itself, doesn't play nice with?

Thanks
Mark
robertut
Registered User
Posts: 47
Joined: Fri Sep 23, 2005 2:38 pm

Post by robertut »

Hi All!

phpbb 2.0.20 installed, added the mod successfully.

But unfortunately reading a topic doesn't make it unread! Only clicking mark topics as read.
My topics keep staying unread, no matter if I read them...

What can i do?

Thanks
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

robertut wrote: Hi All!

phpbb 2.0.20 installed, added the mod successfully.

But unfortunately reading a topic doesn't make it unread! Only clicking mark topics as read.
My topics keep staying unread, no matter if I read them...

What can i do?

Thanks


Did you make the changes I describe a few posts ago (I assume you did since you were able to install, but I just wanted to check).

Did you install with easymod? If not, try going back to your backup files and reinstalling with easymod.
robertut
Registered User
Posts: 47
Joined: Fri Sep 23, 2005 2:38 pm

Post by robertut »

asinshesq wrote:
robertut wrote:Hi All!

phpbb 2.0.20 installed, added the mod successfully.

But unfortunately reading a topic doesn't make it unread! Only clicking mark topics as read.
My topics keep staying unread, no matter if I read them...

What can i do?

Thanks


Did you make the changes I describe a few posts ago (I assume you did since you were able to install, but I just wanted to check).

Did you install with easymod? If not, try going back to your backup files and reinstalling with easymod.


With the latest EasyMOD: I tried to install at first with no success. Then made the modifications you said, and completed successfully.
And it started behaving like I described...
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

Robertut, a few questions:

1. Do you have any other mods installed, or are you saying you started with a brand new 2.0.20 set of files and added only this mod (using easymod)?

2. Is index working properly (showing unread forums only when there are unread forums)?

3. Is viewtopic ok when you actually open up the topic that says its unread but that you've already read? (in other words do all the posts in that topic show as read or do some have yellow flags?)

4. Are you sure it's not working? If you have a topic with multiple pages and you read a page with unread posts at a time when there are subsequent pages in the same topic with unread posts, the topic will remain 'unread' untill you have read through the last page.
Post Reply

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