News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Force Topic Read on Login

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

Previous topic - Next topic

Eliana Tamerin

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!

ManilaGurL

Will this work with DilberMC and TinyPortal installed?

Eliana Tamerin

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!

ASF

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

Eliana Tamerin

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!

4Kstore

Thx For the mod.

Spanish traduction:

Modifications.spanish.php

// 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:

// 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!!!

Eliana Tamerin

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!

bran8464

#47
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

Eliana Tamerin

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!

Kimmie

#49
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. :(

M@nNiak

i already installed, and works great!.

thanks.   :D

digit

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!)

DirtRider

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. "

EV

#53
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

EV

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.

   $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);

[SiNaN]

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

EV

Quote from: [SiNaN] 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.

Check this thread out. 

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

[SiNaN]

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);
Former SMF Core Developer | My Mods | SimplePortal

digit

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!)

[SiNaN]

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

Advertisement: