Changeset 1594
- Timestamp:
- 05/20/08 07:40:12 (7 months ago)
- Files:
-
- devel/mod/commentwall/lib.php (modified) (5 diffs)
- devel/mod/commentwall/walltowall.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
devel/mod/commentwall/lib.php
r1591 r1594 83 83 return get_records_sql($query); 84 84 } 85 86 87 /** 88 * Retrieve the wall-to-wall for a given pair of userids. 89 * 90 * @return mixed Array of comment objects, else returns false. 91 * @param unknown_type $userid The user / wall we are retrieving 92 * @param unknown_type $limit Limit on the search 93 * @param unknown_type $offset Offset 94 */ 95 function commentwall_getwalltowall($userid, $otherid, $limit = 10, $offset = 0) 96 { 97 global $CFG; 98 99 $query = "SELECT * FROM " . $CFG->prefix . "commentwall " . 100 "WHERE (wallowner=" . $userid . " AND comment_owner=" . $otherid . ") OR ". 101 "(wallowner=" . $otherid . " AND comment_owner=" . $userid . ") ". 102 "ORDER BY posted desc LIMIT " . $offset . "," . $limit; 103 104 //echo $query; 105 106 return get_records_sql($query); 107 } 108 85 109 86 110 /** … … 224 248 225 249 $replytowall = __gettext("Post reply"); 226 $replytootherwall = sprintf(__gettext("Reply on %s's wall"), $comment_owner_username); 250 $replytootherwall = sprintf(__gettext("%s's wall"), $comment_owner_username); 251 $walltowall = __gettext("Wall-to-wall"); 227 252 $delete = __gettext("Delete"); 228 253 229 $doaction = "{$CFG->wwwroot}mod/commentwall/do_action.php?owner=" . page_owner(). "&return_url=" .urlencode($_SERVER['REQUEST_URI']);254 $doaction = "{$CFG->wwwroot}mod/commentwall/do_action.php?owner=" . $comment_obj->wallowner. "&return_url=" .urlencode($_SERVER['REQUEST_URI']); 230 255 231 256 $replybar = ""; … … 233 258 { 234 259 //$replybar .= "<a href=\"#commentwall_form_-1\">$replytowall</a>"; 235 if (($comment_obj->wallowner != $comment_obj->comment_owner) && ($comment_obj->comment_owner != 0))260 if (($comment_obj->wallowner != $comment_obj->comment_owner) && ($comment_obj->comment_owner != 0)) { 236 261 $replybar .= "<a href=\"{$CFG->wwwroot}mod/commentwall/index.php?owner={$comment_obj->comment_owner}&wallowner={$comment_obj->comment_owner}&comment_owner={$_SESSION['userid']}&reply={$comment_obj->ident}&return_url=" .urlencode($_SERVER['REQUEST_URI'])."\">$replytootherwall</a> | "; 237 238 if ((commentwall_permissions_check($comment_obj->comment_owner)) 239 || (commentwall_permissions_check($comment_obj->wallowner))) 240 $replybar.= "<a href=\"$doaction&action=commentwall::delete&ident={$comment_obj->ident}\">$delete</a>"; 262 $replybar .= "<a href=\"{$CFG->wwwroot}mod/commentwall/walltowall.php?owner={$comment_obj->wallowner}&other={$comment_obj->comment_owner}&return_url=" .urlencode($_SERVER['REQUEST_URI'])."\">$walltowall</a> | "; 263 } 264 if ((commentwall_permissions_check($comment_obj->comment_owner)) 265 || (commentwall_permissions_check($comment_obj->wallowner))) 266 $replybar.= "<a href=\"$doaction&action=commentwall::delete&ident={$comment_obj->ident}\">$delete</a>"; 241 267 } 242 268 … … 315 341 { 316 342 // $owner = page_owner(); 317 $html = "<div id=\"commentwall_title\"><h2>" . sprintf(__gettext(" %s's comment wall"), user_info("name", page_owner())) . "</h2></div>";343 $html = "<div id=\"commentwall_title\"><h2>" . sprintf(__gettext("Write on %s's comment wall"), user_info("name", $owner)) . "</h2></div>"; 318 344 319 345 if (($showalltxt) && ($wall)) … … 323 349 324 350 325 $html .= commentwall_post_form( page_owner());351 $html .= commentwall_post_form($owner); 326 352 327 353 if (!$wall) {
