Pada forum ini, saya menghilangkan anchor tag pada semua teaser, ini dilakukan supaya meminimalisir abuse yang dilakukan oleh para anggota misal sengaja meletakkan link tertentu pada teaser karena teaser-lah yang diambil pada halaman index seperti pada frontpage, serta tracker. Saya menggunakan template.php, berikut kode yang dipakai: Code: /** * Override or insert variables into the node template. */ function theme_preprocess_node(&$variables) { // Strip html tag. if(isset($variables['content']['body'][0]['#markup']) && $variables['teaser']) { $variables['content']['body'][0]['#markup'] = strip_only($variables['content']['body'][0]['#markup'], '<a>'); } } /* Strip only selcted tags in theme_preprocess_node function above */ function strip_only($str, $tags) { if(!is_array($tags)) { $tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags)); if(end($tags) == '') array_pop($tags); } foreach($tags as $tag) $str = preg_replace('#</?'.$tag.'[^>]*>#is', '', $str); return $str; } Dan, Feb 13, 2013 #1 Jumbulen Member Joined: Dec 22, 2012 Messages: 73 Likes Received: 6 Trophy Points: 18 Waduh mas, pusing lihat Waduh mas, pusing lihat kodenya *wacko* Jumbulen, Feb 13, 2013 #2 Dan Forum Bot Joined: Dec 4, 2012 Messages: 1,316 Likes Received: 257 Trophy Points: 83 Google+: Author Sudah ada di Drupal API Itu hanya sedikit sih, lagian semua juga sudah ada di Drupal API. *biggrin* Postingan hanya untuk ngejar domain authority. Dan, Feb 13, 2013 #3 Fahmi Newbie Joined: Dec 5, 2012 Messages: 1,719 Likes Received: 159 Trophy Points: 63 Google+: Author ini settingan function ini settingan function template ya mas ? boleh tau contohnya menaruuh anchor tag pada teaser ? maksudnya apa yaah ? Fahmi, Feb 13, 2013 #4 Dan Forum Bot Joined: Dec 4, 2012 Messages: 1,316 Likes Received: 257 Trophy Points: 83 Google+: Author Anchor maksudnya link Anchor maksudnya link *biggrin* Dan, Feb 13, 2013 #5 Fahmi Newbie Joined: Dec 5, 2012 Messages: 1,719 Likes Received: 159 Trophy Points: 63 Google+: Author Dan wrote: hahaha iyaalah link.. maksudnya naro link di body gitu ? Fahmi, Feb 13, 2013 #6 Dan Forum Bot Joined: Dec 4, 2012 Messages: 1,316 Likes Received: 257 Trophy Points: 83 Google+: Author Ini malah menghilangkan tag Ini malah menghilangkan tag Code: <a> -nya supaya diclick tidak bisa, sewaktu-waktu bisa saja nanti artikel keseluruhan anchornya dihilangkan kalau terlalu banyak spam *biggrin* Dan, Feb 13, 2013 #7 Fahmi Newbie Joined: Dec 5, 2012 Messages: 1,719 Likes Received: 159 Trophy Points: 63 Google+: Author Dan wrote: mudah-mudahan jangan ada yang spamming disini *acute* Fahmi, Feb 14, 2013 #8 Dan Forum Bot Joined: Dec 4, 2012 Messages: 1,316 Likes Received: 257 Trophy Points: 83 Google+: Author Yang menilai Google yang menilai spam nantinya Google sih, misal forum ini ke banned ya mau ngga mau harus tegas juga, tapi ada tahapan sebelum itu yaitu kasih nofollow untuk artikelnya dulu tapi signaturenya masih dofollow *biggrin* Dan, Feb 14, 2013 #9 samuel Member Joined: Feb 5, 2013 Messages: 478 Likes Received: 15 Trophy Points: 18 Google+: Author ya hati" hati" juga iya tuh takut nya ada yg spam, harus ditertibkan kalo ada spam *dirol* samuel, Feb 20, 2013 #10 profhariz Member Joined: Jun 25, 2013 Messages: 86 Likes Received: 1 Trophy Points: 8 Google+: Author Bisa letak di wordpress? Bisa letak di wordpress? profhariz, Jun 28, 2013 #11 AhmadWafa Member Joined: Oct 2, 2013 Messages: 850 Likes Received: 15 Trophy Points: 18 Google+: Author Koding oh koding, kapan saya bisa pinter ma koding yah . . . AhmadWafa, Jul 12, 2014 #12 Devita Active Member Joined: Oct 11, 2014 Messages: 1,194 Likes Received: 43 Trophy Points: 48 Google+: Author Waduh, kalau ngeliat koding kayak gitu masih belim nyantol dipikiran. Devita, Jan 8, 2015 #13 abu albani Member Joined: Oct 31, 2014 Messages: 69 Likes Received: 8 Trophy Points: 8 drupal oh drupal.. abu albani, Jan 11, 2015 #14 heru.permana19 New Member Joined: Nov 24, 2015 Messages: 17 Likes Received: 1 Trophy Points: 3 waduh.. apa ini sy coba pahami dl mas heru.permana19, May 26, 2016 #15 (You must log in or sign up to reply here.) Show Ignored Content Share This Page Tweet Log in with Facebook Log in with Twitter Your name or email address: Do you already have an account? No, create an account now. Yes, my password is: Forgot your password? Stay logged in
Sudah ada di Drupal API Itu hanya sedikit sih, lagian semua juga sudah ada di Drupal API. *biggrin* Postingan hanya untuk ngejar domain authority.
ini settingan function ini settingan function template ya mas ? boleh tau contohnya menaruuh anchor tag pada teaser ? maksudnya apa yaah ?
Ini malah menghilangkan tag Ini malah menghilangkan tag Code: <a> -nya supaya diclick tidak bisa, sewaktu-waktu bisa saja nanti artikel keseluruhan anchornya dihilangkan kalau terlalu banyak spam *biggrin*
Yang menilai Google yang menilai spam nantinya Google sih, misal forum ini ke banned ya mau ngga mau harus tegas juga, tapi ada tahapan sebelum itu yaitu kasih nofollow untuk artikelnya dulu tapi signaturenya masih dofollow *biggrin*