telugu films released in 2010 : date-wise

0 comments
Release DateMovie
January 01Allam Vellulli
 Comedy Express
 Desadrohi
 Maa Nanna Chiranjeevi
 Madhubala
 Premistu
 Yugalageetham
  
January 13Adurs
 Om Shanti
  
January 14Namo Venkatesa
 Sambo Siva Sambho
  
January 20Ninu Veedani Needanu Nenu
 Sivangi
  
January 22Kaluva
 Seetharamula Kalyanam
  
January 23Udatha Udatha Ooch
  
January 29Sorry Maa Aayana Intlone Unnadu
  
January 30Mayabazar [ colour ]
  
February 02Nonstop
  
February 05Bindaas
 Striker
  
February 12Kedi
 Tejam
  
February 19Leader
  
February 20Joy
  
February 26Inkosari
 Kalavar King
 Rambabu Gadi Pellam
 Sneham
 Ye Maaya Chesaave
  
March 05High School
 Saadhyam
  
March 12Aakasa Ramanna
 Dasanna
 Lenin
 Prem Rajyam
 Tik Tik Tik
 Vasool Rani
  
March 19Dammunnodu
 Kantri Mogudu
 Lahore
 Yaagam
  
March 20Indhu
 Sandadi
 Taj Mahal
  
March 25Maro Charitra
  
March 26Dopidi
  
March 31Varudu
  
April 02Anaganaga Oka Aranyam
 Srimati Kalyanam
  
April 08Mouna Ragam
  
April 09Police Police
 Betting Bangarraju
  
April 10Big B
  
April 161940 Lo Oka Gramam
 1977
 Aavaham
 Madhanudu
 Phoonk 2
 Prasthanam
  
April 23Darling
 Neeku Naaku
 Sarvam
  
April 30Buridi
 Dhoom Dham
 Glamour
 Simha
  
May 07Cara Majaka
 Hasini
 My Name Is Amrutha
 Okka Kshanam
 Super Cowboy
  
May 12Rama Rama Krishna Krishna
  
May 14Aaha Entha Andam
 Andari Bhanduvayya
  
May 15Theliyadhu
 Young India
  
May 20Chalaki
  
May 21Aawara
  
May 27Golimaar
  
May 28Joru
  
June 04Vedam
  
June 11Manava Mrugam
 Osey Mallamma
 Panchakshari
  
June 14Nagamani
  
June 18Villain
  
June 25Alladista
 Andhra Kiran Bedi
 L-Board
 Pappu
  
July 01Jhummandi Naadam
  
July 02Komaram Bheem
 Yamudu
  
July 09Bheemili
 Mosagallaku Mosagadu
 Mynavathi
 Veera Telangana
  
July 16Em Pillo Em Pillado
 Sneha Geetham
 Subhapradam
 U And I
  
July 23Maryada Ramanna
 Preminchina Kothalo
 Varasudochadu
  
July 29Brahmalokam To Yamalokam
  
July 30Allam Bellam
 Kothimooka
  
July 31Maa Annayya Bangaram
  
August 03Subhodayam
  
August 06Don Seenu
  
August 10Ready For Dhee
  
August 13Badmaash
 Lawrence
 Sye Aata
  
August 19Chapter 6
  
August 20Happy Happy Ga
 Ramdev
  
August 27Aunty Uncle Nandagopal
 Chethilo Cheyyesi
 Gudu Gudu Gunjam
 Premistava
  
September 02Bhageerathudu
  
September 03Gaayam 2
 Takita Takita
  
September 10Komaram Puli
  
September 17Adi Nuvve
 Periyar Ramaswamy Nayakar
 Saradaga Kasepu
  
September 24Bhairava
 Mada Mrugam
  
October 01Robo
  
October 07Mahesh Khaleja
  
October 14Brindaavanam
  
October 22Priyamaina Anjali
 Rakhta Charitra
  
October 29Baava
 Prathi Roju
  
November 05Collector Gaari Bharya
 Vayuputra
  
November 06Shopping Mall
  
November 12Kalyanram Kathi
 Yemaindi Eevela
  
November 13Ballem
  
November 26Karma
 Orange
  
December 03Alasyam Amrutham
 Anthima Theerpu
 Rakta Charitra 2
  
December 10Kathi Kantha Rao
 Manasara
  
December 16Nagavalli
  
December 17Nene Ambani
  
December 24Ragada
  
December 30Ranga The Donga
  
December 31Broker
 Neti Charitra
  
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

tamil films released in 2010 : date-wise

0 comments
Release dateMovie
January 01Nil Kavani Ennai Kadhali
 Raja Leelai
 Pugaipadam
 Thunichal
  
January 08Kalasaaram
  
January 14Naanayam
 Aayirathil Oruvan
 Kutty
 Porkkalam
  
January 29Thairiyam
 Jaggubhai
 Kathai
 Tamil Padam
 Goa
  
February 05Asal
  
February 12Kumari Pennin Ullathile
 Rasikkum Seemane
 Theeratha Vilayattu Pillai
  
February 18Makkal Thalapathi
  
February 19Azhukkan
 Dhana
  
February 26Vinnaithaandi Varuvaaya
 Innisai Kavalan
  
March 05Thambikku Intha Ooru
 Veera Sekaran
 Aval Peyar Tamilarasi
  
March 07Kurukku Puthi
  
March 12Yathumagi
 Karunai
 Azhagana Ponnuthan
 Maathiyosi
  
March 19Kacheri Aarambam
 Julie
 Mundhinam Paarthene
  
March 26Angadi Theru
 Padaga Salai
  
April 02Paiya
  
April 09Sivappu Malai
 Ragasiya Sinegithi
  
April 16Kadhal Meipada
  
April 23Bhayam Ariyaan
 Pattu Vanna Rosavam
 Rettaisuzhi
  
April 30Sura
  
May 07Guru Sishyan
 Goripalayam
 Kutty Pisasu
 Irumbu Kottai Murattu Singam
  
May 14Maa
  
May 21Maanja Velu
 Kutra Pirivu
 Kanagavel Kakka
 Magane En Marumagane
 Kola Kolaya Mundhirika
  
May 28Kadhalagi
 Katrathu Kalavu
 Singam
  
June 03Pen Singam
  
June 04Enakka Mani Unakka
  
June 11Orr Eravu
 Drogam Nadanthathu Enna
 Pa Ra Palanisamy
  
June 18Raavanan
  
June 24Tittakkudi
  
June 25Milaga
 Kalavani
 Unakkaga Oru Kavithai
July 02Ambasamudram Ambani
 Veluthu Kattu
 Pournami Naagam
  
July 09Madharasapattinam
 Ananthapurathu Veedu
  
July 12Antharangam
  
July 16Devaleelai
 Pollachi Mappillai
 Virundali
  
July 23Thillalangadi
 Vizhiyil Vizhundhaval
 Singamugam
  
July 30Thambi Arjuna
 Ilakkana Pizhai
 Aaravadhu Vanam
  
August 06Pesuvathu Kiliya
 Baana Kaathadi
  
August 13Vamsam
 Kaadhal Solla Vandhen
 Androru Naal
 Mandabam
  
August 20Naan Mahaan Alla
 Kaipesi Yen
 Inidhu Inidhu
  
August 27Puthumugam
 Moscowin Kaveri
 Vilai
 Ramar
 Neeyum Naanum
 Unakkaka En Kadhal
  
September 03Bale Pandiya
 Ragasiyam
 Sindhu Samaveli
 Puzhal
 Irandu Mugam
  
September 10Drohi
 Maruthani
 Boss Engira Baskaran
 Kuyil
 Thirupur
  
September 17Sivappu Samy
 Vande Mataram
 Panchamugi
 En Kanmani Priya
 Valibame Va
  
September 24row 2, cell 2
  
September 29Singa Vettai
  
October 0

1
Endhiran
  
October 15Gouravargal
 Naane Ennul Illai
 Ochaayee
 Thottuppaar
  
October 22Ithu Kadhal Uthirum Kaalam
 Mattuthavani
 Hisss
 Thangapaambu
 Aarvam
  
November 05Chithira Poove
 Vallakottai
 Mynaa
 Va Quarter Cutting
 Uthama Puthiran
  
November 19Unnaiye Kadhalipen
 Magizhchi
 Nagaram Marupakkam
 Mandhira Punnagai
  
November 26Nandhalala
 Kanimozhi
  
December 03Agarathi
 Chikku Bukku
 Rattha Charithram
 Thaa
  
December 10Agam Puram
 Ayyanar
 Sanikizhamai Sayangalam 5 Mani
 Mittai
 Sidhu + 2 First Attempt
 Viruthagiri
  
December 17Aattanayagan
 Eesan
 Nil Gavani Sellathey
 Vaada Poda Nanbargal
  
December 23Manmadhan Ambu
  
December 24Aridhu Aridhu
 Bhavani IPS
 Gandhipuram
 Nellu
 Thenmerku Paruvakatru
  
December 31Kotti
 Mudhal Kadhal Mazhai
 Nalamdhana
 Puthiya Thalapathy
 Thambikkottai
 Thirupachi Aruva
 Villaalan
  
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

malayalam films released in 2010 : date-wise

0 comments
Release date Movie
January 08 Black Stallion
  Kanmazha Peyyum Munpe
   
January 14 Happy Husbands
   
January 22 Brahmastram
  Punyam Aham
   
January 23 Bodyguard
   
January 27 Drona 2010
   
January 29 Senior Mandrake
   
January 30 Thathwamasi
   
February 05 Yugapurushan
   
February 12 Aagathan
  Twinkle Twinkle Little Star
   
February 19 Annarakannanum Thannalayathu
  Sufi Paranja Katha
   
February 26 Cheriya Kallanum Valiya Policum
   
March 05 Nanthuni
  Valiyangadi
   
March 06 Kaustubham
   
March 12 Rhytham
   
March 19 Nayakan
  Thanthonni
   
March 25 In Ghost House Inn
   
March 26 Kadaksham
  Kayam
  Pramani
   
April 01 April Fool
   
April 08 Janakan
   
April 14 Pappy Appacha
   
April 15 Pulliman
   
April 22 T.D. Dasan Standard V1 B
   
May 07 Alexander The Great
  Kadha Thudarum
  Pokkiriraja
   
May 14 Canvas
   
May 21 Caribbeans
  Mummy & Me
   
June 04 Ring Tone
   
June 21 Thoovalkattu
   
June 25 Nalla Pattukare
   
June 27 Text Book
   
July 09 Nallavan
  Oru Naal Varum
  Varan
   
July 16 Apoorvaragam
  Malarvadi Arts Club
   
July 23 Kutty Srank : The Sailor of Hearts
  Sakudumbam Shyamala
   
July 29 Penpattanam
   
July 30 Advocate Lakshmanan : Ladies Only
  Avan
  Rama Ravanan
  Thaskara Lahala
   
August 06 Ammanilavu
   
August 13 Patham Adhyayam
  Plus Two
   
August 20 3 Char Sau Bees
  Athma Kadha
  Neelambari
  Pattinte Palazhi
  Yakshiyum Njanum
   
August 27 9 KK Road
  Fiddle
  Nirakazhcha
   
September 03 24 Hours
  Inganeyum Oral
  Orange
   
September 09 Shikkar
   
September 10 Elsamma Enna Aankutty
  Pranchiyettan And The Saint
   
September 17 Vande Matharam
   
October 08 Chekavar
  Oridathoru Postman
   
October 15 Anwar
   
October 22 Cocktail
  Sadgamaya
   
October 28 Four Friends
   
November 05 Chithrakuzhal
  Kaaryasthan
   
November 12 Holidays
  Pathinonnil Vyazham
   
November 17 Best Of Luck
  The Thriller
   
November 19 College Days
  Kanyakumari Express
  Koottukar
  Pathinonnil Vyazham
   
November 26 Oru Small Family
  Swantham Bharya Zindabad
   
December 03 Again Kasargod Kadar Bhai
  Sahasram
   
December 09 Best Actor
   
December 10 Chaverpada
   
December 16 Kandahar
   
December 25 Marykkundru Kunjaadu
  Tournament
   
December 31 Karayilekoru Kadal Dooram
  Puthumukhangal
   
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

kannada films released in 2010 : date-wise

0 comments
Release dateMovie
January 01Police Quarters
 Minugu
 Nan Madidh Thappa ?
  
January 08Samagama
 Preethiya Theru
  
January 14Suryakanthi
  
January 22Anishchitha
 School Master
January 28Porki
  
January 29Aparadhi
 Ku Ku
 Nirantara
  
February 05Just Math Mathalli
 Kolminchu
 Yaare Nee Devathe
  
February 12Crazy Kutumba
 Vimukti
  
February 19Aptharakshaka
 Belli Modadha Ambara
 Mukhaputa
  
February 26Varshadhaare
 Sugreeva
 Jugaari
  
March 03Janani
  
March 05Preethi Nee Shashwathana
 Nanna Olavina Banna
  
March 12Sihigaali
 Shri Harikathe
  
March 19Dildar
 Swayamvara
  
March 26Nirdoshi
 Just Pass
  
April 02Satya
 Thipparalliya Tarlegalu
 Premism
  
April 09Krishna Nee Late Aag Baro
 Parole
 Kiladi Krishna
  
April 23Antharathma
 Prithvi
  
April 30Preethi Nee Heegeke
 Ijjodu
 Ullasa Utsaha
  
May 07Bombat Car
 Abhiram
  
May 14Preethiyinda Ramesh
 Tharangini
 Naanu Nanna Kanasu
  
May 21Nooru Janmaku
 Shankar IPS
  
May 28Nannavanu
 Khadak
  
June 04Aithalakkadi
 Hoo
  
June 10Sri Moksha
  
June 11Thamassu
  
June 16Mr. Theertha
  
June 18Punda
 Krishan Love Story
  
June 25Joteyagi Hitavagi
  
July 02Holi
 Zamana
 Parikshe
 Preethi Andre Ishtena
 Hendtheer Darbar
  
July 09Jayahe
 Eradane Maduve
 Olave Vismaya
  
July 16Sanchari
 Lift Kodla
  
July 23Meshtru
 Nam Areal Ondina
 Banni
  
July 30Chandulli Cheluve
 Gurukula
 Gurukula
 18th Cross
 Nee Bandu Nintaaga
 Idre Gopi Bidre Papi
  
August 06Matte Mungaru
 Shambho Shankara
 Thaare
 Gang Leader
  
August 13Jokali
 Deadly 2
  
August 20Shourya
  
August 27Hunja
 Preeti Hungama
  
September 03Narada Vijaya
 Kari Chirathe
 Onti Mane
 Pancharangi
  
September 09Nanjanagudu Nanjunda
  
September 10Jothegara
  
September 17Appu And Pappu
  
September 24Gubbi
 Yakka
  
October 01Hrudayadali Idenidu
  
October 14Jackie
  
October 15Kiccha Huccha
  
October 22Sandalwood Guru
 Vichitra Premi
  
October 29Gundragovi
 Veera Parampare
 Gaana Bajaana
  
November 05Shock
 Bindaas Hudugi
  
November 12Eno Onthara
 Huduga Hudugi
  
November 19Chiru
 Aarbhata
November 26Naariya Seere Kadda
 Bisile
  
December 03Super (Symbol)
  
December 10Naa Raani Nee Maharani
  
December 17Huli
 Nayaka
 Rame Gowda Vs Krishna Reddy
  
December 24Mylari
 Sri Naga Shakti
  
December 31Modala Sala
 Prince
  
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

hindi films released in 2010 : date-wise

0 comments
Release dateMovie
January 08Dulha Mil Gaya
 Hello Hum Lallann Bol Rahe Hain
 Pyaar Impossible !!!!!
  
January 15Bhavnao Ko Samjho
 Chance Pe Dance
 Hello Hum Lallan Bol Rahe Hain
 The Waiting Room
  
January 22Veer
  
January 29Fired
 Ishqiya
 Rann
 Road To Sangam
  
February 05Phaans
 Striker
  
February 12My Name Is Khan
 Pyaar Kaa Fundaa
 Sukhmani – Hope for Life
  
February 19Aakhari Decision
 Click
 Toh Baat Pakki !!!!!
  
February 26Karthik Calling Karthik
 Prem Kaa Game
 Teen Patti
  
March 05Atithi Tum Kab Jaoge ?
 Hello Zindagi
 Road , Movie
 Rokkk
 Thanks Maa
  
March 12Do Dilon Ke Khel Mein
 Hide & Seek
 Na Ghar Ke Na Ghaat Ke
 Right Ya Wrong
 Swaha
 Trump Card
  
March 19Hook Ya Crook
 Idiot Box
 Lahore
 LSD : Love Sex Aur Dhokha
 Mittal Vs Mittal
 Shaapit
  
