Advertisement:

Author Topic: Force Topic Read on Login  (Read 75913 times)

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: Force Topic Read on Login
« Reply #40 on: September 01, 2008, 08:56:34 AM »
Well, it's based on SMF's "mark read" status. I'm unsure if that's cookie based or not. I *could* add a field to the member table once the member has read it, and then clean that out every time the topic ID changes.
Do NOT PM me for support.

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

Offline ManilaGurL

  • Semi-Newbie
  • *
  • Posts: 74
Re: Force Topic Read on Login
« Reply #41 on: September 01, 2008, 11:17:48 AM »
Will this work with DilberMC and TinyPortal installed?

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: Force Topic Read on Login
« Reply #42 on: September 01, 2008, 11:27:05 AM »
It should work on any theme. And I'm not sure about any TP conflict yet, but you can try it.
Do NOT PM me for support.

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

Offline ASF

  • Jr. Member
  • **
  • Posts: 113
  • Gender: Male
Re: Force Topic Read on Login
« Reply #43 on: September 01, 2008, 01:50:17 PM »
I installed but i get this error at the top of my forum..

/ Start Force Read Topic on Login Mod $txt['force_read_enable'] = 'Enable Force Read Topic on Login mod?
(This will force users to read this topic when they login, if they haven\'t read it before.)'; $txt['force_read_topic_id'] = 'Enter the Topic ID'; // End Force Read Topic on Login Mo

i'm using smf 1.1.5

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: Force Topic Read on Login
« Reply #44 on: September 01, 2008, 03:12:45 PM »
Open your Modifications.english.php

Make sure that ?> is at the end of the file. If not, move it there.

Save and upload.
Do NOT PM me for support.

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

Offline 4Kstore

  • SMF Hero
  • ******
  • Posts: 4,314
  • Gender: Male
    • agustintari on Facebook
    • @agustintarifa on Twitter
    • SSIMPLE TEAM PAGE
Re: Force Topic Read on Login
« Reply #45 on: September 01, 2008, 10:05:34 PM »
Thx For the mod.

Spanish traduction:

Modifications.spanish.php
Code: [Select]
// Force Read Topic on Login Mod
   / Start Force Read Topic on Login Mod
$txt['force_read_enable'] = 'Activar Force Read Topic on Login mod?<br /><span class="smalltext" style="font-weight: bold;">(Esto forzara a los usuarios a leer este topic cuando ellos se loggen, solo si no lo leyeron antes.)</span>';

$txt['force_read_topic_id'] = 'Ingresar el ID del topic';


Help.spanish.php:
Code: [Select]
// Start Force Read Topic on Login Mod
$helptxt['force_read_topic_id'] = 'Para el econtrar el id del topic,haga lo siguiente:<br />-Abra el topic que desee.<br />-Copie la URL que sera de esta forma: http://tusitio.com/forum/index.php?topic=<b>123456</b>.0<br />-Copie el id del topic (ejemplo, lo marcado con negrita: <b>123456</b>)<br />-y vaya a Características y Opciones > Basic Settings es su panel de admin<br />-Pegue el topic id (ej: <b>123456</b>) dentro del box de " Ingresar el ID del topic"';
// End Force Read Topic on Login Mod

i wait the next version with membergroups permissions

Baiis (!)
¡¡NEW MOD: Sparkles User Names!!!

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: Force Topic Read on Login
« Reply #46 on: September 01, 2008, 10:16:53 PM »
Thanks 4kstore, I'll include those translations in the next version.
Do NOT PM me for support.

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

Offline bran8464

  • Semi-Newbie
  • *
  • Posts: 90
Re: Force Topic Read on Login
« Reply #47 on: September 08, 2008, 08:54:20 AM »
Nice mod idea. I have installed it and checked the box plus the topic id but I cannot get it to work. I logged out of admin and used a test member ID but no success. I then checked with a member and it didn't work for him either. Any help would be much appreciated.

Freedom Island
« Last Edit: September 08, 2008, 08:58:07 AM by bran8464 »

Offline Eliana Tamerin

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,611
  • Gender: Female
Re: Force Topic Read on Login
« Reply #48 on: September 08, 2008, 08:57:12 AM »
And users have access to this topic?

Would you mind PMing me a test admin and test non-admin account details?
Do NOT PM me for support.

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

Offline Kimmie

  • SMF Hero
  • ******
  • Posts: 1,590
Re: Force Topic Read on Login
« Reply #49 on: September 08, 2008, 01:29:33 PM »
Theirs definitely somethign weird going on with it. I have a test account that I log in with periodically to keep an eye on things without being logged in as admin and every time I log in, it redirects me to my rules thread. I also have the Topic Log mod installed so I can see who all has viewed a topic and this account only shows as having viewed the topic "once" so something somewhere isnt updating. Not sure if its this mod, or the topic mod log, but in either case, that is also tied to the files within SMF that record "views".

Heck if I know..lol

I hope its not redirecting every member every time they log in.. that would be a big deterrent to folks. :(
« Last Edit: September 08, 2008, 01:31:17 PM by Kimmie »

Offline M@nNiak

  • Semi-Newbie
  • *
  • Posts: 51
Re: Force Topic Read on Login
« Reply #50 on: September 14, 2008, 07:16:01 AM »
i already installed, and works great!.

thanks.   :D

Offline digit

  • Sophist Member
  • *****
  • Posts: 1,364
  • Gender: Male
Re: Force Topic Read on Login
« Reply #51 on: September 14, 2008, 11:30:01 AM »
Weird...  it worked for me until recently.

Now even if I update the topic ID no one is redirected. 

 >:(
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

Offline DirtRider

  • SMF Hero
  • ******
  • Posts: 1,415
  • Gender: Male
  • Just Looking
    • TriumphTalk
Re: Force Topic Read on Login
« Reply #52 on: September 18, 2008, 07:13:30 AM »
I have upgraded to SMF 1.1.6 and the mod has stopped working       
http://www.triumphtalk.com

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

Offline EV

  • Semi-Newbie
  • *
  • Posts: 38
Re: Force Topic Read on Login
« Reply #53 on: September 25, 2008, 12:13:04 PM »
Has there been a fix yet for this?  I doesn't work at all for me.

Before I apply the mod this is what is displayed.

Installing this package will perform the following actions:
   Type    Action    Description
1.    Execute Modification    .\Sources/LogInOut.php    Test successful
2.    Execute Modification    .\Sources/ModSettings.php    Test successful
3.    Execute Modification    .\Themes\default/languages/Modifications.english.php    Test successful
4.    Execute Modification    .\Themes\default/languages/Modifications.english-utf8.php    Skipping file
5.    Execute Modification    .\Themes\default/languages/Modifications.english_british.php    Skipping file
6.    Execute Modification    .\Themes\default/languages/Modifications.english_british-utf8.php    Skipping file
7.    Execute Modification    .\Themes\default/languages/Help.english.php    Test successful
8.    Execute Modification    .\Themes\default/languages/Help.english-utf8.php    Skipping file
9.    Execute Modification    .\Themes\default/languages/Help.english_british.php    Skipping file
10.    Execute Modification    .\Themes\default/languages/Help.english_british-utf8.php    Skipping file
« Last Edit: September 30, 2008, 10:03:49 AM by EV »

Offline EV

  • Semi-Newbie
  • *
  • Posts: 38
Re: Force Topic Read on Login
« Reply #54 on: September 30, 2008, 01:55:18 PM »
I found why this isn't working on my system.

The following code is always empty or nothing.  It never determines a user has access to the topic, even though they do.

Code: [Select]
   $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);

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,526
  • Young and Foolish
    • SimplePortal
Re: Force Topic Read on Login
« Reply #55 on: October 01, 2008, 07:46:38 AM »
EV, what is the problem with that code? Can you elaborate?

- Mod should be enabled
- A correct topic ID should be set from settings
- User logging in, should have never read the topic

Tested with a fresh 1.1.6 and no problems for me. You might be missing a small point.
Former SMF Core Developer | My Mods | SimplePortal

Offline EV

  • Semi-Newbie
  • *
  • Posts: 38
Re: Force Topic Read on Login
« Reply #56 on: October 01, 2008, 09:18:41 AM »
EV, what is the problem with that code? Can you elaborate?

- Mod should be enabled
- A correct topic ID should be set from settings
- User logging in, should have never read the topic

Tested with a fresh 1.1.6 and no problems for me. You might be missing a small point.

Check this thread out. 

http://www.simplemachines.org/community/index.php?topic=265175.0

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,526
  • Young and Foolish
    • SimplePortal
Re: Force Topic Read on Login
« Reply #57 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:

Code: [Select]
   // 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:

Code: [Select]
$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);
Former SMF Core Developer | My Mods | SimplePortal

Offline digit

  • Sophist Member
  • *****
  • Posts: 1,364
  • Gender: Male
Re: Force Topic Read on Login
« Reply #58 on: October 01, 2008, 01:46:31 PM »
sigh.... trying to follow this (how many related threads do we have?)

What file is the above referenced code on?

Thanks in advance.
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

Offline [SiNaN]

  • SMF Super Hero
  • *******
  • Posts: 11,526
  • Young and Foolish
    • SimplePortal
Re: Force Topic Read on Login
« Reply #59 on: October 01, 2008, 02:29:20 PM »
This is the only one, no worries. Above code should be in LogInOut.php after you install the mod.
Former SMF Core Developer | My Mods | SimplePortal