dracoblue.net

Workaround for UTF-8 issues with PHP's imagestring

Some of you may have expirienced the issue, that php's

imagestring-function doesn't properly show UTF-8 characters.

As workaround you can use the imagettftext-function.

When using imageTTFtext instead of imagestring, you have to know, that you don't use the $font-ids from PHP, instead you use fontfiles.

So:

imagestring ( resource $im, int $font, int $x, int $y, string $s, int $color )

becomes to:

imagettftext ( resource $im, int $size, int $angle, int $x, int $y, int $color, string $fontfile, string $text ) 

Keep $angle=0 if you want just horizontal-text. Hope that helps!

In open source, php, utf-8 by DracoBlue @ 04 Nov 2007 | 105 Words

Quick-Edit button broken in Simple Machines Forum

Thanks to Korl for pointing out, that the QuickEdit-Button in SMF won't work in locked topics, even if the user has rights to do so.

I took some minutes and found out what the reason was, the [em]$moderate_boards[/em] variable is not set properly and not even loaded.

Quickfix:

Open

Sources/Post.php

Replace line 2050f (containing the following):

(!isset($_REQUEST['modify']) || (!empty($moderate_boards) && $moderate_boards[0] == 0) ? '' : '
AND (t.locked = 0' . (empty($moderate_boards) ? '' : ' OR b.ID_BOARD IN (' . implode(', ', $moderate_boards)) . ')')

And replace it with:

""

Now put right after the

        mysql_free_result($request);

in line 2059 the following:

        if (!empty($row['locked'])) isAllowedTo('moderate_board');

Thats it, have fun! Bugreport with Fix has been

posted at official SMF-Site.

In open source, php, smf by DracoBlue @ 28 Oct 2007 | 144 Words

.innerHTML vs. value in textarea

Some of you may already noticed, that .innerHTML of an html-object like textarea may not be changed if you edited the objects content manually.

For example setting a textarea's innerHTML won't result in any changes if you do it, right after you manually added text to the textarea.

To workaround this issue, you should always use .value on textarea-fields, even though its declared as:

<textarea>inner html</textarea>

In html, javascript, open source by DracoBlue @ 23 Oct 2007 | 71 Words

Mines updates and bugfixes

Today I fixed some serious issues, which could have appeared when using mines on the GTA:Tournament-Servers.

Also I added some neat new functions for our GameMasters (a godmode detection module and a info module which shows stats and some other cool stuff of the player).Â? Most coding has been done by elyks for those two modules, so big thanks again!

In gta:tournament, project by DracoBlue @ 15 Oct 2007 | 60 Words

Fix for 'Add as Additional-MemberGroup' Issue

When adding $_POST['additional'] to my template at MemberGroups.template.php I noticed, that there is a broken line in SubsMembers.php.

In line 551 it shouldn't say:

CONCAT(additionalGroups, '$group')))

It should be instead:

CONCAT(additionalGroups, '$group'))

Am not sure if thats also in the 2.0 Beta 1, but I got this problem since 1.1 release.

I posted a

bugreport at the official simplemachines forums.

In mysql, open source, smf by DracoBlue @ 09 Oct 2007 | 72 Words

Page 37 - Page 38 - Page 39

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