March 25Bohlol Dana - A Sage of Baghdad
  
March 26Hum Tum Aur Ghost
 Its A Man's World
 Muskurake Dekh Zara
 My Friend Ganesha 3
 Well Done Abba
  
April 02Pankh
 Sadiyaan
 The Great Indian Butterfly
 Tum Milo Toh Sahi
  
April 09Jaane Kahan Se Aayi Hai !
 Prince
 The Japanese Wife
  
April 16Get Educated : Paathshaala
 Phoonk 2
  
April 23Apartment
 Bird Idol
 City Of Gold
 Ek Second ..... Jo Zindagi Badal De ?
 Kuchh Kariye
 Musaa
  
April 30Chase
 Housefull
  
May 07Badmaa$h Company
 Its A Wonderful Afterlife
  
May 14Admissions Open
 Bal Hanuman 2
 Bumm Bumm Bole
 Kushti
 Vroom
  
May 21Kites
  
May 28Ashok Chakra
  
June 04Raajneeti
  
June 11The Camp
  
June 18Raavan
  
June 25Krantiveer : The Revolution
 Love.Com
 Mr Singh Mrs Mehta
 Peter Gaya Kaam Se
  
July 02I Hate Luv Storys
  
July 09Milenge Milenge
 Red Alert - The War Within
  
July 16Lamhaa : The Untold Story of Kashmir
 Tere Bin Laden
 Udaan
  
July 23Khatta Meetha
 Mumbai Cutting
  
July 30Once Upon A Time In Mumbaai
  
August 06Aisha
  
August 13Help
 Peepli Live
  
August 20And Once Again
 Lafangey Parindey
 Kis Hudh Tak
 Mr Bhatti on Chutti
  
August 27Aashayein
 Antardwand
 Gumshuda
 Hello Darling
 Madholal Keep Walking
  
September 03Mallika
 The Film Emotional Atyachar
 We Are Family
  
September 10Dabangg
  
September 17Life Express
  
October 01Aakrosh
 Anjaana Anjaani
 Benny And Babloo
 Khichdi : The Movie
 The Robot
  
October 08Bachao - Inside Bhoot Hai .....
 Crook
 Do Dooni Chaar
 Lava Kusa
 Phillum City
  
October 15

Knock Out
 Ramayana : The Epic
  
October 22Dus Tola
 Hisss
 Jhootha Hi Sahi
 Mirch
 Nakshatra
 Paan Singh Tomar
 Rakhta Charitra
  
October 29Be Careful
 Daayen Ya Baayen
 Malik Ek
 Nakshatra
  
November 05Action Replayy
 Golmaal 3
  
November 12A Flat
 Diwangi Ne Had Kar Di
 Dunno Y Na Jaane Kyun
 Ramaa : The Saviour
  
November 19Guzaarish
 Shahrukh Bola 'Khoobsurat Hai Tu'
  
November 25Break Ke Baad
  
November 26Allah Ke Banday
 PayBack
 Spanish Beauty
  
December 03332 Mumbai To India
 Khelein Hum Jee Jaan Sey
 Phas Gaye Re Obama
 Rakta Charitra II
  
December 10Band Baaja Baaraat
 No Problem
  
December 17332 Mumbai To India
 Kaalo
 Mirch
 Payback
  
December 24Ada ..... A Way Of Life
 Isi Life Mein
 Tees Maar Khan
 Toonpur Ka Superrhero
  
December 31Bhoot And Friends
 Tera Kya Hoga Johny
  
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to check plugin existence

0 comments
source : wp-hackers digest # 66,98,5,6,8;107,6.

[ A ] :
<?php
if (is_plugin_active('plugin-directory/plugin-file.php')) {
//plugin is activated
}
?>

[ B ] : Checking for function or class existence is also a solid solution, one I would probably use over is_plugin_active().

[ C ] : If you're building plugins that depend on others, then it is best to attach the initialization of the sub-plugin to a hook in the parent plugin. Then the sub-plugin will noop if the parent plugin is not activated. BuddyPress does this. Of course, that means the parent plugin needs to have hooks in place for that.

[ D ] : Just hook your function to plugins_loaded and check for a function or class name.

function check_for_plugin()
{
if( function_exists('some_function') )
do_something();
}
add_action('plugins_loaded', 'check_for_plugin');
is_plugin_active() requires a folder and a file name, and those might not be the same on all WP installations.

[ E ] : also a great solution is the core fucntion : http://codex.wordpress.org/Function_Reference/is_plugin_active

[ F ] : Is the "master" plugin yours or someone else's ? If you can add code to the master, I would add a do_action hook that loads sub-plugins, and an add_action to the sub-plugin that initializes the plugin. Thus it initializes when the master plugin calls for its sub-plugins.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to specify the menu term_id in wp_query

0 comments
source : wp-hackers digest # 66,112,4.

post_id = $_GET['post'];
$menu_id = $_GET['menu'];

$term = get_term($menu_id, 'nav_menu');

$menu_items = new WP_Query(
array(
'post_type'   => 'nav_menu_item',
'post_status' => 'any',
'meta_key'    => '_menu_item_object_id',
'meta_value'  => $post_id,
'showposts'   => -1,
'taxonomy'    => 'nav_menu',
'term'        => $term->slug,
)
);

The key thing to notice is that the menu item post records were related both via post meta ( which you figured out ) but also via the "nav_menu" taxonomy by term slug ( which you hadn't included. ) At first I thought it wasn't going to be possible to do it with WP_Query() but after inspecting the SQL I wrote I realized it was indeed possible, at least what I understood that you needed.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

show all posts of a taxanomy

0 comments
source : wp-hackers digest # 66,102,1;105,7.

[ A ] Question about showing all posts of a taxonomy, this is a problem I ran into as well, and searched for a long time and found it very hard to figure out.

What I managed to do is list all terms for a taxonomy, and all the posts for each term individually. You may be able to hack this to do what you're trying to do since it is the same as what I needed to do I just didn't have time to make it list only the posts for the taxonomy.

<?php
// Create list of taxonomy terms and list the posts under each term
$post_type = 'post';
$tax = 'your_custom_taxonomy';
$tax_terms = get_terms( $tax );
if ($tax_terms) {
foreach ($tax_terms  as $tax_term) {
$args = array(
'post_type' => $post_type,
"tax" => $tax_term->slug,
'post_status' => 'publish',
'posts_per_page' => -1,
'caller_get_posts'=> 1
);

$my_query = null;
$my_query = new WP_Query($args);

if( $my_query->have_posts() ) : ?>

<h2 class="breadcrumb">All <?php echo $tax; ?> Posts For <?php
echo $tax_term->name; ?></h2>
<ul class="taxlist">
<?php while ( $my_query->have_posts() ) : $my_query->the_post();
?>

<li id="post-<?php the_ID(); ?>">
<a href="<?php the_permalink(); ?>" rel="bookmark"
title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title();
?></a>
</li>


<?php endwhile; // end of loop ?>
</ul>

<?php if( function_exists('wp_pagenavi')) { wp_pagenavi(); }
else { ?>
<div class="navigation clearfix">
<div class="alignleft"><?php next_posts_link('&laquo;
Previous Entries') ?></div>
<div class="alignright"><?php previous_posts_link('Next
Entries &raquo;') ?></div>
</div>
<?php } ?>

<?php else : ?>

<h2 class="title">Oops</h2>
<p>Looks like something is missing...</p>

<?php endif; // if have_posts()
wp_reset_query();

} // end foreach #tax_terms
}
?>

[ B ] I was intrigued to find a solution for "taxonomy=clients" and "term=any" where "any" is a wildcard ( WP_Query() supports "any" as a wildcard for post_types but not for terms of a taxonomy. )

Here's a hook that adds an "any" wildcard for terms for a taxonomy assuming some other plugin didn't muck with the " AND 0 " inserted into the WHERE clause when a taxonomy term doesn't match :

add_action('posts_where','my_posts_where',10,2);

function my_posts_where($where,$query) {
if (isset($query->query_vars['taxonomy']) && $query->query_vars['term']=='any') {
global $wpdb;
$tt = $wpdb->term_taxonomy;
$tr = $wpdb->term_relationships;
$where .= $wpdb->prepare(" AND {$wpdb->posts}.ID IN (
SELECT object_id FROM $tr
INNER JOIN $tt ON $tt.term_taxonomy_id = $tr.term_taxonomy_id
WHERE $tt.taxonomy=%s) ",$query->query_vars['taxonomy']);
$where = str_replace(' AND 0 ','',$where);
}
return $where;
}


Your query for this would look like this :

$posts = new WP_Query("post_type=portfolio_item&taxonomy=clients&term=any&posts_per_page=-1");

OR

$posts = new WP_Query(array(
'post_type' => 'portfolio_item',
'taxonomy' => 'clients',
'term' => 'any',
'posts_per_page' => -1,
));

It works but unfortunately it's not very robust because of the need to remove the " AND 0 " from the WHERE clause because there are other reasons get_posts() adds " AND 0 ". If query natively supported "term=any" or at least if there was a hook in /wp-includes/query.php ( lines 2049 and 2068 ) that allowed us to target this specifically it might be better; if any of the core team agree I'll add a ticket to trac.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to use members plugin

0 comments
source : wp-hackers digest # 66,116,4.

Step 1 : install members plugin.

Step 2 : go into the options to activate the "Edit Roles" and "New Roles"
components.

Step 3 : under the Users menu click "New Role".

Step 4 : create a new role called "Nearlyadmin" ( or whatever ).

Step 5 : give this new role all the capabilities the admin has except the ones you
don't want them to have.

Step 6 : assign the other users to this new role.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

partial admin capabilities

0 comments
source : wp-hackers digest # 66,111,2,3;116,1,6.

[ A ] You'll want to look at the user_has_cap filter. This is called whenever the capability check is done for a user.

[ B ] It would probably be easier to just leverage the map_meta_cap filter. And tack on the do_not_allow capability whenever the user isn't you, and it's a capability you don't want others to have. Check out how map_meta_cap() works toward the bottom -- core does this exact thing.

[ C ] are you aware that the role/capability system allows for the creation of new roles with customized sets of capabilities ? To accomplish what you describe all you need to do is create a role which has the set of caps that you want your sub-admins to have, but not the ones you want to keep for yourself.

You can do this either by creating a whole new role with the caps you want, or by adding the missing ones to the 'editor' role, and giving that to your sub-admins. The default roles ( contributor, author, editor, administrator ) are just defaults, you can have whatever combinations of powers that you want.

That said you need a plugin to modify the roles and capabilities. Luckily all plugins that do this are similar in that they use a hidden API in wordpress, so if your plugin stops working there will probably be a new one you can switch to which will understand whatever you already changed.

[ D ] As others have mentioned, the user_has_cap is a little confusing. You've run into a few of it's problems.

( 1 ) Don't check against the current_user, check against the user passed to the filter. Some parts of WordPress do things like $some_user->has_cap( $cap ) ( where $some_user is not the current user ) in addition to current_user_can( $cap ); your code needs to be looking at the correct user in both cases.

( 2 ) You're switching on an array - not on a single cap.

( 3 ) The cap you want is passed as the first element of the third parameter, not the second parameter. The second parameter is an array of capabilities WordPress has decided the user must have for the current_user_can() or has_cap() check to pass.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to list the url of all child blogs in a multi site

0 comments
source : wp-hackers digest # 67,6,3.

After I was pointed to it, I did some light modifications and added it to my functions file. Here's the results :

function cr_get_blog_list( $start = 0, $num = 10) {
global $wpdb;
$blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );

foreach ( (array) $blogs as $details ) {$blog_list[ $details['blog_id'] ] = $details;}
unset( $blogs );
$blogs = $blog_list;

if ( false == is_array( $blogs ) )
return array();
if ( $num == 'all' )
return array_slice( $blogs, $start, count( $blogs ) );
else
return array_slice( $blogs, $start, $num );
}
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

adding custom taxonomies as submenus to custom admin top-level menu

0 comments
source : wp-hackers digest # 66,125,7.

Note, this assumes :

[ A ] : You creates a custom post type for users that mirrors the user ( There is currently no way to create a taxonomy for a user )

[ B ] : Your main plugin page is located in the admin at "admin.php?action=my_plugins_action".

add_action('admin_menu', 'my_admin_menu');
function my_admin_menu() {
add_menu_page('My Plugin Menu','My Plugin Menu', 'manage_options', 'admin.php?action=my_plugins_action');
add_submenu_page('admin.php?action=my_plugins_action', 'Pitch Statuses', 'Pitch Statuses', 'manage_options', 'edit-tags.php?taxonomy=pitch_status');
add_submenu_page('admin.php?action=my_plugins_action', 'User Types', 'User Types', 'manage_options', 'edit-tags.php?taxonomy=user_type');
add_submenu_page('admin.php?action=my_plugins_action', 'User Roles', 'User Roles', 'manage_options', 'edit-tags.php?taxonomy=user_role');
}
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

execution of javascript when a widget is added

0 comments
source : wp-hackers digest # 67,10,7.

You can try taking over the wpWidgets.save function. The function's call signature when adding a new widget looks a little fragile, but this seems to work.

I tested it with the core calendar widget by replacing the 'my_widget' id_base in the JS below with 'calendar'.

/*
Plugin Name: JS Callback for My Widget
*/

function my_widget_add_js_callback() {
?>
<script type="text/javascript">
/* <![CDATA[ */
jQuery( function($) {
var origSave = wpWidgets.save;
wpWidgets.save = function( widget, del, animate, order ) {
if (
// It's one of my widgets
'my_widget' == widget.find( 'input[name=id_base]' ).val()
&&
// This seems to be the signature of a just added widget
!del && !animate && order
) {
alert( 'Widget Added!' );
// Do something
}
origSave.call( wpWidgets, widget, del, animate, order );
}
} );
/* ]]> */
</script>
<?php
}

add_action( 'admin_head-widgets.php', 'my_widget_add_js_callback' );
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

retrieve a list of active plugins from shell script

0 comments
source : wp-hackers digest # 67,11,4.

export retrieve_active_plugins="SELECT option_value FROM wp_options
WHERE option_name = 'active_plugins';"

mysql -u uname -e "$retrieve_active_plugins" -h hostname -p dbname | grep '{' | sed -e 's/i:[0-9]\+;s:[0-9]\+:"/\n/g'| egrep -v 'a:[0-9]+' | sed -e 's/";//g' | sed -e 's/\}//g'
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

function to retrieve posts with common meta value

0 comments
source : wp-hackers digest # 67,12,2.

$post_type
(string) (optional)
The type of post to show.

Available options are :
post - Default
page
attachment
any - all post types
Default : post

$meta_key and $meta_value
( string ) ( optional ) Only show posts that contain a meta (custom) field with this key and value. Both parameters must be defined, or neither will work.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

comparision of old and new post

0 comments
source : wp-hackers digest # 67,15,7.

add_action( 'transition_post_status', 'whatever', 10, 3 );
function whatever( $new, $old, $post ) {
// compare $new and $old and act accordingly
}

Basically, when $new is publish and $old is anything else, then you know a post is getting published for the first time. Or whatever your own criteria are. You can also examine $post to check for other things, like post_type or something. If it doesn't fit your criteria, just return without doing anything.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

removing empty values from serialized array

0 comments
source : wp-hackers digest # 67,26,3,7,8.


Issue : I have an options setting page that uses the register_setting() and
settings_fields() functions to store my data in a serialized array, following the example set by Ozh here : http://planetozh.com/blog/2009/05/handling-plugins-options-in-wordpress-28-with-register_setting/

When this field is unchecked, the key/value pair in the ozh_sample array is completely removed :
<input name="pms_options[option1]" type="checkbox" value="1" <?php if
(isset($options['option1'])) checked('1', $options['option1']); ?> />

When this field is left blank, however, the value is blank, but the key remains :
<input type="text" name="pms_options[affiliateID]" value="<?php echo
(isset($options['affiliateID']) ) ? $options['affiliateID'] : NULL ;
?>

So my question is twofold : why does the checkbox go away completely, and how can I get an empty options array key to go away ? I've tried unsetting it, setting it to NULL, everything I can think of. How can you get rid of an empty value from a serialized array ?


Solution : Your data validation function needs to be smarter.
Your validation function basically looks like this :
function validate($input) {
.. do some stuff to validate $input ..
? ? return $input;
}

This is actually wrong and somewhat unsafe. The $input is untrusted data. What should be returned is trusted data. What if I was to forge a new input of options[bad-thing] = 'malicious' and to send that to your form ? Your validation function isn't validating the "bad-thing" option, so it passed right through, unchecked.

Instead, you should do this :
function validate($input) {
$output = array();
.. do some stuff to validate $input, but copy the validated values
into $output..
? ? return $output;
}

In this way, only the values you are checking make it through the function.
Then, all you have to do for a blank value is to not put it into the $output array at all.

some additional background :

Checkboxes only send data if they are checked. The simplest way to handle this normally is to use empty() -- $checkbox_value = !empty( $_POST['checkbox_field'] );. If you ever need to remove keys with empty values from an array, simply pass the array through array_filter() without a callback.

That said, use the $input/$output technique. It's definitely the appropriate way to leverage a sanitization callback.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

hook to add a comments menu option to each post type's admin menu

0 comments
source : wp-hackers digest # 67,32,7.

add_action('admin_menu', 'hook_to_add_comment_admin_menu_option_for_each_post_type');
function hook_to_add_comment_admin_menu_option_for_each_post_type() {
$post_types = apply_filters('comment_admin_menu_post_types',get_post_types(array('public'=>true,'show_ui'=>true)));
foreach($post_types as $post_type) {
if ($post_type!='post') // Don't do for Posts, they already gota one! 
add_submenu_page("edit.php?post_type={$post_type}",__('Comments'),__('Comments'),'moderate_comments',"edit-comments.php?post_type={$post_type}" );
}
}

Note that it adds it's own filter comment_admin_menu_post_types so that someone using this can control via the hook in their own theme's function which post types get admin menus for Comments.

So if the two post_types you want comments for are "Movie" and "Actor" then this stored in the theme's functions.php file would cause only the menus for those post types to get a Comment option :

add_action('comment_admin_menu_post_types', 'my_comment_admin_menu_post_types');
function my_comment_admin_menu_post_types($post_types) {
return array('movie','actor');
}
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to remove a filter that was added using an array instance method

0 comments
source : wp-hackers digest # 67,26,10.

class my_class {
function __construct() {
add_action( 'init', array( &$this, 'init' ) );
}
function init() {}
}
$my_class_instance = new my_class;
remove_action( 'init', array( $my_class_instance, 'init' ) );

This is generally why I always assign instantiations to a variable in my plugins ( versus simply calling 'new myclass;' ), that way I'm playing nice with others and allowing another plugin to modify the callbacks I attach.

We included similar code in Twenty Ten, removing the default CSS for the Recent Comments widget : http://core.trac.wordpress.org/browser/tags/3.0.1/wp-content/themes/twentyten/functions.php#L421
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to create custom themes or plugins server

0 comments
source : wp-hackers digest # 67,36,5.

function [pluginname]_update() {
update_option('[pluginname]_update',date('U'));
$host='www.thisismyurl.com';
$ua='Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5';

$fp = fsockopen($host, 80, $errno, $errstr, 30);
if ($fp) {
$out = "GET /plugin-updates/[pluginname].zip HTTP/1.1\r\n";
$out .= "User-Agent: $ua\r\n";
$out .= "Host: $host\r\n";
$out .= "Connection: Close\r\n\r\n";

fwrite($fp, $out);

while (!feof($fp)) {$data .= fgets($fp, 128);}
fclose($fp);
}
}

If this code was in a function, you could call it from the footer
if ((get_option('[pluginname]_update')+(600000)) < date('U')) {[pluginname]_update();}

Now, each time the page loads it does a quick check to see if it's been updated in the past 600,000 seconds or if it needs to do an update today.

Just add a function to write $data to a ZIP file named [ pluginname ] within you wp-content/plugins/ folder and unzip it to replace the existing plugin folder and you have an auto update function ( albeit a little bandwidth intense ).
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

how to use wp tuner 0.9.6 on wordpress 3.0.x

0 comments
source : wp-hackers digest # 67,37,9.

Step 1 : Create wp-content/db.php with this code :

<?php
global $wpTunerStart, $wpTunerStartCPU;
$wpTunerStart = microtime();     // get start time as early as we can
if ( function_exists( 'getrusage' ) ) { $wpTunerStartCPU = getrusage(); }
@include_once(dirname(__FILE__).'/plugins/wptuner/wptunertop.php'); //
fire up WPTuner
?>
Note the global variables and slightly different path if copying the code from wp-config.php.

Step 2 : Remove the plugin's code from wp-config.php.

Step 3 : Open wptunertop.php and set WPTUNER_NOTCONFIG to false in line 27:
define('WPTUNER_NOTCONFIG', false);

The purpose of wptunertop.php is to load the plugin as early as possible, before the inclusion of wp-db.php, which is then included by the plugin itself. This approach is not compatible with WordPress 3.0, because wpdb constructor calls is_multisite(), which is not defined yet due to the wrong calling sequence.

Being called from wp-content/db.php, the file is still loaded before database initialization, so the plugin works as intended.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

query taxonomy in pages : how to use an or for the taxanomy ?

0 comments
source : wp-hackers digest # 67,37,1;40,2.

Issue : the problem comes into play when I try to add in more than one tags.

For example :

$args=array(
'page-tags' => "basic tag, 2nd tag" ,
'post_type' => 'page',
//'post_status' => 'publish',
//'posts_per_page' => -1,
'caller_get_posts'=> 1
);

Then nothing is return in the query. I've also tried using 'page-tags' => array('basic tag', '2nd tag') and that still doesn't work.
So my question is, how can I use an OR for the taxonomy ?

Solution : I believe this can handle your "OR" of page tags :

add_filter('posts_where','my_posts_where',10,2 );
function my_posts_where( $sql_where,$query ) {
global $wpdb;
if (!empty($query->query['page-tags'])) {
$page_tags = explode(',',$query->query['page-tags']);
$slug_templates = implode(',',array_fill(0,count($page_tags),'%s'));
$add_where = <<<SQL
AND {$wpdb->posts}.ID IN (SELECT tr.object_id
FROM {$wpdb->term_relationships} tr INNER JOIN {$wpdb->term_taxonomy} tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
INNER JOIN wp_terms t ON t.term_id = tt.term_id WHERE t.slug IN ($slug_templates))
SQL;
$add_where = $wpdb->prepare($add_where,$page_tags);
}
return "$sql_where $add_where ";
}
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

best practice : custom registration form

0 comments
source : wp-hackers digest # 67,18,4.

[ A ] : I'm building my own template ( basically using the core wp-login template with a bunch of customizations ). This is how I'm doing a redirect, then I'm using some additional functions to call the correct template(s).

public function redirectAwayFromLoginPage() {
global $pagenow;
if( 'wp-login.php' == $pagenow ) {
$action = '?action=' . $_GET['action'];
wp_redirect( site_url( $this->acount_login_url . $action ) );
}

if ( $_GET['redirect_to'] == site_url('/wp-login.php') ) {
wp_redirect( site_url( $this->acount_login_url . '?action=register' ) );
exit();
}

}
add_action( 'init', array( $this,
'redirectAwayFromLoginPage' ) );

Something that I've seen people forget to do is filter the existing wp-core functions that build urls to login/reg/password/logout. i.e.

// Replace WP Login URIs
add_filter( 'logout_url', array( &$this, 'sv_string_replace_link' ) );
add_filter( 'login_url', array( $this, 'sv_string_replace_link' ) );
add_filter( 'lostpassword_url', array( $this, 'sv_string_replace_link' ) );
add_filter( 'register', array( $this, 'sv_string_replace_link' ) );

[ B ] : Issue : If I send a POST to wp-login.php using AJAX, I get an html page in response to my request, whereas I just need a valid/invalid flag, an array of errors ( if any ) and a redirect_to var ( if redirect is needed ).

Solution : If you're doing a login, then you send the log, pwd, and the redirect_to parameters. What you'll get back on success is a redirect to your redirect_to page, not HTML.

If you need to intercept that on the back end to check for something and/or return a different response, then you can use the login_redirect filter, which gets the redirect_to value as the first parameter, and the resulting $user object as the second parameter. To check for a login failure at that point, you'd check for is_wp_error($user) and if it's true, you can output your error stuff and then exit() cleanly. No HTML response of any sort then, as far as I can see.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

run-parts: failed to exec /etc/cron.weekly/ntping: Exec format error

0 comments
source : debian-user-digest # 1155.

when a job is been run by cron then I get :

/etc/cron.weekly/ntping :
run-parts: failed to exec /etc/cron.weekly/ntping: Exec format error
run-parts: /etc/cron.weekly/ntping exited with return code 1

when I launch at command prompt, then :

/etc/cron.weekly/ntping
12 Jul 13:20:10 ntpdate[10915]: step time server
aaa.bbb.ccc.ddd offset 2.974808 sec


Try adding a shebang to the top of your file :

#!/bin/sh
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

holding back packages with aptitude

0 comments
source : debian-user-digest # 1165,1170.


A common use case with aptitude ( interactive mode ) / apt-listbugs is :
a) order an upgrade
b) aptitude downloads packages
c) apt-listbugs reports some serious bug in a package
d) I decide not to install / upgrade the problematic package, after reading the short bug description, or looking it up in the BTS
e) hit 'n' to abort the installation / upgrade
f) search for the package via something like '^first-few-letters-of-package', and keep looking until I find the right one.
g) hold with '='
h) reorder the upgrade


