GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   image rotator code/script that I can use here on GFY (https://gfy.com/showthread.php?t=766723)

Juicy D. Links 09-07-2007 05:14 AM

image rotator code/script that I can use here on GFY
 
anybody have idea?

gotta somehow be usable with the VB Coode and the anti html restrictions

KimJI 09-07-2007 05:37 AM

You could do like some other people do:
Create a database with the file names of the banners, and the URL it should point to. Then you make a cron job on your server that renames the "imagefile" to live-banner.jpg every x minutes and matches the redirect script with that image-name.

Then you change your signature to use the www.server.com/live-banner.jpg and link it to http://yourserver.com/redirectscript.php


That way you use the same static code, but the work is being done on your server

Pipison 09-07-2007 06:30 AM

I am new user in gfy.com, i just sending my first postings. I hope you don’t have any problem with this ...see you and have a nice day.

Juicy D. Links 09-07-2007 06:48 AM

Quote:

Originally Posted by Pipison (Post 13053177)
I am new user in gfy.com, i just sending my first postings. I hope you don?t have any problem with this ...see you and have a nice day.


fucking bot :1orglaugh:1orglaugh:1orglaugh

Juicy D. Links 09-07-2007 06:49 AM

:)
Quote:

Originally Posted by KimJI (Post 13052578)
You could do like some other people do:
Create a database with the file names of the banners, and the URL it should point to. Then you make a cron job on your server that renames the "imagefile" to live-banner.jpg every x minutes and matches the redirect script with that image-name.

Then you change your signature to use the www.server.com/live-banner.jpg and link it to http://yourserver.com/redirectscript.php


That way you use the same static code, but the work is being done on your server

cool ill give it a shot ltr see if i can get it to work :):)

Fletch XXX 09-07-2007 06:57 AM

Quote:

Originally Posted by Pipison (Post 13053177)
I am new user in gfy.com, i just sending my first postings. I hope you don?t have any problem with this ...see you and have a nice day.

just trying out a few rentatrolls dont mind this....

SmokeyTheBear 09-07-2007 10:19 AM

make a new folder lets call it "smokey"

upload all your pics you want to use in this directory , then save the following as index.php
Code:

<?php





        $folder = '.';


        $extList = array();
        $extList['gif'] = 'image/gif';
        $extList['jpg'] = 'image/jpeg';
        $extList['png'] = 'image/png';
       


$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() &#37; 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);
        }
}
?>

to call your random picture with bbcode use this
Code:

[tmg]http://yourdomain.com/smokey/[/tmg]

fris 09-07-2007 05:21 PM

Quote:

Originally Posted by SmokeyTheBear (Post 13055421)
make a new folder lets call it "smokey"

upload all your pics you want to use in this directory , then save the following as index.php
Code:

<?php





        $folder = '.';


        $extList = array();
        $extList['gif'] = 'image/gif';
        $extList['jpg'] = 'image/jpeg';
        $extList['png'] = 'image/png';
       


$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);
        }
}
?>

to call your random picture with bbcode use this
Code:

[tmg]http://yourdomain.com/smokey/[/tmg]

did you code that?

fris 09-08-2007 11:39 AM

bump for answer

Juicy D. Links 09-08-2007 12:07 PM

thx Smokeyyyyyyyyyyyy it works

SmokeyTheBear 09-08-2007 12:18 PM

Quote:

Originally Posted by Fris (Post 13057504)
did you code that?

nope i found it somewhere .. psc i think


All times are GMT -7. The time now is 03:51 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123