InScript
InScript is an extensible scripting framework that provides the capability to insert and modify data without needing to modify any WordPress files.
At the simplest level, it is a generic pattern matcher – it searches for specific patterns, or tags, and replaces them with something else. However, instead of replacing these patterns with static text, you can replace them with variables, functions, and even PHP code.
Some of the features that InScript provides are:
- Dynamic variables, which can be used in many places and are automatically updated (the version and last updated details above are dynamic variables)
- Disable WordPress texturize functions across the whole blog, individual posts, or even individual words
- Conversely, enable texturize, textile, markdown, or any formatting on individual posts or words
- Embed well-defined scripts inside posts and any other part of WordPress, without modifying the theme
The embedded scripts are very powerful, and allow you to do things like:
- Insert post & author information
- Add HTTP meta-values and make them post-specific
- Customise the appearance of words, paragraphs, or posts
- Change date formats on individual sections
- Insert highlighted code
- Insert custom PHP code
- Add custom stylesheets for specific posts
Because of the extensible nature of the plugin, you can add ‘scriptlets’ (mini-plugins) that provide extra features and yet use the same InScript framework.
Here are the current scriptlets:
- rss-link-list.zip - embed RSS feeds in conjunction with the rssLinkList plugin (which must be installed and enabled)
- pinyin-converter.zip - Pinyin converter allows Chinese pinyin to be inserted in the form zhong1guo2 and converted to the correct tonal version of %%lang_pinyin [text=zhong1guo2]%%
Note: install scriptlets into the /wp-content/plugins/inscript/scripts directory.
No really, what does it do?
The best way to explain what InScript does is by providing examples. Note that these examples are provided 'live' by InScript.
Example 1 – Code highlighting
Often you want to highlight some code within a post. This creates several problems:
- Code uses special characters that interfere with HTML
- WordPress mangles a lot of the characters
- It’s a chore to color the code by hand
We can insert an InScript tag to do all this for us.
And this produces:
Example 2 – Blog title & description
Notice anything special about the title of this page? No? Okay, go and look at it again. Yes, that's right, it's different from the rest of the blog. This is because of these two custom fields:
inscript_option_blogname = SuburbanGiraffe
More fun
Of course, all of these are simplistic examples. Separate plugins already exist to achieve many of the functions described here. The point is that InScript gives you the ability to perform these functions anywhere in your blog, using just one syntax and one plugin. Additionally, you can customise the output exactly as you want, using a wider range of functions. You can cook up all sorts of madness – now, who’s for colour-highlighted code in their title?
Before I finish, here are some more live functions:
- Word shuffle - %%str_shuffle [text=my old man is a dustman and he likes giraffes]%%
- Reverse - %%str_reverse [text=hello world and welcome to my plugin]%%
- Rot13 - %%str_rot13 [text=hello world and welcome to my plugin]%%
- Leet - %%str_leet [text=hello world and welcome to my plugin]%%
- Email obsfucator - %%str_obscure_email [email=test.email@example.com]%%
- System info - %%system_os%% %%system_release%% %%system_version%% %%system_machine%%
- Time since - this page was created
(as opposed to %%post_date%%) - PHP version - %%php_version%%
- HTTP agent - your browser is %%http_agent%%
- WordPress version - %%blog_version%%
And here's the WordPress calendar function embedded into a post:






Comments (page 8 of 11)
Jun 26, 2006 7:22 pm
It worked for me. I used it to insert post specific meta tags and adsense code. Inscript is remarkable.
The problem is though, I am not entirely sure how to use Inscript for main index only meta tags without resorting to using the global tags. Let alone doing category specific meta tags. Although it seems Headspace 2 can do category specific tags now.
If Headspace 2 can do it, I am wondering if Inscript can. Since Inscript is so powerful.
Jun 14, 2006 9:13 pm
John,
This plugin looks like it should do 3 or 4 things that I could really ue. Except, I'm just not getting how to get it up and running.
I'm on Wordpress 2.0.2 using the giraffe2 theme (which is fantastic!)
The plugin is installed and activated. The inscript directory permissions are 777 and auto.php is in there.
The hooks for the_content the_excerpt wp_head wp_footer wp_meta are all check marked..
The suggested tests using %%system%% and %%php_info%% render with the post contents and no system or php_info information. Viewing source shows no sign of the functions, either.
If I use inscript function tags, those show up when I view the source for the rendered page, but nothing is displayed except the content.
I appologize if I'm missing something obvious here but this is driving me nuts. I'm sure I've read every word on this web site and in the manual. (Except the ones addressing whatever I'm missing.
Thanks,
Eric
Jun 13, 2006 10:36 pm
Blake, you will need to 'escape' the text. All special HTML characters (such as the <) need to be turned into HTML entities (such as <) otherwise they will not appear or get stripped out by WordPress before InScript has a change to look at it.
Jun 12, 2006 8:31 pm
Please disregard my previous post--inscript is now working.
Cornell
Jun 12, 2006 8:27 pm
I have all hooks enabled, but can't seem to get inscript to work. For example, inputting %%system%% into a post only returns %%system%%---that is, no inscript error message.
Based on previously-answered rsponses, it's something in the Theme.
I'm a WP newbie---any suggestions on where to start troubleshooting?
Cornell
Jun 5, 2006 8:47 am
My code got stripped out. Let me try again ....
<inscript text="%1" wp="off">
<?
$query = "patriotic or liberty or american and not (checkers or baby or tooth)";
doadbpull('patriotic',$query,'24','8');
?> </inscript>
Jun 5, 2006 8:46 am
Okay, thank God.
I need this script for similar reasons to other people: adsense deluxe doesn't work with the TextControl plugin, but it was the only way I could figure out how to turn off default WP formatting for my custom php hacks.
Now I'm trying your plugin but I'm not using it right. (This is awful ... prepare yourself ...)
The gratuitious line breaks are still there. I know I'm not combining my function and inscript the right way. Any tips? Sorry to ask such a dumb question.
May 16, 2006 5:57 am
Joe: Are you 100% that you hooked into the appropriate filter? If you did then the values you entered, even if wrong, will be replaced by an InScript error message. If you haven't then they will just appear exactly as you enter.
Richard: That sounds like it may be aspect of the theme. It's impossible for me to say anymore here. If you have the problem available online then I can take a look
Apr 24, 2006 1:09 pm
It's very nice when putting title tags onto individual pages, but on category pages you get two title tags - the category title tag and some way below it the title tag of the top post.
I would like to be able to get rid of the title tag of that top post, but can't figure it out. Global fields seem too sweeping, unless there's a way of doing it that applies to each separate category.
Mar 30, 2006 3:50 pm
Hi,
InScript does not seem to work for me. I'm using WP 2.02
I put this in a post, I just put it in the post after installing
br /> !!log!!
!!rss!! !!123!!
%%function [param1=!!changelog!!]%%
This is an example sentence.
None of them worked. I went and added the variables where you said, in the name box I put "rss" and left out the !!, isn't this what I am supposed to do? After that I tried an example in the manual and it still didn't work it just shows the text and like !!123!! and on the it left out the
Leave a comment