Thursday, January 30, 2014

PHP regular expression import syntax




Test php regular expression here:
http://www.phpliveregex.com/
Important syntax:
  \a    control characters bell
    \b    backspace
    \f    form feed
    \n    line feed
    \r    carriage return
    \t    horizontal tab
    \v    vertical tab

special character: \. \{ \}
\s Any whitespace character
\S Any non-whitespace character
\d Any digit
\D Any non-digit
\w Any word character (letter, number, underscore)
\W Any non-word charact
^ Start of line
$ End of line
\A Start of string
\z End of string
.  Matches any single character
Examples:
  • .at matches any three-character string ending with "at", including "hat", "cat", and "bat".
  • [hc]at matches "hat" and "cat".
  • [^b]at matches all strings matched by .at except "bat".
  • [^hc]at matches all strings matched by .at other than "hat" and "cat".
  • ^[hc]at matches "hat" and "cat", but only at the beginning of the string or line.
  • [hc]at$ matches "hat" and "cat", but only at the end of the string or line.
  • \[.\] matches any single character surrounded by "[" and "]" since the brackets are escaped, for example: "[a]" and "[b]".

Wednesday, January 29, 2014

Department database design (10) - import publication database





 http://localhost/ubc_surgery_pub/scripts/manage/pubmedimport/index.php
line 354 change
<p>    <label style="padding: 1px 40px 1px 1px;"><input name="autoapprove" type="radio" value="1" checked="checked" />Approve immediately</label>
    <label style="padding: 1px 1px 1px 40px;"><input name="autoapprove" type="radio" value="0" />Don't approve immediately</label></p>

to
<p>    <label style="padding: 1px 40px 1px 1px;display:none;"><input name="autoapprove" type="radio" value="1" checked="checked" />Approve immediately</label>
    <label style="padding: 1px 1px 1px 40px;display:none;"><input name="autoapprove" type="radio" value="0" />Don't approve immediately</label></p>

line 359 change
  $mydepts = getMyDepartments($_SERVER['REMOTE_USER']);
  echo "<p>Choose division to assign data to:
  <select name='chosendept'>";
  foreach($mydepts as $dcode=>$ddept)
    echo "<option value='$dcode'>$ddept[NAME]</option>";
    echo "<option value=0>Unknown</option>";
  echo "</select></p>";

to
  $allpeople = getallpeople();
  echo "<p>Choose a person to assign data to:
  <select name='chosenperson'>";
  echo '<option value=""> --- Choose a person --- </option>';
  foreach($allpeople as $k=>$v)
      echo "\n<option value=\"$k\">$v[LASTNAME],$v[FIRSTNAME]</option>";
  echo "</select></p>";

line 28 change
$chosendept = $_REQUEST['chosendept'];
to
$chosenperson = $_REQUEST['chosenperson'];
if($chosenperson !='')
$chosendept = getdivision($chosenperson);

line 392 add
  global $chosenperson;
line 426 add
 $ret['userlist'][] = ",$chosenperson,";
