Download the original Simple RSS Feed Reader module and unpack the zipfile in a local directory on your harddisk. After unpacking you will see a filestructure similar to this:

To display the author's name and an optional link to their twitter page in the module, I suggest you add two new parameters to the module:
- a parameter to indicate if you want to show the author or not
- a parameter to indicate if you want to link the author's name to its twitter homepage or not
Modifying the main XML file
To do that, you need to add the two parameters to the mod_jw_srfr.xml file. As you may know, all parameters of a Joomla! module are defined in the xml-file of that module. So you need to add the new parameters there. First, open the xml-file in a text editor and lookup line number 19 in the xml file:
<param name="" type="header" default="Feed Content Options" label="" description="" />
Then, below this line, insert the following code:
<param name="feedItemAuthor" type="radio" default="0" label="Feed item author" description="Display the syndicated article author or not.">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
<param name="feedItemAuthorLink" type="radio" default="0" label="Feed item author link" description="Display link to the syndicated article author or not.">
<option value="0">Hide</option>
<option value="1">Show</option>
</param>
Save the xml-file and you're done here.
Modifying the main PHP file
The next file you are going to modify is mod_jw_srfr.php. The function of this file is to read all parameters that have been set and then call the functions to generate the output. As you have just added two new parameters, you need to modify this file too. Open the file in a text editor and lookup line number 39:
$feedTitle = $params->get('feedTitle',1);
Below this line, insert the following two lines:
$feedItemAuthor = $params->get('feedItemAuthor',0);
$feedItemAuthorLink = $params->get('feedItemAuthorLink',0);
Now, what is happening here? The code reads the settings of the two parameters feedItemAuthor and feedItemAuthorLink and stores the settings in the PHP variables $feedItemAuthor and $feedItemAuthorLink. If the parameters are not set, a default value of 0 is stored in the variables.
Save the file and you're done here too.
Modifying the helper.php file
The following file that needs to be changed is helper.php. This file defines various php classes that actually get the RSS feeds from the source. Because you also want to display the name of the author and optionally display the link to their Twitter's homepage you need to change this file too. Open the file in a text editor and lookup line number 39:
$feedElements[$key]->itemTitle = $item->get_title();
Above this line, insert the following two lines:
$feedElements[$key]->itemAuthor = $item->get_author()->get_name();
$feedElements[$key]->itemAuthorLink = $item->get_author()->get_link();
What is done here is, is request the author's name and link anf store that inside the $feedElements variable that holds all information about the RSS feed. You can then later use these values in the code that actually displays the RSS feed.
Save the file and you're done.
Modifying the template
As with all MVC (Model-View-Controller) built modules for Joomla! 1.5, the way the output is generated by a module, is defined in the module view. For the Joomlaworks Simple RSS Feed Reader module you have the option to choose between two types of output: default or compact. In this example you are going to modify the default view.
Navigate to the tmpl/default folder and open the file default.php in your text editor. At line 42 of this file we see the start of the main loop that displays all feeds:
<?php foreach($output as $key=>$feed): ?>
<li class="srfrRow">
Within the main foreach loop, for every feed a li list-item is created. Just below line 43, the line with the li tag add the following lines:
<?php if($feedItemAuthor): ?>
<?php if($feedItemAuthorLink): ?>
<a class="srfrFeedItemAuthorLink" href="<?php echo $feed->itemAuthorLink; ?>" target="_blank"><span class="srfrFeedItemAuthor"><?php echo $feed->itemAuthor; ?></span></a>
<?php else: ?>
<span class="srfrFeedItemAuthor"><?php echo $feed->itemAuthor; ?></span>
<?php endif; ?>
What is happening here? In the first line the code checks to see if the author needs to be displayed.
In the next line, the code checks to see of the author needs te be shown as a link or not. If so, the author is displayed as a link, otherwise as plain text.
As you can see, the code adds the proper css classes, so you can style the link and the title by applying the desired css styling to your template's css file.
Don't want to edit it all? Just download it here
If you are a little uncomfortable editing all these files, you can download a fully modified version here.
If you installed the module like I described in the first blogpost, then you can now simpled re-install the modified version. After installation check the module's parameters below Feed Content Options:

You now see the two new options, Feed item author and Feed item author link. I have set them both to Show on my local website and here's how it looks at the frontend:

If you just set Feed item author to Show and Feed item author link to Hide you will see that the module does show the author's name, but it doesn't have the link to the Twitter page.
I hope you enjoyed these two blogposts and good luck creating your own Twitter modules!

