WP-CodeBox

No Gravatar

Era da un po’ che cercavo un plugin del genere per Wordpress e ora che l’ho trovato ve lo segnalo con gioia :)

WP-Codebox realizzato da Eric Wang non è altro che un “code syntax highlighter”, realizzato in PHP (con alcune feature “in” AJAX*), per Wordpress. L’ideale per inserire pezzi di codice (di svariati linguaggi supportati) nei post.

Ad esempio questo script bash:

#!/bin/bash
clear
echo "Wallpaper 1.0"
echo "Autore: Giulio Rossetti"
echo "Copyright: GPLv3 2008"
if [ "$1" = "" ];
then
echo ""
echo "Attenzione: è necessario fornire in input il path delle immagini"
echo "Esempio: ./R_Wallpaper source/ (a partire dalla home dell'utente)"
echo ""
exit
fi
 
WALLPAPER_DIR=$HOME/$
FILES_FOUND=`ls -1 "${WALLPAPER_DIR}" | wc -l`
 
while ( $TRUE );
do
numero=$RANDOM
RANDOM_NUMBER=$(( $numero % $FILES_FOUND +1 )
RANDOM_FILE=`ls -1 "$WALLPAPER_DIR" | head -n $RANDOM_NUMBER | tail -1`
gconftool-2 -s /desktop/gnome/background/picture_filename -t string   "${WALLPAPER_DIR}/${RANDOM_FILE}"
gconftool-2 -s /desktop/gnome/background/picture_options -t string "stretched"
sleep 600
done
exit

* Correzione apportata in seguito della segnalazione di DnaX :) tnx, mi ero spiegato male!!

Popularity: 11% [?]

Tags: , , ,


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

2 Responses to “WP-CodeBox”

  1. Ajax? Cosa c’entra ajax col plugin?

    Cmq dovrebbe essere simile a quello che ho sul mio blog, vedrai usa la libreria php Geshi per fare il tutto.

  2. “WP-CodeBox provides clean syntax highlighting and AJAX advanced features for embedding source code within pages or posts.”

    Sulla libreria Geshi siamo d’accordo, mi son spiegato male si vede :P parlavo di altre funzionalità (in parte pseudo inutili, ma si sa “gli zuccherini” son sempre graditi)..

Leave a Reply