line 180 change
 $q = "SELECT pubid, url, deptlist FROM PUBLICATIONS WHERE url='" . mysql_real_escape_string($current['url'][0]) . "' LIMIT 1";
        $res = mysql_query($q,connectpubsdb());
        if($res && (mysql_num_rows($res)!=0)){
          $existing = mysql_fetch_assoc($res);
          if(strpos($existing, $current['deptlist'][0])===false)
            mysql_query("UPDATE PUBLICATIONS SET deptlist='"
               . mysql_real_escape_string($existing['deptlist'] . substr($current['deptlist'][0], 1))
               . "' WHERE pubid=$existing[pubid] LIMIT 1", connectpubsdb());
          echo "\n<p>The record with PubMed ID <a href=\"$config[pageshomeurl]manage/?action=edit&amp;pubid=$existing[pubid]\">{$current[url][0]}</a> (<strong><em>"
            . htmlspecialchars($current['title'][0]) . "</em></strong>) is already in the database, so rather than inserting a duplicate, "
            . " the system has associated your department with the existing record.</p>";

to
        $q = "SELECT pubid, url, deptlist, userlist FROM PUBLICATIONS WHERE url='" . mysql_real_escape_string($current['url'][0]) . "' LIMIT 1";
        $res = mysql_query($q,connectpubsdb());
        if($res && (mysql_num_rows($res)!=0)){
          $existing = mysql_fetch_assoc($res);
         
          if(strpos($existing['userlist'], $chosenperson)===false)
            mysql_query("UPDATE PUBLICATIONS SET userlist='"
               . mysql_real_escape_string($existing['userlist'] . "$chosenperson,")
               . "' WHERE pubid=$existing[pubid] LIMIT 1", connectpubsdb());
          echo "\n<p>The record with PubMed ID <a href=\"$config[pageshomeurl]manage/?action=edit&amp;pubid=$existing[pubid]\">{$current[url][0]}</a> (<strong><em>"
            . htmlspecialchars($current['title'][0]) . "</em></strong>) is already in the database, so rather than inserting a duplicate, "
            . " the system has associated your userid with the existing record.</p>";

 line 128 change
  $pmregex1 = '/^(\d+): (.+?)\.'
 
         . ' (.+?)\.'
       
         . '(.+?)\. (\d\d\d\d)(.*?);(.+?):(\w+)-?(\w*?)\;(.*)'
       
         . 'PMID: (\d+)'
       
         . '/s';

to

  $pmregex = '/^(\d+): (.+?)\.'
 
         . ' (.+?)\.'
       
         . '(.+?)[\. \n?](\d\d\d\d)(.*?);(.+?):(\w+)-?(\w*?)[\.\;](.*)'
       
         . '[PMID: \n?](\d+)'
       
         . '/s';

C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\common.php, line 446 add
function getdivision($userid)
{
    $results = mysql_query("SELECT deptid FROM USERS  WHERE userid='$userid'", connectpubsdb());
     return mysql_result($results,0);
}

Tuesday, January 28, 2014

Search over pubmed database





 http://www.ncbi.nlm.nih.gov/pubmed
university of british columbia, department of surgery
(university of british columbia) AND Alice Mui[Author - Full]
university of british columbia, department of surgery AND (university of british columbia) AND Alice Mui[Author - Full]
university of british columbia, department of surgery AND (university of british columbia) AND Alice Mui[Author - Full]
Final search based on author full name (firstname lastname)  and affiliation
department of surgery AND (university of british columbia) AND Alice Mui[Author - Full]
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\personal\index.php, line 345 add
<p>Your publication from pub is based on critia:<br />
 surgery AND (university of british columbia) AND <?php echo $userinfo['firstname'].' '.$userinfo['lastname'];?>[Author - Full]
</p>


 C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\pubmedimport\index.php, line 78 change
if(strlen($data)>0 && !preg_match('/^\d+: .+?\bPMID: \d/s', $data))
to
if(strlen($data)>0 && !preg_match('/^\d+: .+?[PMID: \n?](\d+)/s', $data)) 

check if MySQL return result in PHP using mysql_num_rows




In PHP, I have following query to check if userid exist
 $result = mysql_query("SELECT USERID,  FIRSTNAME, LASTNAME FROM USERS WHERE USERID=".$userid);  
if userid exists,
if (mysql_num_rows($result)>0) {echo "user already in database";}
Here PHP function mysql_num_rows is used  to get how many rows returned from MySQL query.

Department database design (9) - import user csv file





 C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\common.php, line 439 add
function userduplication($firstname, $lastname)
{
  
    $results = mysql_query("SELECT * FROM USERS  WHERE firstname='$firstname' AND lastname='$lastname'", connectpubsdb());
     return mysql_num_rows($results);
}


C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\ superadmin/importcsvuser.php, new file
<?php
session_start();
if(isset($_SESSION['username']))
$_SERVER['REMOTE_USER']='1234567';
else{
echo 'You do not have adminsitraction right. <br />';
 echo "\n<p style='text-align:left;'>[<a href='../../../demosite/'>Back to publication homepage</a>]</p>";
exit();
}

require_once(dirname(dirname(__FILE__)) . '/common.php');
require_once($config['homedir'] . 'query/formataref.php');


$uploadRISfile = $_FILES['uploadRISfile']['tmp_name'];

if (!empty($uploadRISfile))
{
    if (file_exists($uploadRISfile) && is_uploaded_file($uploadRISfile))
    {
     
          $handle = fopen($uploadRISfile, "r");
           $i = 0;
           $message='Duplicated name not inputed: ';
         while (($data0 = fgetcsv($handle, 1000, ",")) !== FALSE)
         { 
              $i =$i + 1;
              if($i==1) continue;
             
             // $name=explode(" ", trim($data0[0]));
               $name= preg_split('/\s+/',trim($data0[0]));
           
              $lastname = $name[0];
              $firstname = $name[1];
           
              $honorifics  = $data0[1];
              $dept = strtolower($data0[2]);
              if (strpos($dept,'cardiac') !== false) {$deptid = 1;}
              elseif (strpos($dept,'general') !== false) {$deptid = 2;}
              elseif (strpos($dept,'neurosurgery') !== false) {$deptid = 3;}
              elseif (strpos($dept,'otolaryngology') !== false) {$deptid = 4;}
              elseif (strpos($dept,'pediatric') !== false) {$deptid = 5;}
              elseif (strpos($dept,'plastic') !== false) {$deptid = 6;}
              elseif (strpos($dept,'radiation') !== false) {$deptid = 7;}
              elseif (strpos($dept,'thoracic') !== false) {$deptid = 8;}
              elseif (strpos($dept,'vascular') !== false) {$deptid = 9;}
              else { $deptid = 10;}  
              $room = $data0[3];
              $email = filter_var($data0[4], FILTER_VALIDATE_EMAIL);
              if($firstname=='') {echo 'First name missing'; exit;}
              if($lastname=='') {echo 'Last name missing'; exit;}
              $PI= strtolower($honorifics);
              $IsPI = 0;
              if ((strpos($PI,'professor') !== false) ||(strpos($PI,'instructor') !== false) ||(strpos($PI,'associate') !== false))
               $IsPI = 1;
               $rowreturn = userduplication($firstname, $lastname);
              if($rowreturn>0) {  $message = $message. $lastname.' '.$firstname.', ';}
              elseif($IsPI == 1) addnewpersonwithdept(' ', $firstname, $lastname, $honorifics,  $room, $deptid, $email);

         }
          if($message=='Duplicated name not input') $message='csv data is inputed to publication database. ';
          else $message='csv data is inputed to publication database. '.$message;
         fclose($handle);
         echo '<script type="text/javascript">alert("' . $message . '");  window.location.href ="../index.php";</script>';     
   }       
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-UK">
<head>
<link rel="stylesheet" type="text/css" href="../../../demosite/css/search.css" />
</head>
<body>
<h1>Import user csv data into publications database</h1>
<br />
<div class="content">
<form action="./superadmin/importcsvuser.php" method="post" enctype="multipart/form-data">

  <p>To add user csv data into the online publications
  database. Ths csv data should have 5 columns in the follwoing order:<br />
  name (lastname firstname, required field), position, division, location and email.
 
  </p>
<div style="margin: 10px 3px 10px 100px;">
<p><input name="uploadRISfile" type="file" size="30" /></p>
<p align="center"><input type="submit" value="Submit" /></p>
</div>
</form>


<p><br>

</div>
</body>
</html>

Monday, January 27, 2014

Department database design (8) - edit and delete users





C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\index.ph, line 512 add 
     <li>Choose a person's entries to edit:
     <select onchange="if(this.value!='') location.href='./?action=people&userid='+this.value">
          <option value=""> --- Choose a person --- </option>
          <?php
              foreach(getallpeople() as $k=>$v)       
            echo "\n<option value=\"$k\">$v[LASTNAME],$v[FIRSTNAME]</option>";
          ?>
     </select>         
     </li>

line 324 add
case 'deleteuser':
    include_once($config['homedir'] . 'manage/common.php');
    if(!isset($userid)) $userid = $_REQUEST['userid'];
    deleteuser($userid);
   break;

 C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\personal\index.php (1 hits)
    Line 287: (<?php echo $userinfo['email']?>) [<a href="javascript:revealupdatenamedetailsform();">Edit these details</a>]</p>

line 301 remove
 <th scope="col">Title</th> 
line 288 add
[<a href="javascript:if(confirm('Are you sure you want to do this?')){ location.href='./?userid=<?php echo $userinfo['userid']?> &amp;action=deleteuser'};">Delete  this entry </a>]
  changeupdatename(stripslashes($userid), stripslashes($title), stripslashes($firstname), stripslashes($lastname), stripslashes($honorifics), stripslashes($email));

line 86 change
updatename(stripslashes($userid), stripslashes($title), stripslashes($firstname), stripslashes($lastname), stripslashes($honorifics), stripslashes($email));
to
updatename1(stripslashes($userid), stripslashes($title), stripslashes($firstname), stripslashes($lastname), stripslashes($honorifics), stripslashes($room), stripslashes($email));
line 310 remove
  <td valign="top"><input name="title" type="text" value="<?php echo $userinfo['title']?>" size="<?php echo max(strlen($userinfo['title']),5)+1 ?>" maxlength="64"></td> 
line 315 remove
 <?php if($deptchoose) { ?><td valign="top"><?php echo $deptchoose ?>
    <label style="display: block; float: left;">Additional department(s) (if jointly-appointed): <br />
    <select name="otherdepts[]" id="otherdepts[]" size="2" multiple="multiple"><option value="">No additional departments</option>
      <?php
         $alldepts = getalldepts();
        $otherdepts = splitDeptListString($userinfo['otherdepts']);
//        print_r($otherdepts);
        foreach($alldepts as $k=>$v)
          echo '<option value="' . htmlspecialchars($k) . '"'.(array_search($k,$otherdepts)===false?'':' selected="selected"').'>' . htmlspecialchars($v['NAME']) . '</option>';
      ?>
    </select>    </label></td><?php } ?>

  <td valign="top"><input type="submit" value="Store amended details">
    <input type="hidden" name="userid" value="<?php echo $userid ?>" />
    <input type="hidden" name="action" value="updatename" /></td>
  </tr>

</table>
to
  <?php if($deptchoose) { ?><td valign="top"><?php echo $deptchoose ?>
    </td><?php } ?>
  </tr>
</table>
  <input type="submit" value="Store amended details">
    <input type="hidden" name="userid" value="<?php echo $userid ?>" />
    <input type="hidden" name="action" value="updatename" />


C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\common.php, line 1176 add
function deleteuser($userid)
{
  $userid = intval($userid);

  $res = mysql_query("DELETE FROM USERS WHERE userid='$userid' LIMIT 1",connectpubsdb());
   if(!$res)
    return false;
    else
      {echo 'User id '.$userid.' is deleted.<p>'; return true;}
 }  

line 1393 add
function updatename1($userid, $title, $firstname, $lastname, $honorifics, $room, $email)
{
  $q = "UPDATE USERS SET title='" . mysql_real_escape_string($title)
                         . "', firstname='" . mysql_real_escape_string($firstname)
                         . "', lastname='" . mysql_real_escape_string($lastname)
                         . "', email='" . mysql_real_escape_string($email)
                          . "', room='" . mysql_real_escape_string($room)
                         . "', honorifics='" . mysql_real_escape_string($honorifics) . "' WHERE userid='$userid' LIMIT 1";
  $res = mysql_query($q, connectpubsdb());
  recordtransaction('updatename',0);
  recordLsUsersTransaction('LS:updatename', $q);
  return $res;

Friday, January 24, 2014

Department database design (7) - add new user






C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\common.php, line 1437 add
 <label style="display: block; float: left;">Location: <br />
    <input name="email" type="text" value="<?php echo $userinfo['room']?>" ></label>
line 1352 change
function addnewpersonwithdept($userid, $title, $firstname, $lastname, $honorifics,  $deptid, $email)
to
 function addnewpersonwithdept($title, $firstname, $lastname, $honorifics,  $room, $deptid, $email)
line 1359 add
                         . "', room='" . mysql_real_escape_string($room)
In users table:
line 1354 remove $userid
userid was changed to int(11) unsigned auto increment, room changed from varchar(32) to text.
line 2802, add
function countPubsPerUser1($userids){
  $userids = mysql_real_escape_string($userids);
  $q = "SELECT COUNT(*) AS cnt, userlist FROM PUBLICATIONS WHERE FIND_IN_SET('$userids',userlist)";
  if(!($res = mysql_query($q, connectpubsdb())))
    return false;
  while($row = mysql_fetch_assoc($res)){
      $counts= $row['cnt'];
  }
  return $counts;
}

C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\personal\index.php, line 113 change
 $res = mysql_query("SELECT userid FROM USERS WHERE email='" . mysql_real_escape_string(stripslashes($email)) . "' LIMIT 1", connectpubsdb());
to
 $res = mysql_query("SELECT userid FROM USERS WHERE firstname='" . mysql_real_escape_string(stripslashes($firstname)) . "' AND lastname='". mysql_real_escape_string(stripslashes($lastname)) ."' LIMIT 1", connectpubsdb());
   line 166 change
addnewpersonwithdept(stripslashes($userid), stripslashes($title), stripslashes($firstname), stripslashes($lastname), stripslashes($honorifics), stripslashes($deptid), stripslashes($email));
to
 addnewpersonwithdept( stripslashes($title), stripslashes($firstname), stripslashes($lastname), stripslashes($honorifics), stripslashes($room), stripslashes($deptid), stripslashes($email));
line 82 add
  if(!isset($room))
    $room=$_REQUEST['room'];
  
line 177 changed to
echo "<p class='simplepaddedmessagebox'>Created a new user record, with Last name <strong>$lastname</strong> and first name <strong>$firstname</strong>.</p>"; 
 C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\people\listallusers.php, line 28 change
 $line .= '(department: <a href="'.$depts[$row['deptid']]['depturl'].'">'.$depts[$row['deptid']]['NAME'].'</a>'; 
to
  $line .= '(department: '.$depts[$row['deptid']]['NAME'].'</a>';
 line 40 add
     $numpublished = countPubsPerUser1($row['userid']);
      $line .= ',number of publications: '.$numpublished;

C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\query\index.php, line 243 change
   // $wh .= "userlist LIKE '%$v%' OR ";
to
   $wh .= "FIND_IN_SET('$v',userlist) OR ";

Thursday, January 23, 2014

Department database design (6) change import from pubmed





 http://localhost/ubc_surgery_pub/scripts/manage/pubmedimport/index.php
line 314 change
<link rel="stylesheet" type="text/css" href="../../../demosite/css/search.css" />
to
<link rel="stylesheet" type="text/css" href="../../../demosite/css/search.css" />
<link href="
../../../demosite/css/ubc-clf-full.min.css" rel="stylesheet">
<link href="
../../../demosite/css/ubc-home.css" rel="stylesheet">

line 319 change
<h1>Import PubMed summary data into publications database</h1>
<br />
<div class="content">

to
<div class="container">
<header id="ubc7-header" class="row-fluid expand" role="banner">       
<div class="header-text">
Import PubMed summary data into publications database</div>
</header>

<!-- UBC Unit Navigation -->
        <div id="ubc7-unit-menu" class="navbar expand" role="navigation">
            <div class="navbar-inner expand">
                    <nav
class="nav-collapse collapse" id="ubc7-unit-navigation">
                        <ul class="nav">
 
   <li ><a href="/ubc_surgery_pub/demosite/"  >Home</a></li>
    <li ><a href="http://surgery.med.ubc.ca/"  >Department of Surgery</a></li>
    <li>
       <a href="/ubc_surgery_pub/scripts/manage/"> Go to Administration</a></li>
        <li class="active"><a href=""  >Import from
PubMed data</a></li><li>
        <a href="/ubc_surgery_pub/demosite/index.php?action=logout">Logout admin</a>

</li>
 
</ul>                    </nav><!-- /.nav-collapse -->
                </div>
        </div><!-- /navbar -->
        <!-- End of UBC Unit Navigation -->   
<div id="content" class="expand row-fluid content" role="main">

line 465 add
<footer class="row-fluid expand" id="ubc7-footer" role="contentinfo">
  <div class="footer-text">
        Copyright © 2014 CESEI, Department of Surgery, UBC. All rights reserved.
  </div>
</footer>

</div>
line 22 remove:
echo "\n<p style='text-align:right;'>[<a href='$config[pageshomeurl]'>Back to administration homepage</a>]</p>"; 
line 365 add
echo "<option value=0>Unknown</option>";
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage/common.php, line 449
 $res = mysql_query("SELECT * FROM DEPTS ORDER BY NAME", connectpubsdb()); 
to
 $res = mysql_query("SELECT * FROM DEPTS", connectpubsdb()); 

Department database design (5) - change import from RIS interface





 http://localhost/ubc_surgery_pub/scripts/manage/risimport/?admin=1
line 360 change
<link rel="stylesheet" type="text/css" href="../../../demosite/css/search.css" />
to
<link rel="stylesheet" type="text/css" href="../../../demosite/css/search.css" />
<link href="
../../../demosite/css/ubc-clf-full.min.css" rel="stylesheet">
<link href="
../../../demosite/css/ubc-home.css" rel="stylesheet">

line 3865 change
<br  />
<h1>Import RIS data into publications database</h1>
<br />
<div class="content">

to
<div class="container">
<header id="ubc7-header" class="row-fluid expand" role="banner">       
<div class="header-text">
 Import RIS data into publications database
</div>
</header>

<!-- UBC Unit Navigation -->
        <div id="ubc7-unit-menu" class="navbar expand" role="navigation">
            <div class="navbar-inner expand">
                    <nav
class="nav-collapse collapse" id="ubc7-unit-navigation">
                        <ul class="nav">
 
   <li ><a href="/ubc_surgery_pub/demosite/"  >Home</a></li>
    <li ><a href="http://surgery.med.ubc.ca/"  >Department of Surgery</a></li>
    <li>
       <a href="/ubc_surgery_pub/scripts/manage/"> Go to Administration</a></li>
        <li class="active"><a href=""  >Import from RIS data</a></li><li>
        <a href="/ubc_surgery_pub/demosite/index.php?action=logout">Logout admin</a>

</li>
 
</ul>                    </nav><!-- /.nav-collapse -->
                </div>
        </div><!-- /navbar -->
        <!-- End of UBC Unit Navigation -->   
<div id="content" class="expand row-fluid content" role="main">

line 494 add
<footer class="row-fluid expand" id="ubc7-footer" role="contentinfo">
  <div class="footer-text">
        Copyright © 2014 CESEI, Department of Surgery, UBC. All rights reserved.
  </div>
</footer>

</div>

Wednesday, January 22, 2014

department database design (4) - change admin interface





C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\index.php,
 line 35 change
<link rel="stylesheet" type="text/css" href="../../demosite/css/search.css" />
to
<link rel="stylesheet" type="text/css" href="../../demosite/css/search.css" />
<link href="
../../demosite/css/ubc-clf-full.min.css" rel="stylesheet">
<link href="
../../demosite/css/ubc-home.css" rel="stylesheet">

line 38 change
<br  />
<h1>UBC Department of Surgery - Publication Administration Page</h1>
<br />
<div class="admin-login">
<a href='../../demosite/'>Back to homepage</a><br />
 </div>
 <div class="content">
to
<div class="container">
<header id="ubc7-header" class="row-fluid expand" role="banner">       
<div class="header-text">
 UBC Department of Surgery - Publication 
Administration Page
</div>
</header>

<!-- UBC Unit Navigation -->
        <div id="ubc7-unit-menu" class="navbar expand" role="navigation">
            <div class="navbar-inner expand">
                    <nav
class="nav-collapse collapse" id="ubc7-unit-navigation">
                        <ul class="nav">
    <li ><a href="/ubc_surgery_pub/demosite/"  >Home</a></li>
    <li
><a href="http://surgery.med.ubc.ca/"  >Department of Surgery</a></li>
    <li
class="active">
       <a href="../scripts/manage/"> Go to Administration</a></li><li>
        <a href="/ubc_surgery_pub/demosite/index.php?action=logout">Logout admin</a>


</li>
 
</ul>                    </nav><!-- /.nav-collapse -->
                </div>
        </div><!-- /navbar -->
        <!-- End of UBC Unit Navigation -->   
<div id="content" class="expand row-fluid content" role="main">

line 677 add
<footer class="row-fluid expand" id="ubc7-footer" role="contentinfo">
  <div class="footer-text">
        Copyright © 2014 CESEI, Department of Surgery, UBC. All rights reserved.
  </div>
</footer>

</div>
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\common.php, line 400 change
 $res = mysql_query("SELECT * FROM DEPTS ORDER BY NAME", connectpubsdb());
to
 $res = mysql_query("SELECT * FROM DEPTS ", connectpubsdb());

Department database design (3) - change front page interface




http://localhost/ubc_surgery_pub/demosite/index.php
http://139.173.32.21/ubc_surgery_pub/demosite/
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\demosite\css\search.css, line 12 change
.login { margin-top:5px; cursor:pointer; font-size:10pt; }
to
.login { }
 line 14 remove
.content { background:#f0f0ee; border:1px dotted #999; color:#666699;margin:80px; }
line 15 add
.header-text {color:white;font-size:20px;text-align: center;margin-top:1cm;}
Line 9 change
.login-msg { z-index:1000; position:absolute; right:21px; top:50px; width:147px; text-align:center; padding:5px 0; border:1px dotted red; background:#ffcccc; color:red; }
to
.login-msg { z-index:1000; position:absolute; left:821px; top:130px; width:147px; text-align:center; padding:5px 0; border:1px dotted red; background:#ffcccc; color:red; }
line 16 add
 .footer-text {color:white;font-size:12px;text-align: center;margin-top:1cm;margin-bottom:1cm;}
To make style consistent with UBC website using ubc-clf-full.min.css and ubc-home.css.
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\demosite\index.php, line 53 change
<link rel="stylesheet" type="text/css" href="css/search.css" />
to
<link rel="stylesheet" type="text/css" href="css/search.css" />
<link href="css/ubc-clf-full.min.css" rel="stylesheet">
<link href="css/ubc-home.css" rel="stylesheet">


line 64 change
<h1>UBC Department of Surgery - Publication Search Page</h1>
<div class="admin-login">
<?php if(!isset($_SESSION['username'])){ ?>
    Admin Login: <img src="images/lock.png" alt="Admin Login" class="login">
    <div class="login-box">
        <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
        Username:<br/><input type="text" name="name" size="15"/><br/>
        Password:<br/><input type="password" name="pass" size="15"/><br/>
        <input type="submit"  name="submit_login" value="Login"  class="login-submit"/>
        </form>
    </div>
<?php }else{ ?>
       <a href="../scripts/manage/"> Go to Administration</a><br />
       <a href="?action=logout"><img src="fast_edit/images/lock_open.png" alt="Logout admin" title="Logout admin" class="logout" /></a>
<?php } ?>  
</div>
<div class="content">

to
 <div class="container">
<header id="ubc7-header" class="row-fluid expand" role="banner">       
<div class="header-text">
 UBC Department of Surgery - Publication Search Page
</div>
</header>

<!-- UBC Unit Navigation -->
        <div id="ubc7-unit-menu" class="navbar expand" role="navigation">
            <div class="navbar-inner expand">
                    <nav class="nav-collapse collapse" id="ubc7-unit-navigation">
                        <ul class="nav">
    <li class="active"><a href="/ubc_surgery_pub/demosite/"  >Home</a></li>
    <li><a href="http://surgery.med.ubc.ca/"  >Department of Surgery</a></li>
    <li>

<?php if(!isset($_SESSION['username'])){ ?>
    <a class="login">Admin Login:</a>
    <div class="login-box">
        <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
        Username:<br/><input type="text" name="name" size="15"/><br/>
        Password:<br/><input type="password" name="pass" size="15"/><br/>
        <input type="submit"  name="submit_login" value="Login"  class="login-submit"/>
        </form>
    </div>
<?php }else{ ?>

       <a href="../scripts/manage/"> Go to Administration</a></li><li>
       <a href="?action=logout">Logout admin</a>
<?php } ?>   

</li>
 
</ul>                    </nav><!-- /.nav-collapse -->
                </div>
        </div><!-- /navbar -->
        <!-- End of UBC Unit Navigation -->   
<div id="content" class="expand row-fluid content" role="main">

line 145 add
<footer class="row-fluid expand" id="ubc7-footer" role="contentinfo">
  <div class="footer-text">
        Copyright © 2014 CESEI, Department of Surgery, UBC. All rights reserved.
  </div>
</footer>

</div>
In mobile, the mobile menu bar is hiiden, the following change will make mobile menu bar appear also auto adjust horizontal to vertical
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\demosite\css\ubc-clf-full.min.css
@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}}
to
@media(min-width:0px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}}
 C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\demosite\css\ubc-home.css, line 79
change
#content {
    height: 400px;


to
#content {
    height: 100%;

 line 410 change
@media screen and (min-width:1200px) {
    #content {
        height: 470px;
    }

to
@media screen and (min-width:1200px) {
    #content {
        height: 100%;
    }


line 536 change
@media (max-width: 979px) and (min-width: 768px) {
    #content {
        position: relative;
        padding-bottom: 29.78178%;
        height: 144px;
    }

to
@media (max-width: 979px) and (min-width: 768px) {
    #content {
        position: relative;
        padding-bottom: 29.78178%;
        height: 100%;
    } 


C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\query\searchform.inc.php, line 202 change
 $res = mysql_query("SELECT * FROM DEPTS  ORDER BY NAME", $dbcon);
to
 $res = mysql_query("SELECT * FROM DEPTS ", $dbcon);

line 92 change
<th>Department</th>
to
<th>Division</th> 
and more

backup all certificate in Firefox in Windows 7





 To backup all certificate in Firefox  in Windows 7
Select "Tools"->"Options" , then select "Advanced" -> "Encryption" -> "View Certificates", choose the "Your Certificates" tab and click on "Backup All", choose a name for this backup file, provide a backup password and save it in local computer.

To restore the certificate in another computer, in FireFox, same process, using "Import" instead of "Backup All".

I backup local computer certificate to
C:\Users\jiansen\Desktop\real-server\local_certifcate\localpc.p12

Tuesday, January 21, 2014

Adoble Flash media server download




Adobe Flash media server development server 4.5 download:
http://www.adobe.com/cfusion/tdrc/index.cfm?loc=en_us&product=flashmediaserver
Adobe Flash Media Server 5 Starter download:
http://www.adobe.com/cfusion/tdrc/index.cfm?product=adobemediaserver

add ftp feature in fms site and backup





control panel->computer management->ftp sites , create new ftp site.
OK for using user name jiansen with ftp port 21.
bacup ksu fms files from dropbox to local real_server directory with zip file.
Backup
C:\Deltacopy\rsync.exe  -v -rlt -z -p --chmod=ugo=rwX --delete   /cygdrive/c/Users/jiansen/desktop/CAS/  /cygdrive/j/jiansen-office/CAS/
C:\Deltacopy\rsync.exe  -v -rlt -z -p --chmod=ugo=rwX --delete   /cygdrive/c/Users/jiansen/desktop/real-server/  /cygdrive/j/jiansen-office/real-server/

Conftool 2014 -for transplantation day





Development server
For  transplantation day
dump conference_tx_2013 to C:\web_root\canhealth\conftool_tx\conference_tx_2014 20140120 1602.sql
copy conference_tx_2014 20140120 1602.sql to conference_tx_2014_default.sql
conference_chung_2014_default.sql , line 21 change
CREATE DATABASE IF NOT EXISTS conference_tx_2013;
USE conference_tx_2013;

to
CREATE DATABASE IF NOT EXISTS conference_tx_2014;
USE conference_tx_2014;

line 409-501, empty table emails2papers
remove
INSERT INTO `emails2papers` (`paperID`,`email`) VALUES
.....

line 490 -   empty  table export_temp1
remove
INSERT INTO `export_temp1` (`paperID`,`topics`) VALUES
......

line 574 - empty table papers

line 733 empty table persons, only admin, alice and myself account left

line 870 empty  table reviews

line 979, empty table topics2papers

restore conference_chung_2014_default.sql


C:\web_root\cesei\conftool
copy uploads to uploads.2013, empty uploads
MYSQL query browser
GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, DROP, REFERENCES
      ON conference_tx_2014.*
      TO 'confuser'@'localhost'
      IDENTIFIED BY 'password';

(change passsword to real password.)

under /etc/conftool.conf.php, line 66
change
$ctconf['db/database'] = 'conference_tx_2013';
to
$ctconf['db/database'] = 'conference_tx_2014';
login admin, edit conference detail

copy to UBC server 1, also need to reset mail configuration in /etc/conftool.conf.php
C:\LMS\canhealth\conftool_chung
add file index.php
 <?php
 header( 'Location: ./htdocs/' ) ;
?>


MYSQL query browser
GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, DROP, REFERENCES
      ON conference_tx_2014.*
      TO 'confuser'@'localhost'
      IDENTIFIED BY 'password';
under /etc/conftool.conf.php, line 17 change
$ctconf['paths/prefix'] = 'C:/web_root/canhealth/conftool_tx/';
to
$ctconf['paths/prefix'] = 'C:/LMS/canhealth/conftool_tx/';
C:\Program Files\Apache Software Foundation\Apache2.4\conf\httpd.conf , line 277 add
    php_value include_path ".;C:/LMS/cesei/conftool_tx/etc/;"
Fatal error: Call to undefined function session_unregister() in C:\LMS\cesei\conftool_tx\classes\CTSession.ctcls.php on line 323
C:\LMS\cesei\conftool_tx\classes\CTSession.ctcls.php
line 323 change
session_unregister($key);    // needed for another bug in php 4.2!
to
            unset($key); 

http://dev.cesei.org:8080/conftool_tx/htdocs/index.php
http://139.173.32.21:8081/conftool_tx/htdocs/index.php

Monday, January 20, 2014

inbound rule and outbound rule





Inbound rules allow other system to connect to yours, ex if you would like someone to connect to your windows shares, ftp, web server etc.
Outbound rules allow applications on you system to connect to other systems, ex if you want to connect to a web site, IM or some elses ftp.
Both the inbound and outbound rules will have no effect if your firewall is off.

conftool 2014 -For Chung research




Development server
For Chung research
dump conference_2013 to C:\web_root\cesei\conftool\conference_chung_2014_bk 20140120 1000.sql
copy conference_chung_2014_bk 20140120 1000.sql to conference_chung_2014_default.sql
conference_chung_2014_default.sql , line 21 change
CREATE DATABASE IF NOT EXISTS conference_2013;
USE conference_2013;

to
CREATE DATABASE IF NOT EXISTS conference_2014;
USE conference_2014;

line 409-501, empty table emails2papers
remove
INSERT INTO `emails2papers` (`paperID`,`email`) VALUES
.....

line 490 -   empty  table export_temp1
remove
INSERT INTO `export_temp1` (`paperID`,`topics`) VALUES
......

line 574 - empty table papers

line 733 empty table persons, only admin, alice and myself account left

line 870 empty  table reviews

line 979, empty table topics2papers

restore conference_chung_2014_default.sql


C:\web_root\cesei\conftool
copy uploads to uploads.2013, empty uploads
MYSQL query browser
GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, DROP, REFERENCES
      ON conference_2014.*
      TO 'confuser'@'localhost'
      IDENTIFIED BY 'password';

(change passsword to real password.)

under /etc/conftool.conf.php, line 66
change
$ctconf['db/database'] = 'conference_2013';
to
$ctconf['db/database'] = 'conference_2014';
login admin, edit conference detail

copy to UBC server 1, also need to reset mail configuration in /etc/conftool.conf.php
C:\LMS\canhealth\conftool_chung
add file index.php
 <?php
 header( 'Location: ./htdocs/' ) ;
?>

under /etc/conftool.conf.php, line 17 change
$ctconf['paths/prefix'] = 'C:/web_root/cesei/conftool/';
to
$ctconf['paths/prefix'] = 'C:/LMS/canhealth/conftool_chung/';
C:\Program Files\Apache Software Foundation\Apache2.4\conf\httpd.conf , line 262 add
php_value include_path ".;C:/LMS/canhealth/conftool_chung/etc/"
Fatal error: Call to undefined function session_unregister() in C:\LMS\canhealth\conftool_chung\classes\CTSession.ctcls.php on line 323
C:\LMS\canhealth\conftool_chung\classes\CTSession.ctcls.php
line 323 change
session_unregister($key);    // needed for another bug in php 4.2!
to
            unset($key); 

http://dev.cesei.org/conftool_chung/htdocs/index.php
 http://139.173.32.21/conftool/htdocs/index.php



Friday, January 17, 2014

Cisco Security Desktop, access denied




After Windows updated, access.vch.ca showed access denied.
Your system failed to be validated by the Cisco Secure Desk and will not granted access.
In Internet explorer 11,
tools->Compatibility Settings
add access.vch.ca

Monday, January 13, 2014

New virtual server 2




File repostory 125 GB,  two virtual directory  share network location \\
but cesei server can not see this due to that they are not in same network.
test streaming  and MySQL database in  new virtual server.
 set excel csv delimiter for export
http://www.howtogeek.com/howto/21456/export-or-save-excel-files-with-pipe-or-other-delimiters-instead-of-commas/ 

Design a script to ftp a file with time stamp from another  Windows server to this computer daily

Department database design (2)





http://localhost/ubc_surgery_pub/scripts/manage/
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\superadmin\convertauthor.php, new file:
<?php
error_reporting(E_ALL ^ E_NOTICE);
// Simply list all users. If "deptid" is supplied then restrict to that dept.
require_once($config['homedir']. '/manage/common.php');
$q = "SELECT * FROM USERS";
if(!($res = mysql_query($q, connectpubsdb()))){
  echo "<p>Database error. Please try refreshing the page, and contact the system administrator if this error persists.</p>";
}else{
  $subcategorised = array();
  while($row = mysql_fetch_assoc($res)){
    $username=$row['firstname'].','.$row['lastname'][0];
    $rvv = '[[:<:]]'.$username.'[[:>:]]';
   
    $wh = "CONCAT_WS(' ', authorlist, secondaryauthorlist, seriesauthorlist) LIKE
    '%$vv%' AND CONCAT_WS(' ', authorlist, secondaryauthorlist, seriesauthorlist) REGEXP '$rvv'";
    $sql = "SELECT * FROM PUBLICATIONS WHERE ($wh)";

    $res1 = mysql_query($sql, connectpubsdb());
    while($row1 = mysql_fetch_assoc($res1)){
      $userlist = $row1['userlist'].','.$row['userid'];
      $pieces = explode(",", $row1['userlist']);
      if (in_array($row['userid'], $pieces)) break;
      $sql_1 = "UPDATE PUBLICATIONS SET userlist='$userlist' WHERE pubid=".$row1['pubid'];
      $res2 = mysql_query($sql_1, connectpubsdb());
    }
  }

?>

Download csv of department faculty and staff from
http://surgery.med.ubc.ca/faculty-staff/directory/

Change department to divisions in the code
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\superadmin\index.php
change department to division, change faculty to department
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\superadmin\user.php
change department to division
http://localhost/ubc_surgery_pub/scripts/manage/
add import user by csv

C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\index.php, line 582 add
 <li><a href="./?action=importcsvuser">Import user via csv file (new)</a></li>
line 70 add:
case 'importcsvuser':
  require_once('superadmin/importcsvuser.php');
  break;    

create new file  superadmin/importcsvuser.php

Friday, January 10, 2014

Windows Server 2008 R2 - Configuring an FTP Server



https://www.youtube.com/watch?v=QsGPqkobCs8

1) add 250GB external disk, initialize NFTS Data D drive
2) Server administration
Role: add IIS, select Ftp
3) Create ftp_users group,
create new users
4) ftp site name? ftp.m.cesei.org
add new ftp site, put ftp_users group insed
5) Run firewall.cpl in cmd
Firewall, first line, add program
Windows/System32/svchost.exe,
6) Check  the checkbox of Host process for Windows Services
in Firewall program.
7) Send request to UBC network to open port 21, 22, 8081-8084, 1935
Should request to open port 3306 for MySQL too.

