Blog

WordPress Widget: King Text (+php) (+html)

"Another Text Widget? Why the hell would i need that?"

Well read on and it might convince you.

Features

wordpress widgets king text

Version 0.69 NEW Features 

- Randomize Widget Content. Split the content with the <!–more–> Tag and it will shuffle the text or php code inside.

- Remote Version checking

- Option for using the Javascript Slide Open/Close function

- Where NOT to show. Select Side Area where the widget is not be shown on (i.e. everywhere but Home) this can be combined with the show in category

- changed the license type

Version 0.63

- 20 Text Boxes

- set HTML before/after seperatly for each Widget OR takes widget before/after HTML from functions.php if left empty 

- Menu in which Website Area to show the Widget on.  New Options are:

  • show on Home / Search / Archive or 404 page
  • show on all or special single Page. You can set the id or slug of the Page where to show
  • show on all or special single Article You can set the id or slug of the Article where to show
  • show on all or special Category Listing You can set the id of the Category where to show
  • Show if inside a special Category.  If in list List or on single Article

You find all Options explained in the WordPress Codex in Conditional Tags  make sure to definitly read this if you are using those Options!

– new ajax menu

Version 0.5

- Choose whether to have php or just html in the widget. With php in the widget you can for example use any WordPress call. So if you are missing any WordPress or Plugin functions in widgets insert them there.

- choose in which category the widget shall appear

- 4 html fields to custmize html before/after widget and title 

- based on the king widget framework 

- Fully localizable with gettext Translation (German Translation included)

 

Screenshot

German and English Admin Screens (Version 0.6+  foldable menu, updated screens are comming)

King Text Admin Screen Englisch  King Text Admin Screen German

 

 Comming Features

- Randomly show box Content devided by <!–more–> Tag like in AdRotator. so you also rotate php code or anything else

- Option to show widget to a specific Role -> use wordpress capabilities (I will give this a priority if someone asks/pays for it)
-  set initial JS Open or Close State + JS Open/Close Time
- make use of is_home / is_single or other conditional tags -> what do you think?

- What else would you like to see? Please comment!  

 

Install

Of course you should have wordpress widgets installed and activated. If not, you can find the download and install instructions over at automattic.com

- Copy king_text.php into your plugins widget folder -> where your widgets.php is !!!

- Copy the King Widget Framework in /king-includes into /plugins if you have not already another King Widget installed

- activate in Pluginarea.

- Drag the King Text Widget on one of your sidebars and play with the options. 

Usage 

Show Content Randomly

- insert the <!–more–> tag between you text or php content

Use JS Slide Open/Close

- Hint: When used together with Random Content the Javascript does not instantly recognize the new height of the box. After toggling it the height is ok.  

Here are the steps to be taken. If you don´t understand those you can simply forget about this function

1. Go into the new King Framework Options Panel and activate the  "Insert Sliding Javascript to Head"

2. go to the text widget html options and activate "Use Sliding Box"

3. The difficult part:

You have to fill the custom html options fields(or use this inside the textbox). The Box needs to be wrapped in a collappsible elemet(div/li/p) with aspecial ID and you have to give the click event to some element. Since this can vary with your blogtemplate i left this up to you.

