Jump to content
Geplaatst:
comment_1089835

Deel je codes/scripts!

--------

Deel hier je codes of scripts!

--------

Graag geen codes quoten, als je iets post graag een code of script posten!

Zet je codes in een Codebox om je codes/scripts te posten!

--------

Ik trap af met een anti copie ding :Y

<script>  
<!--  
if (window.Event)   
 document.captureEvents(Event.MOUSEUP);   
function nocontextmenu()    
{  
event.cancelBubble = true  
event.returnValue = false;  
 return false;  
}  
function norightclick(e)   
{  
if (window.Event)   
{  
 if (e.which == 2 || e.which == 3)  
  return false;  
}  
else  
 if (event.button == 2 || event.button == 3)  
 {  
  event.cancelBubble = true  
  event.returnValue = false;  
  return false;  
 }  
}  
document.oncontextmenu = nocontextmenu;   
document.onmousedown = norightclick;   
function disableselect(e){
return false
}
function reEnable(){
return true
}
document.onselectstart=new Function ("return false")
if (window.sidebar){
document.onmousedown=disableselect
document.onclick=reEnable
}

//-->   
</script>

Bewerkt: door Timske

Featured Replies

Geplaatst:
comment_1090007

dat script is niet geheel anti-copy, het vermoeilijkt het alleen he ;)

je kunt inhoud altijd kopieren, al moet je alles overtypen :bonk:

ik heb ook nog wel een leuk scriptje.

ik had altijd het probleem dat in PHP de functie in_array() wel bestaat, maar in_string() niet. En ik had ook geen zin om elke keer if(strpos("abc", "b") !== false) uit te typen. Ik heb deze functie dus even gemaakt, met wat toegevoegde functies.

 /**********
*in_string(mixed $needle, string $haystack[, bool $caseSensitive [, bool $arrayAll]])
*zoekt voor $needle in $haystack
*$caseSensitive staat voor hoofdlettergevoeligheid, FALSE zal hoofdlettergevoelig zoeken, TRUE niet
*$caseSensitive is standaard FALSE
*als $needle een array is, wordt er voor elk element gekeken of het $needle bevat (werkt ook met multi-dimensionale arrays)
*als $arrayAll TRUE is, moeten alle elementen van $needle in $haystack voorkomen, als $arrayAll FALSE is is 1 van de elementen genoeg
*$arrayAll is standaard FALSE
*return-waarde: TRUE als $needle gevonden is, anders FALSE
**********/
function in_string($needle, $haystack, $caseSensitive=FALSE, $arrayAll=FALSE)
 {
 if(!is_array($needle))
	 {
	 if($caseSensitive)
		 return (strpos($haystack, $needle) !== false)?true:false;
	 else
		 return (stripos($haystack, $needle) !== false)?true:false;
	 }
 else
	 {
	 if(!$arrayAll) // 1 van de elementen in $needle moet in $haystack voorkomen
		 {
		 foreach($needle as $value)
			 {
			 if(in_string($value, $haystack, $caseSensitive, $arrayAll))
				 return true;
			 }
		 return false;
		 }
	 else // alle elementen in $needle moeten in $haystack voorkomen
		 {
		 foreach($needle as $value)
			 {
			 if(!in_string($value, $haystack, $caseSensitive, $arrayAll))
				 return false;
			 }
		 return true;
		 }
	 }
 }

voorbeelden:

if(in_string("a", "abc")) // TRUE
if(in_string("B", "abc")) // TRUE
if(in_string("B", "abc", TRUE)) // FALSE
if(in_string(array("a", array("b", "e")), "abc")) // TRUE
if(in_string(array("a", array("b", "f")), "abc"), FALSE, TRUE) // FALSE

Bewerkt: door marcootje

Gast
Dit onderwerp is gesloten.

Recent actief 0

  • Er zijn hier geen geregistreerde gebruikers aanwezig.