Wednesday, January 8, 2014

Complicate MySQl query





Complicate MySQl query
SELECT * FROM ubc_surgery_pub.publications WHERE (1 AND (CONCAT_WS(' ', authorlist, secondaryauthorlist, seriesauthorlist) LIKE '%Bowen%' AND CONCAT_WS(' ', authorlist, secondaryauthorlist, seriesauthorlist) REGEXP '[[:<:]]Bowen[[:>:]]' AND CONCAT_WS(' ', authorlist, secondaryauthorlist, seriesauthorlist) LIKE '%V%' AND CONCAT_WS(' ', authorlist, secondaryauthorlist, seriesauthorlist) REGEXP '[[:<:]]V[[:>:]]' AND 1) AND (year!=9999) AND (deptlist <> ',' OR year=9999 OR (deptlist=',' AND pendingdepts=',')) AND (deptlist<>',' OR pendingdepts<>',') ) ORDER BY year DESC, authorlist ASC, secondaryauthorlist ASC, title ASC LIMIT 2000;

Explanation:
MySQL CONCAT_WS() function is used to join two or more strings with separator. - See more at: http://www.w3resource.com/mysql/string-functions/mysql-concat_ws-function.php#sthash.nfsRPqcX.dpuf
 MySQL function CONCAT_WS joins strings with separator.
