Page Index Toggle Pages: [1] 2 3 ... 9 Send TopicPrint
Very Hot Topic (More than 25 Replies) [DONE] Go to last post read by user! (Read 51265 times)
Christer Alexander
God Member
*****
Offline


Make my day...

Posts: 3443
Location: Lethbridge
Joined: Feb 10th, 2002
Gender: Male
[DONE] Go to last post read by user!
Apr 20th, 2002 at 2:04pm
Print Post  
The desired mod that lets you continue where you left off! This mod saves the reply counter into the user's log file, and makes the New Post indicator into a link to go to the last read post.
Please do not yell at me for any errors, because I have a headache, and can't concentrate very good.

Latest version is at page 5
« Last Edit: May 2nd, 2002 at 2:50pm by Christer Alexander »  

lastreadbeta1.mod (Attachment deleted)

Code
Select All
unless(0) { stab("LoonyPandora"); next; } 

Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #1 - Apr 20th, 2002 at 3:35pm
Print Post  
Great work krikkert!


Couple of things though:

1...The sub modlog { is replaced, but I can't see what has been changed.

2...Your first search and replace, replaces a section of code with a blank line - this isn't a good idea because you cannot uninstall the mod!

3...You also remove the $counter = $start; code. Isn't it needed anywhere?

4...Should you be saving this number anyway? or should you save $mreplies + 1? (where you've got it at the moment, $lastpost will equal $maxmessagedisplay)


  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Christer Alexander
God Member
*****
Offline


Make my day...

Posts: 3443
Location: Lethbridge
Joined: Feb 10th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #2 - Apr 20th, 2002 at 3:44pm
Print Post  
hehe...
1: I loaded all three subs which changed the logs into the Mod Editor, and forgot to remove those who didn't change  Grin
2: That's a problem...I'll fix that asap

3: Did I remove that? I don't remember doing that...
  

Code
Select All
unless(0) { stab("LoonyPandora"); next; } 

Back to top
IP Logged
 
Christer Alexander
God Member
*****
Offline


Make my day...

Posts: 3443
Location: Lethbridge
Joined: Feb 10th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #3 - Apr 20th, 2002 at 3:48pm
Print Post  
issue 3: hehe...the code tag was <replace>...should be <add after> Smiley

new version is attached
  

lastreadbeta2.mod (Attachment deleted)

Code
Select All
unless(0) { stab("LoonyPandora"); next; } 

Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #4 - Apr 20th, 2002 at 3:49pm
Print Post  
Quote:
<search for>
     $counter = $start;
</search for>

<replace>
....


(but check point 4 above!)

[Edit: you just beat me!]
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Christer Alexander
God Member
*****
Offline


Make my day...

Posts: 3443
Location: Lethbridge
Joined: Feb 10th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #5 - Apr 20th, 2002 at 4:12pm
Print Post  
hehe...I just skimmed through the file and thought "oh sh*t....wrong code, I hope nobody installed yet;D"

Will this say that it works?
  

Code
Select All
unless(0) { stab("LoonyPandora"); next; } 

Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #6 - Apr 20th, 2002 at 4:20pm
Print Post  
Was it working on your board? Because I'm testing it now and I'm running into problems.

The lastpost number isn't being saved in the log file, and I've lost all my "new" indicators! If I find out why, I'll let you know.

In the mean time, check your code and make sure you included all the changes in the mod file.
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Christer Alexander
God Member
*****
Offline


Make my day...

Posts: 3443
Location: Lethbridge
Joined: Feb 10th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #7 - Apr 20th, 2002 at 4:34pm
Print Post  
I never did test this on my forums, since my server is down...

but how can the lastread not be saved? all I did to the saving routine was changing:

print MLOG qq~$_||$yyuserlog{$_}\n~;
to

print MLOG qq~$_||$yyuserlog{$_}|$lastread\n~;
  

Code
Select All
unless(0) { stab("LoonyPandora"); next; } 

Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #8 - Apr 20th, 2002 at 4:47pm
Print Post  
it's saving the additional "|" character, but the value of $counter isn't being passed to the subroutine, so it thinks $lastpost = ""
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Christer Alexander
God Member
*****
Offline


Make my day...

Posts: 3443
Location: Lethbridge
Joined: Feb 10th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #9 - Apr 20th, 2002 at 4:55pm
Print Post  
ok, Display now sends the $counter to the sub along with $mnum and $mdate, and the sub splits $_ back into these three...sounds correct?
  

lastreadbeta3.mod (Attachment deleted)

Code
Select All
unless(0) { stab("LoonyPandora"); next; } 

Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #10 - Apr 20th, 2002 at 4:56pm
Print Post  
You probably want to leave the "mark current thread as read" code where it was originally, but change it to

Code
Select All
	# Mark current thread as read.
	($mnum,$tmpa,$tmpa,$tmpa,$mdate,$mreplies) = split(/\|/,$yyThreadLine);
	$mreplies++;
	&dumplog($mnum,$mdate,$mreplies); 



and then change the dumplog subroutine to save the read and save the extra variable.
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Christer Alexander
God Member
*****
Offline


Make my day...

Posts: 3443
Location: Lethbridge
Joined: Feb 10th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #11 - Apr 20th, 2002 at 5:00pm
Print Post  
ok, I've added your corrections...(I'm popping out betas faster than a rabbit Grin )
  

lastreadbeta4.mod ( 3 KB | 146 Downloads )

Code
Select All
unless(0) { stab("LoonyPandora"); next; } 

Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #12 - Apr 20th, 2002 at 5:08pm
Print Post  
You're too quick! I haven't told you what changes to make to dumplog (and modlog) to read in the information!
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Christer Alexander
God Member
*****
Offline


Make my day...

Posts: 3443
Location: Lethbridge
Joined: Feb 10th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #13 - Apr 20th, 2002 at 5:14pm
Print Post  
Quote:
ok, Display now sends the $counter to the sub along with $mnum and $mdate, and the sub splits $_ back into these three...sounds correct?


hehe...I was already adding that to the code Wink
  

Code
Select All
unless(0) { stab("LoonyPandora"); next; } 

Back to top
IP Logged
 
BHRA Webmaster
God Member
*****
Offline


Mod Author of the Year
2002

Posts: 5238
Location: BHRA Headquarters
Joined: Jan 18th, 2002
Gender: Male
Re: [BETA] Go to last post read by user!
Reply #14 - Apr 20th, 2002 at 5:29pm
Print Post  
Hmmm.

I've got it saving the post count for the thread you are currently viewing, but it keeps deleting all the rest of them.

There's lots of @_ and $_ to deal with, so this may take a while!
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 ... 9
Send TopicPrint