. */ ?>

TwCard Options

'; settings_fields( 'twcard-setting' ); ?>
Twitter Username
Twitter Password

Why Provide Twitter Username/Password? Its optional to give twitter username & pass but if you are having difficulty showing a TwCard, you should use a twitter account. This may be needed if your website is constantly using Twitter API.

Default Display

Set Default display mode for the [twcard] shortcode.

Basic: Full :
Show Background Image: Tip: If you would like to change the default background image, save your image as "bkg_twcard.gif" and palce it in the "'.WP_PLUGIN_DIR.'" folder'; echo '

How to use this plugin: Whenever you want to display a TwitterCard, just use the following shortcode:

[twcard sn="world_surfer"] will show a card for the user World_surfer or [twcard sn=" BillGates"] shows a card for Bill Gates. sn means Screen Name, so make sure you use screen names.

You can use the code in pages and posts. You can use the code multiple times in the same page/posts.

If the Twitter service is down, twitter user no longer exists, or the script is unable to connect to the Twitter API service, it will a simple link to the twitter profile.

[twcard] will display in the default mode set above.

If you want to override the default mode. use these codes:

[twcardf sn="X"] for full display mode where X is the screen name.

Or alternatively, [twcardb] to always display in basic mode. for example: [twcardb sn="X"] where X is a screen name.

You can use the Widget from the Appearance > Widgets section.

'; echo '

'; } ////twitter option function function twcard_display($twcardinputdata,$tdisplaymode,$twcardwyes) { $sttwcardz=get_option('optionz'); $sttwcardw=get_option('optionw'); $sttwcardx=get_option('optionx'); $sttwcardy=get_option('optiony'); $hideb=$tdisplaymode; try { $twcard_url_prep = "http://api.twitter.com/1/users/show.xml?screen_name=".$twcardinputdata; $twcard_curl_url =curl_init("$twcard_url_prep"); curl_setopt($twcard_curl_url, CURLOPT_HEADER, 1); curl_setopt($twcard_curl_url,CURLOPT_TIMEOUT, 30); curl_setopt($twcard_curl_url,CURLOPT_RETURNTRANSFER,1); if ($sttwcardx > "") { if ($sttwcardy > "") { curl_setopt($twcard_curl_url, CURLOPT_USERPWD, $sttwcardx.':'.$sttwcardy); } } $twcard_response=curl_exec ($twcard_curl_url); $twcard_output = strstr($twcard_response, 'location; $twcard_name= $twcard_xml->name; $twcard_screen_name = $twcard_xml->screen_name; $twcard_description=$twcard_xml->description; $twcard_twprofimgurl=$twcard_xml->profile_image_url; $twcard_twweburl=$twcard_xml->url; $twcard_followers=$twcard_xml->followers_count; $twcard_following=$twcard_xml->friends_count; $twcard_tweets=$twcard_xml->statuses_count; } catch (exception $e) { echo''.$twcardinputdata.'
'; } // Continue execution if ( $twcard_location=="" || $twcard_screen_name=="" || $twcard_twprofimgurl=="") { if ($twcardwyes=="widget") { echo '">'; echo'
  • @'.$twcardinputdata.'
  • '; echo""; } else { echo''.$twcardinputdata.'
    '; } } else { if ($twcardwyes<>"widget") { $twcard_output_option=''; } echo "$twcard_output_option"; } ?>