Re: [PHP] PHP Web Applications

2007-06-28 Thread Tijnema

On 6/28/07, Daniel [EMAIL PROTECTED] wrote:

It does?!  I got it for something around $100 if I remember right.  I
don't remember you specifying that it had to be free either.


Nope, I forgot to specify it, but $100 is still too much for me ;) I'm
just a poor student :P

Tijnema



On Jun 27, 2007, at 11:10 AM, Tijnema wrote:

 On 6/27/07, Dan [EMAIL PROTECTED] wrote:
 Check out Delphi for PHP by Borland, this does pretty much what
 you're
 looking for.

 - Dan

 Uhm, Delphi for PHP costs €259,00, I was looking for something free ;)

 Tijnema

 Tijnema [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  On 6/27/07, Jochem Maas [EMAIL PROTECTED] wrote:
  Tijnema wrote:
   On 6/27/07, Jochem Maas [EMAIL PROTECTED] wrote:
   Tijnema wrote:
Hello all!
   
I was wondering if there is some kind of extension
 available that
does
the same as PHP-GTK, Winbinder, etc. but not for the CLI
 but for the
web? Something that will look like EyeOS [1].
   
Tijnema
   
[1] http://demo.eyeos.org/
  
   EyeOS is php
  
   Partly,  there's a lot of Javascript and CSS involved, I have
 looked
   at it, and it seems that it needs a lot more things to do to
 get a
   simple window than PHP-GTK or Winbinder do...
  
   Tijnema
 
  what do you want??? you want a windowing toolkit that runs
 inside a
  browser, right?
  how do you think styling  interaction is done in a browser
 window? with
  CSS, javascript.
 
 
  Yes, of course it is done with CSS and Javascript (and maybe AJAX
  too), but I don't want to program things in Javascript to get that
  window.
 
  I just want something like this:
  $myapp = new application();
  $myapp-title = Test application;
  $myapp-show();
 
  You understand?
 
  Tijnema
  --
  Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info

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




 --
 Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info





--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info

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



Re: [PHP] FreeMovie API

2007-06-28 Thread Tijnema

On 6/27/07, David Giragosian [EMAIL PROTECTED] wrote:

Anyone using or know the status of the FreeMovie PHP toolkit?

Seems like development stopped in 2004...

David




From sourceforge news:

I am finishing work on a new version of FreeMovie. It will be
properly documented and there will be a printed developer's guide.

Stay tuned for news at devGuide.net 

Tijnema


--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info

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



Re: [PHP] Swear filter ideas

2007-06-28 Thread Tijnema

On 6/28/07, Richard Davey [EMAIL PROTECTED] wrote:

Hi all,

Just wanting to pick your collective brains on this one:

How do you go about implementing a swear / bad-word filter in PHP?

Reasons for needing one aside, I'm just wondering if you favour a
regexp, a substr_count, or what? Do you like to *** out the bad words,
or just error back to the user? (I guess that is application
specific).

There are always ways to circumvent them, but I'm still curious to
know how you prefer to handle it.

Cheers,

Rich


This is a really though thing to implement, let's say you don't want
to the word ass in your message coming from the user, and the
message contains this:

Hi, in the archive I attached is a picture of my ass, the password is abcdef.

The word ass is not wanted, so you *** it, but if you do that with a
regexp or such, then password would become p***word, or you want to
check only for real words (so spaces on both sides), but then somebody
would write !ass! or something like that.

Tijnema

--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info

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



Re: [PHP] Swear filter ideas

2007-06-28 Thread Steve Edberg

At 12:35 PM +0200 6/28/07, Tijnema wrote:

On 6/28/07, Richard Davey [EMAIL PROTECTED] wrote:

Hi all,

Just wanting to pick your collective brains on this one:

How do you go about implementing a swear / bad-word filter in PHP?

Reasons for needing one aside, I'm just wondering if you favour a
regexp, a substr_count, or what? Do you like to *** out the bad words,
or just error back to the user? (I guess that is application
specific).

There are always ways to circumvent them, but I'm still curious to
know how you prefer to handle it.

Cheers,

Rich


This is a really though thing to implement, let's say you don't want
to the word ass in your message coming from the user, and the
message contains this:

Hi, in the archive I attached is a picture of my ass, the password is abcdef.

The word ass is not wanted, so you *** it, but if you do that with a
regexp or such, then password would become p***word, or you want to
check only for real words (so spaces on both sides), but then somebody
would write !ass! or something like that.



Something like that could be taken care of with a regexp like

   $CleansedLine = preg_replace('/\bass\b/i', '***', $Line);

The \b matches a word boundary, i means case insensitive. You'd have 
to loop through your BadWord list for each line:


   foreach ($BadWords as $BW) {
  $CleansedLine = preg_replace(/\b$BW\b/i, '***', $Line);
   }

Your badword list should include variants like A55 for ASS, etc. 
Recognize that you aren't going to aren't going to catch all the 
alternatives, but this should get most of them. And of course, if 
you're talking about donkeys, ass is legitimate :). If you really 
need to filter all profanity the only solution I know of is 
moderation. If you want to count the number of badwords and reject 
based on reaching a certain threshold, you could do


   $SwearCount = 0;
   foreach ($BadWords as $BW) {
  $SwearCount  += preg_match_all(/\b$BW\b/i, $Line);
  $CleansedLine = preg_replace(/\b$BW\b/i, '***', $Line);
   }

#  In PHP 5.1, apparently preg_replace can return a match count,
#  eliminating the need for a separate preg_match_all

   if ($SwearCount  SWEAR_THRESHOLD) {
  echo 'You %$#%@, who do you [EMAIL PROTECTED] think you [EMAIL 
PROTECTED] are ??';
   }

- st[EMAIL PROTECTED]

--
+--- my people are the people of the dessert, ---+
| Steve Edberghttp://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center[EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin (530)754-9127 |
+ said t e lawrence, picking up his fork +

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



Re: [PHP] Swear filter ideas

2007-06-28 Thread Robert Cummings
On Thu, 2007-06-28 at 12:35 +0200, Tijnema wrote:
 On 6/28/07, Richard Davey [EMAIL PROTECTED] wrote:
  Hi all,
 
  Just wanting to pick your collective brains on this one:
 
  How do you go about implementing a swear / bad-word filter in PHP?
 
  Reasons for needing one aside, I'm just wondering if you favour a
  regexp, a substr_count, or what? Do you like to *** out the bad words,
  or just error back to the user? (I guess that is application
  specific).
 
  There are always ways to circumvent them, but I'm still curious to
  know how you prefer to handle it.
 
  Cheers,
 
  Rich
 
 This is a really though thing to implement, let's say you don't want
 to the word ass in your message coming from the user, and the
 message contains this:
 
 Hi, in the archive I attached is a picture of my ass, the password is abcdef.
 
 The word ass is not wanted, so you *** it, but if you do that with a
 regexp or such, then password would become p***word, or you want to
 check only for real words (so spaces on both sides), but then somebody
 would write !ass! or something like that.

You got a problem with beasts of burden?

:)

Cheers,
Rob
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Include images in php file

2007-06-28 Thread Marek

Hi,

I want to display images with my php script but i want it to be just ONE 
file. I can't have separate image files or folders etc.


I suppose I could get this result by writing a function that generates 
the right image by drawing it from scratch. But that way I can't have 
any photos.


My question: Is there any way to include an entire jpg/gif/png into a 
php file? So that when i call ?pic=myphoto it can present the right 
photo without a database or additional files. Like a serialized form of 
an image or something that can be copied, saved in a text editor and 
later reassembled as a proper photo.


Thanks for your help.
Marek

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



Re: [PHP] Include images in php file

2007-06-28 Thread Stut

Marek wrote:
I want to display images with my php script but i want it to be just ONE 
file. I can't have separate image files or folders etc.


Why not? This seems like a rather daft limitation.

I suppose I could get this result by writing a function that generates 
the right image by drawing it from scratch. But that way I can't have 
any photos.


My question: Is there any way to include an entire jpg/gif/png into a 
php file? So that when i call ?pic=myphoto it can present the right 
photo without a database or additional files. Like a serialized form of 
an image or something that can be copied, saved in a text editor and 
later reassembled as a proper photo.


You could base64_encode the image data and stick it in a string. 
However, by doing this you will be causing huge memory usage whenever 
teh script is used because PHP will allocate the memory required for 
each embedded image even when you are only going to use one.


Put simply, it's a rediculous way to approach the problem. I suggest you 
explain why there is this restriction - there may be a better way to do it.


-Stut

--
http://stut.net/

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



Re: [PHP] Include images in php file

2007-06-28 Thread Jochem Maas
Marek wrote:
 Hi,
 
 I want to display images with my php script but i want it to be just ONE
 file. I can't have separate image files or folders etc.
 
 I suppose I could get this result by writing a function that generates
 the right image by drawing it from scratch. But that way I can't have
 any photos.
 
 My question: Is there any way to include an entire jpg/gif/png into a
 php file? So that when i call ?pic=myphoto it can present the right
 photo without a database or additional files. Like a serialized form of
 an image or something that can be copied, saved in a text editor and
 later reassembled as a proper photo.

yes. well done for taking the time to search:

http://dean.edwards.name/weblog/2005/06/base64-sexy/
http://www.greywyvern.com/code/php/binary2base64
http://php.net/base64_encode -- 4th comment

 
 Thanks for your help.
 Marek
 

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



Re: [PHP] Include images in php file

2007-06-28 Thread Marek

It's not really a limitation but a personal goal.

I develop a small public script that is meant to be very compact and 
portable. All of its functionality fits nicely in one php file. But at 
the moment it requires a bunch of tiny icons. I would like to eliminate 
this and just have a single file. But without ruining the graphical 
interface.


So far the best solution i just came up with is to have two files - one 
would be an image with all the icons and i could use css to display the 
right icon.


Marek

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



Re: [PHP] Include images in php file

2007-06-28 Thread Robert Cummings
On Thu, 2007-06-28 at 16:39 +0300, Marek wrote:
 It's not really a limitation but a personal goal.
 
 I develop a small public script that is meant to be very compact and 
 portable. All of its functionality fits nicely in one php file. But at 
 the moment it requires a bunch of tiny icons. I would like to eliminate 
 this and just have a single file. But without ruining the graphical 
 interface.
 
 So far the best solution i just came up with is to have two files - one 
 would be an image with all the icons and i could use css to display the 
 right icon.

Usually compactness is achieved by having one directory in which all
your files reside. Having everything embedded in one php file (images
and everything) is ridiculous. But as other have said you can base64
encode your images and embed them directly into the source and use a get
parameter to select them when accessing the page. So the page would
produce HTML that calls the same page with different parameters for the
images. Same as you're no doubt already doing... front end loader
pattern.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Re: Swear filter ideas

2007-06-28 Thread Colin Guthrie
Richard Davey wrote:
 Hi all,
 
 Just wanting to pick your collective brains on this one:
 
 How do you go about implementing a swear / bad-word filter in PHP?
 
 Reasons for needing one aside, I'm just wondering if you favour a
 regexp, a substr_count, or what? Do you like to *** out the bad words,
 or just error back to the user? (I guess that is application
 specific).
 
 There are always ways to circumvent them, but I'm still curious to
 know how you prefer to handle it.

We implemented a simple key = value array map of rude words to
sanitised equivalents:

e.g. breast = sandwich, felch = retrieve etc. etc.

Then we used implode to generate a regexp:

  $new = ' '.$strBadWordsWrittenByEvilUser.' ';
  $gStopRegexp = '('.implode('|',array(\n,\r,'
',',','\.',';',':','-','\!',','')).')';
  foreach ($gNaughtyWords as $naughty=$nice)
  {
$regexp = $gStopRegexp.'('.$naughty.')([s]{0,1})'.$gStopRegexp;
$regexp_rep = '\1'.$nice.'\3\4';
$new = mb_eregi_replace($regexp, $regexp_rep, $new);
  }

  return trim($new);


The added bonus is that you can flip the key/values in your array and
turn perfectly nice sentences into torrents of abuse ;)


It's not perfect but it works for the most part. And it's fun to think
of all the rude words people might use!!

HTH

Col

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



Re: [PHP] Swear filter ideas

2007-06-28 Thread Daniel Brown

On 6/28/07, Robert Cummings [EMAIL PROTECTED] wrote:

You got a problem with beasts of burden?


   No, we like you sometimes, Rob.  ;-P

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: Swear filter ideas

2007-06-28 Thread Daniel Brown

On 6/28/07, Colin Guthrie [EMAIL PROTECTED] wrote:

We implemented a simple key = value array map of rude words to
sanitised equivalents:

e.g. breast = sandwich, felch = retrieve etc. etc.


   Today we have Chicken Marsala over angel hair pasta, which is a
chicken sandwich braised in Marsala wine

   Please keep me asandwich of the events as they transpire.


The added bonus is that you can flip the key/values in your array and
turn perfectly nice sentences into torrents of abuse ;)


   Sandy was a golden felcher


It's not perfect but it works for the most part. And it's fun to think
of all the rude words people might use!!


   We had a pretty decent thread on this about two weeks back, if
memory serves.  Check the archives and you can make your corporate
firewall cry.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Include images in php file

2007-06-28 Thread Marek

Jochem Maas wrote:
  yes. well done for taking the time to search:

And thank you for those links and a lovely sarcastic comment.
If i had known to search for base64, i would not have asked, really.
Other keywords like image in php jpg gif png include embed serialize 
in various combinations didn't give any useful results.


Thank you, i now got my answer - it can be done but at the cost of high 
memory usage. And i don't think i'll be using it. But the idea itself 
isn't really that bad. If you have a small script that you often copy, 
move and delete, it is more handy to have just one file instead of a 
folder system. I know it would be oscure to the programmer but 
convenient for the user.


Marek

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



Re: [PHP] Swear filter ideas

2007-06-28 Thread Robert Cummings
On Thu, 2007-06-28 at 10:06 -0400, Daniel Brown wrote:
 On 6/28/07, Robert Cummings [EMAIL PROTECTED] wrote:
  You got a problem with beasts of burden?
 
 No, we like you sometimes, Rob.  ;-P

You've been checking me out in the gym shower haven't you!! ;)

But seriously, that was a good one :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] Include images in php file

2007-06-28 Thread Jim Moseby
snip
...it is more handy to have just one file instead of a 
 folder system. 

Thats why $deity gave us gzip.  ;-)

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



Re: [PHP] Include images in php file

2007-06-28 Thread Jochem Maas
Jim Moseby wrote:
 snip
 ...it is more handy to have just one file instead of a 
 folder system. 
 
 Thats why $deity gave us gzip.  ;-)
 

whihc makes me think ...
maybe the phar extension could be a good option?

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



[PHP] Re: Swear filter ideas

2007-06-28 Thread Colin Guthrie
Daniel Brown wrote:
 On 6/28/07, Colin Guthrie [EMAIL PROTECTED] wrote:
 We implemented a simple key = value array map of rude words to
 sanitised equivalents:

 e.g. breast = sandwich, felch = retrieve etc. etc.
 
Today we have Chicken Marsala over angel hair pasta, which is a
 chicken sandwich braised in Marsala wine

Indeed. Your word list would have to allow certain words that could be
used in genuine text. Other words which I wont post here would never be
used in general conversation ;)

Please keep me asandwich of the events as they transpire.

This one wouldn't happen due to the stop words regexp.

 The added bonus is that you can flip the key/values in your array and
 turn perfectly nice sentences into torrents of abuse ;)
 
Sandy was a golden felcher

Exactly! Awesome eh!?! Hours of fun!

Col.

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



Re: [PHP] Re: Swear filter ideas

2007-06-28 Thread Jochem Maas
Colin Guthrie wrote:
 Daniel Brown wrote:
 On 6/28/07, Colin Guthrie [EMAIL PROTECTED] wrote:
 We implemented a simple key = value array map of rude words to
 sanitised equivalents:

 e.g. breast = sandwich, felch = retrieve etc. etc.
Today we have Chicken Marsala over angel hair pasta, which is a
 chicken sandwich braised in Marsala wine
 
 Indeed. Your word list would have to allow certain words that could be
 used in genuine text. Other words which I wont post here would never be
 used in general conversation ;)

unless the general was in the heat of combat, there the implied language
would probably be justified. :-

 
Please keep me asandwich of the events as they transpire.
 
 This one wouldn't happen due to the stop words regexp.
 
 The added bonus is that you can flip the key/values in your array and
 turn perfectly nice sentences into torrents of abuse ;)
Sandy was a golden felcher
   ^-- this 'e' shouldn't be there according to the 
amp given above.

which means Sandy is not only on the cutting edge of porn, but also
web2.0 ready :-P

[think flickr] ... which begs the question of what to do with
multilingual situations. one languages' mundane word can be another's
rudest addition (dutch has a phonetically indentical word for 'flicker'
which has altogether different connotations than it does in english)

maybe we should all just shut the  up on a global level ... it is
said that silence is golden (which is a condrum of itself, what with it
be said and all)

 
 Exactly! Awesome eh!?! Hours of fun!

nothing like a little be of mind bending with words eh :-)

 
 Col.
 

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



Re: [PHP] Re: Swear filter ideas

2007-06-28 Thread Daniel Brown

On 6/28/07, Colin Guthrie [EMAIL PROTECTED] wrote:

Daniel Brown wrote:
 On 6/28/07, Colin Guthrie [EMAIL PROTECTED] wrote:
 We implemented a simple key = value array map of rude words to
 sanitised equivalents:

 e.g. breast = sandwich, felch = retrieve etc. etc.

Today we have Chicken Marsala over angel hair pasta, which is a
 chicken sandwich braised in Marsala wine

Indeed. Your word list would have to allow certain words that could be
used in genuine text. Other words which I wont post here would never be
used in general conversation ;)


   That's for fucking sure.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

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



Re: [PHP] Re: strange include path error

2007-06-28 Thread Jim Lucas

brian wrote:

Greg Beaver wrote:

brian wrote:


PHP 5.1.4 on Fedora 2

I recieved a note from a client about a problem with their site today.
Looking at the error log, i found that the DB connection script that's
included into any other that needs it was throwing an error because
MDB2.php couldn't be found:

