PDA

View Full Version : How to insert content below a bbcode?


piratarg
02-20-2014, 12:56 AM
Hi, I would like to insert an advertisement under a bbcode. Is it possible?

I tried editing the bbcode and adding below:

<vb:if condition="is_member_of($bbuserinfo, 1)">
advertisement
</vb:if>

I also tried creating a new template and adding within the bbcode:

{vb:raw my_template}

But does not work. Please help! :confused:

ozzy47
02-20-2014, 01:01 AM
Edited Post!

Try this:

<div>
<vb:if condition="$show['guest']">
advertisement
</vb:if><br />
</div>

That will show it to guests, since that is what it looks like you are trying to do

piratarg
02-20-2014, 01:45 AM
Thanks ozzy47, but not working. Displays "advertisement" to all groups.

ozzy47
02-20-2014, 01:47 AM
Which one, my revised code above with the <vb:if condition="$show['guest']">?

piratarg
02-20-2014, 01:48 AM
Which one, my revised code above with the <vb:if condition="$show['guest']">?
yes, the same.

ozzy47
02-20-2014, 01:50 AM
That's virtually impossible, I tested this out and it is only showing for guests.

Did you add that code to the bbcode template directly?

piratarg
02-20-2014, 02:02 AM
That's virtually impossible, I tested this out and it is only showing for guests.

Did you add that code to the bbcode template directly?
I edit the bbcode and added below:

Title: Spoiler

Replacement:
<div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px"><u>Spoiler</u>: <input type="button" value="Mostrar" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName(' div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Ocultar'; } else { this.parentNode.parentNode.getElementsByTagName('d iv')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Mostrar'; }">
</div>
<div style="margin: 0px; padding: 6px; border: 0px inset;">
<div style="display: none;">{param}
</div>
</div>
</div>
<div>
<vb:if condition="$show['guest']">
Advertisement
</vb:if>
</div>

I do not work. I doing something wrong?

ozzy47
02-20-2014, 02:08 AM
Well I did not try with a custom bbcode like the spoiler, I tried it with default bbcodes.

Try it with a default one such as bbcode_code which is the code bbcode in the post, # in the editor, and see if it works there.

piratarg
02-20-2014, 02:24 AM
Well I did not try with a custom bbcode like the spoiler, I tried it with default bbcodes.

Try it with a default one such as bbcode_code which is the code bbcode in the post, # in the editor, and see if it works there.
Yes, by editing that template if it works.
Would it be possible to do the same with a custom bbcode? :(

ozzy47
02-20-2014, 02:26 AM
Not sure, you will have to ask in the thread where you got the mod from.

piratarg
02-20-2014, 02:41 AM
Not sure, you will have to ask in the thread where you got the mod from.
Very thanks ozzy47 and excuse my english. Some time ago I try to do this. but I fail.

Maybe creating a plugin, but I do not know how to do. Maybe someone knows and can help me.

piratarg
02-26-2014, 01:21 AM
Sorry, as not achieve what I wanted. I'm using the template "bbcode_code" to integrate advertising, as indicated ozzy47.
But usually displays the contents and in other cases not. I update the page and still no show. After entry to other topics and if shown. What can be happening?

Regards!