cvs: presentations / uiuc.xml /slides/intro buzz.xml people1.xml people2.xml people3.xml people4.xml people5.xml people6.xml people7.xml people8.xml
php_yui2.xml php_yui3.xml php_yui4.xml php_yui5.xml sx.xml uiucref.xml

From: Date: Tue, 09 Oct 2007 21:15:38 +0000
Subject: cvs: presentations / uiuc.xml /slides/intro buzz.xml people1.xml people2.xml people3.xml people4.xml people5.xml people6.xml people7.xml people8.xml
php_yui2.xml php_yui3.xml php_yui4.xml php_yui5.xml sx.xml uiucref.xml
Groups: php.pres 
Request: Send a blank email to pres+get-1427@lists.php.net to get a copy of this message
rasmus Tue Oct 9 21:15:38 2007 UTC Added files: /presentations uiuc.xml /presentations/slides/intro buzz.xml people1.xml people2.xml people3.xml people4.xml people5.xml people6.xml people7.xml people8.xml sx.xml uiucref.xml Modified files: /presentations/slides/intro php_yui2.xml php_yui3.xml php_yui4.xml php_yui5.xml Log: UIUC talk

http://cvs.php.net/viewvc.cgi/presentations/slides/intro/php_yui2.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/intro/php_yui2.xml diff -u presentations/slides/intro/php_yui2.xml:1.2 presentations/slides/intro/php_yui2.xml:1.3 --- presentations/slides/intro/php_yui2.xml:1.2 Fri Sep 28 18:07:53 2007 +++ presentations/slides/intro/php_yui2.xml Tue Oct 9 21:15:38 2007 @@ -11,7 +11,7 @@ <script type="text/javascript"> var jsmap = new YMap('jsmapContainer'); jsmap.addZoomLong(); -jsmap.drawZoomAndCenter("Pittsburgh, PA", 7); +jsmap.drawZoomAndCenter(":-:location:-:", 5); </script>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/php_yui3.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/intro/php_yui3.xml diff -u presentations/slides/intro/php_yui3.xml:1.2 presentations/slides/intro/php_yui3.xml:1.3 --- presentations/slides/intro/php_yui3.xml:1.2 Fri Sep 28 18:07:53 2007 +++ presentations/slides/intro/php_yui3.xml Tue Oct 9 21:15:38 2007 @@ -12,7 +12,7 @@ var jsmap = new YMap('jsmapContainer'); jsmap.addZoomLong(); |jsmap.addTypeControl(); -jsmap.drawZoomAndCenter("Pittsburgh, PA", 7); +jsmap.drawZoomAndCenter(":-:location:-:", 5); </script>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/php_yui4.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/intro/php_yui4.xml diff -u presentations/slides/intro/php_yui4.xml:1.2 presentations/slides/intro/php_yui4.xml:1.3 --- presentations/slides/intro/php_yui4.xml:1.2 Fri Sep 28 18:07:53 2007 +++ presentations/slides/intro/php_yui4.xml Tue Oct 9 21:15:38 2007 @@ -22,7 +22,7 @@ var jsmap = new YMap('jsmapContainer'); jsmap.addZoomLong(); jsmap.addTypeControl(); -jsmap.drawZoomAndCenter("Pittsburgh, PA", 7); +jsmap.drawZoomAndCenter(":-:location:-:", 5); </script>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/php_yui5.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/intro/php_yui5.xml diff -u presentations/slides/intro/php_yui5.xml:1.2 presentations/slides/intro/php_yui5.xml:1.3 --- presentations/slides/intro/php_yui5.xml:1.2 Fri Sep 28 18:07:53 2007 +++ presentations/slides/intro/php_yui5.xml Tue Oct 9 21:15:38 2007 @@ -22,7 +22,7 @@ var jsmap = new YMap('jsmapContainer'); jsmap.addZoomLong(); jsmap.addTypeControl(); -jsmap.drawZoomAndCenter("Pittsburgh, PA", 7); +jsmap.drawZoomAndCenter(":-:location:-:", 5); |jsmap.addOverlay(new YGeoRSS('http://earthquake.usgs.gov/eqcenter/catalogs/eqs7day-M2.5.xml')); </script>]]></example> http://cvs.php.net/viewvc.cgi/presentations/uiuc.xml?view=markup&rev=1.1 Index: presentations/uiuc.xml +++ presentations/uiuc.xml <presentation template="php2" navmode="html" titlecolor="#1111aa" navbarbackground="url(images/trans-ffffff.png)" logo1="images/php-med-trans-light.gif" titlesize="2em" navbarheight="4.1em" > <topic>PHP</topic> <title>PHP/YUI</title> <subtitle>You got Javascript in my PHP! And...</subtitle> <location>Champaign, IL</location> <date>Oct 9, 2007</date> <speaker>Rasmus Lerdorf</speaker> <slide>slides/intro/titlepage.xml</slide> <slide>slides/intro/sx.xml</slide> <slide>slides/intro/rss_flickr.xml</slide> <slide>slides/intro/buzz.xml</slide> <slide>slides/intro/ws4.xml</slide> <slide>slides/intro/ws5.xml</slide> <slide>slides/intro/ws6.xml</slide> <slide>slides/intro/ws7.xml</slide> <slide>slides/intro/geoflickr.xml</slide> <slide>slides/intro/php_js1.xml</slide> <slide>slides/intro/php_js2.xml</slide> <slide>slides/intro/php_yui2.xml</slide> <slide>slides/intro/php_yui3.xml</slide> <slide>slides/intro/php_yui4.xml</slide> <slide>slides/intro/php_yui5.xml</slide> <slide>slides/intro/yajax.xml</slide> <slide>slides/intro/people1.xml</slide> <slide>slides/intro/people2.xml</slide> <slide>slides/intro/people3.xml</slide> <slide>slides/intro/people4.xml</slide> <slide>slides/intro/people5.xml</slide> <slide>slides/intro/people6.xml</slide> <slide>slides/intro/people7.xml</slide> <slide>slides/intro/people8.xml</slide> <slide>slides/intro/db_layer1.xml</slide> <slide>slides/intro/db_layer2.xml</slide> <slide>slides/intro/db_layer3.xml</slide> <slide>slides/intro/db_layer4.xml</slide> <slide>slides/intro/db_layer5.xml</slide> <slide>slides/intro/uiucref.xml</slide> </presentation> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/buzz.xml?view=markup&rev=1.1 Index: presentations/slides/intro/buzz.xml +++ presentations/slides/intro/buzz.xml <slide title="Buzz"> <example title="Take a pinch of RSS" result="1" fontsize="1.6em" rfontsize="1.2em" required_extension="simplexml"><![CDATA[<?php $url = 'http://buzz.yahoo.com/feeds/buzzoverl.xml'; $xml = @simplexml_load_file($url); if($xml) { foreach($xml->channel->item as $item) { $ret[(string)$item->title] = (string)$item->link; } echo "<pre>"; print_r($ret); echo "</pre>"; } else echo "Can't get to Yahoo!"; ?>]]></example> <example fontsize="1.6em" title="Add a spoonful of REST"><![CDATA[<?php $imgs='http://api.search.yahoo.com/ImageSearchService/V1/imageSearch'; $news='http://api.search.yahoo.com/NewsSearchService/V1/newsSearch'; foreach($ret as $key=>$link) { $url = $imgs . "?query=$key&appid=RESTDemo"; $obj = simplexml_load_file($url); ... $url = $news . "?query=$key&appid=RESTDemo"; $obj = simplexml_load_file($url); } ?>]]></example> <example type="shell" title="A thimble of gradeschool math">x^2/a^2 + y^2/b^2 = 1</example> <blurb>And we end up with something like this</blurb> <link align="center" fontsize="5em" href="http://buzz.progphp.com/">http://buzz.progphp.com</link> <blurb>By the way, throwing a cache layer between you and whatever remote service you are accessing tends to be a good idea. In our case we can do it like this:</blurb> <example fontsize="1.6em"><![CDATA[<?php $tmp = '/tmp/'.md5($q); if(!file_exists($tmp) || filemtime($tmp) < (time()-7200)) { $stream = fopen($url,'r'); $tmpf = tempnam('/tmp','YWS'); file_put_contents($tmpf, $stream); fclose($stream); rename($tmpf, $tmp); } $obj = simplexml_load_file($tmp); ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/people1.xml?view=markup&rev=1.1 Index: presentations/slides/intro/people1.xml +++ presentations/slides/intro/people1.xml <slide title="People Map"> <break lines="1" /> <blurb fontsize="6em"> Putting it all together in a full application. </blurb> <example title="Main page" result="0" marginright="1em" fontsize="1.5" type="xml"><![CDATA[<div style="margin: 20px 0px 0px 20px; float: left; width:900px; border: 3px solid black;"> <div id="jsmapContainer" style="top:0px; left:0px; width:900px; height:500px;"></div> <div style="padding: 0.5em; float: left;"> <form id="locF" onsubmit="return false"> <label for="loc">Location:<label> <input type="text" name="loc" id="loc" size="80"/> </form> <div id="status" style="display: inline;"></div> </div> <div id="buttonContainer" style="padding: 0.5em; float: right;"> <form> <input type="button" id="login" value="Login"></input> <input type="button" id="add" value="Add"></input> </form> </div> </div>]]></example> <example title="Login Dialog" result="0" marginright="1em" fontsize="1.5" type="xml"><![CDATA[<div id="loginUserDlg"> <div class="hd">Login</div> <div class="bd"> <form id="loginUserForm" method="POST" action="rpc.php"> <input type="hidden" id="action" name="action" value="login"></input> <label for="userid">User id:</label><input type="text" name="id" size="26"/> <label for="userpwd">Password:</label><input type="password" name="pwd" size="26"/> </form> </div> </div>]]></example> <example title="Add User Dialog" result="0" marginright="1em" fontsize="1.5" type="xml"><![CDATA[<div id="addUserDlg"> <div class="hd">New Marker Data</div> <div class="bd"> <form id="addUserForm" method="POST" action="rpc.php"> <!-- TabView ---> <div id="tabContainer" class="yui-navset"> <ul class="yui-nav"> <li class="selected"><a href="#addTab"><em>Add</em></a></li> <li><a href="#langTab"><em>Language</em></a></li> <li><a href="#latLongTab"><em>Lat &amp; Long</em></a></li> </ul> <div class="yui-content"> <div id="addTab"> <input type="hidden" name="action" value="add" /> <label for="name">Name:</label> <input type="text" name="name" size="36" /> <label for="cvs_id">User id:</label> <input type="text" name="cvs_id" size="36"/> <label for="email">E-mail:</label> <input type="text" name="email" size="36"/> <label for="group">Group:</label> <input type="checkbox" name="group[]" value="core"> Core </input> <input type="checkbox" name="group[]" value="doc"> Doc </input> <input type="checkbox" name="group[]" value="qa"> QA </input> </div> <div id="langTab"> <label for="langSearch">Language:</label> <input type="input" id="langSearch" name="langSearch" autocomplete="off" size="36"/> <div id="langResults"></div> </div> <div id="latLongTab"> <p>Center the map on your location to get your lat/lon.</p> <label for="latitude">Latitude:</label> <input type="text" name="latitude" id="latitude" size="36"/> <label for="location">Longitude:</label> <input type="text" name="longitude" id="longitude" size="36"/> </div> </div> </div> <!-- End TabView ---> </form> </div> </div>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/people2.xml?view=markup&rev=1.1 Index: presentations/slides/intro/people2.xml +++ presentations/slides/intro/people2.xml <slide title="People Map"> <break lines="1" /> <blurb fontsize="6em"> Javascript to render map and center pin </blurb> <example result="0" marginright="1em" fontsize="1.5" type="javascript"><![CDATA[ YAHOO.people.container.jsmap = new YMap(document.getElementById('jsmapContainer')); YAHOO.people.container.jsmap.setMapType(YAHOO_MAP_REG); YAHOO.people.container.jsmap.addZoomLong(); YAHOO.people.container.jsmap.addTypeControl(); YAHOO.people.container.jsmap.removeZoomScale(); YAHOO.people.container.jsmap.drawZoomAndCenter("Libya",16); var container_size = YAHOO.people.container.jsmap.getContainerSize(); map_center = new YCoordPoint(container_size.width/2, container_size.height/2-17); var cross = YUtility.createNode('img','cross'); cross.src = 'http://www.lerdorf.com/black_pin.png'; cross.height = 19; cross.width= 23; center_marker = new YCustomOverlay(map_center, cross); YAHOO.people.container.jsmap.addOverlay(center_marker);]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/people3.xml?view=markup&rev=1.1 Index: presentations/slides/intro/people3.xml +++ presentations/slides/intro/people3.xml <slide title="People Map"> <break lines="1" /> <blurb fontsize="6em"> Create and render the dialogs </blurb> <example result="0" marginright="1em" fontsize="1.5" type="javascript"><![CDATA[ YAHOO.people.container.addUser = new YAHOO.widget.Dialog("addUserDlg", { width : "290px", context: ["buttonContainer", "br", "br"], draggable: true, visible : false, buttons : [ { text:"Submit", handler:handleSubmit, isDefault:true }, { text:"Cancel", handler:handleCancel } ] }); YAHOO.people.container.addUser.render(); YAHOO.people.container.loginUser = new YAHOO.widget.Dialog("loginUserDlg", { width : "210px", context: ["buttonContainer", "br", "br"], draggable: true, visible : false, buttons : [ { text:"Login", handler:handleSubmit, isDefault:true }, { text:"Cancel", handler:handleCancel } ] }); YAHOO.people.container.loginUser.render(); ]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/people4.xml?view=markup&rev=1.1 Index: presentations/slides/intro/people4.xml +++ presentations/slides/intro/people4.xml <slide title="People Map"> <break lines="1" /> <blurb fontsize="6em"> Implement fancy fading tab views </blurb> <example result="0" marginright="1em" fontsize="1.5" type="javascript"><![CDATA[ var tabView = new YAHOO.widget.TabView('tabContainer'); tabView.contentTransition = function(newTab, oldTab) { if ( newTab.anim && newTab.anim.isAnimated() ) { newTab.anim.stop(true); } newTab.set('contentVisible', true); YAHOO.util.Dom.setStyle(newTab.get('contentEl'), 'opacity', 0); newTab.anim = newTab.anim || new YAHOO.util.Anim( newTab.get('contentEl') ); newTab.anim.attributes.opacity = { to: 1 }; var hideContent = function() { oldTab.set('contentVisible', false); oldTab.anim.onComplete.unsubscribe(hideContent); }; oldTab.anim = oldTab.anim || new YAHOO.util.Anim( oldTab.get('contentEl') ); oldTab.anim.onComplete.subscribe(hideContent, this, true); oldTab.anim.attributes.opacity = { to: 0 }; newTab.anim.animate(); oldTab.anim.animate(); }; ]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/people5.xml?view=markup&rev=1.1 Index: presentations/slides/intro/people5.xml +++ presentations/slides/intro/people5.xml <slide title="People Map"> <break lines="1" /> <blurb fontsize="6em"> Dealing with the markers </blurb> <example result="0" marginright="1em" fontsize="1.5" type="javascript"><![CDATA[ var createMarker = function(m) { var colors = { none: 'grey', core: 'orange', doc: 'green', qa: 'red' } var geoPoint = new YGeoPoint(m.lat,m.lon); var col = m.groups.split(', ')[0]; if(!col.length) col = 'none'; var newMarker= new YMarker(geoPoint, myMarkerImage(colors[col])); newMarker.addAutoExpand(m.name); var blurb = "<b><font size=+1>"+m.name+"</font></b><br>" + "<b>id:</b> "+m.cvs_id+"<br>" + "<b>email:</b> "+m.email+"<br>" + "<b>language:</b> "+m.language+"<br>" + "<b>groups:</b> "+m.groups; YEvent.Capture(newMarker, EventsList.MouseClick, function(){ newMarker.openSmartWindow(blurb); }); YAHOO.people.container.jsmap.addOverlay(newMarker); }; var handleMarkers = function(o) { var resp = eval('(' + o.responseText + ')'); if(resp['people']) { for(var i in resp['people']) { createMarker(resp['people'][i]); } } }; ]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/people6.xml?view=markup&rev=1.1 Index: presentations/slides/intro/people6.xml +++ presentations/slides/intro/people6.xml <slide title="People Map"> <break lines="1" /> <blurb fontsize="6em"> Events and initial start up </blurb> <example result="0" marginright="1em" fontsize="1.5" type="javascript"><![CDATA[var updateLatLon = function() { var ll = YAHOO.people.container.jsmap.getCenterLatLon(); document.getElementById('latitude').value = ll['Lat']; document.getElementById('longitude').value = ll['Lon']; }; var updateMap = function() { var loc = document.getElementById('loc').value; YAHOO.people.container.jsmap.drawZoomAndCenter(loc,7); return false; }; var callback = { success:handleMarkers } YAHOO.util.Connect.asyncRequest('GET','http://www.lerdorf.com/people/rpc.php?action=markers', callback); YEvent.Capture(YAHOO.people.container.jsmap, EventsList.endPan, updateLatLon); YEvent.Capture(YAHOO.people.container.jsmap, EventsList.endAutoPan, updateLatLon); YEvent.Capture(YAHOO.people.container.jsmap, EventsList.endMapDraw, updateLatLon); YAHOO.util.Event.addListener("addButton", "click", YAHOO.people.container.addUser.show, YAHOO.people.container.addUser, true); YAHOO.util.Event.addListener("loginButton", "click", YAHOO.people.container.loginUser.show, YAHOO.people.container.loginUser, true); YAHOO.util.Event.addListener("locF", "submit", updateMap); ]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/people7.xml?view=markup&rev=1.1 Index: presentations/slides/intro/people7.xml +++ presentations/slides/intro/people7.xml <slide title="People Map"> <break lines="1" /> <blurb fontsize="6em"> Server-side rpc.php </blurb> <example result="0" marginright="1em" fontsize="1.5" type="php"><![CDATA[<?php include './db.inc'; include './db_people.inc'; include './db_languages.inc'; $people = new people; $action = $_REQUEST['action']; switch($action) { case 'markers': header("Content-type: application/json"); $all = $people->load(); echo json_encode(array('people'=>$all)); break; case 'lang': header("Content-type: text/javascript"); $languages = new languages; $found = $languages->search($q); foreach($found as $v) echo $v['name'].","; break; } ?> ]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/people8.xml?view=markup&rev=1.1 Index: presentations/slides/intro/people8.xml +++ presentations/slides/intro/people8.xml <slide title="People Map"> <break lines="1" /> <blurb fontsize="6em"> Implement autocomplete </blurb> <example result="0" marginright="1em" fontsize="1.5" type="javascript"><![CDATA[var oDS = new YAHOO.widget.DS_XHR("http://www.lerdorf.com/people/rpc.php", [","]); oDS.responseType = YAHOO.widget.DS_XHR.TYPE_FLAT; oDS.scriptQueryParam = "q"; oDS.scriptQueryAppend = "action=lang"; var langAutoComp = new YAHOO.widget.AutoComplete("langSearch","langResults", oDS); langAutoComp.animVert = true; langAutoComp.animSpeed = 0.2;]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/sx.xml?view=markup&rev=1.1 Index: presentations/slides/intro/sx.xml +++ presentations/slides/intro/sx.xml <slide title="Simple XML"> <example title="Book XML File"><![CDATA[<books> <book> <title>The Grapes of Wrath</title> <author>John Steinbeck</author> </book> <book> <title>The Pearl</title> <author>John Steinbeck</author> </book> </books>]]></example> <example title="Book PHP File" result="1"><![CDATA[<?php $books = simplexml_load_file('presentations/slides/intro/book.xml'); foreach ($books->book as $book) { echo "{$book->title} was written by {$book->author}<br>\n"; } ?>]]></example> </slide> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/uiucref.xml?view=markup&rev=1.1 Index: presentations/slides/intro/uiucref.xml +++ presentations/slides/intro/uiucref.xml <slide title="Resources"> <break lines="6"/> <link fontsize="3em" marginleft="3em" leader="Slides: " href=":-:url:-:"/> <link fontsize="3em" marginleft="3em" leader="Hack Day: " href="http://developer.yahoo.net/hacku/"/> <link fontsize="3em" marginleft="3em" leader="YDN: " href="http://developer.yahoo.net/"/> <link fontsize="3em" marginleft="3em" leader="Example App: " href="http://lerdorf.com/people/"/> </slide>
« previous php.pres (#1427) next »