dracoblue.net

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

How to convert pawn/pwn to samp 0.2 / pawn 3.2.3664

The new pawn compiler finally arrived and is used at sa-mp. But this also means that most scripts/libraries won't compile anymore or give warnings.

Thatswhy I posted an How-To about converting a script step by step from samp 0.1 to 0.2.

In articles, open source, pawn by DracoBlue @ 05 Jun 2007 | 42 Words

Libraries ready for sa-mp 0.2 and latest pawn language compiler

Due to the 4 player script server release for samp 0.2 I updated today the widely used libraries for latest pawn compiler. Please update them all, to avoid warnings.

Other 0.2 Ready GameModes/Libraries and Filterscripts can be found at the

0.2#Ready-Page

In dini, dprop, dtest, dudb, dutils, open source, pawn by DracoBlue @ 04 Jun 2007 | 70 Words

Arena Bug fixed

The good known arena bug is finally fixed. It appeared if somebody, who was in arena before was beaten, the player (who won) got arena-weapons (for example Tec9), which shouldn't be possible in the freeroam part of GTA:T.

In gta:tournament, project by DracoBlue @ 28 May 2007 | 38 Words

More Ammo & Cops Changes!

Today we have some changes for all players and especially for the Cops!

For all players Since today you get 3x Ammo for all weapons!

Cops With last big content update, the cops have become slightly difficult to play. So we decided to give the law a chance and increase its possibilities. From this moment, you get more respect for busting somebody, hava a bigger range to bust somebody and walking criminals don't have a "speed"-protection anymore.

Details:

  • [461] [Balancing] Added: Tripple Wantedlevel Respect for Busting (DracoBlue)
  • [458] [Balancing] Added 3x Ammo On Spawn and so on. (DracoBlue)
  • [459] [Balancing] Bigger range for Cops (DracoBlue)
  • [460] [Balancing] Added: No speedlimit for Criminals when getting busted (DracoBlue)
  • [450] [Gameplay] Emergency Ammo System Fails if recently spawned (DracoBlue)

In gta:tournament, project by DracoBlue @ 27 May 2007 | 143 Words

Page 40 - Page 41 - Page 42

Give something back

Were my blog posts useful to you? If you want to give back, support one of these charities, too!

Report hate in social media Campact e.V. With our technology and your help, we protect the oceans from plastic waste. Gesellschaft fur Freiheitsrechte e. V. The civil eye in the mediterranean

Recent Dev-Articles

Read recently

Recent Files

About