WebGUI 3.3.0 release

This commit is contained in:
JT Smith 2002-02-22 05:33:00 +00:00
parent 40bb7fed59
commit 80f7752f32
41 changed files with 1662 additions and 402 deletions

View file

@ -12,18 +12,19 @@ package WebGUI::Macro::I_imageWithTags;
use strict;
use Tie::CPHash;
use WebGUI::Attachment;
use WebGUI::Macro;
use WebGUI::Session;
use WebGUI::SQL;
#-------------------------------------------------------------------
sub _replacement {
my (@param, $temp, %data);
my (@param, $temp, %data, $image);
tie %data, 'Tie::CPHash';
@param = WebGUI::Macro::getParams($_[0]);
%data = WebGUI::SQL->quickHash("select * from images where name='$param[0]'");
$temp = '<img src="'.$session{setting}{attachmentDirectoryWeb}.'/images/'.
$data{imageId}.'/'.$data{filename}.'" '.$data{parameters}.'>';
$image = WebGUI::Attachment->new($data{filename},"images",$data{imageId});
$temp = '<img src="'.$image->getURL.'" '.$data{parameters}.'>';
return $temp;
}

View file

@ -17,27 +17,47 @@ use WebGUI::Macro::Backslash_pageUrl;
use WebGUI::Session;
use WebGUI::URL;
#-------------------------------------------------------------------
sub _createURL {
return '<a href="'.WebGUI::URL::page("op=logout").'">'.$_[0].'</a>';
}
#-------------------------------------------------------------------
sub _replacement {
my ($temp);
my ($temp,$boxSize,@param,$text);
@param = WebGUI::Macro::getParams($_[0]);
$temp = '<div class="loginBox">';
if ($session{var}{sessionId}) {
$temp .= WebGUI::International::get(48);
$temp .= ' <a href="'.WebGUI::URL::page('op=displayAccount').'">'.$session{user}{username}.'</a>.';
$temp .= WebGUI::International::get(49);
$temp = WebGUI::Macro::Backslash_pageUrl::process($temp);
$text = $param[1];
if (not defined $text){
$temp .= WebGUI::International::get(48);
$temp .= ' <a href="'.WebGUI::URL::page('op=displayAccount').
'">'.$session{user}{username}.'</a>.';
$temp .= WebGUI::International::get(49);
$temp = WebGUI::Macro::Backslash_pageUrl::process($temp);
} else {
$text =~ s/%(.*?)%/_createURL($1)/ge;
$temp .= WebGUI::Macro::Backslash_pageUrl::process($text);
}
} else {
$boxSize = $param[0];
if (not defined $boxSize) {
$boxSize = 12;
}
if (index(lc($ENV{HTTP_USER_AGENT}),"msie") < 0) {
$boxSize = int($boxSize=$boxSize*2/3);
}
$temp .= '<form method="post" action="'.WebGUI::URL::page().'"> ';
$temp .= WebGUI::Form::hidden("op","login").'<span class="formSubtext">';
$temp .= WebGUI::International::get(50);
$temp .= '<br></span>';
$temp .= WebGUI::Form::text("username",12,30).'<span class="formSubtext"><br>';
$temp .= WebGUI::Form::text("username",$boxSize,30).'<span class="formSubtext"><br>';
$temp .= WebGUI::International::get(51);
$temp .= '<br></span>';
$temp .= WebGUI::Form::password("identifier",12,30).'<span class="formSubtext"><br></span>';
$temp .= WebGUI::Form::password("identifier",$boxSize,30).'<span class="formSubtext"><br></span>';
$temp .= WebGUI::Form::submit(WebGUI::International::get(52));
$temp .= '</form>';
$temp .= '<a href="'.WebGUI::URL::page('op=createAccount').'">Click here to register.</a>';
$temp .= '<a href="'.WebGUI::URL::page('op=createAccount').'">'.WebGUI::International::get(407).'</a>';
}
$temp .= '</div>';
return $temp;
@ -47,6 +67,7 @@ sub _replacement {
sub process {
my ($output, $temp);
$output = $_[0];
$output =~ s/\^L\((.*?)\)\;/_replacement($1)/ge;
$output =~ s/\^L\;/_replacement()/ge;
return $output;
}

View file

@ -0,0 +1,40 @@
package WebGUI::Macro::Thumbnail;
#-------------------------------------------------------------------
# WebGUI is Copyright 2001-2002 Plain Black Software.
#-------------------------------------------------------------------
# Please read the legal notices (docs/legal.txt) and the license
# (docs/license.txt) that came with this distribution before using
# this software.
#-------------------------------------------------------------------
# http://www.plainblack.com info@plainblack.com
#-------------------------------------------------------------------
use strict;
use Tie::CPHash;
use WebGUI::Attachment;
use WebGUI::Macro;
use WebGUI::Session;
use WebGUI::SQL;
#-------------------------------------------------------------------
sub _replacement {
my (@param, %data, $image);
tie %data, 'Tie::CPHash';
@param = WebGUI::Macro::getParams($_[0]);
%data = WebGUI::SQL->quickHash("select * from images where name='$param[0]'");
$image = WebGUI::Attachment->new($data{filename},"images",$data{imageId});
return $image->getThumbnail;
}
#-------------------------------------------------------------------
sub process {
my ($output, $temp);
$output = $_[0];
$output =~ s/\^Thumbnail\((.*?)\)\;/_replacement($1)/ge;
return $output;
}
1;

View file

@ -12,18 +12,19 @@ package WebGUI::Macro::i_imageNoTags;
use strict;
use Tie::CPHash;
use WebGUI::Attachment;
use WebGUI::Macro;
use WebGUI::Session;
use WebGUI::SQL;
#-------------------------------------------------------------------
sub _replacement {
my (@param, $temp, %data);
my (@param, $image, %data);
tie %data, 'Tie::CPHash';
@param = WebGUI::Macro::getParams($_[0]);
%data = WebGUI::SQL->quickHash("select * from images where name='$param[0]'");
$temp = $session{setting}{attachmentDirectoryWeb}.'/images/'.$data{imageId}.'/'.$data{filename};
return $temp;
$image = WebGUI::Attachment->new($data{filename},"images",$data{imageId});
return $image->getURL;
}
#-------------------------------------------------------------------