Salut, am un site unde am integrat page comment de la facebook. Cum pot vedea cand cineva comenteaza o pagina dupa site-ul meu ?
Salut, am un site unde am integrat page comment de la facebook. Cum pot vedea cand cineva comenteaza o pagina dupa site-ul meu ?
vezi comentariile sub articol acolo unde ai adaugat modulul de comentarii prin facebook.
Vreau sa ma anunte cine si unde a comentat
By default nu poti. Trebuie sa faci subsribe la event ca aici :
FB.Event.subscribe - Facebook Developers
Evenimentul care te intereseaza este cred : comment.create
Cum il pot integra ?
Cu un js ca asta :
<script>
window.fbAsyncInit = function () {
FB.init({ appId: 'YOUR_APP_ID',
status: true,
cookie: true,
xfbml: true
});
FB.Event.subscribe('comment.create',
function (response) {
//Send an email with ajax
$.ajax({
type: "POST",
url: "sendcommentemail.php?",
data: "urlofpage=",
beforeSend: function () {$('#loading').show();},
success: function (html) {$('#loading').hide();},
error: function (html) {}
});
}
);
};
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) { return; }
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=YOUR_APP_ID";
fjs.parentNode.insertBefore(js, fjs);
} (document, 'script', 'facebook-jssdk'));
</script>
dupa fiecare comentariu va fi apelata pagina sendcommentemail.php cu parametru url paginii unde a fost comentariul.
Pagina sendcommentemail.php poate sa-ti trimita de exemplu un email sau ce alta forma de notificare vrei tu.
Filip, salut... eu adaug asta in loc de "<div class="fb-comments" data-href="<?php the_permalink(); ?>" data-num-posts="5" data-width="600" data-colorscheme="dark"></div>" ?
Cum fac sendcommentemail.php ?
Ultima modificare făcută de Guess Who; 15th October 2012 la 20:56.
Nu, asta vine in loc de loaderul de facebook js, probabil secventa asta :
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) { return; }
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=YOUR_APP_ID";
fjs.parentNode.insertBefore(js, fjs);
} (document, 'script', 'facebook-jssdk'));
Pentru sendcommentemail.php poate te ajuta cineva care stie php![]()
Alta idee ? Este complicat cu sendcommentemail.php![]()
Momentan este/sunt 1 utilizator(i) care navighează în acest subiect. (0 membrii și 1 vizitatori)