flagflag  
5: 2010-05-15 (Sat) 13:49:05 admin source Cur: 2013-03-20 (Wed) 09:39:44 iseki source
Line 1: Line 1:
** Moodle1.9 Programing [#l2cb4679] ** Moodle1.9 Programing [#l2cb4679]
-- http://docs.moodle.org/en/Development:Blocks+- http://docs.moodle.org/dev/Blocks/Blocks_for_1.5_to_1.9
#br #br
Line 10: Line 10:
**** $USER [#ecf0673b] **** $USER [#ecf0673b]
-- $USER->id+- メンバ変数例 
 +-- id =>
 +-- username => admin 
 +-- firstname => 管理 
 +-- lastname => ユーザ 
 +-- email => iseki@solar-system.tuis.ac.jp 
 +-- emailstop => 0 
 +-- city => 千葉市 
 +-- country => JP 
 +-- lang => ja_utf8 
 +-- timezone => 9.0 
 +-- firstaccess => 1259809008 
 +-- lastaccess => 1273976520 
 +-- lastlogin => 1273631570 
 +-- currentlogin => 1273761631
**** $_POST [#jf217b7d] **** $_POST [#jf217b7d]
Line 18: Line 32:
*** POST, GET [#i893cfed] *** POST, GET [#i893cfed]
- required_param('course',  PARAM_INT); - required_param('course',  PARAM_INT);
-- optional_param('mode', '', PARAM_ALPHA);+- optional_param('mode', default, PARAM_ALPHA);
#br #br
Line 43: Line 57:
**** get_record(s) [#z3e3f469] **** get_record(s) [#z3e3f469]
-- get_record($table, $field1, $value1, $field2='', $value2='', $field3='', $value3='', $fields='*') +- get_record($table, $field1, $value1, $field2="", $value2="", $field3="", $value3="", $fields='*') 
- $course = get_record('course', 'id', $courseid)+ if ($user = get_record('user', 'id', $USER->;id)) { 
- $user = get_record("user", "id", $USER->id)+    $firstname = $user->firstname; 
-- get_records($table, $field='', $value='', $sort='', $fields='*', $limitfrom='', $limitnum='')+ } 
 +- get_records($table, $field="", $value="", $sort="", $fields='*', $limitfrom="", $limitnum="")
 if (!$vars = get_records('autoattend_settings', 'courseid', $courseid, 'id')) {  if (!$vars = get_records('autoattend_settings', 'courseid', $courseid, 'id')) {
   $vars = get_records('autoattend_settings', 'courseid', 0);      // use default    $vars = get_records('autoattend_settings', 'courseid', 0);      // use default
 }  }
 +
**** get_records_sql [#r096c770] **** get_records_sql [#r096c770]
 $qey = "SELECT * FROM .......";  $qey = "SELECT * FROM .......";
Line 71: Line 87:
 }  }
 else {  else {
-    $result = insert_record('autoattend_settings', $rec);+    $result = insert_record('autoattend_settings', $rec);
 }  }
 unset($rec);  unset($rec);


Front page   New List of Pages Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom)

Site Search

Login

Username:

Password:


Lost Password?
Register now!!

Sub Menu

mini Calendar

Last MonthNov 2024Next Month
Su Mo Tu We Th Fr Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Today

Who's Online

202 user(s) are online (88 user(s) are browsing xpwiki)

Members: 0
Guests: 202

more...

Access Counter

Today : 2168216821682168
Yesterday : 3947394739473947
Total : 2446605124466051244660512446605124466051244660512446605124466051
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com