Domain Empire

I'm bored, so - request a script!

Spaceship Spaceship
Watch
Impact
62
Well i'm very bored and was thinking about how I could make money with scripts - then I realized that i'm not even particularly good at coding, I just seem it because nobody else I know (in RL) is.

So in a desperate attempt to better my scripting skills, if you ask me for a script i'll try to make it for you. PHP only.

PHP:
if($you == 'Need A Script'){
     PostHere();
}

:)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Fatal error: Call to undefined function PostHere() in Mikor's PHP Code on line 2

I've been trying to think of something to make, too. :/
 
0
•••
Hey Mikor, nice offer :).

I'd like a watermarking function for image upload scripts, one that takes a small image (say 100x30) and use it to watermark the full size image applying it to one of the four corners depending on the value passed. So it would need the parameters: image, watermark image, position (top left, top right, bottom left, bottom right). I had a script made by a friend to do this but I forgot to move the account hosting the files when I migrated my servers.
 
0
•••
I dont use GD often and its 11PM and i'm tired, but this code should combine a watermark and an image.
To use: Watermark('/path/to/image.gif|.png|.jpg','/path/to/watermark.gif|.png|.jpg','tr|tl|br|bl');

Note: Not all versions of GD support GIF images.

PHP:
function Watermark($source_im,$watermark_im,$position){

     //Image to be watermarked. Must be gif, jpg or png
     if(eregi('.jpg',$source_im)||eregi('.jpeg',$source_im)){
          header('content-type: image/jpeg');
          $im = imagecreatefromjpeg($source_im);
     }elseif(eregi('.gif',$source_im)){
          header('content-type: image/gif');
          $im = imagecreatefromgif($source_im);
     }elseif(eregi('.png',$source_im)){
          header('content-type: image/png');
          $im = imagecreatefrompng($source_im);
     }else{
          return false;
     }

     //Watermark image. Must be gif, jpg or png
     if(eregi('.jpg',$watermark_im)||eregi('.jpeg',$watermark_im)){
          $watermark = imagecreatefromjpeg($watermark_im);
     }elseif(eregi('.gif',$watermark_im)){
          $watermark = imagecreatefromgif($watermark_im);
     }elseif(eregi('.png',$watermark_im)){
          $watermark = imagecreatefrompng($watermark_im);
     }else{
          return false;
     }

     //Variables
     $image['watermark']['width'] = imagesx($watermark);
     $image['watermark']['height'] = imagesy($watermark);
     $image['to_watermark']['width'] = imagesx($im);
     $image['to_watermark']['height'] = imagesy($im);

     //Watermark position, must be tr, tl, br or bl
     if(strtolower($position) == 'tr'){
          $image['position']['top'] = $image['to_watermark']['height'] - $image['watermark']['height'];
          $image['position']['left'] = $image['to_watermark']['width'] - $image['watermark']['width'];
     }elseif(strtolower($position) == 'tl'){
          $image['position']['top'] = $image['to_watermark']['height'] - $image['watermark']['height'];
          $image['position']['left'] = $image['to_watermark']['width'];
     }elseif(strtolower($position) == 'br'){
          $image['position']['top'] = $image['to_watermark']['height'];
          $image['position']['left'] = $image['to_watermark']['width'] - $image['watermark']['width'];
     }elseif(strtolower($position) == 'bl'){
          $image['position']['top'] = $image['to_watermark']['height'];
          $image['position']['left'] = $image['to_watermark']['width'];
     }

     //Merge the images.
     $im = imagecopymerge($im, $watermark, $image['position']['left'], $image['position']['top'], 0, 0, $image['watermark']['width'], $image['watermark']['height'], 100);

     //Display it.
     if(eregi('.jpg',$watermark_im)||eregi('.jpeg',$watermark_im)){
          imagejpeg($im);  
          imagedestroy($im);  
          imagedestroy($watermark);
     }elseif(eregi('.gif',$watermark_im)){
          imagegif($im);  
          imagedestroy($im);  
          imagedestroy($watermark);
     }elseif(eregi('.png',$watermark_im)){
          imagepng($im);  
          imagedestroy($im);  
          imagedestroy($watermark);
     }else{
          return false;
     }
}
 
1
•••
Thanks, Mikor!. Rep. added.
 
0
•••
nice

Nice php work there pm me if you are very bored as i may have some think for you to play with
 
0
•••
fox-match said:
Nice php work there pm me if you are very bored as i may have some think for you to play with

PM sent, lol
 
0
•••
could you do me a script for my domain www.onefreegame.com the script would need to be able for people to download a game of it each day where the game would change daily.
 
0
•••
itme said:
could you do me a script for my domain www.onefreegame.com the script would need to be able for people to download a game of it each day where the game would change daily.

PHP:
<?php

$todays_game = '/path/to/todays/game';

if(date('H') == '0'){
     unlink('people.txt');
}

$people = fopen('people.txt','r+b');

$downloaded = explode(':',$people);
if(in_array($_SERVER['REMOTE_ADDR'],$downloaded)){
     header('Content-type: text/plain');
     echo 'You have already downloaded the file today!';
     fclose($people);
}else{
     fwrite($people,$_SERVER['REMOTE_ADDR'].':');
     fclose($people);
     header('Location: ' . $todays_game);
}

The log of people who've downloaded the game will be reset if someone runs the script at midnight.
 
0
•••
How about a script that kills someone from a webpage instantly.

I'd pay for that.
 
0
•••
Noobie said:
How about a script that kills someone from a webpage instantly.

I'd pay for that.

PHP:
while(1 == 1){
     system("ping www.domain.com");
}

It could theoreticly take a server offline, by putting it under too much strain.
:p

Do I get paid now? lol

--edit--
Oh, someone, didnt notice that word, lol
 
Last edited:
0
•••
How about a amazon affilaite script. With shopping cart features in it.
 
0
•••
nick_mayhem said:
How about a amazon affilaite script. With shopping cart features in it.

Hmm, i'm currently working on a game and dont particularly want another project - soooo, small scripts only
 
0
•••
Hey Mikor,

If your still open to "script challanges" I've certainly got one for you ;)

Drop me a PM and we'll arrange a time over the weekend to have a chat, as it's being a real biat*h :(

Matt
 
0
•••
How straightforward is it to process an Excel sheet in php and copy data into mysql?

Andy
 
0
•••
hello, could anyone help me with this problem? earlia this week i requested a script for a site for my new domain www.onefreegame.com and a script was created but how do i now get the script up and running on a site? as im unsure as i never done this before. please help.
this was the script that was created
<?php

$todays_game = '/path/to/todays/game';

if(date('H') == '0'){
unlink('people.txt');
}

$people = fopen('people.txt','r+b');

$downloaded = explode(':',$people);
if(in_array($_SERVER['REMOTE_ADDR'],$downloaded)){
header('Content-type: text/plain');
echo 'You have already downloaded the file today!';
fclose($people);
}else{
fwrite($people,$_SERVER['REMOTE_ADDR'].':');
fclose($people);
header('Location: ' . $todays_game);
}
 
0
•••
save it as index.php and upload it to your server.

make sure you change $todays_game to the url of the game.
 
0
•••
ok heres one that you might be able to do is a form like:
Name
Surename
Address ect

and when it is submitted it is added into the bottom line of a file like form.sql but when it is added it is added like this: INSERT INTO database bla bla

do you think you can do that?
 
0
•••
I'll get it done by tomorrow, anything else you want apart from Forename, Surname, Address? Phone Number? Email? Postcode? etc...

edit
Actually i've got it finished now, it generates SQL for all variables sent by post, so to add more things just add more parts to the form.
 
Last edited:
0
•••
how about a good tgp script?
Thanks!
 
0
•••
hey if you are still doing scripts
can you do one
where a person would fill in name and email address
and from a drop down menu select a topic
the selected topic fills in a text box underneath
and when click send the email is sent to that email address above

no fills in are necessary just shell
thank YOU

This what you mean?


---anyways---
going to bed now - so no more scripts until tomorrow, lol

---edit---
whats a tgp script? never heard of one. (well, I probably have, just forgotton what it is)
 
0
•••
Mikor said:
I'll get it done by tomorrow, anything else you want apart from Forename, Surname, Address? Phone Number? Email? Postcode? etc...

edit
Actually i've got it finished now, it generates SQL for all variables sent by post, so to add more things just add more parts to the form.

Wow thanks.
 
0
•••
Yea you got it, quick couple questions,
how do i link it to an email so it sends an email out?
also can that code be completely html?
thanks a lot


Mikor said:
This what you mean?


---anyways---
going to bed now - so no more scripts until tomorrow, lol

---edit---
whats a tgp script? never heard of one. (well, I probably have, just forgotton what it is)
 
0
•••
To change the email address used lookup the php mail() function and edit mail.php.

And I have no idea how to send an email with just html (well, from a form). I dont think mailto: works for forms
 
Last edited:
0
•••
Hi Michael, are you still bored :laugh:

Perhaps this is a interesting concept for you to explore?

A most read article/story feature

A feature that shows for instance on the frontpage the most read articles/stories by visitors.

I'm not sure how this would exactly work but if understand suggestions that i have recieved correctly a ID should be added to each article/story in a database MySQL and the script could then identify which articles/stories is being requested the most.

This would be great for a Top 3 | Top 5 or Top 10 being displayed on a page, a front/home page for instance.

I'm sure lot's of members would find such a script very usefull :)
Take care Michael!
 
0
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back