Changeset 1438
- Timestamp:
- 12/10/07 07:59:43 (10 months ago)
- Files:
-
- releases/0.9/mod/blog/lib.php (modified) (3 diffs)
- releases/0.9/mod/blog/widget_css (copied) (copied from devel/mod/blog/widget_css)
- releases/0.9/mod/friend/lib.php (modified) (1 diff)
- releases/0.9/mod/invite/forgotten_password.php (modified) (1 diff)
- releases/0.9/mod/invite/lib.php (modified) (2 diffs)
- releases/0.9/mod/invite/lib/content_invite.php (copied) (copied from devel/mod/invite/lib/content_invite.php)
- releases/0.9/mod/invite/lib/invite_actions.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
releases/0.9/mod/blog/lib.php
r1395 r1438 316 316 $blog_posts= widget_get_data("blog_posts", $widget->ident); 317 317 318 $style .= "<style type=\"text/css\">"; 319 $style .= str_replace('{{url}}', $CFG->wwwroot, file_get_contents($CFG->dirroot . "mod/blog/widget_css")); 320 $style .= "</style>"; 321 318 322 $body= ""; 319 323 $body .=$style; 324 325 326 320 327 if (empty ($blog_id)) { 321 328 global $page_owner; … … 326 333 } 327 334 335 $body .='<div class="weblog-post">'; 328 336 $where= run("users:access_level_sql_where", $_SESSION['userid']); 329 337 $posts= get_records_sql("select * from " . $CFG->prefix . "weblog_posts where ($where) and weblog = $blog_id order by posted desc limit $blog_posts"); … … 331 339 if (is_array($posts) && !empty ($posts)) { 332 340 foreach ($posts as $post) { 333 $body .= run("weblogs:posts:view", $post); 341 //$body .= run("weblogs:posts:view", $post); 342 343 $postedby = __gettext("Posted by"); 344 $commentsStr = __gettext("Comments"); 345 $date = gmdate("H:i",$post->posted); 346 $username = user_info('username', $post->owner); 347 $anyComments = __gettext("comment(s)"); 348 349 $body .= '<h3><a href="' . $CFG->wwwroot . user_name($post->weblog) . '/weblog/' . $post->ident . '.html">' . $post->title . '</a></h3>'; 350 $body .= $postedby . ' ' . $username . ' (' . $date . ')<br><br>'; 351 $body .= $post->body . '<br>'; 352 353 if (!isset($_SESSION['comment_cache'][$post->ident]) || (time() - $_SESSION['comment_cache'][$post->ident]->created > 120)) { 354 $numcomments = count_records('weblog_comments','post_id',$post->ident); 355 $_SESSION['comment_cache'][$post->ident]->created = time(); 356 $_SESSION['comment_cache'][$post->ident]->data = $numcomments; 357 } 358 $numcomments = $_SESSION['comment_cache'][$post->ident]->data; 359 $comments = "<a href=\"".url.$username."/{$post->ident}.html\">$numcomments $anyComments</a>"; 360 361 $body .= $comments . '</div>'; 334 362 } 335 363 } releases/0.9/mod/friend/lib.php
r1248 r1438 44 44 'html' => a_href( "{$CFG->wwwroot}{$friends_username}/friends/requests", 45 45 __gettext("Friendship requests"))); 46 47 if ($CFG->publicinvite == true && ($CFG->maxusers == 0 || (count_users('person') < $CFG->maxusers))) {48 $PAGE->menu_sub[] = array( 'name' => 'friend:invite',49 'html' => a_href( "{$CFG->wwwroot}invite/",50 __gettext("Invite a friend")));51 }52 46 53 47 } releases/0.9/mod/invite/forgotten_password.php
r1369 r1438 16 16 $body = run("invite:password:request"); 17 17 18 templates_page_output($title, $body , null, ' ');18 templates_page_output($title, $body); 19 19 20 20 ?> releases/0.9/mod/invite/lib.php
r1251 r1438 8 8 */ 9 9 10 function invite_pagesetup(){11 require_once (dirname(__FILE__)."/lib/invite_config.php");12 }13 14 10 function invite_init(){ 15 11 global $CFG, $function; 16 12 // Actions 13 $function['invite:init'][] = $CFG->dirroot . "mod/invite/lib/invite_config.php"; 17 14 $function['invite:init'][] = $CFG->dirroot . "mod/invite/lib/invite_actions.php"; 18 15 19 16 // Introductory text 20 $function['content:invite:invite'][] = $CFG->dirroot . " content/invite/invite.php";17 $function['content:invite:invite'][] = $CFG->dirroot . "mod/invite/lib/content_invite.php"; 21 18 22 19 // Allow user to invite a friend … … 39 36 40 37 } 38 39 function invite_pagesetup() { 40 global $PAGE; 41 42 if (defined('context') && context == 'network') { 43 if (!maxusers_limit()) { 44 $PAGE->menu_sub[] = array( 'name' => 'invite:friend', 45 'html' => a_href(get_url(null, 'invite::invite'), 46 __gettext("Invite a friend"))); 47 } 48 } 49 } 50 51 function invite_url($object_id, $object_type) { 52 $url = null; 53 54 switch ($object_type) { 55 case 'invite::': 56 case 'invite::invite': 57 global $CFG; 58 $url = $CFG->wwwroot . 'mod/invite/'; 59 break; 60 } 61 62 return $url; 63 } 41 64 ?> releases/0.9/mod/invite/lib/invite_actions.php
r1288 r1438 2 2 global $USER; 3 3 global $CFG; 4 5 // Ensure that config options are available6 require_once (dirname(__FILE__)."/invite_config.php");7 4 8 5 // Kill all old invitations … … 89 86 break; 90 87 } 88 if (empty($name)) { 89 $messages[] = __gettext('Error! You must provide a name.'); 90 break; 91 } 91 92 if (empty($over13)) { 92 93 $messages[] = __gettext("You must indicate that you are at least 13 years old to join.");
