Changeset 11143


Ignore:
Timestamp:
May 31, 2011, 4:08:12 PM (10 years ago)
Author:
Mattias
Message:

Several bugfixes in admin.php, admin.tpl and main.inc.php, concerning the "Invalid URL - plugin copyrights not active"

Also it shows "N/A" at the picture information when there is no copyright for that picture.

Location:
extensions/Copyrights
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/Copyrights/TODO

    r10973 r11143  
    11- Implement single mode Batch Manager
    2   Probably use prefilters combined with loc_begin_element_set_unit
     2                Probably use prefilters combined with loc_begin_element_set_unit
    33- Add Icon field to copyrights
    44- Show the copyright when image is displayed
     5                It doesnt show the picture, but it does show the name of the copyright
     6- Bugs:
     7        - If you create a new copyright with a name that's already used
     8        - Description doesnt show with the copyright info (on the admin page)
  • extensions/Copyrights/admin.php

    r11084 r11143  
    5050    $query = sprintf(
    5151      'INSERT INTO %s
    52       (`name`,`url`,`des`,`visible`) VALUES
     52      (`name`,`url`,`descr`,`visible`) VALUES
    5353      ("%s","%s","%s",%d)
    5454      ;',
  • extensions/Copyrights/admin.tpl

    r10973 r11143  
    2020        <tr>
    2121          <td>{'Description'|@translate}</td>
    22           <td><textarea name='desc' id='desc'>{$CRdesc}</textarea></td>
     22          <td><textarea name='descr' id='descr'>{$CRdescr}</textarea></td>
    2323        </tr>
    2424        <tr>
  • extensions/Copyrights/image.php

    r11084 r11143  
    3131                <td class="label">Copyright</td>
    3232                <td class="value">
     33                        {if $CR_INFO_NAME}
    3334                        <a target="_blanc" href="{$CR_INFO_URL}" title="{$CR_INFO_NAME}">{$CR_INFO_NAME}</a>
     35                        {else}N/A{/if}
    3436                </td>
    3537        </tr>
     
    5658                $query = '
    5759                  select name, url
    58                   FROM '.$prefixeTable.'copyrights_admin NATURAL JOIN '.$prefixeTable.'copyrights_media
     60                  FROM '.COPYRIGHTS_ADMIN.' NATURAL JOIN '.COPYRIGHTS_MEDIA.'
    5961                  WHERE media_id = '.$page['image_id'].'
     62                  AND visible = 1
    6063                  ;';
    6164                $result = pwg_query($query);
    6265                $row = mysql_fetch_array($result);
    63                 $name = $row['name'];
    64                 $url = $row['url'];
     66                //if(count($row) > 0)
     67                //{
     68                        $name = $row['name'];
     69                        $url = $row['url'];
     70                //}
    6571                       
    6672                // Sending data to the template
  • extensions/Copyrights/main.inc.php

    r11084 r11143  
    3333
    3434define('COPYRIGHTS_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)) . '/'); // The plugin path
    35 define('COPYRIGHTS_WEB_PATH', get_root_url().'admin.php?page=plugin-copyrights');
     35define('COPYRIGHTS_WEB_PATH', get_root_url().'admin.php?page=plugin-Copyrights');
    3636// Whats the difference between "COPYRIGHTS_PATH" and "COPYRIGHTS_WEB_PATH" ???
    3737
Note: See TracChangeset for help on using the changeset viewer.