/);
var i,j,k;
var val,num;
-
+
// (lines are easier to split from html(),
// but values are easier to parse from text())
for(i=0;i
",{class:'tag'});
tag.html(rtag.name);
tag.click({rtag:rtag},function(e){openTagModal(eid/*iExp*/,e.data.rtag)});
@@ -1046,7 +1049,7 @@ function updateTagColor(tag,rtag)
if(rtag.agree==0&&rtag.disagree==0)
return;
-
+
if(rtag.agree-rtag.disagree>0)
tag.addClass('green');
else
@@ -1059,7 +1062,7 @@ function findTag(tags,name,ontology)
{
var j,found=0;
var ob;
-
+
if(tags)
for(j=0;j-1) {
var ex=findExperimentByEID(eid);
obj=findTag(ex.tags,rtag.name,rtag.ontology);
@@ -1240,7 +1243,7 @@ function openTagModal(eid/*iExp*/,rtag)
$('#boxfade').show();
$('#box #eid').html(eid/*iExp*/);
$('#box #ontology').html(rtag.ontology);
-
+
configureTagModal(rtag);
resizeTagModal();
}
@@ -1252,9 +1255,9 @@ function closeTagModal(vote)
var name=$('#box h2.name').text();
var ontology=$('#box #ontology').text();
var tag;
-
+
// Vote -2:retract, 0:cancel, -1:down-vote or 1:up-vote
- if(vote!=0)
+ if(vote!=0)
{
// find the tag
if(eid/*iExp*/>=0) // iExp is >=0 for tables, =-1 for article-level tags
@@ -1264,7 +1267,7 @@ function closeTagModal(vote)
// experiment
if(!(ex.tags))
ex.tags=new Array;
-
+
// check whether the currently voted tag was already among
// the experiment's tags
obj=findTag(ex.tags,name,ontology);
@@ -1314,7 +1317,7 @@ function closeTagModal(vote)
else
rtag.disagree=disagree+1;
}
-
+
// Update tag display and save total tag votes (total agree/disagree stats)
if(eid/*iExp*/>=0)
{
@@ -1521,7 +1524,7 @@ function initTranslucentBrain(eid/*iExp*/)
// create a scene
ex.render.scene = new THREE.Scene();
-
+
// create projector (for hit detection)
ex.render.projector = new THREE.Projector();
ex.render.renderer.domElement.addEventListener( 'mousedown', function(e){onDocumentMouseDown(e,eid/*iExp*/);}, false );
@@ -1538,7 +1541,7 @@ function initTranslucentBrain(eid/*iExp*/)
// allow 'p' to make screenshot
//THREEx.Screenshot.bindKey(renderer);
-
+
// Add lights
var light = new THREE.AmbientLight( 0x3f3f3f);
ex.render.scene.add(light );
@@ -1557,11 +1560,11 @@ function initTranslucentBrain(eid/*iExp*/)
{
var tmp=this.response;
var modifier = new THREE.SubdivisionModifier(1);
-
+
ex.render.material=new THREE.ShaderMaterial({
- uniforms: {
+ uniforms: {
coeficient : {
- type : "f",
+ type : "f",
value : 1.0
},
power : {
@@ -1599,10 +1602,10 @@ function initTranslucentBrain(eid/*iExp*/)
transparent : true,
depthWrite : false,
});
-
+
ex.render.geometry=new THREE.PLYLoader().parse(tmp);
ex.render.geometry.sourceType = "ply";
-
+
modifier.modify(ex.render.geometry);
for(i=0;i/', '$1', $str);
+}
+
+$result = mysqli_query($link, "SELECT * FROM ".$dbname.".Articles");
+while($record=mysqli_fetch_assoc($result))
+{
+ $pmid=$record['PMID'];
+ $doi=$record['DOI'];
+ $exs=$record['Experiments'];
+ $title=$record['Title'];
+
+ //Add Zscores to each experiment
+ $exs=json_decode(strip_cdata($exs));
+ for($i=0;$ilocations) {
+ for ($j=0;$jlocations);$j++) {
+ //ONLY RUN THIS ONCE
+ // $ex->locations[$j].=",0";
+ }
+ // echo implode(" ", $ex->locations);
+ $exs[$i] = $ex;
+ }
+ }
+
+
+ //Update database
+ $q="UPDATE ".$dbname.".Articles SET ";
+ $q.="Experiments='".mysqli_real_escape_string($link, json_encode($exs))."' ";
+ $q.= " WHERE PMID='".$pmid."'";
+ $result2 = mysqli_query($link, $q);
+ if($result2)
+ echo "SUCCESS\n";
+ else
+ {
+ // echo "ERROR: Unable to process query: ".$q."\n";
+ // var_dump($record);
+ }
+
+}
+
+mysqli_free_result($result);
+?>
diff --git a/site/php/admin_numSubjects.php b/site/php/admin_numSubjects.php
new file mode 100644
index 0000000..24f37f9
--- /dev/null
+++ b/site/php/admin_numSubjects.php
@@ -0,0 +1,43 @@
+/', '$1', $str);
+}
+
+ //Update database
+ $q="ALTER TABLE ".$dbname.".Articles ADD ";
+ $q.="NumSubjects int";
+ $result2 = mysqli_query($link, $q);
+ if($result2)
+ echo "SUCCESS\n";
+ else
+ {
+ // echo "ERROR: Unable to process query: ".$q."\n";
+ // var_dump($record);
+ }
+
+ $q="UPDATE ".$dbname.".Articles SET ";
+ $q.="NumSubjects=0";
+ $result3 = mysqli_query($link, $q);
+ if($result3)
+ echo "SUCCESS\n";
+ else
+ {
+ // echo "ERROR: Unable to process query: ".$q."\n";
+ // var_dump($record);
+ }
+
+?>