Fixed bug in RSS xml file generation.

Fixed bug in file and picture links.
This commit is contained in:
vyshane
2006-02-20 03:02:32 +00:00
parent af25f45e1a
commit e5689267df
3 changed files with 13 additions and 11 deletions
+6 -5
View File
@@ -120,22 +120,23 @@ class data_field_file extends data_field_base {// extends
function display_browse_field($fieldid, $recordid, $template) {
global $CFG, $USER, $course;
global $CFG, $USER;
$field = get_record('data_fields', 'id', $fieldid);
$data = get_record('data', 'id', $field->dataid);
if ($content = get_record('data_content', 'fieldid', $fieldid, 'recordid', $recordid)){
$contents[0] = $content->content;
$contents[1] = $content->content1;
$src = empty($contents[0])? '':$contents[0];
$name = empty($contents[1])? $src:$contents[1];
if ($CFG->slasharguments) {
$source = $CFG->wwwroot.'/file.php/'.$course->id.'/'.$CFG->moddata.'/data/'.$field->dataid.'/'.$field->id.'/'.$recordid;
$source = $CFG->wwwroot.'/file.php/'.$data->course.'/'.$CFG->moddata.'/data/'.$field->dataid.'/'.$field->id.'/'.$recordid;
} else {
$source = $CFG->wwwroot.'/file.php?file=/'.$course->id.'/'.$CFG->moddata.'/data/'.$field->dataid.'/'.$field->id.'/'.$recordid;
$source = $CFG->wwwroot.'/file.php?file=/'.$data->course.'/'.$CFG->moddata.'/data/'.$field->dataid.'/'.$field->id.'/'.$recordid;
}
$width = $field->param1 ? ' width = "'.$field->param1.'" ':' ';
+6 -5
View File
@@ -112,10 +112,11 @@ class data_field_picture extends data_field_file {// extends
}
function display_browse_field($fieldid, $recordid, $template) {
global $CFG, $USER, $course;
global $CFG, $USER;
$field = get_record('data_fields', 'id', $fieldid);
$data = get_record('data', 'id', $field->dataid);
if ($content = get_record('data_content', 'fieldid', $fieldid, 'recordid', $recordid)){
if (isset($content->content)){
$contents[0] = $content->content;
@@ -127,9 +128,9 @@ class data_field_picture extends data_field_file {// extends
$src = empty($contents[0])? '':$contents[0];
if ($CFG->slasharguments) {
$source = $CFG->wwwroot.'/file.php/'.$course->id.'/'.$CFG->moddata.'/data/'.$field->dataid.'/'.$field->id.'/'.$recordid;
$source = $CFG->wwwroot.'/file.php/'.$data->course.'/'.$CFG->moddata.'/data/'.$field->dataid.'/'.$field->id.'/'.$recordid;
} else {
$source = $CFG->wwwroot.'/file.php?file=/'.$course->id.'/'.$CFG->moddata.'/data/'.$field->dataid.'/'.$field->id.'/'.$recordid;
$source = $CFG->wwwroot.'/file.php?file=/'.$data->course.'/'.$CFG->moddata.'/data/'.$field->dataid.'/'.$field->id.'/'.$recordid;
}
if ($template == 'listtemplate') {
+1 -1
View File
@@ -35,7 +35,7 @@
// Get the data_records out.
$sql = 'SELECT dr.* ' .
'FROM data_records AS dr ' .
"FROM {$CFG->prefix}data_records AS dr " .
"WHERE dr.dataid = {$dataActivity->id} " .
'ORDER BY dr.timecreated DESC ' .
"LIMIT {$dataActivity->rssarticles}";