Page 1 of 2

“AddThis” under first post

Posted: 22 Jun 2010, 15:54
by Makis
Would anyone (stoker :-D ) please tell me how to add (“AddThis” sharing tool) under first posts in specific forum?

Thanks in advance

Re: “AddThis” under first post

Posted: 22 Jun 2010, 17:12
by cisco007
well i guess you would first have to get the ID of all the forums in which you would like it to show, and in viewtopic_body.html add your addthis code in between this

Code: Select all

<!-- IF FORUM_ID eq x or FORUM_ID eq x and postrow.S_FIRST_ROW --> addthis code here<!-- ENDIF -->
 
and add it all before <!-- END POSTROW -->

replace the x with the ID number of the forum number you wish for it to show!
I think that will work, i have tried it before, but not lately!

[edit]small edit to the code![/edit]

Re: “AddThis” under first post

Posted: 22 Jun 2010, 18:09
by Makis
Thanks a lot cisco007 but I get this

Code: Select all

Parse error: syntax error, unexpected T_LNUMBER in /home/ourdogs/public_html/ad/includes/template.php(175) : eval()'d code on line 168

Re: “AddThis” under first post

Posted: 22 Jun 2010, 18:22
by cisco007
can you post the code and edits you used!? and to what file(s)?

Re: “AddThis” under first post

Posted: 22 Jun 2010, 18:30
by Makis
In viewtopic_body.html and before <!-- END POSTROW -->

Code: Select all

<!-- IF postrow.S_FIRST_ROW -->
<!-- IF FORUM_ID 31 --> '<div class="addthis_toolbox addthis_default_style">
'<a href="http://www.addthis.com/bookmark.php?v=250&username=ourdogs" class="addthis_button_compact">Share</a>
'<span class="addthis_separator">|</span>
'<a class="addthis_button_facebook"></a>
'<a class="addthis_button_live"></a>
'<a class="addthis_button_myspace"></a>
'<a class="addthis_button_google"></a>
'<a class="addthis_button_twitter"></a>
'<a class="addthis_button_delicious"></a>
'<a class="addthis_button_digg"></a>
'
'</div>
'<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=ourdogs"></script><!-- ENDIF -->
<!-- ENDIF --> 
Edit: I just show your edit, let me try again…

Re: “AddThis” under first post

Posted: 22 Jun 2010, 18:38
by cisco007
you did not add the code like i posted in my previous post you are supposed to use
<!-- IF FORUM_ID eq 31 -->
you forgot the eq you must have added the code before you saw my edited post!
and my I ask why all the ' in the code?

Re: “AddThis” under first post

Posted: 22 Jun 2010, 19:06
by Makis
and my I ask why all the ' in the code?
I don’t know for these probably became from copy past, anyway it works now but not only under the first but under all posts in every topic.
And if I’m not asking too much cisco007 I imagine this align center

The code as it is now

Code: Select all

<!-- IF FORUM_ID eq 30 or FORUM_ID eq 31 and postrow.S_FIRST_ROW --> <!-- AddThis Button BEGIN -->
<div class="addthis_toolbox addthis_default_style">
<a href="http://www.addthis.com/bookmark.php?v=250&username=xa-4c20ddf6669ece0a" class="addthis_button_compact">Share</a>
<span class="addthis_separator">|</span>
<a class="addthis_button_facebook"></a>
<a class="addthis_button_myspace"></a>
<a class="addthis_button_google"></a>
<a class="addthis_button_twitter"></a>
</div>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4c20ddf6669ece0a"></script>
<!-- AddThis Button END --><!-- ENDIF -->

Re: “AddThis” under first post

Posted: 22 Jun 2010, 19:23
by Makis
------- SOLVED --------

Just tell me if you please how to align it to center? ;)

PS:
Can I save the html in utf-8

Re: “AddThis” under first post

Posted: 22 Jun 2010, 19:31
by cisco007
glad you got it working because it was working for me! I cannot get it to center either!

don't really know why you want to save it as utf-8, don't know since i just use notepad++ and save it as is and have no problems!

Re: “AddThis” under first post

Posted: 22 Jun 2010, 20:19
by Makis
I know who knows about that center thing I hope he will see,
anyway thank you very much for your help!! :thumb: