26th April 2013, 11:17
#1
3 out of 3 members found this post helpful.
Cum protejam drepturile de autor al unei theme wordpress.
Salutare!
Garantez ca multi dintre voi au intampinat macar o data aceasta situatie. Si anume.. downloadeti o thema free de pe net si considerati ca drepturile vi se cuvin si schimbati footerul , inclusiv drepturile de autor, link-ul catre autor etc si gasiti urmatorul mesaj in general : "This theme is released free for use under creative commons licence. All links in the footer should remain intact. These links are all family friendly and will not hurt your site in any way. This great theme is brought to you for free by these supporters." .
Am afisat acest mesaj ca in general este universal(cel putin asa cred) . Buuunn.. insa sa zicem ca se inverseaza rolurile si ca voi sunteti autorul unei theme wordpress pe care doriti sa o da-ti gratis spre folosinta insa cu pretentia de a se pastra dreptul de autor si link-ul catre site-ul vostru. Cum rezolvam treaba asta? Logic... fisierul functions.php .. unde vom adauga urmatoarele linii :
Cod PHP:
if (!empty($_REQUEST["theme_license"])) { theme_usage_message(); exit(); } function theme_usage_message() { if (empty($_REQUEST["theme_license"])) { $theme_license_false = get_bloginfo("url") . "/index.php?theme_license=true"; echo "<meta http-equiv=\"refresh\" content=\"0;url=$theme_license_false\">"; exit(); } else { echo ("<p style=\"padding:10px; margin: 10px; text-align:center; border: 2px dashed Red; font-family:arial; font-weight:bold; background: #fff; color: #000;\">This theme is released free for use under creative commons licence. All links in the footer should remain intact. These links are all family friendly and will not hurt your site in any way. This great theme is brought to you for free by these supporters.</p>"); } }
<!-- Aici comentez eu putin : imediat dupa acest cod adaugati si : -->
function check_theme_footer() { $uri = strtolower($_SERVER["REQUEST_URI"]); if(is_admin() || substr_count($uri, "wp-admin") > 0 || substr_count($uri, "wp-login") > 0 ) { /* */ } else { $l = '<div id="credits"><div id="credits">Design by <a href="http://www.site.ro" target="_blank">Firma Web design</a></div>'; $f = dirname(__file__) . "/footer.php"; $fd = fopen($f, "r"); $c = fread($fd, filesize($f)); fclose($fd); if (strpos($c, $l) == 0) { theme_usage_message(); die; } } } check_theme_footer();
Bun asta se va regasii in fisierul functions , eu v-am dat un exemplu simplu , divul credits se poate modifica in fel si in chip insa obligatoriu sa fie identic si in functions.php si in footer.php.
Ca am adus in discutie si fisierul footer.php ca aceasta funcitie sa isi faca treaba si sa nu blocheze efectiv site-ul trebuie ca footerul sa contina obligatoriu :
Cod HTML:
<div id="credits"><div id="credits">Design by <a href="http://www.site.ro" target="_blank">Firma Web design</a></div></div>
</div>
Bun, functia este destul de veche si des folosita insa pentru cei care isi doresc sa dezvolte o thema wordpress de la zero consider ca este un tool destul de folositor daca tine la drepturile intelectuale
Toate bune!