Commit 02be7d68 authored by Romain Loth's avatar Romain Loth

fix php html structure and some layout

parent 7930c4cd
<?php <?php
echo " $meta .= "
<script type='text/javascript'> <script type='text/javascript'>
var _gaq = _gaq || []; var _gaq = _gaq || [];
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Common utility functions * Common utility functions
*/ */
function clean_exp($string){ function clean_exp($string) {
// enlève les comma trainantes // enlève les comma trainantes
if (strcmp(substr(trim($string),-1),',')==0){ if (strcmp(substr(trim($string),-1),',')==0){
return substr(trim($string),0,-1); return substr(trim($string),0,-1);
...@@ -13,8 +13,8 @@ function clean_exp($string){ ...@@ -13,8 +13,8 @@ function clean_exp($string){
} }
} }
function esc_html($string){ function esc_html($string) {
return htmlspecialchars($string,ENT_HTML5, 'UTF-8') ; return htmlspecialchars($string,ENT_HTML5|ENT_QUOTES, 'UTF-8') ;
} }
// -----------------------------8<------------------ // -----------------------------8<------------------
......
...@@ -3,16 +3,9 @@ ...@@ -3,16 +3,9 @@
// sort un $content // sort un $content
echo '
<body>';
include ("analytics.php"); include ("analytics.php");
echo '
<div class="container">
<!-- Directory listing -->
<div class="hero-unit">
';
$content.= ' <!-- Directory listing --> ';
$imsize = 150; $imsize = 150;
...@@ -29,7 +22,6 @@ $loop = 0; ...@@ -29,7 +22,6 @@ $loop = 0;
// NB this array was prepared in print_directory or print_scholar_directory // NB this array was prepared in print_directory or print_scholar_directory
foreach ($scholars as $scholar) { foreach ($scholars as $scholar) {
$scholar['position'] = weedout_alt_nulls($scholar['position']) ; $scholar['position'] = weedout_alt_nulls($scholar['position']) ;
...@@ -41,12 +33,37 @@ foreach ($scholars as $scholar) { ...@@ -41,12 +33,37 @@ foreach ($scholars as $scholar) {
set_time_limit(20); set_time_limit(20);
} }
$loop+=1; $loop+=1;
$content.= '<div class="row">
<div class="span12">
<div class="row">
<div class="span9" align="justify">';
$content .= '<div>';
// Entry structure:
// ----------------
// <div class="row">
// <div class="span3" align="justify">
// <!-- picture -->
// </div>
// <div class="span9" align="justify">
// <div class="container inner">
// <div class="row">
// <div class="span6" align="justify">
// <!-- name and affiliations -->
// </div>
// <div class="span3" align="justify">
// <!-- keywords -->
// </div>
// </div>
// <div class="row">
// <div class="span12" align="justify">
// <!-- interests text -->
// </div>
// </div>
// </div>
// </div>
// </div>
$content .= "\n";
$content.= '<div class="row">';
// picture <=> left column
$content.= ' <div class="span3" align="justify">';
// remote pictures url 'http://some.org/path/blabla.png' // remote pictures url 'http://some.org/path/blabla.png'
// or local '/data/shared_user_img/blabla.png' // or local '/data/shared_user_img/blabla.png'
if ($scholar['pic_src'] != null) { if ($scholar['pic_src'] != null) {
...@@ -54,39 +71,52 @@ foreach ($scholars as $scholar) { ...@@ -54,39 +71,52 @@ foreach ($scholars as $scholar) {
if ($_SERVER['REQUEST_SCHEME'] == 'https') { if ($_SERVER['REQUEST_SCHEME'] == 'https') {
$pic_src = preg_replace('/^http:/i', 'https:', $pic_src) ; $pic_src = preg_replace('/^http:/i', 'https:', $pic_src) ;
} }
$content .= '<img style="margin: 7px 10px 10px 0px" src="'. $pic_src . '" width="' . $imsize . 'px" align="left">'; $content .= '<img class="pic-of-scholar" src="'. $pic_src . '" width="' . $imsize . 'px" align="left">';
} }
else { else {
if (count($scholars) < 2000) { if (count($scholars) < 2000) {
$im_id = floor(rand(0, 11)); $im_id = floor(rand(0, 11));
$content .= '<img style="margin: 7px 10px 10px 0px" src="static/img/' . $im_id . '.png" width="' . $imsize . 'px" align="left">'; $content .= '<img class="pic-of-scholar" src="static/img/' . $im_id . '.png" width="' . $imsize . 'px" align="left">';
} }
} }
$content.= ' </div><!-- close pic -->';
// right part :
// ---8---|--4- innerrow1
// ------12---- innerrow2
$content .= ' <div class="span9" align="justify">';
// innercontainer
$content .= ' <div class="container inner">';
// innerrow1
$content .= ' <div class="row">';
// name and affiliations
$content .= ' <div class="span6" align="justify">';
$content .= '<h2 >' . $scholar['title'] . ' ' . $scholar['first_name'] . ' ' . $scholar['mid_initial'] . ' ' . $scholar['last_name'] . $content .= '<h2 >' . $scholar['title'] . ' ' . $scholar['first_name'] . ' ' . $scholar['mid_initial'] . ' ' . $scholar['last_name'] .
' <small> - ' . $scholar['country'] . '</small></h2>'; ' <small> - ' . $scholar['country'] . '</small></h2>';
if (($scholar['position'] != null)
if (($scholar['position'] != null)||count($scholar['labs'])||count($scholar['institutions'])) { || $scholar['homepage'] != null
|| count($scholar['labs'])
|| count($scholar['institutions'])) {
$content .= '<dl>'; $content .= '<dl>';
} }
if ($scholar['position'] != null) { if ($scholar['position'] != null) {
$content .= '<dt>' . $scholar['position'] . '</dt>'; $content .= '<dt>' . $scholar['position'] . '</dt>';
} }
$lab = ''; $lab = '';
// new way: list of org.label values // list of org.label values
if (count($scholar['labs'])) { if (count($scholar['labs'])) {
$labs_html = implode( $labs_html = implode(
'<br>', '<br>',
array_map( array_map(
"clean_exp", "clean_exp",
array_map("esc_html", array_map(
array_map(
"weedout_alt_nulls", "weedout_alt_nulls",
$scholar['labs'] $scholar['labs']
)
) )
) )
); );
...@@ -98,14 +128,15 @@ foreach ($scholars as $scholar) { ...@@ -98,14 +128,15 @@ foreach ($scholars as $scholar) {
# because we already have $lab_counts (per id) # because we already have $lab_counts (per id)
} }
// new way: list of org.label values // list of org.label values
if (count($scholar['institutions'])) { if (count($scholar['institutions'])) {
$institutions_html = implode( $institutions_html = implode(
'<br>', '<br>',
array_map( array_map(
"clean_exp", "clean_exp",
array_map("esc_html", array_map(
$scholar['institutions'] "weedout_alt_nulls",
$scholar['institutions']
) )
) )
); );
...@@ -118,46 +149,59 @@ foreach ($scholars as $scholar) { ...@@ -118,46 +149,59 @@ foreach ($scholars as $scholar) {
} }
// POSS: url of lab as link, if filled in DB if ($scholar['homepage'] != null) {
$www = homepage_to_alink($scholar['homepage']);
$content .= '<dd class="url-of-scholar"><i class="icon-home"></i>'.$www.'</dd>';
}
if (($scholar['position'] != null) if (($scholar['position'] != null)
||count($scholar['labs']) || $scholar['homepage'] != null
||count($scholar['institutions']) || count($scholar['labs'])
|| count($scholar['institutions'])
) { ) {
$content .= '</dl>'; $content .= '</dl>';
} }
$content .= ' </div>'; // close span6
$content .= '</div>'; if ($scholar['keywords'] != null) {
$content .= '<div class="span3" align="left">';
if ($scholar['interests'] != null) { $content .= ' <div class="keywords-of-scholar">
<i class="icon-tags"></i> ' . clean_exp($scholar['keywords']). '
</div>';
$htmlsafe_interests = str_replace('%%%', '<br/>', $content .= "\n";
htmlspecialchars($scholar['interests'], $content .= '</div>'; // close span3
ENT_HTML5, 'UTF-8') $content .= "\n";
);
$content .= '<div>';
$content .= '<h4>Research</h4>';
$content .= '<p>' . $htmlsafe_interests . '</p>';
$content .= '</div>';
} }
$content .= '</div>';
$content .= '</div>'; // close innerrow1
$content .= "\n";
if ($scholar['keywords'] != null) { if ($scholar['interests'] != null) {
$content .= '<div class="span3" align="left">'; // second row is undivided
$content .= "\n";
if ($scholar['keywords'] != null){ $content .= '<div class="row">
$content .= '<i class="icon-tags"></i> ' . clean_exp($scholar['keywords']). '.<br/><br/>'; <div class="span9" align=justify>';
} $content .= "\n";
$content .= '<div class="interests-of-scholar">';
$content .= '<dl><dt>Research</dt></dl>';
$content .= '<p>' . $scholar['interests'] . '</p>';
$content .= '</div>'; $content .= '</div>';
$content .= "\n";
$content .= '</div></div>'; // closing full span and innerrow2
$content .= "\n";
} }
$content .= '</div>';
$content .= '</div>'; $content .= "\n";
$content .= '</div>'; $content .= '</div>'; // closing inner container
$content .= "\n";
$content .= '</div>'; // closing outer span12
$content .= "\n";
$content .= '</div>'; // closing outer row
$content .= "\n";
$content .= ' $content .= '
<center><img src="static/img/bar.png"></center>'; <center><img src="static/img/bar.png"></center>';
...@@ -222,21 +266,23 @@ for($i = 0; $i < $n_steps; $i++) { ...@@ -222,21 +266,23 @@ for($i = 0; $i < $n_steps; $i++) {
AS related_insts AS related_insts
FROM orgs FROM orgs
LEFT JOIN ( LEFT JOIN (
SELECT sch_org.orgid AS src_orgid, SELECT * FROM (
sch_org2.orgid AS tgt_orgid, SELECT sch_org.orgid AS src_orgid,
count(*) AS tgt_freq sch_org2.orgid AS tgt_orgid,
FROM sch_org count(sch_org.uid) AS tgt_freq
LEFT JOIN sch_org AS sch_org2 FROM sch_org
ON sch_org.uid = sch_org2.uid LEFT JOIN sch_org AS sch_org2
JOIN orgs AS orgs2 ON sch_org.uid = sch_org2.uid
ON sch_org2.orgid = orgs2.orgid JOIN orgs AS orgs2
WHERE orgs2.class = 'inst' ON sch_org2.orgid = orgs2.orgid
AND sch_org.orgid != sch_org2.orgid WHERE orgs2.class = 'inst'
GROUP BY sch_org.orgid, sch_org2.orgid AND sch_org.orgid != sch_org2.orgid
) AS lab_relationship_to_inst_via_scholars ON src_orgid = orgs.orgid GROUP BY sch_org.orgid, sch_org2.orgid
) AS lab_relationship_to_inst_via_scholars
WHERE tgt_freq > 1
) lab_relationship_filtered ON src_orgid = orgs.orgid
WHERE orgs.orgid IN ( {$ids_str} ) WHERE orgs.orgid IN ( {$ids_str} )
AND orgs.name != '_NULL' AND orgs.name != '_NULL'
AND tgt_freq > 1
GROUP BY orgs.orgid GROUP BY orgs.orgid
ORDER BY orgs.name, orgs.acro ORDER BY orgs.name, orgs.acro
LABSQLEXTENDED; LABSQLEXTENDED;
......
...@@ -80,12 +80,12 @@ foreach ($labs as $lab) { ...@@ -80,12 +80,12 @@ foreach ($labs as $lab) {
if ($n_related_insts) { if ($n_related_insts) {
$content .= '<h4 title="Frequently related institutions">Institutions:</h4>'; $content .= '<h4 title="Frequently related institutions">Institutions:</h4>';
$content .= '<ul>'; $content .= '<dl style="margin-top:5px;">';
// $content .= "<p>".$n_related_insts."</p>"; // $content .= "<p>".$n_related_insts."</p>";
foreach ($lab['related_insts'] as $rel_inst_id) { foreach ($lab['related_insts'] as $rel_inst_id) {
$content .= '<li class="parent-org"><a href="#org-'.$rel_inst_id.'">'; $content .= '<dd class="parent-org"><a href="#org-'.$rel_inst_id.'">';
$rel_inst_info = $institutions[$rel_inst_id]; $rel_inst_info = $institutions[$rel_inst_id];
$has_acro = false ; $has_acro = false ;
...@@ -100,12 +100,12 @@ foreach ($labs as $lab) { ...@@ -100,12 +100,12 @@ foreach ($labs as $lab) {
$content .= "<span class='rel-inst-locname'> - ".$rel_inst_info['locname']."</span>"; $content .= "<span class='rel-inst-locname'> - ".$rel_inst_info['locname']."</span>";
} }
// $content .= var_dump($rel_inst_info); // $content .= var_dump($rel_inst_info);
$content .= "</li>"; $content .= "</dd>";
// $content .= '<dd class="parent-org">' . ['label'] . '</dd> '; // $content .= '<dd class="parent-org">' . ['label'] . '</dd> ';
} }
$content .= '</ul>'; $content .= '</dl>';
} }
$content .= '</div>'; $content .= '</div>';
......
...@@ -75,6 +75,7 @@ function split_join_keywords_for_html($str_value) { ...@@ -75,6 +75,7 @@ function split_join_keywords_for_html($str_value) {
$mod_arr = []; $mod_arr = [];
foreach ($arr as $kw) { foreach ($arr as $kw) {
$kw = esc_html($kw);
if (strlen(str_replace(' ', '', $kw))) { if (strlen(str_replace(' ', '', $kw))) {
$mod_kw = str_replace(' ', '&nbsp;', $kw) ; $mod_kw = str_replace(' ', '&nbsp;', $kw) ;
array_push($mod_arr, $mod_kw); array_push($mod_arr, $mod_kw);
......
...@@ -53,8 +53,8 @@ foreach ($institutions as $orga) { ...@@ -53,8 +53,8 @@ foreach ($institutions as $orga) {
$content.="</h2>"; $content.="</h2>";
$www = ''; $www = '';
if (array_key_exists('homepage', $lab) && strlen($lab['homepage'])) { if (array_key_exists('homepage', $orga) && strlen($orga['homepage'])) {
$www = homepage_to_alink($lab['homepage']); $www = homepage_to_alink($orga['homepage']);
$content .= '<dl><dd><span class="glyphicon glyphicon-home"></span>'.$www.'</dd></dl>'; $content .= '<dl><dd><span class="glyphicon glyphicon-home"></span>'.$www.'</dd></dl>';
} }
......
...@@ -40,8 +40,8 @@ $missing_country = 0; ...@@ -40,8 +40,8 @@ $missing_country = 0;
$missing_title = 0; $missing_title = 0;
$missing_position = 0; $missing_position = 0;
$missing_labs = $lab_counts[''] || 0; $missing_labs = array_key_exists('', $lab_counts) ? $lab_counts[''] : 0;
$missing_insts = $inst_counts[''] || 0; $missing_insts = array_key_exists('', $inst_counts) ? $inst_counts[''] : 0;
......
...@@ -143,6 +143,7 @@ if ($tags) { ...@@ -143,6 +143,7 @@ if ($tags) {
$i++; $i++;
} }
$f .= ") "; $f .= ") ";
$query_details .= "</li>";
} }
if ($keywords) { if ($keywords) {
...@@ -172,6 +173,8 @@ if ($keywords) { ...@@ -172,6 +173,8 @@ if ($keywords) {
$i++; $i++;
} }
$f .= ") "; $f .= ") ";
$query_details .= "</li>";
} }
...@@ -195,6 +198,7 @@ if ($countries) { ...@@ -195,6 +198,7 @@ if ($countries) {
$i++; $i++;
} }
$f .= ") "; $f .= ") ";
$query_details .= "</li>";
} }
if ($laboratories) { if ($laboratories) {
...@@ -215,6 +219,7 @@ if ($laboratories) { ...@@ -215,6 +219,7 @@ if ($laboratories) {
$i++; $i++;
} }
$f .= ") "; $f .= ") ";
$query_details .= "</li>";
} }
if ($organizations) { if ($organizations) {
...@@ -237,6 +242,7 @@ if ($organizations) { ...@@ -237,6 +242,7 @@ if ($organizations) {
$i++; $i++;
} }
$f .= ") "; $f .= ") ";
$query_details .= "</li>";
} }
$query_details.='</ul>'; $query_details.='</ul>';
...@@ -351,10 +357,10 @@ foreach ($base->query($sql) as $row) { ...@@ -351,10 +357,10 @@ foreach ($base->query($sql) as $row) {
$info = array(); $info = array();
$info['unique_id'] = $row['luid']; $info['unique_id'] = $row['luid'];
$info['doors_uid'] = $row['doors_uid']; $info['doors_uid'] = $row['doors_uid'];
$info['first_name'] = $row['first_name']; $info['first_name'] = esc_html($row['first_name']);
$info['mid_initial'] = (strlen($row['middle_name']) ? substr($row['middle_name'],0,1)."." : ""); $info['mid_initial'] = (strlen($row['middle_name']) ? substr($row['middle_name'],0,1)."." : "");
$info['last_name'] = $row['last_name']; $info['last_name'] = esc_html($row['last_name']);
$info['initials'] = $row['initials']; $info['initials'] = esc_html($row['initials']);
// retrieved from secondary table and GROUP_CONCATenated // retrieved from secondary table and GROUP_CONCATenated
// $info['keywords_ids'] = explode(',', $row['keywords_ids']); // $info['keywords_ids'] = explode(',', $row['keywords_ids']);
...@@ -365,21 +371,25 @@ foreach ($base->query($sql) as $row) { ...@@ -365,21 +371,25 @@ foreach ($base->query($sql) as $row) {
// $info['status'] = $row['status']; // $info['status'] = $row['status'];
$info['record_status'] = $row['record_status']; // TODO use this one $info['record_status'] = $row['record_status']; // TODO use this one
$info['country'] = $row['country']; $info['country'] = esc_html($row['country']);
$info['homepage'] = $row['home_url']; $info['homepage'] = $row['home_url'];
// recreated arrays // recreated arrays
$info['labs'] = explode('%%%', $row['labs_list'] ?? "") ; $info['labs'] = array_map("esc_html",
$info['institutions'] = explode('%%%', $row['insts_list'] ?? "") ; explode('%%%', $row['labs_list'] ?? "")
) ;
$info['institutions'] = array_map("esc_html",
explode('%%%', $row['insts_list'] ?? "")
) ;
$info['labs_ids'] = explode(',', $row['labs_ids'] ?? "") ; $info['labs_ids'] = explode(',', $row['labs_ids'] ?? "") ;
$info['insts_ids'] = explode(',', $row['insts_ids'] ?? "") ; $info['insts_ids'] = explode(',', $row['insts_ids'] ?? "") ;
$info['title'] = esc_html($row['hon_title']);
$info['title'] = $row['hon_title']; $info['position'] = esc_html($row['position']);
$info['position'] = $row['position'];
$info['pic_src'] = $row['pic_fname'] ? '/data/shared_user_img/'.$row['pic_fname'] : $row['pic_url'] ; $info['pic_src'] = $row['pic_fname'] ? '/data/shared_user_img/'.$row['pic_fname'] : $row['pic_url'] ;
$info['interests'] = $row['interests_text']; $info['interests'] = str_replace('%%%', '<br/>',
esc_html($row['interests_text'])
);
// $info['address'] = $row['address']; // $info['address'] = $row['address'];
// $info['city'] = $row['city']; // $info['city'] = $row['city'];
...@@ -432,6 +442,7 @@ foreach ($base->query($sql) as $row) { ...@@ -432,6 +442,7 @@ foreach ($base->query($sql) as $row) {
// both our stats have been filled // both our stats have been filled
// var_dump($lab_counts) ; // var_dump($lab_counts) ;
// var_dump($inst_counts) ; // var_dump($inst_counts) ;
// var_dump($org_id_to_label) ;
// creates js for stats visualisations and counts (we re-use the orgs counts) // creates js for stats visualisations and counts (we re-use the orgs counts)
include ("php_library/stat-prep_from_array.php"); include ("php_library/stat-prep_from_array.php");
...@@ -445,8 +456,7 @@ include ("php_library/directory_content.php"); ...@@ -445,8 +456,7 @@ include ("php_library/directory_content.php");
$content .= '</div>'; $content .= '</div>';
$content .= '</div> $content .= '<footer style="color:white">
<footer style="color:white">
<!-- This directory is maintained by the <a href="http://cssociety.org" target="blank">Complex Systems Society</a> <!-- This directory is maintained by the <a href="http://cssociety.org" target="blank">Complex Systems Society</a>
and the <a href="http://iscpif.fr" target="blank">Complex Systems Institute of Paris Ile-de-France</a>.<br/>--> and the <a href="http://iscpif.fr" target="blank">Complex Systems Institute of Paris Ile-de-France</a>.<br/>-->
<center> <center>
...@@ -484,15 +494,16 @@ $content .= '</div> ...@@ -484,15 +494,16 @@ $content .= '</div>
</html>'; </html>';
//////// Header //////// Header
$header = '<div class="row" id="welcome"> $header = '
<div class="row" id="welcome">
<div class="span12" align="justify"> <div class="span12" align="justify">
<img src="static/img/RegistryBanner.png" align="center"> <img src="static/img/RegistryBanner.png" align="center">
<br/><br/> <br/><br/>
<h1>Complex Systems Scholars</h1> <h1>Complex Systems Scholars</h1>
<br/> <br/>
<br/> <br/>
<p> <p>
This directory presents the profiles of <a href="#scholars">'. count($scholars).' scholars</a>, <a href="#labs">'. count($labs).' labs</a> and <a href="#orga">'.$orga_count.' organizations</a> in the field of Complex Systems'; This directory presents the profiles of <a href="#scholars">'. count($scholars).' scholars</a>, <a href="#labs">'. count($labs).' labs</a> and <a href="#orga">'.$orga_count.' organizations</a> in the field of Complex Systems';
...@@ -508,13 +519,12 @@ science, as well as to increase their visibility at the international scale.< ...@@ -508,13 +519,12 @@ science, as well as to increase their visibility at the international scale.<
<ul> <ul>
<li><b><i>This directory is open</i></b>. Anybody can have her profile included <li><b><i>This directory is open</i></b>. Anybody can have her profile included
provided it is related to Complex Systems science and Complexity science. Personal data are given on a provided it is related to Complex Systems science and Complexity science. Personal data are given on a
voluntary basis and people are responsible for the validity and integrity of their data. voluntary basis and people are responsible for the validity and integrity of their data.</li>
<li>This directory is edited by the ISCPIF. This initiative is supported by the <i>Complex Systems <li>This directory is edited by the ISCPIF. This initiative is supported by the <i>Complex Systems
Society</i> (<a href="http://cssociety.org">http://cssociety.org</a>). Society</i> (<a href="http://cssociety.org">http://cssociety.org</a>).
Contributions and ideas are welcome to improve this directory. Contributions and ideas are welcome to improve this directory.
<a href="mailto:sysop AT iscpif.fr">Please feedback</a></p> <a href="mailto:sysop AT iscpif.fr">Please feedback</a></li>
</ul> </ul>
</p>
<br/> <br/>
<br/> <br/>
...@@ -538,7 +548,12 @@ Contributions and ideas are welcome to improve this directory. ...@@ -538,7 +548,12 @@ Contributions and ideas are welcome to improve this directory.
</div>'; </div>';
echo $meta.' '.$stats.'</head>'; echo $meta.' '.$stats.'</head>';
echo '<body>
<div class="container full-directory">
<div class="hero-unit">';
echo $header; echo $header;
echo '';
echo $content; echo $content;
exit(0) exit(0)
......
...@@ -166,10 +166,10 @@ HERE_QUERY; ...@@ -166,10 +166,10 @@ HERE_QUERY;
$info = array(); $info = array();
$info['unique_id'] = $row['luid']; $info['unique_id'] = $row['luid'];
$info['doors_uid'] = $row['doors_uid']; $info['doors_uid'] = $row['doors_uid'];
$info['first_name'] = $row['first_name']; $info['first_name'] = esc_html($row['first_name']);
$info['mid_initial'] = (strlen($row['middle_name']) ? substr($row['middle_name'],0,1)."." : ""); $info['mid_initial'] = (strlen($row['middle_name']) ? substr($row['middle_name'],0,1)."." : "");
$info['last_name'] = $row['last_name']; $info['last_name'] = esc_html($row['last_name']);
$info['initials'] = $row['initials']; $info['initials'] = esc_html($row['initials']);
// retrieved from secondary table and GROUP_CONCATenated // retrieved from secondary table and GROUP_CONCATenated
$info['keywords_ids'] = explode(',', $row['keywords_ids']); $info['keywords_ids'] = explode(',', $row['keywords_ids']);
...@@ -179,21 +179,25 @@ HERE_QUERY; ...@@ -179,21 +179,25 @@ HERE_QUERY;
// $info['status'] = $row['status']; // $info['status'] = $row['status'];
$info['record_status'] = $row['record_status']; // TODO use this one $info['record_status'] = $row['record_status']; // TODO use this one
$info['country'] = $row['country']; $info['country'] = esc_html($row['country']);
$info['homepage'] = $row['home_url']; $info['homepage'] = $row['home_url'];
// recreated arrays // recreated arrays
$info['labs'] = explode('%%%', $row['labs_list'] ?? "") ; $info['labs'] = array_map("esc_html",
$info['institutions'] = explode('%%%', $row['insts_list'] ?? "") ; explode('%%%', $row['labs_list'] ?? "")
) ;
$info['institutions'] = array_map("esc_html",
explode('%%%', $row['insts_list'] ?? "")
) ;
$info['labs_ids'] = explode(',', $row['labs_ids'] ?? "") ; $info['labs_ids'] = explode(',', $row['labs_ids'] ?? "") ;
$info['insts_ids'] = explode(',', $row['insts_ids'] ?? "") ; $info['insts_ids'] = explode(',', $row['insts_ids'] ?? "") ;
$info['title'] = esc_html($row['hon_title']);
$info['title'] = $row['hon_title']; $info['position'] = esc_html($row['position']);
$info['position'] = $row['position'];
$info['pic_src'] = $row['pic_fname'] ? '/data/shared_user_img/'.$row['pic_fname'] : $row['pic_url'] ; $info['pic_src'] = $row['pic_fname'] ? '/data/shared_user_img/'.$row['pic_fname'] : $row['pic_url'] ;
$info['interests'] = $row['interests_text']; $info['interests'] = str_replace('%%%', '<br/>',
esc_html($row['interests_text'])
);
// $info['address'] = $row['address']; // $info['address'] = $row['address'];
// $info['city'] = $row['city']; // $info['city'] = $row['city'];
// $info['postal_code'] = $row['postal_code']; // $info['postal_code'] = $row['postal_code'];
...@@ -353,8 +357,13 @@ echo '<h2>Sorry, '.$target_name.' did not mention any keywords ... we cannot pr ...@@ -353,8 +357,13 @@ echo '<h2>Sorry, '.$target_name.' did not mention any keywords ... we cannot pr
If you are '.$target_name.', you can <a href="/services/user/profile" target="_BLANK">modify your profile</a> and see your If you are '.$target_name.', you can <a href="/services/user/profile" target="_BLANK">modify your profile</a> and see your
network in few minutes.'; network in few minutes.';
}else{ }else{
echo $header; echo '<body>
echo $content; <div class="container full-directory">
<div class="hero-unit">';
echo $header;
echo '';
echo $content;
} }
exit(0); exit(0);
......
...@@ -346,16 +346,38 @@ div.ccsection-footer { ...@@ -346,16 +346,38 @@ div.ccsection-footer {
} }
/*in directory view*/ /*in directory view*/
.full-directory {
margin: 0 25;
}
.container.inner {
width: 100%;
}
.scholars-list {
}
.interests-of-scholar p {
font-size: 1.2em !important;
line-height: 1.3em !important;
margin-top: -.5em;
}
.keywords-of-scholar {
}
.url-of-scholar {
margin-top: .5em;
}
.pic-of-scholar {
/*margin: 7px 25px 15px 0px;*/
}
.labs-of-scholar { .labs-of-scholar {
font-style: italic; font-style: italic;
} }
.institutions-of-scholar { .institutions-of-scholar {
font-variant: small-caps; /*font-variant: small-caps;*/
font-style: italic; font-family: sans;
} }
.rel-inst-locname { .rel-inst-locname {
font-size: 75%; font-size: 90%;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment