output.inc.php 733 B

1234567891011121314151617181920
  1. function copyfrom($field, $value) {
  2. static $copyfrom_array;
  3. if(!$copyform_array) $copyfrom_array = getcache('copyfrom','admin');
  4. if($value && strpos($value,'|')!==false) {
  5. $arr = explode('|',$value);
  6. $value = $arr[0];
  7. $value_data = $arr[1];
  8. }
  9. if($value_data) {
  10. $copyfrom_link = $copyfrom_array[$value_data];
  11. if(!empty($copyfrom_array)) {
  12. $imgstr = '';
  13. if($value=='') $value = $copyfrom_link['siteurl'];
  14. if($copyfrom_link['thumb']) $imgstr = "<a href='{$copyfrom_link[siteurl]}' target='_blank'><img src='{$copyfrom_link[thumb]}' height='15'></a> ";
  15. return $imgstr."<a href='$value' target='_blank' style='color:#AAA'>{$copyfrom_link[sitename]}</a>";
  16. }
  17. } else {
  18. return $value;
  19. }
  20. }