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

sattninja

holy ****** man hod onto your hat
1.     Set the default session length for login      1.0       [ Uninstall ]  [ List Files ]  [ Delete ]
2.    Team Page    3.2    [ Uninstall ] [ List Files ] [ Delete ]
3.    nCode Image Resizer    1.2    [ List Files ] [ Delete ]
4.    Anonymize Links    2.5    [ Uninstall ] [ List Files ] [ Delete ]
5.    MonthUser    1.0    [ Uninstall ] [ List Files ] [ Delete ]
6.    BK-SMF Sub-Board    1.5    [ Uninstall ] [ List Files ] [ Delete ]
7.    Moderator and Administrator Comment Tags    1.7    [ Uninstall ] [ List Files ] [ Delete ]
8.    Display Name On Registration    2.0    [ Uninstall ] [ List Files ] [ Delete ]
9.    Dynamic_Memberlist    2.0.2    [ Uninstall ] [ List Files ] [ Delete ]
10.    Yet Another Global Announcements Mod    2.4    [ Install Mod ] [ List Files ] [ Delete ]
11.    vNES Integration    1.0    [ Uninstall ] [ List Files ] [ Delete ]
12.    Board Notices    1.0    [ Uninstall ] [ List Files ] [ Delete ]
13.    Extended Registration Notifications    0.9    [ Uninstall ] [ List Files ] [ Delete ]
14.    InformationBar    1.0    [ Uninstall ] [ List Files ] [ Delete ]
15.    PageDropdown    1.3    [ Uninstall ] [ List Files ] [ Delete ]
16.    SideSparks Chat Integration    1.2.1    [ Uninstall ] [ List Files ] [ Delete ]
17.    Signature Prompt    1.0    [ Uninstall ] [ List Files ] [ Delete ]
18.    Mark Personal Messages as Read    1.0    [ Uninstall ] [ List Files ] [ Delete ]
19.    Menu Order    0.1    [ Uninstall ] [ List Files ] [ Delete ]
20.    Reason For Editing Mod    2.3.2    [ Uninstall ] [ List Files ] [ Delete ]
21.    Join Reason    1.2.1    [ Install Mod ] [ List Files ] [ Delete ]
22.    Auto Link Checker    1.1    [ Uninstall ] [ List Files ] [ Delete ]
23.    Add to Existing Ban Group    1.0    [ Uninstall ] [ List Files ] [ Delete ]
24.    [BBCode] Blink    1.0    [ Uninstall ] [ List Files ] [ Delete ]
25.    Global Headers Footers    2.0    [ Uninstall ] [ List Files ] [ Delete ]
26.    Remove SMF Logo    1.301    [ Uninstall ] [ List Files ] [ Delete ]
27.    Add Favicon.ico Support    1.101    [ Uninstall ] [ List Files ] [ Delete ]
28.    Simple Award System    2.1    [ Uninstall ] [ List Files ] [ Delete ]
29.    Force Topic Read On Login Mod    2.1    [ Uninstall ] [ List Files ] [ Delete ]
30.    Member Awards    2.2.1    [ List Files ] [ Delete ]
31.    Activity_Bar    1.0.1.2    [ Uninstall ] [ List Files ] [ Delete ]
32.    last login    2.3    [ Uninstall ] [ List Files ] [ Delete ]
33.    Tapatalk SMF Plugin    0.9.10    [ Install Mod ] [ List Files ] [ Delete ]
34.    Add IP2Location to Track IP    1.3    [ Uninstall ] [ List Files ] [ Delete ]
35.    SMF4iPhone-Mod    1.0    [ Uninstall ] [ List Files ] [ Delete ]
36.    Users Online Today    1.5.6    [ Uninstall ] [ List Files ] [ Delete ]
37.    Default_Membergroup    1.0.0.3    [ Uninstall ] [ List Files ] [ Delete ]
38.    Bookmarks    2.3    [ Uninstall ] [ List Files ] [ Delete ]
39.    Copy Topics    1.6    [ Uninstall ] [ List Files ] [ Delete ]
40.    Center Post Box    1.0    [ Uninstall ] [ List Files ] [ Delete ]
41.    Enhanced PM Warning Message    1.0    [ Uninstall ] [ List Files ] [ Delete ]
42.    AjaxChat Integration    3.2.1 (modified for SMF 2 RC2)    [ Install Mod ] [ List Files ] [ Delete ]
43.    Post_Board_Select    1.2    [ Uninstall ] [ List Files ] [ Delete ]
44.    Best 3    0.1    [ Uninstall ] [ List Files ] [ Delete ]
45.    Custom Copyright    1.2    [ Install Mod ] [ List Files ] [ Delete ]
46.    Country Flags    1.1    [ Uninstall ] [ List Files ] [ Delete ]
47.    Menu Buttons    1.1    [ Uninstall ] [ List Files ] [ Delete ]
48.    Move Old Topics    1.3.5.2    [ Uninstall ] [ List Files ] [ Delete ]
49.    SimplePortal    2.3.1    [ Uninstall ] [ List Files ] [ Delete ]
50.    Thank-O-Matic    2.0 RC1.3    [ Uninstall ] [ List Files ] [ Delete ]
51.    Member Color Link    3.0.7    [ Uninstall ] [ List Files ] [ Delete ]
52.    Slash through Banned Usernames    1.0    [ Install Mod ] [ List Files ] [ Delete ]
53.    Login Security    1.0.2.1    [ Uninstall ] [ List Files ] [ Delete ]
54.    No Temp Directory Removal    1.0    [ Uninstall ] [ List Files ] [ Delete ]
55.    The Rules    1.3    [ Uninstall ] [ List Files ] [ Delete ]
56.    Referrals Mod    2.2.7.1    [ Uninstall ] [ List Files ] [ Delete ]
57.    Aeva Media    1.0 Alpha 2    [ Uninstall ] [ List Files ] [ Delete ]
58.    Post Ratings    1.1    [ Uninstall ] [ List Files ] [ Delete ]
59.    Admin member list registration date    1.1    [ Uninstall ] [ List Files ] [ Delete ]
60.    New Topic Button    1.0    [ Uninstall ] [ List Files ] [ Delete ]
61.    SMF Topic Prefix LM Mod    1.1    [ Uninstall ] [ List Files ] [ Delete ]
62.    ResizeImagesToFitScreen    0.1.5    [ Uninstall ] [ List Files ] [ Delete ]
63.    Buddy List Page    1.0    [ Uninstall ] [ List Files ] [ Delete ]
64.    Warning Point    1.5    [ Uninstall ] [ List Files ] [ Delete ]
65.    dQuoteSelection    2.4    [ Install Mod ] [ List Files ] [ Delete ]
66.    Personal Messages to Membergroups    1.4    [ Uninstall ] [ List Files ] [ Delete ]
67.    Tidy Child Boards    1.1    [ Uninstall ] [ List Files ] [ Delete ]
68.    Avatar On Board RC2    2.1    [ Uninstall ] [ List Files ] [ Delete ]
69.    Current Signature Mod    1.1    [ Uninstall ] [ List Files ] [ Delete ]
70.    Message for your guests    0.1    [ Uninstall ] [ List Files ] [ Delete ]
71.    Profile Comments    2.0    [ Uninstall ] [ List Files ] [ Delete ]
72.    Purge inactive members with a number of posts    1.0.2    [ Uninstall ] [ List Files ] [ Delete ]
73.    Next Topic Page    1.1    [ Uninstall ] [ List Files ] [ Delete ]
74.    Signature Area BBCode Buttons    2.0.1    [ Uninstall ] [ List Files ] [ Delete ]
75.    AvatarSelect    1.2.1    [ Install Mod ] [ List Files ] [ Delete ]
76.    New In Topic View    1.1    [ Uninstall ] [ List Files ] [ Delete ]
77.    Wysiwyg Quick Reply RC2    RC2    [ Uninstall ] [ List Files ] [ Delete ]
78.    Ban List    2.0    [ Uninstall ] [ List Files ] [ Delete ]
79.    Welcome Topic Mod    2.0.3    [ Uninstall ] [ List Files ] [ Delete ]
80.    Search Focus Dropdown
Running Rc4

codevarun

okay just desable the Login Security and hope it will sort out... (don't uninstall it for the moment)
Join: http://www.helponrelation.com/forum/

LETS HELP OTHERS

sattninja

i could not disable it so i uninstalled login security but still no go
Running Rc4

codevarun

Quote from: sattninja on June 25, 2010, 01:57:15 PM
i could not disable it so i uninstalled login security but still no go

have you read that post otherwise?
whats your site let me see that..
Join: http://www.helponrelation.com/forum/

LETS HELP OTHERS

sattninja

i have changed the post number  few times and i am logging in with a test acct brand new and hasn't read any posts at all

i will pm you with the log in
Running Rc4

sattninja

Running Rc4

sattninja

Running Rc4

sattninja

anyone i have checked everything all the code is in place but it just will not work i am lost
Running Rc4

DarkflameQ

Another mod i've never been able to get working.

Does anyone know of any mods that may interfere with this one?

sattninja

yeah i had the same problem man until i upgraded to RC3 and i havent installed all the mods i had but this one is working now maybe you  should post a list of your mods install let me see what matches what i had it is a place to start
Running Rc4

DarkflameQ

Too many to list to be honest (55+), i have none relating to logging in so that's why i'm curious to know if anyone knew of any mods in particular non login related that may interfere with this one.

It's very aggravating that mods break other mods but SMF without mods would only be average software at best.

sattninja

i agree

what version of smf are you running and you sound like me i had a crap load of mods running and like i said i just upgraded and didnt install alot of stuff just the real cool stuff and everything seems to be working now
Running Rc4

DarkflameQ

RC3 and all the mods i've installed, i've installed because they are useful to me and my site not just for the hell of it :)

