by gw » Sun Apr 10, 2005 4:24 pm
Pete,
Here goes ...
The location I found is in yabb/sources/Post.pl. The version I have has this version info at the beginning:
# Version: YaBB 1 Gold - SP 1.3
# Released: December 2001; Updated April 6, 2003
In the function Post2, at line 663, there is this bit of code:
if($username ne 'Guest') {
# Increment post count for the member.
$settings[6] =~ s/[\n\r]//g;
++$settings[6];
fopen(FILE, ">$memberdir/$username.dat") || &fatal_error("213 $txt{'106'}: $txt{'23'} $username.dat");
foreach (@settings) {
print FILE qq~$_\n~;
}
fclose(FILE);
}
This appears to be the code that increments post count ($settings[6]) if the user is not Guest and writes it back out to the user's dat file. Just above this, at line 647, is this guy:
fopen(FILE, "+<$boardsdir/$currentboard.txt", 1) || &fatal_error("211 $txt{'106'}: $txt{'23'} $currentboard.txt");
This line is opening the current board's txt file. We're not necessarily interested in the txt file but the line does show that the current board name is in the variable $currentboard.
So, at a minimum, you could do something like this at line 663:
if($username ne 'Guest' && $currentboard ne 'xxxx') {
where xxxx is the internal name of Cafe Simviation, for example.
Here's what I'll do. To make sure that this idea works I will try it on my yabb system at work on Monday. It's lightly used so, if I break something, I can repair it without a lot of problem.
What I'm inclined to do is insert a function call so you can get more elaborate in your decision making. So the post count code above would be changed to look like this:
if($username ne 'Guest') {
$countPosts = doWeCountPosts($username, $currentboard); # do we count this post?
if($countPosts == 1) {
# Increment post count for the member.
$settings[6] =~ s/[\n\r]//g;
++$settings[6];
fopen(FILE, ">$memberdir/$username.dat") || &fatal_error("213 $txt{'106'}: $txt{'23'} $username.dat");
foreach (@settings) {
print FILE qq~$_\n~;
}
fclose(FILE);
}
}
I would insert the function doWeCountPosts at the end of Post.pl. In it you could do whatever logic was necessary to determine whether to count posts or not. For example, you could have a text file in the Boards directory that listed the internal names of the boards you didn't want to count posts for. If you find $currentboard in the file then return 0 otherwise return 1. To make it a bit more bulletproof, if our special file doesn't exist then return 1. Initially you'd have to maintain the file with vi but we could probably add an admin function to make it more friendly.
This all sounds great but, just to make sure, I will try this on Monday and let you know.
Gordon
Cessna N7654 ready to copy IFR clearance to KSMF.
Cessna N7654 cleared to KSMURF as filed.