Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) Adding an Option to Admin.pl (Read 17886 times)
Dave Baughman
God Member
*****
Offline


I want my MTV

Posts: 2039
Location: Murfreesboro
Joined: May 18th, 2001
Gender: Male
Adding an Option to Admin.pl
Aug 24th, 2001 at 6:30am
Print Post  
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:
Code
Select All
	if ($enable_ubbc) { $ubbcchecked = ' checked'; } 


This just tells YaBB, that if "$enable_ubbc" is on then the checkbox "$ubbcchecked" is checked.
Add After:
Code
Select All
	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:
Code
Select All
</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:
Code
Select All
  </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:
Code
Select All
	# Set as 0 or 1 if box was checked or not  


This is just a comment in Admin.pl
Add Before:
Code
Select All
	push(@onoff, "showtest");  


This signals that $showtest can be turned on and off (I think).

Step 5.
Find this:
Code
Select All
	# If empty fields are submitted, set them to default-values to save yabb from crashing 


Just another comment line in Admin.pl
Add After:
Code
Select All
	$showtest = $FORM{'showtest'} || 0; 


This is used to tell YaBB that if the checkbox is empty (unchecked) $showtest equals 0

Step 6.
Find this:
Code
Select All
\$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:
Code
Select All
\$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:
Code
Select All
	&header; 


This is what adds the menu bar at the top of the page.
Add After:
Code
Select All
	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
  

I'm not sure if it's ignorance or apathy, but I don't know and I don't care.
Back to top
WWW  
IP Logged
 
DemonSlayer
God Member
*****
Offline


I am the face of pure
evil!

Posts: 1398
Joined: Jul 26th, 2001
Gender: Male
Re: Adding an Option to Admin.pl
Reply #1 - Aug 24th, 2001 at 6:47am
Print Post  
Thanks for posting it Grin.


If there is any problem just tell me. I used one of my mods that works perfectly when making this so it should work fine, but if theres a mistake let me now!
  
Back to top
ICQAIM  
IP Logged
 
THE BIG CHEESE
Full Member
***
Offline


I'm Blind When It Comes
To Perl! But Not For
Long!

Posts: 123
Joined: Apr 20th, 2002
Gender: Male
Re: Adding an Option to Admin.pl
Reply #2 - Apr 22nd, 2002 at 1:15am
Print Post  
Can you show how to do one with text boxes -
I have tried before but it never worked


Thanks
  

Formerly known as MYNAMEISZACH
Status:
Working On A LinkPage Mod UPDATE
Upload Center

ZSPages.COM
Back to top
IP Logged
 
Totoro
New Member
*
Offline


I Love Jack Russell Terriers!!

Posts: 3
Joined: Nov 15th, 2002
Re: Adding an Option to Admin.pl
Reply #3 - Nov 15th, 2002 at 8:27am
Print Post  
it's werid, i can't seem to find Step 8 ??? Cry
  
Back to top
WWW  
IP Logged
 
ironwing
God Member
*****
Offline


I love YaBB 1 Gold!

Posts: 2330
Location: Sonoran Desert
Joined: Nov 20th, 2001
Re: Adding an Option to Admin.pl
Reply #4 - Nov 15th, 2002 at 9:43pm
Print Post  
The tutorial is for YaBB Gold Release, not SP1 or SP1.1

Dan
  

Please include your forum address in all requests for assistance.  It greatly speeds things along.
Back to top
WWW  
IP Logged
 
masterstanf2k
Ex Member


Re: Adding an Option to Admin.pl
Reply #5 - May 20th, 2003 at 2:22am
Print Post  
can someone write an update on this? This can be very useful! When it's for the correct version  Grin! Anyways, someone, plz write an update on this here...
  
Back to top
 
IP Logged
 
masterstanf2k
Ex Member


Re: Adding an Option to Admin.pl
Reply #6 - May 24th, 2003 at 4:13pm
Print Post  
?
  
Back to top
 
