MyBB Community Forums

Full Version: Twitter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is their a code so you can type like [twitter] [/twitter]

and it be like one of the buttons here -- >https://twitter.com/about/resources/buttons#follow

And what ever you put in the middle of twitter it like makes a button that leads to that page?


heres the code
<a href="https://twitter.com/DrugForums" class="twitter-follow-button" data-show-count="false">Follow @DrugForums</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
Regular:
\[twitter\](.*?)\[/twitter\]

Replacement:
<a href="https://twitter.com/$1" class="twitter-follow-button" data-show-count="false">Follow @$1</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>

^^ Could be Improved so it doesn't include the script every single time.
Wow, thank you very much.. Big Grin But how do you make it like with the image as well? So it looks a lot nicer..
Clear you cache and wait some time the image should come up sooner or later.
Akshaya is right, clearing the cache would enable the browsers to get the newer copy with the code and the image would get displayed.
Yah it ended up working.. But didnt have a way to reply cause wasn't around a laptop.. but thank you very much again.. Time try to get a facebook one.. xD