TinyPortal

Development => Support => Topic started by: cralor on April 26, 2010, 01:18:05 AM

Title: Social Network Buttons
Post by: cralor on April 26, 2010, 01:18:05 AM
Hi.

On www.dbgc.tk/forums , it shows the buttons twice. Why?

Thanks,
cralor
Title: Re: Social Network Buttons
Post by: Max on April 26, 2010, 01:38:12 AM
hey cralor.

Check this file to see if the code it there twice,
if so remove the duplicate bit.

default/TPsubs.template.php

Find:


function article_bookmark($render=true)
{
global $scripturl, $txt, $settings, $context;

if(in_array('social',$context['TPortal']['article']['visual_options']))
$code = '
<div class="article_socialbookmark">
<a href="http://twitter.com/home/?status=' . $scripturl.'?page='. $context['TPortal']['article']['id'] . '" target="_blank"><img title="Share on Twitter!" src="' . $settings['tp_images_url'] . '/twitter.gif" alt="Share on Twitter!" /></a>
<a href="http://digg.com/submit?url=' . $scripturl.'?page='. $context['TPortal']['article']['id'] . '&title=' . $context['TPortal']['article']['subject'].'" target="_blank"><img title="Digg this story!" src="' . $settings['tp_images_url'] . '/digg.gif" alt="Digg this story!" /></a>
<a href="http://del.icio.us/post?url=' . $scripturl.'?page=' . $context['TPortal']['article']['id'] . '&title=' . $context['TPortal']['article']['subject'] . '" target="_blank"><img src="' . $settings['tp_images_url'] . '/delicious.gif" alt="Del.icio.us" title="Del.icio.us" /></a>
<a href="http://www.facebook.com/sharer.php?u=' . $scripturl . '?page=' . $context['TPortal']['article']['id'] . '" target="_blank"><img src="' . $settings['tp_images_url'] . '/facebook.gif" alt="Share on Facebook!" title="Share on Facebook!" /></a>
<a href="http://www.technorati.com/faves?add=' . $scripturl . '?page=' . $context['TPortal']['article']['id'] . '" target="_blank"><img src="' . $settings['tp_images_url'] . '/technorati.gif" alt="Technorati" title="Technorati" /></a>
<a href="http://www.reddit.com/submit?url=' . $scripturl . '?page=' . $context['TPortal']['article']['id'] . '" target="_blank"><img src="' . $settings['tp_images_url'] . '/reddit.gif" alt="Reddit" title="Reddit" /></a>
<a href="http://www.stumbleupon.com/submit?url=' . $scripturl . '?page=' . $context['TPortal']['article']['id'] . '" target="_blank"><img src="' . $settings['tp_images_url'] . '/stumble_upon_icon.gif" alt="StumbleUpon" title="Stumbleupon" /></a>
</div>';
else
$code='';

if($render) { echo $code; } else { return $code; }
}
Title: Re: Social Network Buttons
Post by: cralor on April 26, 2010, 02:12:41 AM
Only in their once  :-\
Title: Re: Social Network Buttons
Post by: william777 on April 26, 2010, 02:20:35 AM
Hi cralor, yes there are two instances of of your Social Network buttons:


<div class="article_bodytext"></div></div>

<div class="article_socialbookmark">
<a href="http://twitter.com/home/?status=http://dbgc.tk/forums/index.php?page=3" target="_blank"><img title="Share on Twitter!" src="http://dbgc.tk/forums/Themes/default/images/tinyportal/twitter.gif" alt="Share on Twitter!" /></a>
<a href="http://digg.com/submit?url=http://dbgc.tk/forums/index.php?page=3&title=Welcome!" target="_blank"><img title="Digg this story!" src="http://dbgc.tk/forums/Themes/default/images/tinyportal/digg.gif" alt="Digg this story!" /></a>
<a href="http://del.icio.us/post?url=http://dbgc.tk/forums/index.php?page=3&title=Welcome!" target="_blank"><img src="http://dbgc.tk/forums/Themes/default/images/tinyportal/delicious.gif" alt="Del.icio.us" title="Del.icio.us" /></a>
<a href="http://www.facebook.com/sharer.php?u=http://dbgc.tk/forums/index.php?page=3" target="_blank"><img src="http://dbgc.tk/forums/Themes/default/images/tinyportal/facebook.gif" alt="Share on Facebook!" title="Share on Facebook!" /></a>
<a href="http://www.technorati.com/faves?add=http://dbgc.tk/forums/index.php?page=3" target="_blank"><img src="http://dbgc.tk/forums/Themes/default/images/tinyportal/technorati.gif" alt="Technorati" title="Technorati" /></a>
<a href="http://www.reddit.com/submit?url=http://dbgc.tk/forums/index.php?page=3" target="_blank"><img src="http://dbgc.tk/forums/Themes/default/images/tinyportal/reddit.gif" alt="Reddit" title="Reddit" /></a>

<a href="http://www.stumbleupon.com/submit?url=http://dbgc.tk/forums/index.php?page=3" target="_blank"><img src="http://dbgc.tk/forums/Themes/default/images/tinyportal/stumble_upon_icon.gif" alt="StumbleUpon" title="Stumbleupon" /></a>
</div>


<div class="article_socialbookmark">
<a href="http://twitter.com/home/?status=http://dbgc.tk/forums/index.php?page=3" target="_blank"><img title="Share on Twitter!" src="http://dbgc.tk/forums/Themes/default/images/tinyportal/twitter.gif" alt="Share on Twitter!" /></a>
<a href="http://digg.com/submit?url=http://dbgc.tk/forums/index.php?page=3&title=Welcome!" target="_blank"><img title="Digg this story!" src="http://dbgc.tk/forums/Themes/default/images/tinyportal/digg.gif" alt="Digg this story!" /></a>
<a href="http://del.icio.us/post?url=http://dbgc.tk/forums/index.php?page=3&title=Welcome!" target="_blank"><img src="http://dbgc.tk/forums/Themes/default/images/tinyportal/delicious.gif" alt="Del.icio.us" title="Del.icio.us" /></a>
<a href="http://www.facebook.com/sharer.php?u=http://dbgc.tk/forums/index.php?page=3" target="_blank"><img src="http://dbgc.tk/forums/Themes/default/images/tinyportal/facebook.gif" alt="Share on Facebook!" title="Share on Facebook!" /></a>
<a href="http://www.technorati.com/faves?add=http://dbgc.tk/forums/index.php?page=3" target="_blank"><img src="http://dbgc.tk/forums/Themes/default/images/tinyportal/technorati.gif" alt="Technorati" title="Technorati" /></a>
<a href="http://www.reddit.com/submit?url=http://dbgc.tk/forums/index.php?page=3" target="_blank"><img src="http://dbgc.tk/forums/Themes/default/images/tinyportal/reddit.gif" alt="Reddit" title="Reddit" /></a>

<a href="http://www.stumbleupon.com/submit?url=http://dbgc.tk/forums/index.php?page=3" target="_blank"><img src="http://dbgc.tk/forums/Themes/default/images/tinyportal/stumble_upon_icon.gif" alt="StumbleUpon" title="Stumbleupon" /></a>
</div>



</div>
Title: Re: Social Network Buttons
Post by: Max on April 26, 2010, 02:29:44 AM
Strange, if you disable "Show Social Bookmarks buttons" in your article (down near the bottom there's a tick box)

Does it still show up twice?
Title: Re: Social Network Buttons
Post by: cralor on April 26, 2010, 02:31:25 AM
Quote from: Maxâ„¢ on April 26, 2010, 02:29:44 AM
Strange, if you disable "Show Social Bookmarks buttons" in your article (down near the bottom there's a tick box)

Does it still show up twice?

If I disable the buttons, both sets go away. :(

william777: Yeah. I know they are twice :) But it's only referenced once in the PHP code where it is defined.
Title: Re: Social Network Buttons
Post by: Max on April 26, 2010, 03:01:33 AM
This maybe your problem, I've not tested all of the article layouts myself, from looking threw some code it seems it added twice to one of the layouts.

default/TPortalAdmin.template.php find this line:

<span class="lowerframe" style="margin-bottom: 5px;"><span></span></span>';

above that located in a div tag, there should only be one {article_bookmark}

<div class="article_padding">{article_text}</div>
{article_bookmark}
{article_boardnews}
{article_moreauthor}
{article_bookmark}
{article_morelinks}
{article_globaltags}
{article_comments}
</div>


If you remove one does it make any difference like so:

<div class="article_padding">{article_text}</div>
{article_boardnews}
{article_moreauthor}
{article_morelinks}
{article_globaltags}
{article_comments}
{article_bookmark}
</div>
Title: Re: Social Network Buttons
Post by: cralor on April 26, 2010, 10:27:49 PM
Removed one of them, but it still shows two :(
Title: Re: Social Network Buttons
Post by: cralor on May 05, 2010, 10:54:37 PM
Any other thoughts?
Title: Re: Social Network Buttons
Post by: ZarPrime on May 06, 2010, 06:03:13 PM
cralor,

I have tried to duplicate this on my test forum without success.  Have you switched to the default SMF theme (curve) to see if it works that way with it?  Can you detail the steps you took to install TP 1.0 beta 5-1 and what version of TP you had installed before that?  Also, do you have any other SMF Mods installed or just TinyPortal?

Since this seems to be a test site for you, I would suggest unzipping the current install of TP to a temp folder on your hard drive and using FTP to upload/overwrite all of the correct files to your site again.  That means the files located in the common folder and the SMF2RC2 folder to their proper locations.

Finally, if this doesn't fix it, please post the exact code you are using here, the kind of article, and your settings for both the article and the category so that I can try to duplicate the problem.

ZarPrime
Title: Re: Social Network Buttons
Post by: cralor on May 07, 2010, 01:45:41 AM
Thanks for the reply!

Let's start off with my installation and package mod specs.

TinyPortal 5-1
SMF 2.0 RC3
Fresh install, no previous installation

Packages: (besides TP)
Aeva Media
SMF Arcade

This DOES show up on the Default theme as well.

Thanks!
Title: Re: Social Network Buttons
Post by: ZarPrime on May 07, 2010, 05:33:03 PM
cralor,

This is very confusing to me.  It's obvious that the social buttons are getting called twice for some reason but why this is happening is beyond me since I can't duplicate it.  Perhaps one of the other TP Team Members has an idea about it.

ZarPrime
Title: Re: Social Network Buttons
Post by: IchBin on May 08, 2010, 05:01:06 AM
Can you post what your frontpage settings are? What are the settings you have on both your article and the category the article is in?
Title: Re: Social Network Buttons
Post by: cralor on May 08, 2010, 02:59:56 PM
Ok I thought I looked everywhere :) Some reason was listed 2 times in the frontpage settings.

Thanks guys!!!
Title: Re: Social Network Buttons
Post by: ZarPrime on May 08, 2010, 03:05:06 PM
cralor,

I'm confused.  What is listed 2 times in the frontpage settings?  Can you show us a screenshot?

ZarPrime
Title: Re: Social Network Buttons
Post by: cralor on May 08, 2010, 03:15:41 PM
Sorry.

{article_bookmark} tag was listed twice in the FrontPage settings layout code (Custom).
Title: Re: Social Network Buttons
Post by: ZarPrime on May 08, 2010, 03:32:59 PM
Ah, I see.  Wow, I wouldn't have thought to even look there.  Nice catch. O0

I just checked it in my TP 1.0 beta 5.2 install, and it's not listed in the custom code textarea there twice.  Out of curiosity, did you edit the custom code to fit your site, and that was why it was in there twice?

Now that you have brought this up, I'm thinking that it might not be a bad idea for bloc to add a reset button for the custom code (layout type #7) in case someone edits it and needs to get back to a default custom code.

In any case, I will go ahead and mark this topic solved.

ZarPrime
Title: Re: Social Network Buttons
Post by: cralor on May 08, 2010, 04:38:47 PM
I don't believe I did :) But it was the fix anyway!

Thanks again,
cralor