The majority of the mods i have working so i'm happy for the most part, it's just little mods like this i leave till last, but i can live without them if i can't find a solution but it would be helpful if they did work.

petesky

#133
Question: I installed on RC4 but user will not be redirected to the topic set in Modsettings for some reason.
What can be the reason why user is not being redirected to ? Have to set something else ?

EDIT: OK sorry, just read obove thread right now  ;D Any suggestions ?

petesky

So, the update function works as expected as it is and i noticed still a problem with force topic read. So i decided to reduced the function without checking for existent topic and now it works.
Don't know why but have no time to debug this further.


dougiefresh

Thank you for the wonderful mod!  I thought I'd let everybody know that when I updated my forum from 2.0 RC5 to 2.0 Gold, I had to reinstall all my mods.  This mod installed without issues and without emulation.  Hope this info helps someone!

jeffreesworld

Not sure if I'll get a response... but I need help!

I need to know how to stop making a topic a force read.
I can't find the page of settings in my admin panel and every time I login I have to read the same page again and It's really annoying ._.
So if someone could help It'd be so appreciated! :)

floydpink

@jeffreesworld
UPDATE `{$db_prefix}settings` SET value =0 WHERE variable = 'force_read_enable'

floydpink

This is a great mod. The only restriction is that you can only force the viewing of one post at a time. As some of my members are not that regular it means waiting for quite a long time before being able to change the forced post to a new one.
Here's an update to the mod that allows a list of posts to be entered e.g. 1233,1243,1255 such that the first post in the list that hasn't been read is displayed.
Array of Forced Topics (Tested of Verion 1.1.16)
./Sources/LogInOut.php
Find
if (!empty($modSettings['force_read_enable']) && !empty($modSettings['force_read_topic_id']))
{
$topic = (int) $modSettings['force_read_topic_id'];
       
   // 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);

// Check if he read that topic.
   $request = db_query("
  SELECT ID_TOPIC
  FROM {$db_prefix}log_topics
  WHERE ID_TOPIC = $topic
AND ID_MEMBER = $ID_MEMBER
  LIMIT 1", __FILE__, __LINE__);
   list ($read) = mysql_fetch_row($request);
   mysql_free_result($request);
   
   // Just log you back out if it's in maintenance mode and you AREN'T an admin.
   if((empty($maintenance) || allowedTo('admin_forum')) && (empty($read) && !empty($exists)))
      redirectexit('topic=' . $topic . '.0');
   elseif ((empty($maintenance) || allowedTo('admin_forum')) && ((!empty($read)) || empty($exists)))
  redirectexit('action=login2;sa=check;member=' . $ID_MEMBER, $context['server']['needs_login_fix']);
   else
      redirectexit('action=logout;sesc=' . $sc, $context['server']['needs_login_fix']);
   }
   else
   {
    // Just log you back out if it's in maintenance mode and you AREN'T an admin.
if (empty($maintenance) || allowedTo('admin_forum'))
redirectexit('action=login2;sa=check;member=' . $ID_MEMBER, $context['server']['needs_login_fix']);
else
redirectexit('action=logout;sesc=' . $sc, $context['server']['needs_login_fix']);
}

Replace with // Floydpink INSERT - Replace Force Login Mod code above with more efficient version that allows arrays
// Force Topic Read MOD
    // Just log you back out if it's in maintenance mode and you AREN'T an admin.
if (allowedTo('admin_forum'))
redirectexit('action=login2;sa=check;member=' . $ID_MEMBER, $context['server']['needs_login_fix']);
else if (!empty($maintenance))
redirectexit('action=logout;sesc=' . $sc, $context['server']['needs_login_fix']);
else
{
if (!empty($modSettings['force_read_enable']) && !empty($modSettings['force_read_topic_id']))
{
$topicidlist = $modSettings['force_read_topic_id'];
    // 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 IN ($topicidlist)
  AND $user_info[query_see_board]
  ", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
{
$canseeids[] = $row['ID_TOPIC'];
}
  mysql_free_result($request);

if (!empty($canseeids))
{
// Check if already read each topic; show it if they haven't
foreach ($canseeids as $topic) {
$request = db_query("
SELECT ID_TOPIC
  FROM {$db_prefix}log_topics
  WHERE ID_TOPIC = $topic
AND ID_MEMBER = $ID_MEMBER
  LIMIT 1", __FILE__, __LINE__);
list ($read) = mysql_fetch_row($request);
    mysql_free_result($request);
   
    if(empty($read))
  redirectexit('topic=' . $topic . '.0');
}
}
}
// Default action
redirectexit('action=login2;sa=check;member=' . $ID_MEMBER, $context['server']['needs_login_fix']);
}
// Floydpink End EDIT


./Sources/ModSettings.php
Find // Force Read Topic on Login Mod
      array('check', 'force_read_enable',
      &$txt['force_read_desc']),
      array('int', 'force_read_topic_id'),
    '',

Replace with// Force Read Topic on Login Mod
      array('check', 'force_read_enable',
      &$txt['force_read_desc']),
      array('text', 'force_read_topic_id'),
    '',

Find
// Start Force Read Topic on Login Mod
$txt['force_read_enable'] = 'Enable Force Read Topic on Login mod?<br /><span class="smalltext" style="font-weight: bold;">(This will force users to read this topic when they login, if they haven\'t read it before.)</span>';
$txt['force_read_topic_id'] = 'Enter the Topic ID';
// End Force Read Topic on Login Mod

Replace with // Start Force Read Topic on Login Mod
$txt['force_read_enable'] = 'Enable Force Read Topic on Login mod?<br /><span class="smalltext" style="font-weight: bold;">(This will force users to read this topic when they login, if they haven\'t read it before.)</span>';
$txt['force_read_topic_id'] = 'Enter a list of Topic IDs separated by commas';
// End Force Read Topic on Login Mod

vbgamer45

Thanks floydpink for code example that should be very useful for people who need it.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Advertisement: