Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
publications [2015/11/03 10:14]
aasmunst
publications [2016/10/05 10:09] (current)
aasmunst [Publications] Gå over til felles PHP-fil for MarineUAS og TEMPO
Line 3: Line 3:
  
 <php> <php>
-//<?php+$publicationDatabaseSite = "​tempo";​ 
 +include("​/srv/www/​htdocs/​projects/​publications.php"​);​ 
 +</php>
  
- 
- 
- 
-$mysqli = new mysqli("​localhost",​ "​tempo",​ "​RsKGJxbQnG9CSFb9",​ "​tempo"​);​ 
-/* check connection */ 
-if (mysqli_connect_errno()) { 
- printf("​Connect failed: %s\n", mysqli_connect_error());​ 
- exit(); 
-} 
-$query = "SET NAMES '​utf8'";​ 
-$dummy = $mysqli->​query($query);​ 
- 
-$query = "​SELECT a.id, af.forfatter,​ af.arbeidsinnsats,​ a.id, a.publiseringsaar,​ 
- a.kategori,​ a.overskrift_eng,​ a.publikasjonssted_eng,​ a.registrert,​ 
- f.id, GROUP_CONCAT(f.fullt_navn ORDER BY af.arbeidsinnsats DESC SEPARATOR ', '), 
- a.url 
- FROM `artikler` AS a 
- LEFT JOIN artikkel_forfattere AS af ON af.artikkel = a.id 
- LEFT JOIN forfattere AS f ON af.forfatter = f.id 
- GROUP BY a.id 
- ORDER BY a.publiseringsaar DESC, a.kategori ASC, a.registrert DESC"; 
- 
-if ($result = $mysqli->​query($query)) { 
- $dato = 99999; 
- $kategori = 0; 
- echo "<​!--";​ 
- /* fetch object array */ 
- while ($row = $result->​fetch_row()) { 
- if ($row[4] < $dato) { 
- $dato = $row[4]; 
- echo "</​ul><​!-- $dato --><​ul>";​ 
- echo "<​strong style='​font-size:​ 150%;'><​a name=\"​$dato\">​$dato</​a></​strong><​br>";​ 
- $kategori = 0; 
- } 
- if ($row[5] != $kategori) { 
- $kategori = $row[5]; 
- switch ($kategori) { 
- // Book chapter 
- case 1: 
- echo "</​ul>";​ 
- echo "<​em>​Book chapters:<​br></​em>";​ 
- echo "​\n<​ul>​\n\t";​ 
- #echo "​\n\t<​li class=\"​level1\"><​div class=\"​li\"><​strong>"​ . $row[10] . "</​strong>​ " . $row[6] . " <​i>"​ . $row[7] . "</​i>,​ " . $row[4] . "​.";​ 
-   echo "​\n\t<​li class=\"​level1\"><​div class=\"​li\"><​strong>​ "​.$row[10]."​ </​strong>​ "​.$row[6]."​ <i> "​.$row[7]."​ </i>, "​.$row[4]."​.<​br>​\n\t"​. 
- ($row[11] ?"​\tURL:​ <a target='​_blank'​ href='"​.$row[11]."'>"​.$row[11]."</​a>"​ :""​);​ 
- break; 
- // Journals 
- case 2: 
-   echo "</​ul>";​ 
-   echo "<​em>​Journals:<​br></​em>";​ 
-   echo "​\n<​ul>​\n\t";​ 
-   #echo "​\n\t<​li class=\"​level1\"><​div class=\"​li\"><​strong>"​ . $row[10] . "</​strong>​ " . $row[6] . " <​i>"​ . $row[7] . "</​i>,​ " . $row[4] . "​.";​ 
-   echo "​\n\t<​li class=\"​level1\"><​div class=\"​li\"><​strong>​ "​.$row[10]."​ </​strong>​ "​.$row[6]."​ <i> "​.$row[7]."​ </i>, "​.$row[4]."​.<​br>​\n\t"​. 
- ($row[11] ?"​\tURL:​ <a target='​_blank'​ href='"​.$row[11]."'>"​.$row[11]."</​a>"​ :""​);​ 
-   break; 
- case 3: 
-   echo "</​ul>";​ 
-   echo "<​em>​Conference papers: <​br></​em>";​ 
-   echo "​\n<​ul>​\n\t";​ 
-   #echo "​\n\t<​li class=\"​level1\"><​div class=\"​li\"><​strong>"​ . $row[10] . "</​strong>​ " . $row[6] . " <​i>"​ . $row[7] . "</​i>,​ " . $row[4] . "​.</​div>";​ 
-   echo "​\n\t<​li class=\"​level1\"><​div class=\"​li\"><​strong>​ "​.$row[10]."​ </​strong>​ "​.$row[6]."​ <i> "​.$row[7]."​ </i>, "​.$row[4]."​.<​br>​\n\t"​. 
- ($row[11] ?"​\tURL:​ <a target='​_blank'​ href='"​.$row[11]."'>"​.$row[11]."</​a>"​ :""​);​ 
-   break; 
- case 4: 
-   echo "</​ul>";​ 
-   echo "<​em>​Book:</​em>";​ 
-   echo "​\n<​ul>​\n\t";​ 
-   echo "​\n\t<​li class=\"​level1\"><​div class=\"​li\"><​strong>​ "​.$row[10]."​ </​strong>​ "​.$row[6]."​ <i> "​.$row[7]."​ </i>, "​.$row[4]."​.<​br>​\n\t"​. 
- ($row[11] ?"​\tURL:​ <a target='​_blank'​ href='"​.$row[11]."'>"​.$row[11]."</​a>"​ :""​);​ 
-   break; 
- case 5: 
-   echo "</​ul>";​ 
-   echo "<​em>​Patent:</​em>";​ 
-   echo "​\n<​ul>​\n\t";​ 
-   echo "​\n\t<​li class=\"​level1\"><​div class=\"​li\"><​strong>​ "​.$row[10]."​ </​strong>​ "​.$row[6]."​ <i> "​.$row[7]."​ </i>, "​.$row[4]."​.<​br>​\n\t"​. 
- ($row[11] ?"​\tURL:​ <a target='​_blank'​ href='"​.$row[11]."'>"​.$row[11]."</​a>"​ :""​);​ 
-   break; 
- case 6: 
-   echo "</​ul>";​ 
-   echo "<​em>​Technical report:</​em>";​ 
-   echo "​\n<​ul>​\n\t";​ 
-   echo "​\n\t<​li class=\"​level1\"><​div class=\"​li\"><​strong>​ "​.$row[10]."​ </​strong>​ "​.$row[6]."​ <i> "​.$row[7]."​ </i>, "​.$row[4]."​.<​br>​\n\t"​. 
- ($row[11] ?"​\tURL:​ <a target='​_blank'​ href='"​.$row[11]."'>"​.$row[11]."</​a>"​ :""​);​ 
-   break; 
- } 
-   } else { 
- echo "​\n\t<​li class=\"​level1\"><​div class=\"​li\"><​strong>​ "​.$row[10]."​ </​strong>​ "​.$row[6]."​ <i> "​.$row[7]."​ </i>, "​.$row[4]."​.<​br>​\n\t"​. 
- ($row[11] ?"​\tURL:​ <a target='​_blank'​ href='"​.$row[11]."'>"​.$row[11]."</​a>"​ :""​);​ 
- } 
- } 
- echo "<​!-- -->";​ 
- /* free result set */ 
- $result->​close();​ 
-} 
-/* close connection */ 
-$mysqli->​close();​ 
-?> 
-</​php>​ 



2016/10/05 10:09, aasmunst

Bottom banner