Creation of the world
This commit is contained in:
25
ajax/addSiteXML.php
Normal file
25
ajax/addSiteXML.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?
|
||||
$number = $_POST['number'];
|
||||
$url = $_POST['url'];
|
||||
$name = $_POST['name'];
|
||||
|
||||
$nb = 1;
|
||||
|
||||
$xmla = simplexml_load_file('../db/blog_links.xml');
|
||||
|
||||
$test = $xmla->note;
|
||||
|
||||
$field_count = count($test);
|
||||
|
||||
for($i=0;$i<$field_count;$i++){
|
||||
if($nb <= $test[$i]['id']) $nb = $test[$i]['id']+1;
|
||||
}
|
||||
|
||||
$newnote = $xmla->addChild('link');
|
||||
$newnote->addChild('name', $name);
|
||||
$newnote->addChild('number', $number);
|
||||
$newnote->addChild('url', $url);
|
||||
$xmla->asXML('../db/blog_links.xml');
|
||||
|
||||
echo $nb;
|
||||
?>
|
25
ajax/delete-notes.php
Normal file
25
ajax/delete-notes.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?// Escaping the input data:
|
||||
|
||||
$rid = $_POST['id'];
|
||||
$explodeid = explode("-",$rid);
|
||||
$id = intval($explodeid[1]);
|
||||
|
||||
|
||||
$xmla = simplexml_load_file('../db/notes.xml');
|
||||
|
||||
$target = false;
|
||||
$i = 0;
|
||||
|
||||
foreach ($xmla->note as $s) {
|
||||
if ($s['id']==$id) { $target = $i; break; }
|
||||
$i++;
|
||||
}
|
||||
if ($target !== false) {
|
||||
unset($xmla->note[$target]);
|
||||
}
|
||||
|
||||
$xmla->asXML('../db/notes.xml');
|
||||
|
||||
$target++;
|
||||
echo $target;
|
||||
?>
|
21
ajax/post-config.php
Normal file
21
ajax/post-config.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?// Escaping the input data:
|
||||
|
||||
$clock = $_POST['clock'];
|
||||
$meteo = $_POST['meteo'];
|
||||
$notes = $_POST['notes'];
|
||||
$search = $_POST['search'];
|
||||
$links = $_POST['links'];
|
||||
$blogs = $_POST['blogs'];
|
||||
|
||||
$xmla = simplexml_load_file('../db/config.xml');
|
||||
$config_xml = $xmla->item;
|
||||
$config_xml[0]->visibility = $clock;
|
||||
$config_xml[1]->visibility = $meteo;
|
||||
$config_xml[2]->visibility = $notes;
|
||||
$config_xml[3]->visibility = $search;
|
||||
$config_xml[4]->visibility = $links;
|
||||
$config_xml[5]->visibility = $blogs;
|
||||
$xmla->asXML('../db/config.xml');
|
||||
|
||||
echo "1";
|
||||
?>
|
29
ajax/post-notes.php
Normal file
29
ajax/post-notes.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?// Escaping the input data:
|
||||
|
||||
$body = $_POST['body'];
|
||||
$color = $_POST['color'];
|
||||
$zindex = $_POST['zindex'];
|
||||
$nb = 1;
|
||||
|
||||
$xmla = simplexml_load_file('../db/notes.xml');
|
||||
$field_count = count($xmla->note);
|
||||
/*foreach($xmla->note as $test){
|
||||
if($nb < $test['id']){$nb=$test['id'];}
|
||||
}*/
|
||||
|
||||
$test = $xmla->note;
|
||||
for($i=0;$i<$field_count;$i++){
|
||||
if($nb <= $test[$i]['id']) $nb = $test[$i]['id']+1;
|
||||
}
|
||||
|
||||
$newnote = $xmla->addChild('note');
|
||||
$newnote->addAttribute("id", $nb);
|
||||
$newnote->addChild('text', $body);
|
||||
$newnote->addChild('color', $color);
|
||||
$newnote->addChild('zindex', $zindex);
|
||||
$newnote->addChild('top', '0');
|
||||
$newnote->addChild('left', '0');
|
||||
$xmla->asXML('../db/notes.xml');
|
||||
|
||||
echo $nb;
|
||||
?>
|
21
ajax/saveTodoist.php
Normal file
21
ajax/saveTodoist.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?
|
||||
|
||||
$xmla = simplexml_load_file('../db/todoist.xml');
|
||||
|
||||
if(isset($_GET['token'])){
|
||||
|
||||
$token = trim($_GET['token']);
|
||||
|
||||
|
||||
|
||||
$xmla->addChild("token", $token);
|
||||
|
||||
|
||||
|
||||
$xmla->asXML('../db/todoist.xml');
|
||||
|
||||
|
||||
|
||||
echo $token;
|
||||
|
||||
}else if(isset($_GET['name']) && isset($_GET['id'])){
|
22
ajax/update_position.php
Normal file
22
ajax/update_position.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
// Error reporting
|
||||
error_reporting(E_ALL^E_NOTICE);
|
||||
|
||||
// Validating the input data:
|
||||
if(!is_numeric($_GET['id']) || !is_numeric($_GET['x']) || !is_numeric($_GET['y']) || !is_numeric($_GET['z']))
|
||||
die("0");
|
||||
|
||||
// Escaping:
|
||||
$id = (int)$_GET['id'];
|
||||
$x = (int)$_GET['x'];
|
||||
$y = (int)$_GET['y'];
|
||||
$z = (int)$_GET['z'];
|
||||
|
||||
|
||||
// Saving the position and z-index of the note:
|
||||
$xmla = simplexml_load_file('../db/notes.xml');
|
||||
|
||||
$target = -1;
|
||||
$i = 0;
|
||||
|
||||
foreach ($xmla->note as $s) {
|
27
ajax/update_position_config.php
Normal file
27
ajax/update_position_config.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// Error reporting
|
||||
error_reporting(E_ALL^E_NOTICE);
|
||||
|
||||
// Validating the input data:
|
||||
if(!is_numeric($_GET['x']) || !is_numeric($_GET['y']))
|
||||
die("0");
|
||||
|
||||
// Escaping:
|
||||
$id = $_GET['id'];
|
||||
$x = (int)$_GET['x'];
|
||||
$y = (int)$_GET['y'];
|
||||
|
||||
|
||||
// Saving the position and z-index of the note:
|
||||
$xmla = simplexml_load_file('../db/config.xml');
|
||||
|
||||
/*if($id == "weather"){
|
||||
$xmla->item[1]->y = $y;
|
||||
$xmla->item[1]->x = $x;
|
||||
$target = 1;
|
||||
echo $id;
|
||||
}*/
|
||||
$target = -1;
|
||||
$i = 0;
|
||||
|
||||
foreach ($xmla->item as $s) {
|
Reference in New Issue
Block a user