CONCAT_WS(separator, string1, string2)
LIKE '%Bowen%': find string containing Bowen, which can be in the middle of a string
REGEXP: regular expression
[[:<:]] match beginning of  the word
 [[:>:]] match end of  the word
 [[:<:]]Bowen [[:>:]]  match a word boundary at the beginning and  end of a word,
i.e. BBowenn will not match, while LIKE '%Bowen%' match
<>: not equal  operator
[[:<:]] match beginning of words
[[:>:]] match ending of words - See more at: http://www.tech-recipes.com/rx/484/use-regular-expressions-in-mysql-select-statements/#sthash.Jjvj1UWR.dpuf
MySQL CONCAT_WS() function is used to join two or more strings with separator. - See more at: http://www.w3resource.com/mysql/string-functions/mysql-concat_ws-function.php#sthash.nfsRPqcX.dpuf

Monday, January 6, 2014

Add new user account in Windows server 2003




Windows server 2003 - Virtual Server Services
 Start -> Administrator Tools->Computer Management->Local Users and Groups->Users
right click, add new user jiansen
Setup ftp account and password in windows server 2003
 Start -> Administrator Tools->Computer Management->Internet Information Services->Ftp sites
Reference:
http://support.microsoft.com/kb/323384
https://www.serverintellect.com/support/ftp/manual-ftp-acct/

