Exemple #1
0
function hot_pictures_file_data($data)
{
    global $CONFIG, $CURRENT_ALBUM_DATA, $CURRENT_PIC_DATA, $lang_plugin_hot_pictures;
    if (hot_pictures_config('groups')) {
        $superCage = Inspekt::makeSuperCage();
        if ($superCage->get->keyExists('set')) {
            $set[$superCage->get->getInt('set')] = ' style="font-weight: bold;"';
        }
        $hot_pictures_menu_icon = $CONFIG['enable_menu_icons'] > 0 ? '<img src="images/icons/exif_mgr.png" border="0" width="16" height="16" class="icon" /> ' : '';
        $buttons = "<li><a href=\"index.php?file=hot_pictures/set&amp;pid={$CURRENT_PIC_DATA['pid']}&amp;hot=0\"><span{$set[0]}>{$hot_pictures_menu_icon}{$lang_plugin_hot_pictures['hot0']}</span></a></li>";
        foreach (hot_pictures_config('buttons') as $days) {
            if ($days < 1) {
                continue;
            }
            $text = $days == 1 ? $lang_plugin_hot_pictures['hot1'] : sprintf($lang_plugin_hot_pictures['hotx'], $days);
            $buttons .= "<li><a href=\"index.php?file=hot_pictures/set&amp;pid={$CURRENT_PIC_DATA['pid']}&amp;hot={$days}\"><span{$set[$days]}>{$hot_pictures_menu_icon}{$text}</span></a></li>";
        }
        $data['menu'] = str_replace('</ul>', $buttons . '</ul>', $data['menu']);
    }
    return $data;
}
Exemple #2
0
  Copyright (c) 2012 eenemeenemuu
  *************************************************
  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...');
}
$pid = $superCage->get->getInt('pid');
if (hot_pictures_config('groups')) {
    $days = $superCage->get->getInt('hot');
    if ($days === 0) {
        cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET hot_expire = 0 WHERE pid = {$pid}");
        $set = 0;
    } elseif (in_array($days, hot_pictures_config('buttons'))) {
        cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET hot_expire = " . (time() + 60 * 60 * 24 * $days) . " WHERE pid = {$pid}");
        $set = $days;
    } else {
        $set = -1;
    }
    header("Location: displayimage.php?pid={$pid}&set={$set}#top_display_media");
} else {
    header("Location: displayimage.php?pid={$pid}#top_display_media");
}