Swobodin's website
 
Index Articles Downloads Contact Guestbook Links
Chess Curiosities
Linux Tricks
PHP Scripts

The box said "Requires
Windows XP or better."
So I installed LINUX

Programming time

What's is your favorite time to program?

Morning
Afternoon
Evening
Night
Any time, depends on my character
I don't program

View poll results



Welcome, dear visiotor, and greetings to the United States the United States
(According to your IP: 38.107.191.106)

UP
Home

SQL(s)2PNG

Rate the article

Comment the article

This program converts MySQL , Postgresql or SQLite data to an image file using GD and PHP.
I wrote it simply because someone has hired a webmaster to display some articles in the Web without having the possibility to copy them (in order to sell them ??). The Webmaster has used a "special method" (sic) which consists in disabling right click by JavaScript ; neglecting (or faking so) the fact of not all the users surf with Exploder, that they can use Ctrl+E with Mozilla to get the plain text, or disabling JavaScript ; or even use a primitive (and powerful) browser, such as Amaya, Dillo or Lynx ...
Okay, I wrote this program just to prove that it is possible to make better...

All you need is a Web server (I'd prefer Apache, but there are many: THTTP, Nano, etc. All Open Source) supporting PHP, GD with TTF and PNG support, and at least one of the databases mentioned below ... If you don't have, just compile your PHP with --with-sqlite option, no additional program is required.
Error reporting must be set to
error_reporting = E_ALL & ~E_NOTICE
in php.ini; in brieve, E_NOTICE must be disabled else it won't work.

I "created" an Anti-OCR method: a random line that crosses the document, or the PNG image, in order to "damage" some letters ...

Also, I added with the package an Open Source True Type font - Luxi mono ; it's not the best, but noway to put a commercial font.
Change the font if you want, through the (mini) administration control panel, but then, it's strong possible to get the scale method incorrect. You'll have to change the formulas in gen.php ; not too complicated for someone who knows multiplication, addition an euclidean division

INSTALLATION
Open Inc/functions.php and edit the database type ; if it's a server side, go to the selected database (in the same file) and change the database configuration.
Install the tables from directory/db.(yourdatabase) file
Run index.php as a user, login.php as an administrator, login with "admin" as username, "pass" as password.

If the prefix "swobodin_" bothers, you may change it by changing $prefix = "new_prefix" in functions.php and replacing "swobodin_*".
For example:
$ cat db.mysql|sed "s/swobodin_/newprefix_/g" > New && mv -f New db.mysql
makes substitutions into file db.mysql ... Who the idiot who said that command lines are depreciated?


You may notice it's not pretty at all, since I have not integrated a style sheet, the article edition is disabled : I am simply lazy ... If you want a full administration control panel, download and hack on Swobodin's Do All 0.1 , available at http://www.swobodin.tk

Related download: SQL(s)2PNG - noversion

Downloaded 846 times

Click here to download the source
53 kb

UP
Home

 

 

Comments: 2

View comments
 

 
Global note :: 3.3/5 Total votes :: 20

Rate this article

Excellent
Very Good
Good
Fair
Poor



Page loaded in 0.380 seconds

Swobodin's Do All 0.1 GNU/GPL - ©2004 Swobodin
http://www.swobodin.tk