HomeSupportDrupal 6.22 Module

Changelog

v1.0 . October, 2011
  • Fixed issue with conflict between already existing ‘News’ content type.
v1.0 . September, 2011
  • Fixed bug with categories not showing up in admin UI.
  • Fixed bug causing post body to delete when edited.
v1.0 . March, 2011
  • Fixed a few small bugs

[Jump to top]

Module Requirements

  • Drupal 6
  • PHP5 on your hosting server, with the cURL Library
  • MYSQL 5.0 database or newer

[Jump to top]

Installation

To install this module you’ll first have to copy the module directory into your *Drupal Installation*/sites/all/modules folder. This is located on your server so you will need to use an FTP client.

Then, navigate to the Module sub section of the Administer menu as shown.

Once there simply enable the “Brafton Scheduled Feed Importer” and save the new configuration.

[Jump to top]

Configuration

To configure this module navigate to the Site Configuration section of the Administer menu.

Here you will need to enter the unique API Key that was given to you. First, select the feed url base for your product. If you are using content from Brafton, use http://api.brafton.com/. Next, enter your unique 36 character API Key. Once you have done this, click “Save configuration.”

At this point your Articles will be updated every time your site runs Cron. Normally this is set to occur once every few hours automatically. To run Cron manually you must navigate to the Status Report section of the Reports menu.

The articles will be imported as a custom content type called “News Article.” Their Drupal machine name for this type is “b_news.” By default, a page is created with a stream of your latest articles at “yourdomain.com/b_news” and a headlines block with titles and links to your 5 most recent articles is added to your admin blocks menu.

[Jump to top]

Image Handling

Download and enable the Content Template module for Drupal. Add the following code to either the body or teaser sections of the News Article content type.

$result_obj = db_query("SELECT large_url FROM {brafton_pictures} WHERE nid = $node->nid");
$result = db_fetch_array($result_obj);
$img_url = $result['large_url'];
print "<img alt="" src="&quot; . $img_url . &quot;" />";

[Jump to top]

Category links in posts

If you are having issues displaying category links in individual posts, download and enable the Content Template module for Drupal. Add the following code to the body section of the News Article content type.

$term = db_query('SELECT t.name, t.tid FROM {taxonomy_index} n LEFT JOIN {taxonomy_term_data} t ON (n.tid = t.tid) WHERE n.nid = :nid', array(':nid' => $node->nid));
$tax = '';
foreach ($term as $record) {
$tax .= l($record->name, 'taxonomy/term/' . $record->tid) . ' ';
}
print $tax;