/[drupal]/contributions/modules/votesmart/modules/votesmart_field/votesmart_field.module
ViewVC logotype

Diff of /contributions/modules/votesmart/modules/votesmart_field/votesmart_field.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.5, Wed Oct 1 00:08:28 2008 UTC revision 1.6, Wed Oct 1 03:11:56 2008 UTC
# Line 1  Line 1 
1  <?php // $Id: votesmart_field.module,v 1.4 2008/09/09 01:11:46 vauxia Exp $  <?php // $Id: votesmart_field.module,v 1.5 2008/10/01 00:08:28 vauxia Exp $
2    
3  /**  /**
4   * Implementation of hook_elements().   * Implementation of hook_elements().
# Line 210  function _votesmart_field_map_form($node Line 210  function _votesmart_field_map_form($node
210   * this "works".   * this "works".
211   */   */
212  function _votesmart_field_save_file($url) {  function _votesmart_field_save_file($url) {
213      if (!$url) return null;
214    
215    global $user;    global $user;
216    
217    $parts = parse_url($url);    $parts = parse_url($url);
# Line 219  function _votesmart_field_save_file($url Line 221  function _votesmart_field_save_file($url
221    $dest = file_destination($path, FILE_EXISTS_REPLACE);    $dest = file_destination($path, FILE_EXISTS_REPLACE);
222    
223    if ($file = db_fetch_object(db_query("SELECT * FROM {files} WHERE filepath = '%s'", $dest))) {    if ($file = db_fetch_object(db_query("SELECT * FROM {files} WHERE filepath = '%s'", $dest))) {
224      //return $file;      return $file;
225    }    }
226    
227    $data = file_get_contents($url);    $data = file_get_contents($url);

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.2