root/releases/0.1.1b/units/weblogs/function_search_rss.php

Revision 2, 1.3 kB (checked in by sven, 3 years ago)

importing elgg-0.1.1a

Line 
1 <?php
2
3     global $search_exclusions;
4
5     if (isset($parameter) && $parameter[0] == "weblog" || $parameter[0] == "weblogall") {
6         
7         $search_exclusions[] = "weblogall";
8         $owner = (int) $_REQUEST['owner'];
9         $searchline = "tagtype = 'weblog' and tag = '".addslashes($parameter[1])."'";
10         $searchline = "(" . run("users:access_level_sql_where",$_SESSION['userid']) . ") and " . $searchline;
11         $searchline = str_replace("access", "weblog_posts.access", $searchline);
12         $searchline = str_replace("owner", "weblog_posts.owner", $searchline);
13         $refs = db_query("select weblog_posts.ident, weblog_posts.title, users.username, users.name, tags.ref from tags left join weblog_posts on weblog_posts.ident = ref left join users on users.ident = tags.owner where $searchline order by weblog_posts.posted desc limit 50");
14         
15         if (sizeof($refs) > 0) {
16             foreach($refs as $post) {
17                 $run_result .= "\t<item>\n";
18                 $run_result .= "\t\t<title>Weblog post :: " . htmlentities(stripslashes($post->name));
19                 if ($post->title != "") {
20                     $run_result .= " :: " . htmlentities(stripslashes($post->title));
21                 }
22                 $run_result .= "</title>\n";
23                 $run_result .= "\t\t<link>" . url . htmlentities(stripslashes($post->username)) . "/weblog/" . $post->ident . ".html</link>\n";
24                 $run_result .= "\t</item>\n";
25             }
26         }
27         
28     }
29
30 ?>
Note: See TracBrowser for help on using the browser.