Share This Topic

Started by All Colours Sam, September 06, 2009, 05:09:23 AM

Previous topic - Next topic

All Colours Sam

DrBermant   this mod only works on a per topic and a per message level, it does not work on a board level, thats why you do not see any facebook like button or other button on the topic's list.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

DrBermant

Quote from: Miss All Sunday on June 05, 2011, 11:01:26 PM
DrBermant   this mod only works on a per topic and a per message level, it does not work on a board level, thats why you do not see any facebook like button or other button on the topic's list.

Thank you
Board Certified
American Board Plastic Surgery
Plastic Surgery Encyclopedia
A Body Beautiful Plastic Surgery Forum

mastro

Quote from: Miss All Sunday on June 05, 2011, 05:42:16 PM
@mastro   atach both your Sources/Display.php and your theme's Display.template.php
Of course!! Also, my beautiful forum is www.hdforum.gr [nofollow] !!!!


go-

Hello,
is it possible to activate this mod for the normal SMFBlog Mod?

The Mod displays the first post of every new topic in a previously "use as blog" marked board.
So "Share This Topic" would be very fitting in there.

All Colours Sam

@mastro   do you only want to show the buttons and not the icons?

do you use the buttons on every message or just the first one?


@go-   there's a simple way to add the buttons and the icons on your mod, the only thing you need to have its a valid url to share, what SMF are you using?

if you are using 2.o you just need to ad this at your template:

// define some parameters
      $parameters = array(
         'url' => 'url to share',   
      );   
         
      // :)
        $suki =  share_this($parameters);
        $mirahalo = share_icons($parameters);


and thats all,    $suki holds the buttons meanwhile $mirahalo holds the icons, you cna put those variables whereever you want on your template.  for 1.1.x its pretty much the same, you just need to call the ShareThis.php file  with:

global $sourcedir;
require_once($sourcedir . '/ShareThis.php');


at the beginning of your template file.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

go-

Quote from: Miss All Sunday on June 06, 2011, 08:54:19 PM
@go-   there's a simple way to add the buttons and the icons on your mod, the only thing you need to have its a valid url to share, what SMF are you using?

if you are using 2.o you just need to ad this at your template:

// define some parameters
      $parameters = array(
         'url' => 'url to share',   
      );   
         
      // :)
        $suki =  share_this($parameters);
        $mirahalo = share_icons($parameters);


and thats all,    $suki holds the buttons meanwhile $mirahalo holds the icons, you cna put those variables whereever you want on your template.  for 1.1.x its pretty much the same, you just need to call the ShareThis.php file  with:

global $sourcedir;
require_once($sourcedir . '/ShareThis.php');


at the beginning of your template file.

Thanks for your reply.

I'm using SMF 1.1.13

here's the code of the Blog.template.php
Maybe you can tell me where to put the code above so it will appear the way it is ususal in topics.
<?php
// Version: 0.1 Beta; Blog

// Stuff displayed on top of the blog...
function template_blog_above()
{
echo '
<div style="padding: 3px;">'
theme_linktree(), '</div>';
}

// ... and stuff displayed below it.
function template_blog_below()
{
global $context;

// Please do not remove the copyright. If you really must, please contact me
// (Daniel15) so we can arrange something. Removing the copyright without
// permission is illegal!
echo '
<div style="text-align: center" class="smalltext">
Powered by <a href="http://www.dansoftaustralia.net/products/smf-mods/blog.htm" title="A (very) simple blogging system for SMF">SMFBlog</a> '
$context['blog_version']['version'], ' (build '$context['blog_version']['build'], ') by <a href="http://www.dansoftaustralia.net/">DanSoft Australia</a>.
</div>'
;
}

// The blog index.
function template_index()
{
global $context$scripturl$txt;

echo '
<table width="100%" cellpadding="5" cellspacing="0" border="0" class="tborder" style="margin-top: 1.5ex;">
<tr><td class="titlebg">'
$txt['blog'], ' - '$txt['blog_blogs'], '</td></tr>
<tr valign="top" class="windowbg2">
<td style="padding-bottom: 2ex;">'
;

// Loop through all blog boards.
foreach ($context['blog_boards'] as $board)
echo '
<div class="blog_listing">
<a class="blog_link" href="'
$scripturl'?action=blog;sa=view_blog;name='$board['alias'], '">'$board['name'], '</a>
<blockquote class="blog_desc">'
$board['description'], '</blockquote>
</div>'
;

echo '
</td>
</tr>
</table>'
;
}

// Viewing a blog itself.
function template_view()
{
global $context$modSettings$scripturl$txt;
echo '
<h2>'
$context['blog']['name'], '</h2>
'
$context['blog']['pageindex'];

$alternating 1;
// Loop through each post.
foreach ($context['blog']['posts'] as $post)
{
// Output this post.
echo '
<div class="windowbg2 blog_post blog_post_'
$alternating'">
<a class="blog_post_heading" href="'
$scripturl'?action=blog;sa=view_post;id='$post['id'], (!empty($modSettings['blog_enable_rewrite']) ? ';blog_name=' $context['blog']['alias'] : ''), '">'$post['icon'], ' '$post['subject'], '</a>
<div class="smaller">'
$post['time'], ' '$txt[525], ' '$post['poster']['link'], '</div>

<div class="blog_post_body" style="padding: 2ex 0;">'
$post['body'], '</div>
</div>'
;

$alternating = ($alternating == 1) ? 1;
}

// Page numbers at the bottom
echo '
'
$context['blog']['pageindex'];

}

// Viewing a blog post.
function template_view_post()
{
global $context$scripturl$txt;

echo '
<h2 class="blog_heading">'
$context['blog_post']['subject'], '</h2>';

// Output the blog post itself.
echo '
<div class="windowbg2 blog_post">
<div class="blog_post_heading">'
$context['blog_post']['icon'], ' '$context['blog_post']['subject'], '</div>
<div class="smaller">'
$context['blog_post']['time'], ' '$txt[525], ' '$context['blog_post']['poster']['link'], '</div>

<div class="blog_post_body">'
$context['blog_post']['body'], '</div><br /><br />
</div>

<h2 class="blog_heading">'
$txt['blog_write_comment'], ':</h2>';
// Not logged in? No commenting for you!
// !!! Check the permissions!!
if (!$context['user']['is_logged'])
echo '
'
,$txt['blog_error_login'];
else
echo '
<form action="'
$scripturl'?action=post2" method="post" accept-charset="'$context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);">
<input type="hidden" name="topic" value="' 
$context['blog_post']['id'] . '" />
<input type="hidden" name="sc" value="'
$context['session_id'], '" />
<input type="hidden" name="seqnum" value="'
$context['form_sequence_number'], '" />
<input type="hidden" name="blog_post" value="'
$context['blog_post']['id'], '" />', (!empty($context['blog_name']) ? '
<input type="hidden" name="blog_name" value="' 
htmlentities($context['blog_name']) . '" />' ''), '

<table border="0" width="100%" align="center" cellspacing="1" cellpadding="3"> <!--class="bordercolor"-->
<tr>
<td align="right" style="font-weight: bold;" id="caption_subject">
'
$txt[70], ':
</td>
<td>
<input type="text" name="subject" value="Re: '
$context['blog_post']['subject'], '" tabindex="'$context['tabindex']++, '" size="80" maxlength="80" />
</td>
</tr>
'
theme_postbox(''), '
<tr>
<td align="center" colspan="2">
<span class="smalltext"><br />'
$txt['smf16'], '</span><br />
<input type="submit" name="post" value="'
$txt[10], '" tabindex="'$context['tabindex']++, '" onclick="return submitThisOnce(this);" accesskey="s" />
<input type="submit" name="preview" value="'
$txt[507], '" tabindex="'$context['tabindex']++, '" onclick="return event.ctrlKey || previewPost();" accesskey="p" />
</td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</table>
</form>'
;

echo '
<a name="comments"></a>
<h2 class="blog_heading">'
$txt['blog_comments'], ':</h2>';

// No replies? Too bad! :P.
if ($context['blog_post']['reply_count'] == 0)
echo '
'
$txt['blog_no_comments'];
else
{
// Page numbers, please!
echo '
'
$context['blog_post']['pageindex'];

// Now, go through all replies...
foreach ($context['blog_post']['replies'] as $post)
{
echo '
<a name="msg'
$post['id'], '"></a>', ($post['is_last'] ? '<a name="new"></a>' ''), '
<div id="msg'
$post['id'], '" class="windowbg2 blog_reply">
<div class="blog_reply_heading">'
$post['icon'], ' '$post['subject'], ' ('$txt['ssiTopic_reply'], ' '$post['number'], ') </div>
<div class="smaller">'
$post['time'], ' '$txt[525], ' '$post['poster']['link'], '</div>

<div class="blog_reply_body">'
$post['body'], '</div>
</div>'
;
}

// Again, some page numbers on the bottom this time!
echo '
'
$context['blog_post']['pageindex'];
}
}
?>



Thanks.

All Colours Sam

OK, I couldn't find any url parameter on that template, this mod needs to have an url parameter in order to work properly.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

go-

#1247
Quote from: Miss All Sunday on June 06, 2011, 09:13:58 PM
OK, I couldn't find any url parameter on that template, this mod needs to have an url parameter in order to work properly.

Thank you very much.

So is there anything I can do about this?


It's currently 3.30AM here, so I will read your reply tomorrow.

All Colours Sam

you can ask the mod author if there is a variable that holds the url for the blog.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

mastro

Quote from: Miss All Sunday on June 06, 2011, 08:54:19 PM
@mastro   do you only want to show the buttons and not the icons?

do you use the buttons on every message or just the first one?

I use them on every message!!

All Colours Sam

@mastro     do you want to show just the buttons?    otherwise it will be to tight to have both the buttons and the icons on that little space.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

mastro

#1251
Quote from: Miss All Sunday on June 07, 2011, 10:35:52 AM
@mastro     do you want to show just the buttons?    otherwise it will be to tight to have both the buttons and the icons on that little space.

Anything that is easier for you to tell me.
If it's easy to explain both situations it would be even better.

I would be also pleased if there was a way to just put them anywhere below the post. I just don't like them above..that's all.

All Colours Sam

yes, but you haven't asnwer my question,  there are two  separate things, one is the "buttons"  which includes the facebook like, the digg, buzz and twitter buttons.


the other part is the "icons"  which includes all the little 16 x 16 images linked to several social bookmarking sites.

I guess you are talking about the Buttons and that you do not use the icons, if thats the case and you only want to show the buttons below the message, then on your Sources/Display.php find:


if (!empty($modSettings['share_all_messages']) &&  !in_array($board_info['id'], $share_denied_boards))
$message['body'] = ($suki.$message['body'].$mirahalo);




and replace with:


if (!empty($modSettings['share_all_messages']) &&  !in_array($board_info['id'], $share_denied_boards))
$message['body'] = ($message['body'].$mirahalo.$suki);
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

mastro

Quote from: Miss All Sunday on June 07, 2011, 01:42:39 PM
yes, but you haven't asnwer my question,  there are two  separate things, one is the "buttons"  which includes the facebook like, the digg, buzz and twitter buttons.


the other part is the "icons"  which includes all the little 16 x 16 images linked to several social bookmarking sites.

I guess you are talking about the Buttons and that you do not use the icons, if thats the case and you only want to show the buttons below the message, then on your Sources/Display.php find:


if (!empty($modSettings['share_all_messages']) &&  !in_array($board_info['id'], $share_denied_boards))
$message['body'] = ($suki.$message['body'].$mirahalo);




and replace with:


if (!empty($modSettings['share_all_messages']) &&  !in_array($board_info['id'], $share_denied_boards))
$message['body'] = ($message['body'].$mirahalo.$suki);


I only use the buttons. That didn't work. Anyway ....Many thanks!!

All Colours Sam

Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

mastro

Quote from: Miss All Sunday on June 07, 2011, 02:18:01 PM
link to your forum?

It's www.hdforum.gr [nofollow] but don't worry. I realized that this module is about liking a topic. I wanted someone that could like each post individually.

All Colours Sam

you can like each post individually....   if you select to show the buttons on every message the like button for every message will like individually each message as every message has its own individual url to share.

this is the only mod that has that feature... all other mods are made based on topics only.
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

mastro

Quote from: Miss All Sunday on June 07, 2011, 02:32:31 PM
you can like each post individually....   if you select to show the buttons on every message the like button for every message will like individually each message as every message has its own individual url to share.

this is the only mod that has that feature... all other mods are made based on topics only.

I know that but something had stuck and it showed me that I liked every post if I clicked on the first one. Seems that works now...So...the buttons after the post? I think that this should be an option on the configuration menu.

mastro

#1258
ahahah I made it!! 8)
This is the code if someone is interested
// Show "� Last Edit: Time by Person �" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
$parameters = array(
'url' => $scripturl . '?topic=' . $topic . '.msg' . $message['id_msg'] . '#msg' . $message['id_msg'],
);

// :)
  $suki =  share_this($parameters);
echo '
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';

echo '
</div>
<div class="smalltext reportlinks">',$suki,'';


This puts the buttons inside above the report this moderator bar...Then you can style the share this div so it fits your needs\
Unfortunately when I press the like button returnes an error that it doesn't get the address....so don't do that.
I finally decided to just put it below the post with this:
if (!empty($modSettings['share_all_messages']) &&  !in_array($board_info['id'], $share_denied_boards))
$message['body'] = ($message['body'].$mirahalo.$suki);



With a little styling you can make it look like this

Ascot

is it possible to change font color to the annouce "Be the first of your friends on like this" next to Like button?
Because my forum background is black and you can't see this line.
Thanks in advance.

Advertisement: