FB Like JQM dialog best optimized java script -- 3
$10-30 USD
Fechado
Publicado há aproximadamente 9 anos
$10-30 USD
Pago na entrega
I need a short and well optimized sdk javascript for facebook (API 2.2), to integrate into a my php script, in order to show a big FB thumb into a transparent JQM dialog box only for FB logged users if not liked yet a given page.
The javascript will be contained into an included php page, called by my php script, this page will include the popup layout script too.
Requirements:
1) jquerymobile 1.3.2 and jquery 1.9.1 are called by my php script,
2) assume that the user is just logged into facebook by another apps running under the same domain but different subdomain.
3) please declare all needed variable at begin of your script, using php, so I can change them with my values.
4) for test purpose you can use [login to view URL] or similar
5) assume that user has given all needed permissions (likes) else do nothing
At moment the task is done with PHP-SDK, but I wish using JSDK only.
The flow:
1) check if current user is logged into facebook
2) check if user has liked a given page
3) if liked do nothing else open the JQM dialog and ask to like page
4) on click on the like button likes page and close the popup without show the FB dialog form, on click anywhere close the popup and do nothing.
This is an example of the actual called function, you are allowed to change it with a responsive div:
function print_pleaselike_popup($val){
$test=1;
if(!$val[isFan] AND $val[FBuser] OR $test ==1) {
$FBpageid = $val[FBpageid];
$FBpagelink = $val[FBpagelink];
echo "<div data-role="popup" id="pleaselike" class="ui-content boxpopup" data-dismissible="false" data-overlay-theme="a" data-theme="none" data-shadow="false" style="max-width:300px">"
."<img class="boxpopup" src="images/[login to view URL]">"
."<div data-role="content" style="min-height:60px;width:250px;" data-theme="d" class="ui-corner-all">"
."<a href="#" data-rel="back" data-role="button" data-theme="c" data-icon="delete" data-iconpos="notext" class="ui-btn-right" style="float:right;">"._CLOSE."</a>"
."<div class="boxpopup_txt" style="max-width:250px;">"._PLEASELIKETHISPAGE."<br/>"._PLEASELIKETHISPAGE1.""
."</div>"
// you can change if needed:
."<fb:like href="$FBpagelink" ref="WIMO_Social" width="100" layout="button" show_faces="false" send="false" share="false" action="like" id="fblikebuttonbig"></fb:like>"
////
."</div>"
."</div>";
?>
<script type="text/javascript" language="JavaScript">
$(":jqmData(role='page'):last").on("pageshow", function(event) {
$("#pleaselike", $(this)).popup("open");
});
</script>
<?
}
return;
}