dracoblue.net

Avoid session expiration in Webapplications (e.g. PHP)

Some of you may have run into the problem that the default session timeout (about 15 minutes) isn't always useful if your users have to fill a large form with lots of text.

Often you get after those: 'Session timed out' and after login the user has to type all again. To fix that, you can wait for the login and refill the form with the saved data. That is not very handy and quite difficult to implement.

A very handy and fast fix for this session timeout is, that you query the server every minute once to keep the session alive without requiring the user to reload the page. I found out that that soloution is used even in SMF, so it seems to be quite common.

So just add the following lines to an extra page or the start of your index-file.

session_start(); if (isset($_GET['sessionfix']))Â? exit;

And now add the magic javascript, which updates that in the template or html file.

That's it!

In articles, open source, php by DracoBlue @ 27 Feb 2008 | 167 Words

How to add auto-youtube-tags to SMF

Open Subs.php and alter the following things.

After:

    static $bbc_codes = array(), $itemcodes = array(), $no_autolink_tags = array();
static $disabled;

Add:


$message = preg_replace('/http:\/\/([^\s\.]+).(youtube.com\/watch\?v=)([A-Za-z0-9\-]+)([^\s]*)/', '[youtube]$3[/youtube]', $message);

After:

            array(
'tag' => 'b',
'before' => '<b>',
'after' => '</b>',
)

Add:

            array(
'tag' => 'youtube',
'before' => ''
),

In open source, php, smf by DracoBlue @ 20 Jan 2008 | 75 Words

Drag n' Drop!

Today I finished the drag and drop functionality for the inventory and added the action bar. You may know both from other (online) games, but its still something quite new for gta online gaming. So I hope you guys like it!

In gta:tournament, project by DracoBlue @ 17 Jan 2008 | 41 Words

Visual Inventory part one

This is the first version of GTA:Tournament's Visual Inventory. At the moment you can hover items, to see what they do (like those EDs) and doubleclicky them to activate them (leads to slow health refill).

In gta:tournament, project by DracoBlue @ 17 Jan 2008 | 41 Words

Testing the battlearea

We made some nice progress on the battlearea. Elyks converted an initial version from pawn and I fixed most issues coming up. Currently only respawn is missing and what happens if you disconnect.

By the way, you can find screenshots of testing previews at the gtat media database.

In gta:tournament, project by DracoBlue @ 15 Jan 2008 | 55 Words

Page 34 - Page 35 - Page 36

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