munich
สมุนแก๊งเสียว
พลังน้ำใจ: 4
ออฟไลน์
กระทู้: 845
|
 |
« เมื่อ: 03 ตุลาคม 2006, 18:26:00 » |
|
แบบเด็กๆน่ะครับ เหมาะกับมือใหม่ เซียนๆข้ามไปได้เลย :lol: :lol: ป.ล. กรุณาอ่านกระทู้นี้ เนื่องจากมีกฏกำหนดเรื่องนี้ออกมาแล้ว (bubbleball 21-12-06) http://www.thaiseoboard.com/viewtopic.php?t=3963 ผลลัพธ์ 1 ผลลัพธ์ 2 1.สร้างภาพตรึงไว้เป็นเหมือน Icon หรือ Thumbnail ให้ดูเหมือนเป็นภาพเล็กๆสวยๆ 4 ภาพ (แต่จริงๆคือไฟล์ภาพเดียวกัน) ขนาด 90x280 pixels สำหรับเอามาใช้สุ่ม จะสร้างสัก 2-3 ชุดก็ตามแต่ จัดวางเลย์เอ้าก็กะเอาราวๆนี้ ถ้าไม่มีก็หาเอา icon สวยๆมาแต่งโหลดเอาจากที่นี่ครับ http://www.maxpower.ca/free-icons/2006/03/05/  2.ใช้สคริปต์สำหรับเปลี่ยนภาพในข้อ 1 เวลาดาวน์โหลดมาใช้อย่าลืมเปลี่ยนเป็น rotate.php ด้วยครับ http://www.alistapart.com/d/randomizer/rotate.txt  3.สร้าง Folder สำหรับเก็บภาพทั้งหมดเอาไว้ที่โฮสต์ อย่าลืมเอาสคริปต์ rotate.php ใส่ไว้ด้านในด้วย คือ image1, image2, image3 (ภาพในข้อที่ 1) และไฟลฺ์ rotate.php จัดเก็บอยู่ในโฟลเดอร์เดียวกัน 4.ใช้ table หรือ css สำหรับใส่รูปภาพในข้อที่ 1 และโค้ด Adsense จัดวาง layout ให้เหมาะสมในไฟล์เพจที่เราต้องการแสดงโฆษณาแล้วบันทึก ตัวอย่าง table code <table border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="http://www.johntp.com/adsense/rotate.php" width="90" height="280"/></td> <td> <script type="text/javascript"><!-- google_ad_client = "AdSense ID ของเราเอง"; google_ad_width = 336; google_ad_height = 280; google_ad_format = "336x280_as"; google_ad_type = "text"; google_ad_channel ="8617624486"; google_color_border = "FFFFFF"; google_color_bg = "FFFFFF"; google_color_link = "3D81EE"; google_color_text = "000000"; google_color_url = "3D81EE"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </td> </tr> </table>
ขนาดหรือ scale ปรับหรือประยุกต์กันเอาเองน่ะครับ ไฟล์ภาพที่จะเอามาใช้ก็ให้ใกล้เคียงกับ Ad ที่จะขึ้น เช่น Content ด้านท่องเที่ยวก็ใส่ภาพทิวทัศน์ ภูเขา หรือทะเล แค่นี้ น่าจะได้คลิกเยอะเหมือนกันน่ะครับ ถ้าไม่ Random ภาพก็ยัดภาพใส่ตรงๆไม่ต้องใช้ โค้ดให้วุ่นวายน่ะครับ เครดิตจากเว็บนี้  น่ะครับ ลอกเค้ามา :lol: :lol:
|
|
|
บันทึกการเข้า
|
|
|
|
tony
เกี๊ยวหวาน
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 6
ออฟไลน์
กระทู้: 4,079
|
 |
« ตอบ #1 เมื่อ: 03 ตุลาคม 2006, 18:28:37 » |
|
ผมกำลังเลิกใช้เทคนิคนี้ ฮาาาา
ใช้เทคนิคเนียนๆ อย่างอื่นอยู่ ลองดู
|
|
|
บันทึกการเข้า
|
ไม่ค่อยว่างมาดูเท่าไร แต่หัวใจยังกิ๊ดตึ๋ง
|
|
|
munich
สมุนแก๊งเสียว
พลังน้ำใจ: 4
ออฟไลน์
กระทู้: 845
|
 |
« ตอบ #2 เมื่อ: 03 ตุลาคม 2006, 18:31:24 » |
|
เทคนิคไรหว่า บอกได้เปล่า
|
|
|
บันทึกการเข้า
|
|
|
|
7
หัวหน้าแก๊งเสียว
พลังน้ำใจ: 16
ออฟไลน์
กระทู้: 1,353
|
 |
« ตอบ #3 เมื่อ: 03 ตุลาคม 2006, 19:18:13 » |
|
คุณ tony เทคนิคนี้มีข้อเสียอย่างไรฤา ทั้งวางภาพไว้ข้างหน้าหรือข้างหลัง
|
|
|
บันทึกการเข้า
|
|
|
|
iamnewbies
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 28
ออฟไลน์
กระทู้: 9,635
|
 |
« ตอบ #4 เมื่อ: 03 ตุลาคม 2006, 19:33:55 » |
|
PM บอกผมหน่อยจิคุณ tony อิอิ
|
|
|
บันทึกการเข้า
|
ุอิอิ พลุบๆโพล่ๆ เข้าๆออกๆ เสียวๆ
|
|
|
Yut!
Administrator
หัวหน้าแก๊งเสียว
พลังน้ำใจ: 192
ออฟไลน์
กระทู้: 1,642
|
 |
« ตอบ #5 เมื่อ: 03 ตุลาคม 2006, 19:37:08 » |
|
บอกผมด้วยนะ :oops:
|
|
|
บันทึกการเข้า
|
|
|
|
jane
หัวหน้าแก๊งเสียว
พลังน้ำใจ: 25
ออฟไลน์
กระทู้: 1,265
|
 |
« ตอบ #6 เมื่อ: 03 ตุลาคม 2006, 19:47:55 » |
|
ขอ..ด้วยคนค่ะ :wink:
|
|
|
บันทึกการเข้า
|
|
|
|
antitrust
ก๊วนเสียว
พลังน้ำใจ: 6
ออฟไลน์
กระทู้: 301
|
 |
« ตอบ #7 เมื่อ: 03 ตุลาคม 2006, 20:19:23 » |
|
ขอผมด้วยนะคร๊าบ พี่ tony 
|
|
|
บันทึกการเข้า
|
มือใหม่หัดขับ...google
|
|
|
tony
เกี๊ยวหวาน
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 6
ออฟไลน์
กระทู้: 4,079
|
 |
« ตอบ #8 เมื่อ: 03 ตุลาคม 2006, 20:37:48 » |
|
กำ มันอยู่ในช่วงทดสอบบบบบ อย่าเพิ่งเสะ :lol:
เออ ผมว่า เทคนิคนี้ มีข้อเสียคือ - เวลาโฆษณามาไม่เต็ม ตัวหนังสือมันจะใหญ่ขึ้น แล้ว รูปมันจะไม่ตรงกับหัวข้อโฆษณา ดูแล้วรู้ว่า "มันเอามาใส่ไว้ทำไม" หรือไม่ก็ "ดูพิลึกๆ" ถ้าเป็นคนทำ adsense ก็จะคิดว่า "มันจะหลอกกูคลิกรึ"
- แล้วเอามาใส่ มันจะทำให้ เว็บคุณดูแปลกๆ ไป ลองสังเกตสิ ยิ่งหารูปมาใส่ เป็นกรอบสี่เหลี่ยม สี่อัน ยิ่งแปลกๆ
คนทำได้ดี อาจจะดีไป คนทำไม่ดีนี่ เอ่อ... อาจจะค่อนไปทางซวย
|
|
|
บันทึกการเข้า
|
ไม่ค่อยว่างมาดูเท่าไร แต่หัวใจยังกิ๊ดตึ๋ง
|
|
|
benze
สมุนแก๊งเสียว
พลังน้ำใจ: 1
ออฟไลน์
กระทู้: 972
|
 |
