Exemplo n.º 1
0
function annotate_meta_album($meta)
{
    global $CONFIG, $CURRENT_CAT_NAME, $RESTRICTEDWHERE, $lang_plugin_annotate;
    require_once './plugins/annotate/init.inc.php';
    $annotate_init_array = annotate_initialize();
    $lang_plugin_annotate = $annotate_init_array['language'];
    $annotate_icon_array = $annotate_init_array['icon'];
    switch ($meta['album']) {
        case 'lastnotes':
            $album_name = $annotate_icon_array['annotate'] . ' ' . $lang_plugin_annotate['lastnotes'];
            if ($CURRENT_CAT_NAME) {
                $album_name .= " - {$CURRENT_CAT_NAME}";
            }
            $query = "SELECT DISTINCT n.pid \n                FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate AS n \n                INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON n.pid = p.pid \n                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid \n                {$RESTRICTEDWHERE}";
            $result = cpg_db_query($query);
            $count = mysql_num_rows($result);
            mysql_free_result($result);
            $query = "SELECT MAX(nid) AS nid\n                FROM {$CONFIG['TABLE_PREFIX']}plugin_annotate AS n \n                INNER JOIN {$CONFIG['TABLE_PICTURES']} AS p ON n.pid = p.pid \n                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid \n                {$RESTRICTEDWHERE}\n                GROUP BY n.pid \n                ORDER BY n.nid DESC {$meta['limit']}";
            $result = cpg_db_query($query);
            $latest_nids_array = array();
            while ($row = mysql_fetch_assoc($result)) {
                $latest_nids_array[] = $row['nid'];
            }
            mysql_free_result($result);
            $query = "SELECT *, user_time AS msg_date\n                FROM {$CONFIG['TABLE_PICTURES']} AS p\n                INNER JOIN {$CONFIG['TABLE_PREFIX']}plugin_annotate AS n ON p.pid = n.pid \n                INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON r.aid = p.aid \n                {$RESTRICTEDWHERE} \n                AND approved = 'YES'\n                AND n.nid IN (" . implode(', ', $latest_nids_array) . ")\n                ORDER BY n.nid DESC";
            $result = cpg_db_query($query);
            $rowset = cpg_db_fetch_rowset($result);
            mysql_free_result($result);
            build_caption($rowset, array('msg_date'));
            break;
        case 'shownotes':
            if (annotate_get_level('permissions') < 1) {
                global $lang_errors;
                cpg_die(ERROR, $lang_errors['access_denied'], __FILE__, __LINE__);
            }
            $superCage = Inspekt::makeSuperCage();
            $note = $superCage->get->keyExists('note') ? $superCage->get->getRaw('note') : $superCage->cookie->getRaw($CONFIG['cookie_name'] . 'note');
            setcookie($CONFIG['cookie_name'] . 'note', $note);
            $album_name = cpg_fetch_icon('search', 2) . ' ' . $lang_plugin_annotate['shownotes'] . " '{$note}'";
            if ($CURRENT_CAT_NAME) {
                $album_name .= " - {$CURRENT_CAT_NAME}";
            }
            $note = addslashes(addslashes($note));
            $query = "SELECT p.pid FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON p.aid = r.aid INNER JOIN {$CONFIG['TABLE_PREFIX']}plugin_annotate n ON p.pid = n.pid {$RESTRICTEDWHERE} AND approved = 'YES' AND n.note = '{$note}' GROUP BY p.pid";
            $result = cpg_db_query($query);
            $count = mysql_num_rows($result);
            mysql_free_result($result);
            $query = "SELECT p.*, r.title FROM {$CONFIG['TABLE_PICTURES']} AS p INNER JOIN {$CONFIG['TABLE_ALBUMS']} AS r ON p.aid = r.aid INNER JOIN {$CONFIG['TABLE_PREFIX']}plugin_annotate n ON p.pid = n.pid {$RESTRICTEDWHERE} AND approved = 'YES' AND n.note = '{$note}' GROUP BY p.pid ORDER BY p.pid DESC {$meta['limit']}";
            $result = cpg_db_query($query);
            $rowset = cpg_db_fetch_rowset($result);
            mysql_free_result($result);
            build_caption($rowset);
            break;
        default:
            return $meta;
    }
    $meta['album_name'] = $album_name;
    $meta['count'] = $count;
    $meta['rowset'] = $rowset;
    return $meta;
}
Exemplo n.º 2
0
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3 of the License, or
  (at your option) any later version.
  ********************************************
  $HeadURL$
  $Revision$
  $LastChangedBy$
  $Date$
  **************************************************/
if (!defined('IN_COPPERMINE')) {
    die('Not in Coppermine...');
}
global $CONFIG, $LINEBREAK;
require_once './plugins/annotate/init.inc.php';
$annotate_init_array = annotate_initialize();
$lang_plugin_annotate = $annotate_init_array['language'];
$annotate_icon_array = $annotate_init_array['icon'];
$name = $lang_plugin_annotate['plugin_name'];
$description = $lang_plugin_annotate['plugin_description'];
$author = '<ul>' . $LINEBREAK;
$author .= '<li>' . sprintf($lang_plugin_annotate['plugin_credit_creator'], '<a href="http://forum.coppermine-gallery.net/index.php?action=profile;u=941" rel="external" class="external">Nibbler</a>') . '</li>' . $LINEBREAK;
$author .= '<li>' . sprintf($lang_plugin_annotate['plugin_credit_porter'], '<a href="http://forum.coppermine-gallery.net/index.php?action=profile;u=24278" rel="external" class="external">eenemeenemuu</a>') . '</li>' . $LINEBREAK;
$author .= '<li>' . sprintf($lang_plugin_annotate['plugin_credit_js'], '<a href="http://www.dustyd.net/" rel="external" class="external">Dusty Davidson</a>', '<a href="http://www.twinhelix.com/" rel="external" class="external">Angus Turnbull</a>') . '</li>' . $LINEBREAK;
$author .= '<li>' . sprintf($lang_plugin_annotate['plugin_credit_i18n'], '<a href="http://forum.coppermine-gallery.net/index.php?action=profile;u=2" rel="external" class="external">Joachim Müller</a>') . '</li>' . $LINEBREAK;
$author .= '</ul>';
$version = '3.0';
$plugin_cpg_version = array('min' => '1.5');
$install_info = '<a href="http://forum.coppermine-gallery.net/index.php/topic,60622.0.html" rel="external" class="admin_menu">' . $annotate_icon_array['announcement'] . $lang_plugin_annotate['announcement_thread'] . '</a>';
$extra_info .= '<a href="index.php?file=annotate/admin" class="admin_menu">' . $annotate_icon_array['configure'] . $lang_plugin_annotate['configure_plugin'] . '</a> ';
$extra_info .= '<a href="index.php?plugin=annotate&amp;update_database" class="admin_menu">' . $annotate_icon_array['update_database'] . $lang_plugin_annotate['update_database'] . '</a> ';