dracoblue.net

Escaping { and } or javascript in smarty

When using php's smarty you sometimes want to use { and } (curly braces) in .tpl files.

For such things you can use the {literal}{what you want to do}<!-- {} -->{/literal} statement.

Detailed explanation at the

smarty documentation page.

In open source, php, smarty by DracoBlue @ 09 Jul 2007 | 42 Words

DracoBlue's Wiki moves to dev.dracoblue.net

Spieleschuppen.de started as very informative page about games, mainly about GTA:T.

But Spieleschuppen.de is/was german only, so the English/Polish/French-Content didn't fit in that context then.

Thatswhy I decided to move spieleschuppen.de's content to a new domain called dev.dracoblue.net. But thats not all, the german content will be detected and opens german interface at spiele.dracoblue.net instead. So german users have it way more easier to access german content and all other fellows can use dev.dracoblue.net or games.dracoblue.net now!

In project by DracoBlue @ 04 Jul 2007 | 79 Words

Forwarding X on Linux/Unix Machines

Like ssh.com says, you need to do the following things to successfully forward an X-Server to your client. [ol]

  • Servers X-Config needs to have:

    AllowX11Forwarding              yes
    

  • Clients Set in [em]/etc/ssh2/sshd2_config:[/em]

    ForwardX11 yes
    

  • Now connect via following command:

  • After that, use declare command to set the display to your servers one:

    declare -X DISPLAY="99.99.99.99:0.0"
    

    (with your IP)

  • [/ol] Thats it.

    In articles, linux, open source, ssh, x window system by DracoBlue @ 03 Jul 2007 | 95 Words

    Updated geshi highlighter for pawn + samp

    Elyks reported a problem #384 with current version of the pawn-highlighter for geshi. The issue was a duplicated entry for 'sizeof'.

    II uploaded the

    updated pawn.php for geshi 1.0.

    In geshi, open source, pawn, php by DracoBlue @ 15 Jun 2007 | 31 Words

    Convert Title-String to Url Slug in PHP or Lua

    When making your urls looking better, you may want to convert a title to a url-slug.

    An url-slug is in common a string containing only alphanumeric letters and '-'. Following php and lua function converts it to that format.

    php:

    function toSlug($str) {
    return str_replace(" ","-",ereg_replace("[ ]+"," ",ereg_replace("[^ A-Za-z0-9]","",$str)));
    }
    

    lua:

    function toSlug(str)
    return string.gsub(string.gsub(str,"[^ A-Za-z]",""),"[ ]+","-")
    end
    

    The

    toSlug function also replaces multiple spaces with one ' -' only.

    You can find this Lua-How-To at luanet.net, too.

    In lua, open source, php by DracoBlue @ 13 Jun 2007 | 90 Words

    Page 40 - Page 41 - Page 42