init
This commit is contained in:
16
livejournal/htdocs/styles/browse/index.html
Executable file
16
livejournal/htdocs/styles/browse/index.html
Executable file
@@ -0,0 +1,16 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Style Browser</title>
|
||||
</head>
|
||||
|
||||
<frameset cols="200,*">
|
||||
<frameset rows="100,*">
|
||||
<frame name="start" src="start.bml">
|
||||
<frame name="links" src="links.bml">
|
||||
</frameset>
|
||||
<frame name="main" src="instructions.bml">
|
||||
</frameset>
|
||||
|
||||
</html><!-- <LJDEP>
|
||||
link: htdocs/styles/browse/start.bml, htdocs/styles/browse/blank.bml, htdocs/styles/browse/instructions.bml
|
||||
</LJDEP> -->
|
||||
12
livejournal/htdocs/styles/browse/instructions.bml
Executable file
12
livejournal/htdocs/styles/browse/instructions.bml
Executable file
@@ -0,0 +1,12 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Style Browser</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Style Browser</h1>
|
||||
<p>Enter a username in the box on the left and click "Preview" to see a list of that users'
|
||||
public styles. In the list, click on the style name to view what the style looks like, or
|
||||
click the dash to view style information.</p>
|
||||
</body>
|
||||
</html><!-- <LJDEP>
|
||||
</LJDEP> -->
|
||||
55
livejournal/htdocs/styles/browse/links.bml
Executable file
55
livejournal/htdocs/styles/browse/links.bml
Executable file
@@ -0,0 +1,55 @@
|
||||
<base target=_top>
|
||||
<?_code
|
||||
{
|
||||
use strict;
|
||||
use vars qw(%GET);
|
||||
|
||||
my $user = LJ::canonical_username($GET{'user'});
|
||||
return "Enter a username." unless $user;
|
||||
|
||||
my $remote = LJ::get_remote();
|
||||
my $dispuser = $remote ? $remote->{'user'} : $user;
|
||||
my $styu = LJ::load_user($user);
|
||||
my $styles;
|
||||
if ($user eq 'system') {
|
||||
$styles = LJ::S1::get_public_styles();
|
||||
} else {
|
||||
$styles = LJ::S1::get_user_styles($user);
|
||||
}
|
||||
|
||||
my $admin = $remote &&
|
||||
(LJ::check_priv($remote, 'canview', 'styles') ||
|
||||
LJ::check_priv($remote, 'canview', '*'));
|
||||
|
||||
my ($dday,$dmon,$dyear) = (localtime(time))[3..5];
|
||||
$dyear+=1900; $dmon++;
|
||||
my %extra = ( 'day' => "&month=$dmon&day=$dday&year=$dyear" );
|
||||
|
||||
my $ret = "Styles for " . LJ::ljuser($user) . ":<br /><br />";
|
||||
|
||||
my $last;
|
||||
STY:
|
||||
foreach my $sty (sort { $a->{'type'} cmp $b->{'type'} || $a->{'styledes'} cmp $b->{'styledes'} }
|
||||
values %$styles) {
|
||||
|
||||
next STY unless $sty->{is_public} eq 'Y' || # public is always visible
|
||||
LJ::u_equals($remote, $styu) || # yours are visible to you
|
||||
LJ::can_manage($remote, $styu) ||# you can view things you manage
|
||||
$admin; # you have appropriate canview
|
||||
|
||||
if ($last ne $LJ::viewinfo{$sty->{'type'}}->{'des'}) {
|
||||
$last = $LJ::viewinfo{$sty->{'type'}}->{'des'};
|
||||
$ret .= "<b>$last</b><br />\n";
|
||||
}
|
||||
|
||||
$ret .= "<nobr> [<a target='main' href='styleinfo.bml?styleid=$sty->{'styleid'}'>info</a>] ";
|
||||
$ret .= "<a target='main' href='/customview.cgi?styleid=$sty->{'styleid'}&user=$dispuser&";
|
||||
$ret .= "nooverride=1$extra{$sty->{'type'}}'>$sty->{'styledes'}</a></nobr><br />\n";
|
||||
}
|
||||
|
||||
$ret .= ".";
|
||||
return $ret;
|
||||
}
|
||||
_code?><?_c <LJDEP>
|
||||
link: htdocs/styles/browse/styleinfo.bml, htdocs/customview.cgi
|
||||
</LJDEP> _c?>
|
||||
9
livejournal/htdocs/styles/browse/start.bml
Executable file
9
livejournal/htdocs/styles/browse/start.bml
Executable file
@@ -0,0 +1,9 @@
|
||||
<FORM TARGET="links" ACTION="links.bml" METHOD=GET>
|
||||
View styles of user:
|
||||
<INPUT NAME="user" VALUE="system" SIZE=15 MAXLENGTH=15>
|
||||
<BR>
|
||||
|
||||
<INPUT TYPE="SUBMIT" VALUE="Preview">
|
||||
</FORM> <?_c <LJDEP>
|
||||
form: htdocs/styles/browse/links.bml
|
||||
</LJDEP> _c?>
|
||||
45
livejournal/htdocs/styles/browse/styleinfo.bml
Executable file
45
livejournal/htdocs/styles/browse/styleinfo.bml
Executable file
@@ -0,0 +1,45 @@
|
||||
<?_code
|
||||
|
||||
my $styleid = $FORM{'styleid'}+0;
|
||||
my $remote = LJ::get_remote();
|
||||
|
||||
my $sty = LJ::S1::get_style($styleid);
|
||||
my $styu = LJ::load_user($sty->{user}) if $sty; # if $sty so we don't auto-vivify!
|
||||
return "Style $styleid does not exist or is not public."
|
||||
unless $sty &&
|
||||
($sty->{is_public} eq 'Y' || # straight up public
|
||||
LJ::u_equals($remote, $styu) || # is this your account?
|
||||
LJ::can_manage($remote, $styu) || # how about your community?
|
||||
LJ::check_priv($remote, 'canview', 'styles') || # can you see private styles?
|
||||
LJ::check_priv($remote, 'canview', '*')); # or maybe you can see everything
|
||||
|
||||
my $ret = "";
|
||||
$ret .= "<H1>Style Info</H1>\n";
|
||||
|
||||
$ret .= "<DL>\n";
|
||||
$ret .= "<DT><B>Author</B><DD><A TARGET=_top HREF=\"$LJ::SITEROOT/userinfo.bml?user=$sty->{'user'}\">$sty->{'user'}</A>\n";
|
||||
$ret .= "<DT><B>Style Description</B><DD>$sty->{'styledes'}<BR>\n";
|
||||
$ret .= "<DT><B>Last Updated</B><DD>$sty->{'lastupdate'}<BR>\n";
|
||||
$ret .= "<DT><B>View Type</B><DD>$sty->{'type'}<BR>\n";
|
||||
$ret .= "<DT><B>Public?</B><DD>$sty->{'is_public'}<BR>\n";
|
||||
$ret .= "<DT><B>Embeddable?</B><DD>$sty->{'is_embedded'}<BR>\n";
|
||||
$ret .= "<DT><B>Color-free? (only uses color themes, not fixed colors)</B><DD>$sty->{'is_colorfree'}<BR>\n";
|
||||
$ret .= "</DL>";
|
||||
|
||||
my %vars;
|
||||
LJ::parse_vars(\$sty->{'formatdata'}, \%vars);
|
||||
|
||||
$ret .= "<H1>Style Variables</H1>\n";
|
||||
|
||||
foreach my $v (sort keys %vars) {
|
||||
$ret .= "<H2>$v</H2>\n";
|
||||
my $val = LJ::ehtml($vars{$v});
|
||||
$val =~ s/\n/<BR>\n/g;
|
||||
$ret .= $val;
|
||||
}
|
||||
|
||||
return $ret;
|
||||
|
||||
_code?><?_c <LJDEP>
|
||||
link: htdocs/userinfo.bml
|
||||
</LJDEP> _c?>
|
||||
Reference in New Issue
Block a user