various fixes pulled from trunk

git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.1@437 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-08-06 19:27:54 +00:00
parent c607260c95
commit f101a1fc93
7 changed files with 19 additions and 15 deletions

View File

@ -167,6 +167,16 @@ class ImageIO extends Extension {
global $database;
global $config;
/*
* Validate things
*/
if(!empty($image->source)) {
if(!preg_match("#^(https?|ftp)://#", $image->source)) {
$error = "Image's source isn't a valid URL";
return $error;
}
}
/*
* Check for an existing image
*/

View File

@ -51,8 +51,7 @@ class RSS_Images extends Extension {
$title = $config->get_string('title');
$base_href = $config->get_string('base_href');
$version = $config->get_string('version');
$xml = "
<"."?xml version=\"1.0\" encoding=\"utf-8\" ?".">
$xml = "<"."?xml version=\"1.0\" encoding=\"utf-8\" ?".">
<rss version=\"2.0\">
<channel>
<title>$title</title>
@ -62,8 +61,7 @@ class RSS_Images extends Extension {
<copyright>(c) 2007 Shish</copyright>
$data
</channel>
</rss>
";
</rss>";
$page->set_data($xml);
}
// }}}

View File

@ -80,8 +80,8 @@ class Upload extends Extension {
}
else if(filesize($file['tmp_name']) > $config->get_int('upload_size')) {
$this->theme->display_upload_error($page, "Error with ".html_escape($file['name']),
"File too large (".filesize($file['tmp_name'])." &gt; ".
($config->get_int('upload_size')).")");
"File too large (".to_shorthand_int(filesize($file['tmp_name']))." &gt; ".
(to_shorthand_int($config->get_int('upload_size'))).")");
}
else if(!($info = getimagesize($file['tmp_name']))) {
$this->theme->display_upload_error($page, "Error with ".html_escape($file['name']),

View File

@ -122,10 +122,6 @@ A:hover {text-decoration: underline;}
.withleft {
margin-left: 160px;
}
#body TABLE {
width: 90%;
margin: auto;
}
.paginator {
margin: 16px;
text-align: center;

View File

@ -20,7 +20,7 @@ class TagListTheme extends Themelet {
$page->disable_left();
$page->set_title("Tag List");
$page->set_heading($this->heading);
$page->add_block(new Block("Navigation", str_replace("<br>", " ", $this->navigation), "main", 0));
$page->add_block(new Block("Navigation", str_replace("<br>", ", ", $this->navigation), "main", 0));
$page->add_block(new Block("&nbsp;", $this->list));
}

View File

@ -33,7 +33,7 @@ class UserPageTheme extends Themelet {
$html .= "
<form action='".make_link("user_admin/create")."' method='POST'>
<table style='width: 300px;' border='1'>
<table style='width: 300px;'>
<tr><td>Name</td><td><input type='text' name='name'></td></tr>
<tr><td>Password</td><td><input type='password' name='pass1'></td></tr>
<tr><td>Repeat Password</td><td><input type='password' name='pass2'></td></tr>
@ -75,7 +75,7 @@ class UserPageTheme extends Themelet {
}
public function display_ip_list($page, $uploads, $comments) {
$html = "<table id='ip-history'>";
$html = "<table id='ip-history' style='width: 400px;'>";
$html .= "<tr><td>Uploaded from: ";
foreach($uploads as $ip => $count) {
$html .= "<br>$ip ($count)";
@ -140,7 +140,7 @@ class UserPageTheme extends Themelet {
<form action='".make_link("user_admin/change_pass")."' method='POST'>
<input type='hidden' name='name' value='{$duser->name}'>
<input type='hidden' name='id' value='{$duser->id}'>
<table style='width: 300px;' border='1'>
<table style='width: 300px;'>
<tr><td colspan='2'>Change Password</td></tr>
<tr><td>Password</td><td><input type='password' name='pass1'></td></tr>
<tr><td>Repeat Password</td><td><input type='password' name='pass2'></td></tr>

View File

@ -103,7 +103,7 @@ class ViewTheme extends Themelet {
<div id='imgdata'><form action='".make_link("tag_edit/set")."' method='POST'>
<input type='hidden' name='image_id' value='$i_image_id'>
<input type='hidden' name='query' value='$h_query'>
<table style='width: 500px;'>
<table style='width: 500px; margin: 0px;'>
<tr><td width='50px'>Tags</td><td width='300px'><input type='text' name='tags' value='$h_tags'></td></tr>
<tr><td>Source</td><td><input type='text' name='source' value='$h_source'></td></tr>
<tr><td>&nbsp;</td><td><input type='submit' value='Set'></td></tr>