###############################################################################
# Settings_ExtendedProfiles.pm #
# $Date: 01 Sep 2026 $ #
###############################################################################
# YaBB: Yet another Bulletin Board #
# Version: YaBBForum 3.2 #
# Packaged: 01 Sep 2026 #
# Distributed by: https://yabbforum.nz #
# =========================================================================== #
# Copyright (c) 2000-2026 YaBB (yabbforum.nz) - All Rights Reserved. #
# Software by: The YaBB Development Team #
# with assistance from the YaBB community. #
###############################################################################
# This file was part of the Extended Profiles Mod which has been created by #
# Michael Prager. Last modification by him: 15.11.07 #
# Added to the YaBB default code on 07. September 2008 #
###############################################################################
our $VERSION = '3.2';
$settings_extendedprofilespmver = 'YaBBForum 3.2';
if ( $action eq 'detailedversion' ) { return 1; }
LoadLanguage('ExtendedProfiles');
$ext_spacer_hr = q~
~;
$previous = 1;
}
# format the output dependent on the field type
if ( ( $field{'type'} eq 'text' && $value ne q{} )
|| ( $field{'type'} eq 'text_multi' && $value ne q{} )
|| ( $field{'type'} eq 'select' && $value ne q{ } )
|| ( $field{'type'} eq 'radiobuttons' && $value ne q{} )
|| ( $field{'type'} eq 'date' && $value ne q{} )
|| $field{'type'} eq 'checkbox' )
{
$output .= qq~
$field{'name'}:
$value
~;
$previous = 0;
}
elsif ( $field{'type'} eq 'spacer' ) {
# only print spacer if the previous entry was no spacer of the same type and if this is not the last entry
if ( ( $previous == 0 || $field{'comment'} ne q{} )
&& $id ne $last_field_id )
{
if ( $value eq $ext_spacer_br ) {
$output .= qq~
$ext_spacer_br
~;
$previous = 0;
}
else {
$output .= q~
~;
if ( $field{'comment'} ne q{} ) {
$output .= qq~
~;
$previous = 0;
}
}
}
# only add spacer if there there is at least one field displayed
if ( $output ne q{} ) {
$output = $pre_output . $output . q~
~;
}
return $output;
}
sub CreateExtLock {
fopen( LOCKFILE, ">$vardir/Extended.lock" )
|| setup_fatal_error( "$maintext_23 $vardir/Extended.lock: ", 1 );
print {LOCKFILE} qq~This is a lockfile for the Extended Profiles.\n~
or croak 'cannot print to LOCKFILE';
print {LOCKFILE}
qq~It prevents it being run again after it has been run once.\n~
or croak 'cannot print to LOCKFILE';
print {LOCKFILE} q~Delete this file if you want to run the Converter again.~
or croak 'cannot print to LOCKFILE';
fclose(LOCKFILE);
return;
}
sub FoundExtLock {
$found = qq~
$lang_ext{'convlock'}
$lang_ext{'convlock_desc'}
~;
return $found;
}
1;
# file formats used by this code:
#
# username.vars - contains the additional user profile information. Number is field-id
# -------------
# ...
# 'ext_0',"value"
# 'ext_1',"value"
# 'ext_2',"value"
# ...
#
# @ext_prof_order - contains the order in which the fields will be displayed
# ---------------------------
# ("name","name","name",....)
#
# extended_profiles_fields.txt - defines the new profile fields. Uses line number as field-id
# ----------------------------
# ("name|type|options|active|comment|required_on_reg|visible_in_viewprofile|v_users|v_groups|visible_in_posts|p_users|p_groups|p_displayfieldname|visible_in_memberlist|m_users|m_groups|editable_by_user|visible_in_posts_popup|pp_users|pp_groups|pp_displayfieldname","name|type|options|active|comment|required_on_reg|visible_in_viewprofile|v_users|v_groups|visible_in_posts|p_users|p_groups|p_displayfieldname|visible_in_memberlist|m_users|m_groups|editable_by_user|visible_in_posts_popup|pp_users|pp_groups|pp_displayfieldname","name|type|options|active|comment|required_on_reg|visible_in_viewprofile|v_users|v_groups|visible_in_posts|p_users|p_groups|p_displayfieldname|visible_in_memberlist|m_users|m_groups|editable_by_user|visible_in_posts_popup|pp_users|pp_groups|pp_displayfieldname",....)
#
# Here are all types with their possible type-specific options. If options contain multiple entries, separated by ^
# - text limit_len^width^is_numberic^default_value^allow_ubbc
# - text_multi limit_len^rows^cols^allow_ubbc
# - select option1^option2^option3... (first option is default)
# - radiobuttons option1^option2^option3... (first option is default)
# - spacer br_or_hr^visible_in_editprofile
# - checkbox -
# - date -
# - emial -
# - url -
# - image width^height^allowed_extensions
#
# required_on_reg can have value 0 (disabled), 1 (required on registration) and 2 (not req. but display on reg. page anyway)
# editable_by_user can have value 0 (will only show on the "admin edits" page), 1 ("edit profile" page), 2 ("contact information" page), 3 ("Options" page) and 4 ("PM Preferences" page)
# allowed_extensions is a space-seperated list of file extensions, example: "jpg jpeg gif bmp png"
# v_groups, p_groups, m_groups, pp_groups format: "Administrator" or "Moderator" or "Global Moderator" or NoPost{...} or Post{...}
#
# NOTE: use prefix "ext_" in sub-, variable- and formnames to prevent conflicts with other mods
#
# easy mod integration: use &ext_get($username,"fieldname") go get user's field value
#
###############################################################################