diff --git a/INITBASE/loader.py b/INITBASE/loader.py index f50f1c3..ff04d57 100755 --- a/INITBASE/loader.py +++ b/INITBASE/loader.py @@ -3,7 +3,14 @@ import xml.etree.ElementTree as ET import MySQLdb as mdb import sys import re -import os +import httplib + +def exists(site, path): + c = httplib.HTTPConnection(site) + c.request('HEAD', path) + response = c.getresponse() + c.close() + return response.status == 200 def insert (cur, table, dict) : keys = "" @@ -101,8 +108,7 @@ try : image = child.text.encode('utf-8') # On s'interesee qu'aux oeuvres ayant une image - response = os.system("ping -c 1 " + "http://www.augustins.org/documents/10180/156407/"+image) - if image != "NULL" and response == 0 : + if image != "NULL" and exists('www.augustins.org','/documents/10180/156407/'+image): if str(datation)+str(datation2) in listeDatation : iddatation = listeDatation[str(datation)+str(datation2)] else : diff --git a/SRC/app/Http/Controllers/AdminController.php b/SRC/app/Http/Controllers/AdminController.php index 392ddb8..9ffc242 100755 --- a/SRC/app/Http/Controllers/AdminController.php +++ b/SRC/app/Http/Controllers/AdminController.php @@ -39,7 +39,6 @@ class AdminController extends Controller { public function addUser() { $user = new Referent; - $user->nom = Input::get('nom'); $user->email = Input::get('email'); $user->etablissement = Input::get('etablissement'); diff --git a/SRC/resources/views/frontend/puzzle.blade.php b/SRC/resources/views/frontend/puzzle.blade.php index e0f502d..cd45042 100755 --- a/SRC/resources/views/frontend/puzzle.blade.php +++ b/SRC/resources/views/frontend/puzzle.blade.php @@ -18,7 +18,9 @@ } function preload () { game.load.spritesheet('balls', '{{ URL::to('imgs/puzzle/balls.png') }}', 17, 17); - game.load.image('trophee', '{{ URL::to('imgs/trophees/or.png') }}'); + game.load.image('trophee3', '{{ URL::to('imgs/trophees/or.png') }}'); + game.load.image('trophee2', '{{ URL::to('imgs/trophees/argent.png') }}'); + game.load.image('trophee1', '{{ URL::to('imgs/trophees/bronze.png') }}'); for(i=1; i<=selection.length; i++) { game.load.spritesheet("tableau"+i, selection[i-1].src, selection[i-1].width/dimensions[0], selection[i-1].height/dimensions[1]); @@ -213,7 +215,7 @@ var ratioImage = 0.8; var dimensions = [{{$dimension}}, {{$dimension}}]; var nbToPlay = {{$nbTab}}; - + var trophy = {{ $niveau }}; var images = []; @foreach ($oeuvres as $i => $oeuvre) images.push("http://www.augustins.org/documents/10180/156407/{{ $oeuvre -> image}}");