| 1 |
// $Id$
|
| 2 |
|
| 3 |
=============
|
| 4 |
== Summary ==
|
| 5 |
=============
|
| 6 |
This module provides links to post pages to twitter. Clicking the links will
|
| 7 |
open a new window or tab with twitter in it. The tweet will be in focus and will
|
| 8 |
contain a customizable string (making hashtags possible) which can
|
| 9 |
programmatically include the relevant URL and title. The Shorten URLs module is
|
| 10 |
used to shorten the URLs if it is installed.
|
| 11 |
|
| 12 |
URLs and titles will be for either the node which is being displayed as a
|
| 13 |
teaser or for the current page. Multiple links can appear on the same page, as
|
| 14 |
on a View of teasers. By default, links appear in the Links section when viewing
|
| 15 |
full nodes or teasers.
|
| 16 |
|
| 17 |
Administrators can choose whether to show the link as an icon, an icon and
|
| 18 |
text, or just text. Options can be chosen separately for nodes and teasers.
|
| 19 |
Administrators can also choose which node types the links should appear on, or
|
| 20 |
could choose not to have links show up on nodes at all. If the module is
|
| 21 |
configured not to display links automatically, administrators can display their
|
| 22 |
own links wherever they like by calling tweet_to_twitter(). A more complete
|
| 23 |
explanation is below.
|
| 24 |
|
| 25 |
=====================
|
| 26 |
== Development/API ==
|
| 27 |
=====================
|
| 28 |
If you are using this module to display links to twitter arbitrarily, you will
|
| 29 |
probably be using the tweet_to_twitter() function. This constructs the link
|
| 30 |
you need according to the following arguments. All arguments are optional
|
| 31 |
unless otherwise noted. If no arguments are passed the link constructed will
|
| 32 |
be for the current page according to your settings.
|
| 33 |
|
| 34 |
If you want more control, the _tweet_to_twitter() function takes the same
|
| 35 |
arguments and returns an array in the format required by hook_link()
|
| 36 |
(http://api.drupal.org/api/function/hook_link/6).
|
| 37 |
|
| 38 |
$type
|
| 39 |
Specifies what will show up in the link: the twitter icon, the twitter icon
|
| 40 |
and text, or just text. Pass 'icon' to show just the icon, 'icon_text' to
|
| 41 |
show the icon and text, and 'text' to show just the text. Required if display
|
| 42 |
options for nodes are set to 'none' on the settings page.
|
| 43 |
$format
|
| 44 |
A string representing the tweet text, optionally with the case-insensitive
|
| 45 |
tokens [url] and [title]. If not passed, the format from the settings page
|
| 46 |
will be used.
|
| 47 |
$nid
|
| 48 |
The NID of the node for which the twitter link should be constructed.
|
| 49 |
$q
|
| 50 |
The absolute URL of the page for which the twitter link should be
|
| 51 |
constructed. If this is not the current page, the _title_ MUST be set
|
| 52 |
manually, or it will be incorrect.
|
| 53 |
|
| 54 |
==================
|
| 55 |
== Installation ==
|
| 56 |
==================
|
| 57 |
1. Install this module as usual (FTP the files to sites/all/modules, enable
|
| 58 |
at admin/build/modules). See http://drupal.org/node/176044 for help.
|
| 59 |
2. If you want, go to admin/settings/tweet to change the module's settings.
|
| 60 |
|
| 61 |
===========
|
| 62 |
== Links ==
|
| 63 |
===========
|
| 64 |
Visit the module page for more information.
|
| 65 |
|
| 66 |
Module Page: http://drupal.org/project/tweet
|
| 67 |
Enable Module: http://example.com/?q=admin/build/modules
|
| 68 |
Settings Page: http://example.com/?q=admin/settings/tweet
|
| 69 |
Shorten URLs: http://drupal.org/project/shorten
|