Changeset 284
- Timestamp:
- 04/12/08 20:35:29 (8 months ago)
- Files:
-
- bookmarks/trunk/INSTALL (modified) (1 diff)
- bookmarks/trunk/lib.php (modified) (4 diffs)
- bookmarks/trunk/lib/bookmarks_actions.php (modified) (5 diffs)
- bookmarks/trunk/lib/bookmarks_user_info_menu.php (modified) (1 diff)
- bookmarks/trunk/lib/function_rss_getitems.php (modified) (5 diffs)
- bookmarks/trunk/lib/function_rss_publish.php (added)
- bookmarks/trunk/lib/main.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bookmarks/trunk/INSTALL
r260 r284 19 19 RewriteRule ^bookmarks\/popular$ mod/bookmarks/popular.php 20 20 RewriteRule ^bookmarks\/popular\/skip/([0-9]+)$ mod/bookmarks/popular.php?skip=$1 21 RewriteRule ^(([A-Za-z0-9])[A-Za-z0-9]+)\/bookmarks\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=bookmark 21 22 22 23 That's it. bookmarks/trunk/lib.php
r260 r284 3 3 * @package bookmarks 4 4 * @filesource mod/bookmarks/ 5 * @version 2. 05 * @version 2.1 6 6 * @author beni<b.taraghi@tugraz.at> 7 7 * @copyright Copyright © 2007, Graz University of Technology - WG Social Learning<http://www.tugraz.at> … … 21 21 22 22 if (isloggedin() && user_info("user_type", $_SESSION['userid']) != "external" && !(defined("context") && context == "admin")) { 23 //if (user_type($page_owner) == "person") {24 23 if (defined("context") && context == "bookmarks" && $page_owner == $_SESSION['userid']) { 25 24 $PAGE->menu[] = array ( … … 32 31 'html' => "<li><a href=\"{$CFG->wwwroot}{$_SESSION['username']}/bookmarks/all/\" >" . __gettext("Your Bookmarks" 33 32 ) . '</a></li>'); 34 //} 35 } 36 /* 37 if (user_type($page_owner) == "community") { 38 if (defined("context") && context == "bookmarks") { 39 $PAGE->menu[] = array ( 40 'name' => 'bookmarks', 41 'html' => '<li><a href="' . $CFG->wwwroot . $bm_username . '/bookmarks/all/" class="selected">' . __gettext("Bookmarks" 42 ) . '</a></li>'); 43 } else { 44 $PAGE->menu[] = array ( 45 'name' => 'bookmarks', 46 'html' => '<li><a href="' . $CFG->wwwroot . $bm_username . '/bookmarks/all/">' . __gettext("Bookmarks" 47 ) . '</a></li>'); 48 } 49 } 50 */ 33 } 51 34 } 52 35 … … 54 37 55 38 if ($page_owner != -1) { 39 $PAGE->menu_sub[]= array ( 40 'name' => 'bookmark:rssfeed', 41 'html' => "<a href=\"{$CFG->wwwroot}{$bm_username}/bookmarks/rss/\"><img src=\"{$CFG->wwwroot}mod/template/icons/rss.png\" border=\"0\" alt=\"rss\" /></a>" 42 ); 43 56 44 if (run("permissions:check", array ( 57 45 "bookmark:add", bookmarks/trunk/lib/bookmarks_actions.php
r249 r284 42 42 43 43 if(optional_param('bm_import', "0")) { 44 // not used in ELGG 45 // not nacessary because of js 46 /* 47 if(!Modifications::TagsFromStringAreValid($keywords)) 48 { 49 $messages[] = __gettext("You must set at least one key word for your bookmark."); 50 break; 51 } 52 */ 44 53 45 $bool_success = run("bookmarks:import:content", array('import_bookmark_file', $access, $keywords, $category_id, $view)); 54 46 } … … 59 51 // commented to let #page=55&view=FitView work for pdfs 60 52 //$url = preg_replace('/#.*$/', '', $url); 61 /* 62 if(!Modifications::TagsFromStringAreValid($keywords)) 63 { 64 $messages[] = __gettext("You must set at least one key word for your bookmark."); 65 break; 66 } 67 */ 53 68 54 if ($bm_exists = get_field('bookmarks','ident','url',$url)) { 69 55 if (!run("bookmark:subscribed",$bm_exists)) { … … 165 151 } 166 152 if($bool_success) {// success 153 $rssresult = run("bookmarks:rss:publish", array($page_owner, false)); 167 154 if($action == "bookmarks:post:add") 168 155 define('redirect_url',url . user_info("username",$page_owner) . "/bookmarks/all/"); … … 208 195 209 196 } 197 $rssresult = run("bookmarks:rss:publish", array($oldpost->bookmark, false)); 210 198 $messages[] = __gettext("The bookmark has been modified."); // gettext variable 211 199 } … … 224 212 delete_records('tags','tagtype','bookmark','ref',$id); 225 213 226 214 $rssresult = run("bookmarks:rss:publish", array($post_info->bookmark, false)); 227 215 $messages[] = __gettext("The selected bookmark was deleted."); 216 228 217 229 218 // if the user has been the only owner of the bookmark, delete it completely from DB bookmarks/trunk/lib/bookmarks_user_info_menu.php
r249 r284 30 30 $body = '<ul>'; 31 31 32 $body .= "<li><a href=\"$CFG->wwwroot" .$bm_username ."/bookmarks/all/\">$bookmarks_see</a> ( $cnt_bm )</li>"; 32 $rsslink = "<a href=\"{$CFG->wwwroot}{$bm_username}/bookmarks/rss/\"><img src=\"{$CFG->wwwroot}mod/template/icons/rss.png\" border=\"0\" alt=\"rss\" /></a>"; 33 $body .= "<li><a href=\"$CFG->wwwroot" .$bm_username ."/bookmarks/all/\">$bookmarks_see</a> {$rsslink} ($cnt_bm)</li>"; 33 34 34 35 bookmarks/trunk/lib/function_rss_getitems.php
r249 r284 56 56 ORDER BY bs.created_on DESC LIMIT '.$numrows,array($userid,'PUBLIC','bookmark',0)); 57 57 58 $entries_views = get_records_sql('SELECT bs.*, u.username, b.url, b.title as b_title FROM '.$CFG->prefix.'bookmark_subscriptions bs JOIN '.$CFG->prefix.'views v on v.ref = bs.ident JOIN '.$CFG->prefix.'users u ON u.ident = v.view59 JOIN '.$CFG->prefix.'bookmarks b ON b.ident=bs.bookmark_id60 WHERE v.view = ? AND bs.access = ? AND v.viewtype = ?61 AND (SELECT count(ident) FROM '.$CFG->prefix.'tags t WHERE t.tagtype = ? AND t.tag IN ('.$tag_in.') AND t.ref = bs.ident) = ?62 ORDER BY bs.created_on DESC LIMIT '.$numrows,array($userid,'PUBLIC','bookmark','bookmark',0));63 64 58 } else if (isset($parameter[3]) && $parameter[3] == "all") { 65 59 $entries = get_records_sql('SELECT bs.*, u.username, b.url, b.title as b_title FROM '.$CFG->prefix.'bookmark_subscriptions bs JOIN '.$CFG->prefix.'users u ON u.ident = bs.owner … … 68 62 ORDER BY bs.created_on DESC LIMIT '.$numrows,array('PUBLIC','bookmark',0)); 69 63 70 $entries_views = get_records_sql('SELECT bs.*, u.username, b.url, b.title as b_title FROM '.$CFG->prefix.'bookmark_subscriptions bs JOIN '.$CFG->prefix.'users u ON u.ident = bs.owner71 JOIN '.$CFG->prefix.'views v on v.ref = bs.ident JOIN '.$CFG->prefix.'bookmarks b ON b.ident=bs.bookmark_id WHERE bs.access = ? AND v.viewtype = ?72 AND (SELECT count(ident) FROM '.$CFG->prefix.'tags t WHERE t.tagtype = ? AND t.tag IN ('.$tag_in.') AND t.ref = bs.ident) = ?73 ORDER BY bs.created_on DESC LIMIT '.$numrows,array('PUBLIC','bookmark','bookmark',0));74 75 64 } else if ($tag) { 76 65 $entries = get_records_sql('SELECT bs.*, u.username, b.url, b.title as b_title FROM '.$CFG->prefix.'tags t JOIN '.$CFG->prefix.'bookmark_subscriptions bs ON bs.ident = t.ref … … 80 69 ORDER BY bs.created_on DESC limit '.$numrows,array($userid,'PUBLIC','bookmark')); 81 70 82 $entries_views = get_records_sql('SELECT bs.*, u.username, b.url, b.title as b_title FROM '.$CFG->prefix.'tags t JOIN '.$CFG->prefix.'bookmark_subscriptions bs ON bs.ident = t.ref83 JOIN '.$CFG->prefix.'views v on v.ref = bs.ident JOIN '.$CFG->prefix.'users u on u.ident = v.view84 JOIN '.$CFG->prefix.'bookmarks b ON b.ident=bs.bookmark_id85 WHERE v.view = ? AND bs.access = ? AND t.tag IN ('.$tag_in.') AND t.tagtype = ? AND v.viewtype = ?86 ORDER BY bs.created_on DESC limit '.$numrows,array($userid,'PUBLIC','bookmark','bookmark'));87 88 71 } else { 89 72 $entries = get_records_sql('SELECT bs.*, u.username, b.url, b.title as b_title FROM '.$CFG->prefix.'bookmark_subscriptions bs JOIN '.$CFG->prefix.'users u ON u.ident = bs.bookmark … … 92 75 ORDER BY bs.created_on DESC LIMIT '.$numrows, array($userid, 'PUBLIC')); 93 76 94 $entries_views = get_records_sql('SELECT bs.*, u.username, b.url, b.title as b_title FROM '.$CFG->prefix.'bookmark_subscriptions bs JOIN '.$CFG->prefix.'views v ON v.ref = bs.ident95 JOIN '.$CFG->prefix.'users u ON u.ident = v.view JOIN '.$CFG->prefix.'bookmarks b ON b.ident=bs.bookmark_id96 WHERE v.view = ? AND bs.access = ? AND v.viewtype = ?97 ORDER BY bs.created_on DESC LIMIT '.$numrows, array($userid, 'PUBLIC', 'bookmark'));98 99 77 } 100 78 101 79 if(!is_array($entries)) $entries = array(); 102 if(!is_array($entries_views)) $entries_views = array(); 103 $entries_result = array_merge($entries, $entries_views);104 $entries = array(); 80 81 $entries_result = $entries; 82 $entries = array();$cnt=0; 105 83 foreach($entries_result as $obj_entries) { 106 $entries[$obj_entries->created_on ] = $obj_entries;84 $entries[$obj_entries->created_on + $cnt++] = $obj_entries; 107 85 } 108 86 krsort($entries); … … 114 92 $body = '<p><a href="'.$entry->url.'" target="_blank">' . $entry->url . '</a></p>'; 115 93 $body .= '<p>' . $entry->description . '</p>'; 116 $body = (run("bookmarks:text:process",stripslashes($body)));94 //$body = (run("bookmarks:text:process",stripslashes($body))); 117 95 $pubdate = gmdate("D, d M Y H:i:s T", $entry->created_on); 118 96 $keywordtags = ""; bookmarks/trunk/lib/main.php
r249 r284 4 4 * @package bookmarks 5 5 * @filesource mod/bookmarks/lib/ 6 * @version 1. 56 * @version 1.6 7 7 * @author beni<b.taraghi@tugraz.at> 8 8 * @copyright Copyright © 2007, Graz University of Technology - WG Social Learning<http://www.tugraz.at> … … 48 48 // Publish static RSS file of posts 49 49 $function['bookmarks:rss:getitems'][] = dirname(__FILE__) . "/function_rss_getitems.php"; 50 // no bookmark.xml => no publishing for now 51 //$function['bookmarks:rss:publish'][] = dirname(__FILE__) . "/function_rss_publish.php"; 50 $function['bookmarks:rss:publish'][] = dirname(__FILE__) . "/function_rss_publish.php"; 52 51 // Update URLs 53 52 $function['bookmarks:url:update'][] = dirname(__FILE__) . "/function_url_update.php";
