This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Zustz vom Ort trennen - Unter Zusatz läuft nur nicht Kartenmaterial | |
// Dieser Filter erlaubt nur folgende Patterns: | |
// Erlaubter Zusatz, Ortsname Ortszusatz (Strassen, Postleitzahl, Bekanntes Gebäude) | |
// Alles vor dem Zeichen wird mittels RegEx entfernt | |
$location = $_GET['location']; | |
$location = preg_replace('/([a-zA-Z0-9 ])*, /', '', $location); | |
?> | |
<br /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tabelle: datastore | |
id type sid name value | |
1 page 1 title Testseite | |
2 page 1 body Dies ist … | |
3 page 1 autor Martin | |
4 page 2 title Impressum | |
5 page 2 body Ansprech.. | |
6 page 2 autor Admin | |
7 comment 3 autor Gast | |
8 comment 3 mail mail@do… |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function loadmap() { | |
// config | |
imageX = 326; | |
imageY = 271; | |
iX = 0; | |
iY = 0; | |
// create new div's for each image px | |
// start with X | |
while(iX <= imageX) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// coords | |
$destX = 22; | |
$destY = 10; | |
$actX = 70; | |
$actY = 12; | |
// now go to destination | |
while(($actX < $destX || $actX > $destX) && ($actY < $destX || $actY > $destY)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// standard time - remember, time 1 second --> 1000 | |
var time = 2000; | |
// our function to load the map | |
function loadMap(newTime) { | |
if(newTime == 4000) { | |
time = 2000; | |
} | |
$("#r3").load('response.php'); | |
window.setTimeout("loadMap("+time+");", time); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// coords | |
$destX = 1; | |
$destY = 1; | |
$actX = 5; | |
$actY = 7; | |
// now go to destination | |
while(($actX <= $destX || $actX >= $destX) && ($actY <= $destX || $actY >= $destY)) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Slide between 3 tweets in 3 div's. | |
* | |
* @param int display The tweet to start | |
*/ | |
function tweetSlider(display) { | |
if(display == 0) { | |
// hide tweets | |
$('#tweet_1').hide(); | |
$('#tweet_2').hide(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_GET['id'])) { | |
$trackID = (int)$_GET['id']; | |
// get download url | |
$trackUrl = file_get_contents('http://www.jamendo.com/get/track/id/track/audio/plain/'.$trackID.'/?aue=ogg2'); | |
if($trackUrl == false) { | |
echo 'track id not availible!'; | |
} else { | |
// get track information | |
$trackTitle = (string)file_get_contents('http://www.jamendo.com/get/album/id/album/title/plain/'.$trackID.'/'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$numbers = str_split('101110111010'); | |
$result = 0; | |
foreach($numbers as $number) { | |
$result *= 2; | |
$result += $numbers[array_search($number, $numbers) + 1]; | |
} | |
echo $result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$number = 141; | |
$result = ''; | |
while($number != 0) { | |
$result .= $number % 2; | |
$number = floor($number / 2); | |
} | |
echo strrev($result); |
OlderNewer