/customers/familjencarlstrom.se/familjencarlstrom.se/httpd.www/WordPress/wp-content/plugins/wp-cache/wp-cache-phase1.php Wordpress | Familjen Carlströms Blog

Archive for the ‘WordPress’ Category

Jul 06
Familjen Carlström

Blog by cellphone

Kl 9:05 av Familjen Carlström i WordPress svenska currently 4 349 views Updated: 2 Sep, 2007

Now you can read all posts by WAP on your cellphone. You can reach the page at:



Sep 07
Familjen Carlström

SQL-data for IP-to-Country

Kl 20:45 av Familjen Carlström i WordPress svenska currently 4 605 views

New data is converted. Link to post here.

Jul 07
Familjen Carlström

Translation of wp-forecast

Kl 11:31 av Familjen Carlström i Translations, WordPress svenska currently 1 867 views Updated: 30 Jul, 2007

I missed a step when uploading the file. It is now available.

I have made a swedish translation of wp-forecast. In the below rar-file you will find the language.php- and wp-forecast-admin.php-files with swedish translations.

wp-forecast 0.9.1 swedish translations

wp-forecast 1.0b2 swedish translations

Jul 07
Familjen Carlström

WP Plugins DB

Kl 11:44 av Familjen Carlström i Translations, WordPress svenska currently 1 849 views Updated: 29 Jul, 2007

 A minor error in the code made the button to move the plugin to main/submenu to show only pats of the text. Corrected in the downloaded rar-file. 

 A very good plugin is created which simplifies the work as admin to track and update your plugins. This Plugin compares the version of the plugins in your blog with corresponding plugins version at wp-plugins-db.org Database. Read more at:


I have localized the plugin and created a .pot-file. Swedish translation is also created. This can be downloaded below:

WP-Plugins-Tracker Localized

Jul 07
Familjen Carlström

Languagefiles to Postie 1.1.1

Kl 13:59 av Familjen Carlström i Translations, WordPress svenska currently 1 845 views Updated: 21 Sep, 2007

I updated the config_form.php to support localization. The postie.pot-file was also updated to support this. Created Swedish po and mo-files. This can be downloaded in the rarfile below:

Postie 1.1.1 Localization

Jul 07
Familjen Carlström

Codeviewer 1.4.3

Kl 20:21 av Familjen Carlström i CodeViewer, WordPress svenska currently 1 822 views

Codeviewer is updated to version 1.4.3. Downloads at the CodeViewer-post below:


Jul 07
Familjen Carlström

Enhancing the WordPress plugin Admin drop menu

Kl 16:33 av Familjen Carlström i Translations, WordPress svenska currently 2 207 views Updated: 29 Jul, 2007

I enhanced the WordPress plugin Admin drop menu to support selfmade icons in the menu. You will find the file at Yellowfish.

Post (http://www.yellowswordfish.com/support-forum?forum=6&topic=454&page=1

Jul 07
Familjen Carlström

IP-to-country sql-data

Kl 10:51 av Familjen Carlström i WordPress svenska currently 4 367 views Updated: 22 Sep, 2007

Here you find a csv to sql-converted file for use with the ip-to-country WordPress-plugin. Right-click the link and choose "Save as target". The file consists of approx 77000 rows which can cause mysql to hang.

You can then split the sql-fil or download the csv-file here and convertingphp-file here. Edit csvimportscript.php and put the correct information in xxUSERNAMExx, xxPASSWORDxx och xxDATABASExx. Upload csvimportscript.php and ip-to-country.csv to your server and run the php-script. Then the table is created and populated.

The csv-information is dated 2007-03-05 2007-07-30.

Csv-data can also be found at:


Jul 07
Familjen Carlström

Addition of swedish langugefile for EventCalendar3

Kl 13:23 av Familjen Carlström i Translations, WordPress svenska currently 2 042 views Updated: 29 Jul, 2007

I have created a swedish languagefile fo the useful widget EventCalendar3


.mo can be downloaded here and .po can be downloaded here 

Aug 06
Familjen Carlström

Code Viewer

Kl 20:58 av Familjen Carlström i CodeViewer, WordPress currently 12 264 views Updated: 23 Jul, 2008

The original version is developed by Aaron Schaefer (http://elasticdog.com/) and AJ (http://flash.terra.ee/?p=11). This version is slighly modified by me to be usable with a WUSIWUG-editor.

Code Viewer is a WordPress plugin that pulls source code from an external file and displays it, optionally adding a link to download the code directly. The plugin displays the code with proper indentation, line numbers, and automatic long-line wrapping. The plugin also works well with a WYSIWYG-editor and has GeSHi-support.

When using Code Viewer, you no longer have to worry about typing countless entity references in order to make your code “HTML friendly” or to simulate tabs…it’s all done automatically with PHP and a little CSS. By inserting line numbers on your page, the plugin also eliminates the problem of long, non-breaking lines screwing up your layout. In addition, line numbers make convenient reference points when discussing code samples.

Last, but not least…because you’re pulling the source code from an external file (rather than having it embedded directly in your entry), the same code can be repeated on numerous pages, and you only have to type it in once. This not only saves you time, but when you update the code in the centralized file, all instances of that code will be updated along with it.


  1. Download Code Viewer v1.4.4 (MD5 Sum: 0e667da2c95ab3ebbca60d808f54e9b3
  2. Extract the contents in the rar-file.
  3. Upload the codeviewer-directory into your wp-content/plugins/ directory.
  4. Activate the plugin on your WP Admin » Plugin Management page by clicking the corresponding “Activate” link under the Action column.
  5. Goto WP Admin » Options » Codeviewer and edit the default paths. 
  6. You’ll also want to change some of the classes in the CSS that will control the look of the code listing. Everything (with the exception of auto-indention) works just fine without the CSS; but adding it in makes a huge difference on readability. Feel free to change these values to whatever you like, but futher down you see how I have mine set up.
  7. If you want to use GeSHi-highlighting download the latest GeSHi-class at http://qbnz.com/highlighter/ (2008-07-22: 1.07.22 is latest version). Extract the contents in the zip-file. Upload the geshi-directory into your wp-content/plugins/ directory.

MD5 Sum (http://www.download.com/WinMD5Sum/3000-2381_4-10115915.html) let you check that no manipulation is done to the file.


Code Viewer basically searches your entry for a custom tag named [viewcode ] [/viewcode], that tells the server to look at an external file and parse it line-by-line into an ordered list. It can be placed anywhere a block-level tag is valid but the tag must be properly closed.

Note that there should not be a white space character after viewcode and before ]. I have problems to show this tag correctly into this post without showing everything as code!

To better illustrate its usage, the tag used in this entry (to show the codeviewer.css listing above) was:
[viewcode ] src=codeviewer.css geshi=css[/viewcode]

  1. /***************************************
  2. * This file shall be put into the directory
  3. * wp-content/plugins/code-viewer
  4. * Created by Håkan Carlström
  5. * www.familjencarlstrom.se
  6. ***************************************/
  8. ol.codelist{
  9. border:1px solid #303130;
  10. background-color:#FEFEFE;
  11. font-size:13px;
  12. font-family:'Courier New',Courier,monospace;
  13. }
  15. ol.codelist li.even{
  16. background-color: #aebbc6;
  17. }
  19. ol.codelist li.odd{
  20. }
  23. ol.codelist li.tab0 { padding-left: 2px; }
  24. ol.codelist li.tab1 { padding-left: 26px; }
  25. ol.codelist li.tab2 { padding-left: 50px; }
  26. ol.codelist li.tab3 { padding-left: 74px; }
  27. ol.codelist li.tab4 { padding-left: 98px; }
  28. ol.codelist li.tab5 { padding-left: 122px; }
  29. ol.codelist li.tab6 { padding-left: 146px; }
  30. ol.codelist li.tab7 { padding-left: 170px; }
  33. ol.codelist li code { color: 222; }
  35. ol.codelist div {
  36. margin: 0;
  37. padding: 1px 2px;
  38. }
  40. ol.codelist div.tab0 { padding-left: 2px; }
  41. ol.codelist div.tab1 { padding-left: 26px; }
  42. ol.codelist div.tab2 { padding-left: 50px; }
  43. ol.codelist div.tab3 { padding-left: 74px; }
  44. ol.codelist div.tab4 { padding-left: 98px; }
  45. ol.codelist div.tab5 { padding-left: 122px; }
  46. ol.codelist div.tab6 { padding-left: 146px; }
  47. ol.codelist div.tab7 { padding-left: 170px; }
  49. ol.codelist li.sourcelink {
  50. color: 000;
  51. font: 115% Georgia, "Times New Roman", Times, serif;
  52. list-style: none;
  53. margin-left: -32px;
  54. padding-top: .85em;
  55. text-align: center;
  56. }
  58. ol.warning{
  59. }

This CSS-file is included in the above rar-file of CodeViewer.


[viewcode ] src="URL" link=display lines=visible scroll=display scrollheight=height showsyntax=display geshi=language[/viewcode]

  • The URL attribute is required.
    • "URL" - string - The URL of the code to display. Note that relative paths are in relation to the $default_path variable set during the installation step.
  • The link attribute is optional.
    • display - string - Should the link to the code be displayed (yes), or not be displayed (no). If the link attribute is left out of the tag completely, the value defaults to no.
  • The lines attribute is optional.
    • visible - string - Which linenumbers shall be visible in the output. Use , and - to separate linenumbers. Example 1,3-5,10-12,16-18,22.
  • The scroll attribute is optional.
    • display - string - Should the scrollbar be displayed (yes), or not be displayed (no). If the scroll attribute is left out of the tag completely, the value defaults to no.
  • The scrollheight attribute is optional.
    • height- string - Height of the scrollbar. In px (pixels). Defaults to '100 px'(pixels).
  • The showsyntax attribute is optional.
    • display - string - Should the syntax used of [viewcode ]  be displayed (yes), or not be displayed (no). If the showsyntax attribute is left out of the tag completely, the value defaults to no.
  • The geshi attribute is optional.

All attribute values can be surrounded with double quotes (") or single quotes(').


Here are some examples of valid syntax recognized by Code Viewer.

Note that all of these examples point to the same file (assuming the $default_path variable is set to "http://www.familjencarlstrom.se/WordPress/Mods/"):

[viewcode ] src=http://www.familjencarlstrom.se/WordPress/Mods/codeviewer/codeviewer.css link=yes[/viewcode]
[viewcode ] src="http://www.familjencarlstrom.se/WordPress/Mods/codeviewer/codeviewer.css"[/viewcode]

[viewcode ] src="codeviewer/codeviewer.css" lines=1-30 scroll=yes scrollheight=200px [/viewcode]
[viewcode ] src="codeviewer/codeviewer.css" lines=1-5,10-15 showsyntax=no [/viewcode]
[viewcode ] src=codeviewer/codeviewer.css[/viewcode]
[viewcode ] src=codeviewer/codeviewer.css geshi=css[/viewcode]

The above examples is verified working 2007-07-17. Make sure the WYSIWYG-editor dont add links (which is the usual) to the http://-argument when using absolute path. 

Version History

  • v1.4.4 (21 april 2008) - Changed default showsyntax to no.
  • v1.4.3 (18 Juli 2007) - Added GeSHI-highligtning by using attribute geshi="language".
  • v1.4.2 (17 Juli 2007) - Added the same support as Codeviewer 1.3 which means that there is no requirement of correct ordering. You can also use single quotes and the scrollheight-attribute has been corrected.
  • v1.4.1 (8 Juli 2007) - Added Option Page at Admin page with Default Path and Plugin Path(instead of editing in file) and localization.
  • v1.4 (16 Aug 2006) - Usable with a WYSIWUG-editor.

By others

  • v1.3 (5 Jul 2005) - AJ added scroll and scroll_height.
  • v1.2 (4 Jul 2005) - AJ added "lines" to input string. 
  • v1.1 (10 Oct 2004) - Fixed blank line detection; no longer confused by whitespace characters.
  • v1.01 (30 Sep 2004) - Update to code-viewer.css; fixed inconsistent font sizing.
  • v1.0 (26 Sep 2004) - Initial release to the public.


The original version is developed by Aaron Schaefer (http://elasticdog.com/) and AJ (http://flash.terra.ee/?p=11). This version is slighly modified by me to be usable with a WUSIWUG-editor.


Code Viewer is licensed under the GPL v2.