Failed opening required 'MDB2.php'
(include_path='.:/opt/www/zijn2/htdocs/includes:/usr/local/lib/php')

What's *really* weird is that the paths listed there are
ancient--everything is in /usr/share/pear now, and the zijn2 one had
been added--then removed--when i was troubleshooting something (it seems
like a couple of years ago).


Do a grep for set_include_path in your client's code - I suspect
you'll find it.



Nope. I wrote the app and i have no need for set_include_path, in any 
case, as i control the server. I did also doublecheck the vhost conf but 
there's nothing there. This is the thing: it's *my* code and i can't 
think of anything that would cause this.


I've also ensured that there's only one php.ini on the server. Apache 
has been restarted several times since that old include path existed. 
This is why i was talking about the box being rebooted, as well. I'm 
trying to cover everything but i'm flummoxed.


FWIW, i've also carefully gone over the site and everything seems to be 
in order. The error was triggered when some script included a DB 
connection script (that has require_once 'MDB2.php';) but, 
unfortunately, the error msg doesn't specify which it was.


I guess i'll have to wait until tuesday to get more info from the client.

brian


you could always cross reference the time stamp in the error log to the access 
log and see what matches.

--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] Re: strange include path error

2007-06-28 Thread brian

Jim Lucas wrote:

brian wrote:
FWIW, i've also carefully gone over the site and everything seems to 
be in order. The error was triggered when some script included a DB 
connection script (that has require_once 'MDB2.php';) but, 
unfortunately, the error msg doesn't specify which it was.


I guess i'll have to wait until tuesday to get more info from the client.

brian

you could always cross reference the time stamp in the error log to the 
access log and see what matches.




D'OH! I guess that's why $deity created mailing lists--to allow us all 
to make boobs of ourselves once in a while.


I saw the same error again twice today and have found the two seperate 
scripts that were called (incidentally, the clients were the google  
yahoo bots). Neither script shows me anything odd and i've checked every 
other script included within them.


It's like there's a rogue thread or something. Except the box has been 
rebooted at least once since i upgraded, which is when i changed the 
include path location.


brian

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



Re: [PHP] Re: Swear filter ideas

2007-06-28 Thread Dan

:O Bad Word  :P

Anyway, I would think that there should be some sort of library already out 
there that has this functionality.  This problem has been arround since the 
internet started.


- Dan

Daniel Brown [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

On 6/28/07, Colin Guthrie [EMAIL PROTECTED] wrote:

Daniel Brown wrote:
 On 6/28/07, Colin Guthrie [EMAIL PROTECTED] wrote:
 We implemented a simple key = value array map of rude words to
 sanitised equivalents:

 e.g. breast = sandwich, felch = retrieve etc. etc.

Today we have Chicken Marsala over angel hair pasta, which is a
 chicken sandwich braised in Marsala wine

Indeed. Your word list would have to allow certain words that could be
used in genuine text. Other words which I wont post here would never be
used in general conversation ;)


   That's for fucking sure.

--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107 


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



[PHP] Re: Problems with mirror site script

2007-06-28 Thread Dan
If you're looking to build an web based proxy that supports ads, there's 
already tons of scripts out there that do it securely, and render very 
nicely.  Most even supporting ad management.


CGIProxy http://www.jmarshall.com/tools/cgiproxy/
PHProxy http://whitefyre.com/poxy/
Zelune http://www.zelune.net/

Are some of the extremly popular ones.  No need to reinvent the wheel.

- Dan

Wikus Möller [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]

Hi.

I am currently writing a script to put on my site so people can browse
other sites by using my site as a mirror therefore the contents of a
webpage would be retrieved and echoed on my site.

I am having some problems with placing my ad at the top of the page
that is echoed when a user browses a site so that it doesn't interfere
with the headers. I am having problems with where to place the link
e.g. after the body tag, and how to find out what type of page it is
i.e. html, xhtml, etc. so I know if I can use specific effects with my
ads.

Also, when a user clicks on a link on the mirrored page the link
should be mysite.com/index.php?go=http://othersite.com/othersitepage.htm
and not mysite.com/othersitepage.htm

I have tried to use str_replace in the contents of the retrieved
webpage but it doesn't seam to work.

Here is the simple piece of code that I have started with without security 
etc:


?

// $http is the page that the user wants to browse

$handle = fopen($http, r);   ///get contents of webpage
$contents = fread($handle, 50);
fclose($handle);

$replace = explode(mysite.com/, $contents);
str_replace(mysite.com,
mysite.com/index.php?http=$http/$replace[1], $contents);

