Page Index Toggle Pages: 1 [2] 3 4 ... 9 Send TopicPrint
Very Hot Topic (More than 25 Replies) [DONE] Go to last post read by user! (Read 51271 times)
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 #15 - Apr 20th, 2002 at 5:46pm
Print Post  
ok...so at least SOMETHING is working :)

I think there is something like this:
$lastread is defined now ONLY for the thread you are viewing. You think it would work if I defined another variable to the $lastread info read from the file?
  

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 #16 - Apr 20th, 2002 at 7:00pm
Print Post  
The trouble is the three subroutines getlog, modlog and dumplog. They call each other, and the problem is finding out which one isn't passing the variable to the other two.
  


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 #17 - Apr 20th, 2002 at 7:42pm
Print Post  
let's see...getlog passes it on, dumplog writes it, but modlog was never changed to do anything about it?
  

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 #18 - Apr 20th, 2002 at 9:02pm
Print Post  
When a thread is viewed, display.pl calls the  dumplog subroutine, passing it the new information to save to the users log.
&dumplog($mnum,$mdate,$mreplies);

Dumplog calls modlog to format the information.
if( @_ ) { &modlog(@_); }

Modlog calls getlog to read the existing information from the users log file.
unless( defined %yyuserlog ) { &getlog; }

Getlog passes this information back to dumplog via modlog.
return $yyuserlog{$entry};

This is why it is confusing!
  


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 #19 - Apr 20th, 2002 at 9:10pm
Print Post  
why should all be so complicated with this!

I've added $lastreadr into all return statements now...
  

lastreadbeta5.mod ( 4 KB | 140 Downloads )

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

Back to top
IP Logged
 
Gobalopper
Junior Member
**
Offline



Posts: 89
Joined: Jul 27th, 2001
Re: [BETA] Go to last post read by user!
Reply #20 - Apr 20th, 2002 at 9:15pm
Print Post  
krikket you still need a board to test this on? Or is your server back up?
If you do I can throw up a test board on my server. I'm going to do it anyhow but I can give you access if you want.
  
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 #21 - Apr 20th, 2002 at 10:06pm
Print Post  
@krikkert: Take Gobalopper up on his offer, and you will see what I mean.
  


World Domination, one smiley at a time!
Back to top
 
IP Logged
 
Gobalopper
Junior Member
**
Offline



Posts: 89
Joined: Jul 27th, 2001
Re: [BETA] Go to last post read by user!
Reply #22 - Apr 20th, 2002 at 10:18pm
Print Post  
Yep I had a few guys test it out with me and I get the same problem BHRA had. It only writes a | and nothing else.
Also recent posts doesn't seem to work properly anymore, it just lists the last post from the thread. ie I have two threads and it only shows the last two posts from those threads. I'll mess around with it some more see if I can figure out some of the problems.
  
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 #23 - Apr 21st, 2002 at 9:22am
Print Post  
Quote:
There's lots of @_ and $_ to deal with, so this may take a while!


is @_ what is being sent to the routine through &routine(parameter1, parameter2); or is it also what is returned from a called subroutine??

EDIT: @gobalopper: yeah, my board is still down Angry
  

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 #24 - Apr 21st, 2002 at 11:30am
Print Post  
If you use
Code
Select All
$result = &routine($parameter1, $parameter2);

sub routine {
	my ($parameter1, $parameter2) = @_;
	$variable = $parameter1 + $parameter2
	return $variable;
} 



This sends parameter1 and parameter2 to the subroutine, which receives it by looking at @_ or $_. The subroutine sends back the information specified in the return statement, so $result = $variable.

However, the subroutines in this case don't return the variables directly, but use %yyuserlog instead.


(at least that's how I *think* it works! I'm still learning this stuff!)
  


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 #25 - Apr 21st, 2002 at 11:34am
Print Post  
what if we make the routine do it the normal way, with $variables instead of %hashes?
  

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 #26 - Apr 21st, 2002 at 11:41am
Print Post  
I think the %yyuserlog is used because it's sending lots of variables between the different subroutines, not just one...

...Besides, I don't want to mess around with it too much, in case we break something else!
  


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 #27 - Apr 21st, 2002 at 11:55am
Print Post  
why not just change a little bit of code so that the $yyuserlog{$entry} = $time|$lastread; or something?
  

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 #28 - Apr 21st, 2002 at 12:04pm
Print Post  
I tried that, it still only saved $lastread for the thread currently being viewed. Sad
  


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 #29 - Apr 21st, 2002 at 12:07pm
Print Post  
hmm.....what about saving the lastread things in a separate log file?
  

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

Back to top
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 4 ... 9
Send TopicPrint