You are here

function jquery_social_stream_instagram_form in jQuery social stream 8.2

Same name and namespace in other branches
  1. 8 jquery_social_stream.module \jquery_social_stream_instagram_form()
  2. 7.2 jquery_social_stream.module \jquery_social_stream_instagram_form()
  3. 7 jquery_social_stream.module \jquery_social_stream_instagram_form()

Instagram settings form.

File

./jquery_social_stream.module, line 691
Code for the Campaign social media module.

Code

function jquery_social_stream_instagram_form($conf) {
  $form = array();
  $access_token = \Drupal::config('jquery_social_stream.settings')
    ->get('instagram_access_token');
  if (!$access_token) {
    $form['#description'] = t('Please note you must enter Instagram API info at <a href="/admin/config/services/jquery-social-stream">admin/config/services/jquery-social-stream</a> to display Instagram feed');
  }
  _jquery_social_stream_settings_text($form, $conf, 'id', 'Instagram ID', '<p>Instagram can handle 4 different types of network feed ID - search, tags, user ID and a location ID:</p>
<dl>
<dt>Search</dt><dd>This will return Instagram posts based on a geographical location, which is defined by a latitude &amp; longitude plus a distance. To enter a search ID start with the character "?" followed by the latitude, longitude and distance in meters (up to a maximum of 5000) all separated by a "/" (e.g. <em>?55.5/0/20</em>)</dd>
<dt>Tags</dt><dd>To search by tag start with the character "#" followed by the tag (e.g. <em>#london</em>)</dd>
<dt>User ID</dt><dd>To show latest posts by user start the ID with a "!" followed by the user\'s profile ID (e.g. <em>!12345</em>)</dd>
<dt>Location ID</dt><dd>To show latest posts by a location ID start with a "@" followed by the ID (e.g. <em>@12345</em>)</dd>
</dl>
<p>As with all networks multiple feeds can be entered by separating each feed ID with a comma:  e.g. id: <em>?50.3/40.8/10,#london,!12345,@12345</em></p>', '', 512);
  _jquery_social_stream_settings_text($form, $conf, 'intro', 'Feed item intro text', '', 'Posted');
  _jquery_social_stream_settings_text($form, $conf, 'search', 'Search item intro text', '', 'Search');
  _jquery_social_stream_settings_text($form, $conf, 'out', 'Output', 'Stream item output: content blocks & order. Available options: intro, thumb, text, user, share, meta', 'intro,thumb,text,user,share,meta');
  _jquery_social_stream_settings_text($form, $conf, 'comments', 'Number of comments to display', 'Enter the maximum number of comments to display for each instagram image. Set to zero to disable comments.', '0');
  _jquery_social_stream_settings_text($form, $conf, 'likes', 'Number of likes to display', 'Enter the maximum number of profile thumbnails to display for users who have liked a post. Set to zero to disable likes.', '0');
  _jquery_social_stream_settings_select($form, $conf, 'thumb', 'Width & Height of image', '', array(
    'thumbnail' => t('Thumbnail (150 px)'),
    'low_resolution' => t('Low resolution (306 px)'),
    'standard_resolution' => t('Standard resolution (612 px)'),
  ), 'low_resolution');
  return $form;
}