if(strstr($contents, !DOCTYPE html
PUBLIC \-//W3C//DTD HTML))
{
$ads = ads_html();
$contents2 = explode(/body , $contents);
}

if(strstr($contents, !DOCTYPE html
PUBLIC \-//W3C//DTD XHTML))
{
$ads = ads_xhtml();
$contents2 = explode(/body , $contents);
}


echo $contents2[0] . $ads . $contents2[1];
?

Please advise me if there is another better way to place my ad and
check the type of page because this coding is just wrong and
error-prone.

Thanks
Wikus 


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



[PHP] Currency Exchange Database?

2007-06-28 Thread Tom Ray [Lists]
I have a client that's looking to do auto conversions of currency on 
their reservation payment form. No big deal, I can that part down. 
However, exchange rates change on a minute to minute basis and they want 
the program to automatically know the current rates. Is there an online 
database or a way I can tap into a database that has that information?


Any help would be appreciated.

Thanks.

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



RE: [PHP] Re: Swear filter ideas

2007-06-28 Thread Daevid Vincent
 This problem has been arround since the internet started.

rant

problem?

They're just words!

Not sure why some people are so offended by them? My parents have even
purchased a little device that sits between their TV and DVD/VHS and
bleeps out bad words. And they're in their 60's and have no kids at
home.

It's certainly not kids/children who are offended. They're probably the
ones saying these words the most and writing them the most in your
forum/blog/whatever you're trying to protect.

If it's adults, then I'm sure it's nothing they've not heard before.

It just seems like a lot of work for little payoff and something that
will NEVER be accurate. If someone is that easily offended, then perhaps
they need to get out into the real world once and a while.

It seems to me also, you have liability issues. If you have some
filter mode, then what happens when a word gets through? Are you to
blame for offending some poor child/adults sensitive ears/eyes? A simple
age-check or disclaimer indicating you're not responsible for the
content of your posters comments seems more safe. 

But that's just my opinion.

/rant

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



RE: [PHP] Re: Swear filter ideas

2007-06-28 Thread Robert Cummings
On Thu, 2007-06-28 at 17:57 -0700, Daevid Vincent wrote:
  This problem has been arround since the internet started.
 
 rant
 
 problem?
 
 They're just words!
 
 Not sure why some people are so offended by them? My parents have even
 purchased a little device that sits between their TV and DVD/VHS and
 bleeps out bad words. And they're in their 60's and have no kids at
 home.
 
 It's certainly not kids/children who are offended. They're probably the
 ones saying these words the most and writing them the most in your
 forum/blog/whatever you're trying to protect.
 
 If it's adults, then I'm sure it's nothing they've not heard before.
 
 It just seems like a lot of work for little payoff and something that
 will NEVER be accurate. If someone is that easily offended, then perhaps
 they need to get out into the real world once and a while.
 
 It seems to me also, you have liability issues. If you have some
 filter mode, then what happens when a word gets through? Are you to
 blame for offending some poor child/adults sensitive ears/eyes? A simple
 age-check or disclaimer indicating you're not responsible for the
 content of your posters comments seems more safe. 
 
 But that's just my opinion.
 
 /rant

I've always found it amusing how much people get their nickers in a
twist over some words. I mean take the word fuck... what is so bad about
it? Is the word intercourse as offensive? Didn't think so. So it's not
the meaning. What about the word duck, it's has the same sound with the
exclusion of the leading consonant, but nobody takes offence if you run
around shouting duck (unless you're at a golf course :) So really,
words are only offensive to those who somehow infer a secondary meaning.
What that inference is, I've yet to understand. I can say the baby
pooped, had a bowel movement, or dirtied its diaper, but as soon as you
say the baby shit its diaper... people give you a funny look.

Humans are such a strange bunch :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] Re: Swear filter ideas

2007-06-28 Thread Steve Edberg

At 9:27 PM -0400 6/28/07, Robert Cummings wrote:

On Thu, 2007-06-28 at 17:57 -0700, Daevid Vincent wrote:

  This problem has been arround since the internet started.

 rant

 problem?

 They're just words!

 Not sure why some people are so offended by them? My parents have even
 purchased a little device that sits between their TV and DVD/VHS and
 bleeps out bad words. And they're in their 60's and have no kids at
 home.

 It's certainly not kids/children who are offended. They're probably the
 ones saying these words the most and writing them the most in your
 forum/blog/whatever you're trying to protect.

 If it's adults, then I'm sure it's nothing they've not heard before.

 It just seems like a lot of work for little payoff and something that
 will NEVER be accurate. If someone is that easily offended, then perhaps
 they need to get out into the real world once and a while.

 It seems to me also, you have liability issues. If you have some
 filter mode, then what happens when a word gets through? Are you to
 blame for offending some poor child/adults sensitive ears/eyes? A simple
 age-check or disclaimer indicating you're not responsible for the
 content of your posters comments seems more safe.

 But that's just my opinion.

 /rant


I've always found it amusing how much people get their nickers in a
twist over some words. I mean take the word fuck... what is so bad about
it? Is the word intercourse as offensive? Didn't think so. So it's not
the meaning. What about the word duck, it's has the same sound with the
exclusion of the leading consonant, but nobody takes offence if you run
around shouting duck (unless you're at a golf course :) So really,
words are only offensive to those who somehow infer a secondary meaning.
What that inference is, I've yet to understand. I can say the baby
pooped, had a bowel movement, or dirtied its diaper, but as soon as you
say the baby shit its diaper... people give you a funny look.

Humans are such a strange bunch :)



That's why I live with computers and cats -

steve

--
+--- my people are the people of the dessert, ---+
| Steve Edberghttp://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center[EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin (530)754-9127 |
+ said t e lawrence, picking up his fork +

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



Re: [PHP] Include images in php file

2007-06-28 Thread Larry Garfield
Skip raster images and just output the images as SVG.  OK, only works in 
Firefox 1.5+, but it would get you everything in one file without bloated 
encoding. :-)

On Thursday 28 June 2007, Marek wrote:
 It's not really a limitation but a personal goal.

 I develop a small public script that is meant to be very compact and
 portable. All of its functionality fits nicely in one php file. But at
 the moment it requires a bunch of tiny icons. I would like to eliminate
 this and just have a single file. But without ruining the graphical
 interface.

 So far the best solution i just came up with is to have two files - one
 would be an image with all the icons and i could use css to display the
 right icon.

 Marek


-- 
Larry Garfield  AIM: LOLG42
[EMAIL PROTECTED]   ICQ: 6817012

If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it.  -- Thomas 
Jefferson

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



Re: [PHP] Include images in php file

2007-06-28 Thread Robert Cummings
On Thu, 2007-06-28 at 22:56 -0500, Larry Garfield wrote:
 Skip raster images and just output the images as SVG.  OK, only works in 
 Firefox 1.5+, but it would get you everything in one file without bloated 
 encoding. :-)

No need to have bloated encoding.. just have the file check itself for a
flag, if it is set then read itself, replace base64 data segments with
binary data segments update flag, and resave, and redirect to self for
proper request. Future requests will work with the deflated version
directly. The only bloat will be the extra chars needed to properly
escape special characters such that binary image data can be stored in a
string. I suggest using single quote delimiters for the string :)

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



Re: [PHP] Currency Exchange Database?

2007-06-28 Thread Paul Scott

On Thu, 2007-06-28 at 20:44 -0400, Tom Ray [Lists] wrote:
 I have a client that's looking to do auto conversions of currency on 
 their reservation payment form. No big deal, I can that part down. 
 However, exchange rates change on a minute to minute basis and they want 
 the program to automatically know the current rates. Is there an online 
 database or a way I can tap into a database that has that information?
 

I am pretty sure, although I may be wrong, that http://xe.com provides a
webservice for this.

--Paul

All Email originating from UWC is covered by disclaimer 
http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

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

Re: [PHP] Include images in php file

2007-06-28 Thread Robert Cummings
On Fri, 2007-06-29 at 00:20 -0400, Robert Cummings wrote:
 On Thu, 2007-06-28 at 22:56 -0500, Larry Garfield wrote:
  Skip raster images and just output the images as SVG.  OK, only works in 
  Firefox 1.5+, but it would get you everything in one file without bloated 
  encoding. :-)
 
 No need to have bloated encoding.. just have the file check itself for a
 flag, if it is set then read itself, replace base64 data segments with
 binary data segments update flag, and resave, and redirect to self for
 proper request. Future requests will work with the deflated version
 directly. The only bloat will be the extra chars needed to properly
 escape special characters such that binary image data can be stored in a
 string. I suggest using single quote delimiters for the string :)

Just for fun I've whipped up a little script to illustrate the ease of
embedding images into your own PHP script without the hassle of manually
doing the embedding. I've only registered one image, but feel free to
register as many as you want. The first time the script loads it will
embed any image resources that are registered into itself. Then you can
send anyone the script. This technique can be done with any kind of
resource.

?php

$build = true;

$images = array
(
'banner' = 'banner.png',
);

$imagesImported = '[[IMPORTED_IMAGE_DATA]]';

checkBuild();
handleRequest();

function handleRequest()
{
$type = isset( $_GET['type'] ) ? $_GET['type'] : null;
$what = isset( $_GET['what'] ) ? $_GET['what'] : null;

if( $type === 'image' )
{
showImage( $what );
}
else
{
showPage( $what );
}
}

function showPage( $page )
{
showHeader();

echo 'pBlah blah blah blah blah - Rob was here!/p'.\n;

showFooter();
}

function showHeader()
{
$banner = htmlspecialchars( getResource( 'banner', 'image' ) );

echo 'html'
.'body'
.'img src='.$banner.' /'
.'br /br /';
}

function showFooter()
{
echo '/body'
.'/html';
}

function getResource( $what, $type=null )
{
$me = $_SERVER['PHP_SELF'];

$params = array();

if( $type !== null )
{
$params['type'] = $type;
}

$params['what'] = $what;

foreach( $params as $key = $value )
{
$params[$key] = urlencode( $key ).'='.urlencode( $value );
}

return $me.'?'.implode( '', $params );
}

