Page Index Toggle Pages: [1] 2  Send TopicPrint
Hot Topic (More than 10 Replies) YaBB Variables (Read 5582 times)
Imp_In_Training
God Member
*****
Offline


Don't follow me, I'm lost
too!

Posts: 608
Location: Aberdeen
Joined: Jun 17th, 2004
Gender: Male
YaBB Variables
Sep 23rd, 2006 at 11:43am
Print Post  
Is there a list of YaBB variables in use that I could use as a reference for my codes?  Things like iamadmin, the user's name, etc.?
  
Back to top
WWW  
IP Logged
 
devonst17
New Member
*
Offline


Nightmare City

Posts: 23
Location: Northridge
Joined: Sep 23rd, 2006
Gender: Male
Re: YaBB Variables
Reply #1 - Sep 23rd, 2006 at 8:32pm
Print Post  
Somewhere around the start of most YaBB functions, (I'm looking in the file I have open, Display.pl, looking at sub Display) you'll find a line that looks like:
my ($variable, $var1, $var2, etc);
That has most of the variables that are used in that function. There are some other variables that are global, but I think that's what you're looking for.
  
Back to top
WWWAIM  
IP Logged
 
AK108
God Member
*****
Offline



Posts: 942
Joined: Oct 1st, 2003
Gender: Male
Re: YaBB Variables
Reply #2 - Sep 24th, 2006 at 3:33am
Print Post  
Well, let's start a list. Here's the auto-loaded stuff from Load.pl.

Code
Select All
$username: The one true global variable for the user ;). (Current username)
$iamguest, $iamadmin, $iamgmod: self explanatory
$iammod: true if the current user is a moderator (or membergroup moderator) of any board
$realname, $realemail: Current display name and email address of a user
$useraccount{$user}: Username value that is safe for use in links. (Otherwise having a # in the username breaks everything)
$language: The current language of the current user
$usestyle, $usehead, $useboard, $usemessage, $usedisplay, $imagesdir: The stylesheet, template.html, boardindex template, messageindex template, display template, and the images directory URL, in that order. Won't be too useful except for template related mods.
$memberunfo{$user}: User's group name, as it should be displayed
$addmembergroup{$user}: User's additional groups, comma separated 

  

For my mods, check out my public notes.

You might be interested in my projects, or my forum, the Flying Kirby Pub.
Back to top
WWWAIM  
IP Logged
 
T3rrabug
Full Member
***
Offline


I love YaBB  2 :D

Posts: 220
Location: over_there
Joined: Aug 21st, 2004
Gender: Male
Re: YaBB Variables
Reply #3 - Sep 24th, 2006 at 7:15am
Print Post  
Thanks AK  Smiley
  

Back to top
 
IP Logged
 
Imp_In_Training
God Member
*****
Offline


Don't follow me, I'm lost
too!

Posts: 608
Location: Aberdeen
Joined: Jun 17th, 2004
Gender: Male
Re: YaBB Variables
Reply #4 - Sep 25th, 2006 at 12:20am
Print Post  
Sweet, thank you very much, AK.  Thanks to you too, Devon.
  
Back to top
WWW  
IP Logged
 
AK108
God Member
*****
Offline



Posts: 942
Joined: Oct 1st, 2003
Gender: Male
Re: YaBB Variables
Reply #5 - Sep 25th, 2006 at 12:25am
Print Post  
Also make sure to check Variables/Settings.pl, Variables/advsettings.txt, and Variables/secsettings.txt for settings.
  

For my mods, check out my public notes.

You might be interested in my projects, or my forum, the Flying Kirby Pub.
Back to top
WWWAIM  
IP Logged
 
Imp_In_Training
God Member
*****
Offline


Don't follow me, I'm lost
too!

Posts: 608
Location: Aberdeen
Joined: Jun 17th, 2004
Gender: Male
Re: YaBB Variables
Reply #6 - Sep 25th, 2006 at 12:38am
Print Post  
I'm currently revamping a mod from YaBB 1.4 to YaBB 2.1.  It makes reference of several variables... some of which I can tell what they are supposed to be, and some of which I am clueless about.  If it's not asking too much, could someone look over this list and tell me if I am right or wrong, and - more importantly - if the variable still exists in YaBB 2.1 or if it has been replaced with another:

Code
Select All
$name: The alias that the user goes by (not to be confused with the actual $username login data).
$tmpuname: ?
$settings[7]: ? (eq 'Administrator' or 'Global Moderator')
$moderators{$username}: ?
$threadpost: ?
$sourcedir: Where the YaBBC.pl file is located
$msubject: subject line of the message in question.
$mname: alias of the person who posted the message in question.
$memail: email of the person who posted the message in question.
$mdate: date of the posted message in question.
$musername: actual login user name of the person who posted the message in question.
$micon: the chosen icon for the message in question.
$mattach: any attachment on the message in question.
$mip: the IP address of the person who posted the message in question.
$mmessage: the body of the message in question.
$mns: ?
$message: ?
$nestedquotes: True if there is a quote within a quote of the message in question. 

  
Back to top
WWW  
IP Logged
 
AK108
God Member
*****
Offline



Posts: 942
Joined: Oct 1st, 2003
Gender: Male
Re: YaBB Variables
Reply #7 - Sep 25th, 2006 at 12:55am
Print Post  
$name - $realname
$settings[7] - use $iamadmin, $iamgmod, or ${$uid.$username}{'position'}

$sourcedir is the same
$moderators{$username} - use $iammod or &is_moderator($user)

Variables beginning with $m (that regard messages) are the same.

$nestedquotes is now a setting, I think. You may want to check that out.



$threadpost and $tmpuname I don't know about.
  

For my mods, check out my public notes.

You might be interested in my projects, or my forum, the Flying Kirby Pub.
Back to top
WWWAIM  
IP Logged
 
Imp_In_Training
God Member
*****
Offline


Don't follow me, I'm lost
too!

Posts: 608
Location: Aberdeen
Joined: Jun 17th, 2004
Gender: Male
Re: YaBB Variables
Reply #8 - Sep 25th, 2006 at 3:28pm
Print Post  
Very nice.  I'm keeping a list.  I know that alot of these variables will come up in the future.  You've been a great help.  Thanks!
  
Back to top
WWW  
IP Logged
 
AK108
God Member
*****
Offline



Posts: 942
Joined: Oct 1st, 2003
Gender: Male
Re: YaBB Variables
Reply #9 - Sep 25th, 2006 at 9:49pm
Print Post  
Feel free to add it to the  YaBB Codex. Smiley
« Last Edit: Sep 26th, 2006 at 2:34am by AK108 »  

For my mods, check out my public notes.

You might be interested in my projects, or my forum, the Flying Kirby Pub.
Back to top
WWWAIM  
IP Logged
 
Imp_In_Training
God Member
*****
Offline


Don't follow me, I'm lost
too!

Posts: 608
Location: Aberdeen
Joined: Jun 17th, 2004
Gender: Male
Re: YaBB Variables
Reply #10 - Sep 25th, 2006 at 11:17pm
Print Post  
Oh, hey... good idea.
  
Back to top
WWW  
IP Logged
 
Imp_In_Training
God Member
*****
Offline


Don't follow me, I'm lost
too!

Posts: 608
Location: Aberdeen
Joined: Jun 17th, 2004
Gender: Male
Re: YaBB Variables
Reply #11 - Sep 26th, 2006 at 12:21am
Print Post  
I gave it a shot... tried to edit the "Modification" category - since it didn't exist.  But it kept giving me errors and would not save my work.  In effect, without posting the message in a totally unrelated area, I can't do it.  Do you belong to YaBB Codex, AK?

If so, and if you have a better handle on how to get things implemented, could you post for me?  Here is the formatted detail:

Code
Select All
=Modification=
==Variables==
There are a wide variety of variables in use in the YaBB scripts.  In order to modify the YaBB scripting, you should have a good knowledge of the variables in play.
===YaBB 1.4===
This article is an attempt to define those variables in use in YaBB 1.4
===YaBB 2.1===
This article is an attempt to define those variables in use in YaBB 2.1.
====A====
'''$addmembergroup{$user}'''
::User's additional groups, comma separated.
====B====
====C====
====D====
====E====
====F====
====G====
====H====
====I====
'''$iamadmin'''
::True if the user is the administrator.
'''$iamgmod'''
::True if the user is a Global Moderator.
'''$iamguest'''
::True if the user is a guest user.
'''$iammod'''
::True if the current user is a moderator (or membergroup moderator) of any board.
'''$imagesdir'''
::The images directory URL.
====J====
====K====
====L====
'''$language'''
::The current language of the current user.
====M====
'''$mattach'''
::Any attachment on the message in question.
'''$mdate'''
::Date of the posted message in question.
'''$memail'''
::Email of the person who posted the message in question.
'''$memberunfo{$user}'''
::User's group name, as it should be displayed.
'''$micon'''
::The chosen icon for the message in question.
'''$mip'''
::The IP address of the person who posted the message in question.
'''$mmessage'''
::The body of the message in question.
'''$mname'''
::Alias of the person who posted the message in question.
'''$msubject'''
::Subject line of the message in question.
'''$musername'''
::Actual login user name of the person who posted the message in question.
====N====
====O====
====P====
====Q====
====R====
'''$realemail'''
::Current email address of a user.
'''$realname'''
::The displayed alias that the user goes by - that shows up on messages.
====S====
'''$sourcedir'''
::Where the YaBBC.pl file is located.
====T====
====U====
'''$useboard'''
::The boardindex in use.
'''$usedisplay'''
::The display template in use.
'''$usehead'''
::The template.html in use.
'''$usemessage'''
::The messageindex template in use.
'''$useraccount{$user}'''
::Username value that is safe for use in links. (Otherwise having a # in the username breaks everything)
'''$username'''
::The one true global variable for the user ;). (Current username)
'''$usestyle'''
::The stylesheet in use.
====V====
====W====
====X====
====Y====
====Z====

{{Stub}}
 



If not, maybe you know who I should talk to about it?  There really was no contact ID on the Codex.

Edited:
Alphabetized the list
  
Back to top
WWW  
IP Logged
 
AK108
God Member
*****
Offline



Posts: 942
Joined: Oct 1st, 2003
Gender: Male
Re: YaBB Variables
Reply #12 - Sep 26th, 2006 at 2:36am
Print Post  
I'm asking what the correct place for this would be.
  

For my mods, check out my public notes.

You might be interested in my projects, or my forum, the Flying Kirby Pub.
Back to top
WWWAIM  
IP Logged
 
devonst17
New Member
*
Offline


Nightmare City

Posts: 23
Location: Northridge
Joined: Sep 23rd, 2006
Gender: Male
Re: YaBB Variables
Reply #13 - Sep 26th, 2006 at 5:44am
Print Post  
For some reason the server is down, it's 10:43 on Monday, Sept 25th (PST).

I was going to go look up what this YaBBCodex is, I've never heard of it!

-Devon
  
Back to top
WWWAIM  
IP Logged
 
AK108
God Member
*****
Offline



Posts: 942
Joined: Oct 1st, 2003
Gender: Male
Re: YaBB Variables
Reply #14 - Sep 26th, 2006 at 12:53pm
Print Post  
It's our online manual in the form of a wiki. Only problem is that it's not active enough to be too useful, and it has some bugs.
  

For my mods, check out my public notes.

You might be interested in my projects, or my forum, the Flying Kirby Pub.
Back to top
WWWAIM  
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint