cvs: docweb /templates/all/www users.tpl.php /www redirect.php users.php

[email protected] ("Nuno Lopes")
Newsgroups php.doc.web
Message-ID <cvsnlopess1122726969@cvsserver>
nlopess		Sat Jul 30 08:36:09 2005 EDT

  Added files:                 
    /docweb/templates/all/www	users.tpl.php 
    /docweb/www	users.php 

  Modified files:              
    /docweb/www	redirect.php 
  Log:
  add a minimal /user/xx script. urgent: need a designer :)
  
http://cvs.php.net/diff.php/docweb/www/redirect.php?r1=1.7&r2=1.8&ty=u
Index: docweb/www/redirect.php
diff -u docweb/www/redirect.php:1.7 docweb/www/redirect.php:1.8
--- docweb/www/redirect.php:1.7	Tue May 24 10:16:01 2005
+++ docweb/www/redirect.php	Sat Jul 30 08:36:09 2005
@@ -15,7 +15,7 @@
 +----------------------------------------------------------------------+
 | Authors:          Sean Coates <[email protected]>                         |
 +----------------------------------------------------------------------+
-$Id: redirect.php,v 1.7 2005/05/24 14:16:01 nlopess Exp $
+$Id: redirect.php,v 1.8 2005/07/30 12:36:09 nlopess Exp $
 */
 
 require_once('../include/lib_proj_lang.inc.php');
@@ -79,7 +79,16 @@
     }
 }
 
-if (!($uri = part_is_valid_uri($uri))) {
+// exception for the /user/xx shortcut
+$parts = explode('/', $uri);
+if ((count($parts) == 3 || count($parts) == 4) &&
+    $parts[1] == 'user')
+{
+    $userid = $parts[2];
+    $uri    = './users.php';
+
+// generic uri validator
+} elseif (!($uri = part_is_valid_uri($uri))) {
     unset($uri);
 }
 

http://cvs.php.net/co.php/docweb/templates/all/www/users.tpl.php?r=1.1&p=1
Index: docweb/templates/all/www/users.tpl.php
+++ docweb/templates/all/www/users.tpl.php
<?php
global $info;

echo <<< HTML
<p>&docweb.users.username;: $info[username]<br />
&docweb.users.name;: $info[name]<br />
&docweb.users.country;: $info[country]<br />
HTML;

if ($info['whishlist'])
	echo "<a href='$info[whishlist]'>&docweb.users.whishlist;</a><br />";

if (is_file(dirname(__FILE__) . '/images/users/' . $info['username'] . '.jpg'))
	echo "<img src='/images/users/$info[username].jpg' alt='&docweb.users.photo;'/>";

echo '</p>';
?>

http://cvs.php.net/co.php/docweb/www/users.php?r=1.1&p=1
Index: docweb/www/users.php
+++ docweb/www/users.php
<?php
/* $Id: users.php,v 1.1 2005/07/30 12:36:09 nlopess Exp $ */

include '../include/init.inc.php';
require_once '../include/lib_auth.inc.php';

if(empty($userid) || !is_string($userid) || !ctype_alpha($userid))
	die('no hacking allowed :)');

$info = user_info($userid);

echo site_header('docweb.common.header.users');
echo DocWeb_Template::get('users.tpl.php');
echo site_footer();

?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.