Permalink
Browse files

Add bing as a search engine option. Search engine placement is random…

… on each page load. Add randomization of the order of platinum supporter logos as in years past. Closes #120.
  • Loading branch information...
1 parent ab3ec66 commit 59653dfc89aad949b139c6c3b7f628759d717b85 @mikehelmick committed Jan 28, 2012
Showing with 131 additions and 41 deletions.
  1. +1 −1 authors/index.php
  2. +59 −0 bing.php
  3. +8 −0 css/master.css
  4. +3 −9 exhibitors/index.php
  5. +3 −9 index.php
  6. +11 −0 parts/bing_search.php
  7. +3 −0 parts/google.php
  8. +20 −0 parts/google_search.php
  9. +3 −0 parts/intel.php
  10. +8 −20 parts/menu.php
  11. +3 −0 parts/microsoft.php
  12. +7 −0 parts/platinum.php
  13. +2 −2 search.php
View
@@ -1,5 +1,5 @@
<?php
- $title = "SIGCSE 2012 - Home";
+ $title = "SIGCSE 2012 - Call For Participation";
$onload = "pageLoad('authors', 'cfp');";
include("../parts/top.php");
?>
View
@@ -0,0 +1,59 @@
+<?php
+ $title = "SIGCSE 2012 - Search Results";
+ $onload = "pageLoad(null, null);";
+ include("parts/top.php");
+?>
+<div class="SectionHeader"><div class="Full">
+<h2>SIGCSE 2012 Search Results from Bing</h2>
+</div></div>
+<div class="searchResult">
+
+<?php
+$resultPerPage = 10;
+$offsetNum = 0;
+$offset = "web.offset=0";
+if (isset($_GET['offset'])) {
+ $offsetNum = intval($_GET['offset']);
+ $offset = "web.offset=0" . $_GET['offset'];
+}
+
+
+if (isset($_GET['query'])) {
+$request =
+'http://api.bing.net/json.aspx?Appid=1EAAC8DFCA91DD8D0E442B4AFCAB8B641F7903E1&sources=web&' .
+$offset . '&web.count=' . $resultPerPage . '&query=' . urlencode( $_GET["query"] ) . "+site%3Asigcse.org%2Fsigcse2012%2F";
+$response = file_get_contents($request);
+$jsonobj = json_decode($response);
+
+echo('<p>Found ' . $jsonobj->SearchResponse->Web->Total . ' total results</p>');
+
+foreach($jsonobj->SearchResponse->Web->Results as $value)
+{
+echo('<p><strong><a href="' . $value->Url . '" style="color: blue;">' . $value->Title . '</a></strong><br/>');
+echo( $value->Description . "<br/>");
+echo( '<span class="searchUrl">' . $value->DisplayUrl . '</span>');
+echo('</p>');
+}
+
+$page = 1;
+$pages = ceil($jsonobj->SearchResponse->Web->Total / floatval($resultPerPage));
+$curPage = floor($offsetNum / $resultPerPage) + 1;
+echo('<p>Page: ');
+while($page <= $pages) {
+ if ($page == $curPage) {
+ echo('<strong>' . $page . '</strong>');
+ } else {
+ $newOffset = ($page - 1) * $resultPerPage;
+ echo('<a href="/sigcse2012/bing.php?offset=' . $newOffset . '&query=' . urlencode( $_GET["query"] ) . '">' . $page . '</a>');
+ }
+ echo(' ');
+ $page = $page + 1;
+}
+echo('</p>');
+} ?>
+</div>
+<?php
+ $updated = filemtime( $_SERVER["SCRIPT_FILENAME"] );
+ $mainPage = true;
+ include("parts/bottom.php");
+?>
View
@@ -453,3 +453,11 @@ blockquote {
margin-right: 5px;
}
+.searchResult a:link a:active a:visited {
+ color: blue;
+}
+
+.searchUrl {
+ color: green;
+}
+
View
@@ -33,15 +33,9 @@
<td align="center" valign="top" colspan="3"><h3>Platinum Supporters</h3></td>
</tr>
<tr>
- <td align="center" valign="middle" colspan="1">
- <a href="http://www.microsoft.com/education/highered/faculty/" alt="Microsoft Highered"><img src="/sigcse2012/images/logos/sponsors/microsoft.png" /></a>
- </td>
- <td align="center" valign="middle" colspan="1">
- <a href="http://www.google.com/edu/" alt="Google EDU"><img src="/sigcse2012/images/logos/sponsors/google.png" /></a>
- </td>
- <td align="center" valign="middle">
- <a href="http://software.intel.com/sites/academic_showcase/" alt="Intel Education"><img src="/sigcse2012/images/logos/sponsors/intel.png" /></a>
- </td>
+<?php
+ include("../parts/platinum.php");
+?>
</tr>
<tr>
<td align="center" valign="top" colspan="3"><h3>Silver Supporters</h3></td>
View
@@ -25,15 +25,9 @@
<td align="center" valign="top" colspan="3"><h3>Platinum Supporters</h3></td>
</tr>
<tr>
- <td align="center" valign="middle" colspan="1">
- <a href="http://www.microsoft.com/education/highered/faculty/" alt="Microsoft Highered"><img src="/sigcse2012/images/logos/sponsors/microsoft.png" /></a>
- </td>
- <td align="center" valign="middle" colspan="1">
- <a href="http://www.google.com/edu/" alt="Google EDU"><img src="/sigcse2012/images/logos/sponsors/google.png" /></a>
- </td>
- <td align="center" valign="middle">
- <a href="http://software.intel.com/sites/academic_showcase/" alt="Intel Education"><img src="/sigcse2012/images/logos/sponsors/intel.png" /></a>
- </td>
+<?php
+ include("parts/platinum.php");
+?>
</tr>
<tr>
<td align="center" valign="top" colspan="3"><h3>Silver Supporters</h3></td>
View
@@ -0,0 +1,11 @@
+<form method="get" action="/sigcse2012/bing.php">
+ Search with Bing<br/><input type="text" id="query" name="query" size="31" value="<?php
+ if (isset($_GET['query'])) {
+ echo($_GET['query']); }
+ else {
+ echo('SIGCSE 2012');
+ }
+ ?>"/>
+<input type="submit" value="Search" name="submit" id="searchButton" />
+
+</form>
View
@@ -0,0 +1,3 @@
+<td align="center" valign="middle" colspan="1">
+ <a href="http://www.google.com/edu/" alt="Google EDU"><img src="/sigcse2012/images/logos/sponsors/google.png" /></a>
+</td>
View
@@ -0,0 +1,20 @@
+Search with Google<br/><script type="text/javascript" src="http://www.google.com/jsapi"></script>
+<script type="text/javascript">
+google.load('search', '1');
+google.setOnLoadCallback(function() {
+google.search.CustomSearchControl.attachAutoCompletion(
+'000184131728111546209:ca9n_ricjba',
+document.getElementById('q'),
+'cse-search-box');
+});
+</script>
+<form action="http://www.sigcse.org/sigcse2012/search.php" id="cse-search-box">
+<div>
+<input type="hidden" name="cx" value="000184131728111546209:bra5kgqicnk" />
+<input type="hidden" name="cof" value="FORID:11" />
+<input type="hidden" name="ie" value="UTF-8" />
+<input type="text" name="q" id="q" autocomplete="on" size="31" />
+<input type="submit" name="sa" value="Search" />
+</div>
+</form>
+<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>
View
@@ -0,0 +1,3 @@
+<td align="center" valign="middle">
+ <a href="http://software.intel.com/sites/academic_showcase/" alt="Intel Education"><img src="/sigcse2012/images/logos/sponsors/intel.png" /></a>
+</td>
View
@@ -85,26 +85,14 @@
</div>
<div class="menu"><a id="committee_menu" href="/sigcse2012/committee/">Program Committee</a></div>
<hr/>
-<script type="text/javascript" src="http://www.google.com/jsapi"></script>
-<script type="text/javascript">
-google.load('search', '1');
-google.setOnLoadCallback(function() {
-google.search.CustomSearchControl.attachAutoCompletion(
-'000184131728111546209:ca9n_ricjba',
-document.getElementById('q'),
-'cse-search-box');
-});
-</script>
-<form action="http://www.sigcse.org/sigcse2012/search.php" id="cse-search-box">
-<div>
-<input type="hidden" name="cx" value="000184131728111546209:bra5kgqicnk" />
-<input type="hidden" name="cof" value="FORID:11" />
-<input type="hidden" name="ie" value="UTF-8" />
-<input type="text" name="q" id="q" autocomplete="off" size="31" />
-<input type="submit" name="sa" value="Search" />
-</div>
-</form>
-<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&lang=en"></script>
+
+<?php
+$sponsors = array("google_search.php", "bing_search.php");
+shuffle($sponsors);
+foreach ($sponsors as $sponsor) {
+ include($sponsor);
+}
+?>
<hr/>
<g:plus href="https://plus.google.com/105068073150868262530" size="badge"></g:plus>
View
@@ -0,0 +1,3 @@
+<td align="center" valign="middle" colspan="1">
+ <a href="http://www.microsoft.com/education/highered/faculty/" alt="Microsoft Highered"><img src="/sigcse2012/images/logos/sponsors/microsoft.png" /></a>
+</td>
View
@@ -0,0 +1,7 @@
+<?php
+$sponsors = array("microsoft.php", "google.php", "intel.php");
+shuffle($sponsors);
+foreach ($sponsors as $sponsor) {
+ include($sponsor);
+}
+?>
View
@@ -1,10 +1,10 @@
<?php
- $title = "SIGCSE 2012 - Search Reults";
+ $title = "SIGCSE 2012 - Search Results";
$onload = "pageLoad(null, null);";
include("parts/top.php");
?>
<div class="SectionHeader"><div class="Full">
-<h2>SIGCSE 2012 Search Results</h2>
+<h2>SIGCSE 2012 Search Results from Google</h2>
</div></div>
<div id="cse-search-results"></div>
<script type="text/javascript">

0 comments on commit 59653df

Please sign in to comment.