<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://cutesoft.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Cute Editor for PHP</title><link>http://cutesoft.net/forums/46/ShowForum.aspx</link><description>Questions, issues, and discussions of PHP HTML Editor. Http://phphtmledit.com</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP3 (Build: 20423.1)</generator><item><title>Re: Inserting image from custom imagegallery</title><link>http://cutesoft.net/forums/thread/74356.aspx</link><pubDate>Tue, 07 Aug 2012 07:51:01 GMT</pubDate><guid isPermaLink="false">9a74aede-84de-42da-8122-3d80bfaac2cf:74356</guid><dc:creator>Minisuit</dc:creator><slash:comments>0</slash:comments><comments>http://cutesoft.net/forums/thread/74356.aspx</comments><wfw:commentRss>http://cutesoft.net/forums/commentrss.aspx?SectionID=46&amp;PostID=74356</wfw:commentRss><description>&lt;div id="pastingspan1"&gt;Step 1 Defining Custom Image Sizes&lt;/div&gt;&lt;div id="pastingspan1"&gt;&lt;/div&gt;&lt;div id="pastingspan1"&gt;For your theme to support custom image sizes you have to edit the functions.php file found in your themes folder. Open your theme&amp;#8217;s functions.php and check if you have a line that looks like this:&lt;/div&gt;&lt;div id="pastingspan1"&gt;&lt;/div&gt;&lt;div id="pastingspan1"&gt;add_action( 'after_setup_theme', 'function_name' ); &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&lt;/div&gt;&lt;div id="pastingspan1"&gt;This hook is called during a theme&amp;#8217;s initialization. It is generally used to perform basic setup, registration, and initialization actions for a theme, where &amp;#8220;function_name&amp;#8221; is the name of the function to be called.&lt;/div&gt;&lt;div id="pastingspan1"&gt;If you found a line like that, then also find the method with the same name as the 2nd parameter from that add_action method.&lt;/div&gt;&lt;div id="pastingspan1"&gt;If you can&amp;#8217;t find a line that looks like that you should add it, and also create a method names as the 2nd parameter:&lt;/div&gt;&lt;div id="pastingspan1"&gt;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&lt;/div&gt;&lt;div id="pastingspan1"&gt;add_action( 'after_setup_theme', 'setup' ); &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;function setup() { &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; // ... &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;} &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;Now to enable post thumbnails for your theme add the following lines in the method defined above:&lt;/div&gt;&lt;div id="pastingspan1"&gt;&lt;/div&gt;&lt;div id="pastingspan1"&gt;function setup() { &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; // ... &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; add_theme_support( 'post-thumbnails' ); // This feature enables post-thumbnail support for a theme &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; // To enable only for posts: &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; //add_theme_support( 'post-thumbnails', array( 'post' ) ); &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; // To enable only for posts and custom post types: &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; //add_theme_support( 'post-thumbnails', array( 'post', 'movie' ) ); &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; // Register a new image size. &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; // This means that WordPress will create a copy of the post image with the specified dimensions &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; // when you upload a new image. Register as many as needed. &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; // Adding custom image sizes (name, width, height, crop) &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; add_image_size( 'featured-image', 620, 200, true ); &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; // ... &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;} &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;Step 2 Displaying Images With Custom Sizes&lt;/div&gt;&lt;div id="pastingspan1"&gt;Insert Custom Sized Image Into Post Using Media Gallery&lt;/div&gt;&lt;div id="pastingspan1"&gt;To insert an image inside a post or page from the media gallery insert the following filter into the functions.php file:&lt;/div&gt;&lt;div id="pastingspan1"&gt;view plaincopy to clipboardprint?&lt;/div&gt;&lt;div id="pastingspan1"&gt;add_filter( 'image_size_names_choose', 'custom_image_sizes_choose' ); &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;function custom_image_sizes_choose( $sizes ) { &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; $custom_sizes = array( &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'featured-image' =&amp;gt; 'Featured Image' &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; ); &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;&amp;nbsp; &amp;nbsp; return array_merge( $sizes, $custom_sizes ); &amp;nbsp;&lt;/div&gt;&lt;div id="pastingspan1"&gt;} &amp;nbsp;&lt;/div&gt;</description></item><item><title>Re: Inserting image from custom imagegallery</title><link>http://cutesoft.net/forums/thread/73874.aspx</link><pubDate>Tue, 12 Jun 2012 03:32:47 GMT</pubDate><guid isPermaLink="false">9a74aede-84de-42da-8122-3d80bfaac2cf:73874</guid><dc:creator>Beedk</dc:creator><slash:comments>0</slash:comments><comments>http://cutesoft.net/forums/thread/73874.aspx</comments><wfw:commentRss>http://cutesoft.net/forums/commentrss.aspx?SectionID=46&amp;PostID=73874</wfw:commentRss><description>&lt;div&gt;Hi - Problem solved :)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;I had a look at the file "custombuttons-popup.php" that illustrates how to do it - now it works perfectly :)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Just thought I'd just mention it, if someone else should have the same problem.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Best regards&lt;/div&gt;&lt;div&gt;Bee (DK)&lt;/div&gt;</description></item><item><title>Inserting image from custom imagegallery</title><link>http://cutesoft.net/forums/thread/73865.aspx</link><pubDate>Mon, 11 Jun 2012 02:34:24 GMT</pubDate><guid isPermaLink="false">9a74aede-84de-42da-8122-3d80bfaac2cf:73865</guid><dc:creator>Beedk</dc:creator><slash:comments>0</slash:comments><comments>http://cutesoft.net/forums/thread/73865.aspx</comments><wfw:commentRss>http://cutesoft.net/forums/commentrss.aspx?SectionID=46&amp;PostID=73865</wfw:commentRss><description>&lt;div&gt;Hi all&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;I'm new here - and I might be posting this "problem" in the wrong place!&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;I'm haveing some trouble inserting images from my own custom imagegallery into the editor, this is what I have done.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;A custom button&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;$editor-&amp;gt;CustomAddons = "&amp;lt;img title=\"Inds&amp;#230;t billede\" class=\"CuteEditorButton\" onmouseover=\"CuteEditor_ButtonCommandOver(this)\" onmouseout=\"CuteEditor_ButtonCommandOut(this)\" onmousedown=\"CuteEditor_ButtonCommandDown(this)\" onmouseup=\"CuteEditor_ButtonCommandUp(this)\" ondragstart=\"CuteEditor_CancelEvent()\" Command=\"billedarkiv\" src=\"../gfx/edit-gfx1.gif\" /&amp;gt;";&lt;br /&gt;&lt;/div&gt;&lt;div&gt;With the following javascript after&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;lt;script language="JavaScript" type="text/javascript" &amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var editor1=document.getElementById("ClientID");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;function CuteEditor_OnCommand(editor1,command,ui,value)&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//handle the command by yourself&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(command=="billedarkiv") {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;var newwin=editor1.ShowDialog(null,"../common/popup-billedarkiv_v2.0.php",editor1,"dialogWidth:800px;dialogHeight:600px");&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return true;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;When the user clicks the button, the dialog window loads perfectly, and I can select and add pictures to the gallery without problems.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;My script creates an html img tag, and I want to return this to the editor.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;My script looks like this&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&amp;lt;script language='JavaScript' type='text/javascript'&amp;gt;\n";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&amp;lt;!--\n";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&amp;nbsp;var imagename = '" . $imagename . "';\n";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&amp;nbsp;var imagestring&amp;nbsp; = ('&amp;lt;img border=0 src=" . $billedarkivpath . "' + imagename + '\&amp;gt;');\n";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo "editor1.PasteHTML(imagestring);";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&amp;nbsp; window.close();\n";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "// --&amp;gt;\n";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo "&amp;lt;/script&amp;gt;\n";&lt;/div&gt;&lt;div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;I think the problem has something to do with eidtor1.PasteHTML(imagestring) - and also I'm not sure how to close the window :)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;all/any help is appreaciated :)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;Best regards&lt;/div&gt;&lt;div&gt;Bee (DK)&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;&lt;/div&gt;</description></item></channel></rss>