Welcome to Gaia! ::


Note/Update: I do not have a website anymore so the code isn't there anymore and I don't deal with the shoutbox anymore because I just don't have time to put somewhere else, update the code, ect. so please don't pm asking about how to do the shoutbox or with any help with it. Thank you.
-Seth

I'm sure you a lot of you saw those shoutboxes created by Cremonte and now you are all sad and heart broken because you cannot get your own now that he has closed down. Well never fear because now you can host your own simple shoutbox use the code I give to you, yay =^-^=.

Requirements:
PHP Version greater than 4.3
A MySQL database
GD library version 1.8 or greater, preferable GD2 because of its increased PNG support

Instructions:
Download the shoutbox package:
http://sethswebs.com/shoutbox.zip

First open up shoutbox.php and edit the following things:

[code:1]$mypass = "MySQL pass goes here";
$myuser = "MySQL user goes here";
$mydb = "MySQL Database goes here";
$myhost = "localhost";
$imurl = "ImageUrl goes here";
$x = "X position goes here";
$y = "Y position goes here";
$maxx = "The max width goes here";
$maxy = "The max height goes here";[/code:1]

$imurl is going to be the background image where the shouts will appear on. X and Y are the text position, meaning the cordinates for that is where the text is going to start being written. Maxx is the maximum width that the text can go while Maxy is the maximum height the text can go. If the host you are using already offers a MySQL database along with PHP then leave $myhost alone, otherwise change it to the host of your MySQl database.

Next in the same file find where it says

[code:1]header("image/" wink ; [/code:1]

After the the image/ add the extension of the file you will be using(jpeg,gif,ect.). Note that jpg must be jpeg because that is the actual extension name.

Now find where it says

[code:1]$im = @imagecreatefrom($imurl);[/code:1]

After the from in imagecreatefrom add the extension of the image you are going to use.

Now scroll down to where it says

[code:1]$tc = imagecolorallocate($im,0,0,0);[/code:1]

If you want a color other than black then edit the three 0's to the colors you want for them. The 0's correspond to the RGB colors. If you want black then leave it alone. On the opposite side of the spectrum white would be 255,255,255.

Find where it says

[code:1]return image($im);[/code:1]

After the image part add the extension of your image, so if you are using a png it should be:

[code:1]return imagepng($im);[/code:1]

If you going to use a jpeg then the correct code would be:

[code:1]return imagejpeg($im,'',100);[/code:1]

Where the last number is the quality of the image, 0 being the worst and 100 being the best.

Now then open up shoutboxshout.php and shoutboxinstall.php and edit the code that says:

[code:1]$mypass = "MySQL pass goes here";
$myuser = "MySQL user goes here";
$mydb = "MySQL Database goes here";
$myhost = "localhost";[/code:1]

If the host you are using already offers a MySQL database along with PHP then leave $myhost alone, otherwise change it to the host of your MySQl database. Next upload all the files then run shoutboxinstall.php in order to create your table for you shouts. When that is done you can delete it.

And if all goes well you have just created a shoutbox for your sig, yay =^-^=. Have fun with it.

User Image - Blocked by "Display Image" Settings. Click to show.

Note: This code was inspired by Cremonte. If it wasn't for him making his shoutboxes I would of never made this code. All credit for the shoutboxes should rightfully go to him

But if you're feeling generous you can send a donation to me because I worked so hard to make this code ^_^;;;

If you don't have a MySQL database or you don't want to use a different host for one then you can use Rayquazza's flatfile version, yay for Ray =^-^=:

Sig.php:
[code:1]<?php


$im = ImageCreateFrompng('try.png'); // your image
$im2 = imagecreatetruecolor(425, 250); // size of your image
$white = imagecolorallocate($im, 85, 85, 85);

















imagefill($im2, 0, 0, $white); // fille the background image
ImageCopyMerge($im2, $im, 0, 0, 0, 0, ImagesX($im), ImagesY($im), 100);

$file = file_get_contents('messagelog.txt');
$file = explode("n", $file);






$ln = count($file);
$e = 1;
// Write text on image starting from bottom up. (newest on bottom)
for ($i = 7; $i > 0; $i--) {
$j = $i - 1;
$vertdist = $e * 15;
$vertdist = $vertdist + 10;
$lnc = $ln - $i;
$string = $file[$lnc];
switch ($col) {
case 0;
imagestring($im2, 2, 110, $vertdist, $string, $white);
break;
case 1;
imagestring($im2, 2, 10, $vertdist, $string2, $white);
break;
case 2;
imagestring($im2, 2, 110, $vertdist, $string3, $white);
break;
case 3;
imagestring($im2, 2, 110, $vertdist, $today, $white);
break;
default:
imagestring($im2, 2, 110, $vertdist, $whatis, $white);
}
$e++;
}






header("Content-type: image/png" wink ; // tell browser it's an image
imagepng($im2); // send image
imagedestroy($im2); // free resources


?> [/code:1]

Submit.php:

[code:1]<html><body><center><br><br><br><br><br><br><br><br><br><form action="submit.php" method="POST">
Name: <input type="text" name="username" maxlength='19'><font color="red">*</font><br>
Message / Action: <input type="text" name="message" maxlength='27'><font color="red">*</font><br>

<input type="submit" value="Submit"><br>

</form></center>
<body></html>
<?php
$message = stripslashes($_POST['message']);
$username = stripslashes($_POST['username']);
$password = stripslashes($_POST['password']);

//define vars

if (!empty($username) && !empty($message)){
//checks if all inputs are set










$fh = fopen("messagelog.txt", "a+"); // sends stuff to logfile

fwrite($fh, " " . $username . " says: " . $message . "n" wink ;
fclose($fh);
echo "<center>Successful. Check <a href='sig.php'>the shoutbox</a>.";


}
else {
echo "<center>All fields marked with an <font color="red">*</font> are necesary.<br>";
}





?> [/code:1]

http://www.oinko.net/freephp/ is a site that shows a list of hosts that offer php and MySQL, thanks dstar ^_^.
I dont think it was correct of you to publish his code like this...

EDIT: Forget it, since he cancelled his shop I dont think it matters. xd
Nice Sethy!
Well TheUnknownFactor made mine, and I luff him. ******** Cremonte... *Hugs TUF even though he cant see it.*
Lewa-chan
Well TheUnknownFactor made mine, and I luff him. ******** Cremonte... *Hugs TUF even though he cant see it.*
Ungrateful.

7,350 Points
  • Person of Interest 200
  • Citizen 200
  • Window Shopper 100
Lewa-chan
Well TheUnknownFactor made mine, and I luff him. ******** Cremonte... *Hugs TUF even though he cant see it.*
Even though Cremonte invented the code and the idea and Factor would have never thought or made it without Cremonte? Wow. We have a dunce in the house.

I agree with the first poster, Sethy... sweatdrop It doesn't seem...right.

;-; Lulu still luffs Cremonte. ******** all the poser chatterboxes.
An Angels Nightmare
Lewa-chan
Well TheUnknownFactor made mine, and I luff him. ******** Cremonte... *Hugs TUF even though he cant see it.*
Ungrateful.
Just was I was thinking ::glares at Lewa:: stare .

For those of you who don't have access to a MySQL database I'm going to be working on a flatfile version ^_^.
An Angels Nightmare
Lewa-chan
Well TheUnknownFactor made mine, and I luff him. ******** Cremonte... *Hugs TUF even though he cant see it.*
Ungrateful.


When Cremonte comes and gives me some lovin' I'll be grateful. Rowr...
Teh Lulu
Lewa-chan
Well TheUnknownFactor made mine, and I luff him. ******** Cremonte... *Hugs TUF even though he cant see it.*
Even though Cremonte invented the code and the idea and Factor would have never thought or made it without Cremonte? Wow. We have a dunce in the house.

I agree with the first poster, Sethy... sweatdrop It doesn't seem...right.
Lulu, one of the newer people (mods) loves php. He was thinking of designing one, then I told him about Cremontes. XP He stillw ants to create the code so users can have their own. :/

Invisible Inquisitor

11,750 Points
  • Invisibility 100
  • Tooth Fairy 100
  • Timid 100
Gah, it ate my post.

question Question: Can you make it so that new posts appear at the bottom?
This is just a very simple one for people to use. If people want to create a shop and with all these fancy file protected stuff, admin cp, custom fonts and whatever then they still can.

7,350 Points
  • Person of Interest 200
  • Citizen 200
  • Window Shopper 100
An Angels Nightmare
Teh Lulu
Lewa-chan
Well TheUnknownFactor made mine, and I luff him. ******** Cremonte... *Hugs TUF even though he cant see it.*
Even though Cremonte invented the code and the idea and Factor would have never thought or made it without Cremonte? Wow. We have a dunce in the house.

I agree with the first poster, Sethy... sweatdrop It doesn't seem...right.
Lulu, one of the newer people (mods) loves php. He was thinking of designing one, then I told him about Cremontes. XP He stillw ants to create the code so users can have their own. :/
>.> I guess I'm just iffy about it, since Cremonte made the original code and idea and such. Although my opinion doesn't really matter. sweatdrop
I agree with lulo o.o The idea is great that you want to help other members make their own sigs and whatnot.. but that was Cremonte's original code .. Did you even ask t'see if it was okay with him?
Rayinte
Gah, it ate my post.

question Question: Can you make it so that new posts appear at the bottom?
Too lazy and too much work.

Lulu - it was said in another thread when someone was asking about making a shop for this that PHP code can't really be copied so it isn't breaking any rules for posting it. So this is actually my own code, just inspired by Cremonte's.
Teh Lulu
An Angels Nightmare
Teh Lulu
Lewa-chan
Well TheUnknownFactor made mine, and I luff him. ******** Cremonte... *Hugs TUF even though he cant see it.*
Even though Cremonte invented the code and the idea and Factor would have never thought or made it without Cremonte? Wow. We have a dunce in the house.

I agree with the first poster, Sethy... sweatdrop It doesn't seem...right.
Lulu, one of the newer people (mods) loves php. He was thinking of designing one, then I told him about Cremontes. XP He stillw ants to create the code so users can have their own. :/
>.> I guess I'm just iffy about it, since Cremonte made the original code and idea and such. Although my opinion doesn't really matter. sweatdrop
I may/may not use it, because its cremonte's code, and I want his permission first. I dunno.... sweatdrop

Quick Reply

Submit
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games
Mini-Games
Play with GCash
Play with Platinum