<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#webliberty::App::Profile.pm (2006/02/18)
#Copyright(C) 2002-2006 Knight, All rights reserved.

package webliberty::App::Profile;

use strict;
use base qw(webliberty::Basis);
use webliberty::String;
use webliberty::Skin;
use webliberty::App::Diary;

### ã‚³ãƒ³ã‚¹ãƒˆãƒ©ã‚¯ã‚¿
sub new {
	my $class = shift;

	my $self = {
		init   =&gt; shift,
		config =&gt; shift,
		query  =&gt; shift
	};
	bless $self, $class;

	return $self;
}

### ãƒ¡ã‚¤ãƒ³å‡¦ç†
sub run {
	my $self = shift;

	$self-&gt;output;

	return;
}

### ãƒ—ãƒ­ãƒ•ã‚£ãƒ¼ãƒ«è¡¨ç¤º
sub output {
	my $self = shift;

	my $skin_ins = new webliberty::Skin;
	$skin_ins-&gt;parse_skin("$self-&gt;{init}-&gt;{skin_dir}$self-&gt;{init}-&gt;{skin_header}");
	$skin_ins-&gt;parse_skin("$self-&gt;{init}-&gt;{skin_dir}$self-&gt;{init}-&gt;{skin_profile}");
	$skin_ins-&gt;parse_skin("$self-&gt;{init}-&gt;{skin_dir}$self-&gt;{init}-&gt;{skin_footer}");

	my $diary_ins = new webliberty::App::Diary($self-&gt;{init}, $self-&gt;{config}, $self-&gt;{query});

	$skin_ins-&gt;replace_skin(
		$diary_ins-&gt;info
	);

	my(%name, %text);

	open(FH, "$self-&gt;{init}-&gt;{data_dir}$self-&gt;{init}-&gt;{data_profile}") or $self-&gt;error("Read Error : $self-&gt;{init}-&gt;{data_dir}$self-&gt;{init}-&gt;{data_profile}");
	while (&lt;FH&gt;) {
		chomp;
		my($user, $name, $text) = split(/\t/);

		if (!$name) {
			$name = 'admin';
		}

		$name{$user} = $name;
		$text{$user} = $text;
	}
	close(FH);

	my $user_ins = new webliberty::String('admin');
	my $name_ins = new webliberty::String($name{'admin'});
	my $text_ins = new webliberty::String($text{'admin'});

	print $self-&gt;header;
	print $skin_ins-&gt;get_data('header');
	print $skin_ins-&gt;get_replace_data(
		'contents',
		PROFILE_USER =&gt; $user_ins-&gt;create_line,
		PROFILE_NAME =&gt; $name_ins-&gt;create_line,
		PROFILE_TEXT =&gt; $text_ins-&gt;create_text
	);
	print $skin_ins-&gt;get_data('footer');

	return;
}

1;
</pre></body></html>