« ตอบ #9 เมื่อ: 03 ตุลาคม 2006, 20:39:38 » |
|
บอกผมด้วยนะ
|
|
|
บันทึกการเข้า
|
|
|
|
kittop
Verified Seller
สมุนแก๊งเสียว
พลังน้ำใจ: 27
ออฟไลน์
กระทู้: 755
|
 |
« ตอบ #10 เมื่อ: 03 ตุลาคม 2006, 20:49:58 » |
|
ขอด้วยละกันครับ อยากรู้เช่นกัน
|
|
|
บันทึกการเข้า
|
|
|
|
blogger
หัวหน้าแก๊งเสียว
พลังน้ำใจ: 11
ออฟไลน์
กระทู้: 1,443
|
 |
« ตอบ #11 เมื่อ: 03 ตุลาคม 2006, 21:50:20 » |
|
ไม่ควรใส่กรอบนะครับจะได้เนียนขึ้น แต่ใส่กรอบแล้วดีตรงที่ปลอดภัยจาก gg ครับ
ทำวิธีนี้ ctr เพิ่ม 2-3 เท่าครับ ถือว่าโอนะครับ
คุณ tony jaa บอกไต๋บางดิ thank you
|
|
|
บันทึกการเข้า
|
|
|
|
bubbleball
Administrator
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 444
ออฟไลน์
กระทู้: 5,695
|
 |
« ตอบ #12 เมื่อ: 03 ตุลาคม 2006, 21:50:55 » |
|
ผมกะเก็บเป็น xml แล้วดึงใส่ flash มาแสดงผลเอาเลย แต่ไม่ใช่ภาพเรื่อยเปื่อยนะครับ เป็นภาพจากใน blog แต่ละ post นี่แหละ  วิธีนี้ได้ผลแน่นอนครับ ลองดู ตะกี้ผมเพิ่งได้ 2 คลิก 0.62 ดอล  วันก่อนกระแดะลองเอาออก ลดให้เหลือ ad อันเดียวด้านบนสุด ไม่มีคนคลิกเลย เหอๆ
|
|
|
บันทึกการเข้า
|
|
|
|
munich
สมุนแก๊งเสียว
พลังน้ำใจ: 4
ออฟไลน์
กระทู้: 845
|
 |
« ตอบ #13 เมื่อ: 03 ตุลาคม 2006, 21:55:17 » |
|
อ่า ขอวิธีคุณ bbball ด้วยครับ เผื่อจะจิ๊กวิชาบ้างครับ
|
|
|
บันทึกการเข้า
|
|
|
|
bubbleball
Administrator
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 444
ออฟไลน์
กระทู้: 5,695
|
 |
« ตอบ #14 เมื่อ: 03 ตุลาคม 2006, 22:02:23 » |
|
เดี๋ยวว่างก่อนนะครับ มันต้องเขียน action script ใน flash แต่หลักการก็โหลดไฟล์ xml มาแล้ว จับใส่อาเรย์แล้วแรนดอม url ของภาพออกมา 4 อัน หลังจากนั้นก็ใช้คำสั่งโหลดภาพ ใส่มูฟวี่คลิปที่วางไว้ 4 ตัว แค่นี้แหละครับ flash มันโหลดภาพจากภายนอกเข้ามาได้  แต่ผลลัพธ์ก็คงไม่ต่างกันมากกับใช้ js หรอกครับ
|
|
|
บันทึกการเข้า
|
|
|
|
iamnewbies
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 28
ออฟไลน์
กระทู้: 9,635
|
 |
« ตอบ #15 เมื่อ: 03 ตุลาคม 2006, 22:27:13 » |
|
สำหรับคนที่ไม่เก่ง flash นะครับ
ผมว่าใช้ GIF Animation ก็ง่ายดีนะครับ คลาสสิกดี อิอิ
|
|
|
บันทึกการเข้า
|
ุอิอิ พลุบๆโพล่ๆ เข้าๆออกๆ เสียวๆ
|
|
|
Nongkhai_tong
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 236
ออฟไลน์
กระทู้: 6,542
|
 |
« ตอบ #16 เมื่อ: 03 ตุลาคม 2006, 22:40:09 » |
|
gif animation มันจะเปลี่ยนรูปเองน่ะคับ ดูไม่ค่อยเนี้ยนเท่าไหร่แต่ถ้าใช้สคริปนั้นก็ work ดีน่ะผมว่าอะ
|
|
|
บันทึกการเข้า
|
|
|
|
blogger
หัวหน้าแก๊งเสียว
พลังน้ำใจ: 11
ออฟไลน์
กระทู้: 1,443
|
 |
« ตอบ #17 เมื่อ: 04 ตุลาคม 2006, 18:40:14 » |
|
แล้วจะหา file rotate.php ได้จากไหนครับ ผมลอง save rotate.txt มา แต่พอเปลี่ยนเป็น php มันดันเป้น rotate.php.txt อะคับ
|
|
|
บันทึกการเข้า
|
|
|
|
Nongkhai_tong
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 236
ออฟไลน์
กระทู้: 6,542
|
 |
« ตอบ #18 เมื่อ: 04 ตุลาคม 2006, 18:42:25 » |
|
แล้วจะหา file rotate.php ได้จากไหนครับ ผมลอง save rotate.txt มา แต่พอเปลี่ยนเป็น php มันดันเป้น rotate.php.txt อะคับ ง่าย ๆคับ ก็ copy โค๊ดที่อยู่ใน rotate.txt แล้วเปิด Dreamwever สร้างไฟล์ใหม่แล้วก็ past จากนั้นก็ save เป็น php ได้หนิคับ :lol:
|
|
|
บันทึกการเข้า
|
|
|
|
blogger
หัวหน้าแก๊งเสียว
พลังน้ำใจ: 11
ออฟไลน์
กระทู้: 1,443
|
 |
« ตอบ #19 เมื่อ: 04 ตุลาคม 2006, 19:01:18 » |
|
แล้วจะหา file rotate.php ได้จากไหนครับ ผมลอง save rotate.txt มา แต่พอเปลี่ยนเป็น php มันดันเป้น rotate.php.txt อะคับ ง่าย ๆคับ ก็ copy โค๊ดที่อยู่ใน rotate.txt แล้วเปิด Dreamwever สร้างไฟล์ใหม่แล้วก็ past จากนั้นก็ save เป็น php ได้หนิคับ :lol: ขอบคุงคับ
|
|
|
บันทึกการเข้า
|
|
|
|
jane
หัวหน้าแก๊งเสียว
พลังน้ำใจ: 25
ออฟไลน์
กระทู้: 1,265
|
 |
« ตอบ #20 เมื่อ: 29 ตุลาคม 2006, 00:31:33 » |
|
ไม่ควรใส่กรอบนะครับจะได้เนียนขึ้น แต่ใส่กรอบแล้วดีตรงที่ปลอดภัยจาก gg ครับ ทำวิธีนี้ ctr เพิ่ม 2-3 เท่าครับ ถือว่าโอนะครับ
คุณ tony jaa บอกไต๋บางดิ thank you ถ้าไม่ใส่กรอบแล้วผิดกฎเหรอคะ :?: :roll: พอดีกำลังทำแบบไม่ใส่กรอบอยู่น่ะค่ะ
|
|
|
บันทึกการเข้า
|
|
|
|
bubbleball
Administrator
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 444
ออฟไลน์
กระทู้: 5,695
|
 |
« ตอบ #21 เมื่อ: 29 ตุลาคม 2006, 01:25:17 » |
|
ถ้าไม่ใส่กรอบ ให้เว้นระยะพอประมาณกำลังดีครับ
|
|
|
บันทึกการเข้า
|
|
|
|
iamnewbies
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 28
ออฟไลน์
กระทู้: 9,635
|
 |
« ตอบ #22 เมื่อ: 29 ตุลาคม 2006, 10:09:10 » |
|
|
|
|
บันทึกการเข้า
|
ุอิอิ พลุบๆโพล่ๆ เข้าๆออกๆ เสียวๆ
|
|
|
iamnewbies
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 28
ออฟไลน์
กระทู้: 9,635
|
 |
« ตอบ #23 เมื่อ: 29 ตุลาคม 2006, 10:09:25 » |
|
<?php
/*
AUTOMATIC IMAGE ROTATOR Version 2.2 - December 4, 2003 Copyright (c) 2002-2003 Dan P. Benjamin, Automatic, Ltd. All Rights Reserved.
http://www.hiveware.com/imagerotator.php http://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 (you're them reading now) - Significant speed improvements - More error checking - Cleaner code (albeit more PHP-specific) - 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 (such as no images being found in the specified folder) *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 (most users can ignore that part). 3. Upload this file (rotate.php) 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:
<img src="http://example.com/rotate.php">
5. You can also specify the image to display like this:
<img src="http://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: $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: PDF Files:
$extList['pdf'] = 'application/pdf'; CSS Files:
$extList['css'] = 'text/css';
You can even serve up random HTML files:
$extList['html'] = 'text/html'; $extList['htm'] = 'text/html';
Just be sure your mime-type definition is correct!
*/
$extList = array(); $extList['gif'] = 'image/gif'; $extList['jpg'] = 'image/jpeg'; $extList['jpeg'] = 'image/jpeg'; $extList['png'] = 'image/png';
// You don't need to edit anything after this point.
// --------------------- END CONFIGURATION -----------------------
$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); } }
?>
|
|
|
บันทึกการเข้า
|
ุอิอิ พลุบๆโพล่ๆ เข้าๆออกๆ เสียวๆ
|
|
|
EThaiZone
เจ้าพ่อโลลิค่อน
เจ้าพ่อบอร์ดเสียว
พลังน้ำใจ: 321
ออฟไลน์
กระทู้: 12,518
|
 |
« ตอบ #24 เมื่อ: 29 ธันวาคม 2006, 07:37:35 » |
|
... จะเอายาวๆ ทำไมน้อครับ ในเมื่อสุ่มแค่รูปภาพนิ <?php //PHP Code : Random Picture In Folder //Writed by : EThaiZone.Com //Contact us : [email protected]
//แก้เป็นชื่อโฟลเดอร์ที่เก็บรูปภาพ มี / ปิดท้ายด้วย $path = "images/adsense/";
$path2 = realpath($path); $flist = opendir($path2); $list = array(); while (false !== ($mfile = readdir($flist))) { $list = array_merge((array)$list, (array)$mfile); } sort($list); array_splice($list, 0, 2); $img =array_rand($list); $img = $list[$img]; header('Content-type: image/jpeg'); @readfile("$path$img"); ?> วิธีใช้งานสุดๆ แก้ $path ให้เป็นโฟลเดอร์ที่เก็บรูปภาพ ภายในนั้นต้องมีแต่ภาพนะครับ (ผมเขียนให้สั้นที่สุด จึงไม่มีระบบเช็คนามสกุล) แล้วก็ใช้งานได้เลย ตัวอย่าง (ดูแล้วจะรุ้ว่าต้องอัพไฟล์ และใช้อย่างไร) ip.ethaizone.com/picture.php ip.ethaizone.com/images/adsense/ ไม่เห็นกระทู้นี้ ไม่งั้นก็เอาโค้ดมาโพสนานแล้ว ความจริงเขียนไว้นานแล้วแหละ แต่ไม่นึกว่ามีคนคิดเหมือนกัน
|
|
|
บันทึกการเข้า
|
|
|
|
|
หน้า: 1 2 [ทั้งหมด] ขึ้นบน |
|