Custom User Titles for YaBB 2.7.00
1.6
Allows Administrators and Global Moderators (if allowed) to add Custom User Titles to Members
Version History
1.0 - First release by Derek Barnstorm - 6th December 2008
1.1 - Updated for YaBB 2.4 - 14th April 2009
1.2 - Updated for YaBB 2.6.0 by Dandello - July 1, 2014
1.2 - Updated for YaBB 2.6.1 by Dandello - Sept 4, 2014
1.3 - Updated for YaBB 2.6.1 Build 1606 by Dandello - Nov 28, 2014
1.4 - Updated for YaBB 2.7.00 by Dandello - Feb 19, 2016
1.5 - Updated for YaBB 2.7.00 strict by Dandello - Jan 13, 2017
1.6 - Updated for YaBB 2.7.00 strict by Dandello - March 8, 2018 (YaBB Build 2015)
Install using YaBMod
Credits
There was a version of this Mod for YaBB 1. I believe the original author was Godai, and it was also updated by rehlbe and mats.
Derek Barnstorm, updated for 2.7.00 by Dandello
http://yabbforumsoftware.com
Admin/ModList.pm
### END BOARDMOD ANCHOR ###
my $mod_cutitle = 'Custom User Titles|Derek Barnstorm, updated for 2.7.00 by Dandello|Allows Administrators and Global Moderators (if allowed) to add Custom User Titles to Members|1.6|March 8th, 2018';
push @installed_mods, $mod_cutitle;
Languages/English/Profile.lng
if (@englishprofilelngmods) {
push @englishprofilelngmods, 'Custom User Title';
1;
$profile_txt{'cut'} = 'Custom User Title';
Sources/Display.pm
if (@displaypmmods) {
push @displaypmmods, 'Custom User Title';
$memberinfo .= $addmemgrp;
$memberinfo .= ${ $uid . $musername }{'cutitle'};
Sources/Load.pm
if (@loadpmmods) {
push @loadpmmods, 'Custom User Title';
else {
${ $uid . $usr }{'gender'} = q{};
}
if ( ${ $uid . $usr }{'cutitle'} ) {
${ $uid . $usr }{'cutitle'} =
${ $uid . $usr }{'cutitle'}
? qq~
${ $uid . $usr }{'cutitle'}~
: q{};
}
else {
${ $uid . $usr }{'cutitle'} = q{};
}
Sources/MyCenter.pm
if (@mycenterpmmods) {
push @mycenterpmmods, 'Custom User Title';
my $memberinfo = "$memberinfo{$usr}$addmembergroup{$usr}";
my $memberinfo =
"$memberinfo{$usr}${$uid.$usr}{'cutitle'}$addmembergroup{$usr}";
Sources/Profile.pm
if (@profilepmmods) {
push @profilepmmods, 'Custom User Title';
## our Mod Hook ##
our ($myprofile_cutitle, $row_cutitle);
${ $uid . $user }{'addgroups'} = $member{'addgroup'};
${ $uid . $user }{'cutitle'} = $member{'cutitle'};
${ $uid . $user }{'cutitlecol'} = $member{'cutitlecol'};
$my_tta =~ s/\Q{yabb profile_txt87b}\E/$profile_txt{'87b'}/xsm;
}
my $my_cutitle = $myprofile_cutitle;
${ $uid . $user }{'cutitle'} ||= q{};
my $cutitlecol = isempty( ${ $uid . $user }{'cutitlecol'}, '#f00' );
$my_cutitle =~ s/\Q{yabb mycutitle}\E/${ $uid . $user }{'cutitle'}/gxsm;
$my_cutitle =~ s/\Q{yabb cutitlcol}\E/$cutitlecol/gxsm;
## Mod Hook showProfile_admin ##
my $row_cutitle = get_row_cutitle();
$show_profile =~
s/\Q{yabb my_cutitle}\E/$my_cutitle/xsm; ## Custom User titles ##
## Mod Hook showProfile2 ##
my $row_cutitle = get_row_cutitle();
$show_profile =~
s/\Q{yabb row_cutitle}\E/$row_cutitle/xsm; ## Custom User titles ##
1;
sub get_row_cutitle {
my $row_cutitle = q{};
if ( ${ $uid . $user }{'cutitle'} ) {
$row_cutitle .=
qq~${ $uid . $user }{'cutitle'}
~;
}
return $row_cutitle;
}
Sources/System.pm
if (@systempmmods) {
push @systempmmods, 'Custom User Title';
## Mod hook ##
push @var_tags, 'cutitle', 'cutitlecol';
Templates/default/MyProfile.template
if (@defaultmyprofilemods) {
push @defaultmyprofilemods, 'Custom User Title';
{yabb my_tta}~;
{yabb my_tta}
{yabb my_cutitle}~;
~;
$myprofile_cutitle = qq~
|
|
~;
{yabb col_title_user}
{yabb row_cutitle}