Commit 32989e14 authored by Kjartan's avatar Kjartan

- Fixed blog.module to accept blog/name URLs as well as blog/id

- Changed the RewriteRule in .htaccess.
- Fixed form_select() matching incorrectly.
- Added missing $Id$ to menu.inc
parent ebd95351
......@@ -742,7 +742,7 @@ function form_textarea($title, $name, $value, $cols, $rows, $description = 0) {
function form_select($title, $name, $value, $options, $description = 0, $extra = 0, $multiple = 0) {
if (count($options) > 0) {
foreach ($options as $key=>$choice) {
$select .= "<option value=\"$key\"". (is_array($value) ? (in_array($key, $value) ? " selected=\"selected\"" : "") : ($key == $value ? " selected=\"selected\"" : "")) .">". check_form($choice) ."</option>";
$select .= "<option value=\"$key\"". (is_array($value) ? (in_array($key, $value) ? " selected=\"selected\"" : "") : ($value == $key ? " selected=\"selected\"" : "")) .">". check_form($choice) ."</option>";
}
return form_item($title, "<select name=\"edit[$name]". ($multiple ? "[]" : "") ."\"". ($multiple ? " multiple " : "") . ($extra ? " $extra" : "") .">$select</select>", $description);
}
......
<?php
// $Id$
function menu_trail() {
......@@ -156,4 +157,4 @@ function menu_add($name, $link, $title = NULL, $help = NULL, $parent = NULL, $we
}
}
?>
?>
\ No newline at end of file
......@@ -149,7 +149,7 @@ function blog_page_user($uid = 0) {
global $user, $theme;
if ($uid) {
$account = user_load(array("uid" => $uid, "status" => 1));
$account = user_load(array((is_numeric($uid) ? "uid" : "name") => $uid, "status" => 1));
}
else {
$account = $user;
......
......@@ -149,7 +149,7 @@ function blog_page_user($uid = 0) {
global $user, $theme;
if ($uid) {
$account = user_load(array("uid" => $uid, "status" => 1));
$account = user_load(array((is_numeric($uid) ? "uid" : "name") => $uid, "status" => 1));
}
else {
$account = $user;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment