SimplePortal

Support => International Support => Spanish => Topic started by: fapencio on May 02, 2014, 12:12:13 AM

Title: Poner botones sociales en block "board news"
Post by: fapencio on May 02, 2014, 12:12:13 AM
Hola, pido ayuda por favor para que me ilustren y me enseñen a poner los botones "me gusta" y "google +"  en los bloques que aparecen en el Portal o Home, también llamado "Board News", de preferencia justo al lado izquierdo de donde dice "Leer más | Escribir comentario"

gracias de antemano  ;D
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 02, 2014, 10:16:18 AM
Fapencio,

Have you installed a mod for "like" and "+1" on your forum?  Do these buttons appear on your posts?
Title: Re: Poner botones sociales en block "board news"
Post by: fapencio on May 02, 2014, 12:35:03 PM
Hi Angelina, yep, i have installed this mod and these buttons appear on my post, BUT not appear
in the Home Portal, in the block "Board News", i want this:

(http://i56.servimg.com/u/f56/15/36/53/57/captur18.jpg)

Is there any way to put social buttons on the block "board news" ? 
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 02, 2014, 01:03:10 PM
This is going to require some customization.
Look in the file PortalBlocks.php
You will see the boardnews function.

Near the end of the function, you will see where all the HTML is echo'd out.
You need to think about where you would put the icons for each item.
And you would need to look at what that mod has done to your display.template.php and/or $context to put those icons and link information into the post display.

Basically, you will have to modify the boardnews block to do some of what the mod does.
This is definitely about customization.
Title: Re: Poner botones sociales en block "board news"
Post by: fapencio on May 02, 2014, 04:33:01 PM
 :| :( :'(  ok, thanks
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 02, 2014, 05:16:10 PM
One step at a time.  Talk to the other mod author for advice on how you can add the icons to a custom template.  It will be ok
Title: Re: Poner botones sociales en block "board news"
Post by: fapencio on May 04, 2014, 11:47:09 AM
si alguien nos puede ayudar con esta petición por favor, este tip es muy solicitado y espero lo implementen en la nueva versión de simpleportal, tan solo fíjense en las visitas que ha tenido esta petición, mas de 1500 y contando, un saludo a todos y si alguien ya lo pudo implementar en su web, que nos ayude por favor  :-[
Title: Re: Poner botones sociales en block "board news"
Post by: dhayzon on May 04, 2014, 07:15:51 PM
 creo q esta facil de hacer  :D  las visitas son puros bots   :thumbsdown:
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 05, 2014, 10:41:58 AM
fapencio,

The customization in PortalBlocks.php will be easy.
Please find out how those icons are added to your posts now.
Then you can do the same in sp_boardNews.
You will probably want to look in Display.php and Display.template.php -- or else ask the mod author for advice on where to look.
Title: Re: Poner botones sociales en block "board news"
Post by: fapencio on May 07, 2014, 12:00:20 PM
ya casi 2500 vistas tiene este post, es una lástima que haya personas que pueden ayudar con esto y tienen conocimientos y no lo hacen, si logro encontrar la forma de hacerlo antes de que alguien me ayude, les compartiré el tip en este post, saludos
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 08, 2014, 07:27:36 AM
Fapencio,  I don't know how to find out how many people have viewed this topic.

I do know that, if you talk to the mod author, you will learn valuable information.  If you share that here, I, and others, can help you make the customization.

Not everyone speaks Spanish.  The conversation might get more help in the customization board, perhaps in English, even with the help of Google Translate
Title: Re: Poner botones sociales en block "board news"
Post by: fapencio on May 08, 2014, 02:06:08 PM
is true AngelinaBelle, thanks for the tip
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 08, 2014, 04:35:57 PM
I hope it is good advice, and you are able to make your customization very soon.

Saludos!
Title: Re: Poner botones sociales en block "board news"
Post by: fapencio on May 08, 2014, 04:47:12 PM
esto lo estamos esperando muchos usuarios de simpleportal por eso hay muchas visitas a este post, ojalá alguien se anime a ayudarnos
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 08, 2014, 04:58:17 PM
In the meantime, please contact the author of "like button" mod for advice.  This will help.
Title: Re: Poner botones sociales en block "board news"
Post by: fapencio on May 18, 2014, 12:01:02 AM
help please
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 19, 2014, 11:20:29 AM
Of course! What did the author of your "like button" mod tell you?
Title: Re: Poner botones sociales en block "board news"
Post by: fapencio on May 19, 2014, 03:48:02 PM
this is the mod:

http://custom.simplemachines.org/mods/index.php?mod=3559

thanks in advance  :D
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 20, 2014, 01:36:07 PM
Did you ask for information on how to add the button to custom templates?
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 20, 2014, 01:52:30 PM
I think there is a clue here: http://www.simplemachines.org/community/index.php?topic=494062.msg3655886#msg3655886

So first, we must begin with "board news".  But here is your question: Do you want to "like" the topic or do you want to "like" the post?
Title: Re: Poner botones sociales en block "board news"
Post by: fapencio on May 20, 2014, 03:44:12 PM
like the topic, thanks AB  :-[
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 20, 2014, 03:58:44 PM
So then, please have a look in POrtalBlocks.php.  look in the function sp_boardNews.

Scroll down.  See where all the information is written to the board news block? 
Code: (find) [Select]
foreach ($return as $news)
Code: (replace) [Select]
foreach ($return as $id_topic => $news)

Now, it will be possible to add some HTML like this into the output, somewhere, depending on where you want to put it:


Code: [Select]
if (!empty($modSettings['facebook_like'])) {
echo '
<div id="fb-root"></div>
<div style="margin-left:auto;margin-right:2em;text-align:center;padding-right:12px" class="fb-like" data-href="', $scripturl, '?topic=', $id_topic, '" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false" data-font="verdana"></div>';
}

Decide where you want that icon to go.  Before or after the subject? Before or after the avatar? Before or after the message body?

You decide where you will stick this, and we can help you stick it in the correct place.
Title: Re: Poner botones sociales en block "board news"
Post by: fapencio on May 20, 2014, 05:13:20 PM
before of miniavatar please AB
Title: Re: Poner botones sociales en block "board news"
Post by: AngelinaBelle on May 22, 2014, 11:04:29 AM
1. make the change I gave you above and test that.
You should see no changes, and no errors on your error log.
Once you have done that, move on to the second step (the second step will not work properly without the first one)

2. Make this change and test it.  Check for errors in your log.  If you have no errors and are happy with the result, then you are done.
Code: (find) [Select]
         if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))
Code: (replace) [Select]
        if (!empty($modSettings['facebook_like'])) {
                echo '   
<div id="fb-root"></div>
<div style="margin-left:auto;margin-right:2em;text-align:center;padding-right:12px" class="fb-like" data-href="', $scripturl, '?topic=', $id_topic, '" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false" data-font="verdana"></div>';
        }

         if ($avatars && $news['avatar']['name'] !== null && !empty($news['avatar']['href']))

If  you have any questions about what is going on here and how to fix any typos I might have made, please read
http://www.php.net/manual/en/control-structures.foreach.php (for information on the foreach loop)
http://www.php.net/manual/en/function.echo.php (how php writes out HTML stuff for your users) and
http://www.w3schools.com/html/DEFAULT.asp (for information about HTML)
SimplePortal 2.3.8 © 2008-2024, SimplePortal