ยินดีต้อนรับคุณ, บุคคลทั่วไป กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน

เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น

ThaiSEOBoard.comไทย เสียว บอร์ดTutorial (ห้ามตั้งคำถามห้องนี้)เปิดซิงกับ Tutorial :AdSense Ad Positioning แบบไอคอนภาพสุ่ม
หน้า: 1 [2]  ทั้งหมด   ลงล่าง
พิมพ์
ผู้เขียน หัวข้อ: เปิดซิงกับ Tutorial :AdSense Ad Positioning แบบไอคอนภาพสุ่ม  (อ่าน 11678 ครั้ง)
0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้
jane
หัวหน้าแก๊งเสียว
*

พลังน้ำใจ: 25
ออฟไลน์ ออฟไลน์

กระทู้: 1,265



ดูรายละเอียด
« ตอบ #20 เมื่อ: 29 ตุลาคม 2006, 00:31:33 »

อ้างจาก: "blogger"
ไม่ควรใส่กรอบนะครับจะได้เนียนขึ้น แต่ใส่กรอบแล้วดีตรงที่ปลอดภัยจาก gg ครับ
ทำวิธีนี้ ctr เพิ่ม 2-3 เท่าครับ ถือว่าโอนะครับ

คุณ tony jaa บอกไต๋บางดิ thank you


ถ้าไม่ใส่กรอบแล้วผิดกฎเหรอคะ  :?:  :roll:
พอดีกำลังทำแบบไม่ใส่กรอบอยู่น่ะค่ะ
บันทึกการเข้า

bubbleball
Administrator
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 444
ออฟไลน์ ออฟไลน์

กระทู้: 5,731



ดูรายละเอียด
« ตอบ #21 เมื่อ: 29 ตุลาคม 2006, 01:25:17 »

ถ้าไม่ใส่กรอบ ให้เว้นระยะพอประมาณกำลังดีครับ
บันทึกการเข้า

iamnewbies
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 28
ออฟไลน์ ออฟไลน์

กระทู้: 9,635



ดูรายละเอียด
« ตอบ #22 เมื่อ: 29 ตุลาคม 2006, 10:09:10 »

http://alistapart.com/articles/randomizer/

http://alistapart.com/d/randomizer/rotate.txt
บันทึกการเข้า

ุอิอิ  พลุบๆโพล่ๆ  เข้าๆออกๆ เสียวๆ
iamnewbies
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 28
ออฟไลน์ ออฟไลน์

กระทู้: 9,635



ดูรายละเอียด
« ตอบ #23 เมื่อ: 29 ตุลาคม 2006, 10:09:25 »

โค๊ด:

<?php

/*

AUTOMATIC IMAGE ROTATOR
Version 2.2 - December 4, 2003
Copyright &#40;c&#41; 2002-2003 Dan P. Benjamin, Automatic, Ltd.
All Rights Reserved.

http&#58;//www.hiveware.com/imagerotator.php

http&#58;//www.automaticlabs.com/


DISCLAIMER
Automatic, Ltd. makes no representations or warranties about
the suitability of the software, either express or
implied, including but not limited to the implied
warranties of merchantability, fitness for a particular
purpose, or non-infringement. Dan P. Benjamin and Automatic, Ltd.
shall not be liable for any damages suffered by licensee
as a result of using, modifying or distributing this
software or its derivatives.


ABOUT
This PHP script will randomly select an image file from a
folder of images on your webserver.  You can then link to it
as you would any standard image file and you'll see a random
image each time you reload.

When you want to add or remove images from the rotation-pool,
just add or remove them from the image rotation folder.


VERSION CHANGES
Version 1.0
- Release version

Version 1.5
- Tweaked a few boring bugs

Version 2.0
- Complete rewrite from the ground-up
- Made it clearer where to make modifications
- Made it easier to specify/change the rotation-folder
- Made it easier to specify/change supported image types
- Wrote better instructions and info &#40;you're them reading now&#41;
- Significant speed improvements
- More error checking
- Cleaner code &#40;albeit more PHP-specific&#41;
- Better/faster random number generation and file-type parsing
- Added a feature where the image to display can be specified
- Added a cool feature where, if an error occurs &#40;such as no
  images being found in the specified folder&#41; *and* you're
  lucky enough to have the GD libraries compiled into PHP on
  your webserver, we generate a replacement "error image" on
  the fly.

    Version 2.1
        - Updated a potential security flaw when value-matching
          filenames

    Version 2.2
        - Updated a few more potential security issues
        - Optimized the code a bit.
        - Expanded the doc for adding new mime/image types.

        Thanks to faithful ALA reader Justin Greer for
        lots of good tips and solid code contribution!


INSTRUCTIONS
1. Modify the $folder setting in the configuration section below.
2. Add image types if needed &#40;most users can ignore that part&#41;.
3. Upload this file &#40;rotate.php&#41; to your webserver.  I recommend
   uploading it to the same folder as your images.
4. Link to the file as you would any normal image file, like this&#58;

<img src="http&#58;//example.com/rotate.php">

5. You can also specify the image to display like this&#58;

<img src="http&#58;//example.com/rotate.php?img=gorilla.jpg">

This would specify that an image named "gorilla.jpg" located
in the image-rotation folder should be displayed.

That's it, you're done.

*/




/* ------------------------- CONFIGURATION -----------------------


Set $folder to the full path to the location of your images.
For example&#58; $folder = '/user/me/example.com/images/';
If the rotate.php file will be in the same folder as your
images then you should leave it set to $folder = '.';

*/


$folder '.';


/*

Most users can safely ignore this part.  If you're a programmer,
keep reading, if not, you're done.  Go get some coffee.

    If you'd like to enable additional image types other than
gif, jpg, and png, add a duplicate line to the section below
for the new image type.

Add the new file-type, single-quoted, inside brackets.

Add the mime-type to be sent to the browser, also single-quoted,
after the equal sign.

For example&#58;

PDF Files&#58;

$extList['pdf'&#93; = 'application/pdf';

    CSS Files&#58;

        $extList['css'&#93; = 'text/css';

    You can even serve up random HTML files&#58;

    $extList['html'&#93; = 'text/html';
    $extList['htm'&#93; = 'text/html';

    Just be sure your mime-type definition is correct!

*/

    
$extList = array&#40;&#41;;
$extList['gif'&#93; = 'image/gif';
$extList['jpg'&#93; = 'image/jpeg';
$extList['jpeg'&#93; = 'image/jpeg';
$extList['png'&#93; = 'image/png';


// You don't need to edit anything after this point.


// --------------------- END CONFIGURATION -----------------------

$img null;

if &
#40;substr&#40;$folder,-1&#41; != '/'&#41; &#123;
$folder $folder.'/';
&
#125;

if &#40;isset&#40;$_GET['img'&#93;&#41;&#41; &#123;
$imageInfo pathinfo&#40;$_GET['img'&#93;&#41;;
if &#40;
    isset&#40; $extList[ strtolower&#40; $imageInfo['extension'&#93; &#41; &#93; &#41; &&
        
file_exists&#40; $folder.$imageInfo['basename'&#93; &#41;
    
&#41; &#123;
$img $folder.$imageInfo['basename'&#93;;
&#125;
&#125; else &#123;
$fileList = array&#40;&#41;;
$handle opendir&#40;$folder&#41;;
while &#40; false !== &#40; $file = readdir&#40;$handle&#41; &#41; &#41; &#123;
$file_info pathinfo&#40;$file&#41;;
if &#40;
    isset&#40; $extList[ strtolower&#40; $file_info['extension'&#93; &#41; &#93; &#41;
&#41; &#123;
$fileList[&#93; = $file;
&#125;
&#125;
closedir&#40;$handle&#41;;

if &#40;count&#40;$fileList&#41; > 0&#41; &#123;
$imageNumber time&#40;&#41; % count&#40;$fileList&#41;;
$img $folder.$fileList[$imageNumber&#93;;
&#125;
&#125;

if &#40;$img!=null&#41; &#123;
$imageInfo pathinfo&#40;$img&#41;;
$contentType 'Content-type&#58; '.$extList$imageInfo['extension'&#93; &#93;;
header &#40;$contentType&#41;;
readfile&#40;$img&#41;;
&#125; else &#123;
if &#40; function_exists&#40;'imagecreate'&#41; &#41; &#123;
header &#40;"Content-type&#58; image/png"&#41;;
$im = @imagecreate &#40;100, 100&#41;
    or die &#40;"Cannot initialize new GD image stream"&#41;;
$background_color imagecolorallocate &#40;$im, 255, 255, 255&#41;;
$text_color imagecolorallocate &#40;$im, 0,0,0&#41;;
imagestring &#40;$im, 2, 5, 5,  "IMAGE ERROR", $text_color&#41;;
imagepng &#40;$im&#41;;
imagedestroy&#40;$im&#41;;
&#125;
&#125;

?>

บันทึกการเข้า

ุอิอิ  พลุบๆโพล่ๆ  เข้าๆออกๆ เสียวๆ
EThaiZone
เจ้าพ่อโลลิค่อน
เจ้าพ่อบอร์ดเสียว
*

พลังน้ำใจ: 321
ออฟไลน์ ออฟไลน์

กระทู้: 12,516



ดูรายละเอียด
« ตอบ #24 เมื่อ: 29 ธันวาคม 2006, 07:37:35 »

... จะเอายาวๆ ทำไมน้อครับ ในเมื่อสุ่มแค่รูปภาพนิ

โค๊ด:
<?php
//PHP Code &#58; Random Picture In Folder
//Writed by &#58; EThaiZone.Com
//Contact us &#58; ethazione@hotmail.com

//แก้เป็นชื่อโฟลเดอร์ที่เก็บรูปภาพ มี / ปิดท้ายด้วย
$path "images/adsense/";

$path2 realpath&#40;$path&#41;;
$flist opendir&#40;$path2&#41;;
$list = array&#40;&#41;;
while &#40;false !== &#40;$mfile = readdir&#40;$flist&#41;&#41;&#41; &#123;
$list array_merge&#40;&#40;array&#41;$list, &#40;array&#41;$mfile&#41;;
&#125;
sort&#40;$list&#41;;
array_splice&#40;$list, 0, 2&#41;;
$img =array_rand&#40;$list&#41;;
$img $list[$img&#93;;
header&#40;'Content-type&#58; image/jpeg'&#41;;
@readfile&#40;"$path$img"&#41;;
?>


วิธีใช้งานสุดๆ
แก้ $path ให้เป็นโฟลเดอร์ที่เก็บรูปภาพ ภายในนั้นต้องมีแต่ภาพนะครับ
(ผมเขียนให้สั้นที่สุด จึงไม่มีระบบเช็คนามสกุล)

แล้วก็ใช้งานได้เลย ตัวอย่าง  (ดูแล้วจะรุ้ว่าต้องอัพไฟล์ และใช้อย่างไร)
ip.ethaizone.com/picture.php
ip.ethaizone.com/images/adsense/

ไม่เห็นกระทู้นี้ ไม่งั้นก็เอาโค้ดมาโพสนานแล้ว
ความจริงเขียนไว้นานแล้วแหละ แต่ไม่นึกว่ามีคนคิดเหมือนกัน
บันทึกการเข้า

หน้า: 1 [2]  ทั้งหมด   ขึ้นบน
พิมพ์