Changeset 106
- Timestamp:
- 01/12/06 08:02:45 (3 years ago)
- Files:
-
- devel/_activity/index.php (modified) (2 diffs)
- devel/_files/rss2.php (modified) (1 diff)
- devel/content/mainindex/content_loggedout.php (modified) (2 diffs)
- devel/content/mainindex/content_main_index.php (modified) (2 diffs)
- devel/units/admin/admin_actions.php (modified) (1 diff)
- devel/units/admin/admin_contentflags.php (modified) (1 diff)
- devel/units/admin/admin_main.php (modified) (3 diffs)
- devel/units/admin/admin_users.php (modified) (1 diff)
- devel/units/atom/isotope/storeElgg.php (modified) (3 diffs)
- devel/units/communities/communities_access_level_check.php (modified) (1 diff)
- devel/units/communities/communities_access_level_sql_check.php (modified) (2 diffs)
- devel/units/communities/communities_actions.php (modified) (1 diff)
- devel/units/communities/communities_edit.php (modified) (1 diff)
- devel/units/communities/permissions_check.php (modified) (2 diffs)
- devel/units/communities/user_info_menu_text.php (modified) (1 diff)
- devel/units/db/library.php (modified) (5 diffs)
- devel/units/display/function_output_field_display.php (modified) (2 diffs)
- devel/units/files/files_init.php (modified) (1 diff)
- devel/units/files/files_user_info_menu.php (modified) (1 diff)
- devel/units/files/function_search.php (modified) (3 diffs)
- devel/units/friends/friends_edit.php (modified) (1 diff)
- devel/units/friends/friends_of_edit.php (modified) (1 diff)
- devel/units/friends/user_friends.php (modified) (1 diff)
- devel/units/friends/user_info_menu_text.php (modified) (1 diff)
- devel/units/groups/function_access_level_sql_where.php (modified) (1 diff)
- devel/units/groups/get_groups_membership.php (modified) (1 diff)
- devel/units/icons/function_actions.php (modified) (1 diff)
- devel/units/icons/function_add_icons.php (modified) (1 diff)
- devel/units/invite/invite_actions.php (modified) (1 diff)
- devel/units/magpie/function_update.php (modified) (1 diff)
- devel/units/magpie/function_view.php (modified) (1 diff)
- devel/units/magpie/function_view_individual.php (modified) (1 diff)
- devel/units/profile/function_search.php (modified) (1 diff)
- devel/units/profile/function_search_ecl.php (modified) (1 diff)
- devel/units/profile/function_search_rss.php (modified) (1 diff)
- devel/units/search/tags_display.php (modified) (1 diff)
- devel/units/search/tags_display_personal.php (modified) (1 diff)
- devel/units/templates/template_actions.php (modified) (4 diffs)
- devel/units/users/function_access_level_select.php (modified) (1 diff)
- devel/units/users/function_access_level_sql_where.php (modified) (1 diff)
- devel/units/users/function_number_of_users.php (modified) (1 diff)
- devel/units/weblogs/function_search.php (modified) (1 diff)
- devel/units/weblogs/weblogs_actions.php (modified) (1 diff)
- devel/units/weblogs/weblogs_all_users_view.php (modified) (1 diff)
- devel/units/weblogs/weblogs_friends_view.php (modified) (1 diff)
- devel/units/weblogs/weblogs_posts_view.php (modified) (1 diff)
- devel/units/weblogs/weblogs_user_info_menu.php (modified) (1 diff)
- devel/units/weblogs/weblogs_view.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/_activity/index.php
r98 r106 40 40 41 41 $activities = db_query("select users.username, weblog_comments.*, weblog_posts.ident as weblogpost, weblog_posts.title as weblogtitle, weblog_posts.weblog as weblog from weblog_comments left join weblog_posts on weblog_posts.ident = weblog_comments.post_id left join users on users.ident = weblog_posts.weblog where weblog_comments.posted >= $starttime and weblog_posts.owner = $page_owner order by weblog_comments.posted desc"); 42 if ( sizeof($activities) > 0) {42 if (is_array($activities) && sizeof($activities) > 0) { 43 43 foreach($activities as $activity) { 44 44 $commentbody = stripslashes($activity->body); … … 59 59 60 60 $activities = db_query("select users.username, users.name as weblogname, weblog_comments.*, weblog_posts.weblog, weblog_posts.ident as weblogpost, weblog_posts.title as weblogtitle, weblog_posts.weblog as weblog from weblog_watchlist left join weblog_comments on weblog_comments.post_id = weblog_watchlist.weblog_post left join weblog_posts on weblog_posts.ident = weblog_comments.post_id left join users on users.ident = weblog_posts.weblog where weblog_watchlist.owner = $page_owner and weblog_comments.posted >= $starttime order by weblog_comments.posted desc"); 61 if ( sizeof($activities) > 0) {61 if (is_array($activities) && sizeof($activities) > 0) { 62 62 foreach($activities as $activity) { 63 63 $commentbody = stripslashes($activity->body); devel/_files/rss2.php
r92 r106 46 46 } else { 47 47 $tag = trim($_REQUEST['tag']); 48 $files = db_query("select files.* from tags leftjoin files on files.ident = tags.ref where files.files_owner = $page_owner and files.access = 'PUBLIC' and tags.tagtype = 'file' and tags.tag = '$tag' order by files.time_uploaded desc limit 10");48 $files = db_query("select files.* from tags join files on files.ident = tags.ref where files.files_owner = $page_owner and files.access = 'PUBLIC' and tags.tagtype = 'file' and tags.tag = '$tag' order by files.time_uploaded desc limit 10"); 49 49 } 50 50 if (sizeof($files) > 0) { devel/content/mainindex/content_loggedout.php
r45 r106 7 7 $run_result .= "<p>". sprintf(gettext("<a href=\"%s\">Find others</a> with similar interests and goals."), url . "search/tags.php") . "<br /><br />"; 8 8 9 $users = db_query("SELECT distinct users.*, icons.filename as iconfile FROM tags LEFT JOIN users ON users.ident = tags.owner left join icons on icons.ident = users.icon WHERE (tags.tagtype = 'biography' OR tags.tagtype = 'minibio' OR tags.tagtype = 'interests')AND users.icon != -1 AND tags.access = 'PUBLIC' and users.user_type = 'person' ORDER BY rand( ) LIMIT 3");9 $users = db_query("SELECT DISTINCT users.*, icons.filename AS iconfile FROM tags JOIN users ON users.ident = tags.owner LEFT JOIN icons ON icons.ident = users.icon WHERE tags.tagtype IN ('biography','minibio','interests') AND users.icon != -1 AND tags.access = 'PUBLIC' AND users.user_type = 'person' ORDER BY RAND() LIMIT 3"); 10 10 11 11 if (sizeof($users) > 0) { … … 30 30 $run_result .= "<p> </p>"; 31 31 32 $news = db_query("select weblog_posts.* from weblog_posts leftjoin users on users.ident = weblog_posts.weblog where users.username = 'news' order by posted desc limit 1");32 $news = db_query("select weblog_posts.* from weblog_posts join users on users.ident = weblog_posts.weblog where users.username = 'news' order by posted desc limit 1"); 33 33 if (sizeof($news) > 0) { 34 34 devel/content/mainindex/content_main_index.php
r84 r106 7 7 $run_result .= "<p>". gettext("Tell people about yourself and connect to others with similar interests and goals.") . "<br />"; 8 8 9 $users = db_query("SELECT distinct users.*, icons.filename as iconfile FROM tags LEFT JOIN users ON users.ident = tags.owner left join icons on icons.ident = users.icon WHERE (tags.tagtype = 'biography' OR tags.tagtype = 'minibio' OR tags.tagtype = 'interests')AND users.icon != -1 AND tags.access = 'PUBLIC' and users.user_type = 'person' ORDER BY rand( ) LIMIT 3");9 $users = db_query("SELECT DISTINCT users.*, icons.filename AS iconfile FROM tags JOIN users ON users.ident = tags.owner LEFT JOIN icons ON icons.ident = users.icon WHERE tags.tagtype IN ('biography','minibio','interests') AND users.icon != -1 AND tags.access = 'PUBLIC' AND users.user_type = 'person' ORDER BY RAND() LIMIT 3"); 10 10 11 11 if (sizeof($users) > 0) { … … 31 31 $run_result .= "<p> </p>"; 32 32 33 $news = db_query("select weblog_posts.* from weblog_posts leftjoin users on users.ident = weblog_posts.weblog where users.username = 'news' order by posted desc limit 1");33 $news = db_query("select weblog_posts.* from weblog_posts join users on users.ident = weblog_posts.weblog where users.username = 'news' order by posted desc limit 1"); 34 34 if (sizeof($news) > 0) { 35 35 devel/units/admin/admin_actions.php
r66 r106 117 117 } else { 118 118 119 $exists = db_query("select count( ident) as num from users where username = '" . $new_username[$i] . "'");119 $exists = db_query("select count(*) as num from users where username = '" . $new_username[$i] . "'"); 120 120 $exists = $exists[0]->num; 121 121 devel/units/admin/admin_contentflags.php
r45 r106 10 10 $run_result .= "<form action=\"\" method=\"post\">"; 11 11 12 $flags = db_query("select distinct url, count( ident) as totalflags from content_flags group by url order by totalflags desc");12 $flags = db_query("select distinct url, count(*) as totalflags from content_flags group by url order by totalflags desc"); 13 13 if (sizeof($flags) > 0) { 14 14 devel/units/admin/admin_main.php
r97 r106 10 10 11 11 // Number of users of each type 12 $users = db_query("select user_type, count( ident) as numusers from users group by user_type");12 $users = db_query("select user_type, count(*) as numusers from users group by user_type"); 13 13 if (sizeof($users) > 0) { 14 14 foreach($users as $user) { … … 26 26 27 27 // Number of weblog posts 28 $weblog_posts = db_query("select count( ident) as numposts from weblog_posts");29 $weblog_comments = db_query("select count( ident) as numposts from weblog_comments");30 $weblog_posts_7days = db_query("select count( ident) as numposts from weblog_posts where posted > (UNIX_TIMESTAMP() - (86400 * 7))");31 $weblog_comments_7days = db_query("select count( ident) as numposts from weblog_comments where posted > (UNIX_TIMESTAMP() - (86400 * 7))");28 $weblog_posts = db_query("select count(*) as numposts from weblog_posts"); 29 $weblog_comments = db_query("select count(*) as numposts from weblog_comments"); 30 $weblog_posts_7days = db_query("select count(*) as numposts from weblog_posts where posted > (UNIX_TIMESTAMP() - (86400 * 7))"); 31 $weblog_comments_7days = db_query("select count(*) as numposts from weblog_comments where posted > (UNIX_TIMESTAMP() - (86400 * 7))"); 32 32 $run_result .= run("templates:draw", array( 33 33 'context' => 'adminTable', … … 39 39 40 40 // Number of files 41 $files = db_query("select count( ident) as numfiles, sum(size) as totalsize from files");42 $files_7days = db_query("select count( ident) as numfiles, sum(size) as totalsize from files where time_uploaded > (UNIX_TIMESTAMP() - (86400 * 7))");41 $files = db_query("select count(*) as numfiles, sum(size) as totalsize from files"); 42 $files_7days = db_query("select count(*) as numfiles, sum(size) as totalsize from files where time_uploaded > (UNIX_TIMESTAMP() - (86400 * 7))"); 43 43 $run_result .= run("templates:draw", array( 44 44 'context' => 'adminTable', devel/units/admin/admin_users.php
r97 r106 26 26 $run_result .= "</form>"; 27 27 28 $maxusers = db_query("select count( ident) as maxusers from users where users.user_type = 'person'");28 $maxusers = db_query("select count(*) as maxusers from users where users.user_type = 'person'"); 29 29 $maxusers = $maxusers[0]->maxusers; 30 30 31 $users = db_query("select users.* from users where users.user_type = 'person' group by identorder by username asc limit $offset, 50");31 $users = db_query("select users.* from users where users.user_type = 'person' order by username asc limit $offset, 50"); 32 32 33 33 if (sizeof($users) > 0) { devel/units/atom/isotope/storeElgg.php
r45 r106 4 4 * isoTope: an Atom-powered web framework * 5 5 * * 6 * storeElgg.php - Elg storage of Atom entries. *6 * storeElgg.php - Elgg storage of Atom entries. * 7 7 * Implements the storeAPI * 8 8 * * … … 17 17 18 18 /* 19 if ($config["storeDir"]) {20 } else {21 $req->addMsg("ElggStorage: not configured yet");22 }19 if ($config["storeDir"]) { 20 } else { 21 $req->addMsg("ElggStorage: not configured yet"); 22 } 23 23 */ 24 24 $req->addMsg("ElggStorage: init"); … … 48 48 global $req; 49 49 50 // TODO distinguish between blogs51 52 $userIdent = run("users:name_to_id", ELGG_USER);53 $user = run("users:instance", $userIdent);54 $weblog = run("weblogs:instance", array('user_id' => $userIdent,55 'blog_id' => $userIdent));50 // TODO distinguish between blogs 51 52 $userIdent = run("users:name_to_id", ELGG_USER); 53 $user = run("users:instance", $userIdent); 54 $weblog = run("weblogs:instance", array('user_id' => $userIdent, 55 'blog_id' => $userIdent)); 56 56 57 $posts = array_slice($weblog->getPosts(), 0, $first);57 $posts = array_slice($weblog->getPosts(), 0, $first); 58 58 59 $feed = new AtomFeed();60 $feed->title = $weblog->getTitle();59 $feed = new AtomFeed(); 60 $feed->title = $weblog->getTitle(); 61 61 62 62 $feed->modified=0; 63 63 64 if ($first >= 1)65 {66 if (sizeof($posts) > 0)67 {68 foreach($posts as $post_id)69 {70 // Get post object71 $post = $weblog->getPost($post_id);64 if ($first >= 1) 65 { 66 if (sizeof($posts) > 0) 67 { 68 foreach($posts as $post_id) 69 { 70 // Get post object 71 $post = $weblog->getPost($post_id); 72 72 73 // New entry74 $atomEntry = new AtomFeedEntry();75 $atomEntry->id = $post_id;76 $atomEntry->created = date('Y-m-d\TH:i:s', $post->getPosted());77 $atomEntry->modified = date('Y-m-d\TH:i:s', $post->getPosted());73 // New entry 74 $atomEntry = new AtomFeedEntry(); 75 $atomEntry->id = $post_id; 76 $atomEntry->created = date('Y-m-d\TH:i:s', $post->getPosted()); 77 $atomEntry->modified = date('Y-m-d\TH:i:s', $post->getPosted()); 78 78 79 $atomEntry->link =substr($post->getPermaLink(),0,-5);80 $atomEntry->title = $post->getTitle();81 $atomEntry->issued = date('Y-m-d\TH:i:s', $post->getPosted());82 // Personal data83 $person = new AtomPerson();84 $person->name = $user->getName();85 $person->url = url.ELGG_USER."/weblog";86 $person->email = $user->getEmail();87 88 $atomEntry->author = $person;79 $atomEntry->link = substr($post->getPermaLink(),0,-5); 80 $atomEntry->title = $post->getTitle(); 81 $atomEntry->issued = date('Y-m-d\TH:i:s', $post->getPosted()); 82 // Personal data 83 $person = new AtomPerson(); 84 $person->name = $user->getName(); 85 $person->url = url.ELGG_USER."/weblog"; 86 $person->email = $user->getEmail(); 87 88 $atomEntry->author = $person; 89 89 90 $atomContent = new AtomContent();91 $atomContent->containerType = "text";92 $atomContent->container = "Here is the entry";93 $atomEntry->content = $atomContent;94 95 $postUrl = $this->blogDirUrl;96 97 $req->addMsg("storeElgg: getAtomEntries");90 $atomContent = new AtomContent(); 91 $atomContent->containerType = "text"; 92 $atomContent->container = "Here is the entry"; 93 $atomEntry->content = $atomContent; 94 95 $postUrl = $this->blogDirUrl; 96 97 $req->addMsg("storeElgg: getAtomEntries"); 98 98 99 // TODO modify service url for this post99 // TODO modify service url for this post 100 100 101 // Add the entry to the feed102 array_push($feed->entries, $atomEntry);103 }104 }105 }101 // Add the entry to the feed 102 array_push($feed->entries, $atomEntry); 103 } 104 } 105 } 106 106 return $feed; 107 107 } devel/units/communities/communities_access_level_check.php
r45 r106 4 4 $commnum = (int) substr($parameter, 9, 15); 5 5 $result = db_query("select friends.owner from friends 6 leftjoin users on users.ident = friends.friend6 join users on users.ident = friends.friend 7 7 where users.user_type = 'community' 8 8 and users.ident = $commnum devel/units/communities/communities_access_level_sql_check.php
r45 r106 5 5 if (logged_on) { 6 6 7 $communities = db_query("select users.* from friends left join users on users.ident = friends.friend where users.user_type = 'community' and users.owner <> " . $_SESSION['userid'] . " and friends.owner = " . $_SESSION['userid']); 7 $communitieslist = array(); 8 9 $communities = db_query("select users.* from friends join users on users.ident = friends.friend where users.user_type = 'community' and users.owner <> " . $_SESSION['userid'] . " and friends.owner = " . $_SESSION['userid']); 8 10 if (sizeof($communities) > 0) { 9 11 foreach($communities as $community) { 10 $ run_result .= "or access = \"community" . $community->ident . "\" ";12 $communitieslist[] = $community->ident; 11 13 } 12 14 } … … 14 16 if (sizeof($communities) > 0) { 15 17 foreach($communities as $community) { 16 $ run_result .= "or access = \"community" . $community->ident . "\" ";18 $communitieslist[] = $community->ident; 17 19 } 18 20 } 19 21 if (count($communitieslist)) { 22 $communitieslist = array_unique($communitieslist); 23 $run_result .= " or access IN ('community" . implode("', 'community", $communitieslist) . "') "; 24 } 20 25 } 21 26 devel/units/communities/communities_actions.php
r77 r106 20 20 } else { 21 21 $username = strtolower(trim($_REQUEST['comm_username'])); 22 $usernametaken = db_query("select count( ident) as taken from users where username = '$username'");22 $usernametaken = db_query("select count(*) as taken from users where username = '$username'"); 23 23 $usernametaken = $usernametaken[0]->taken; 24 24 if ($usernametaken > 0) { devel/units/communities/communities_edit.php
r84 r106 10 10 11 11 $result = db_query("select users.*, friends.ident as friendident from friends 12 leftjoin users on users.ident = friends.friend12 join users on users.ident = friends.friend 13 13 where friends.owner = $user_id and users.user_type = 'community'"); 14 14 devel/units/communities/permissions_check.php
r45 r106 20 20 } 21 21 if ($run_result != true) { 22 $result = db_query("select count( users.ident) as num from friends23 leftjoin users on users.ident = friends.friend22 $result = db_query("select count(*) as num from friends 23 join users on users.ident = friends.friend 24 24 where users.ident = $page_owner 25 25 and friends.owner = ". $_SESSION['userid'] . " … … 56 56 } 57 57 if ($run_result != true) { 58 $result = db_query("select count( users.ident) as num from friends59 leftjoin users on users.ident = friends.friend58 $result = db_query("select count(*) as num from friends 59 join users on users.ident = friends.friend 60 60 where users.ident = $owner 61 61 and friends.owner = ". $_SESSION['userid'] . " devel/units/communities/user_info_menu_text.php
r45 r106 9 9 10 10 if (run("users:type:get", $user_id) == "community") { 11 $result = db_query("select count( users.ident) as friend from friends12 leftjoin users on users.ident = friends.friend11 $result = db_query("select count(*) as friend from friends 12 join users on users.ident = friends.friend 13 13 where friends.owner = " . $_SESSION['userid'] . " 14 and friends.friend = $user_id");14 and friends.friend = $user_id"); 15 15 $result = $result[0]->friend; 16 16 if ($result == 0) { devel/units/db/library.php
r94 r106 1 1 <?php 2 3 /*4 * TODO: This could probably do with using the $db_connection variable in the mysql functions,5 * as PHP can be a bit arbitrary in its choice of db session. Would also be required for a6 * replicated mysql system, which could be a future need for large user bases.7 * Not actually running a test copy of Elgg atm so dunno what scope $db_connection's in.8 * - Sven9 */10 2 11 3 // Database library functions … … 16 8 global $querynum; 17 9 global $querycache; 10 global $db_connection; 18 11 19 12 /*if (isset($querycache[$sql_query])) { … … 29 22 // echo "<b>" . $run_context . "</b> " . $sql_query . "<br />"; 30 23 if ($sql_query != "") { 31 // echo "<!-- $sql_query -->\n"; 32 if ($result = @mysql_query($sql_query)) { 24 if ($result = @mysql_query($sql_query, $db_connection)) { 33 25 $data = array(); 34 26 if (!is_bool($result)) { … … 42 34 } else { 43 35 if (ELGG_DEBUG) { 44 echo $sql_query . " :: " . @mysql_error( ) . "<br />\n";36 echo $sql_query . " :: " . @mysql_error($db_connection) . "<br />\n"; 45 37 } 46 38 $querycache[$sql_query] = FALSE; … … 54 46 // Rows affected by the last MySQL transaction 55 47 function db_affected_rows() { 56 return @mysql_affected_rows(); 48 global $db_connection; 49 return @mysql_affected_rows($db_connection); 57 50 } 58 51 59 52 // Returns the ID of the last MySQL transaction 60 53 function db_id() { 61 return @mysql_insert_id(); 54 global $db_connection; 55 return @mysql_insert_id($db_connection); 62 56 } 63 57 devel/units/display/function_output_field_display.php
r85 r106 61 61 $where = run("users:access_level_sql_where",$_SESSION['userid']); 62 62 foreach($keyword_list as $key => $list_item) { 63 $numberofkeywords = db_query("select count( ident) as number from profile_data where ($where) and name = '".$parameter[2]."' and value like \"%[[".$list_item."]]%\"");63 $numberofkeywords = db_query("select count(*) as number from profile_data where ($where) and name = '".$parameter[2]."' and value like \"%[[".$list_item."]]%\""); 64 64 $number = $numberofkeywords[0]->number; 65 65 if ($number > 1) { … … 84 84 $keywords .= ", "; 85 85 } 86 $numberoftags = db_query("select count( ident) as number from tags where tag = '".$tag->tag."'");86 $numberoftags = db_query("select count(*) as number from tags where tag = '".$tag->tag."'"); 87 87 $numberoftags = $numberoftags[0]->number; 88 88 if ($numberoftags > 1) { devel/units/files/files_init.php
r45 r106 29 29 if (isset($_REQUEST['folder'])) { 30 30 $folder = (int) $_REQUEST['folder']; 31 $result = db_query("select count( ident) as x from file_folders where ident = $folder and files_owner = $owner");31 $result = db_query("select count(*) as x from file_folders where ident = $folder and files_owner = $owner"); 32 32 if ($result[0]->x < 1) { 33 33 $folder = -1; devel/units/files/files_user_info_menu.php
r84 r106 7 7 if ($page_owner != -1 && $page_owner != $_SESSION['userid']) { 8 8 9 $posts = db_query("select count( ident) as x from files where (".run("users:access_level_sql_where",$profile_id).") and files_owner = $profile_id");9 $posts = db_query("select count(*) as x from files where (".run("users:access_level_sql_where",$profile_id).") and files_owner = $profile_id"); 10 10 $posts = $posts[0]->x; 11 11 devel/units/files/function_search.php
r85 r106 15 15 $folder_refs = db_query("select ref from tags where $searchline_folders"); 16 16 $searchline = ""; 17 $searchlist = array(); 17 18 if (sizeof($folder_refs) > 0) { 18 19 foreach($folder_refs as $folder) { 19 if ($searchline != "") { 20 $searchline .= " or "; 21 } 22 $searchline .= "file_folders.ident = " . $folder->ref; 20 $searchlist[] = $folder->ref; 23 21 } 22 $searchline = " file_folders.ident IN (" . implode(", ", $searchlist) . ") "; 24 23 $folders = db_query("select file_folders.name, users.name as userfullname, users.username, file_folders.ident from file_folders 25 leftjoin users on users.ident = file_folders.owner where ($searchline)24 join users on users.ident = file_folders.owner where ($searchline) 26 25 order by name asc"); 27 26 $run_result .= "<h2>" . sprintf(gettext("Folders owned by '%s' in category '%s'"),stripslashes($folders[0]->userfullname),$parameter[1])."</h2>\n"; … … 41 40 } 42 41 $searchline = ""; 42 $searchlist = array(); 43 43 if (sizeof($file_refs) > 0) { 44 44 foreach($file_refs as $file) { 45 if ($searchline != "") { 46 $searchline .= " or "; 47 } 48 $searchline .= "files.ident = " . $file->ref; 45 $searchlist[] = $file->ref; 49 46 } 47 $searchline = " files.ident IN (" . implode(", ", $searchlist) . ") "; 50 48 $files = db_query("select files.*, users.username, users.name as userfullname from files 51 leftjoin users on users.ident = files.owner where ($searchline)49 join users on users.ident = files.owner where ($searchline) 52 50 order by title asc") 53 51 or die(mysql_error()); … … 71 69 $run_result .= "<p><small>[ <a href=\"".url.$files[0]->username . "/files/rss/" . $parameter[1] . "\">".sprintf(gettext("RSS feed for files owned by %s"), stripslashes($files[0]->userfullname)) . " in category '".$parameter[1]."'</a> ]</small></p>\n"; 72 70 } 73 $searchline = " (tagtype = 'file' or tagtype ='folder') and tag = '".addslashes($parameter[1])."'";71 $searchline = " tagtype IN ('file','folder') and tag = '".addslashes($parameter[1])."'"; 74 72 $searchline = "(" . run("users:access_level_sql_where",$_SESSION['userid']) . ") and " . $searchline; 75 73 $searchline = str_replace("owner","tags.owner",$searchline); 76 $sql = "select distinct users.* from tags leftjoin users on users.ident = tags.owner where ($searchline)";74 $sql = "select distinct users.* from tags join users on users.ident = tags.owner where ($searchline)"; 77 75 &nbs