function showImage( $name )
{
if( !isset( $GLOBALS['images'][$name] ) )
{
header( 'HTTP/1.0 404 Not Found' );
exit();
}

$filename = $GLOBALS['images'][$name];

if( !is_array( $GLOBALS['imagesImported'] ) )
{
$imageStuff = getImageStuff( $filename );
}
else
{
$imageStuff = $GLOBALS['imagesImported'][$name];
}

header( 'Content-type: '.$imageStuff['info']['mime'] );
echo $imageStuff['content'];

exit();
}

function getImageStuff( $filename )
{
$path = ereg_replace( '/[^/]+$', '/', __FILE__ ).$filename;

return
array
(
'content' = implode( '', file( $path ) ),
'info'= getImageSize( $path ),
);
}

function escapeLiteral( $value )
{
$value = str_replace( '\\', '', (string)$value );
$value = str_replace( ', \\', $value );

return '.$value.';
}

function convertToDeclaration( $anArray )
{
$dec = 'array( ';

foreach( $anArray as $key = $value )
{
if( is_array( $value ) )
{
$value = convertToDeclaration( $value );
}
else
{
$value = escapeLiteral( $value );
}

$key = escapeLiteral( $key );

$dec .= $key.' = '.$value.', ';
}

$dec .= ' )';

return $dec;
}

function checkBuild()
{
if( is_array( $GLOBALS['imagesImported'] ) )
{
//
// Already built :)
//
return;
}

if( !isset( $GLOBALS['build'] )
||
!$GLOBALS['build'] )
{
//
// Not enabled -- testing probably.
//
return;
}

$imported = array();
foreach( $GLOBALS['images'] as $name = $filename )
{
$imported[$name] = getImageStuff( $filename );
}

$source = implode( '', file( __FILE__ ) );

$source =
str_replace
(
'.[[IMPORTED_IMAGE_DATA]].',
convertToDeclaration( $imported ),
$source
);

if( ($fptr = fopen( __FILE__, 'w' )) !== false )
{
fwrite( $fptr, $source );
fclose( $fptr );
}
}

?

-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable 

Re: [PHP] Currency Exchange Database?

2007-06-28 Thread Tom Ray [Lists]
I thought about that but I'm looking to make it seem-less. I just want 
to get the numbers and do the conversion myself not have the third party 
do it. I just need an updated list on a daily/hourly basis.


Paul Scott wrote:

On Thu, 2007-06-28 at 20:44 -0400, Tom Ray [Lists] wrote:
  
I have a client that's looking to do auto conversions of currency on 
their reservation payment form. No big deal, I can that part down. 
However, exchange rates change on a minute to minute basis and they want 
the program to automatically know the current rates. Is there an online 
database or a way I can tap into a database that has that information?





I am pretty sure, although I may be wrong, that http://xe.com provides a
webservice for this.

--Paul

  



All Email originating from UWC is covered by disclaimer http://www.uwc.ac.za/portal/uwc2006/content/mail_disclaimer/index.htm 

  


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



RE: [PHP] Currency Exchange Database?

2007-06-28 Thread Andy B.
You could have a look at the Euro foreign exchange reference rates rom the
European Central Bank.

They also provide a regularly updated XML file:

http://www.ecb.int/stats/exchange/eurofxref/html/index.en.html

Hope it helps...


Andy

-Original Message-
From: Tom Ray [Lists] [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 29, 2007 02:45
To: php-general@lists.php.net
Subject: [PHP] Currency Exchange Database?

I have a client that's looking to do auto conversions of currency on 
their reservation payment form. No big deal, I can that part down. 
However, exchange rates change on a minute to minute basis and they want 
the program to automatically know the current rates. Is there an online 
database or a way I can tap into a database that has that information?

Any help would be appreciated.

Thanks.

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

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