Open aggregator links in new browser window in Drupal 5 or 6

Many people would like to keep users on their site and in some situations you may find opening aggregator links in a new window accomplishes this. (Be warned, however, that this tactic is sometimes considered underhanded and is generally not accessible.) In order to have users open links in a new browser window instead of leaving your site you can either look at the External Link module or override the aggregator code in your template.php:

Find the function to override

First open aggregator.module in your favorite text editor. Then locate this function in the aggregator.module file:

<?php
function theme_aggregator_page_item($item) {

$source = '';
if ($item->ftitle && $item->fid) {
$source = l($item->ftitle, "aggregator/sources/$item->fid", array('class' => 'feed-item-source')) . ' -';
}

if (date('Ymd', $item->timestamp) == date('Ymd')) {
$source_date = t('%ago ago', array('%ago' => format_interval(time() - $item->timestamp)));
}
else {
$source_date = format_date($item->timestamp, 'custom', variable_get('date_format_medium', 'D, m/d/Y - H:i'));
}

$output .= "

\n";

Add searching to your custom module

In order for a custom module be searchable, the module must support the search hook. Read the Drupal API for the hook_search.

For 4.7 on the new API site:

http://api.drupal.org/api/4.7/function/hook_search

Pathauto: generate URL path aliases automatically

The Pathauto module creates automatic path aliases for content, users, and taxonomy terms, eliminating the need to create them manually. This way, your site is more user and search engine friendly, and more descriptive about its content with less work from your side.

The Pathauto module automatically generates URL/path aliases for various kinds of content (nodes, taxonomy terms, users) without requiring the user to manually specify the path alias. This allows you to have URL aliases like /category/my-node-title  instead of /node/123 . The aliases are based upon a "pattern" system that uses tokens which the administrator can change.

The aliases are generated when you create content in your site and are based upon the pathauto patterns (placeholders) you specify at:

  1. For 6.x :  Administer > Site Building > URL aliases , in the "Automated alias settings" tab.
  2. For 7.x, 8.x :  Administer > Configuration > Search and Metadata > URL aliases , in the "Patterns" tab.

Currency Exchange 1

Currency allows visitors to do currency conversions between different currencies from your web site. It also provides an API that can be used by other modules. It depends on Yahoo! Finance for its information.

Users with the appropriate access level (use currency) will be able to use this feature by entering an amount in the text field, choose the source and target currencies and then perform the conversion to the target currency.

You can:

HOWTO: Display some arbitrary HTML on a specific page based on the URL you are on

This snippet shows you how to insert simple "if" statements in your theme to display html or any other block of code based on the URL you are on. In the example it shows you how to display a block of text before printing out a taxonomy node listing.

1) open up page.tpl.php in your phptemplate theme.
2) Right above where it starts printing out your main content in your theme (usually starts with printing
menu tabs) you can insert some logic.
3) you can use some logic to figure out what page you are on. For instance for the URL:

http://www.example.com/taxonomy/term/10

arg(0) returns 'taxonomy'
arg(1) returns 'term'
arg(2) returns '10'

4) If you want to display some html if you are on that
page, you put in some logic in your theme file (page.tpl.php).


<?php if(arg(0)=='taxonomy' & arg(1)=='term' & arg(2)== '10'): ?>
  This is where you put the html you want to print out
  on this page! It won't print this if we aren't on this
  page.

<?php endif; ?>

MAIN CONTENT

That's all the php you have to type. The logic says, "If we are on the taxonomy/term/10 page, let's print
this html code. Otherwise let's skip it and continue to the main content." You can see that this is

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x