Services IIS admin service

Setup sftp using OpenSSH in Windows 2003
 setup username in sftp
cd C:\Program Files\OpenSSH\bin
mkpasswd -l -u username >> ..\etc\passwd
http://www.digitalmediaminute.com/article/1487/setting-up-a-sftp-server-on-windows

change username to jiansen, in ../etc/passwd
change /home/jiansen to /cygdrive/c/web_root

restart openssh

in database server: 10.29.227.65 using active directory, create user jiansen (control pannel->active directory user and group), connect via remote desktop using new account, error: exceed maximum connection. Check administrator  connect, I did found 2 remote connections hang there, how to reset them?
only one ftp account uploader, created via IIS manager in Windows 2003

1. Create FTP User
  Start -> Administrator Tools->Computer Management->Internet Information Services->Ftp sites
in active directory
Start -> Administrator Tools->Active Directory Users and computer->Users->New User (right click mouse)

2.  Create FTP Virtual Directory
    Start -> Administrator Tools->Internet Information Service (IIS) Manager
  ->FTP Sites > new virtual directory (right click  mouse)
  Enter "Alias" name, put it as exactly the same as the username you have just created and click Next, Browse to the directory where you wish to allow this FTP user to access to. Click Next, enable "Read" and "Write" privileges. Click Finish


