Previous Thread
Next Thread
Print Thread
Rating: 5
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338
Mod Name / Version: Correct mark posts as read or unread in Threaded mode

Description: Correctly read read/unread posts in threaded mode.
Testet in 6.5.1 (should also work in 6.5)

Working Under: UBB.Threads 6.5

Mod Status: Beta

Any pre-requisites:

Author(s): Yakub ([email protected])

Date: 02/21/05

Credits:

Files Altered: showthreaded.php

New Files: No.

Database Altered: Add U_TempRead (VARCHAR 255) field of the end of w3t_Users

Info/Instructions: Find:
$Subjectlinkstart = "";
$Subjectlinkstop = "";

Add below:
$read = "";

Find:
global $config,$dbh,$theme,$images,$ubbt_lang, $thispath,$tempstyle,$replycode,$tree,$z,$postrow,$modcheck, $var_start, $var_eq, $var_sep,$topicread,$mainpostid;

Change for:
global $config,$dbh,$theme,$images,$ubbt_lang, $thispath,$tempstyle,$replycode,$tree,$z,$postrow,$modcheck, $var_start, $var_eq, $var_sep,$topicread,$mainpostid,$read,$username2;

Find:
$imagesize = $images['icons'];
if (!in_array($PNumber,$topicread['threaded_read']['track']) && $Posted > $unread) {
$alt = "*";
$folder = "newfolder.gif";
$topicread[$mainpostid] = $html->get_date();
$_SESSION['topicread'] = $topicread;
}
else {
$alt = "*";
$folder = "nonewfolder.gif";
}
if ( ($Open == "C") || ($Open == "M") ){
$Icon = "lock.gif";
}
Change for:
$time = $html -> convert_time($Posted,$offset,$timeformat);
$alt = ".";


$check = ",$PNumber,";
$check_akt = ",$Number,";

$imagesize = $images['icons'];

if ($config['newcounter']) {

if ( (!strstr($read,$check)) && $Posted > $unread ) { //echo "debug1";

if ($check==$check_akt)
{
$alt = "*";
$folder = "nonewfolder.gif";
}
else
{
$alt = "*";
$folder = "newfolder.gif";
}
$topicread[$mainpostid] = $html->get_date();
$_SESSION['topicread'] = $topicread;

$read2 = $read . ",$Number,";
$Username_q = addslashes($username2);
$read_q = addslashes($read2);

$query = "
UPDATE {$config['tbprefix']}Users
SET U_TempRead = '$read_q'
WHERE U_Username = '$Username_q'
";




$dbh -> do_query($query);

}
else {
$alt = "*";
$folder = "nonewfolder.gif";
} }
if ( ($Open == "C") || ($Open == "M") ){
$Icon = "lock.gif";
}

Find:
// Get the user info
$userob = new user;
$user = $userob -> authenticate("U_Display, U_Groups, U_PostsPer, U_PicturePosts, U_FlatPosts, U_TimeOffset,U_ShowSigs,U_TimeFormat,U_Ignored,U_Preview,U_TextCols,U_TextRows");

Change for:
// -----------------
// Get the user info
$userob = new user;
$user = $userob -> authenticate("U_Display, U_Groups, U_PostsPer, U_PicturePosts, U_FlatPosts, U_TimeOffset,U_ShowSigs,U_TimeFormat,U_Ignored,U_Preview,U_TextCols,U_TextRows,U_TempRead,U_Username");
$read = $user['U_TempRead'];
$username2 = $user['U_Username'];

//echo $username2;

//echo $read;

Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.

Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.

Sponsored Links
Joined: Feb 2005
Posts: 7
Lurker
Lurker
Offline
Joined: Feb 2005
Posts: 7
Great... it seems to be working...

Joined: May 2004
Posts: 43
User
User
Offline
Joined: May 2004
Posts: 43
It works, but it doesn't. It works if you enter a forum from the main index page, but if you click the link of a thread from the main index, the lightbulb is still there when you open another browser at any time. Part of the problem solved though


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)