Ignore:
Timestamp:
Jan 26, 2013, 2:50:41 PM (11 years ago)
Author:
mistic100
Message:

option to save website URL in photo description

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/url_uploader/admin.php

    r20064 r20407  
    8383          );
    8484       
     85        $updates = array();
    8586        if (!empty($_POST['photo_name']))
    8687        {
    87           single_update(
    88             IMAGES_TABLE,
    89             array('name'=>$_POST['photo_name']),
    90             array('id' => $image_id)
    91             );
     88          $updates['name'] = $_POST['photo_name'];
    9289        }
     90        if (isset($_POST['url_in_comment']))
     91        {
     92          $url = parse_url($_POST['file_url']);
     93          $url = $url['scheme'].'://'.$url['host'];
     94          $updates['comment'] = '<a href="'. $url . '">'. $url .'</a>';
     95        }
     96       
     97        single_update(
     98          IMAGES_TABLE,
     99          $updates,
     100          array('id' => $image_id)
     101          );
    93102       
    94103        $image_ids = array($image_id);
Note: See TracChangeset for help on using the changeset viewer.