Station module archives : Changing path from program id to program title in station schedule

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
gabari's picture

The station_schedule.module places a link to previously broadcast audio files on the program pages using the following lines (about line 568-579)
----------starts -------
/**
* Load listen links for a program.
* @param $program_nid Node id of the program.
* @param $short bool true for short version of links
/
function station_schedule_archive_links($program_nid, $short = FALSE) {
$archive_url = station_get_archive_url();
$may_archive = db_result(db_query('SELECT COUNT(
) FROM {station_schedule_item} s WHERE s.program_nid = %d AND s.may_archive = 1', $program_nid));

if ($archive_url && $may_archive ) {
$listen_url = $archive_url . $program_nid;
/* $rss_url = $archive_url . $program_nid .'/feed';*/
-ends ----
If the program id for the Good Morning Show is 346, the url for the audio archives will be website.com/station/archives/346.

What I'd prefer is to have it use the program title . So instead the url will be website.com/station/archives/good-morning-show

Any suggestions on how to do this?

Comments

RESOLVED

gabari's picture

Ended up using the following in an argument.

if (arg(0) == 'node' && is_numeric(arg(1) ) ) {
$node = node_load(arg(1) );
return str_replace(' ', '-', strtolower($node->title) );

}

Radio

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: