Biri benim tema altbilgi güç çıkardığınızda nasıl bir uyarı hatırlatma koymak

3 Cevap

Benim altbilgi örnek link

$powered = 'Powered by <a href="htp://stackoverflow.com">Stackoverflow</a>';

tema dosyası

<?php echo $powered; ?>

$powered Benim altbilgiden kaldırıldı ve hata / hatırlatma fark olmadığını nasıl yapılır.

Örnek die('Do not remove the powered link')

3 Cevap

Uzun cevap:

<?php

$powered = 'Powered by <a href="htp://stackoverflow.com">Stackoverflow</a>';

ob_start();
echo $powered;
$html = ob_get_clean();

/*
 * If you remove the "echo $powered;" part, please don't remove the following lines
 * so I can detect the license violation. Thank you for your cooperation!
 */
if( strpos($html, $powered)===FALSE ){
    echo die('Do not remove the powered link');
}else{
    echo $html;
}

?>

Kısa cevap: mümkün değil.

Mümkün ... Eğer değişmiş olmaktan kodu korumak için Zend Guard kullanabilirsiniz.