#!/usr/bin/perl
#########################################
# index
# - do all index stuff, also deal with keyword admin
#########################################
use localbucky;
$dbh = DBI->connect ($dsn);
our ($USER, $lastlog) = checkin();
my $k;
my $tag;
# check name of the calling script: index, tag, keyword
$input->{script} ||= $input->{script_from_uri} if defined($input->{script_from_uri});
# load the tag or keyword into the input params, if they don't exit already
if ( $input->{script} eq $BUCKY_LEXICON_TAG )
{
$input->{tag} ||= $input->{object_from_uri} if defined($input->{object_from_uri});
}
elsif ( $input->{script} eq $BUCKY_LEXICON_KEYWORD )
{
$input->{keyword} ||= $input->{object_from_uri} if defined($input->{object_from_uri});
}
# Get keyword
if (exists($input->{keyword}) && $input->{keyword} ne "new" && $input->{keyword} ne "unsorted")
{
$k = get_keyword($input->{keyword});
}
# Create New Keyword? FORM
if (exists($input->{keyword}) && $input->{keyword} eq "new")
{
my $t;
header("add new category");
if (exists($input->{thread}))
{
$t = get_thread($input->{thread});
}
menu();
print "
";
my %faek =
(
keyword => $input->{keyword},
thread => $input->{thread}
);
keyword_form($input->{keyword}, \%faek, $t);
footer();
}
# Edit settings for keyword
elsif ($input->{c} eq "edit" && (check_op($k) || $USER->{ulevel} == 3))
{
header(
{
title => "settings for category '$input->{keyword}'",
sticky => $input->{keyword}
} );
# 20070903 - marc - new menu args calling style
my $menu_args;
$menu_args->{keywords} = $k if $k;
menu( $menu_args );
# menu($k);
print "
";
keyword_form($k->{keyword}, $k);
print qq!
| \n);
print qq( ); print $s; print qq( ); } if ($s) { print qq($start - $pre ); print $s; print qq( ); print qq( | \n);
print qq(\n); alerts(); if ($USER == -1) { bPod_box(); } else { welcome_box(); # if (check_key($USER->{boxes}, "welcome")); search_box(); bPod_box() if (check_key($USER->{boxes}, "bPod")); radio_box() if (check_key($USER->{boxes}, "radio")); upload_form($keyword) if (check_key($USER->{boxes}, "postform")); hoot_box() if (check_key($USER->{boxes}, "hootbox")); } print qq( | \n); print qq(\n);
if (check_key($USER->{boxes}, "photostream") || ($USER == -1) )
{
if ( $keyword ne "all" )
{ photostream({ keyword => $keyword, vertical => 0, count => 4 }); }
elsif ( $tag )
{ photostream({ tag => $tag, vertical => 0, count => 4 }); }
else
{ photostream({ user => 1, vertical => 0, count => 4 }); }
}
print qq( |