Ejemplo n.º 1
0
function cropimage12_admin_addon()
{
    global $cfgrow, $txt, $image, $spacer;
    if ($cfgrow['crop'] == '12c') {
        echo "\n        <hr />\n        <strong>12CropImage tool:</strong>\n        <br />\n        \n        This functionality is already inside admin/index.php but this addon is for demo only that show the abilities of \"addons for admin panel\" feature.\n        <br /><br />\n        \n        To edit the thumbnail for this photo, drag the crop window with mouse or expand/shrink it with '+'/'-' buttons:\n        <br />\n        \n        <input type='button' name='Submit1' value='Update Thumbnail' onclick=\"cropCheck('def','" . $image . "');\" />\n        <input type='button' name='Submit3' value='" . $txt['smaller'] . "' onMouseDown=\"cropZoom('in');\" onMouseUp='stopZoom();' />\n        <input type='button' name='Submit4' value='" . $txt['bigger'] . "' onMouseDown=\"cropZoom('out');\" onMouseUp='stopZoom();' />";
        /**
         * Set the size of the crop frame according to the uploaded image
         *
         */
        setsize_cropdiv($image);
        echo "\n        <p />\n        \n        <img src='" . $cfgrow['imagepath'] . $image . "' id='myimg' />\n        \n        <div id='cropdiv'>\n            <table width='100%' height='100%' border='1' cellpadding='0' cellspacing='0' bordercolor='#000000'>\n                <tr>\n                    <td><img src='" . $spacer . "' /></td>\n                </tr>\n            </table>\n        </div>\n        </div>\n        </div>\n        <p />";
    } else {
        echo "<strong>Note:</strong> The 12CropImage option is not selected for cropping thumbnails.<p />Please enable the 12CropImage option <a href='index.php?view=options&optionsview=thumb'>here</a>.";
    }
}
Ejemplo n.º 2
0
 echo $to_echo;
 // tag of content div still open
 //create thumbnail
 if (function_exists('gd_info')) {
     $gd_info = gd_info();
     if ($gd_info != "") {
         $thumbnail = $filnamn;
         $thumbnail = createthumbnail($thumbnail);
         eval_addon_admin_workspace_menu('thumb_created');
         // if crop is not '12c' use the oldfashioned crop
         if ($cfgrow['crop'] != '12c') {
             echo "</div><!-- end of content div -->";
             // close content div
         } else {
             // set the size of the crop frame according to the uploaded image
             setsize_cropdiv($filnamn);
             $for_echo = "<img src='" . $cfgrow['imagepath'] . $filnamn . "' id='myimg'/>\n\t\t\t\t\t\t\t<div id='cropdiv'>\n\t\t\t\t\t\t\t<table width='100%' height='100%' border='1' cellpadding='0' cellspacing='0' bordercolor='#000000'>\n\t\t\t\t\t\t\t<tr><td><img src='" . $spacer . "'/></td></tr>\n\t\t\t\t\t\t\t</table></div> <!-- end of crop div -->\n\t\t\t\t\t\t\t<div id='editthumbnail'>\n\t\t\t\t\t\t\t<hidden>{$admin_lang_ni_crop_background}</hidden>\n\t\t\t\t\t\t\t</div><!-- end of editthumbnail id -->\n\t\t\t\t\t\t\t</div> <!-- end of content div -->  ";
             echo $for_echo;
         }
         // end else
     }
     // gd info
 }
 // function_exists
 // workspace: image_uploaded
 eval_addon_admin_workspace_menu('image_uploaded');
 // save tags
 save_tags_new(clean($_POST['tags']), $theid);
 // save the alt_tags to if the variable is set
 if ($cfgrow['altlangfile'] != 'Off') {
     save_tags_new(clean($_POST['alt_tags']), $theid, "alt_");
Ejemplo n.º 3
0
            // Check if the language addon is enabled. If not there is no need to show these fields
            if ($cfgrow['altlangfile'] != 'Off') {
                echo "\n\t\t\t\t\t<div class='jcaption' style='text-align:left;color:black;'>{$admin_lang_imgedit_alt_language}</div><br />\n\t\t\t\t\t\t<div class='jcaption'>{$admin_lang_imgedit_title}</div>\n\t\t\t\t\t\t\t<div class='content'><input type='text' name='alt_headline' value='{$alt_headline}' style='width:300px;' /></div>\n\t\t\t\t\t\t<div class='jcaption'>{$admin_lang_imgedit_tags_edit}</div>\n\t\t\t\t\t\t\t<div class='content'><input type='text' name='alt_tags' style='width:550px;' value='{$alt_tags}' />";
                eval_addon_admin_workspace_menu('edit_image_form_alt_lang');
                echo "</div>\n\t\t\t\t\t\t<div class='jcaption'>{$admin_lang_imgedit_txt_desc}</div>\n\t\t\t<div class='content'>";
                if ($cfgrow['markdown'] == 'T') {
                    echo "\n   \t\t\t\t\t\t\t<div>" . $admin_lang_ni_markdown_text . "<br/>\n    \t\t\t\t\t\t<a href='http://daringfireball.net/projects/markdown/' title='<?php echo {$admin_lang_ni_markdown_hp}; ?>' target='_blank'>" . $admin_lang_ni_markdown_hp . "</a>\n    \t\t\t\t\t\t&nbsp;&nbsp;&nbsp;\n    \t\t\t\t\t\t<a href='http://daringfireball.net/projects/markdown/basics' title='<?php echo {$admin_lang_ni_markdown_element}; ?>' target='_blank'>" . $admin_lang_ni_markdown_element . "</a>\n    \t\t\t\t\t\t&nbsp;&nbsp;&nbsp;\n    \t\t\t\t\t\t<a href='http://daringfireball.net/projects/markdown/syntax' title='<?php echo {$admin_lang_ni_markdown_syntax}; ?>' target='_blank'>" . $admin_lang_ni_markdown_syntax . "</a>\n    \t\t\t\t\t\t</div>";
                }
                echo " {$admin_lang_imgedit_txt_desc}<br/>\n\t\t\t\t\t\t\t<textarea name='alt_body' cols='50' rows='5' style='width:95%;'>{$alt_body}</textarea>\n\t\t\t\t\t\t</div><br />";
            }
            eval_addon_admin_workspace_menu("image_edit_form", "images");
            echo "\n\t\t\t<div class='jcaption'>{$admin_lang_imgedit_img}</div>\n\t\t\t<div class='content'>\n\t    \t<b>{$admin_lang_imgedit_file_name}</b> {$image}, <b>{$admin_lang_imgedit_fsize}</b> {$img_width} x {$img_height}; {$img_size} <b>kb</b>\n\t\t\t\t<br/>\n         <img id='itemimg' src='" . $cfgrow['thumbnailpath'] . "thumb_{$image}' alt='' />\n\t\t\t</div>\n      <div class='content'>\n\t    \t<input type='submit' value='{$admin_lang_imgedit_u_post_button}' />\n\t\t\t</div>\n      \t    </form>\n\t\t\t    \t  ";
            // Check if the '12c' is selected as the crop then add 3 buttons to the page '+', '-', and 'crop'
            if ($cfgrow['crop'] == '12c') {
                $to_echo = "\n\t\t\t<br/><br/>\n\t\t\t&nbsp;&nbsp;&nbsp;<strong>{$admin_lang_imgedit_12cropimg}</strong><br/>\n            {$admin_lang_imgedit_12cropimg_txt}\n            <input type='button' name='Submit1' value='{$admin_lang_imgedit_uthmb_button}' onclick=\"cropCheck('def','" . $image . "');\" />\n \t    \t<input type='button' name='Submit3' value='" . $txt['smaller'] . "' onmousedown=\"cropZoom('in');\" onmouseup='stopZoom();' />\n\t   \t\t<input type='button' name='Submit4' value='" . $txt['bigger'] . "' onmousedown=\"cropZoom('out');\" onmouseup='stopZoom();' />";
                echo $to_echo;
                // set the size of the crop frame according to the uploaded image
                setsize_cropdiv($image);
                //--------------------------------------------------------
                $for_echo = "<p/>\n\t<img src='" . $cfgrow['imagepath'] . $image . "' id='myimg' />\n\t<div id='cropdiv'>\n\t<table width='100%' height='100%' border='1' cellpadding='0' cellspacing='0' bordercolor='#000000'>\n    <tr><td><img src='" . $spacer . "' /></td>\n\t</tr></table>\n\t</div>\n\t<div id='editthumbnail'>{$admin_lang_imgedit_cropbg}</div> <!-- end of edit thumb div -->\n\t ";
                echo $for_echo;
                //--------------------------------------------------------
            } else {
                echo "{$admin_lang_imgedit_12crop_opt}<p />";
            }
            echo "<!-- end of content div -->\n         <p />";
        }
    }
    // end of if imagesview = edit
}
// end view=images