root/elgg/trunk/profile/extended.php

Revision 151, 1.0 kB (checked in by cedenoj, 1 year ago)

fixes #2833 The profile module now uses PARAM_SAFEDIR as defined in lib/constants.php to allow usernames that include underscores. This should allow the dino users to view and create their profiles. The .htaccess file was also modified so that dino users get pretty urls as well.

Line 
1 <?php
2
3 //    ELGG profile view page
4
5 // Run includes
6 require_once(dirname(dirname(__FILE__)) . '/includes.php');
7 require_once($CFG->dirroot . 'profile/profile.class.php');
8
9 // define what profile to show
10 $profile_name = optional_param('profile_name', '', PARAM_SAFEDIR);
11 if (!empty($profile_name)) {
12     $profile_id = user_info_username('ident', $profile_name);
13 }
14 if (empty($profile_id)) {
15     $profile_id = optional_param('profile_id', -1, PARAM_INT);
16 }
17 // and the page_owner naturally
18 $page_owner = $profile_id;
19
20 define("context", "profile");
21 templates_page_setup();
22
23 // init library
24 $profile = new ElggProfile($profile_id);
25         
26 $title = user_name($profile_id); //$profile->display_name();
27 $body  = $profile->view();
28
29 $body  = templates_draw( array(
30                                'context' => 'contentholder',
31                                'title' => $title,
32                                'body' => $body
33                                ));
34
35 echo templates_page_draw(array($title, $body));
36
37 ?>
38
Note: See TracBrowser for help on using the browser.