News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Force Topic Read on Login

Started by SMFHacks.com Team, August 28, 2008, 05:43:20 PM

Previous topic - Next topic

EV

Quote from: [SiNaN] on October 01, 2008, 10:47:48 AM
I see. Seems like the query see board is not updated until. This should fix it:

Find:

   // Check if the user can see the topic first.
   $request = db_query("
      SELECT t.ID_TOPIC
       FROM {$db_prefix}topics as t
  LEFT JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
      WHERE ID_TOPIC = $topic
      AND $user_info[query_see_board]
      LIMIT 1", __FILE__, __LINE__);
      list ($exists) = mysql_fetch_row($request);
      mysql_free_result($request);


Replace:

$groups = !empty($user_settings['additionalGroups'][0]) ? array_unique(array_merge(array($user_settings['ID_GROUP']), $user_settings['additionalGroups'])) : array($user_settings['ID_GROUP']);
$query = $user_info['is_admin'] ? '1' : '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $groups) . ', b.memberGroups))';

   // Check if the user can see the topic first.
   $request = db_query("
      SELECT t.ID_TOPIC
       FROM {$db_prefix}topics as t
  LEFT JOIN {$db_prefix}boards AS b ON (b.ID_BOARD = t.ID_BOARD)
      WHERE ID_TOPIC = $topic
      AND $query
      LIMIT 1", __FILE__, __LINE__);
      list ($exists) = mysql_fetch_row($request);
      mysql_free_result($request);


I just tried your fix and it does seem to work now.  Thank you for your assistance!  I really appreciate the effort.

[SiNaN]

You're welcome. And thanks for you too, for reporting and helping with identifying the bug.
Former SMF Core Developer | My Mods | SimplePortal

InternetMafia

Any plans to make this compatible with 1.1.6
Its better to be dead and cool than alive and uncool.

floydpink

I followed the manual instructions for 1.1.7 installation and its working like a dream.
Great mod, thanks.

DirtRider

Will this be upgraded for RC1 at all
http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

jossanaijr

Any news here?
What about force topic read only if member did not read it yet or if he did not read all new replies?

JBlaze

Update:

Mod taken over by JBlaze
Updated for 2.0 RC1.2 and 1.1.10
Jason Clemons
Former Team Member 2009 - 2012

JBlaze

Update:

7/29/09 - v2.1
! Fixed a bug that would throw a DB error for SMF 2.0 RC1.2
Jason Clemons
Former Team Member 2009 - 2012

Groundhog

Working good thanks (SMF 2.0 RC1) :)

JBlaze

Jason Clemons
Former Team Member 2009 - 2012

ralliart

any future plan for adding a feature that forces EVERYONE to read a specific thread rather than the new users?  :)

Eliana Tamerin

That's exactly what this does, ralliart. If your users haven't already read this topic (in which case, they're ahead of the game), then it directs them there the next time they log in. All users, young and old, new and ancient.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

ralliart

Quote from: Eliana Tamerin on July 29, 2009, 11:39:03 AM
That's exactly what this does, ralliart. If your users haven't already read this topic (in which case, they're ahead of the game), then it directs them there the next time they log in. All users, young and old, new and ancient.

Thanks for the clarification, Eliana.  :)

Ampix0

Ok i have a question.

Is this EVERY TIME the user logs in?

Because i would love a mod where if i have an announcement the user is asked to read it before continuing.

JBlaze

This mod makes it so that a user is forced to read a topic if they have not yet read it before. Once they read it, it is no longer forced upon them.
Jason Clemons
Former Team Member 2009 - 2012

imrich

Thanks for this great mod!

This appears to only support one 'must read' topic.

What I'd like is something that can allow more than one must read topic.

As an example:

First must read will be a 'forum code of conduct' which everyone must read.

Another could come up from time to time for a club, for example "The club meeting is postponed one week due to the holiday, don't forget!"

Is there any way to support more than one 'must read' topic on login?

The way it could work is for a new member, they would have to read each 'must read' topic. For someone that has been a member for a while, they would have read 'must read #1' already, so they wouldn't see it again. But if a new 'must read' comes up, then they will be forced to read it.

Is this possible?

Thanks for any advice and for your support of this helpful mod.


Blinker

For your rules, there's a redirect on activation mod that will send your new users to a certain location when they first activate.

After that you can use this mod for your single week to week "must read" topics.

If you need more than that there is also a redirect on login mod that you can use to send them to a certain topic.

It's a bit messy I know but you have some choices to make this all work.

Redirect on login/logout

Redirect users on activation

Redirect users on registration

imrich

Quote from: Blinker on September 06, 2009, 10:03:12 AM
For your rules, there's a redirect on activation mod that will send your new users to a certain location when they first activate.

After that you can use this mod for your single week to week "must read" topics.

If you need more than that there is also a redirect on login mod that you can use to send them to a certain topic.

It's a bit messy I know but you have some choices to make this all work.

Redirect on login/logout

Redirect users on activation

Redirect users on registration

Thanks for these ideas. They may come in handly. However at this time those mods require that SMF be configured in very certain ways (such as immediate activation). Our SMF is a small group and may be controlled, so we are considering using 'member approval' activation.

Blinker

It will still work. Member approval has an "approve and require activation" setting. That is what I use on my forum.

When the user activates they are immediately redirected to the forum rules.


imrich

Any update for SMF 2 RC2? :) thanks!

Advertisement: