Changeset 1438

Show
Ignore:
Timestamp:
12/10/07 07:59:43 (10 months ago)
Author:
misja
Message:

Misja Hoebe <misja@curverider.co.uk> Merge r1431, r1434, r1435, r1436, r1437 in 0.9 branch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • releases/0.9/mod/blog/lib.php

    r1395 r1438  
    316316  $blog_posts= widget_get_data("blog_posts", $widget->ident); 
    317317 
     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   
    318322  $body= ""; 
    319  
     323  $body .=$style; 
     324   
     325   
     326   
    320327  if (empty ($blog_id)) { 
    321328    global $page_owner; 
     
    326333  } 
    327334 
     335  $body .='<div class="weblog-post">'; 
    328336  $where= run("users:access_level_sql_where", $_SESSION['userid']); 
    329337  $posts= get_records_sql("select * from " . $CFG->prefix . "weblog_posts where ($where) and weblog = $blog_id order by posted desc limit $blog_posts"); 
     
    331339  if (is_array($posts) && !empty ($posts)) { 
    332340    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>'; 
    334362    } 
    335363  } 
  • releases/0.9/mod/friend/lib.php

    r1248 r1438  
    4444                                       'html' => a_href( "{$CFG->wwwroot}{$friends_username}/friends/requests", 
    4545                                                          __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                 } 
    5246 
    5347            } 
  • releases/0.9/mod/invite/forgotten_password.php

    r1369 r1438  
    1616        $body = run("invite:password:request"); 
    1717         
    18         templates_page_output($title, $body, null, '&nbsp;'); 
     18        templates_page_output($title, $body); 
    1919 
    2020?> 
  • releases/0.9/mod/invite/lib.php

    r1251 r1438  
    88 */ 
    99 
    10  function invite_pagesetup(){ 
    11     require_once (dirname(__FILE__)."/lib/invite_config.php"); 
    12  } 
    13  
    1410 function invite_init(){ 
    1511  global $CFG, $function; 
    1612  // Actions 
     13      $function['invite:init'][] = $CFG->dirroot . "mod/invite/lib/invite_config.php"; 
    1714      $function['invite:init'][] = $CFG->dirroot . "mod/invite/lib/invite_actions.php"; 
    1815 
    1916  // 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"; 
    2118 
    2219  // Allow user to invite a friend 
     
    3936 
    4037 } 
     38 
     39function 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 
     51function 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} 
    4164?> 
  • releases/0.9/mod/invite/lib/invite_actions.php

    r1288 r1438  
    22global $USER; 
    33global $CFG; 
    4  
    5 // Ensure that config options are available 
    6 require_once (dirname(__FILE__)."/invite_config.php"); 
    74 
    85// Kill all old invitations 
     
    8986                 break; 
    9087             } 
     88             if (empty($name)) { 
     89                $messages[] = __gettext('Error! You must provide a name.'); 
     90                break; 
     91             } 
    9192             if (empty($over13)) { 
    9293                 $messages[] = __gettext("You must indicate that you are at least 13 years old to join.");