Skip to content

Instantly share code, notes, and snippets.

@shrink
Last active January 4, 2016 20:19
Show Gist options
  • Save shrink/8673013 to your computer and use it in GitHub Desktop.
Save shrink/8673013 to your computer and use it in GitHub Desktop.
A BBCode thing for IPB, take a list of comma separated values as the option and only show the content in those topics. For example "[showin=123,456]Hello![/showin]" would only show in topics of the ID 123 and 456.
<div class="showintopic">
{content}
</div>
<script type="text/javascript">
var showintopics = "{option}";
var topic = String(ipb.topic.topic_id);
var topics = showintopics.split(",");
if (jQuery.inArray(topic, topics) != '-1') {
jQuery('script:last').prev('.showintopic').show();
}
</script>
.showintopic {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment