{"id":7781,"date":"2010-01-09T14:01:44","date_gmt":"2010-01-09T14:01:44","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/twitter-image-host\/"},"modified":"2011-08-07T19:11:32","modified_gmt":"2011-08-07T19:11:32","slug":"twitter-image-host","status":"publish","type":"plugin","link":"https:\/\/tah.wordpress.org\/plugins\/twitter-image-host\/","author":1144815,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.6.1","stable_tag":"0.6.1","tested":"3.2.1","requires":"3.0","requires_php":"","requires_plugins":"","header_name":"Twitter Image Host","header_author":"Michael Tyson","header_description":"","assets_banners_color":"","last_updated":"2011-08-07 19:11:32","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/atastypixel.com\/blog\/wordpress\/plugins\/twitter-image-host","header_plugin_uri":"http:\/\/atastypixel.com\/blog\/wordpress\/plugins\/twitter-image-host","header_author_uri":"http:\/\/atastypixel.com\/blog","rating":0,"author_block_rating":0,"active_installs":10,"downloads":5855,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"0.6.1":"<p>Introduces Twitter account to author mapping. Re-login to Twitter to take effect.<\/p>","0.6":"<p>At last, a fix for authentication.  Tweeting from the web interface works again.  If you&#039;re using the plugin with\nTwitter for iOS, you&#039;ll need to reconfigure your Twitter client with the new API endpoint displayed on the plugin&#039;s\nsettings page.<\/p>","0.5.7":"<p>Twitter for iPhone 3.0.1 has a bug that prevents it from sending username and password.  This update supports a workaround; see &quot;Posting Images&quot; in the readme for details.<\/p>","0.5.6":"<p>This release fixes a bug that causes a &#039;not found&#039; error when appending any parameters to the URL, or a trailing slash<\/p>","0.5.4":"<p>This release fixes a bug that prevented filtering based on author from working<\/p>","0.5.3":"<p>This release prevents duplicate uploads - if a duplicate is detected, just returns the URL to the original image<\/p>","0.5":"<p>This is a major release that introduces a widget and shortcode to display entries<\/p>","0.4.4":"<p>This update fixes the HTML image submission form for WP installations within a sub-directory<\/p>","0.4.3":"<p>If you are getting &#039;missing argument&#039; warnings, install this update.<\/p>","0.4.2":"<p>This update fixes a bug that stopped Tweetie 2 for iPhone working with this plugin.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.1","0.2","0.3","0.4","0.4.1","0.4.2","0.4.3","0.4.4","0.5","0.5.1","0.5.2","0.5.3","0.5.4","0.5.5","0.5.6","0.5.7","0.6","0.6.1","0.6.2"],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[1456,163,159],"plugin_category":[50,56],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-7781","plugin","type-plugin","status-publish","hentry","plugin_tags-hosting","plugin_tags-images","plugin_tags-twitter","plugin_category-media","plugin_category-social-and-sharing","plugin_committers-michaeltyson"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/twitter-image-host.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Keep your traffic in the family!  Host Twitter images on your own site, with support for comments and trackbacks, image\nresizing and thumbnailing with Lightbox.<\/p>\n\n<p>Twitter doesn\u2019t yet come with its own inline image support, so we tend to be limited to using image hosting services, \nand linking to them with short URLs. So, services like Twitpic host the image, and we direct traffic to them in return.<\/p>\n\n<p>Better to take advantage of that traffic, and host images on your own site.  This way, viewers come to your site, instead\nof someone else's!<\/p>\n\n<p>Posted images are displayed in your normal WordPress template, with support for comments and trackbacks, without any \nsetup required.  Most themes should work with this, but if not, or if a different layout is required, a custom theme template \ncan also be provided (see 'Creating a Template').<\/p>\n\n<p>Provides an HTML form for posting image content, as well as an API modelled on that of <a href=\"http:\/\/img.ly\/pages\/API\">img.ly<\/a>,\ncompatible with Tweetie (for iPhone) and any other Twitter clients that speak this protocol and offer configuration of\ncustom image hosting services.<\/p>\n\n<p>Uses Twitter's authentication and a list of authorised accounts, so you can let others use your image host too.  You can even \npost status updates to Twitter while submitting images.<\/p>\n\n<p>Provides a widget and shortcode to display uploaded images.  This supports filtering by Twitter account, styling with CSS,\nand Lightbox\/Thickbox.<\/p>\n\n<h3>Widget<\/h3>\n\n<p>To use the widget, simply visit the Widgets page and drag the \"Twitter Images\" widget into a sidebar and configure it.<\/p>\n\n<h3>Shortcode<\/h3>\n\n<p>Shortcodes are snippets of text that can be inserted into pages and posts.  These snippets are replaced by various generated content.\nTwitter Image Host provides a 'twitter-images' shortcode to display images you have uploaded within a page\/post.<\/p>\n\n<p>Available parameters:<\/p>\n\n<pre><code>  count                    Number of items to display\n  id                       Single ID (eg 'abcde') of one image to display, or multiple IDs separated by commas (abcde,fghij)\n  view                     Image thumbnail view: squares, proportional, large or custom\n  custom_thumbnail_width   Custom width for thumbnails, when 'view' is 'custom'\n  custom_thumbnail_height  Custom width for thumbnails, when 'view' is 'custom'\n  custom_thumbnail_crop    Whether to crop custom thumbnails\n  author                   Comma-separated list of Twitter account names to limit results to\n  columns                  Number of columns of images to display \n  lightbox                 'true' to use Lightbox\/Thickbox\n<\/code><\/pre>\n\n<p>Example:<\/p>\n\n<pre><code>  [twitter-images columns=4 lightbox=\"true\"]&lt;h3&gt;PHP function&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>As well as the shortcode, you can also use call <code>twitter_image_host_images()<\/code> from within a template to\nproduce the same output.  Pass the same arguments as the shortcode as associative array values:<\/p>\n\n<pre><code>  &lt;h3&gt;Recently submitted images&lt;\/h3&gt;\n  &lt;?php twitter_image_host_images(array('author' =&gt; 'ATastyPixel', 'columns' =&gt; 6, 'lightbox' =&gt; true)); ?&gt;\n<\/code><\/pre>\n\n<p>Tip: Use this in the <code>twitter-image-host.php<\/code> template (see 'Creating a Single Template', below) to display\nother posted images when viewing an image.  Use <code>the_twitter_image_author()<\/code> to filter the list, to show\nonly other submissions by the same Twitter account as the one of the currently displayed image.<\/p>\n\n<h3>Template Tags<\/h3>\n\n<p>This plugin provides several template tags, for use both in displaying single posts (see 'Creating a Single Template'), and for custom pages which display\nmany posts in a loop (see 'Using Template Tags in a Loop').<\/p>\n\n<p>The available template tags are:<\/p>\n\n<h4>Single Entry Tags<\/h4>\n\n<p><em><code>the_twitter_image_permalink<\/code><\/em><\/p>\n\n<p>Returns the URL to the view page<\/p>\n\n<p><em><code>the_twitter_image_url<\/code><\/em><\/p>\n\n<p>Returns the full URL to the image, or the image thumbnail if the original image was large<\/p>\n\n<p><em><code>the_twitter_full_image_url<\/code><\/em><\/p>\n\n<p>Returns the URL to the full-sized image, if one exists, or false otherwise<\/p>\n\n<p><em><code>the_twitter_image_title<\/code><\/em><\/p>\n\n<p>The title of the image<\/p>\n\n<p><em><code>the_twitter_image_date<\/code><\/em><\/p>\n\n<p>The date (timestamp) of the image - use date() to configure the display<\/p>\n\n<p><em><code>the_twitter_image_author<\/code><\/em><\/p>\n\n<p>The associated Twitter account<\/p>\n\n<p><em><code>the_twitter_image<\/code><\/em><\/p>\n\n<p>Returns HTML to display the image and a link to the full-sized image if it exists, with Lightbox rel tags.<\/p>\n\n<h4>Loop Tags<\/h4>\n\n<p><em><code>query_twitter_images<\/code><\/em><\/p>\n\n<p>Search for Twitter images<\/p>\n\n<p>Available parameters (passed as associative array):<\/p>\n\n<pre><code> count                    Number of items to display\n id                       Single ID (eg 'abcde') of one image to display, or multiple IDs separated by commas (abcde,fghij)\n author                   Comma-separated list of Twitter account names to limit results to\n<\/code><\/pre>\n\n<p><em><code>has_twitter_images<\/code><\/em><\/p>\n\n<p>Use with loop: Determine if there are more images<\/p>\n\n<p><em><code>next_twitter_image<\/code><\/em><\/p>\n\n<p>Use with loop: Get the next image<\/p>\n\n<h4>Creating a Single Template<\/h4>\n\n<p>By default, this plugin will use the standard post template ('single.php').  However, if you wish, you can create a \ncustom template to display hosted images.  The template should be called 'twitter-image-host.php', located within your\ncurrent theme directory.<\/p>\n\n<p>Creating a template to use this information is fairly straightforward if you have just a little knowledge of HTML or PHP:<\/p>\n\n<ol>\n<li>On your server (via an FTP program, etc.), navigate to your current theme.  This will live within <code>wp-content\/themes<\/code>.<\/li>\n<li>Copy an existing template - <code>single.php<\/code> is usually a good candidate - and call it <code>twitter-image-host.php<\/code>.<\/li>\n<li>Open up <code>twitter-image-host.php<\/code>, and delete everything that looks post-related: This usually includes everything between\nthe <code>have_posts<\/code> call and the matching <code>endif<\/code>, and may include some other surrounding content like an 'Edit this post' link.<\/li>\n<li><p>Replace that which you have just deleted with something that uses the 'single entry' template tags above, like the following:<\/p>\n\n<pre><code>&lt;?php echo the_twitter_image() ?&gt;\n&lt;h1 class=\"center\"&gt;&lt;?php echo the_twitter_image_title() ?&gt;&lt;\/h1&gt;\n&lt;p class=\"center\"&gt;\n    From &lt;a href=\"http:\/\/twitter.com\/&lt;?php echo the_twitter_image_author() ?&gt;\"&gt;&lt;?php echo the_twitter_image_author() ?&gt;&lt;\/a&gt;\n     on &lt;?php echo date('F jS, Y', the_twitter_image_date()) ?&gt;\n&lt;\/p&gt;\n<\/code><\/pre><\/li>\n<li><p>Save the file, add some content (see the 'Posting Images' section), and see how it looks.<\/p><\/li>\n<\/ol>\n\n<h4>Using Template Tags in a Loop<\/h4>\n\n<p>Just like the WordPress Loop template tags, the template tags provided by this plugin can be used to display multiple posted entries.\nThis can be used to create a custom page template that lists all submitted entries, with more flexibility than that offered by the shortcode.<\/p>\n\n<p>Use begins with a call to <code>query_twitter_images()<\/code>, possibly with an argument to configure the search.  If the result is true, then the loop begins,\nconditional upon <code>has_twitter_images()<\/code>, and starting with <code>next_twitter_image()<\/code> to load the next entry.  The single template tags can then be used\nto customise the display of each entry.<\/p>\n\n<p>Here is an example of use:<\/p>\n\n<pre><code>  &lt;?php if ( query_twitter_images() ) : ?&gt;\n      &lt;?php while ( has_twitter_images() ) : next_twitter_image(); ?&gt;\n          &lt;div class=\"item entry\"&gt;\n            &lt;div class=\"itemhead\"&gt;\n              &lt;h1&gt;&lt;a href=\"&lt;?php echo the_twitter_image_permalink() ?&gt;\" rel=\"bookmark\"&gt;&lt;?php echo the_twitter_image_title(); ?&gt;&lt;\/a&gt;&lt;\/h1&gt;\n              &lt;div class=\"date\"&gt;&lt;?php echo date('F jS, Y', the_twitter_image_date()) ?&gt;&lt;\/div&gt;\n            &lt;\/div&gt;\n\n            &lt;?php echo the_twitter_image() ?&gt;\n            &lt;p class=\"center\"&gt;From &lt;a href=\"http:\/\/twitter.com\/&lt;?php echo the_twitter_image_author() ?&gt;\"&gt;&lt;?php echo the_twitter_image_author() ?&gt;&lt;\/a&gt;&lt;\/p&gt;\n            &lt;\/div&gt;\n      &lt;?php endwhile; ?&gt;\n  &lt;?php else : ?&gt;\n      &lt;p&gt;There are no Twitter images.&lt;\/p&gt;\n  &lt;?php endif; ?&gt;&lt;h3&gt;Posting Images&lt;\/h3&gt;\n<\/code><\/pre>\n\n<p>To start posting from your WordPress blog, select the \"Twitter Image Host\" menu item from the \"Posts\" administration section.\nEnter a title for your image, select your image file, hit Submit, and you will be given the URL for the image.  If you wish\nto tweet straight from this facility, you will need to follow the instructions from that page to set up the plugin.<\/p>\n\n<p>To access this facility from an application, use the access point displayed on the Twitter Image Host options page under \"Settings\".<\/p>\n\n<p>The API is more-or-less the same as that of <a href=\"http:\/\/twitpic.com\/api.do\">TweetPic<\/a>, <a href=\"http:\/\/img.ly\/pages\/API\">img.ly<\/a>, etc.<\/p>\n\n<p>To post from Twitter (Tweetie 2) for iPhone, visit Twitter\/Tweetie's settings, and within <em>Services, Image Service<\/em>, select 'Custom', then\nenter the API URL as listed on the options page.<\/p>\n\n<h3>Making the URL even shorter<\/h3>\n\n<p>If you run WordPress from a sub-directory (for example, http:\/\/your-site.com\/blog), then the short URLs generated by this plugin will\nlook like <code>http:\/\/your-site\/blog\/xxxxx<\/code>.  You can remove that 'blog' component via a little <code>.htaccess<\/code> trickery.<\/p>\n\n<p>Here's how:<\/p>\n\n<ol>\n<li>Create and open a new file in your site's webroot called \".htaccess\". If there's one already there, just open that up and prepare to edit at the bottom.<\/li>\n<li><p>Add the following, replacing 'blog' with the real subdirectory under which WordPress is installed:<\/p>\n\n<pre><code>&lt;IfModule mod_rewrite.c&gt;\nRewriteEngine On\nRewriteBase \/\nRewriteCond %{REQUEST_URI} ^\/([^\/]+)\/?$\nRewriteCond %{DOCUMENT_ROOT}\/blog\/wp-content\/twitter-image-host-content\/%1.jpg -f [OR]\nRewriteCond %{DOCUMENT_ROOT}\/blog\/wp-content\/twitter-image-host-content\/%1.png -f [OR]\nRewriteCond %{DOCUMENT_ROOT}\/blog\/wp-content\/twitter-image-host-content\/%1.jpeg -f\nRewriteRule (.*) \/blog\/$1 [L]\n&lt;\/IfModule&gt;\n<\/code><\/pre>\n\n<p>This will take any requests that:<\/p>\n\n<ul>\n<li>Are located in the web-root (start with a slash, followed by anything but a slash until the end)<\/li>\n<li>Have a corresponding file within Twitter Image Host's content directory\nThen, it'll rewrite the request silently to the real Twitter Image Host URL, without the viewer seeing.<\/li>\n<\/ul><\/li>\n<li>In Twitter Image Host settings, set the 'Override URL Prefix' option to 'http:\/\/your-site.com\/'<\/li>\n<\/ol>\n\n<h3>Credits<\/h3>\n\n<p>German Translation: <a href=\"http:\/\/mb.walter.silvergeeks.com\/\">Walter G\u00fcldenberg<\/a><\/p>\n\n<!--section=installation-->\n<ol>\n<li>Unzip the package, and upload <code>twitter-image-host<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>Visit the settings page and add your Twitter account to the list of authorised accounts<\/li>\n<li>Start submitting images - See the 'Posting Images' section for more<\/li>\n<\/ol>\n\n<p>If you find Twitter Image Host useful, please consider buying some awesome <a href=\"http:\/\/atastypixel.com\/products\">Mac\/iPhone software<\/a>. Then\ntell all your friends.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt>I get \"Couldn't place uploaded file\" messages<\/dt>\n<dd><p>You probably need to create the folder in which Twitter Image Host stores uploaded images -- it will try to create the folder automatically, but it will fail if it doesn't have permission.<\/p>\n\n<p>Create a folder called <code>twitter-image-host-content<\/code> within the <code>wp-content<\/code> folder of your WordPress installation, and make sure it has write permission for the web server user.<\/p><\/dd>\n<dt>I keep getting 404 errors<\/dt>\n<dd><p>Make sure your blog is using URL rewriting (i.e. your permalink structure is anything but the boring default <code>?p=###<\/code>).<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>0.6.1<\/h4>\n\n<ul>\n<li>Added automatic mapping between Twitter account and author (users prior to 0.6.1 must re-login to Twitter to take effect)<\/li>\n<li>Added German translation, thanks to <a href=\"http:\/\/mb.walter.silvergeeks.com\/\">Walter G\u00fcldenberg<\/a><\/li>\n<li>Improved internal query handling<\/li>\n<\/ul>\n\n<h4>0.6<\/h4>\n\n<ul>\n<li>Updated Twitter authentication support, and moved posting interface to WordPress Admin.<\/li>\n<\/ul>\n\n<h4>0.5.7<\/h4>\n\n<ul>\n<li>Support for Twitter for iPhone 3.0.1 bug (see 'Posting Images' section in readme)<\/li>\n<\/ul>\n\n<h4>0.5.6<\/h4>\n\n<ul>\n<li>Fixed bug that causes 'not found' error when appending any parameters to the URL, or a trailing slash<\/li>\n<\/ul>\n\n<h4>0.5.5<\/h4>\n\n<ul>\n<li>Better error reporting for failed uploads<\/li>\n<\/ul>\n\n<h4>0.5.4<\/h4>\n\n<ul>\n<li>Fixed bug that prevented filtering based on author from working<\/li>\n<\/ul>\n\n<h4>0.5.3<\/h4>\n\n<ul>\n<li>Avoid adding duplicate images - if a duplicate is detected, just returns the URL to the original image<\/li>\n<\/ul>\n\n<h4>0.5.2<\/h4>\n\n<ul>\n<li>Fallback to index.php template if 'single' template can't be found<\/li>\n<\/ul>\n\n<h4>0.5.1<\/h4>\n\n<ul>\n<li>Added character counter to HTML submission form<\/li>\n<li>Bugfix for when content folder doesn't exist<\/li>\n<\/ul>\n\n<h4>0.5<\/h4>\n\n<ul>\n<li>Implemented a widget, shortcode and standalone PHP function to display uploaded images (see documentation)<\/li>\n<li>Implemented loop-style template tags to create custom pages for displaying entries<\/li>\n<\/ul>\n\n<h4>0.4.4<\/h4>\n\n<ul>\n<li>Fix to HTML submission form for WP installations within a sub-directory<\/li>\n<li>If a tweet is too long, report by how many characters<\/li>\n<\/ul>\n\n<h4>0.4.3<\/h4>\n\n<ul>\n<li>Minor tweak to suppress missing argument warnings<\/li>\n<\/ul>\n\n<h4>0.4.2<\/h4>\n\n<ul>\n<li>Improved Twitter error reporting<\/li>\n<li>Fixed bug causing incorrect API response<\/li>\n<\/ul>\n\n<h4>0.4.1<\/h4>\n\n<ul>\n<li>Bugfix in URL creation<\/li>\n<\/ul>\n\n<h4>0.4<\/h4>\n\n<ul>\n<li>Improved support for running out of a sub-directory<\/li>\n<\/ul>\n\n<h4>0.3<\/h4>\n\n<ul>\n<li>Fixed bug that interferes with some other plugins<\/li>\n<\/ul>\n\n<h4>0.2<\/h4>\n\n<ul>\n<li>Proper support for trackbacks, comment feeds, fixed a bug which caused plugin to say Twitter was unavailable when the Twitter account has no direct messages<\/li>\n<\/ul>\n\n<h4>0.1<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Host Twitter images from your blog and keep your traffic, rather than using a service like Twitpic and losing your viewers.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/7781","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=7781"}],"author":[{"embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/michaeltyson"}],"wp:attachment":[{"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=7781"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=7781"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=7781"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=7781"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=7781"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/tah.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=7781"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}