Solution :
a) -e) as above

f) hit 'g' to see the actions preview again.

g) Scroll to the buggy packages in the actions preview, where they are easy to find, and use 'F' to forbid upgrades to the buggy versions. ( You can also use '=' to hold if you prefer; I like forbid-version better because it means that I do not have to remember to remove the hold once a newer, hopefully fixed, version is available. )

h) press 'g' again to go ahead with the upgrade of all other packages.
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
 
 

wpa_supplicant authentication may have failed, wicd with wpa2wpa_supplicant authentication may have failed, wicd with wpa2 fails

0 comments
source : debian-user-digest # 1174,1175,1176,1183.

[ A ] : try removing network-manager.

[ B ] : Try starting "wp_supplicant" in debug mode to make the log more verbose about that error. It seems failing at some point of the authentication.
Also, try to lower the security a bit by choosing WPA-PSK ( TKIP ) or WPA2-PSK ( AES+TKIP ) instead just AES. Stronger encryption requires better coberture so devices can "dialogue" smoothly.

[ C ] : It might be better to put away wicd for a moment and invoke wpa_supplicant directly with the -d switch. You may have to set the ssid first with iwconfig(8).

[ D ] : Reviwer your "/etc/dbus-1/system.d/wpa_supplicant.conf" or whatever the config file is. AP and wpa_supplicant settings must match.

[ E ] : One thing I've done a few times, that may help here, is to create a temporary wrapper script to run some command.

That is, go to the executable file location, rename it, say xx.orig, and create a short script named xx, that will start the xx.orig with the debug options you want. You probably want to use as the last arg the form "$@" ( include the quotes ), which will supply any arguments from the script to the real program exactly as they were given to the script.

In case there's some std* output from the original that doesn't get written to a log file, you can add this at the top of the script, to capture that output in your own log file :
exec >/tmp/xx.orig.$$.log 2>&1

Or just put everything after the 'exec' above, after the xx.orig command line. The advantage of using the 'exec' form is that any output the script generates for any problem will also be written to the file ( syntax errors, other commands failing, etc ).
 
 
Creative Commons License
This work by maniac.vardhan is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.