austin316

Diamond Member
Dec 1, 2001
3,572
0
0
I have a bunch of quotes I would like to post on my-myspace account, but would like it to be random and only display one quote at a time. Using just HTML, is this possible? I have my own webspace with php, anyway to make this work and have it appear in my profile?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
You can do it of you link to an image of text, but you have to host that image somewhere on another site, and you can't make that image with just HTML either.
 

OdiN

Banned
Mar 1, 2000
16,430
3
0
If you can put javascript in yeah.

Apparently you can't. That makes no ****** sense. I mean...what the ******? You can have all these flash pieces of ****** in there and all the glittery faggoty text ****** but you can't have javascript? BULLSHIT! Stupid ******.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: OdiN
If you can put javascript in yeah.

Apparently you can't. That makes no ****** sense. I mean...what the ******? You can have all these flash pieces of ****** in there and all the glittery faggoty text ****** but you can't have javascript? BULLSHIT! Stupid ******.

You're not a security expert, are you? Allowing user-defined javascript on a site like myspace is a huge security problem. Allowing glittery text is not.
 

insename2

Senior member
Dec 15, 2005
420
0
0
Originally posted by: GrantMeThePower
Just leave myspace and start a revolution for the betterment of humanity

b2revolution?

_________________________________

btw, u can prolly do it with flash + XML
 
Jun 4, 2005
19,723
1
0
You guys are putting way too much thought into it. You can still use PHP.

This is your HTML code :

This is your PHP code :
<?php

$folder = '.'; //This is your folder. If you leave it as it, it's the folder where the PHP file is located on your server, that's where it'll look for your images.

$extList = array();
// Set these for your file types.
$extList['gif'] = 'image/gif';
$extList['jpg'] = 'image/jpeg';
$extList['jpeg'] = 'image/jpeg';
$extList['png'] = 'image/png';

//That's it. If you're not experienced with PHP, don't touch this.
$img = null;

if (substr($folder,-1) != '/') {
$folder = $folder.'/';
}

if (isset($_GET['img'])) {
$imageInfo = pathinfo($_GET['img']);
if (
isset( $extList[ strtolower( $imageInfo['extension'] ) ] ) &&
file_exists( $folder.$imageInfo['basename'] )
) {
$img = $folder.$imageInfo['basename'];
}
} else {
$fileList = array();
$handle = opendir($folder);
while ( false !== ( $file = readdir($handle) ) ) {
$file_info = pathinfo($file);
if (
isset( $extList[ strtolower( $file_info['extension'] ) ] )
) {
$fileList[] = $file;
}
}
closedir($handle);

if (count($fileList) > 0) {
$imageNumber = time() % count($fileList);
$img = $folder.$fileList[$imageNumber];
}
}

if ($img!=null) {
$imageInfo = pathinfo($img);
$contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
header ($contentType);
readfile($img);
} else {
if ( function_exists('imagecreate') ) {
header ("Content-type: image/png");
$im = @imagecreate (100, 100)
or die ("Cannot initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 0,0,0);
imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color);
imagepng ($im);
imagedestroy($im);
}
}

?>

Alright, so, the PHP is on your server, the HTML is on myspace. As I said in the comments, the $folder is equivalent to the path of your images. If you leave it to default, it'll randomize all the files in the folder in which the PHP script is located.

Here's an example : Text

EDIT : SOB! QUOTES! I thought images. :(
 

insename2

Senior member
Dec 15, 2005
420
0
0
Originally posted by: LoKe
You guys are putting way too much thought into it. You can still use PHP.

This is your HTML code :

This is your PHP code :
<?php

$folder = '.'; //This is your folder. If you leave it as it, it's the folder where the PHP file is located on your server, that's where it'll look for your images.

$extList = array();
// Set these for your file types.
$extList['gif'] = 'image/gif';
$extList['jpg'] = 'image/jpeg';
$extList['jpeg'] = 'image/jpeg';
$extList['png'] = 'image/png';

//That's it. If you're not experienced with PHP, don't touch this.
$img = null;

if (substr($folder,-1) != '/') {
$folder = $folder.'/';
}

if (isset($_GET['img'])) {
$imageInfo = pathinfo($_GET['img']);
if (
isset( $extList[ strtolower( $imageInfo['extension'] ) ] ) &&
file_exists( $folder.$imageInfo['basename'] )
) {
$img = $folder.$imageInfo['basename'];
}
} else {
$fileList = array();
$handle = opendir($folder);
while ( false !== ( $file = readdir($handle) ) ) {
$file_info = pathinfo($file);
if (
isset( $extList[ strtolower( $file_info['extension'] ) ] )
) {
$fileList[] = $file;
}
}
closedir($handle);

if (count($fileList) > 0) {
$imageNumber = time() % count($fileList);
$img = $folder.$fileList[$imageNumber];
}
}

if ($img!=null) {
$imageInfo = pathinfo($img);
$contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
header ($contentType);
readfile($img);
} else {
if ( function_exists('imagecreate') ) {
header ("Content-type: image/png");
$im = @imagecreate (100, 100)
or die ("Cannot initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 0,0,0);
imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color);
imagepng ($im);
imagedestroy($im);
}
}

?>

Alright, so, the PHP is on your server, the HTML is on myspace. As I said in the comments, the $folder is equivalent to the path of your images. If you leave it to default, it'll randomize all the files in the folder in which the PHP script is located.

Here's an example : Text

EDIT : SOB! QUOTES! I thought images. :(
^^ lol edit...


images? guess he'll have to save his quotes as a jpg or something...


 

austin316

Diamond Member
Dec 1, 2001
3,572
0
0
Originally posted by: insename2
Originally posted by: LoKe
You guys are putting way too much thought into it. You can still use PHP.

This is your HTML code :

This is your PHP code :
<?php

$folder = '.'; //This is your folder. If you leave it as it, it's the folder where the PHP file is located on your server, that's where it'll look for your images.

$extList = array();
// Set these for your file types.
$extList['gif'] = 'image/gif';
$extList['jpg'] = 'image/jpeg';
$extList['jpeg'] = 'image/jpeg';
$extList['png'] = 'image/png';

//That's it. If you're not experienced with PHP, don't touch this.
$img = null;

if (substr($folder,-1) != '/') {
$folder = $folder.'/';
}

if (isset($_GET['img'])) {
$imageInfo = pathinfo($_GET['img']);
if (
isset( $extList[ strtolower( $imageInfo['extension'] ) ] ) &&
file_exists( $folder.$imageInfo['basename'] )
) {
$img = $folder.$imageInfo['basename'];
}
} else {
$fileList = array();
$handle = opendir($folder);
while ( false !== ( $file = readdir($handle) ) ) {
$file_info = pathinfo($file);
if (
isset( $extList[ strtolower( $file_info['extension'] ) ] )
) {
$fileList[] = $file;
}
}
closedir($handle);

if (count($fileList) > 0) {
$imageNumber = time() % count($fileList);
$img = $folder.$fileList[$imageNumber];
}
}

if ($img!=null) {
$imageInfo = pathinfo($img);
$contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
header ($contentType);
readfile($img);
} else {
if ( function_exists('imagecreate') ) {
header ("Content-type: image/png");
$im = @imagecreate (100, 100)
or die ("Cannot initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 0,0,0);
imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color);
imagepng ($im);
imagedestroy($im);
}
}

?>

Alright, so, the PHP is on your server, the HTML is on myspace. As I said in the comments, the $folder is equivalent to the path of your images. If you leave it to default, it'll randomize all the files in the folder in which the PHP script is located.

Here's an example : Text

EDIT : SOB! QUOTES! I thought images. :(
^^ lol edit...


images? guess he'll have to save his quotes as a jpg or something...

anyway to do this as text? or should I just save my quotes as .gifs?

 

austin316

Diamond Member
Dec 1, 2001
3,572
0
0
Originally posted by: austin316
Originally posted by: insename2
Originally posted by: LoKe
You guys are putting way too much thought into it. You can still use PHP.

This is your HTML code :

This is your PHP code :
<?php

$folder = '.'; //This is your folder. If you leave it as it, it's the folder where the PHP file is located on your server, that's where it'll look for your images.

$extList = array();
// Set these for your file types.
$extList['gif'] = 'image/gif';
$extList['jpg'] = 'image/jpeg';
$extList['jpeg'] = 'image/jpeg';
$extList['png'] = 'image/png';

//That's it. If you're not experienced with PHP, don't touch this.
$img = null;

if (substr($folder,-1) != '/') {
$folder = $folder.'/';
}

if (isset($_GET['img'])) {
$imageInfo = pathinfo($_GET['img']);
if (
isset( $extList[ strtolower( $imageInfo['extension'] ) ] ) &&
file_exists( $folder.$imageInfo['basename'] )
) {
$img = $folder.$imageInfo['basename'];
}
} else {
$fileList = array();
$handle = opendir($folder);
while ( false !== ( $file = readdir($handle) ) ) {
$file_info = pathinfo($file);
if (
isset( $extList[ strtolower( $file_info['extension'] ) ] )
) {
$fileList[] = $file;
}
}
closedir($handle);

if (count($fileList) > 0) {
$imageNumber = time() % count($fileList);
$img = $folder.$fileList[$imageNumber];
}
}

if ($img!=null) {
$imageInfo = pathinfo($img);
$contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ];
header ($contentType);
readfile($img);
} else {
if ( function_exists('imagecreate') ) {
header ("Content-type: image/png");
$im = @imagecreate (100, 100)
or die ("Cannot initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 0,0,0);
imagestring ($im, 2, 5, 5, "IMAGE ERROR", $text_color);
imagepng ($im);
imagedestroy($im);
}
}

?>

Alright, so, the PHP is on your server, the HTML is on myspace. As I said in the comments, the $folder is equivalent to the path of your images. If you leave it to default, it'll randomize all the files in the folder in which the PHP script is located.

Here's an example : Text

EDIT : SOB! QUOTES! I thought images. :(
^^ lol edit...


images? guess he'll have to save his quotes as a jpg or something...

anyway to do this as text? or should I just save my quotes as .gifs?

or make an animated .gif?

 

Kev

Lifer
Dec 17, 2001
16,367
4
81
I like how LoKe says you guys are putting too much thought into it, then proceeds to serve up 40 lines of php code.
 

QED

Diamond Member
Dec 16, 2005
3,428
3
0
Originally posted by: austin316

anyway to do this as text? or should I just save my quotes as .gifs?

or make an animated .gif?

Actually, you can use the GD lib with PHP to convert a text string into a graphic image on the fly.

It'd be pretty easy to write a PHP script which grabbed a line from a text file containing all of your quotes, and then create a gif file with that quote.

 

austin316

Diamond Member
Dec 1, 2001
3,572
0
0
Originally posted by: MathMan
Originally posted by: austin316

anyway to do this as text? or should I just save my quotes as .gifs?

or make an animated .gif?

Actually, you can use the GD lib with PHP to convert a text string into a graphic image on the fly.

It'd be pretty easy to write a PHP script which grabbed a line from a text file containing all of your quotes, and then create a gif file with that quote.


any pointers where I could find a guide to help me?