| 1 |
<?php |
|---|
| 2 |
global $CFG; |
|---|
| 3 |
global $db; |
|---|
| 4 |
|
|---|
| 5 |
$sitename = sitename; |
|---|
| 6 |
|
|---|
| 7 |
$run_result = "<h3>" . __gettext("Welcome") . "</h3>"; |
|---|
| 8 |
$run_result .= "<p><b>" . sprintf(__gettext("Why not <a href=\"%s\">create your profile</a>?"), url . "profile/edit.php") . "</b></p>"; |
|---|
| 9 |
$run_result .= "<p>". __gettext("Tell people about yourself and connect to others with similar interests and goals.") . "<br />"; |
|---|
| 10 |
|
|---|
| 11 |
if ($users = get_records_sql("SELECT DISTINCT u.*,i.filename AS iconfile, ".$db->random." as rand |
|---|
| 12 |
FROM ".$CFG->prefix."tags t JOIN ".$CFG->prefix."users u ON u.ident = t.owner |
|---|
| 13 |
LEFT JOIN ".$CFG->prefix."icons i ON i.ident = u.icon |
|---|
| 14 |
WHERE t.tagtype IN (?,?,?) AND u.icon != ? AND t.access = ? AND u.user_type = ? |
|---|
| 15 |
ORDER BY rand LIMIT 3",array('biography','minibio','interests',-1,'PUBLIC','person'))) { |
|---|
| 16 |
if (count($users) > 1) { |
|---|
| 17 |
$run_result .= __gettext("Here are some examples of complete profiles:"); |
|---|
| 18 |
} else { |
|---|
| 19 |
$run_result .= __gettext("Here is an example of a complete profile:"); |
|---|
| 20 |
} |
|---|
| 21 |
foreach($users as $key => $user) { |
|---|
| 22 |
if ($key > 0) { |
|---|
| 23 |
$run_result .= ", "; |
|---|
| 24 |
} else { |
|---|
| 25 |
$run_result .= " "; |
|---|
| 26 |
} |
|---|
| 27 |
$run_result .= "<a href=\"" . url . $user->username . "/\">" . stripslashes($user->name) . "</a>"; |
|---|
| 28 |
} |
|---|
| 29 |
} |
|---|
| 30 |
|
|---|
| 31 |
$run_result .= "</p>"; |
|---|
| 32 |
|
|---|
| 33 |
$run_result .= "<p><b>" . sprintf(__gettext("Or you could <a href=\"%s\">start your blog</a>?"),url . "_weblog/edit.php") . "</b><br /><br />"; |
|---|
| 34 |
$run_result .= sprintf(__gettext("Comment on what you're learning, collect interesting links and decide who gets to see what you're writing. Here's what <a href=\"%s\">everyone else is talking about</a> right now."),url . "_weblog/everyone.php") . "</p>"; |
|---|
| 35 |
$run_result .= "<p> </p>"; |
|---|
| 36 |
|
|---|
| 37 |
if ($news = get_record_sql("SELECT wp.* FROM ".$CFG->prefix."weblog_posts wp |
|---|
| 38 |
JOIN ".$CFG->prefix."users u ON u.ident = wp.weblog |
|---|
| 39 |
WHERE u.username = ? ORDER BY posted DESC",array('news'),false)) { |
|---|
| 40 |
$run_result .= "<div class=\"sitenews\">"; |
|---|
| 41 |
$run_result .= "<h2>" . __gettext("Latest news") . "</h2>"; |
|---|
| 42 |
$run_result .= "<p>" . run("weblogs:text:process",nl2br(stripslashes($news->body))) . "</p>"; |
|---|
| 43 |
$run_result .= "</div>"; |
|---|
| 44 |
} |
|---|
| 45 |
?> |
|---|