Change <? to <?php and add some formatting

This commit is contained in:
2016-11-17 22:16:26 +01:00
parent 2d5ba7fb8d
commit fb71f8c112
27 changed files with 270 additions and 296 deletions

View File

@@ -1,5 +1,6 @@
<?php
class blogs extends Module {
class blogs extends Module
{
protected $moduleTitle = 'Blogs BD';
protected $paramsList = array(
'visibility',

View File

@@ -1,4 +1,4 @@
<?
<?php
$url = $_POST['newLink'];
if($url == '' || !isset($_POST['newLink']))
header('Location: index.php');
@@ -18,7 +18,7 @@ header('Location: index.php');
$(document).ready(function(){
$('.choose').click(function(){
var id = $(this).attr('id');
var url = "<?=$url?>";
var url = "<?php echo $url; ?>";
var name = 'test';
$.post('addSiteXML.php', {number: id, url: url, name: name}, function(data){
document.location.href="index.php"
@@ -30,7 +30,7 @@ $('.choose').click(function(){
</head>
<body>
<?
<?php
echo 'URL : '.$url.'<br/>';
require('blogs_last_post.php');
$opts = array(CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_TIMEOUT => 10);

View File

@@ -1,4 +1,4 @@
<?
<?php
require('blogs_last_post.php');
$opts = array(CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_TIMEOUT => 10, CURLOPT_CONNECTTIMEOUT => 10);
$blogs = new Blogs_last_post();

View File

@@ -1,4 +1,4 @@
<?
<?php
require('CURL.php');
class Blogs_last_post extends CURL{
@@ -30,14 +30,14 @@ function getResult()
}
public function getLinks(){
if($linksXML = simplexml_load_file('../db/blog_links.xml')){
if($linksXML = @simplexml_load_file('../db/blog_links.xml')){
foreach($linksXML->link as $individualLink){
$this->link[] = array('name'=>$individualLink->name, 'url'=>$individualLink->url, 'number'=>$individualLink->number);
}
return $this->link;
}
else
return;
return [];
}
function getTitles()
@@ -70,7 +70,7 @@ function getTitle($result = null, $url = null)
if(isset($title[1]))
return $title[1];
else
return 'Erreur : pas de titre de blog trouv<75>.';
return 'Erreur : pas de titre de blog trouv<75>.';
}
}

View File

@@ -1,5 +1,6 @@
<?php
class clockAdvanced extends Module {
class clockAdvanced extends Module
{
protected $moduleTitle = 'Horloge Avancée';
protected $paramsList = array(
'visibility',
@@ -20,7 +21,7 @@ class clockAdvanced extends Module {
<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
echo '<div class="jclockAdvanced" id="clockAdvanced" style="left:'.$this->getParam('x').'; top:'.$this->getParam('y').';"></div>';
$options = '';
foreach (self::$paramsList as $paramName){
foreach ($this->paramsList as $paramName){
if($this->getParam($paramName) != null)
$options .= $paramName.' : "'.$this->getParam($paramName).'",';
}

View File

@@ -1,4 +1,4 @@
<?
<?php
$reserve = $_POST['reserve'];
$doc = new DOMDocument;

View File

@@ -1,4 +1,4 @@
<?
<?php
if($links_xml = simplexml_load_file("../db/links.xml")){
$links = $links_xml->reserve;
foreach($links as $label){

View File

@@ -1,4 +1,4 @@
<?
<?php
$reserve = $_POST['reserve'];
$doc = new DOMDocument;

View File

@@ -1,4 +1,4 @@
<?
<?php
$label = $_POST['label'];
$order = $_POST['order'];
$itemMoved = $_POST['itemMoved'];

View File

@@ -1,20 +1,24 @@
<?php
class news extends Module{
protected $moduleTitle = 'Google News';
protected $paramsList = array(
'visibility',
'x',
'y'
);
public function __construct($params){
parent::__construct(__CLASS__, $params);
}
public function build(){
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css" type="text/css" />';
echo '<script type="text/javascript" src="http://www.google.com/jsapi"></script>
class news extends Module
{
protected $moduleTitle = 'Google News';
protected $paramsList = array(
'visibility',
'x',
'y'
);
public function __construct($params)
{
parent::__construct(__CLASS__, $params);
}
public function build()
{
echo '<script type="text/javascript" src="' . $this->pathToModule . 'js/' . $this->moduleName . '.js"></script>
<link rel="stylesheet" href="' . $this->pathToModule . 'css/' . $this->moduleName . '.css" type="text/css" />';
echo '<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<div id="news" style="top:' . $this->getParam('y') . '; left: ' . $this->getParam('x') . ';"></div>
<script type="text/javascript">
google.load("elements", "1", {packages : ["newsshow"]});
@@ -33,5 +37,5 @@ class news extends Module{
google.setOnLoadCallback(onLoad);
</script>';
}
}
}

View File

@@ -1,4 +1,4 @@
<?// Escaping the input data:
<?php // Escaping the input data:
$rid = $_POST['id'];
$explodeid = explode("-",$rid);
@@ -22,4 +22,3 @@ $xmla->asXML('../db/notes.xml');
$target++;
echo $target;
?>

View File

@@ -1,4 +1,5 @@
<?// Escaping the input data:
<?php
// Escaping the input data:
$body = $_POST['body'];
$color = $_POST['color'];
@@ -26,4 +27,3 @@ $newnote->addChild('left', '0');
$xmla->asXML('../db/notes.xml');
echo $nb;
?>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Notes>
<note id="2"><text>Test de post-it.</text><color>green</color><zindex>1</zindex><top>153</top><left>53</left></note><note id="7"><text>/!\ C'est bien fait ? :)</text><color>yellow</color><zindex>1</zindex><top>85</top><left>1038</left></note><note id="10"><text>Des améliorations ?</text><color>yellow</color><zindex>1</zindex><top>264</top><left>1038</left></note></Notes>
<?xml version="1.0" encoding="utf-8"?>
<Notes>
<note id="2"><text>Test de post-it.</text><color>green</color><zindex>1</zindex><top>153</top><left>53</left></note><note id="7"><text>/!\ C'est bien fait ? :)</text><color>yellow</color><zindex>1</zindex><top>68</top><left>252</left></note><note id="10"><text>Des améliorations ?</text><color>yellow</color><zindex>2</zindex><top>264</top><left>247</left></note></Notes>

View File

@@ -1,8 +1,6 @@
<?php $nb = 0;
$notes = simplexml_load_file('modules/notes/db/notes.xml');
foreach($notes as $test){$nb++;}
for($i=0; $i<$nb; $i++){?>
<div class="note <?echo $notes->note[$i]->color;?>" style="position:absolute; left:<? echo $notes->note[$i]->left;?>; top:<? echo $notes->note[$i]->top;?>;z-index:<? echo $notes->note[$i]->zindex;?>;"><div class="delete" id="r-<?echo $notes->note[$i]['id'];?>"></div><? echo $notes->note[$i]->text;?><br/><span class="data"><?echo $notes->note[$i]['id'];?></span></div>
<?}?>
for($i=0; $i<$nb; $i++){ ?>
<div class="note <?php echo $notes->note[$i]->color;?>" style="position:absolute; left:<?php echo $notes->note[$i]->left;?>; top:<?php echo $notes->note[$i]->top;?>;z-index:<?php echo $notes->note[$i]->zindex;?>;"><div class="delete" id="r-<?php echo $notes->note[$i]['id'];?>"></div><?php echo $notes->note[$i]->text;?><br/><span class="data"><?php echo $notes->note[$i]['id'];?></span></div>
<?php }

View File

@@ -1,21 +1 @@
<?
$xmla = simplexml_load_file('../db/todoist.xml');
if(isset($_POST['token'])){
$token = trim($_POST['token']);
$xmla->addChild("token", $token);
$xmla->asXML('../db/todoist.xml');
echo "ok";
}else if(isset($_POST['name']) && isset($_POST['id'])){
<?php

View File

@@ -1,3 +1 @@
<?
$xmla = simplexml_load_file('../db/todoist.xml');
if($xmla->token== '' || $xmla->token == null)
<?php

View File

@@ -1,12 +1 @@
<?
$xmla = simplexml_load_file('../db/todoist.xml');
if($xmla->token== '' || $xmla->token == null)
header('Location: install-todoist.php');
if($xmla->id != '' || $xmla->id != null):
$token = $xmla->token;
<?php

View File

@@ -1,4 +1,4 @@
<?
<?php
$xmla = simplexml_load_file('../db/todoist.xml');
if($xmla->token == '' || $xmla->token == null):?>
<html>
@@ -18,7 +18,7 @@ if($xmla->token == '' || $xmla->token == null):?>
</fieldset>
</body>
</html>
<?
<?php
else:
header('Location: getProjectsList.php');
endif;

View File

@@ -1,6 +1 @@
<?header('Content-type: application/javascript');
$token = $_GET['token'];
?>
<?header('Content-type: application/javascript');

View File

@@ -1,9 +1 @@
<?header('Content-type: application/javascript');
$token = $_GET['token'];
$id = $_GET['id'];
?>
function cbfunc(o){
$('#results').append('<ul id="uncompletedList"><ul>');
for(var i in o)
{
<?header('Content-type: application/javascript');

View File

@@ -1,5 +1,7 @@
<?php
class weather extends Module {
class weather extends Module
{
protected $moduleTitle = 'Météo';
@@ -16,15 +18,17 @@ class weather extends Module {
public function build(){
$ville = $this->getParam('city');
$future_weather = [];
include $this->pathToModule.'includes/GoogleMeteo.php';
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
if (!empty($present_weather)) {
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css">';
echo '<div id="weather" style="left:'.$this->getParam("x").'; top:'.$this->getParam("y").';">
'.$city.'<br/>
echo '<div id="weather" style="left:'.$this->getParam("x").'; top:'.$this->getParam("y").';">
'.$ville.'<br/>
<div class="weatherpic"></div>
<strong>'.$present_weather.'</strong><br/>
'.$future_weather1.'<br/>
'.$future_weather2.'
</div>';
'.implode('<br/>', $future_weather).'
</div>';
}
}
}

View File

@@ -1,38 +1,45 @@
<?php
require('class/GoogleWeather.class.php');
//ça récupère un truc du style : http://www.google.com/ig/api?weather=paris&hl=fr
if($ville != '' || $ville != null){
$gweather = new GoogleWeatherAPI($ville,'fr');
if($gweather->isFound()) {
$city = $gweather->getCity();
$currentTemp = $gweather->getCurrent();
$forecastTemp = $gweather->getForecast();
$present_weather = 'Actuellement : '.$currentTemp['temp_c'].'°C - '.$currentTemp['condition'];
$i=0;
foreach($forecastTemp as $temp) {
${'future_weather'.$i} = $temp['day_of_week'].' : '.$temp['low'].'°C | '.$temp['high'].'°C - '.$temp['condition'];
$i++;
}
require('class/GoogleWeather.class.php');
$present_weather = null;
//ça récupère un truc du style : http://www.google.com/ig/api?weather=paris&hl=fr
if ( !empty($ville) ) {
$google_weather = new GoogleWeatherAPI($ville, 'fr');
if(strpos(strtolower($present_weather),"soleil") !== false) {?>
<link rel="stylesheet" type="text/css" href="modules/weather/css/soleil.css">
<?}
if(strpos(strtolower($present_weather),"nuage") !== false) {?>
<link rel="stylesheet" type="text/css" href="modules/weather/css/nuage.css">
<?}
if(strpos(strtolower($present_weather),"peu nuageux") !== false) {?>
<link rel="stylesheet" type="text/css" href="modules/weather/css/peunuage.css">
<?}
if((strpos(strtolower($present_weather),"pluie") !== false) || (strpos(strtolower($present_weather),"averse") !== false)) {?>
<link rel="stylesheet" type="text/css" href="modules/weather/css/pluie.css">
<?}
if(strpos(strtolower($present_weather),"neige") !== false) {?>
<link rel="stylesheet" type="text/css" href="modules/weather/css/neige.css">
<?}
}else{ $present_weather = 'Ville non trouvé : '.$city; }
}else
$present_weather = 'Ville non renseignée';
if ($google_weather->isFound()) {
$city = $google_weather->getCity();
$currentTemp = $google_weather->getCurrent();
$forecastTemp = $google_weather->getForecast();
$present_weather = 'Actuellement : ' . $currentTemp['temp_c'] . '°C - ' . $currentTemp['condition'];
$future_weather = [];
foreach ($forecastTemp as $temp) {
$future_weather[] = $temp['day_of_week'] . ' : ' . $temp['low'] . '°C | ' . $temp['high'] . '°C - ' . $temp['condition'];
}
if (strpos(strtolower($present_weather), "soleil") !== false) { ?>
<link rel="stylesheet" type="text/css" href="modules/weather/css/soleil.css">
<?php
}
if (strpos(strtolower($present_weather), "nuage") !== false) { ?>
<link rel="stylesheet" type="text/css" href="modules/weather/css/nuage.css">
<?php
}
if (strpos(strtolower($present_weather), "peu nuageux") !== false) { ?>
<link rel="stylesheet" type="text/css" href="modules/weather/css/peunuage.css">
<?php
}
if ((strpos(strtolower($present_weather), "pluie") !== false) || (strpos(strtolower($present_weather), "averse") !== false)) { ?>
<link rel="stylesheet" type="text/css" href="modules/weather/css/pluie.css">
<?php
}
if (strpos(strtolower($present_weather), "neige") !== false) { ?>
<link rel="stylesheet" type="text/css" href="modules/weather/css/neige.css">
<?php
}
} else {
$present_weather = 'Ville non trouvé : ' . $ville;
}
} else {
$present_weather = 'Ville non renseignée';
}