3 .Create Permissions on FTP Folder

 Right click on your FTP folder and add the FTP user you have just created above to this folder.
Enable full permissions or any permission set you wish to create.

Active directory tutorial:
Part 1
https://www.youtube.com/watch?v=dQI75523Vag
Part 2
 https://www.youtube.com/watch?v=ti8NQghywco
Part 3
 https://www.youtube.com/watch?v=9e2NqHWkByM

Microsoft Management Console (MMC) is a component of Windows 2000 and its successors that provides system administrators and advanced users an interface for configuring and monitoring the system.
Here I typed mmc  in RUN   to add Local user and groups in active directory

Friday, January 3, 2014

Flash media server stream to mobile devices





Flash media server  4.5 and above can stream to mobile devices, such as iPad, iphone, itouch and Android. HTTP streaming is used.

Video files are located under webroot, for example thisvideo.f4v. The format must be  MPEG-4 format (F4V), i.e  H.264 video (600kbps video, 64kbps audio, 640*480, or 640*360 for wide screen),  ACC audio.

The video link for ios devices:
http://ipaddress/vod-hls/thisvideo.f4v.m3u8 
The video link for flash/Android:
http://ipaddress/vod-hds/thisvideo.f4v.f4m

During Adobe Media Server installation, the default option is to install Apache. If you want to use your own web
server, do not install Apache. You can proxy HTTP connections from Adobe Media Server to your web server.

