ทำ menu แบบ youtube

  • warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 1005 is not allowed to access /tmp owned by uid 0 in /var/www/sites/sugree/codenone.com/subdomains/www/html/includes/file.inc on line 190.
  • warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 1005 is not allowed to access /tmp owned by uid 0 in /var/www/sites/sugree/codenone.com/subdomains/www/html/includes/file.inc on line 190.

สงสัยว่าจะใช้ module อะไรบ้างใช้ทำ menu ทางซ้ายมือของ youtube ครับ แบบให้ link กับ view ได้

ที่เป็นการกำหนด
browse เป็น sort by
time เป็น time filter
category เป็น category filter

ตัวอย่าง

Videos
------------------------------------------
Browse
-Most Recent
-Most Viewed
-Top Rated
-Most Discussed
-Top Favorited
-Most Linked
-Recently Featured
-Most Responded
-Watch on Mobile

Time
-Today
-This Week
-This Month
-All Time

Category
-All
-Autos & Vehicles
-Comedy
-Entertainment
-Film & Animation
-Gadgets & Games
-Howto & DIY
-Music
-News & Politics
-Music

sugree's picture

ถ้าทำ View ไว้แล้วเขียนบล็อคเองจะง่ายกว่ามั๊งครับ

เขียนบล็อคแบบไหนดีครับ ช่วยแนะนำหน่อยครับ ขอบคุณมากครับที่ให้คำปรึกษา

mk's picture

ถ้าอยากได้เป็น list อย่างเดียว (พร้อม thumbnail หรือดาว) ใช้ Views ก็น่าจะไม่ยากนะครับ

มันยากตรงที่ menu มันไม่ support การทำ multi-select นะครับ

เท่าที่นึกได้ตามที่คุณ sugree แนะนำ คือต้องสร้าง View ให้รับ parameter

เช่น /videos/$category/$time/$sortby/$page

โดยใช้วิธีการใส่ PHP Code ลงไปใน Argument Handling Code ของ Views

แล้วให้สร้าง Block (PHP code) ให้ทำ list มา 3 ชุดโดยแต่ละชุดจะต้องคำนวน Active menu จากค่าตามช่องต่างๆที่อยู่ใน URL

เช่น ถ้า $time = 'Today' ก็ให้ Today นั้น active

ปัญหาคือ ผมนั้นมือใหม่มากๆ ครับ ไม่รู้จะเขียน PHP code ยังไง ช่วยทีนะครับ ขอบคุณครับ

sugree's picture

อ๋อ อยากได้แบบนี้เหรอ ถ้าต้องการแบบนี้ผมว่าเขียนเป็นโมดูลจะง่ายกว่า ดูแล้วไม่ยากนะ

ย้าย Codenone

ประกาศย้าย Codenone ไปใช้ Forum ของ Blognone แทนครับ ตามไปตั้งกระทู้ต่อได้ที่ Codenone Forum (รายละเอียดอ่านจากกระทู้ ย้าย Codenone ไปรวมกับ Blognone)

กระทู้เก่าๆ จะย้ายตามไปในภายหลัง ตอนนี้ปิดการโพสต์กระทู้ไว้ เหลือไว้เฉพาะอ้างอิงเท่านั้น