Esempio n. 1
0
function embed_code_file_info($info)
{
    global $CONFIG, $CURRENT_PIC_DATA;
    // The weird comparision is because only picture_width is stored
    $resize_method = $CONFIG['picture_use'] == "thumb" ? $CONFIG['thumb_use'] == "ex" ? "any" : $CONFIG['thumb_use'] : $CONFIG['picture_use'];
    if ($resize_method == 'ht' && $CURRENT_PIC_DATA['pheight'] > $CONFIG['picture_width']) {
        $use_intermediate = true;
    } elseif ($resize_method == 'wd' && $CURRENT_PIC_DATA['pwidth'] > $CONFIG['picture_width']) {
        $use_intermediate = true;
    } elseif ($resize_method == 'any' && max($CURRENT_PIC_DATA['pwidth'], $CURRENT_PIC_DATA['pheight']) > $CONFIG['picture_width']) {
        $use_intermediate = true;
    } else {
        $use_intermediate = false;
    }
    $file['thumb'] = $CONFIG['ecards_more_pic_target'] . get_pic_url($CURRENT_PIC_DATA, 'thumb');
    $file['fullsize'] = $CONFIG['ecards_more_pic_target'] . get_pic_url($CURRENT_PIC_DATA, 'fullsize');
    if ($use_intermediate) {
        $file['normal'] = $CONFIG['ecards_more_pic_target'] . get_pic_url($CURRENT_PIC_DATA, 'normal');
        if (strpos($normal, 'images/thumbs/thumb_nopic.png')) {
            $file['normal'] = $file['fullsize'];
        }
    } else {
        $file['normal'] = $file['fullsize'];
    }
    $url = $CONFIG['ecards_more_pic_target'] . 'displayimage.php?pid=' . $CURRENT_PIC_DATA['pid'];
    if ($CONFIG['plugin_embed_code_fullsized_view'] == 1) {
        $url .= "&fullsize=1";
    }
    foreach (plugin_embed_code_config_options() as $option => $text) {
        if ($CONFIG[$option] == 1 && $option != 'plugin_embed_code_fullsized_view') {
            $option_parts = explode("_", $option);
            $textarea = '<textarea onfocus="this.select();" onclick="this.select();" class="textinput" rows="1" cols="64" wrap="off" style="overflow:hidden; height:15px;">';
            if ($option_parts[3] == 'bb') {
                $textarea .= '[url=' . $url . '][img]' . $file[$option_parts[4]] . '[/img][/url]</textarea>';
            } elseif ($option_parts[3] == 'html') {
                $textarea .= '&lt;a href="' . $url . '"&gt;&lt;img src="' . $file[$option_parts[4]] . '" /&gt;&lt;/a&gt;</textarea>';
            }
            $info[$text] = $textarea;
        }
    }
    return $info;
}
Esempio n. 2
0
        global $lang_errors;
        cpg_die(ERROR, $lang_errors['invalid_form_token'], __FILE__, __LINE__);
    }
    foreach (plugin_embed_code_config_options() as $option => $text) {
        $val = $superCage->post->keyExists($option) ? 1 : 0;
        cpg_db_query("UPDATE {$CONFIG['TABLE_CONFIG']} SET value = {$val} WHERE name = '{$option}'");
        $CONFIG[$option] = $val;
    }
    starttable("100%", $lang_common['information']);
    echo "\r\n        <tr>\r\n            <td class=\"tableb\">\r\n                {$lang_common['done']}\r\n            </td>\r\n        </tr>\r\n    ";
    endtable();
    echo "<br />";
}
echo "<form action=\"index.php?file=embed_code/admin\" method=\"post\">";
starttable("100%", "Embed Code - " . $lang_gallery_admin_menu['admin_lnk'], 3);
foreach (plugin_embed_code_config_options() as $option => $text) {
    $checked = $CONFIG[$option] == 1 ? ' checked="checked"' : '';
    echo <<<EOT
        <tr>
            <td class="tableb" width="200">
                {$text}
            </td>
            <td class="tableb">
                <input type="checkbox" name="{$option}" value="{$CONFIG[$option]}" {$checked} />
            </td>
        </tr>
EOT;
}
endtable();
list($timestamp, $form_token) = getFormToken();
echo "<input type=\"hidden\" name=\"form_token\" value=\"{$form_token}\" />";