Changeset 11075


Ignore:
Timestamp:
May 27, 2011, 5:56:35 PM (10 years ago)
Author:
Mattias
Message:
  • image.php

created

  • maintain.inc.php:

?> tag added
"desc" changed in "descr" (in a query)
bug commented away in plugin_activate()
(hence the warning for our plugin i guess)

  • main.inc.php

added comment
included image.php

Location:
extensions/Copyrights
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/Copyrights/main.inc.php

    r10931 r11075  
    11<?php
    22/*
    3 Plugin Name: Copyrights
     3Plugin Name: Copyrights_TEST
    44Version: Alpha
    55Description: Create copyrights and assign them to your photos.
     
    3232if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    3333
    34 define('COPYRIGHTS_PATH',
    35     PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)) . '/'); // The plugin path
     34define('COPYRIGHTS_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)) . '/'); // The plugin path
    3635define('COPYRIGHTS_WEB_PATH', get_root_url().'admin.php?page=plugin-copyrights');
     36// Whats the difference between "COPYRIGHTS_PATH" and "COPYRIGHTS_WEB_PATH" ???
    3737
    3838global $prefixeTable;
     
    4242include_once(COPYRIGHTS_PATH . 'include/functions.inc.php');
    4343
    44 /* Plugin admin */
     44
     45/* +-----------------------------------------------------------------------+
     46 * | Plugin admin                                                          |
     47 * +-----------------------------------------------------------------------+ */
     48
     49
    4550add_event_handler('get_admin_plugin_menu_links', 'copyrights_admin_menu');
    4651function copyrights_admin_menu($menu) {
     
    5459  return $menu;
    5560}
     61
     62
     63/* +-----------------------------------------------------------------------+
     64 * | Plugin image                                                          |
     65 * +-----------------------------------------------------------------------+ */
     66
     67
     68//if (script_basename() == 'picture') // Why should i want this "if" here?
     69include_once(dirname(__FILE__).'/image.php');
     70
     71
     72/* +-----------------------------------------------------------------------+
     73 * | Plugin batchmanager                                                   |
     74 * +-----------------------------------------------------------------------+ */
     75
     76
     77// @Johan: Misschien een goed idee om dit ook in een apart php scriptje te zetten, voor de overzichtelijkheid.
     78// En om deze reden (Citaat uit de piwigo docs http://piwigo.org/doc/doku.php?id=en:plugins):
     79// Code size
     80// When PWG loads the plugins, it will include every main.inc.php.
     81// Don't put in your main.inc.php 3000 lines of code just to add a page on the administration menu.
     82// Split you main.inc.php in several files and feel free to add include_once inside functions defined in main.inc.php as much as you want.
     83
    5684
    5785// Add copyrights drop down menu to the batch manager
  • extensions/Copyrights/maintain.inc.php

    r10973 r11075  
    2929      name varchar(255) UNIQUE NOT NULL,
    3030      url varchar(255) NOT NULL,
    31       desc text DEFAULT NULL,
     31      descr text DEFAULT NULL,
    3232      visible bool DEFAULT 0,
    3333      PRIMARY KEY (cr_id)
     
    4646
    4747function plugin_activate() {
    48   global $prefixeTable;
     48  /*global $prefixeTable;
    4949
    5050  $query = "
     
    5555  if (0 == $counter) {
    5656    copyrights_create_default();
    57   }
     57  }*/
    5858}
    5959
     
    143143  );
    144144}
     145
     146?>
Note: See TracChangeset for help on using the changeset viewer.