Standart Options which should work with the default Template: (please check the " when copy/paste)

HTML Before Widget: <li>

HTML before widget Title: <h2 onClick="textslide1.toggle();" ><li>

HTML after widget Title: </h2><div id="text1">

HTML after widget: </div></li>

When you have multiple Boxes you just have to adapt the numbers in textslide1.toggle -> textslide2.toggle and of course the id text1 -> text2 

Upgrade

For Version 0.69 you also need to get the changed King Widget Framework which is now available separate.

After upgrading your framework just replace king-test.php with the new one. Your textboxes content should remain unchanged.

Download

Version 0.69

 king-text_0.69.zip king-text_0.69.zip (05.07.2006 01:13)

don´t forget to get the king-widget framework Version 0.68 or greater.

Version 0.63 

king-text_0.63.zip king-text_0.63.zip (09.05.2006 16:13)

 

Please don´t hesitate to give me a feedback if this is usefull or if you think you found a bug!

Have fun! 

Georg Leciejewski

89 Comments to WordPress Widget: King Text (+php) (+html)

  1. ovidiu's Gravatar ovidiu
    30.10.2006 at 13:11

    sorry the code completely disappeared.

    I’ll try again:

    I tried inserting a lot of spaces, hopefully it works this time here in the coment

  2. ovidiu's Gravatar ovidiu
    30.10.2006 at 11:52

    hello,

    I have just tried to display a certain php code with this widget. I insert the code, check the php check box, update, and when I check again the widget teh php code disappeares…

    here is one example I am trying to get to display:

    I introduced some spaces in the php code so that it gets not filtered, after saving the widget settings, I open them again and the php code has disappeared….

    can you help please?

  3. 24.10.2006 at 1:41

    Exelente trabajp XD.

  4. leo's Gravatar leo
    20.10.2006 at 16:22

    hallo schorsch.

    ich habe 10 Text Widgets und und zeige diese auf verschiedenen Seiten an.
    nun habe ich zwei Seiten wo ich 2 gleiche Text Widgets anzeigen möchte, in der Beschreibung steht das ich die Seiten ID’s getrennt mit Komma angeben kann, leider funkioniert das nicht.
    hast du einen Tipp für mich?

    mfg, leo

  5. 05.10.2006 at 22:03

    Great set of widgets, thank you.

    I sent an email out, unsure if it made it over, so my question:

    I’m trying to get a text widget (actually any widget using the framework) to display *only* in the catagory page it’s linked to. However, if posts are in more than one catagory, there are issues.

    Take my weblog, for example. I have one King Text Widget trying to stay in page of catagory 3 (Second Life), but if the top post in the Main (is_home) page is also catagory 3 it shows there too. This also goes for the other catagory pages where the top post in the sequence is also catagory 3.

    If this is a WordPress limitation I’ll just give up, but I hope not. I’m using 2.0.4 btw.

    Thanks,
    –TSK

  6. 26.09.2006 at 7:09

    Answering my wn question :)

    nickname; ?>’s

  7. 26.09.2006 at 6:52

    I am trying to put the nickname of the currently displayed author page into the widget.

    Is this possible? What is the php I would use? Tried a bunch of stuff and failed – help appreciated!

  8. 20.09.2006 at 3:34

    Awesome widget. Thank you so much!

    As per comment # 23… I too would like to see the dropdown list as checkboxes and re-programmed to allow for more precise placement of where I want my boxes.

    Let us know when you create such magic!!!

    Take care.

  9. Valerie Williams's Gravatar Valerie Williams
    22.08.2006 at 18:39

    Okay thanks! I use Firefox at home, but at work we are only allowed to use IE, so I’ll just have to be resigned to re-checking that PHP box if I do anything at work. Thanks again!

  10. 21.08.2006 at 18:04

    Hey Valerie,

    first of all, it’s not me who did this widget, it’s Schorsch, I’m just a fellower like you. But to answer your problem, you have to open the widget admin in Firefox, not in Internet Explorer. Schorsch tried to fix it for hours and it didn’t work. So you have to open it in Firefox, which is anyway much better than IE. Try it out for yourself.

    Have a great day

    Alex

  11. Valerie Williams's Gravatar Valerie Williams
    21.08.2006 at 16:33

    Alex, thank you so much for these great widgets. They solved a lot of problems I was having getting my site to work the way I wanted to. I didn’t list it here, because it’s not ready for public view yet. The Text widget works great for plugging in non-widget plugins in an easy, quick way. Thanks again!

    One quick comment – on the Text Widgets, the only problem I have had is that if I open the widget in my control panel to check something or change something, whether I make any changes or not, the “Use PHP in Text” box always automatically unchecks itself, which effectively breaks the plugin I’ve put there until I realize what happened and fix it.

    You might consider setting that to stay checked (if it was previously checked), rather than always defaulting back to unchecked, if possible.

    But, that’s a minor item. Just wanted to say thanks a bunch! Really appreciate your work!

  12. 21.08.2006 at 8:31

    Vielen Dank Schorsch, klappt jetzt wunderbar.

    Alex

  13. 19.08.2006 at 22:53

    Hallo Schorsch, sorry das ich dich schon wieder nerve. Ich habe in der Sidebar ein Textwidget meiner Top 3 eingefuegt und auch die Funktion “Used Slide Open Box” aktiviert. Ich habe auch den noetigen html Code eingefuegt. Leider funktioniert es nicht. Beim Login Widget funzt es ohne Probleme, hoffe du kannst mir da weiterhelfen.

    Vielen Dank im Voraus

    Alex

  14. 14.08.2006 at 22:56

    hallo Schorsch,

    wie kann ich eine Extrazeile zwischen den einzelnen Widgets machen. die Widgets, ob Login Widget oder Textwidgets, die ich von dir einsetze sind immer gleich untereinander angesetzt. Waere super wenn ich zwischen den einzelnen widgets eine Leerzeile einfuegen kann. Ich habs schon im Widget mit / vor und nach dem widget probiert, aber nichts funzt.

    waere fuer ein Beispiel sehr dankbar.

    Ach ja, nur zur Info, auf deiner Seite wo du alle Widgets Symbole als Uebersicht aufgelistet hast, hast du das TextWidget Symbol garnicht dabei.

    Alex

  15. 07.08.2006 at 0:47

    Unfortunately, it was Firefox that was giving me problems and I had to resort to IE to make things work at all. But, as I mentioned, it was probabably something on my end (laptop, session management, site caching?) since it has been a non-repeating problem so far.

    Regards,

    Rich.
    BlogRodent

  16. 06.08.2006 at 19:14

    please try to use Firefox since the bug you had seems to come from IE.

  17. 06.08.2006 at 19:06

    Thanks for your quick reply, and for taking the time to look into it. For some reason, today everything worked beautifully. When I left my comment I could only manage the Widgets using IE, as well, and King Text was acting oddly. However, since then, I’ve flushed my WordPress cache, reinstalled a few plugins, flushed my FireFox cache, and generally restarted everything. So, today, when it works beautifully, I conclude the problem was probably client-side.

    Thanks, again, for looking into this. I’m delighted to use KingText. It’s a great, useful tool. The exact kind of thing the WordPress developers should’ve put in, but didn’t.

    Regards,

    Rich
    BlogRodent

  18. 05.08.2006 at 13:50

    @rich
    i checked the code again and did some testing but could not locate a problem.
    Maybe you can try to disable some other widgets to make sure it comes from the king text.

  19. 05.08.2006 at 13:31

    Hi, what a great set of widges, and King Text serves my needs very nicely.

    Only one problem … when I check the box to allow PHP, close the widget screen, and click to save my PHP-enhanced text box, everything works fine. But, then, when I add more widgets or update some other widget, the King Text seems to revert back to disabled PHP. Things mysteriously disappear on my weblog.

    Any ideas what could be the problem? At the time I write this I am not behind a firewall, and it’s not a caching issue.

    Regards,

    Rich
    BlogRodent

  20. 28.06.2006 at 22:21

    Gengo kann ich nur empfehlen. Sehr gut (wie der King Text :) .

    Alternativ kann man das mit den Textblöcken für die Sidebar auch mit Gengo lösen, weil es eine Funktion für zweisprachige Textblöcke gibt. Allerdings wäre das wahrscheinlich mit King Text ein bisschen komfortabler zu verwalten gewesen, deshalb fragte ich.

    Muss ich in dem Fall halt auf die Widget-Lösung verzichten. Na, macht nix.

  21. 28.06.2006 at 21:03

    Großartiges Ding.

    Ich habe jetzt einen Spezialfall, und zwar verwende ich Gengo, ein Plugin, womit man zweisprachige Seiten betreiben kann. Der URL wird dann jeweils für jede Version ein “?language=Ländercode” angefügt. Sehr praktisch.

    Jetzt würde ich gerne für die Startseite in der Sidebar einmal einen deutschen Text und einmal einen englischen Text haben, der je nach URL in der korrekten Sprache angegeben (also bei URL language=de ->deutscher Text und entsprechend beim Englischen).

    In den Optionen von King-Text gibt es ja die Option
    Spezieller Bereich und dann “Bereich ID/URL/Titel”. Ich hoffte, wenn ich dort den obigen URL-Teil eingebe, dann wird der King-Textblock tatsächlich nur dort angezeigt, klappt aber nicht.

    Gibts da vielleicht eine Möglichkeit, die Dir einfiele?

    Merci im voraus.

  22. 28.06.2006 at 18:06

    I look forward to the “rotator” function — of course, I’m not complaining, either. The King family of widgets is fantastic already!

  23. donzacharias's Gravatar donzacharias
    21.06.2006 at 19:09

    sorry for the junk code… that second section should read

    <code><?php foreach ($authorsArchives as $authorArchiveLink): ?>
    <option value=”<?php echo $authorArchiveLink->user_nicename; ?>”><?php echo $authorArchiveLink->display_name; ?></option>
    <?php endforeach; ?></code>

    thanks again

  24. donzacharias's Gravatar donzacharias
    21.06.2006 at 18:43

    Hi, thanks for making such a useful plugin! I’m having trouble using the results of a custom select query inside a King Text widget. Here is the page:
    http://wp.sacrag.com/

    the area in question is the error in the second SELECT in the right column. The following PHP is in the HEAD:

    $authorsArchives = $wpdb->get_results("SELECT * FROM $wpdb->users");

    and then the following PHP is used in a King Text widget:

    `
    user_nicename; ?>">display_name; ?>

    and you see what that does on the above link. I’m guessing it has something to do with the scope of $wpdb but I don’t really understand how to fix that. Can anybody help?

    Thanks!

  25. 15.06.2006 at 11:46

    besteht eigentlich die möglichkeit, das widget so umzustricken, daß zb. die anzeige auf
    home
    archiv der category 3
    allen einzelseiten der category 3

    möglich ist?

    Beispiel: http://www.spiegelland.de.hm
    der mondkalender soll auf der Startseite in der kategorie “Jahresrad” (http://www.sternengarten.info/fauna/?cat=48) und bei bei der artikelansicht (http://www.sternengarten.info/fauna/?p=160) in dieser kategorie angezeigt werden.

    Das gleiche wäre beim king catgories widget nötig.

    ja… ich weiß… frauen und sonderwünsche … ;-)

  26. 10.06.2006 at 11:52

    Thanks for a great plugin! It is one of the most useful plugins I am using. It is hard a at work on http://www.xeep.net.

  27. 10.06.2006 at 9:29

    Instead of 1) in #22, I want to make the following suggestion.

    Use checkboxes insted of a dropdown list for areas where the wisget should be shown.

    One should be able to select multiple areas where the widget can be displayed rather than restriciting it to a single area.

    This would be a great feature in almost all king widgets! Thanks a lot

  28. 10.06.2006 at 0:09

    I have 2 feature requests!

    1) is NOT in the following areas
    – can be useful to show some text on all pages but the home page!
    2) Add is_author to the list of areas.

    Great plugins! Thanks a lot!

  29. 09.06.2006 at 22:07

    I’ve installed all files correctly but king-text doesn’t show up in the widgets menue.

  30. 25.05.2006 at 12:12

    I’m using the hemingway theme, that incorporates blocks rather than widgets… (discussion board @ discuss.warspire.com )

    Is it possible to incorporate king text etc.. into this?

    Chris

  31. 25.05.2006 at 11:40

    Hi guys,

    how I can place the title of text widget and the text on different rows? (I use your king text widget and put in it the UTW cloud). You can look what I mean on my blog.mobilet.ru – the very bottom widget on sidebar. There “Теги” is Titie, and cloud is php text.

  32. chrisblack's Gravatar chrisblack
    12.05.2006 at 16:41

    whoops… i jumped here from wp widegtes page – i missed out on installing king framework!!!

    Chris

  33. chrisblack's Gravatar chrisblack
    12.05.2006 at 16:16

    help please??

    Warning: require_once(D:\webworld\bantryyouth\bantryyouth.net\www\wordpress/wp-content/
    plugins/king-includes/library/king_widget_functions.php) [function.require-once]: failed to open stream: No such file or directory in D:\webworld\bantryyouth\bantryyouth.net\www\wordpress\wp-content\plugins\widgets\king-text.php on line 360

  34. peb's Gravatar peb
    09.05.2006 at 15:21

    I ran into a small problem with King Text.

    The widget does not seem to populate many parameters with defaults. In particular, default WIDGET HTML code is simply blanked rather than being filled with default values. I’ve been able to work around this by manually inserting the values. The widget code assigns actually assigns these defaults initially, but never populates the form so that when the form is updated, the resulting fields are blank, and do not contain the default data.

    I don’t have King Categories loaded now, but I think there’s a default location that triggers display that is supposed to be index.php that suffers the same fate.

    Neither of these are serious problems, but I had to scratch my head a few times trying to figure out why the “default” values never showed up, and I have to manually enter everything rather than modifying a default when I use the widget. OTOH, these widgets allow me to do things I couldn’t do with any other widget, so I still gladly use them.

  35. peb's Gravatar peb
    08.05.2006 at 3:21

    Really a great plugin, and greatly expands the versatility of widgets.

    I’d like to give some users access to these, but I’m unwilling to give them the capability to use php in scripts unless I know that they know what they’re doing.

    So, it would be nice to have a feature to set a minimum level for including php in any widget. Just a thought for the future.

    In any event this is a really nice effort that is very much appreciated.

  36. bob's Gravatar bob
    02.05.2006 at 19:39

    i have this problem with king text:
    Warning: widget_king_text_register(widgets.php): failed to open stream: No such file or directory in /var/www/sdb/8/9/moax/MOA/wp-content/plugins/king-text.php on line 281

    Warning: widget_king_text_register(): Failed opening ‘widgets.php’ for inclusion (include_path=’/var/www/sdb/8/9/moax/include:.’) in /var/www/sdb/8/9/moax/MOA/wp-content/plugins/king-text.php on line 281

  37. 26.04.2006 at 9:12

    Oh my god, king plz help:
    Warning: widget_king_categories_register(widgets.php): failed to open stream: No such file or directory in /home/../../../wp-content/plugins/king-categories.php on line 471

  38. Administrator's Gravatar Administrator
    25.04.2006 at 15:13

    thanks for the feedback:
    1. yeah i´ve thinking about that. Since the boxes are indentified by the name, kind of tricky. but actually a must.
    2. no problem, i will increase it in the next version to 20!

  39. ss's Gravatar ss
    25.04.2006 at 14:54

    Suggestion:
    1.show customed title bit king text1 text2…,etc.
    2.number of text box can be over 10.

    Thanks, it is a good plugin~

1 Trackback to WordPress Widget: King Text (+php) (+html)

  1. By on 05.07.2009 at 15:38
  2. By on 02.06.2009 at 8:25
  3. By on 31.01.2009 at 22:25
  4. By on 05.09.2008 at 14:46
  5. By on 06.01.2008 at 12:43
  6. By on 23.08.2007 at 10:41
  7. By on 16.07.2007 at 1:12
  8. By on 15.07.2007 at 15:54
  9. By on 14.07.2007 at 13:58
  10. By on 15.06.2007 at 7:48
  11. By on 01.06.2007 at 5:02
  12. By on 31.05.2007 at 2:46
  13. By on 20.05.2007 at 9:52
  14. By on 18.05.2007 at 11:18
  15. By on 17.05.2007 at 4:12
  16. By on 17.05.2007 at 0:44
  17. By on 17.05.2007 at 0:41
  18. By on 01.04.2007 at 20:48
  19. By on 16.03.2007 at 8:12
  20. By on 11.03.2007 at 18:46
  21. By on 30.01.2007 at 7:41
  22. By on 13.01.2007 at 23:17
  23. By on 18.12.2006 at 22:33
  24. By on 08.12.2006 at 11:53
  25. By on 05.12.2006 at 1:19
  26. By on 04.12.2006 at 18:38
  27. By on 28.11.2006 at 0:08
  28. By on 27.11.2006 at 19:49
  29. By on 19.11.2006 at 14:10
  30. By on 13.11.2006 at 2:25
  31. By on 25.07.2006 at 3:55
  32. By on 06.07.2006 at 3:16
  33. By on 08.06.2006 at 22:57
  34. By on 04.06.2006 at 23:58
  35. By on 09.05.2006 at 1:09
  36. By on 28.04.2006 at 20:35
  37. By on 24.04.2006 at 15:34

Work

Archive