|
Revision 7, 0.9 kB
(checked in by sven, 3 years ago)
|
snapshot of elgg 0.1.2a
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
global $page_owner; |
|---|
| 4 |
$profile_id = $page_owner; |
|---|
| 5 |
$url = url; |
|---|
| 6 |
|
|---|
| 7 |
$posts = db_query("select count(ident) as x from files where (".run("users:access_level_sql_where",$profile_id).") and owner = $profile_id"); |
|---|
| 8 |
$posts = $posts[0]->x; |
|---|
| 9 |
|
|---|
| 10 |
if ($posts > 0) { |
|---|
| 11 |
|
|---|
| 12 |
if ($_SESSION['userid'] == $profile_id) { |
|---|
| 13 |
$title = "Your Files"; |
|---|
| 14 |
} else { |
|---|
| 15 |
$title = "Files"; |
|---|
| 16 |
} |
|---|
| 17 |
|
|---|
| 18 |
$weblog_username = run("users:id_to_name",$profile_id); |
|---|
| 19 |
$body = <<< END |
|---|
| 20 |
<p align="center"> |
|---|
| 21 |
<a href="{$url}{$weblog_username}/files/">File Storage</a> |
|---|
| 22 |
(<a href="{$url}{$weblog_username}/files/rss/">RSS</a>) |
|---|
| 23 |
</p> |
|---|
| 24 |
END; |
|---|
| 25 |
|
|---|
| 26 |
$run_result .= "<div class=\"box_files\">"; |
|---|
| 27 |
$run_result .= run("templates:draw", array( |
|---|
| 28 |
'context' => 'infobox', |
|---|
| 29 |
'name' => $title, |
|---|
| 30 |
'contents' => $body |
|---|
| 31 |
) |
|---|
| 32 |
); |
|---|
| 33 |
$run_result .= "</div>"; |
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
} |
|---|
| 37 |
|
|---|
| 38 |
?> |
|---|