| 1 |
<?php |
|---|
| 2 |
global $CFG; |
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
$run_result = ""; |
|---|
| 13 |
|
|---|
| 14 |
$page_owner; |
|---|
| 15 |
|
|---|
| 16 |
$parameter) && is_array($parameter)) { |
|---|
| 17 |
|
|---|
| 18 |
$userid = (int) $parameter[0]; |
|---|
| 19 |
$userid > 0) { |
|---|
| 20 |
$username = user_info('username', $userid); |
|---|
| 21 |
|
|---|
| 22 |
$username) { |
|---|
| 23 |
|
|---|
| 24 |
$numrows = (int) $parameter[1]; |
|---|
| 25 |
$numrows) { |
|---|
| 26 |
$numrows = 10; |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
$tag = trim($parameter[2]); |
|---|
| 30 |
$tag)) { |
|---|
| 31 |
$files = get_records_sql('SELECT * FROM '.$CFG->prefix.'files where files_owner = ? and access = ? order by time_uploaded desc limit ?',array($parameter[0],'PUBLIC',$numrows)); |
|---|
| 32 |
|
|---|
| 33 |
$files = get_records_sql('SELECT f.* FROM '.$CFG->prefix.'tags t |
|---|
| 34 |
.$CFG->prefix.'files f ON f.ident = t.ref |
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
,array($parameter[0],'PUBLIC','file',$tag)); |
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
is_array($files) && sizeof($files) > 0) { |
|---|
| 41 |
$CFG->dirroot . 'lib/filelib.php'); |
|---|
| 42 |
$files as $file) { |
|---|
| 43 |
$title = stripslashes($file->title); |
|---|
| 44 |
$link = url . $username . "/files/" . $file->folder . "/" . $file->ident . "/" . (urlencode(stripslashes($file->originalname))); |
|---|
| 45 |
$description = stripslashes($file->description); |
|---|
| 46 |
$pubdate = gmdate("D, d M Y H:i:s T", $file->time_uploaded); |
|---|
| 47 |
|
|---|
| 48 |
$length = (int) $file->size; |
|---|
| 49 |
$mimetype = mimeinfo('type',$file->location); |
|---|
| 50 |
$keywordtags = ""; |
|---|
| 51 |
$keywords = get_records_select('tags',"tagtype = ? AND ref = ?",array('file',$file->ident))) { |
|---|
| 52 |
$keywords as $keyword) { |
|---|
| 53 |
$keywordtags .= "\n\t\t<dc:subject><![CDATA[". (stripslashes($keyword->tag)) . "]]></dc:subject>"; |
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
$run_result .= <<< END |
|---|
| 57 |
|
|---|
| 58 |
<item> |
|---|
| 59 |
<title><![CDATA[$title]]></title> |
|---|
| 60 |
<link>$link</link> |
|---|
| 61 |
<enclosure url="$link" length="$length" type="$mimetype" /> |
|---|
| 62 |
<pubDate>$pubdate</pubDate>$keywordtags |
|---|
| 63 |
<description><![CDATA[$description]]></description> |
|---|
| 64 |
</item> |
|---|
| 65 |
END; |
|---|
| 66 |
} |
|---|
| 67 |
} else { |
|---|
| 68 |
|
|---|
| 69 |
} |
|---|
| 70 |
|
|---|
| 71 |
} |
|---|
| 72 |
|
|---|
| 73 |
} |
|---|
| 74 |
|
|---|
| 75 |
?> |
|---|