vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Show Thread Enhancements - Twitter Anywhere in Postbit and bbcode (https://vborg.vbsupport.ru/showthread.php?t=263372)

boydy 05-08-2011 10:00 PM

Twitter Anywhere in Postbit and bbcode
 
1 Attachment(s)
Hi Guys,

Nice Twitter mod here for you today. It involves creating an anywhere app on the twitter website which then can be used on your forums, it basically involves a custom profile field which the user will put there Twitter username in and then it will be shown in the postbit but with a mouseover popup displaying information about their Twitter account, i've also worked out some bbcode for it so it can be used in posts. To show it a bit better i've attached a couple of screenshots before we get into the install details,

Postbit:

https://vborg.vbsupport.ru/attachmen...1&d=1304956087https://vborg.vbsupport.ru/attachmen...1&d=1304956087

bbcode:

https://vborg.vbsupport.ru/attachmen...1&d=1304956087

https://vborg.vbsupport.ru/attachmen...1&d=1304956087

Like the look of it? Then read on for install instructions!

First off before we do anything we need to create the app on twitter.

Step 1 - Go to https://dev.twitter.com/anywhere/apps/new

Step 2 - Fill out the app details, how to fill it out:

Application Name - Your Website Name

Application Website -
Your Forum URL

Callback URL - Your Forum URL

Default Access Type - Read & Write

Step 3 - After filling out the captcha and accepting the terms you will be provided with a block of code which will look something like this:
HTML Code:

  <script src="http://platform.twitter.com/anywhere.js?id=your-API-Key&amp;v=1">
  </script>
  <script type="text/javascript">
    twttr.anywhere(function(twitter) {
              twitter.hovercards();
    });
  </script>

Only difference is i've not copied the <head> tags as we DO NOT need them so you do not need to copy them either else it will cause problems. Your code will also have an API key where the code above says your-API-Key.

Step 4 - Open template - headinclude and paste in your code from Twitter at the top of the template, again make sure you do not copy the <head> tags. Save.

-------

Ok, we now have the app all setup, now all we need to do is set everything up on your forum.

Step 1 - User profile fields -> Add new user profile field:

Profile Field Type - Single-Line Text Box
Title - Twitter
Description - Insert your Twitter Username.
Field Searchable on Members List - NO
Show on Members List - NO

Step 2 - Open Template - Postbit Templates -> postbit or postbit_legacy (depends on your forum layout postbit is the horizontal postbit and postbit legacy is the vertical postbit)

Find -
HTML Code:

<dt>{vb:rawphrase 'posts'}</dt> <dd>{vb:raw post.posts}</dd>
Add, Under -
HTML Code:

<vb:if condition="$post['field##']">
<dt>Twitter</dt><dd>@<a target ="blank" class="twitter-anywhere-user" href="http://twitter.com/{vb:raw post.field##}">{vb:raw post.field##}</a></dd>
</vb:if>

Replace the 3 ## with the field number of the Twitter profile field you created before, to find out the profile field number go to User Profile Fields -> User profile field manager.

And that's it for your postbit! For the bbcode see below:

------------------

Step 1 - Custom BB Codes -> Add New BB Code

Title - Twitter Anywhere

BB Code Tag Name - twitter

Replacement -
HTML Code:

<a target ="blank" class="twitter-anywhere-user" href="http://twitter.com/{param}">{param}</a>


Example -
@[twitter]Twitter[/twitter]

Use {option} - No

Disable BB Code Within This BB Code -
Yes

Disable Smilies Within This BB Code -
Yes

Disable Word Wrapping Within This BB Code -
Yes

Disable Automatic Link Parsing Within This BB Code
- Yes

You can add an icon at your own discretion.

And that's it! Any questions or issues just post in here. All screenshots are below.

Enjoy! And remember to mark as installed for future updates and support!

Boydy

Brandon Sheley 05-09-2011 04:59 PM

Nice looking mod, I'll take a look at this tonight if I remember :)

[high]* Brandon Sheley tags this mod[/high]

egyptsons 05-09-2011 07:39 PM

Great !!!
I will try it ;))

Thank you

gscimbomcom 05-09-2011 11:13 PM

thnx

CRDeveloper 05-10-2011 04:10 AM

Installed, looking good and very useful!

boydy 05-10-2011 08:26 AM

Thanks people, remember to mark installed though!

harderstylez 05-11-2011 06:38 PM

Awesome mod thnx!

burak61 09-22-2012 09:30 PM

How can i do this for vb 3.8.x ?

00glenn 09-24-2012 12:49 PM

great mod, thanks

xixxon 09-24-2012 03:24 PM

Great !!!


All times are GMT. The time now is 10:47 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01038 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete