Re: [PHP] Replacing with f*ck and f*cking

2008-10-25 Thread Andrew Barnett
Maybe you should look at the source code of an open source project that can
already do this such as phpBB.  I'm not exactly sure where to find it in the
phpBB code though.

Andrew


2008/10/26 Ryan S [EMAIL PROTECTED]

 Hey!
 I'm just trying to replace some of the more bad words with their slightly
 censored counterparts like so

 $bad_words = array(/*Well you know the words so am not going to write them
 here*/);
 $bad_words_replacements = array(f*ck, f*cking);
 $comment = str_replace($bad_words,$bad_words_replacements,  $comment);

 My question is this, for just two words its fine to use the above, but a
 pal tells me that if using a lot of words (eg: 15) and the $comment is big
 then it can take quite some time and be a bit of a processing strain as well
 because php first checks the first word from the good list against all the
 15 words in the bad list against the comment then moves to the second word
 etc.

 Is this really bad processing wise and would you recommend any other way of
 doing this?
 The other question i have is, wont f*ck catch f*cking as well? so
 should i delete the longer f*cking?

 I'm not really trying to stop people swearing... just trying to make it not
 jump out so much, this was the poster is happy coz i have not censored him
 to bits and the reader should be a bit happy coz its a bit decent.

 Thanks!
 R




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] web shot script

2008-10-23 Thread Andrew Barnett
Hey Joey,
I had a search, and from what I found, it would be very difficult unless you
have root access to a server. Another way would be to create a HTML/CSS
renderer using PHP, and then using that to take a screenshot.

A link from DigitalPoint 
http://forums.digitalpoint.com/showthread.php?t=76454 may provide some
clues, or discouragement as I found.

Let us know if you work out how to do it. I'd love to know.


Andrew

2008/10/24 Joey [EMAIL PROTECTED]

 Hi Guys,

 Really I want to do this, not pay someone to do it via those services you
 linked to.
 So nobody has seen open source code for this?


  -Original Message-
  From: Joey [mailto:[EMAIL PROTECTED]
  Sent: Saturday, October 18, 2008 4:59 AM
  To: PHP
  Subject: [PHP] web shot script
 
  Hello All,
 
 
  Does anyone know of a script to capture web pages and store the image?
 
  Trying to see all of my sites screenshots and have it updated on
 occasion.
 
 
 
  Thanks!
 
 
 
  Joey



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] web shot script

2008-10-23 Thread Andrew Barnett
Are you suggesting to create a PDF, and then convert from PDF to an image?

Andrew



2008/10/24 Afan Pasalic [EMAIL PROTECTED]


 Andrew Barnett wrote:

 Hey Joey,
 I had a search, and from what I found, it would be very difficult unless
 you
 have root access to a server. Another way would be to create a HTML/CSS
 renderer using PHP, and then using that to take a screenshot.



 or, maybe, as an idea, save the page as pdf?


  A link from DigitalPoint 
 http://forums.digitalpoint.com/showthread.php?t=76454 may provide some
 clues, or discouragement as I found.

 Let us know if you work out how to do it. I'd love to know.


 Andrew

 2008/10/24 Joey [EMAIL PROTECTED]



 Hi Guys,

 Really I want to do this, not pay someone to do it via those services you
 linked to.
 So nobody has seen open source code for this?




 -Original Message-
 From: Joey [mailto:[EMAIL PROTECTED]
 Sent: Saturday, October 18, 2008 4:59 AM
 To: PHP
 Subject: [PHP] web shot script

 Hello All,


 Does anyone know of a script to capture web pages and store the image?

 Trying to see all of my sites screenshots and have it updated on


 occasion.



 Thanks!



 Joey



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php










Re: [PHP] web shot script

2008-10-23 Thread Andrew Barnett
You might actually be onto something there Afan.

As long as Ghostscript and Imagemagick are installed on the server, you will
be able to convert a PDF to an image. So maybe that will help.

Although, is it possible to have a continuous length PDF, or does it only
fit to specific page sizes.

Its probably worth a shot though Joey.


Andrew



2008/10/24 Afan Pasalic [EMAIL PROTECTED]


 Andrew Barnett wrote:

 Are you suggesting to create a PDF, and then convert from PDF to an image?

 I'm sorry. didn't get it has to be an image.



 Andrew



 2008/10/24 Afan Pasalic [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]


Andrew Barnett wrote:

Hey Joey,
I had a search, and from what I found, it would be very
difficult unless you
have root access to a server. Another way would be to create a
HTML/CSS
renderer using PHP, and then using that to take a screenshot.


or, maybe, as an idea, save the page as pdf?


A link from DigitalPoint 
http://forums.digitalpoint.com/showthread.php?t=76454 may
provide some
clues, or discouragement as I found.

Let us know if you work out how to do it. I'd love to know.


Andrew

2008/10/24 Joey [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]


Hi Guys,

Really I want to do this, not pay someone to do it via
those services you
linked to.
So nobody has seen open source code for this?



-Original Message-
From: Joey [mailto:[EMAIL PROTECTED] mailto:[EMAIL 
 PROTECTED]]
Sent: Saturday, October 18, 2008 4:59 AM
To: PHP
Subject: [PHP] web shot script

Hello All,


Does anyone know of a script to capture web pages and
store the image?

Trying to see all of my sites screenshots and have it
updated on

occasion.


Thanks!



Joey


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php









Re: [PHP] Randomiser

2008-10-17 Thread Andrew Barnett
I ended up using an example from the PHP website.

?php
$input = array(Neo, Morpheus, Trinity, Cypher, Tank);
$rand_keys = array_rand($input, 2);
echo $input[$rand_keys[0]] . \n;
echo $input[$rand_keys[1]] . \n;
?

Just extended the array to the number of lines I needed.

Andrew


[PHP] Randomiser

2008-10-16 Thread Andrew Barnett
Hey All,
I'm trying to work out how to randomise the order of a bunch of strings I
have. I know how to pick one random string from a bunch of them, but how do
I make sure that everyone is used just once.

Any pointers on how to do that would be appreciated.

Cheers,
Andrew


Re: [PHP] Error message

2008-09-18 Thread Andrew Barnett
It sounds like there is a space or output before the ?php line. It
should be the very first line on a PHP page, and have no spaces before
it.

Andrew

2008/9/19 CanihoJR [EMAIL PROTECTED]:
 No puedes tener ningun espacio en blanco delante de session_start();

 Sorry for my english:
 you cant have any blank spaccing before SESSION_START()


 Prueba:
 TRY:

 ?php
 session_start();

 echo 'Welcome to page #1';

 $_SESSION['favcolor'] = 'green';
 $_SESSION['animal']   = 'cat';
 $_SESSION['time'] = time();

 // Works if session cookie was accepted
 echo 'br /a href=page2.phppage 2/a';

 // Or maybe pass along the session id, if needed
 echo 'br /a href=page2.php?' . SID . 'page 2/a';
 ?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Interntet Explorer 8 beater 2

2008-09-08 Thread Andrew Barnett
Sorry, but sarcasm doesn't quite come across email very effectively.


2008/9/8 Richard Heyes [EMAIL PROTECTED]:
 Hi,

 I think he is asking whether people are using Internet Explore 8 Beta 2

 I am. That would be an obscure sense of humour.

 No I'm not using it, I still haven't ugraded to IE7 yet, and probably
 won't while I use Firefox 3, and am quite happy with FF3.

 I really don't want to install a beta (though I did install Chrome, so
 maybe that should be an MS beta) but I am interested in how it
 performs.

 --
 Richard Heyes

 HTML5 Graphing for IE7, FF, Chrome, Opera and Safari:
 http://www.phpguru.org/RGraph


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Interntet Explorer 8 beater 2

2008-09-08 Thread Andrew Barnett
I think he is asking whether people are using Internet Explore 8 Beta 2

No I'm not using it, I still haven't ugraded to IE7 yet, and probably
won't while I use Firefox 3, and am quite happy with FF3.


Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php