cvs: bugtracker /includes cache_generate.php template.php /template/generic/user profile.php
| From: | Barry Carlyon | Date: | Thu, 14 Aug 2008 16:29:21 +0000 |
| Subject: | cvs: bugtracker /includes cache_generate.php template.php /template/generic/user profile.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-2430@lists.php.net to get a copy of this message | ||
bcarlyon Thu Aug 14 16:29:21 2008 UTC
Added files:
/bugtracker/template/generic/user profile.php
Modified files:
/bugtracker/includes cache_generate.php template.php
Log:
End of the working day commit, partial profile display and user editing thereof
http://cvs.php.net/viewvc.cgi/bugtracker/includes/cache_generate.php?r1=1.14&r2=1.15&diff_format=u
Index: bugtracker/includes/cache_generate.php
diff -u bugtracker/includes/cache_generate.php:1.14 bugtracker/includes/cache_generate.php:1.15
--- bugtracker/includes/cache_generate.php:1.14 Thu Aug 14 12:27:25 2008
+++ bugtracker/includes/cache_generate.php Thu Aug 14 16:29:21 2008
@@ -37,7 +37,7 @@
* @author Barry Carlyon <bcarlyon@php.net>
* @copyright 2008-2008 Barry Carlyon
* @license http://www.opensource.org/licenses/bsd-license.php
BSD License
-* @version CVS: $Id: cache_generate.php,v 1.14 2008/08/14 12:27:25 bcarlyon Exp $
+* @version CVS: $Id: cache_generate.php,v 1.15 2008/08/14 16:29:21 bcarlyon Exp $
* @link http://gsoc.barrycarlyon.servegame.org/
*/
@@ -53,11 +53,20 @@
$users = '<?php' . "\n";
while ($row = $db->fetch_row())
{
- $users .= '
+ $users .= '
$cacher["users"][] = "' . $row['handle'] . '";
- $users["' . $row['handle'] . '"]["handle"] = "'
. $row['handle'] . '";
- $users["' . $row['handle'] . '"]["email"] = "' .
$row['email'] . '";
';
+ foreach ($row as $ref => $data)
+ {
+ if (!is_numeric($ref))
+ {
+ $users .= '
+$users["' . $row['handle'] . '"]["' . $ref . '"]
= "' . $data . '";';
+ }
+ }
+// $users["' . $row['handle'] . '"]["handle"] =
"' . $row['handle'] . '";
+// $users["' . $row['handle'] . '"]["email"] = "'
. $row['email'] . '";
+//';
}
$query = 'SELECT * FROM temp_account';
http://cvs.php.net/viewvc.cgi/bugtracker/includes/template.php?r1=1.24&r2=1.25&diff_format=u
Index: bugtracker/includes/template.php
diff -u bugtracker/includes/template.php:1.24 bugtracker/includes/template.php:1.25
--- bugtracker/includes/template.php:1.24 Thu Aug 14 09:06:48 2008
+++ bugtracker/includes/template.php Thu Aug 14 16:29:21 2008
@@ -48,7 +48,7 @@
* @author Barry Carlyon <bcarlyon@php.net>
* @copyright 2008-2008 Barry Carlyon
* @license http://www.opensource.org/licenses/bsd-license.php
BSD License
-* @version CVS: $Id: template.php,v 1.24 2008/08/14 09:06:48 bcarlyon Exp $
+* @version CVS: $Id: template.php,v 1.25 2008/08/14 16:29:21 bcarlyon Exp $
* @link http://gsoc.barrycarlyon.servegame.org/
*/
@@ -442,7 +442,7 @@
$this->login = '<li><a href="/admin/"
title="Admin">Admin</a></li>';
}
- $this->login .= '<li><a href="/user/profile/"
title="Profile">Profile (' . $user->handle .
')</a></li><li><a href="/user/logout/"
title="Logout">Logout</a></li>';
+ $this->login .= '<li><a href="/user/profile/' . $user->handle .
'/" title="Profile">Profile (' . $user->handle .
')</a></li><li><a href="/user/logout/"
title="Logout">Logout</a></li>';
}
$this->swap('login', $this->login );
http://cvs.php.net/viewvc.cgi/bugtracker/template/generic/user/profile.php?view=markup&rev=1.1
Index: bugtracker/template/generic/user/profile.php
+++ bugtracker/template/generic/user/profile.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:*/
/**
* tempkate/generic/user/profile.php
* A users profile
*
* Copyright (c) 2008, Barry Carlyon <bcarlyon@php.net>
* All rights reserved.
*
* PHP versions 5
*
* LICENSE: Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* @category BugTracking
* @package GSoC Bugtracker
* @author Barry Carlyon <bcarlyon@php.net>
* @copyright 2008-2008 Barry Carlyon
* @license http://www.opensource.org/licenses/bsd-license.php
BSD License
* @version CVS: $Id: profile.php,v 1.1 2008/08/14 16:29:21 bcarlyon Exp $
* @link http://gsoc.barrycarlyon.servegame.org/
*/
if ($user->logged_in) {
$view_user = loadvar('method');
$view_user = str_replace('/','',$view_user);
$content = '';
if ($view_user == $user->handle) {
$template->page_title .= 'Profile';
$template->content_title = 'Profile';
include('cache/users.php');
$user_data = $users[$user->handle];
$content = '<form action="/user/profile/update/" method="post"
class="form" id="profile">
<div class="slim">
<label for="handle">Handle:</label> <input type="text"
name="handle" id="handle" value="' . $user->handle . '"
disabled="disabled" />
<br /><br />
<label for="email">Email:</label> <input type="text"
name="email" id="email" value="' . $user_data['email'] .
'" disabled="disabled" />
<br /><br />
<label for="website">Website:</label> <input type="text"
name="website" id="website" value="' . $user_data['website']
. '" />
<br /><br />
</div>
</form>';
} elseif ($view_user) {
} else {
}
$template->prehtml = $content;
} else {
$template->meta_refresh('/login/');
trigger_error('You need to be logged in to view/edit profiles', E_USER_ERROR);
}