Hana Code Insert WordPress Plugin

10/4/2009: Please visit the new home for the Hana Code Insert and Hana Code Insert Forum.
V.2.0 (7/20/2009) : PHP evaluation settings can be set within the option page. Editor Helper Dialog button is added for easier insert. If you are upgrading , you should enable the PHP execution option from the option page if you were using PHP eval function previously.

V.1.5 (1/16/2009) : There was issue with the form and textarea tag . It is fixed now. Also, there is a ‘Remove All’ button now that you can remove all code entries if you have any issue.

Inserting some javascript or Html codes in the middle of an article is not an easy task. It’s hard to copy and paste bunch of codes into the article whenever you write an article. Sometimes, the code breaks and doesn’t work as intended because WordPress encodes HTML entities.

So I decided to come up with the plugin that will help me insert that AdSense or Paypal Donation code into the middle of article.

V2.0 : New features to insert quick tags easily while posting a blog.

hanacode_button1

hanacode_button2


Now with my plugin, Hana Code Insert, you can easily insert any complicated HTML and JAVASCRIPT code or even custom PHP output in your Wordpress article. Useful for adding AdSense and Paypal donation code in the middle of the WP article. You can manage multiple code entries.

After the plugin installation, you would setup the HTML or Javascript entries in the ‘Hana Code Insert’ Settings menu. Simply define a unique name and paste the complicated codes copied from AdSense or Paypal into the textarea. Then click on the ‘Create a new entry’ button.

After the creation, you can find that the newly added entry is shown in the bottom. Copy the usage code example and insert it in your article. That’s all.

Basically, you can place the specific tag element [hana-code-insert name='...' /] in your wordpress article to show the codes. The ‘name’ attribute is mandatory where you use the name of the code entry that you want to show.

For example, after you setup a code entry in the admin Settings with the name ‘AdSense’, you can invoke the code by using below element in your article.

[hana-code-insert name='AdSense' /]

Below is the Admin Settings (Options) Screen for ‘Hana Code Insert’. Four code entries are defined.

Here are the actual working samples.

[hana-code-insert name='donation' /]


[hana-code-insert name='donation with amount' /]

Did you enjoy my article or software? Thank you for the donation.
US $

[hana-code-insert name='adsense' /]

Now this is an actual example showing the current local time. If you refresh the page, you can see that the time changes and reflecting the latest time. This is not javascript, but created by PHP codes inserted in the middle of this blog! (Note that if you have Super Cache plugin installed and enabled, this PHP code may not work correctly.)

Result

09/03/2010 01:11:35

Here is the actual code used when setting up in the Settings/Options page with name “php example”.

print "<div style='border:1px dotted red; padding: 5px;'>";
print date("m/d/Y H:i:s"); 
print "</div>";

And here is the text inserted in the middle of the article.

[hana-code-insert name='php example' /]

If you have any question, leave in the comment section.

Thank you.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • MySpace
  • Reddit
  • Technorati
  • Twitter

, ,

My favorite listmania

Headphones and In-Ear Monitors with volume and play controls

$399.99
Shure SE530PTH Sound Isolating Earphones with Push-To-Hear Control - The Shure SES30PTH sound isolating earphones performed as expected. Of course they do not isolate all background sounds, but they do reduce it quite a bit if you have a good seal with the earpieces a...
$499.95
Sennheiser MX W1 Totally Wireless Earphone - Great sound quality and top of the line blue tooth technology make these earbuds a force to be reckoned with. It would be nice if there was yet another adapter for the ear lock, as it seems mine fall ...
$220.29
Etymotic Research Ety8 Bluetooth Stereo Wireless In-Ear Earphones - Team Ety,

