UBB.Dev
Posted By: Max Fisch Mark all read revised - 02/14/2002 5:31 AM
This is a revised version of Sitstay's Mark All Read hack. It works for 5.5 , and includes installation instructions.

It includes another hack also from Sitstay, which will mark all read automatically for new users so the forums will load fast and they start fresh.

Max


Attached File
44338-markallread.zip  (16 downloads)
Posted By: AllenAyres Re: Mark all read revised - 02/14/2002 6:07 AM
Grazi []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]

This one does make a huge difference in forum speed... I'll update the one we have here []https://www.ubbdev.com/threads/php/images/icons/smile.gif[/]
Posted By: XanthViper Re: Mark all read revised - 02/14/2002 8:02 PM
I get this error on MARK ALL READ:

In reply to:

SQL ERROR: Unable to do_query: SELECT Bo_Keyword, Bo_Last FROM w3t_Boards WHERE Bo_Total > 0 AND ()
You have an error in your SQL syntax near ') ' at line 5
Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/html/sdsrdom/wwwthreads-php/markallread.php on line 141

Warning: Supplied argument is not a valid MySQL result resource in /home/httpd/html/sdsrdom/wwwthreads-php/mysql.inc.php on line 83




any ideas?
Posted By: caymuc Re: Mark all read revised - 02/15/2002 12:45 AM
I have that too!!

If you compare the (working) adduser-script with the (not-working) markallread-script, you find that [:red] difference:

// Grab all the boards in the database
$query = "
SELECT Bo_Keyword[:red], Bo_Last
FROM w3t_Boards
WHERE Bo_Total > 0
$groupquery
";
$boards = $dbh -> do_query($query);
[:red] $total = mysql_num_rows($boards);


Maybe that extra code is the problem?

Another problem is that inside the function there is a part of non-php HTML... that looks also unproper to me.
Posted By: caymuc Re: Mark all read revised - 02/15/2002 1:13 AM
No, I think I found it :

Should be:

$userob = new user;
$user = $userob -> authenticate("$Username","$Password","U_Username, U_Password, U_Groups, U_TimeOffset");
Posted By: Max Fisch CORRECTION - 02/15/2002 5:55 AM
Sorry... user authentication was incorrect... my apologies. This is my installed version which works. The name of the file should be markallread.php. The difference is:
after:
// Get the user info
you need to have:
$Username = $w3t_myname;
$Password = $w3t_mypass;

Regards,
Max
Posted By: Max Fisch Re: Mark all read revised - 02/15/2002 5:56 AM
See my post above, marked "CORRECTION" ... sorry about that.
Max
Posted By: Max Fisch Re: Mark all read revised - 02/15/2002 5:57 AM
Thanks caymuc,

The other way is to do what I described above, in my post entitled "Correction" ... it's my working version on 5.5

Regards,
Max
Posted By: Max Fisch attachment here - 02/15/2002 1:22 PM
forgot to attach

Attached File
44410-markallread4.txt  (43 downloads)
Posted By: XanthViper Re: Mark all read revised - 02/15/2002 3:58 PM
Thanks, this is what fixed it along with what Max Put in.

Posted By: razvan Re: attachment here - 03/16/2002 1:48 PM
Err... I just grabbed it and for some reason I fail to see the reason for this:
 $Board = 'websites';    // edit this board name to one on your site

// ---------------------------------------
// Set a cookie, or register a session var
if ($config[tracking] == "sessions") {
session_register('w3t_visit');
$w3t_visit .= "-$Board=$Last-";
}
else {
$w3t_visit .= "-$Board=$Last-";
setcookie("w3t_visit","$w3t_visit",0);
}
Why do we need to set the last time for a board?

[EDIT] I always keep forgetting something: you'll also have to add $config to the 'global' line of the domarkallread function (otherwise the test for cookie/session mode will not work properly)
Posted By: Max Fisch Re: attachment here - 03/17/2002 7:32 PM
I asked Sitstay the same question at the time... he gave an answer, frankly it was over my head.
Max
Posted By: dRiver Re: attachment here - 03/18/2002 11:51 AM
could someone please explain to me where to put
format: $phpurl/markallread.php?Cat=$Cat&action=markallread
when using 5.5.1?

I keep getting errors no mater where i place this piece of script.

cheers
Posted By: razvan Re: attachment here - 03/18/2002 7:47 PM
Actually, you need to place a line like:
<a href="$phpurl/markallread.php?Cat=$Cat&action=markallread" $target>Mark all read</a>$spacer
in ubbt.inc.php. You should look around line 347 -- there are a bunch of lines like that.
Posted By: dRiver Re: attachment here - 03/19/2002 12:36 AM
Thanks razvan,

This seems to make sense for 551

cheers
© UBB.Developers