Changeset 11084


Ignore:
Timestamp:
05/28/11 11:55:12 (8 years ago)
Author:
Mattias
Message:

Serveral bug fixes in main.inc.php, maintain.inc.php, admin.php
Added link to the CR_name (image.php)

Location:
extensions/Copyrights
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • extensions/Copyrights/admin.php

    r10973 r11084  
    3838$CRname = ''; 
    3939$CRurl = ''; 
    40 $CRdesc = ''; 
     40$CRdescr = ''; 
    4141$CRvisible = 0; 
    4242 
     
    4646    $name = pwg_db_real_escape_string($_REQUEST['name']); 
    4747    $url = pwg_db_real_escape_string($_REQUEST['url']); 
    48     $desc = pwg_db_real_escape_string($_REQUEST['desc']); 
     48    $descr = pwg_db_real_escape_string($_REQUEST['descr']); 
    4949    $visible = (isset($_REQUEST['visible']) ? 1 : 0); 
    5050    $query = sprintf( 
     
    5353      ("%s","%s","%s",%d) 
    5454      ;', 
    55       COPYRIGHTS_ADMIN, $name, $url, $desc, $visible); 
     55      COPYRIGHTS_ADMIN, $name, $url, $descr, $visible); 
    5656    pwg_query($query); 
    5757  } 
     
    7070    $CRname = $row['name']; 
    7171    $CRurl = $row['url']; 
    72     $CRdesc = $row['desc']; 
     72    $CRdescr = $row['descr']; 
    7373    $CRvisible = $row['visible']; 
    7474  } 
     
    7878    $name = pwg_db_real_escape_string($_REQUEST['name']); 
    7979    $url = pwg_db_real_escape_string($_REQUEST['url']); 
    80     $desc= pwg_db_real_escape_string($_REQUEST['desc']); 
     80    $descr= pwg_db_real_escape_string($_REQUEST['descr']); 
    8181    $visible = (isset($_REQUEST['visible']) ? 1 : 0); 
    8282    $query = sprintf( 
    8383      'UPDATE %s 
    84       SET `name`="%s", `url`="%s", `desc`="%s", `visible`=%d 
     84      SET `name`="%s", `url`="%s", `descr`="%s", `visible`=%d 
    8585      WHERE `cr_id`=%d 
    8686      ;', 
    87       COPYRIGHTS_ADMIN, $name, $url, $desc, $visible, $id); 
     87      COPYRIGHTS_ADMIN, $name, $url, $descr, $visible, $id); 
    8888    pwg_query($query); 
    8989  } 
     
    113113  FROM %s 
    114114  ;', 
    115   COPYTIGHTS_ADMIN); 
     115  COPYRIGHTS_ADMIN); 
    116116$result = pwg_query($query); 
    117117 
     
    123123      'name'    => $row['name'], 
    124124      'url'     => $row['url'], 
    125       'desc'    => $row['desc'], 
     125      'descr'    => $row['descr'], 
    126126      'visible' => $row['visible'] 
    127127    ) 
     
    138138$template->assign('CRname', $CRname); 
    139139$template->assign('CRurl', $CRurl); 
    140 $template->assign('CRdesc', $CRdesc); 
     140$template->assign('CRdescr', $CRdescr); 
    141141$template->assign('CRvisible', $CRvisible); 
    142142 
  • extensions/Copyrights/image.php

    r11076 r11084  
    3030        <tr id="Copyrights_name"> 
    3131                <td class="label">Copyright</td> 
    32                 <td class="value">{$CR_INFO_NAME}</td> 
     32                <td class="value"> 
     33                        <a target="_blanc" href="{$CR_INFO_URL}" title="{$CR_INFO_NAME}">{$CR_INFO_NAME}</a> 
     34                </td> 
    3335        </tr> 
    3436        <tr id="datecreate">'; 
    35         // "Copyright" is nog hardcoded 
     37        // "Copyright" label is nog hardcoded - moet een @translate achter van de smarty, maar dat laat ik maar aan Johan over =P 
    3638 
    3739        return preg_replace($search, $replacement, $content); 
  • extensions/Copyrights/main.inc.php

    r11075 r11084  
    11<?php 
    22/* 
    3 Plugin Name: Copyrights_TEST 
     3Plugin Name: Copyrights 
    44Version: Alpha 
    55Description: Create copyrights and assign them to your photos. 
     
    6666 
    6767 
    68 //if (script_basename() == 'picture') // Why should i want this "if" here? 
     68//if (script_basename() == 'picture') // Why should i want this here? 
    6969include_once(dirname(__FILE__).'/image.php'); 
    7070 
     
    103103    WHERE `visible`<>0 
    104104    ;', 
    105     COPYRIGHT_ADMIN); 
     105    COPYRIGHTS_ADMIN); 
    106106  $result = pwg_query($query); 
    107107  $CRoptions = array(); 
     
    137137        WHERE media_id IN (%s) 
    138138        ;', 
    139         COPYRIGHT_MEDIA, implode(',', $collection)); 
     139        COPYRIGHTS_MEDIA, implode(',', $collection)); 
    140140      pwg_query($query); 
    141141    } 
  • extensions/Copyrights/maintain.inc.php

    r11075 r11084  
    4646 
    4747function plugin_activate() { 
    48   /*global $prefixeTable; 
     48  global $prefixeTable; 
    4949 
    50   $query = " 
     50  $query = ' 
    5151    SELECT COUNT(*) 
    52     FROM ".$prefixeTable."copyrights_admin 
    53     ;"; 
     52    FROM '.$prefixeTable.'copyrights_admin 
     53    ;'; 
    5454  list($counter) = pwg_db_fetch_row(pwg_query($query)); 
    5555  if (0 == $counter) { 
    5656    copyrights_create_default(); 
    57   }*/ 
     57  } 
    5858} 
    5959 
     
    8080      'name' => 'Creative Commons (BY)', 
    8181      'url' => 'http://creativecommons.org/licenses/by/3.0/', 
    82       'desc' => 'This license lets others distribute, remix, tweak, and build  
     82      'descr' => 'This license lets others distribute, remix, tweak, and build  
    8383                upon your work, even commercially, as long as they credit you  
    8484                for the original creation. This is the most accommodating of  
     
    9090      'name' => 'Creative Commons (BY-SA)', 
    9191      'url' => 'http://creativecommons.org/licenses/by-sa/3.0/', 
    92       'desc' => 'This license lets others remix, tweak, and build upon your 
     92      'descr' => 'This license lets others remix, tweak, and build upon your 
    9393                work even for commercial purposes, as long as they credit you 
    9494                and license their new creations under the identical terms. This 
     
    104104      'name' => 'Creative Commons (BY-ND)', 
    105105      'url' => 'http://creativecommons.org/licenses/by-nd/3.0/', 
    106       'desc' => 'This license allows for redistribution, commercial and  
     106      'descr' => 'This license allows for redistribution, commercial and  
    107107                non-commercial, as long as it is passed along unchanged and in 
    108108                whole, with credit to you.', 
     
    112112      'name' => 'Creative Commons (BY-NC)', 
    113113      'url' => 'http://creativecommons.org/licenses/by-nc/3.0/', 
    114       'desc' => 'This license lets others remix, tweak, and build upon your 
     114      'descr' => 'This license lets others remix, tweak, and build upon your 
    115115                work non-commercially, and although their new works must also 
    116116                acknowledge you and be non-commercial, they don’t have to 
     
    121121      'name' => 'Creative Commons (BY-NC-SA)', 
    122122      'url' => 'http://creativecommons.org/licenses/by-nc-sa/3.0/', 
    123       'desc' => 'This license lets others remix, tweak, and build upon your 
     123      'descr' => 'This license lets others remix, tweak, and build upon your 
    124124                work non-commercially, as long as they credit you and license 
    125125                their new creations under the identical terms.', 
     
    129129      'name' => 'Creative Commons (BY-NC-ND)', 
    130130      'url' => 'http://creativecommons.org/licenses/by-nc-nd/3.0/', 
    131       'desc' => 'This license is the most restrictive of our six main licenses, 
     131      'descr' => 'This license is the most restrictive of our six main licenses, 
    132132                only allowing others to download your works and share them with 
    133133                others as long as they credit you, but they can’t change them 
Note: See TracChangeset for help on using the changeset viewer.