Wanted to say thanks so, so much for your great service with my
broken ety-8 bluetooth headphones. I was heartbroken after the nice
gift from my girlfriend brok...
$158.30
Etymotic Research HF2 Earphones / Headset (iPhone Compatible) - Black - I've owned these for three weeks. So far so good, they sound great. Lots of detail and the bass is pretty good too. I think they are better than the Denon AHC751K I owned before these. You have to pu...
$10.77
Sony MDR-E829V Fontopia Earbuds with In-line Volume Control - The sound quality is very good and the ear pieces are comfortable. The cable is also thicker and sort of rubbery so it doesn't get stuck to things and feels stronger than the Ipod headphones.
I...
$14.76
Koss KTXPRO1 Titanium Portable Headphones with Volume Control - Lightweight, reasonably comfortable and an in line volume control. just the ticket for portable music. i use them with my Blackbery and with my media player. considering the price the sound is very im...
$19.95
Sony MDRG58V Street Style Headphone with Volume Control - I honestly have no idea what other people are complaining about--none at all. Some of these reviews are old, so maybe changes have been made to these since I got them almost two years ago...? The pict...
JVC Lightweight Headphone with Volume Control (Black) - These headphones have great sound, and the volume control is very, VERY convenient. The downside to these headphones for me is the fit. They do not seem snug enough over my head, and move a bit when...
Panasonic RP-HX32 2-way Style Earbud Headphones with In-cord Volume Control - I listen to audiobooks only, no music, but find the sound reproduction to be very clear and they are very comfortable to wear. I wear them for hours every day with no problems. Very good product.
Griffin SmartShare Headphone Splitter with Individual Volume Control White - This product is affordable and works-as-designed. The individual volume controls work well. I found this product useful when I was traveling via plane and we wanted to share the audio while watching...
$17.95
Shure EA650 Volume Control for Shure E/SE Series Sound Isolating Earphones - Good for two years but now it is very sensitive to motion. If I move from side to side about 6 inches I hear static.

Not buying another one again.
$59.99
Sennheiser MX55VC Twist-To-Fit In-Ear Stereo Headphones w/ Volume Control - I am a life-long jogger and looked and looked for ear phones that were comfortable and would stay in my ears. These are the best earphones for jogging and they also sound great and are water proof. Th...
$24.99
Panasonic RP-HV280 Portable Earbud Headphones with In-Cord Volume Control - The ear buds fit nicely, and the sound is good. I bought them for the in-line volume control, and was pleasantly surprised by both the quality (they are heavy and don't feel cheap) and the sound. Gr...
AKG K 14 P Earbuds with In-Line Volume Control - You think you can not get a good earbud at this price? You are wrong! When it comes to AKG K14/K314, you are at the right place! This is a very inexpensive, but very nice sound quality earbud. The det...
$8.13
Koss P9 In-Ear Headphones with Volume Control - This is a pretty good purchase if you want something cheap, reliable, with decent sound quality. There are few wrap-around headphones out there when I was shopping for them - this set had the buds-in-...
Sennheiser HD 435 Versatile Open-Aire Ultra-Light Supraural Headphone w/ Volume Control - Well I've had these headphones now for little over a month and they are alright. They aren't great mind you but the sound is good, the volume control function is great which is the reason I bought the...
Too low to display
V-MODA Vibe Duo Earbud Headset (Chrome, iPhone Compatible) - Pros:
-I have always liked Vmoda's sound quality
-The black fabric cable makes it more durable

Cons:
-The controls do not work with iPhone 4
-The microphone is rea...
$12.23
Monster MusicShare Headphone Y-Splitter with Volume Control/Mute for Zune - Looking for a Y-connector for headsets to use with an iPod or other MP3 player or with a laptop? Consider the following product, which is on another Amazon web page:

Monster AICYP 200 ...
Turbo Earhugger TV-6000 Headphone - I may have smaller ears than most adults, because every other earbud on the market is painful and refuses to stay in place for me. These are entirely comfortable and have enough flex that the buds can...
$11.95
Ear Bud with Play/Stop Controller and Microphone for Apple iPhone (Black) - It only took a month before the ear buds started to fall apart. The sound quality was non-existant as two tin cans would have sounded better. The buds were comfortable while they lasted but poor con...
Sennheiser MX 660 Silver Earbuds with Volume Control and Cable Winder ?(Silver) - Great set of phones with a nice rich, deep bass sound. Why are you still wear those white buds?
Shure PTH Push To Hear Control for Sound Isolating Earphones - I am buying a second of these cables for my se430 (in addition to my se530). I love it. Really great to block out load mouths in your work area. When the boss comes by your cubicle to ask about you...
$55.48
Maximo iP-HS1 iMetal Stereo Headset for iPhone (White,Silver) - I loved this headset. The earbuds were comfortable, and the mic was decent. The placement of the mic/button along the cord was good as well. However, as another reviewer said, the small, round, rub...
  1. #1 by charles at August 4th, 2008

    Hi:
    We bought Email Marketing 5.0, created the forms and pasted the HTML code generated by EM into one of our pages in WordPress ver 2.6 in the HTML section of the editor.

    The issue is that the captcha image in order to submit the fomr is not displayed. I think might have to do with WP editor.

    Any clues.

    Thanks,

    Charles

  2. #2 by HanaDaddy at August 4th, 2008

    charles, are you actually using my plugin and having problem?
    If you see your test html output, ampersand and double quotes are transformed into corresponding HTML entities by WordPress. If you actually use my plugin, this problem can be fixed.


    <script>
    var url = "http://www.jurisad.com/em/admin/resources/form_designs/captcha/index.php?c=" + getRandom(1,1000)+ "&#038;ss=" + SetSID();
    document.write("<img src='" + url + "' alt='img'/>&#8220;);
    </script>

  3. #3 by charles at August 5th, 2008

    Hanna:

    Thank you so much for the reply.

    When I posted I have not installed yet your plugin. Now it is installed and everything working fine.

    Thanks again.

    Excellent plugin.

    Charles

  4. #4 by HanaDaddy at August 5th, 2008

    I am glad that my plugin helped you. Thank you.

  5. #5 by Ryan Gerardi at September 24th, 2008

    Good thinking. This is something I have had the need for a lot lately. I am going to download this and give it a whirl.

    Have you tested this on Wordpress MU by chance?

  6. #6 by mekelle at January 6th, 2009

    Hi,
    at first – thank you for a great plugin for Wordpress! I have one one problem, small problem i hope:)
    I need use a PHP code. I tried use it by your example, but without succes. Can you help me? How i can use htis code:

    It was OK, when i used only this part:
    print wp_forecast(”A”);

    But how i can use full of this PHP code?
    Thank you for answer!:)
    Marek

  7. #7 by LeslieTP at January 14th, 2009

    Hi

    Thanks for the plugin.

    When I inserted the 3rd form, it won’t let me update or delete any of the code in the forms. I tried de-activating, and reactivating. Tried deleting the forms several times.

    Any ideas?
    Thank you.

  8. #8 by HanaDaddy at January 17th, 2009

    @LeslieTP. Okay, with v1.5 now, the issue is resolved. Please overwrite existing Hana Code Insert plugin folder with the new version.

  9. #9 by Charlie at January 22nd, 2009

    Hey there,

    Having a bit of a problem with the plugin. I’ve used it on one page and it has made the content of the page not centered anymore. The site looks right, it’s just left-aligned instead of being centered. Any ideas?

  10. #10 by Dara at March 11th, 2009

    Hi Hana,

    Thanks for taking the time to create this plugin. After i download it and open the file (on a mac) it opens up in text wrangler as coding. How do I get to open it as a form like the screenshot you provide?

    Thanks!
    Dara

  11. #11 by alex at March 14th, 2009

    THANKS!!! I’s been 3 hours now since i have been pulling my hair out because my html code would not display properly. Now it works perfectly. Thanks

  12. #12 by mugger at April 3rd, 2009

    You describe use in ARTICLE. Can that apply to PAGE?

  13. #13 by HanaDaddy at April 3rd, 2009

    No this is only for Blog article, not for PAGE. You can edit the template files and add the coding directly into the file easily.

  14. #14 by mugger at April 3rd, 2009

    Tried in both PAGE and POST, without and with $eval_php=true;
    PHP code merely appeared (most of it). Should I be doing a line by line “print”, like your
    print “”;
    ?
    AND thanks for your fast response.

  15. #15 by mugger at April 3rd, 2009

    I should have referred to your
    Here is the actual code used when setting up in the Settings/Options page with name “php example”.
    above, as #14 did not appear as I had intended.

  16. #16 by Sebastian at June 19th, 2009

    Hey Hana,

    I really like your plugin. Thank you for sharing!

    I have a question for a specific development.
    I would like to use this plugin for a clients website (Wordpress as a CMS) and I want to give my client a very easy tool to use HTML-code snipets without knowing any HTML-Markus.
    Your plugin is an easy way to include HTML to the content of a website, but I think the the syntax is quite more complicated the necessary.

    I try to change the program code and the result is that I can use the following syntax:

    *name=mycode*

    instead of

    [hana-code-insert name='mycode' /]

    Isn’t it more easy to use?

    I would like to know you can change the plugin code so that I can use the following syntax:

    #code:mycode#

    or even better would be:

    #mycode#

    I think I could tell my client not to use the # character.

    If you can do that please contact me and tell me what it will cost.

    Best regards,
    Sebastian

  17. #17 by Halo at June 23rd, 2009

    Hi! Love this plugin so much and would like to donate, however noscript brings up an xss issue when I click donate, could you email me your paypal email addy pls? Thx so much again :)

  18. #18 by HanaDaddy at June 23rd, 2009

    Thank you Sebastian and Halo, If you think any kind of improvement is needed, just let me know.

  19. #19 by Juergen at July 1st, 2009

    Thanks for this plugin.
    Question: How can I implement this into my templates?
    I’d like to use it inside header.php so that specific code is inserted in every page/post
    Juergen

  20. #20 by HanaDaddy at July 1st, 2009

    Juergen, Thank you for using my plugin. However, I don’t think my plugin is appropriate for that kind of task. But I am just thinking that I can create
    1. a function to be used in the template files and shows a specific code entry item.
    2. a function shows one random code item from the list.
    And you can insert this function to the specific location of the template.

    What do you think?

  21. #21 by Tom at July 5th, 2009

    Big thanks for your plugin, it works great.
    I have only small problem with position of inserted window. If you look on my site for pgnviewer, you select some play for playback and klick for autoplay or for next move in play – this inserted program does switch (scroll) every move to top again. It is not big problem on 22 inch monitor, but on 19 ínch monitor is it not really usable for playback. How can i fix this problem, plz ?

  22. #22 by Adrienne Fritze at August 27th, 2009

    I want to use your plug-in but Wordpress.org says it’s not yet been tested with 2.8.4. Any update on testing it with this new version of WP?

    Thank you!
    A.

  23. #23 by Sebastian at August 27th, 2009

    For me it works fine with the newest version! :)

  24. #24 by HanaDaddy at August 27th, 2009

    Basically 2.8.4 version is maintenance version and I believe Hana Code Insert will work fine, so you can just download and use it. However, i will check and update the status. Thank you.

  25. #25 by charles at September 17th, 2009

    Dear Hana:

    Do your plugin works witn WP-MU 2.8.4a?

    We installed the plugin, inserted the code (which is used to display a form). The form is displayed correctly, I can fill all fields, but once I click on Send, it is asking to enter an email address, which but it was already entered.

    I have the plugin installed in other WP sites and it works fine with the same form code. This is the only WP-MU installation I have.

    Any clues?
    Thanks,
    Charles

  26. #26 by HanaDaddy at September 17th, 2009

    charles, I am sorry but I never tried WP-MU version before. And my plugin is not developed for MU version.

  27. #27 by Mallory - Detox.FM at September 27th, 2009

    Hana,

    We love your plugin. It was very easy to implement and we’re going wild with it.

    Any way to incorporate it into the Text Widget for the sidebar, or in the sidebar.php?

    Best wishes,

    Mallory

  28. #28 by HanaDaddy at September 27th, 2009

    It is not supported at this time. But,It’s a good idea to use Hana Code Insert in the sidebar widget. I will review on that, mean while if you want to use the Hana Code Insert in the sidebar.php, blow php snippet will do the trick, just change ‘key’ to your defined entry key.

    < ?php
    global $hana_code;
    if ($hana_code != null) {
    echo $hana_code->hana_code_return("[hana-code-insert name='key' /]");
    }
    ?>

  29. #29 by HanaDaddy at October 4th, 2009

    Hana code insert is upgraded to v2.2 , but the Text Widget function is not implemented yet. Probably in the next version soon.

    And Hana Code Insert Plugin home page is moved to a new home. Hana Code Insert.
    Also visit the

    Hana Code Insert Forum

    The comment is now closed. Thank you everybody.

Comments are closed.

Quick Coupons!
Abe's of Maine: Actually , if you buy a product more than $75, you can use FRIEND10 coupon code to get extra $10 off!