MyBB Community Forums

Full Version: Code on only the OP?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I got the new +1 google code but want it only on the FIRST post of each page in every thread how can i do this?
Install Template Conditionals plugin and wrap the +1 code with this;
<if ({$postcounter} - 1) % {$mybb->settings['postsperpage']} == "0" then>
YOUR_CODE_GOES_HERE
</if>

This'll add the code in the first post only. You just need to add that code in postbit and postbit_classic templates.
Not exactly what i wanted. I was hoping like this.
[Image: 2ebxyqv.png]
But only for the first posy of the topic on all the pages it might have.
Try this:
(2011-06-04, 06:35 AM)Yaldaram Wrote: [ -> ]Install Template Conditionals plugin and wrap the +1 code with this;
<if ({$postcounter} - 1) % {$mybb->settings['postsperpage']} == "0" then>
YOUR_CODE_GOES_HERE
</if>

This'll add the code in the first post only. You just need to add that code in postbit and postbit_classic templates.

Try this. In template 'postbit' and 'postbit_classic', add this:
<if $postcounter == 1 then>
<div style="float:right"><g:plusone></g:plusone></div>
</if>
above
{$post['signature']}
(2011-06-04, 07:48 PM)Aries-Belgium Wrote: [ -> ]Try this. In template 'postbit' and 'postbit_classic', add this:
<if $postcounter == 1 then>
<div style="float:right"><g:plusone></g:plusone></div>
</if>
above
{$post['signature']}
Not exactly what I wanted but close enough.

In postbit and postbit_classic templates, find;
{$post['message']}
and Add the following code just Before that;
<if $postcounter == 1 then>
<div style="float: right;"><g:plusone></g:plusone></div>
</if>
(2011-06-04, 08:10 PM)Yaldaram Wrote: [ -> ]In postbit and postbit_classic templates, find;
{$post['message']}
and Add the following code just Before that;
<if $postcounter == 1 then>
<div style="float: right;"><g:plusone></g:plusone></div>
</if>
Thats what i have, I mean on like page 2, post 1 there would be a +1 to.

You mean +1 button on first post of each page, right ? If so, try this;
In postbit and postbit_classic templates, find;
{$post['message']}
and Add the following code just Before that;
<if $postcounter - 1) % $mybb->settings['postsperpage'] == "0" then>
<div style="float: right;"><g:plusone></g:plusone></div>
</if>
Pages: 1 2