Share This Topic

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

Previous topic - Next topic

evillive

Sure here it is
<?php
// Version: 2.0 RC3; index

/* This template is, perhaps, the most important template in the theme. It
contains the main template layer that displays the header and footer of
the forum, namely with main_above and main_below. It also contains the
menu sub template, which appropriately displays the menu; the init sub
template, which is there to set the theme up; (init can be missing.) and
the linktree sub template, which sorts out the link tree.

The init sub template should load any data and set any hardcoded options.

The main_above sub template is what is shown above the main content, and
should contain anything that should be shown up there.

The main_below sub template, conversely, is shown after the main content.
It should probably contain the copyright statement and some other things.

The linktree sub template should display the link tree, using the data
in the $context['linktree'] variable.

The menu sub template should display all the relevant buttons the user
wants and or needs.

For more information on the templating system, please see the site at:
http://www.simplemachines.org/
*/

// Initialize the template... mainly little settings.
function template_init()
{
global $context$settings$options$txt;

/* Use images from default theme when using templates from the default theme?
if this is 'always', images from the default theme will be used.
if this is 'defaults', images from the default theme will only be used with default templates.
if this is 'never' or isn't set at all, images from the default theme will not be used. */
$settings['use_default_images'] = 'never';

/* What document type definition is being used? (for font size and other issues.)
'xhtml' for an XHTML 1.0 document type definition.
'html' for an HTML 4.01 document type definition. */
$settings['doctype'] = 'xhtml';

/* The version this template/theme is for.
This should probably be the version of SMF it was created for. */
$settings['theme_version'] = '2.0 RC3';

/* Set a setting that tells the theme that it can render the tabs. */
$settings['use_tabs'] = true;

/* Use plain buttons - as opposed to text buttons? */
$settings['use_buttons'] = true;

/* Show sticky and lock status separate from topic icons? */
$settings['separate_sticky_lock'] = true;

/* Does this theme use the strict doctype? */
$settings['strict_doctype'] = false;

/* Does this theme use post previews on the message index? */
$settings['message_index_preview'] = false;

/* Set the following variable to true if this theme requires the optional theme strings file to be loaded. */
$settings['require_theme_strings'] = true;
}

// The main sub template above the content.
function template_html_above()
{
global $context$settings$options$scripturl$txt$modSettings;

// Show right to left and the character set for ease of translating.
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
'

// share this topic facebook like buttom start
echo '
<html xmlns="http://www.w3.org/1999/xhtml" '
, !empty($modSettings['share_likebutton_enable']) ? 'xmlns:fb="http://www.facebook.com/2008/fbml ' '',  $context['right_to_left'] ? ' dir="rtl"' '''>';
     
// share this topic facebook like buttom end
   
   echo '
<head>
<meta http-equiv="Content-Type" content="text/html; charset='
$context['character_set'], '" />
<meta name="description" content="'
$context['page_title_html_safe'], '" />', !empty($context['meta_keywords']) ? '
<meta name="keywords" content="' 
$context['meta_keywords'] . '" />' '''
<title>'
$context['page_title_html_safe'], '</title>';

// Please don't index these Mr Robot.
if (!empty($context['robot_no_index']))
echo '
<meta name="robots" content="noindex" />'
;

// Present a canonical url for search engines to prevent duplicate content in their indices.
if (!empty($context['canonical_url']))
echo '
<link rel="canonical" href="'
$context['canonical_url'], '" />';

// The ?rc3 part of this link is just here to make sure browsers don't cache it wrongly.
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/css/index'$context['theme_variant'], '.css?rc3" />
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/css/print.css?rc3" media="print" />';

// Show all the relative links, such as help, search, contents, and the like.
echo '
<link rel="help" href="'
$scripturl'?action=help" />
<link rel="search" href="'
$scripturl'?action=search" />
<link rel="contents" href="'
$scripturl'" />';

// If RSS feeds are enabled, advertise the presence of one.
if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']))
echo '
<link rel="alternate" type="application/rss+xml" title="'
$context['forum_name_html_safe'], ' - '$txt['rss'], '" href="'$scripturl'?type=rss;action=.xml" />';

// If we're viewing a topic, these should be the previous and next topics, respectively.
if (!empty($context['current_topic']))
echo '
<link rel="prev" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=prev" />
<link rel="next" href="'
$scripturl'?topic='$context['current_topic'], '.0;prev_next=next" />';

// If we're in a board, or a topic for that matter, the index will be the board's index.
if (!empty($context['current_board']))
echo '
<link rel="index" href="'
$scripturl'?board='$context['current_board'], '.0" />';

// Some browsers need an extra stylesheet due to bugs/compatibility issues.
foreach (array('ie7''ie6''webkit') as $cssfix)
if ($context['browser']['is_' $cssfix])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['default_theme_url'], '/css/'$cssfix'.css" />';

// RTL languages require an additional stylesheet.
if ($context['right_to_left'])
echo '
<link rel="stylesheet" type="text/css" href="'
$settings['theme_url'], '/css/rtl.css" />';

echo '
<script type="text/javascript" src="'
$settings['default_theme_url'], '/scripts/script.js?rc3"></script>
<script type="text/javascript" src="'
$settings['theme_url'], '/scripts/theme.js?rc3"></script>
<script type="text/javascript"><!-- // --><![CDATA[
var smf_theme_url = "'
$settings['theme_url'], '";
var smf_default_theme_url = "'
$settings['default_theme_url'], '";
var smf_images_url = "'
$settings['images_url'], '";
var smf_scripturl = "'
$scripturl'";
var smf_iso_case_folding = '
$context['server']['iso_case_folding'] ? 'true' 'false'';
var smf_charset = "'
$context['character_set'], '";'$context['show_pm_popup'] ? '
var fPmPopup = function ()
{
if (confirm("' 
$txt['show_personal_messages'] . '"))
window.open(smf_prepareScriptUrl(smf_scripturl) + "action=pm");
}
addLoadEvent(fPmPopup);' 
'''
var ajax_notification_text = "'
$txt['ajax_in_progress'], '";
var ajax_notification_cancel_text = "'
$txt['modify_cancel'], '";
// ]]></script>'
;


// share this topic facebook like buttom start
if (!empty($modSettings['share_likebutton_enable']))
    {
echo '
<meta property="og:title" content="'
$context['page_title_html_safe'], '"/>
<meta property="og:site_name" content="'
$context['forum_name_html_safe'], '"/>
<meta property="og:image" content="'
, !empty($modSettings['share_likebutton_image']) ?  $modSettings['share_likebutton_image'] : '''"/>';
    
// share this topic facebook like buttom end

    }// Output any remaining HTML headers. (from mods, maybe?)
echo $context['html_headers'];

echo '
<script language="JavaScript" type="text/javascript">
var current_header_am = '
, empty($options['collapse_header_am']) ? 'false' 'true'';

function shrinkHeaderAM(mode)
{'
;

if ($context['user']['is_guest'])
echo '
document.cookie = "upshrinkAM=" + (mode ? 1 : 0);'
;
else
echo '
smf_setThemeOption("collapse_header_am", mode ? 1 : 0, null, "'
$context['session_id'], '");';

echo '
document.getElementById("upshrink_am").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

document.getElementById("upshrinkHeaderAM").style.display = mode ? "none" : "";

current_header_am = mode;
}
</script>


  <script src="http://platform.twitter.com/anywhere.js?id=Oi5KFX7nyLH8QaOtD3f7Bw&amp;v=1">  </script> <script type="text/javascript">  twttr.anywhere(function (T) {    T(".section").hovercards({      username: function(node) {        return node.alt;      }     });     });  </script>        <script src="http://platform.twitter.com/anywhere.js?id=YOUR DEVELOPER ID&amp;v=1">  </script>  <script type="text/javascript">     twttr.anywhere(function(twitter) {              twitter.hovercards();     });  </script>  </head>



<body>'
;
}

function 
template_body_above()
{
global $context$settings$options$scripturl$txt$modSettings;

echo '
<div id="toparea">
<div id="topbox" class="wrapper">
<div id="userarea">'
;
if($context['user']['is_logged'])
{
echo $txt['hello_member_ndt'] , ' <strong>' $context['user']['name'] , '</strong>';

// Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo '&nbsp;&nbsp;[<a href="'$scripturl'?action=pm">'$context['user']['messages'], '/<strong>'$context['user']['unread_messages'] , '</strong></a> '$txt['pm'], ']';

// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin'])
echo '[<strong>'$txt['maintenance'], '</strong>]';

// Are there any members waiting for approval?
if (!empty($context['unapproved_members']))
echo '[<a href="'$scripturl'?action=viewmembers;sa=browse;type=approve">'$context['unapproved_members'] , ' '$txt['memb_approve'], '</a> ]';

echo '&nbsp;&nbsp;<a href="'$scripturl'?action=unread">'$txt['memb_unread'], '</a> / <a href="'$scripturl'?action=unreadreplies">'$txt['replies'], '</a>';

}
else
echo sprintf($txt['welcome_guest'], $txt['guest_title']);

echo '
</div>
</div>
</div>
<div id="mainarea">
<div id="header" class="wrapper">
<div id="logo">
<a href="'
.$scripturl.'" title=""></a>
</div>
<div id="searcharea">'
;
echo '
<form action="'
$scripturl'?action=search2" method="post" accept-charset="'$context['character_set'], '">
<input class="inputbox" type="text" name="search" value="'
$txt['search'], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\''$txt['search'], '...\';" />';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="'
$context['current_topic'], '" />';

// If we're on a certain board, limit it to this board ;).
elseif (!empty($context['current_board']))
echo '
<input type="hidden" name="brd['
$context['current_board'], ']" value="'$context['current_board'], '" />';

echo '
</form>
</div>
</div>'
;
echo'
<div class="wrapper">
<div id="toolbar-l">
<div id="toolbar-r">
<div id="toolbar">
'
,template_menu(),'
</div>
</div>
</div>
<div id="bodybox">
<div id="bdybox-l">
<div id="bdybox-b">
<div id="bdybox-br">
<div id="bdybox-bl">
<div id="bdybox-t">
<div id="bdybox-tr">
<div id="bdybox-tl">'
;

// Show the navigation tree.
//theme_linktree();

}

function 
template_body_below()
{
global $context$settings$options$scripturl$txt$modSettings;

echo '
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>'
;
echo '
</div>'
;

// Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="bottomarea">
<div id="footer">
<div id="footerarea">
<span class="smalltext">DS-Natural designed by <b>DzinerStudio</b><br /><br><br>This 
    site was designed for 1024x768 Best viewed with <a href="http://www.microsoft.com/windows/ie/downloads/default.mspx">Microsoft&reg; Internet Explorer 8.0</a><br>
    2009-2010 <a href="http://www.wheresmyservice.com">Wheres My Service</a> for questions 
    contact <a href="mailto:daniel@[email protected]">Webmaster</a><br>
    All Other Content Copyright&copy; Digital-Wraith. Website Design by <a href="http://www.digital-wraith.com">Digital-Wraith</a>. 
    View our <a href="http://wheresmyservice.com/blog/index.php?action=ezportal;sa=page;p=1">Copyright 
    and Privacy Statement</a>
<br />'
theme_copyright(), '</span>';

// Show the load time?
if ($context['show_load_time'])
echo '
<br /><span class="smalltext">'
$txt['page_created'], $context['load_time'], $txt['seconds_with'], $context['load_queries'], $txt['queries'], '</span>';

echo '
</div>
</div>
</div>'
;
}

function 
template_html_below()
{
global $context$settings$options$scripturl$txt$modSettings;

echo '
</body></html>'
;
}

// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree($force_show false)
{
global $context$settings$options$shown_linktree;

// If linktree is empty, just return - also allow an override.
if (empty($context['linktree']) || (!empty($context['dont_default_linktree']) && !$force_show))
return;

echo '
<div class="navigate_section">
<ul>'
;

// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
echo '
<li'
, ($link_num == count($context['linktree']) - 1) ? ' class="last"' '''>';

// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];

// Show the link, including a URL if it should have one.
echo $settings['linktree_link'] && isset($tree['url']) ? '
<a href="' 
$tree['url'] . '"><span>' $tree['name'] . '</span></a>' '<span>' $tree['name'] . '</span>';

// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];

// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' &#38;#187;';

echo '
</li>'
;
}
echo '
</ul>
</div>'
;

$shown_linktree true;
}

// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context$settings$options$scripturl$txt;

echo '
<div id="topmenu">
<ul>'
;

foreach ($context['menu_buttons'] as $act => $button)
echo '<li><a '$button['active_button'] ? ' class="current"' '' ' href="'$button['href'], '"><span>'$button['title'], '</span></a></li>';

echo '
</ul>
</div>'
;

}

// Generate a strip of buttons.
function template_button_strip($button_strip$direction 'top'$strip_options = array())
{
global $settings$context$txt$scripturl;

if (!is_array($strip_options))
$strip_options = array();

// Create the buttons...
$buttons = array();
foreach ($button_strip as $key => $value)
{
if (!isset($value['test']) || !empty($context[$value['test']]))
$buttons[] = '
<li><a' 
. (isset($value['id']) ? ' id="button_strip_' $value['id'] . '"' '') . ' class="button_strip_' $key '' . (isset($value['active']) ? ' active' '') . '" href="' $value['url'] . '"' . (isset($value['custom']) ? ' ' $value['custom'] : '') . '><span>' $txt[$value['text']] . '</span></a></li>';
}

// No buttons? No button strip either.
if (empty($buttons))
return;

// Make the last one, as easy as possible.
$buttons[count($buttons) - 1] = str_replace('<span>''<span class="last">'$buttons[count($buttons) - 1]);

echo '
<div class="buttonlist'
, !empty($direction) ? ' align_' $direction '''"', (empty($buttons) ? ' style="display: none;"' ''), (!empty($strip_options['id']) ? ' id="' $strip_options['id'] . '"'''), '>
<ul>'
,
implode(''$buttons), '
</ul>
</div>'
;
}

?>

evillive

I ust noticed that all the share links are the same for every post. Not sure if that will be fixed with the template changes or not. You can see on the site what happens when you share.

mirahalo

oh! ok, let me cehck that again, I tested on local before gave it to you, let me check that again

pviagem

Quote from: 130860 on July 30, 2010, 03:40:46 PM
it show the message because you're not log in on Facebook, you need to be log in to facebook to get access to all the stats including how many people like the topic and if your friends liked it will show your friends photo,   go to a topic where the button with that message is show,  open a new tab on your browser, log in to face book,   refresh the topic page, now you will see the change.

Many thanks for this clarification

mirahalo

  alright evillive   use this code:

Code (php) Select
function EzBlockBoardNewsBlock($paramters = array(),$board = null, $length = null, $limit = null, $start = null)
{
global $scripturl, $smcFunc, $txt, $settings, $modSettings, $context;






// Pass all the parematers
foreach($paramters as $myparam)
{
if ($myparam['parameter_name'] == 'board')
$board = (int) $myparam['data'];
if ($myparam['parameter_name'] == 'limit')
$limit = (int) $myparam['data'];

if ($myparam['parameter_name'] == 'length')
$length = (int) $myparam['data'];
}



loadLanguage('Stats');

// Must be integers....
if ($limit === null)
$limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 5;
else
$limit = (int) $limit;

if ($start === null)
$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
else
$start = (int) $start;

if ($length === null)
$length = isset($_GET['length']) ? (int) $_GET['length'] : 0;
else
$length = (int) $length;

$limit = max(0, $limit);
$start = max(0, $start);


// Load the message icons - the usual suspects.
$stable_icons = array('xx', 'thumbup', 'thumbdown', 'exclamation', 'question', 'lamp', 'smiley', 'angry', 'cheesy', 'grin', 'sad', 'wink', 'moved', 'recycled', 'wireless');
$icon_sources = array();
foreach ($stable_icons as $icon)
$icon_sources[$icon] = 'images_url';

// Find the post ids.
$request = $smcFunc['db_query']('', "
SELECT ID_FIRST_MSG
FROM {db_prefix}topics
WHERE ID_BOARD IN($board)
ORDER BY ID_FIRST_MSG DESC
LIMIT $start, $limit");
$posts = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
$posts[] = $row['ID_FIRST_MSG'];
$smcFunc['db_free_result']($request);

if (empty($posts))
return array();

// Find the posts.
$request = $smcFunc['db_query']('', "
SELECT
m.icon, m.subject, m.body, IFNULL(mem.real_name, m.poster_name) AS poster_name, m.poster_time,
t.num_replies, t.ID_TOPIC, m.ID_MEMBER, m.smileys_enabled, m.ID_MSG, t.locked
FROM ({db_prefix}topics AS t, {db_prefix}messages AS m)
LEFT JOIN {db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)
WHERE t.ID_FIRST_MSG IN (" . implode(', ', $posts) . ")
AND m.ID_MSG = t.ID_FIRST_MSG
ORDER BY t.ID_FIRST_MSG DESC
LIMIT " . count($posts));
$return = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
// If we want to limit the length of the post.
if (!empty($length) && $smcFunc['strlen']($row['body']) > $length)
{
$row['body'] = $smcFunc['substr']($row['body'], 0, $length);

// The first space or line break. (<br />, etc.)
$cutoff = max(strrpos($row['body'], ' '), strrpos($row['body'], '<'));

if ($cutoff !== false)
$row['body'] = $smcFunc['substr']($row['body'], 0, $cutoff);
$row['body'] .= '...';
}

$row['body'] = parse_bbc($row['body'], $row['smileys_enabled'], $row['ID_MSG']);

// Check that this message icon is there...
if (empty($modSettings['messageIconChecks_disable']) && !isset($icon_sources[$row['icon']]))
$icon_sources[$row['icon']] = file_exists($settings['theme_dir'] . '/images/post/' . $row['icon'] . '.gif') ? 'images_url' : 'default_images_url';

censorText($row['subject']);
censorText($row['body']);

$return[] = array(
'id' => $row['ID_TOPIC'],
'message_id' => $row['ID_MSG'],
'icon' => '<img src="' . $settings[$icon_sources[$row['icon']]] . '/post/' . $row['icon'] . '.gif" align="middle" alt="' . $row['icon'] . '" border="0" />',
'subject' => $row['subject'],
'time' => timeformat($row['poster_time']),
'timestamp' => forum_time(true, $row['poster_time']),
'body' => $row['body'],
'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0',
'link' => '<a href="' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.0">' . $row['num_replies'] . ' ' . ($row['num_replies'] == 1 ? $txt['ezp_built_news_1'] : $txt['ezp_built_news_2']) . '</a>',
'replies' => $row['num_replies'],
'comment_href' => !empty($row['locked']) ? '' : $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['num_replies'] . ';num_replies=' . $row['num_replies'],
'comment_link' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['num_replies'] . ';num_replies=' . $row['num_replies'] . '">' . $txt['ezp_built_news_3'] . '</a>',
'new_comment' => !empty($row['locked']) ? '' : '<a href="' . $scripturl . '?action=post;topic=' . $row['ID_TOPIC'] . '.' . $row['num_replies'] . '">' . $txt['ezp_built_news_3'] . '</a>',
'poster' => array(
'id' => $row['ID_MEMBER'],
'name' => $row['poster_name'],
'href' => !empty($row['ID_MEMBER']) ? $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] : '',
'link' => !empty($row['ID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['poster_name'] . '</a>' : $row['poster_name']
),
'locked' => !empty($row['locked']),
'is_last' => false
);
}
$smcFunc['db_free_result']($request);

if (empty($return))
return;

$return[count($return) - 1]['is_last'] = true;








foreach ($return as $news)
{
 
// Build list of social icons share this topic mod
$social_icons = '';
$sites = array(
     'ask' => 'http://mystuff.ask.com/mysearch/QuickWebSave?v=1.2&url=%s',
'blinkbits' => 'http://blinkbits.com/bookmarklets/save.php?v=1&source_url=%s',
'blinklist' => 'http://blinklist.com/index.php?Action=Blink/addblink.php&Url=%s',
'bloglines' => 'http://www.bloglines.com/sub/%s',
'bmarks' => 'http://blogmarks.net/my/new.php?mini=1&simple=1&url=%s',
'delicious' => 'http://del.icio.us/post?url=%s',
'digg' => 'http://digg.com/submit?phase=2&url=%s',
'dzone' => 'http://www.dzone.com/links/add.html?description&url=%s',
'facebook' => 'http://www.facebook.com/share.php?u=%s',
'feedmelinks' => 'http://feedmelinks.com/categorize?from=toolbar&op=submit&url=%s',
'furl' => 'http://furl.net/storeIt.jsp?u=%s',
'google' => 'http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=%s',
'live' => 'https://skydrive.live.com/sharefavorite.aspx/.SharedFavorites??marklet=1&url=%s',
'magnolia' => 'http://ma.gnolia.com/bookmarklet/add?url=%s',
'myspace' => 'http://www.myspace.com/index.cfm?fuseaction=postto&amp;c=&amp;t=&amp;u=%s',
'netvouz' => 'http://netvouz.com/action/submitBookmark?url=%s',
'newsvine' => 'http://www.newsvine.com/_wine/save?u=%s',
'oneview' => 'http://www.oneview.de/quickadd/neu/addBookmark.jsf?URL=%s',
'reddit' => 'http://reddit.com/submit?url=%s',
'rojo' => 'http://www.rojo.com/add-subscription/?resource=%s',
'scuttle' => 'http://www.scuttle.org/bookmarks.php/maxpower?action=add&address=%s',
'shadows' => 'http://www.shadows.com/shadows.aspx?url=%s',
'slashdot' => 'http://slashdot.org/bookmark.pl?url=%s',
'spurl' => 'http://www.spurl.net/spurl.php?url=%s',
'squidoo' => 'http://www.squidoo.com/lensmaster/bookmark?%s',
'stumbleupon' => 'http://www.stumbleupon.com/submit?url=%s',
'technorati' => 'http://www.technorati.com/faves?add=%s',
'twitter' => 'http://twitter.com/home?status=%s',
'tipd' => 'http://tipd.com/submit.php?url=%s',
'google' => 'http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=%s',
'yahoo' => 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u=%s',
'gbuzz' => 'http://www.google.com/reader/link?url=%s',


);


foreach($sites as $site => $url){

$entry = 'share_' . $site;
$page_url = $news['href'];
if(!empty($modSettings[$entry]) && $modSettings[$entry]) {
$social_icons .= sprintf('<a href="' . $url . '" target="_blank"><img src="' . $settings['images_url'] . '/share/' . $site . '.gif" align="bottom" title="' . $txt['share_default_tooltip'] . '" alt="' . $txt['share_default_tooltip'] . '" /></a>', urlencode($page_url), $txt[$entry], $txt[$entry]);}

}

echo '
<div>
<div style="float:left;"><a href="', $news['href'], '">', $news['icon'], '</a> <b>', $news['subject'], '</b> </div><div style="float:right;"><div id="fblike" style="float:right; padding:2px;">
<fb:like href="', urlencode($news['href']) ,'"  width="', !empty($modSettings['share_likebutton_width']) ? $modSettings['share_likebutton_width'] : '', '"></fb:like>
             </div></div>
<div class="smaller" style="clear:both;">', $news['time'], ' ', $txt['ezp_built_by'], ' ', $news['poster']['link'], '</div>

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

', $news['link'], $news['locked'] ? '' : ' | ' . $news['comment_link'], '
<br />', $social_icons, '</div>';

if (!$news['is_last'])
echo '
<hr style="margin: 2ex 0;" width="100%" />';
}




}


and the file attached

evillive

Thank you so much it works perfect.

mirahalo

glad it worked ;)  I actually end up using the same on my site which uses SSI :)

loki8

Hi, your mod is just great!!!

I have a problem though...


The Icons do not show. I installed it successfully but this came up.

How do I resolve it?

Thanks

mirahalo

check the FAQ link on the very first post ;)

loki8

Worked! Thanks.


[Off-topic] In the "packages" folder I still see the compressed mods. Are those files necessary for the mods to run? Or are they just waisting my Hosting Space? [Off-topic/]

mirahalo

any mod you install will be stored in your "Packages" directory  when you want to uninstall one mod,  the packager manager will check that directory and will perform the unnistall,  you can delete the share this topic zip within  Packages folder,  but if you do, you wont be able to unistall it with the packager manager, you will have to do it manually.

no, those compressed files are not needed for any mod to work properly.

Greenman

Trying to get SSI to show the buttons too, what part of the index.template code did you modify for evillive?
I have a clean SMF2.0 rc3 install.

GarfieldP

having problems with small buttons?
heres my three buttons I use for twitter facebook and digg.  Any other common social sites I should do?

changed the backround for facebook because of the background of my site.

free to use

mirahalo

Quote from: Greenman on August 03, 2010, 05:35:23 AM
Trying to get SSI to show the buttons too, what part of the index.template code did you modify for evillive?
I have a clean SMF2.0 rc3 install.

I''m currently in the middle of a re-do for this mod, that will allow users to easily add the icons and the facebook like button where needed/wanted.

but if you want I can make those changes for you, just tell me, are you using the SSI echo method or are you using an array?

if you are just using   <?php ssi_boardNews(); ?>   then please attach your SSI.php file,  if you're using an arrary,  post the file where your code is.



@GarfieldP     thank you for sharing ;)

pviagem

Hi

I'm using this MOD and everything is working as expected. The MOD was configured as requested by installation instructions (new application from Facebook developers).

What I would like to know is if I've any chance to use a facebook page instance of the current application.

I've this page http://www.facebook.com/pages/ProximaViagem/141465445876984 [nofollow] which is connected to my personal profile and if I use the "Add Like Box" I receive a Facebook Page Id (the id of the facebook page for this Like Box). Can I use this ID with the MOD?

Basically what I would like it's to replace the Facebook application by this page.

Many thanks for any help or comments.

Greenman

Quote from: 130860 on August 03, 2010, 10:55:03 AM
Quote from: Greenman on August 03, 2010, 05:35:23 AM
Trying to get SSI to show the buttons too, what part of the index.template code did you modify for evillive?
I have a clean SMF2.0 rc3 install.

I''m currently in the middle of a re-do for this mod, that will allow users to easily add the icons and the facebook like button where needed/wanted.

but if you want I can make those changes for you, just tell me, are you using the SSI echo method or are you using an array?

if you are just using   <?php ssi_boardNews(); ?>   then please attach your SSI.php file,  if you're using an arrary,  post the file where your code is.

Oh, if it won't take too long I could wait!  :)

If it'll take a while though, here's my SSI.php. I just want for the facebook "like" button to show up in every first post through <?php ssi_boardNews(); ?>.

mirahalo

mmm, its not recommendable to directly edit SSI.php, so  lets make  an array instead :)

on your page where   <?php ssi_boardNews(); ?>  is, replace   <?php ssi_boardNews(); ?>.   with this:


Code (php) Select
<?php
 
// $board is the id of the board you want to display, null shows it all.
// $limit is the number of news to display, null show it all
// $start is the id of the topic where the news will start to display, null to start of the recent one
// $length well, obviusly is the length of the news post, set null to show it full
 
 
$board_news ssi_boardNews($board null$limit null$start null$length null'array');
global $scripturl$modSettings$txt;

 foreach (
$board_news as $news){

// Build list of social icons share this topic mod
$social_icons '';
$sites = array(
     'ask' => 'http://mystuff.ask.com/mysearch/QuickWebSave?v=1.2&url=%s',
 'blinkbits' => 'http://blinkbits.com/bookmarklets/save.php?v=1&source_url=%s',
 'blinklist' => 'http://blinklist.com/index.php?Action=Blink/addblink.php&Url=%s',
 'bloglines' => 'http://www.bloglines.com/sub/%s',
 'bmarks' => 'http://blogmarks.net/my/new.php?mini=1&simple=1&url=%s',
 'delicious' => 'http://del.icio.us/post?url=%s',
 'digg' => 'http://digg.com/submit?phase=2&url=%s',
 'dzone' => 'http://www.dzone.com/links/add.html?description&url=%s',
 'facebook' => 'http://www.facebook.com/share.php?u=%s',
 'feedmelinks' => 'http://feedmelinks.com/categorize?from=toolbar&op=submit&url=%s',
 'furl' => 'http://furl.net/storeIt.jsp?u=%s',
 'google' => 'http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=%s',
 'live' => 'https://skydrive.live.com/sharefavorite.aspx/.SharedFavorites??marklet=1&url=%s',
 'magnolia' => 'http://ma.gnolia.com/bookmarklet/add?url=%s',
 'myspace' => 'http://www.myspace.com/index.cfm?fuseaction=postto&amp;c=&amp;t=&amp;u=%s',
 'netvouz' => 'http://netvouz.com/action/submitBookmark?url=%s',
 'newsvine' => 'http://www.newsvine.com/_wine/save?u=%s',
 'oneview' => 'http://www.oneview.de/quickadd/neu/addBookmark.jsf?URL=%s',
 'reddit' => 'http://reddit.com/submit?url=%s',
 'rojo' => 'http://www.rojo.com/add-subscription/?resource=%s',
 'scuttle' => 'http://www.scuttle.org/bookmarks.php/maxpower?action=add&address=%s',
 'shadows' => 'http://www.shadows.com/shadows.aspx?url=%s',
 'slashdot' => 'http://slashdot.org/bookmark.pl?url=%s',
 'spurl' => 'http://www.spurl.net/spurl.php?url=%s',
 'squidoo' => 'http://www.squidoo.com/lensmaster/bookmark?%s',
 'stumbleupon' => 'http://www.stumbleupon.com/submit?url=%s',
 'technorati' => 'http://www.technorati.com/faves?add=%s',
 'twitter' => 'http://twitter.com/home?status=%s',
 'tipd' => 'http://tipd.com/submit.php?url=%s',
 'google' => 'http://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=%s',
 'yahoo' => 'http://myweb2.search.yahoo.com/myresults/bookmarklet?u=%s',
 'gbuzz' => 'http://www.google.com/reader/link?url=%s',


);


foreach(
$sites as $site => $url){

$entry 'share_' $site;
$page_url $news['href'];
if(!empty($modSettings[$entry]) && $modSettings[$entry]) {
$social_icons .= sprintf('<a href="' $url '" target="_blank"><img src="' $settings['images_url'] . '/share/' $site '.gif" align="bottom" title="' $txt['share_default_tooltip'] . '" alt="' $txt['share_default_tooltip'] . '" /></a>'urlencode($page_url), $txt[$entry], $txt[$entry]);}

}


echo '
<div>
<a href="'
$news['href'], '">'$news['icon'], '</a> <strong>'$news['subject'], '</strong><br />
<fb:like href="'
urlencode($news['href']) ,'"  width="', !empty($modSettings['share_likebutton_width']) ? $modSettings['share_likebutton_width'] : '''"></fb:like><br />
<div class="smaller">'
$news['time'], ' '$txt['by'], ' '$news['poster']['link'], '</div>

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

'
$news['link'], $news['locked'] ? '' ' | ' $news['comment_link'], '
<br />'
,$social_icons,'</div>';

if (!$news['is_last'])
echo '
<hr style="margin: 2ex 0;" width="100%" />'
;
}
 
 
 
?>



this will show the exact code but with the share icons and the like button.

Greenman

Thanks!

Share buttons work, but no "Like" buttons are showing. :(

gbsothere

Hi, 130860.   :)


I'm helping a member here with her RC3 site and two errors are being generated that refer back to the code for this mod:

   

I've not had any luck searching the first error because it is simply "undefined index:" without saying what the undefined index is (although I would guess they're both the same).

In her case, "undefined index" ties back to line 248 of the Display.template.php
   
if ($share_options[$modSettings['share_options']] == 'share_option1') {


The other error is "Undefined index: share_options" but it didn't come up on search.  It points to line 804 of the same template:

   

if ($share_options[$modSettings['share_options']] == 'share_option3') {



She does have a custom theme, but it has no Display.template.php so it rolls back to default.  Her forum language is English.

I'd sure appreciate any help. 
My apologies, but I am taking a break from accepting PM requests for support.  If I am not currently assisting you, please do not ask as long as this notice is posted.  Thank you.

I Don't Want To Grow Old Alone


It has been proven that Steely Dan reduces the occurrence of road rage, according to an independent study.



A reminder about admin / ftp passwords etc.

Polymath

Would have been good, but I can not get the sharetopic admin page to load to even turn it on and use it.. hangs.
* I don't suffer from insanity; I enjoy every minute of it. *
F.I.G.J.A.M

Advertisement: