I do appreciate that I may be missing something, but I am fully able to get it working for the users var - I am currently using that and it works fine. It just seems to be when I try it for a board.
Feel free to tell me to sod off, but please could you look over the below and see if anything stands out as incorrect?
System.pl
###############################################################################
# System.pl #
###############################################################################
# YaBB: Yet another Bulletin Board #
# Open-Source Community Software for Webmasters #
# Version: YaBB 2.1 #
# Released: November 8, 2005 #
# Distributed by: http://www.yabbforum.com #
# =========================================================================== #
# Copyright (c) 2000-2005 YaBB (www.yabbforum.com) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
# Sponsored by: Xnull Internet Media, Inc. - http://www.ximinc.com #
# Your source for web hosting, web design, and domains. #
###############################################################################
$systemplver = 'YaBB 2.1 $Revision: 1.2 $';
sub BoardTotals {
my ($job, @updateboards) = @_;
my ($testboard, $line, @lines, $updateboard, @boardvars, $tag, $cnt);
if (!@updateboards) { @updateboards = @allboards; }
if ($job eq "convert") {
fopen(FORUMTOTALS, ">>$boardsdir/forum.totals");
foreach $testboard (@allboards) {
chomp $testboard;
fopen(BOARDTTL, "$boardsdir/$testboard.ttl");
$line = <BOARDTTL>;
fclose(BOARDTTL);
chomp $line;
print FORUMTOTALS "$testboard|$line|\n";
unlink "$boardsdir/$testboard.ttl";
}
fclose(FORUMTOTALS);
}
if (@updateboards) {
if ($job eq "load") {
fopen(FORUMTOTALS, "$boardsdir/forum.totals");
@lines = <FORUMTOTALS>;
fclose(FORUMTOTALS);
my @tags = qw(board threadcount messagecount lastposttime lastposter lastpostid lastreply lastsubject lasticon);
###################
push(@tags,"test");
###################
foreach $line (@lines) {
chomp $line;
(@boardvars) = split(/\|/, $line);
foreach $updateboard (@updateboards) {
chomp $updateboard;
if ($boardvars[0] eq $updateboard && exists($board{ $boardvars[0] })) {
$loadedboards++;
for ($cnt = 1; $cnt < $#tags; $cnt++) {
${$uid.$updateboard}{ $tags[$cnt] } = $boardvars[$cnt];
}
}
}
}
}
if ($job eq "update") {
fopen(FORUMTOTALS, "+<$boardsdir/forum.totals");
seek FORUMTOTALS, 0, 0;
@lines = <FORUMTOTALS>;
truncate FORUMTOTALS, 0;
seek FORUMTOTALS, 0, 0;
my @tags = qw(board threadcount messagecount lastposttime lastposter lastpostid lastreply lastsubject lasticon);
###################
push(@tags,"test");
###################
print FORUMTOTALS "$updateboards[0]|";
for ($cnt = 1; $cnt <= $#tags; $cnt++) {
print FORUMTOTALS ${$uid.$updateboards[0]}{ $tags[$cnt] };
if ($cnt < $#tags) { print FORUMTOTALS "|"; }
}
print FORUMTOTALS "\n";
foreach $line (@lines) {
chomp $line;
(@boardvars) = split(/\|/, $line);
if ($boardvars[0] ne $updateboards[0] && exists($board{ $boardvars[0] })) {
print FORUMTOTALS "$line\n";
$loadedboards++;
}
}
fclose(FORUMTOTALS);
}
if ($job eq "delete") {
fopen(FORUMTOTALS, "$boardsdir/forum.totals");
seek FORUMTOTALS, 0, 0;
@lines = <FORUMTOTALS>;
truncate FORUMTOTALS, 0;
seek FORUMTOTALS, 0, 0;
foreach $line (@lines) {
chomp $line;
(@boardvars) = split(/\|/, $line);
if ($boardvars[0] ne $updateboards[0] && exists($board{ $boardvars[0] })) {
print FORUMTOTALS "$line\n";
$loadedboards++;
}
}
fclose(FORUMTOTALS);
}
if ($job eq "add") {
fopen(FORUMTOTALS, "$boardsdir/forum.totals");
seek FORUMTOTALS, 0, 0;
@lines = <FORUMTOTALS>;
truncate FORUMTOTALS, 0;
seek FORUMTOTALS, 0, 0;
print FORUMTOTALS "$updateboards[0]|0|0|N/A|N/A||||\n";
print FORUMTOTALS @lines;
fclose(FORUMTOTALS);
}
}
}
Write New Var
sub Display {
$board=$currentboard;
&BoardTotals("load",$board);
${$uid.$board}{'test'} = "appleade";
&BoardTotals("update",$board);
Forum.Totals
openelectrical|4|9|1146765872|admin|1146765873|0|teeererer|xx|appleade
info|2|2|1121214036|Squirrelman|1121236137|0|Tropical Fish Forum|thumbup|appleade
just_talk|2|6|1126887432|Martin|1122732119|4|Re: Hello|xx|appleade
comp_probs|4|11|1146773005|admin|1146773005|0|gh|xx|appleade
humour|7|7|1128261547|admin|1128261547|0|Just found this........always makes me laugh!|laugh|appleade
removed|0|0|N/A|N/A||||
paint|0|0|N/A|N/A||||
build|0|0|N/A|N/A||||
lounge|1|2|1128093958|admin|1121005102|1|Re: Welcome To The Lounge|xx
intrude|0|0|N/A|N/A||||
admin|2|6|1128189381|admin|1128189344|2|Re: Testing quotes|xx
Recycle_Bin|0|0|N/A|N/A||||
mods|0|0|N/A|N/A||||
carpentry|0|0|N/A|N/A||||
plumbing|0|0|N/A|N/A||||
Recall Var (DOESNT WORK)
$board=$currentboard;
&BoardTotals("load",$board);
######${$uid.$board}{'test'} = "appleade";
######&BoardTotals("update",$board);
&fatal_error("Test New Var Should Appear Below <br> ${$uid.$board}{'test'} <br> ${$uid.$board}{'lastposter'}");
The fatal_error above shows the "Test new var should.... and then an empty line, and then the last poster of the board.
Sorry to be a pain - I really am stumpted - I can usually have sorted my self out by now!