| 1720 |
varun.gupt |
1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
2 |
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
3 |
<head>
|
|
|
4 |
<title>Phones I Own | Saholic</title>
|
|
|
5 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
|
|
6 |
|
|
|
7 |
<!--link rel="stylesheet" href="/css/phonesiown.css" type="text/css" /-->
|
|
|
8 |
<style>
|
|
|
9 |
div.productItem {
|
|
|
10 |
float:left;
|
|
|
11 |
width: 250px;
|
|
|
12 |
padding: 7px;
|
|
|
13 |
}
|
|
|
14 |
|
|
|
15 |
div.productImg {
|
|
|
16 |
float: left;
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
.yellow-image {
|
|
|
20 |
background: url("spriteme1.png") repeat-x scroll -10px -750px transparent;
|
|
|
21 |
border: 1px solid #BFA864;
|
|
|
22 |
color: #000000;
|
|
|
23 |
cursor: pointer;
|
|
|
24 |
float: left;
|
|
|
25 |
font-size: 13px;
|
|
|
26 |
font-weight: bold;
|
|
|
27 |
height: 18px;
|
|
|
28 |
padding: 4px 7px;
|
|
|
29 |
text-align: center;
|
|
|
30 |
}
|
|
|
31 |
|
|
|
32 |
.yellow-image input.button {
|
|
|
33 |
background: none repeat scroll 0 0 transparent;
|
|
|
34 |
border: medium none;
|
|
|
35 |
cursor: pointer;
|
|
|
36 |
font-size: 13px;
|
|
|
37 |
font-weight: bold;
|
|
|
38 |
}
|
|
|
39 |
|
|
|
40 |
input, select, textarea {
|
|
|
41 |
outline: medium none;
|
|
|
42 |
}
|
|
|
43 |
</style>
|
|
|
44 |
</head>
|
|
|
45 |
<body>
|
|
|
46 |
<img src="http://saholic.com/images/saholic-main.jpg" />
|
|
|
47 |
<hr />
|
|
|
48 |
<div>
|
|
|
49 |
<form action="/fb/my-phones" method="get">
|
|
|
50 |
Which phone do you own?
|
|
|
51 |
<input type="text" name="q" />
|
|
|
52 |
<input type="submit" value="Search" />
|
|
|
53 |
</form>
|
|
|
54 |
</div>
|
|
|
55 |
<hr />
|
|
|
56 |
#set($resultCount = $action.getResultCount())
|
|
|
57 |
|
|
|
58 |
#if($resultCount > 0)
|
|
|
59 |
<div>
|
|
|
60 |
<p>We found following phones matching with your search query:</p>
|
|
|
61 |
#set($results = $action.getResults())
|
|
|
62 |
#set($snippets = $action.getSnippets())
|
|
|
63 |
|
|
|
64 |
#foreach($entityId in $results)
|
|
|
65 |
$snippets.get($entityId)
|
|
|
66 |
#end
|
|
|
67 |
</div>
|
|
|
68 |
#end
|
|
|
69 |
<div id="fb-root"></div>
|
|
|
70 |
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
|
|
|
71 |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.2.min.js"></script>
|
|
|
72 |
<script type="text/javascript">
|
|
|
73 |
|
|
|
74 |
FB.init({
|
|
|
75 |
appId : '179519275432255',
|
|
|
76 |
status : true, // check login status
|
|
|
77 |
cookie : true, // enable cookies to allow the server to access the session
|
|
|
78 |
xfbml : true // parse XFBML
|
|
|
79 |
});
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
function publishStream(productName, productURL, productImgURL, productDesc) {
|
|
|
83 |
FB.ui({
|
|
|
84 |
method: 'feed',
|
|
|
85 |
name: productName,
|
|
|
86 |
link: productURL,
|
|
|
87 |
picture: productImgURL,
|
|
|
88 |
caption: 'Phones I Own | Saholic.com',
|
|
|
89 |
description: productDesc,
|
|
|
90 |
message: 'Check out the phone I own!'
|
|
|
91 |
},
|
|
|
92 |
function(response) {
|
|
|
93 |
if (response && response.post_id) {
|
|
|
94 |
// Post was published
|
|
|
95 |
} else {
|
|
|
96 |
// Post was not published
|
|
|
97 |
}
|
|
|
98 |
});
|
|
|
99 |
}
|
|
|
100 |
$(function(){
|
|
|
101 |
$('input.publish-button').click(function() {
|
|
|
102 |
var id = $(this).attr('id').replace('post-badge-', '');
|
|
|
103 |
var productName = $(this).html();
|
|
|
104 |
var productUrl = $('#url-' + id).html();
|
|
|
105 |
var imageUrl = $('#img-' + id).attr('src');
|
|
|
106 |
var desc = "";
|
|
|
107 |
|
|
|
108 |
$('#desc-' + id).children().each(function(i, item){
|
|
|
109 |
desc += $(item).html() + ', ';
|
|
|
110 |
});
|
|
|
111 |
desc = jQuery.trim(desc);
|
|
|
112 |
|
|
|
113 |
publishStream(productName, productUrl, imageUrl, desc);
|
|
|
114 |
});
|
|
|
115 |
});
|
|
|
116 |
</script>
|
|
|
117 |
</body>
|
|
|
118 |
</html>
|