Jan 06

Tags: , , ,

อยากมี twitter มาติดเว็บไหม เอาแบบเท่ห์ เช่น http://digg.meemarket.com

คำตอบคือ twitter widget ครับ จาก digg ตัวอย่างข้างต้น แก้ไข pligg นิดนึง ทำแบบนี้ครับ

แก้ไข
1. file index.php ของ pligg เรา (folder บนสุดของ pligg) แก้ไฟล์นี้เสีย

ประมาณบรรทัด 125 จัดการแทรก โค๊ด

$twitter = “<script src=’http://widgets.twimg.com/j/2/widget.js’></script>
<script>
new TWTR.Widget({
  version: 2,
  type: ‘profile’,
  rpp: 5,
  interval: 6000,
  width: ‘auto’,
  height: 300,
  theme: {
    shell: {
      background: ‘#faf5fa’,
      color: ‘#080808′
    },
    tweets: {
      background: ‘#faf5fa’,
      color: ‘#000000′,
      links: ‘#70736e’
    }
  },
  features: {
    scrollbar: false,
    loop: false,
    live: false,
    hashtags: true,
    timestamp: true,
    avatars: false,
    behavior: ‘all’
  }
}).render().setUser(’amzstore’).start();
</script>”;
$main_smarty->assign(’twitter’, “$twitter”);

2. ไปแก้ที่ template ของเรา ยกตัวอย่างของผม template season ก็ไปที่ templates/season/slidebar2.tpl

เพิ่มที่บรรทัดสุดท้าย
{$twitter}

แล้ว upload ชื่นชมผลงานของตัวเองครับ อ้ออย่าลืมเปลี่ยน user เป็นของตัวเองนะครับ amzstore ก็เปลี่ยนเป็นของตัวท่าน จากโค๊ดด้านบนน่ะ ไม่งั้นท่านจะได้แต่โฆษณาขายของ ของกระผมครับ

code ก็ปรับแต่งได้ ตัวอย่าง gen มาจาก
http://twitter.com/badges

จริงๆ แล้วมันมีเว็บที่ช่วยเยอะมากๆ ตามลิสต์เลยครับ
http://mashable.com/2009/03/30/twitter-badges/

  • Share/Bookmark

58 Responses to “จับ twitter มาใส่เว็บทำยังไง”

  1. get taller says: |

    Nice news, I want say thanks to writer coz’ i’ve read here a lot exciting info. Keep it going! :) . Best regards

  2. veneers lumineers says: |

    You have a style of explaining things, which is really straightforward. Thank you for clear and concise details.

  3. Eldon Salwasser says: |

    Hello – Nice site, just browsing around some pages, it looks to be a pretty nice looking theme you are using here. I am currently using WordPress to run some of my web sites but looking to change one of these over to a platform the same as yours just for a trial run. Anything in particular you may suggest about it?

  4. Jamal Paetz says: |

    Try coupon code “onecentcoupons” – HostGator hosting one month for free during ordering.

  5. Cecile Beldon says: |

    Thank you! I consistently bare to address on my website something like that. Can I apparatus a allocation of your column to my blog?

  6. Lavon Andere says: |

    It will depend on how you look at it and where that you’re coming from on the subject really. Ultimately beauty is in the eye of the beholder, but Now i am with you on this one.

  7. Cheap Levaquin says: |

    If you’re still on the fence: grab your favorite earphones, head down to a Best Buy and ask to plug them into a Zune then an iPod and see which one sounds better to you, and which interface makes you smile more. Then you’ll know which is right for you.

  8. track bags says: |

    I found here something new and interesting. Thanks