discourse-legacysite-perl/site/forum.slowtwitch.com/cgi-bin/widget.cgi
2024-06-17 21:49:12 +10:00

28 lines
696 B
Perl
Executable File

#!/usr/bin/perl
use strict;
use lib '/var/home/slowtwitch/slowtwitch.com/cgi-bin/articles/admin';
use Links qw/$PLG $IN $DB/;
use Links::User::Page;
local $SIG{__DIE__} = \&Links::fatal;
Links::init('/var/home/slowtwitch/slowtwitch.com/cgi-bin/articles/admin');
my $id = $IN->param('id');
print $IN->header;
if ($id) {
my $tab = $DB->table('Widgets');
my $widget = $tab->get($id);
if ($widget) {
if ($widget->{Image}) {
my $fh = $tab->file_info('Image', $widget->{ID});
$widget->{Image_URL} = '/images/widgets/' . $fh->File_RelativeURL;
}
print Links::SiteHTML::display('include_widgets', { widgets_loop => [$widget] });
}
}