This tutorial is made too teach you how to properly add an option into Admin.pl.
This option will be whether or not to, write the words "THIS IS A TEST" above the news fader but below the menu bar
(I know its a dumb idea but it will work)
Step 1. Open Admin.pl
Step 2. Find this: if ($enable_ubbc) { $ubbcchecked = ' checked'; }
This just tells YaBB, that if "$enable_ubbc" is on then the checkbox "$ubbcchecked" is checked.
Add After: if ($showtest) { $showtestchecked = ' checked'; }
This is the same as the above except it uses "$showtest" is on then checkbox "$showtestchecked" is checked.
Step 3. Find this: </tr><tr>
<td class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="2">$txt{'521'}</font></td>
<td class="windowbg2" bgcolor="$color{'windowbg2'}"><input type=checkbox name="menutype"$menuchecked></td>
This is the HTML for the "Use text menu instead of images?" option.
Add Before: </tr><tr>
<td class="windowbg2" bgcolor="$color{'windowbg2'}"><font size="2">Show "THIS IS A TEST" above the news fader?</font></td>
<td class="windowbg2" bgcolor="$color{'windowbg2'}"><input type=checkbox value="1" name="showtest"showtestchecked></td>
This is HTML for the option to show in the Admin center.
Step 4. Find this: # Set as 0 or 1 if box was checked or not
This is just a comment in Admin.pl
Add Before: push(@onoff, "showtest");
This signals that $showtest can be turned on and off (I think).
Step 5. Find this: # If empty fields are submitted, set them to default-values to save yabb from crashing
Just another comment line in Admin.pl
Add After: $showtest = $FORM{'showtest'} || 0;
This is used to tell YaBB that if the checkbox is empty (unchecked) $showtest equals 0
Step 6. Find this: \$enable_ubbc = $enable_ubbc; # Set to 1 if you want to enable UBBC (Uniform Bulletin Board Code)
This is what gets written to Settings.pl
Add Before: \$showtest = $showtest; # Set to 1 if want to display birthdays at the top of the fourm index
This is what gets written to Settings.pl (You need the \ at the beginning of the first one so it writes it as "$showtest" not 1 or 0)
Step 7. Open BoardIndex.pl
Step 8. Find this: &header;
This is what adds the menu bar at the top of the page.
Add After: if( $showtest == '1') {
print <<"EOT";
<font size="7" color="orange">THIS IS A TEST</font>
EOT
}
print <<"EOT";
After you install this and go to your fourm index, "THIS IS A TEST" will not be there. But if you go to the admin center and you select the option, and then go to the fourm index (you may need ot refresh) it will say "THIS IS A TEST".
This tutorial was written by
DemonSlayer