Changeset 11505


Ignore:
Timestamp:
Jun 24, 2011, 10:14:33 PM (13 years ago)
Author:
Mattias
Message:
  • Some changes in image.php (pwg_db instead of mysql)
  • batch_single.php adds an extra <tr> between the author and the creation date
Location:
extensions/Copyrights
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/Copyrights/TODO

    r11423 r11505  
    1111        - If you create a new copyright with a name that's already used
    1212        - Description doesnt show with the copyright info (on the admin page)
    13         - The warning triangle saying our plugin does not seem compatible - no clue
     13        - The warning triangle saying our plugin does not seem compatible
     14        - Cannot create a new copyright???
  • extensions/Copyrights/batch_single.php

    r11488 r11505  
    22
    33// Add a prefilter
    4 add_event_handler('loc_begin_element_set_unit', 'set_prefilter_batch_single', 55 );
     4add_event_handler('loc_end_element_set_unit', 'set_prefilter_batch_single', 55 );
    55
    66// Change the variables used by the function that changes the template
     
    1515function copyrights_batch_single($content, &$smarty)
    1616{
    17   $search = '#<tr id="datecreate">#';
     17  $search = "#<td><strong>{'Creation date'#"; // Not ideal, but ok for now :)
    1818
    19   $replacement = '
    20     <tr id="Copyrights_name">
    21     <tr id="datecreate">';
     19  // We use the <tr> from the Creation date, and give them a new <tr>
     20  $replacement = '<td><strong>DWO TESTJE</strong></td>
     21                <td>
     22                        DWO TESTJE
     23                </td>
     24        </tr>
     25       
     26        <tr>
     27                <td><strong>{\'Creation date\'';
    2228
    2329    return preg_replace($search, $replacement, $content);
     30       
     31        // Dit is een interresant testje - deze functie word dus een aantal keren (3) aangeroepen,
     32        // en pas de laatste keer is bevat $content meer dan een aantal enters...
     33        //return $content.'<div id="dwo_test" style="display: none;">'.$content.'</div>';
    2434}
    2535
  • extensions/Copyrights/image.php

    r11439 r11505  
    1818// Change the variables used by the function that changes the template
    1919add_event_handler('loc_begin_picture', 'copyrights_add_vars_to_template');
    20 
    21 // The big question is - WHY THIS WAY!!!
    2220
    2321function copyrights_set_prefilter_add_to_pic_info()
     
    6765                  ;';
    6866                $result = pwg_query($query);
    69                 $row = mysql_fetch_array($result);
    70                 //if(count($row) > 0)
    71                 //{
    72                         $name = $row['name'];
    73                         $url = $row['url'];
    74                 //}
     67                $row = pwg_db_fetch_row($result);
     68                if(count($row) > 0) {
     69                        $name = $row[0];
     70                        $url = $row[1];
     71                }
     72                else {
     73                        $name = '';
     74                        $url = '';
     75                }
    7576                       
    7677                // Sending data to the template
Note: See TracChangeset for help on using the changeset viewer.