|
|
Joined: Jun 2006
Posts: 693
Addict
|
|
Addict
Joined: Jun 2006
Posts: 693 |
Greetings - I have social networking buttons at the bottom of all my posts. You can see them here for example - http://forums.bellaonline.com/ubbthreads.php/topics/431034/Weight_Milestone_Signs#Post431034I'm trying to add a Google Plus button into that line. I'm editing post_side.tpl. However the Google Plus code involves a left squiggle bracket. That then is not passed through the regular UBB interpretation. How do I get the left squiggle bracket to be ignored by UBB so it can be active in the final webpage? Lisa
|
|
|
|
|
Joined: Jun 2006
Posts: 693
Addict
|
|
Addict
Joined: Jun 2006
Posts: 693 |
I played with the Google+ options and found an option that didn't use the { - I'd still be interested in how to do it though.
|
|
|
|
|
Joined: Jan 2004
Posts: 2,474 Likes: 3
Pooh-Bah
|
|
Pooh-Bah
Joined: Jan 2004
Posts: 2,474 Likes: 3 |
Hi Lisa, Google gave me this code...
<g:plusone size="small"></g:plusone>
It works  I haven't seen anything that needed curly braces.
|
|
|
|
|
Joined: Jun 2006
Posts: 869
old hand
|
|
old hand
Joined: Jun 2006
Posts: 869 |
I have it in the top left of www.clubadventist.com feel free to like it 
|
|
|
|
|
Joined: Jan 2004
Posts: 2,474 Likes: 3
Pooh-Bah
|
|
Pooh-Bah
Joined: Jan 2004
Posts: 2,474 Likes: 3 |
Ahh sorry Lisa, were you talking about this bit...?
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"> {lang: 'en-GB'} </script>
I keep that in my HTML Includes Header Insert.
|
|
|
|
|
Joined: Apr 2007
Posts: 3,940 Likes: 1
Former Developer
|
|
Former Developer
Joined: Apr 2007
Posts: 3,940 Likes: 1 |
if you want a left 'squiggle' in any .tpl file you do {ldelim} right 'squiggle' --> {rdelim} just an fyi  addionally, you can just surround the code with {literal} crazy code with { and } here {/literal} instead 
|
|
|
|
|
Joined: Jun 2006
Posts: 16,532 Likes: 150
|
|
Joined: Jun 2006
Posts: 16,532 Likes: 150 |
I go with the literal code when I need it
|
|
|
|
|
Joined: Jun 2006
Posts: 693
Addict
|
|
Addict
Joined: Jun 2006
Posts: 693 |
Ah, Literal sounds perfect! Thanks so much, I'll remember that for the future!
|
|
|
|
|
Joined: Jun 2006
Posts: 693
Addict
|
|
Addict
Joined: Jun 2006
Posts: 693 |
I thought I'd post an update so anybody who wants to have the row of social networking buttons like I use in the BellaOnline forums has quick, easy code to cut and paste into their site. This is notated for version 7.5.7.
========================================================================
INITIALIZE GOOGLE +1 CODE ONCE
in /templates/default/header.tpl
line 43
just before </head>, add:
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
This initializes the Google +1 button code.
========================================================================
SET VARIABLE FOR USE IN SOCIAL SCRIPTS
in /scripts/showflat.inc.php
line 913
look for:
$postrow[$i]['Subject'] = $results[$i]['POST_SUBJECT'];
add in after that:
// LISA ADDED FOR SOCIAL NETWORKING
$postrow[$i]['SubjectSocial'] = $results[$i]['POST_SUBJECT'];
========================================================================
DRAW THE VISIBLE BUTTONS ON EACH INDIVIDUAL POST
in /templates/default/post_side.tpl
Starting at line 100 it says:
<td class="post_top_link" valign="bottom">
<a href="#top">{$lang.TOP}</a>
</td>
<td class="post-options" valign="bottom" align="right">
replace those four lines with the entire block below between the squiggles
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<!-- LISA CODE FOR SOCIAL NETWORKING START -->
<td class="post_top_link" valign="bottom">
<a href="#top">{$lang.TOP}</a>
</td>
<td valign="bottom">
<table border=0 cellspacing="0" cellpadding="0" width=100%><TR><TD class="post-options" valign="bottom" align="left">
<g:plusone size="small" annotation="inline" width="150"></g:plusone>
<BR>
<a rel="nofollow" href="http://twitter.com/home?status={$postrow[post].SubjectSocial}%20{$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}" title="Post {$postrow[post].SubjectSocial} to Twitter" target="_blank"><img src="{$config.FULL_URL}/images/social/twitter.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Twitter" title="Add {$postrow[post].SubjectSocial} to Twitter " /></a>
<a rel="nofollow" href="http://www.facebook.com/sharer.php?u={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&t={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Facebook" target="_blank"><img src="{$config.FULL_URL}/images/social/facebook.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Facebook" title="Add {$postrow[post].SubjectSocial} to Facebook " /></a>
<a rel="nofollow" href="http://www.myspace.com/Modules/PostTo/Pages/?u={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&t={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to MySpace" target="_blank"><img src="{$config.FULL_URL}/images/social/myspace.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to MySpace" title="Add {$postrow[post].SubjectSocial} to MySpace " /></a>
<a rel="nofollow" href="http://del.icio.us/post?url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Add {$postrow[post].SubjectSocial} to del.icio.us" target="_blank"><img src="{$config.FULL_URL}/images/social/delicious.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Del.icio.us" title="Post {$postrow[post].SubjectSocial} to Del.icio.us" /></a>
<a rel="nofollow" href="http://digg.com/submit?phase=2&url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Digg {$postrow[post].SubjectSocial}" target="_blank"><img src="{$config.FULL_URL}/images/social/digg.gif" border="0" alt="Digg {$postrow[post].SubjectSocial}" title="Digg {$postrow[post].SubjectSocial}" /></a>
<a rel="nofollow" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&t={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Yahoo My Web" target="_blank"><img src="{$config.FULL_URL}/images/social/yahoomyweb.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Yahoo My Web" title="Add {$postrow[post].SubjectSocial} to Yahoo My Web" /></a>
<a rel="nofollow" href="http://www.google.com/bookmarks/mark?op=edit&bkmk={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Google Bookmarks" target="_blank"><img src="{$config.FULL_URL}/images/social/googlebookmarks.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Google Bookmarks" title="Add {$postrow[post].SubjectSocial} to Google Bookmarks" /></a>
<a rel="nofollow" href="http://www.stumbleupon.com/submit?url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Stumbleupon" target="_blank"><img src="{$config.FULL_URL}/images/social/stumbleupon.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Stumbleupon" title="Add {$postrow[post].SubjectSocial} to Stumbleupon" /></a>
<a rel="nofollow" href="http://reddit.com/submit?url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Reddit" target="_blank"><img src="{$config.FULL_URL}/images/social/reddit.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Reddit" title="Add {$postrow[post].SubjectSocial} to Reddit" /></a>
</TD><td bgcolor="#F9F9F5" valign="bottom" align="right" class="post-options" >
<!-- LISA CODE FOR SOCIAL NETWORKING END -->
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Then down near line 150
{if $postrow[post].mailpostlink}
<span class="post-buttons"><a href="{$postrow[post].mailpostlink}" rel="nofollow"><img src="{$config.BASE_URL}/images/{$style_array.general}/email.gif" alt="" /> {$lang.EMAIL_POST}</a></span>
{/if}
</td>
</tr>
Change that to
{if $postrow[post].mailpostlink}
<span class="post-buttons"><a href="{$postrow[post].mailpostlink}" rel="nofollow"><img src="{$config.BASE_URL}/images/{$style_array.general}/email.gif" alt="" /> {$lang.EMAIL_POST}</a></span>
{/if}
</td>
</tr>
</table>
</TD></TR>
========================================================================
GOOGLE PLUS LOAD POST-PAGE-DRAW FOR SPEED
needs to go after all +1 buttons, so put in footer. Note you have to escape the } and { with literal so they're not processed
in /templates/default/footer.tpl
around line 47, before div id=footer
<!-- LISA CODE TO LOAD GOOGLE +1 BUTTON AFTER PAGE LOAD -->
<script type="text/javascript">
(function() {literal}{{/literal}
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
{literal}}{/literal})();
</script>
<!-- END CODE -->
========================================================================
DRAW VISIBLE BUTTONS AT BOTTOM OF PAGE THAT LISTS ALL THREADS IN A GIVEN TOPIC
/templates/default/postlist.tpl
line 316 - bottom - after $ishopto section
<!-- LISA CODE FOR SOCIAL NETWORKING -->
<table border=0 cellspacing="0" cellpadding="0" width=100%><TR><TD class="post-options" valign="bottom" align="left">
<g:plusone size="small" annotation="inline" width="150"></g:plusone>
<BR>
<a rel="nofollow" href="http://twitter.com/home?status={$postrow[post].SubjectSocial}%20{$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}" title="Post {$postrow[post].SubjectSocial} to Twitter" target="_blank"><img src="{$config.FULL_URL}/images/social/twitter.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Twitter" title="Add {$postrow[post].SubjectSocial} to Twitter " /></a>
<a rel="nofollow" href="http://www.facebook.com/sharer.php?u={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&t={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Facebook" target="_blank"><img src="{$config.FULL_URL}/images/social/facebook.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Facebook" title="Add {$postrow[post].SubjectSocial} to Facebook " /></a>
<a rel="nofollow" href="http://www.myspace.com/Modules/PostTo/Pages/?u={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&t={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to MySpace" target="_blank"><img src="{$config.FULL_URL}/images/social/myspace.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to MySpace" title="Add {$postrow[post].SubjectSocial} to MySpace " /></a>
<a rel="nofollow" href="http://del.icio.us/post?url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Add {$postrow[post].SubjectSocial} to del.icio.us" target="_blank"><img src="{$config.FULL_URL}/images/social/delicious.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Del.icio.us" title="Post {$postrow[post].SubjectSocial} to Del.icio.us" /></a>
<a rel="nofollow" href="http://digg.com/submit?phase=2&url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Digg {$postrow[post].SubjectSocial}" target="_blank"><img src="{$config.FULL_URL}/images/social/digg.gif" border="0" alt="Digg {$postrow[post].SubjectSocial}" title="Digg {$postrow[post].SubjectSocial}" /></a>
<a rel="nofollow" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&t={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Yahoo My Web" target="_blank"><img src="{$config.FULL_URL}/images/social/yahoomyweb.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Yahoo My Web" title="Add {$postrow[post].SubjectSocial} to Yahoo My Web" /></a>
<a rel="nofollow" href="http://www.google.com/bookmarks/mark?op=edit&bkmk={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Google Bookmarks" target="_blank"><img src="{$config.FULL_URL}/images/social/googlebookmarks.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Google Bookmarks" title="Add {$postrow[post].SubjectSocial} to Google Bookmarks" /></a>
<a rel="nofollow" href="http://www.stumbleupon.com/submit?url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Stumbleupon" target="_blank"><img src="{$config.FULL_URL}/images/social/stumbleupon.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Stumbleupon" title="Add {$postrow[post].SubjectSocial} to Stumbleupon" /></a>
<a rel="nofollow" href="http://reddit.com/submit?url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Reddit" target="_blank"><img src="{$config.FULL_URL}/images/social/reddit.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Reddit" title="Add {$postrow[post].SubjectSocial} to Reddit" /></a>
</TD></TR></TABLE>
<!-- END LISA CODE -->
========================================================================
DRAW VISIBLE BUTTONS AT BOTTOM OF MAIN FORUM PAGE THAT LISTS CATEGORY AREAS
/templates/default/forum.tpl
line 114 - bottom - after $tbclose and /section
<!-- LISA CODE FOR SOCIAL NETWORKING -->
<table border=0 cellspacing="0" cellpadding="0" width=100%><TR><TD class="post-options" valign="bottom" align="left">
<g:plusone size="small" annotation="inline" width="150"></g:plusone>
<BR>
<a rel="nofollow" href="http://twitter.com/home?status={$postrow[post].SubjectSocial}%20{$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}" title="Post {$postrow[post].SubjectSocial} to Twitter" target="_blank"><img src="{$config.FULL_URL}/images/social/twitter.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Twitter" title="Add {$postrow[post].SubjectSocial} to Twitter " /></a>
<a rel="nofollow" href="http://www.facebook.com/sharer.php?u={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&t={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Facebook" target="_blank"><img src="{$config.FULL_URL}/images/social/facebook.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Facebook" title="Add {$postrow[post].SubjectSocial} to Facebook " /></a>
<a rel="nofollow" href="http://www.myspace.com/Modules/PostTo/Pages/?u={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&t={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to MySpace" target="_blank"><img src="{$config.FULL_URL}/images/social/myspace.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to MySpace" title="Add {$postrow[post].SubjectSocial} to MySpace " /></a>
<a rel="nofollow" href="http://del.icio.us/post?url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Add {$postrow[post].SubjectSocial} to del.icio.us" target="_blank"><img src="{$config.FULL_URL}/images/social/delicious.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Del.icio.us" title="Post {$postrow[post].SubjectSocial} to Del.icio.us" /></a>
<a rel="nofollow" href="http://digg.com/submit?phase=2&url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Digg {$postrow[post].SubjectSocial}" target="_blank"><img src="{$config.FULL_URL}/images/social/digg.gif" border="0" alt="Digg {$postrow[post].SubjectSocial}" title="Digg {$postrow[post].SubjectSocial}" /></a>
<a rel="nofollow" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&t={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Yahoo My Web" target="_blank"><img src="{$config.FULL_URL}/images/social/yahoomyweb.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Yahoo My Web" title="Add {$postrow[post].SubjectSocial} to Yahoo My Web" /></a>
<a rel="nofollow" href="http://www.google.com/bookmarks/mark?op=edit&bkmk={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Google Bookmarks" target="_blank"><img src="{$config.FULL_URL}/images/social/googlebookmarks.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Google Bookmarks" title="Add {$postrow[post].SubjectSocial} to Google Bookmarks" /></a>
<a rel="nofollow" href="http://www.stumbleupon.com/submit?url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Stumbleupon" target="_blank"><img src="{$config.FULL_URL}/images/social/stumbleupon.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Stumbleupon" title="Add {$postrow[post].SubjectSocial} to Stumbleupon" /></a>
<a rel="nofollow" href="http://reddit.com/submit?url={$config.FULL_URL}/ubbthreads.php{$var_start}ubb{$var_eq}showflat{$var_sep}Number{$var_eq}{$postrow[post].Number}%2F%23Post{$postrow[post].Number}&title={$postrow[post].SubjectSocial}" title="Post {$postrow[post].SubjectSocial} to Reddit" target="_blank"><img src="{$config.FULL_URL}/images/social/reddit.gif" border="0" alt="Add {$postrow[post].SubjectSocial} to Reddit" title="Add {$postrow[post].SubjectSocial} to Reddit" /></a>
</TD></TR></TABLE>
<!-- END LISA CODE -->
========================================================================
ACTUAL IMAGES
if needed move in all /images/social/ from backup (should still be there from before)
|
|
|
|
0 members (),
253
guests, and
121
robots. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
|