IP Logged
 
Administrator
Forum Administrator
*****
Offline


Yummm

Posts: 7
Location: Modders Rile
Joined: Oct 7th, 2014
Gender: Male
Re: Adding an Option to Admin.pl
Reply #7 - May 25th, 2003 at 1:05am
Print Post  
This tutorial is fully valid for Sp1.3.1. All you have to to keep in mind that the modify settings code is in AdminEdit.pl now instead of Admin.pl
  

The Administrator.
Back to top
WWW  
IP Logged
 
masterstanf2k
Ex Member


Re: Adding an Option to Admin.pl
Reply #8 - May 25th, 2003 at 1:37am
Print Post  
I'm on SP 1.1....
  
Back to top
 
IP Logged
 
Administrator
Forum Administrator
*****
Offline


Yummm

Posts: 7
Location: Modders Rile
Joined: Oct 7th, 2014
Gender: Male
Re: Adding an Option to Admin.pl
Reply #9 - May 25th, 2003 at 5:49pm
Print Post  
It's the same with SP1.1

Note that you won't need step8, as it only demonstrates how to make use of the new variable.
  

The Administrator.
Back to top
WWW  
IP Logged
 
masterstanf2k
Ex Member


Re: Adding an Option to Admin.pl
Reply #10 - May 25th, 2003 at 5:52pm
Print Post  
well, if I wanna make use of the new variable, what do I do instead of step 8?
  
Back to top
 
IP Logged
 
Administrator
Forum Administrator
*****
Offline


Yummm

Posts: 7
Location: Modders Rile
Joined: Oct 7th, 2014
Gender: Male
Re: Adding an Option to Admin.pl
Reply #11 - May 26th, 2003 at 1:48am
Print Post  
Well you simply make use of the variable you just added Smiley

In the example's case, the added variable is $showtest. Simply use it anywhere in YaBB as you like.

For example:

Code
Select All
if( $showtest == '1') {
do something
} else {
don't do something
} 

  

The Administrator.
Back to top
WWW  
IP Logged
 
bordeglobal
God Member
*****
Offline


Only the Best Posters
Survive!

Posts: 1837
Location: Trinidad, West Indies
Joined: Sep 30th, 2002
Gender: Male
Re: Adding an Option to Admin.pl
Reply #12 - Aug 11th, 2003 at 1:44pm
Print Post  
It would be good for a text box to be added next to the checkbox in admin where you can add the html you want displayed... please do show. Thanks.
  

Back to top
WWW  
IP Logged
 
Peter Barbosa
Senior Member
****
Offline



Posts: 277
Location: Barrie
Joined: Mar 31st, 2002
Gender: Male
Re: Adding an Option to Admin.pl
Reply #13 - Jul 14th, 2004 at 3:20pm
Print Post  
Very nice.. Im sure this would come in handy to most of us.
  

pc: [ cpu: athlon xp 2400 | ram: 512ddr pc2700 | radeon 9600xt | 2 x 40gig hdd ]

server: [ cpu: p4 2.6 | ram: 1 gig pc3200 | 2 x 80 gig hdd ]

Web site: www.plasmatic-exploit.com - Online
Back to top
WWW  
IP Logged
 
Spikecity
God Member
*****
Offline


Beer anyone ?

Posts: 2630
Location: New York
Joined: Apr 16th, 2002
Gender: Male
Re: Adding an Option to Admin.pl
Reply #14 - Jul 27th, 2004 at 1:09pm
Print Post  
Quote:
This tutorial is fully valid for Sp1.3.1. All you have to to keep in mind that the modify settings code is in AdminEdit.pl now instead of Admin.pl

Not really unless it explains how to add valid commands to SubList.pl too as this is the major difference with SP1.1.
The rest of the tutorial is OK to use in SP1.3.1 but SubList.pl additions should be explained as well as the difference between that file and the former usage in YaBB.pl (where the code parsing used to be)
  

Nothing to add here Smiley
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint