root/releases/elgg0.8rc2/content/mainindex/content_loggedout.php

Revision 687, 2.1 kB (checked in by sven, 2 years ago)

some htmlentities and php notices fixes

  • Property svn:eol-style set to native
Line 
1 <?php
2 global $CFG;
3 global $db;
4
5 $sitename = sitename;
6
7 $run_result = "<h5>" . __gettext("Welcome") . "</h5>";
8 $run_result .= "<p>" . sprintf(__gettext("This is %s, a learning landscape. Why not check out <a href=\"%s\">what people are saying</a> right now."), $sitename, url . "_weblog/everyone.php") . "<br />";
9 $run_result .= "<br />". sprintf(__gettext("<a href=\"%s\">Find others</a> with similar interests and goals."), url . "search/tags.php") . "<br /><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 example users:");
18     } else {
19         $run_result .= __gettext("Here is an example user:");
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>" . sprintf(__gettext("If you like what you see, why not <a href=\"%s\">register for an account</a>?"), url . "_invite/register.php") . "</p>";
34 $run_result .= "<p>&nbsp;</p>";
35
36 if ($news = get_record_sql("SELECT wp.* FROM ".$CFG->prefix."weblog_posts wp
37                             JOIN ".$CFG->prefix."users u ON u.ident = wp.weblog
38                             WHERE u.username = ? ORDER BY posted DESC",array('news'),false)) {
39     $run_result .= "<div class=\"siteNews\">";
40     $run_result .= "<h2>" . __gettext("Latest news") . "</h2>";
41     $run_result .= "<p>" . run("weblogs:text:process",nl2br(stripslashes($news->body))) . "</p>";
42     $run_result .= "</div>";
43 }
44
45 ?>
Note: See TracBrowser for help on using the browser.