Problemas com botão de compartilhar e curtir no FB

  • Autor Autor marcelo12239
  • Data de início Data de início
Tradução em andamento: em alguns minutos este tópico estará em português. Por enquanto, o conteúdo está no original em espanhol. Ver original
M

marcelo12239

Iota
No recomendado
Usuário com poucas negociações! Use sempre o saldo do ForoBeta!
hola
tenog una web q genera el boton de gusta y compartir auotmaticamente peor no aparece la descrion y el titulo de la url eston los archivo 3 este son los 2 botones
<div style="margin-top:-4px;display:inline-block;">{if $_PREFER_IFRAME}<iframe src="http://www.facebook.com/plugins/like.php?href={$LIKE_URL_ENC}&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:120px; height:20px;" allowTransparency="true"></iframe>{else}<fb:like href="{$LIKE_URL}" layout="button_count" show_faces="false"></fb:like>{/if}</div>
</div>
</div>
<div style="margin-left:20px;margin-right:2px;padding:0 10px 10px;min-height:67px;background: Enlace eliminado">
{if $LIKE_TYPE == 1 && $LIKE_TEXT_TITLE_RAW != ''}
<div class="like-text">{$LIKE_TEXT_TITLE}</div>
{/if}
<div class="like-text">{$LIKE_TEXT}</div>
{if $LIKE_NAME != ''}<div style="font-size:10px;"><em>--- By: {$LIKE_NAME}</em></div>{/if}
{if $_SHOW_SHARE}
<div style="text-align:right;">
<link rel="stylesheet" type="text/css" href="http://static.ak.fbcdn.net/connect.php/css/share-button-css" />
<a name="fb_share" onclick="fbShare();return false;" href="#" style="text-decoration: none; "><span class="fb_share_size_Small "><span class="FBConnectButton FBConnectButton_Small" style="cursor😛ointer;"><span class="FBConnectButton_Text">Share</span></span><span class="fb_share_count_nub_right fb_share_no_count"></span><span class="fb_share_count fb_share_no_count fb_share_count_right"><span class="fb_share_count_inner">&nbsp;</span></span></span></a>
<br />
<div class="bluebutton-cont"><a class="bluebutton" href="{if $_PRETTY_URLS}{$_SITE_SUBDIR}/search/special:random{else}search.php?k=special:random{/if}">See more Likes!</a></div>
</div>
<script type="text/javascript">function fbShare() { window.open('http://www.facebook.com/sharer.php?u={$LIKE_URL_ENC}&t={$LIKE_TEXT_TITLE_ENC}','sharer','toolbar=0,status=0,width=600,height=300'); }</script>


aqui esta la meta
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns😱g="http://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<meta property="fb:admins" content="{$FB_ADMINS}" />
<meta property="og:title" content="{if $_LIKE_PAGE}{$LIKE_TEXT_TITLE}{else}{$_SITE_NAME}{/if}"/>
<meta property="og:type" content="{if $_LIKE_PAGE}activity{else}website{/if}"/>
<meta property="og:site_name" content="{$_SITE_NAME_FB}"/>
<meta property="og:url" content="{if $_LIKE_PAGE}{$LIKE_URL}{else}{$_SITE_URL}{/if}"/>
<meta property="og:image" content="{if $_LIKE_PAGE && $LIKE_THUMB !== false}{$LIKE_THUMB}{else}{$_SITE_IMAGE}{/if}"/>
<meta property="og:description" content="{$_SITE_DESC}"/>



aqui el de la configuracion
<?php
define( 'APP_ROOT', './' );
require( APP_ROOT . 'world.php' );
$vars = array();
$rows = array();

$Id = (int) _GET( 'l' );

$result = $db->query( "SELECT * FROM `{$dbprefix}likes` WHERE `id`=$Id" );
if ( $result->num_rows > 0 )
{
$found = true;
$row = $result->fetch_object();
$vars = array(
'LIKE_ID' => $row->id,
'LIKE_NAME' => $row->name,
'LIKE_COMMS'=> ( $row->comments ) ? true : false,
'LIKE_TYPE' => $row->type,
'LIKE_TEXT' => get_Like( $row->type, $row->text ),
'LIKE_TEXT_TITLE' => strip_tags( get_Like_Title( $row->type, $row->text, $row->id, $row->title ) ),
'LIKE_TEXT_TITLE_RAW' => $row->title,
'LIKE_TEXT_TITLE_ENC' => urlencode( strip_tags( get_Like_Title( $row->type, $row->text, $row->id, $row->title ) ) ),
'LIKE_THUMB'=> get_Like_ogimage( $row->type, $row->text ),
'LIKE_URL' => get_like_url( $row->id ),
'LIKE_URL_ENC' => urlencode( get_like_url( $row->id ) ),
);
$liked = (int)$row->liked;
$shared = (int)$row->shared;

$result->free_result();
}

$vars['LIKES_MORE'] = array();
if ( strpos( $_SERVER[ 'USER_AGENT' ], 'facebookexternalhit' ) === false ) { // If it's the FB Bot, don't load all this.
/* BLOCK START */
$result = $db->query( "SELECT * FROM `{$dbprefix}likes` WHERE `pinned`='1' ORDER BY RAND() LIMIT 5" );
if ( $result->num_rows > 0 )
{
while ( $row = $result->fetch_object() )
{
$vars['LIKES_MORE'][] = array(
'id' => $row->id,
'text' => get_Like_Listing( $row->type, $row->text, $row->title ),
'url' => get_like_url( $row->id ),
'url_enc' => urlencode( get_like_url( $row->id ) ),
);
}
$result->free_result();
}

$result = $db->query( "SELECT * FROM `{$dbprefix}likes` WHERE `pinned`='0' ORDER BY `last_liked_at` DESC LIMIT 15" );
if ( $result->num_rows > 0 )
{
while ( $row = $result->fetch_object() )
{
$vars['LIKES_MORE'][] = array(
'id' => $row->id,
'text' => get_Like_Listing( $row->type, $row->text, $row->title ),
'url' => get_like_url( $row->id ),
'url_enc' => urlencode( get_like_url( $row->id ) ),
);
}
$result->free_result();
}
/* BLOCK END */
}

$vars = array_merge( $vars, array(
'_LIKE_PAGE' => true,
'_SHOW_SHARE' => $econf[ 'show_like_share' ],
'FOUND' => ( $found ) ? 1 : 0,
));
$tpl->assign( $vars );
$tpl->display( 'like.html' );

@ob_end_flush();

if ( $found ) {
// Check the liked counter.
$fb_query = 'SELECT like_count, share_count FROM link_stat WHERE url="' . get_like_url( $vars[ 'LIKE_ID' ] ) . '"';
$fb_param = array(
'method' => 'fql.query',
'query' => $fb_query,
'callback' => ''
);
$fb_result = $facebook->api( $fb_param );
if ( $fb_result[ 0 ][ 'like_count' ] != $liked || $fb_result[ 0 ][ 'share_count' ] != $shared ) {
$liked_old = $liked;
$liked = $fb_result[ 0 ][ 'like_count' ];
$shared = $fb_result[ 0 ][ 'share_count' ];
$last_liked_at = time();
$db->query( "UPDATE `{$dbprefix}likes` SET `liked`='$liked', `shared`='$shared', `last_liked_at`='$last_liked_at' WHERE `id`=$Id" );

// Let's do some tracking!
if ( $Change = $liked - $liked_old > 0 ) {
$db->query( "INSERT INTO `{$dbprefix}tracking` (`like_id`, `time`, `count`) VALUES ('%s', '%s', '%s')", $Id, time(), $Change );
}
}
unset( $fb_result );
}
?>
 
Foi útil? Participe da conversa

Com sua conta grátis você pode responder, mandar mensagem privada ao autor e comprar com Saldo retido: o pagamento é liberado quando você recebe o combinado.

Leva 30 segundos · você volta a este tópico ao terminar
Compañero, yo tuve el mismo detalle con el botón de Share de facebook, indagando un poco encontré esto:

The Share button has been deprecated in favor of the Like button, and will no longer be supported.
Please use the Like button whenever possible to drive maximum traffic to your apps.

Acá: https://developers.facebook.com/docs/share/

Básicamente Facebook está dejando de usar el "sharer" (Log In | Facebook). No van a seguir desarrollandolo ni expandiendolo.

Dicho esto, la única forma en la que puedes usar el sharer actualmente es esta:

https://www.facebook.com/sharer/sharer.php?u={tu url}

por ejemplo:

https://www.facebook.com/sharer/sharer.php?u=www.forobeta.com

La imagen de fb la puedes crear tu y ponerle ese link que abra en target="_blank" y ahí se compartirá el contenido.

PD: en la web de facebook dicen que puedes pasarle otro parámetro al sharer, el "title", pero este en realidad no hace nada, por lo menos a mi nunca me funciono. Tampoco puedes poner un mensaje personalizado en el sharer, facebook lo que hace es agarrar la meta description de la url junto con la primera imagen que encuentra y la usa. Sí, no es muy bueno que digamos, pero es lo que hay actualmente.

PD2: fíjate cómo hice el "sharer" esta web: Enlace eliminado
 
Última edição:
Voltar
Topo