Search found 10 matches

by nitrino
Sun Apr 08, 2007 7:45 am
Forum: PHP - Code
Topic: Screen capturing a .flv video.
Replies: 1
Views: 846

Use ffmpeg. For small and medium projects it will fit your needs.

To fetch a thumbnail use this (tried and works on one of webs i wrote):

Code: Select all

exec("/usr/bin/ffmpeg -an -y -i $outputdir$outputfile -f mjpeg -t 0:0:5.000 -vframes 1 -ss 0:0:5.000 $outputdir$outputframe");
by nitrino
Sun Apr 08, 2007 7:42 am
Forum: PHP - Code
Topic: redirecting
Replies: 6
Views: 581

i always use this:

Code: Select all

define('ROOT',$_SERVER['DOCUMENT_ROOT']);
and anywhere...

Code: Select all

include ROOT.'/folder/something.php';
never have a problems with including files.
by nitrino
Sun Apr 08, 2007 7:39 am
Forum: PHP - Code
Topic: elseif statements
Replies: 3
Views: 677

maybe use switch...case instead.
by nitrino
Sat Apr 07, 2007 5:09 pm
Forum: PHP - Code
Topic: Multilanguage support
Replies: 13
Views: 2124

seems like it needs php compiled with that support... i'm not sure there are many hostings where it's allowed.
by nitrino
Sat Apr 07, 2007 4:45 pm
Forum: PHP - Code
Topic: Multilanguage support
Replies: 13
Views: 2124

thanks, a DEFINE would speed up a little bit, but usage of constants remains. Maybe is there a completely ANOTHER method for dealing with languges?
by nitrino
Sat Apr 07, 2007 1:50 pm
Forum: PHP - Code
Topic: Multilanguage support
Replies: 13
Views: 2124

Multilanguage support

Hello, I would like to know your suggestions and theoretical solutions about creating multi-language support in sites based on PHP/MySQL. It's clear that separating web root for each language is bad solution. Does anybody know a better, more scalable, and simplier solution? Just theoretically? Metho...
by nitrino
Mon Jan 08, 2007 1:09 pm
Forum: General Discussion
Topic: Little known PHP Idioms etc.
Replies: 53
Views: 10303

The Ninja Space Goat wrote:why do people do this:

Code: Select all

$var = $x?true:false;
as opposed to this?

Code: Select all

$var = (bool) $x;
Never understood that.
It was just an example, it could be

Code: Select all

$var=$x>3?'apple':'banana';
:)
by nitrino
Mon Jan 08, 2007 12:36 pm
Forum: General Discussion
Topic: Little known PHP Idioms etc.
Replies: 53
Views: 10303

Does anybody use a short condition check?

Code: Select all

$var = $x?true:false;
not a tricky, but found very usefull for myself some time ago.
by nitrino
Tue Jan 02, 2007 10:45 am
Forum: PHP - Code
Topic: Dynamic counters - views, comments..
Replies: 2
Views: 681

Well, ok then. I just wanted to be shure if i've got the best practice for unique counters. thanks.
by nitrino
Tue Jan 02, 2007 10:37 am
Forum: PHP - Code
Topic: Dynamic counters - views, comments..
Replies: 2
Views: 681

Dynamic counters - views, comments..

Hello, (sorry for my English :) ) This is more a theoretical question, but i'd like to know from you, which is the best practice to implement dynamic counters for media or stuff (i mean, view count for photos, videos, blog entries etc.), but only UNIQUE counters, so pressing F5 won't add "+1&qu...