require "smilies.inc.php"; function build_theme_list_nav() global $session, $users, $PHP_SELF; global $action, $keywords; if ($action == "listall" || $action == "") { $buffer = "<b>All Themes</b>"; $buffer = "<a href=\"" . $session->localUrl($PHP_SELF) . "?action=listall\">All Themes</a>"; $buffer .= " "; if ($action == "listpopular") $buffer .= "<b>Popular Themes</b>"; $buffer .= "<a href=\"" . $session->localUrl($PHP_SELF) . "?action=listpopular\">Popular Themes</a>"; $buffer .= "<b>·</b> "; if ($action == "search" && !isset($keywords)) $buffer .= "<b>Search</b>"; $buffer .= "<a href=\"themes.php?action=search\">Search</a>"; $buffer .= "<b>·</b> "; if ($action == "addtheme") $buffer .= "<b>Add Theme</b>"; $buffer .= "<a href=\"" . $session->localUrl($PHP_SELF) . "?action=addtheme\">Add Theme</a>"; $buffer .= "<b>·</b> "; $buffer .= "<a href=\"" . $session->localUrl("logout.php") . $buffer .= "<a href=\"" . $session->localUrl("login.php") . "\">Log In</a> "; $buffer .= "<a href=\"" . $session->localUrl("register.php") . "\">Register Account</a>"; function display_unknown_theme() setup_site("Unknown Theme"); start_section("Unknown Theme", build_theme_list_nav(), false); The
theme
specified
does
not
exist
in
the
database.
function display_permission_denied($type) setup_site("Permission Denied"); start_section("Permission Denied", build_theme_list_nav(), false); You
do
not
have
permission
to
<?php print $type ?> this
theme.
This
incident
has
been
reported
to
the
FBI.
function display_add_theme() global $_FILES, $HTTP_POST_FILES, $HTTP_POST_VARS; global $name, $version, $url, $homepage, $filesize, $brief; global $icon, $screenshot; global $icon_size, $screenshot_size; global $theme_icon_dir, $theme_screenshot_dir; "name", "version", "url", "filesize", "brief", "description" for ($i = 0; $i < count($requiredinfo); $i++) { if (empty($GLOBALS[$requiredinfo[$i]])) { $GLOBALS[$requiredinfo[$i]] = -1; if (!is_numeric($filesize)) if ($missinginfo == false) $theme_id = $themes->add_theme($users->get_active_user_id(), $homepage, $filesize, $brief, upload_image($_FILES['icon']['name'], $_FILES['icon']['tmp_name'], $theme_icon_dir, $theme_id); if (trim($screenshot) != "") { upload_image($_FILES['screenshot']['name'], $_FILES['screenshot']['tmp_name'], $theme_screenshot_dir, $theme_id); header("Location: themes.php"); start_section("Add Theme", build_theme_list_nav(), false); if (!is_numeric($filesize)): <b>Error:
</b> The
file
size
field
must
be
an
integer!
You
must
enter
in
all
the
required
information.
Please
fill
in
the
information
in
<font color="#FF0000">red
</font>,
as
well
as
your
password
again,
to
To
add
a
theme
to
the
database,
please
fill
out
the
form
below.
All
posted
material
is
subject
to
the
discretion
of
the
Gaim
team.
As
Gaim
is
a
family
oriented
web
site,
please
refrain
from
posting
questionable
material.
We
reserve
the
right
to
remove
any
content
which
we
deem
inappropriate.
Please
note
that
all
fields
marked
with
a
red
asterisk
(
<font color="#FF0000">*
</font>)
must
be
filled
in!
<form method="post" action="themes.php" enctype="multipart/form-data"> <input type="hidden" name="action" value="addtheme" /> <input type="hidden" name="step" value="2" /> <input type="hidden" name="themetype" value="<?php print $themetype; ?>" /> start_table(array("width" => "100%", "cellspacing" => 0, "cellpadding" => 0, "border" => 0)); start_td(array("align" => "right", "nowrap" => "nowrap")); print "<b>Theme Type:</b> "; print $themes->get_description(); empty_cell(array("colspan" => 2)); form_item("Name", "name", $name, true, 16, 128); form_item("Version", "version", $version, true, 16, 16); form_item("Brief Description", "brief", $brief, true, 30, 255); file_form("Icon", "icon", $icon, false, 30); file_form("Screenshot", "screenshot", $screenshot, false, 30); form_item("Download URL", "url", $url, true, 30, 255); form_item("Home Page", "homepage", $homepage, false, 30, 255); form_item("File Size", "filesize", $filesize, true, 15, 255); start_td(array("align" => "right")); print "(Specify in bytes)"; start_td(array("colspan" => 2)); start_table(array("align" => "center", "border" => 0, "cellspacing" => 0, "cellpadding" => 0)); print "<font color=\"#FF0000\">*</font> "; print "<b>Description:</b>"; start_tag("textarea", array("rows" => 10, "cols" => 50, "name" => "description")); start_td(array("colspan" => 2, "align" => "center")); <input type="submit" value="Submit" /> function show_theme_var($theme, $name, $var, $width = "") if ($width != "") { print " width=\"$width\""; } print " align=\"right\" valign=\"top\">"; print "<b>$name:</b> "; if ($width != "") { print " width=\"$width\""; } global $themes, $users, $session; $themes->update_view_count($id); $theme = $themes->get_theme($id); setup_site($theme["NAME"] . " v" . $theme["VERSION"]); start_section($theme["NAME"] . " v" . $theme["VERSION"], build_theme_list_nav(), false); start_table(array("border" => 0, "width" => "100%")); start_td(array("width" => "100%", "align" => "center", start_table(array("border" => 0, "width" => "100%")); show_theme_var($theme, "Name", "NAME", "50%"); show_theme_var($theme, "Version", "VERSION"); show_theme_var($theme, "Brief Description", "BRIEF"); show_theme_var($theme, "Author", "AUTHOR"); show_theme_var($theme, "Created", "CREATED"); show_theme_var($theme, "Last Updated", "UPDATED"); start_table(array("width" => 400, "border" => 0, "align" => "center")); start_td(); print "<b>Description:</b>"; end_td(); start_td(); print $theme["DESCRIPTION"]; end_td(); start_td(array("nowrap" => "nowrap", "valign" => "top")); if ($theme["USER_ID"] == $users->get_active_user_id()) start_table(array("width" => "100%", "border" => 0)); ahref("Edit Theme", "themes.php?action=edittheme&id=$id"); ahref("Delete Theme", "themes.php?action=deletetheme&id=$id"); /* Home Page / Download table. */ start_table(array("width" => "100%", "border" => 0)); if ($theme["HOMEPAGE"] != "") start_td(array("nowrap" => "nowrap")); ahref("Home Page", $theme["HOMEPAGE"]); start_td(array("nowrap" => "nowrap")); ahref("Download", "$PHP_SELF?action=download&id=$id"); start_table(array("width" => "100%", "border" => 0)); start_td(array("nowrap" => "nowrap")); print "<b>File Size:</b> " . $theme["FILESIZE"]; start_td(array("nowrap" => "nowrap")); print "<b>Page Views:</b> " . $theme["VIEW_COUNT"]; start_td(array("nowrap" => "nowrap")); print "<b>Download Count:</b> " . $theme["DOWNLOAD_COUNT"]; function download_theme() $theme = $themes->get_theme($id); $themes->update_download_count($id); header("Location: " . $theme["URL"]); function display_themes() global $themes, $action, $start, $limit; if (!isset($start)) $start = 0; if (!isset($limit)) $limit = 25; if ($action == "listpopular") $theme_list = $themes->get_popular_themes(); $title = "Popular Themes"; $theme_list = $themes->get_all_themes($start, $limit); $theme_count = $themes->get_theme_count(); start_section($title, build_theme_list_nav(), false); <p><i>There
are
no
themes!
</i></p> $table = new Table(array("", "Name", "Brief Description", "Version", "Author", "Downloads"), $table->set_alignment(0, "center"); $table->set_valignment(0, "center"); $table->set_widths(array("20", "20%", "50%", "10%", "10%", "10%")); $table->set_header_align(5, "right"); while (list($id, $theme) = each($theme_list)) $icon = $themes->get_icon($theme["THEME_ID"]); $icon = "<img src=\"/themes/icons/$icon\" border=\"0\" />"; "<a href=\"themes.php?action=showtheme&id=$id\">" . array("valign" => "top"), array("valign" => "top"), array("valign" => "top"), array("valign" => "top"), array("valign" => "top", "align" => "right") if ($action != "listpopular" && $limit < $theme_count) start_tag("div", array("align" => "center")); ahref("Previous", "themes.php?action=$action&start=" . ($start - $limit) . "&limit=" . $limit); for ($i = 0; $i < ($theme_count / $limit); $i++) if (($i * $limit) == $start) print "<b>" . ($i + 1) . "</b>"; ahref($i + 1, "themes.php?action=$action&start=" . ($i * $limit) . "&limit=" . $limit); if ($start + $limit < $theme_count) ahref("Next", "themes.php?action=$action&start=" . ($start + $limit) . "&limit=" . $limit); function display_edit_theme() global $users, $session, $themes; global $name, $version, $url, $homepage, $filesize, $brief; $theme = $themes->get_theme($id); elseif ($theme["USER_ID"] != $users->get_active_user_id()) display_permission_denied("edit"); "name", "version", "url", "filesize", "brief", "description" for ($i = 0; $i < count($requiredinfo); $i++) { if (empty($GLOBALS[$requiredinfo[$i]])) { $GLOBALS[$requiredinfo[$i]] = -1; if (!is_numeric($filesize)) if ($missinginfo == false) $themes->update_theme($id, $name, $version, $url, $homepage, $filesize, $brief, $description); header("Location: themes.php"); $version = $theme["VERSION"]; $homepage = $theme["HOMEPAGE"]; $filesize = $theme["FILESIZE"]; $brief = $theme["BRIEF"]; $description = $theme["DESCRIPTION"]; setup_site("Edit Theme"); start_section("Edit Theme", build_theme_list_nav(), false); if (!is_numeric($filesize)): <b>Error:
</b> The
file
size
field
must
be
an
integer!
You
must
enter
in
all
the
required
information.
Please
fill
in
the
information
in
<font color="#FF0000">red
</font>,
as
well
as
your
password
again,
to
To
add
a
theme
to
the
database,
please
fill
out
the
form
below.
<b>Note:
</b> If
you
don't
want
to
host
your
own
theme,
you
can
add
it
to
the
<a href="http://sourceforge.net/tracker/?atid=390395&group_id=235&func=browse">tracker
</a> on
SourceForge,
and
use
the
resulting
URL
in
the
Download
URL
field
below.
Please
note
that
all
fields
marked
with
a
red
asterisk
(
<font color="#FF0000">*
</font>)
must
be
filled
in!
<form method="post" action="themes.php" enctype="multipart/form-data"> <input type="hidden" name="action" value="edittheme" /> <input type="hidden" name="step" value="2" /> <input type="hidden" name="id" value="<?php print $id; ?>" /> <input type="hidden" name="themetype" value="<?php print $themetype; ?>" /> start_table(array("width" => "100%", "cellspacing" => 0, "cellpadding" => 0, "border" => 0)); start_td(array("align" => "right", "nowrap" => "nowrap")); print "<b>Theme Type:</b> "; print $themes->get_description(); empty_cell(array("colspan" => 2)); form_item("Name", "name", $name, true, 16, 128); form_item("Version", "version", $version, true, 16, 16); form_item("Brief Description", "brief", $brief, true, 30, 255); file_form("Icon", "icon", $icon, false, 30); file_form("Screenshot", "screenshot", $screenshot, false, 30); form_item("Download URL", "url", $url, true, 30, 255); form_item("Home Page", "homepage", $homepage, false, 30, 255); form_item("File Size", "filesize", $filesize, true, 15, 255); print "<tr><td align=\"right\"><small>(Specify in bytes)</small></td>"; print "<td> </td></tr>\n"; start_td(array("colspan" => 2)); start_table(array("align" => "center", "border" => 0, "cellspacing" => 0, "cellpadding" => 0)); print "<font color=\"#FF0000\">*</font> "; print "<b>Description:</b>"; start_tag("textarea", array("rows" => 10, "cols" => 50, "name" => "description")); start_td(array("colspan" => 2, "align" => "center")); <input type="submit" value="Submit" /> function display_delete_theme() global $users, $session, $themes; $theme = $themes->get_theme($id); elseif ($theme["USER_ID"] != $users->get_active_user_id()) display_permission_denied("edit"); $themes->delete_theme($id); header("Location: themes.php"); setup_site("Delete Theme"); start_section("Delete Theme", build_theme_list_nav(), false); Are
you
sure
you
want
to
delete
this
theme?
<form method="post" action="themes.php"> <input type="hidden" name="action" value="deletetheme" /> <input type="hidden" name="id" value="<?php print $id; ?>" /> <input type="submit" name="confirm" value="yes" /> <input type="submit" name="confirm" value="no" /> function display_search() global $users, $session, $themes; global $type, $keywords, $start, $limit; if ($keywords == "" || !isset($keywords)) setup_site("Search Themes"); start_section("Search Themes", build_theme_list_nav(), false); Enter
as
many
keywords
as
you
like.
They
must
be
separated
by
spaces,
and
we
don't
support
fancy
schmancy
logical
searches!
<form method="get" action="themes.php"> <input type="hidden" name="action" value="search" /> <input type="hidden" name="start" value="0" /> <input type="hidden" name="limit" value="25" /> <b>Keywords:
</b> <input type="text" name="keywords" value="" size="40" /> <input type="radio" name="type" value="name" /> Search
names
<input type="radio" name="type" value="description" checked="checked" /> Search
descriptions
<input type="submit" value="Search" /> setup_site("Search Results"); start_section("Search Results", build_theme_list_nav(), false); $theme_count = $themes->get_search_count($keywords, $type); $results = $themes->search_themes($keywords, $type, $start, <p><i>No
themes
matched
those
keywords!
</i></p> $table = new Table(array("Name", "Brief Description", "Version", "Author", "Downloads"), $table->set_widths(array("20%", "50%", "10%", "10%", "10%")); $table->set_header_align(4, "right"); while (list($id, $theme) = each($results)) "<a href=\"themes.php?action=showtheme&id=$id\">" . array("valign" => "top"), array("valign" => "top"), array("valign" => "top"), array("valign" => "top"), array("valign" => "top", "align" => "right") if ($limit < $theme_count) start_tag("div", array("align" => "center")); ahref("Previous", "themes.php?action=search&start=" . ($start - $limit) . "&limit=" . $limit); for ($i = 0; $i < ($theme_count / $limit); $i++) if (($i * $limit) == $start) print "<b>" . ($i + 1) . "</b>"; ahref($i + 1, "themes.php?action=search&start=" . ($i * $limit) . "&limit=" . $limit); if ($start + $limit < $theme_count) ahref("Next", "themes.php?action=search&start=" . ($start + $limit) . "&limit=" . $limit); /* Beginning of the main code. */ /* Make sure the user isn't trying to trick us. */ if (!$users->logged_in() && ($action == "addtheme" || $action == "edittheme" || $action == "deletetheme")) header("Location: login.php"); print "Invalid theme type specified."; /* Figure out what to do. */ if ($action == "addtheme") { elseif ($action == "showtheme") { elseif ($action == "download") { elseif ($action == "edittheme") { elseif ($action == "deletetheme") { elseif ($action == "search") {