output.inc.php 778 B

12345678910111213141516171819
  1. function downfiles($field, $value) {
  2. extract(string2array($this->fields[$field]['setting']));
  3. $list_str = array();
  4. $file_list = string2array($value);
  5. if(is_array($file_list)) {
  6. foreach($file_list as $_k=>$_v) {
  7. if($_v[fileurl]){
  8. $filename = $_v[filename] ? $_v[filename] : L('click_to_down');
  9. if($downloadlink) {
  10. $a_k = urlencode(sys_auth("i=$this->id&s=&m=1&f=$_v[fileurl]&d=$downloadtype&modelid=$this->modelid&catid=$this->catid", 'ENCODE', pc_base::load_config('system','auth_key')));
  11. $list_str[] = "<a href='".APP_PATH."index.php?m=content&c=down&a_k={$a_k}' target='_blank'>{$filename}</a>";
  12. } else {
  13. $list_str[] = "<a href='{$_v[fileurl]}' target='_blank'>{$filename}</a>";
  14. }
  15. }
  16. }
  17. }
  18. return $list_str;
  19. }