Reference:
http://help.adobe.com/en_US/adobemediaserver/install/adobemediaserver_5.0.1_install.pdf 

HTTP proxy configuration is configured in the HTTPTunnel section of the Adaptor.xml file (found in fms_root/conf/_defaultRoot, detail can be found:
 http://helpx.adobe.com/adobe-media-server/kb/configuring-proxy-flash-media-server.html

Reference:
http://learnfromlisa.com/
 

Flash media server we used





There are Flash Media Development Server, Flash Media Streaming Server, Flash Media Interactive Server, Flash Media Enterprise Server, Flash Media Server on Amazon Web Services. The difference can be found:
http://www.adobe.com/products/flashmediaserver/helpmechoose.html

The Flash Media Development Server is a free version of Flash Media Enterprise Server (around 45,000$) with limitation of  10 RTMP and 10 RTMFP.

Flash Media Streaming Server (around $995) is not with RTMP.

As we need RTMP and recording, we choose  Flash Media Interactive Server (around $4500), which has feature: 500 RTMFP,  real-time communication and protect/record  media.


I have a very old version of Macromedia Flash Media Server 2, it did not  support IOS streaming
Public Beta Download
https://www.adobe.com/cfusion/entitlement/index.cfm?e=flashmediaserver

Only  Flash Media Server4.5 and later support IOS device streaming, which uses HTTP live streaming (HLS).

Thursday, January 2, 2014

deaprtment database design (1)




http://localhost/ubc_surgery_pub/demosite/
 http://139.173.32.21/ubc_surgery_pub/demosite/
http://myopia.sourceforge.net/
https://sites.google.com/site/2013webservernote/chapter-10-october-2013/chapter-10-1-3-department-publication-database
database name: ubc_surgery_pub
http://jiansenlucodelogger.blogspot.ca/2013/10/design-department-database.html  
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\superadmin\index.php, line 483
change
/div>  
to  
</div>
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\superadmin\querylog.php 
line 62 change
?><tr><td><a href="<?php echo $config[pageshomeurl] ?>manage/?action=edit&pubid=<?php echo $row['pubid'] ?>" target="_blank"><?php echo htmlspecialchars($row['pubid'])
to
?><tr><td><a href="<?php echo $config[pageshomeurl] ?>?action=edit&pubid=<?php echo $row['pubid'] ?>" target="_blank"><?php echo htmlspecialchars($row['pubid']) 
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\people\listallusers.php, line 26 change
 $line = "<li><a href='$config[pageshomeurl]?users%5B%5D=$row[userid]&action=search'><strong>$row[lastname]</strong>, $row[firstname]</a> <small>";
to
 $line = "<li><a href='$config[pageshomeurl]manage/?users%5B%5D=$row[userid]&action=search'><strong>$row[lastname]</strong>, $row[firstname]</a> <small>"; 

issue: how to convert authorlist to userlist in table ubc_surgery_pub.publications p; 

1)  http://localhost/ubc_surgery_pub/scripts/manage/
Add an entry: convert author list to user id.
C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\index.php, line 578 add
  <li><a href="./?action=convertauthor">Convert author list to user id (new)</a></li>
line 67 add
case 'convertauthor':
  require_once('superadmin/convertauthor.php');
  break; 

  C:\Users\jiansen\Desktop\CAS\jiansen_dir\www_cesei0_mobile\ubc_surgery_pub\scripts\manage\superadmin\querylog.php, line 62 change
    ?><tr><td><a href="<?php echo $config[pageshomeurl] ?>?action=edit&pubid=<?php echo $row['pubid'] ?>" target="_blank"><?php echo htmlspecialchars($row['pubid']);
to
    ?><tr><td><a href="<?php echo $config[pageshomeurl] ?>/manage/?action=edit&pubid=<?php echo $row['pubid'] ?>" target="_blank"><?php echo htmlspecialchars($row['pubid']);