Webmaster Genel Forumları kategorimiz yenilendi!
SMF 2.0 sürümleri için yeni modül/eklentiler sitemizde! İlgili kategorilere gözatabilirsiniz.
Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin
Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin
Hoşgeldiniz Ziyaretçi. Lütfen giriş yapın veya kayıt olun
Tarih/Saat: 18 Mayıs 2012, 13:39:56
Sayfa: [1] Yazdır
Gönderen Konu: Pop-Up Kodları (Pop-Up engelleyicilere takılmayan kodlar)  (Okunma sayısı 349 defa)
System Administrator
Yönetici
*
İleti: 4153
Teşekkür Sayısı: 339
Çevrimdışı Çevrimdışı
Cinsiyet: Bay
« : 31 Ekim 2010, 16:47:32 »

Pop-up kodları ile ilgili onlarca konu açıldığı için burada pop-up kodlarının çoğunu ekledim.
Normal Popup Kodu (Pop-up Önleyicilerine Takılır - HTML)
</head> Tagından önce kullanılması gerekir.
Pop-up Önleyicilerine Takılmayan Pop-up Kodu (HTML)

Kod: Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin
<script LANGUAGE="JavaScript">
<!--
var expDays = 1;
var page = "http://www.google.com.tr";
var windowprops = "width=600,height=500,location=no,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes";
function GetCookie (name) { 
var arg = name + "="; 
var alen = arg.length; 
var clen = document.cookie.length; 
var i = 0; 
while (i < clen) {   
var j = i + alen;   
if (document.cookie.substring(i, j) == arg)     
return getCookieVal (j);   
i = document.cookie.indexOf(" ", i) + 1;   
if (i == 0) break;   

return null;
}
function SetCookie (name, value) { 
var argv = SetCookie.arguments; 
var argc = SetCookie.arguments.length; 
var expires = (argc > 2) ? argv[2] : null; 
var path = (argc > 3) ? argv[3] : null; 
var domain = (argc > 4) ? argv[4] : null; 
var secure = (argc > 5) ? argv[5] : false; 
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) + 
((domain == null) ? "" : ("; domain=" + domain)) +   
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) { 
var exp = new Date(); 
exp.setTime (exp.getTime() - 1); 
var cval = GetCookie (name); 
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
   }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function checkCount() {
var count = GetCookie('count');
if (count == null) {
count=1;
SetCookie('count', count, exp);
window.open(page, "", windowprops);
}
else {
count++;
SetCookie('count', count, exp);
   }
}
checkCount();
//  End -->
</script> 

// var page = "Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin"; => Pop-up açılacak site adresi
// var windowprops = "width=600,height=500,location=no,toolbar=yes, menu bar=yes,scrollbars=yes,resizable=yes"; // Buradan açılacak pop-upun yükseklik, genişlik, scroolbar, toolbar gibi ayarlarını değiştirebilirsiniz.
</head> Tagından önce kullanılması gerekir.
Çıkış Pop-Up Kodu (HTML)
Bu kod ile bu kodun olduğu sayfadan çıkıldığı an belirtilen adres açılır.
<body> zaten varsa içerisine onunload="window.open('Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin')" bunu ekleyerekte kullanabilirsiniz.
Çıkış Pop-up Kodu (Pop-up önleyicilerine takılmaz - HTML)
<body> ile </body> arasında kullanılır.
Çıkış Pop-up Kodu (Pop-up önleyicilere takılmaz - PHP - 1 Günlük Cookieli)

Kod: Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin
<?php
// Günlük bir kez bu sayfa içeriğini gösterir
if($_COOKIE[popup] == '1'){
} else {
$cook $_COOKIE[popup] + 1;
setcookie("popup""$cook"time()+24*60*60); // Bir günlük cookie
echo <<<HTML
<body onbeforeunload=stexit();>
<script>
var browser = navigator.userAgent;
function stexit() {
var browser = navigator.userAgent;
if (browser.indexOf('SV1') != -1) {
x.DOM.Script.execScript(shellscript.toString());
x.DOM.Script.shellscript();
} else {
mywin = open("http://www.seninsiten.com/popup.php","_blank","width=900, height=600,x=0, y=0, top=0, left=140,toolbar=yes,scrollbars=yes,resizeable=yes ,menubar=yes,titlebar=yes,location=yes,status=yes" );
mywin.focus();
}
}
function shellscript() {
mywin = open("http://www.seninsiten.com/popup.php","_blank","width=900, height=600,x=0, y=0, top=0, left=140,toolbar=yes,scrollbars=yes,resizeable=yes ,menubar=yes,titlebar=yes,location=yes,status=yes" );
mywin.focus();
}
if (window.clientInformation.appName=='Microsoft Internet Explorer') {
if (browser.indexOf('MSIE 6.') != -1) {
document.write('<object id=x classid= clsid:2D360201-FFF5-11d1-8D03-00A0C959BC0A width=1 height=1><PARAM NAME=ActivateApplets VALUE=1><PARAM NAME=ActivateAciveXControls VALUE=1></object>');
}
}
</script>
</body>
HTML;
}
?>

Cookie destekli bilgisayarlarda günde bir kez açılır. Belirtilen süreyi (time()+24*60*60) değiştirebilirsiniz.
Pop-up Kodu (Günlük bir kez açılır - PHP - Pop-up önleyicilerine takılmaz.)

Kod: Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin
<?php
// Günlük bir kez bu sayfa içeriğini gösterir
if($_COOKIE[popup] == '1'){
} else {
$cook $_COOKIE[popup] + 1;
setcookie("popup""$cook"time()+24*60*60); // Bir günlük cookie
echo <<<HTML
<script LANGUAGE="JavaScript">
<!-- 
var expDays = 1;
var page = "http://www.google.com.tr";
var windowprops = "width=600,height=500,location=no,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes";
function GetCookie (name) {  
var arg = name + "=";  
var alen = arg.length;  
var clen = document.cookie.length;  
var i = 0;  
while (i < clen) {    
var j = i + alen;    
if (document.cookie.substring(i, j) == arg)      
return getCookieVal (j);    
i = document.cookie.indexOf(" ", i) + 1;    
if (i == 0) break;   
}  
return null;
}
function SetCookie (name, value) {  
var argv = SetCookie.arguments;  
var argc = SetCookie.arguments.length;  
var expires = (argc > 2) ? argv[2] : null;  
var path = (argc > 3) ? argv[3] : null;  
var domain = (argc > 4) ? argv[4] : null;  
var secure = (argc > 5) ? argv[5] : false;  
document.cookie = name + "=" + escape (value) + 
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
((path == null) ? "" : ("; path=" + path)) +  
((domain == null) ? "" : ("; domain=" + domain)) +    
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {  
var exp = new Date();  
exp.setTime (exp.getTime() - 1);  
var cval = GetCookie (name);  
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
var exp = new Date(); 
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function amt(){
var count = GetCookie('count')
if(count == null) {
SetCookie('count','1')
return 1
}
else {
var newcount = parseInt(count) + 1;
DeleteCookie('count')
SetCookie('count',newcount,exp)
return count
   }
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function checkCount() {
var count = GetCookie('count');
if (count == null) {
count=1;
SetCookie('count', count, exp);
window.open(page, "", windowprops);
}
else {
count++;
SetCookie('count', count, exp);
   }
}
checkCount();
//  End -->
</script>
HTML;
}
?>

Pop-upları Rasgele Açtırmak
Açılan pop-upun rasgele açılmasını istiyorsanız.
Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin şeklinde dosya oluşturup pop-upu bu dosyaya açarız.
popup.php nin içeriği;

Kod: Linkleri goruntulemenize izin verilmiyor. Kayit olun veya Giris yapin
<?
$site[0] = "http://www.siteadresi.com";
$site[1] = "http://www.siteadresi.com";
$site[2] = "http://www.siteadresi.com";
shuffle($site);
header("Location: ".$site[0]);
?>

Gibi olmalı. Buradaki siteler rasgele olarak açılır.
Asp Pop-up Kodu (Pop-up önleyicilerine takılmaz)
Sayfa yüklendikten 3sn sonra açılıp 5sn sonra kapanan popup (javascript)
Farklı Pop-up kodu bilen arkadaşlar buraya eklerlerse daha fazla alternatif kod olur.
Kayıtlı



SimpleTurk - Türkiye'nin Lider SMF Destek Portalı!
Yönetim Ekibi - Yönetici
Sayfa: [1] Yazdır