Jump to content
php.lv forumi

maza prob nevaru dabut lai stradat spoileris


Faks

Recommended Posts

Labdien Damas un Kungi tatad atkal problema un nestrada kuram gaisaka galva varbut palidzt atrisinat problemu pieviena sis kods ari noderes komunai :) !

	$in = array(
  			  	'\[spoiler\](.*?)\[/spoiler\]'
);
// nestrada jo php nenem preti :(
$out = array(
'<div align="center">
<div style="margin: 5px 20px 20px; width: 60%;">
<div style="text-align: right; padding: 4px; background: #72B73A; repeat-x scroll 0% 0% transparent; border: 1px solid #2C6302; -moz-border-radius:5px; color:#ffffff; text-shadow:0 -1px #4B7926; font-weight:bold; ">Spoiler: <input type="button" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';    	this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" style="width: 45px; font-size: 10px; margin: 0px; padding: 0px;" value="Show"></div><div class="quotecontent"><div style="border-right: 1px solid #000000; border-width: 0px 1px 1px; border-style: none solid solid; border-color: #000000; padding: 4px; -moz-border-radius:5px; display: none;">$1</div></div></div></div>'

 

P.s

Paldies par uzmanibu un atsaucibus (nesudzaties ka nau garum zimes eh 64bit os ...) .

Link to comment
Share on other sites

Uzraksti šādi:

$in = array('\[spoiler\](.*?)\[/spoiler\]');
$out = array('');

ja strādā, tad kopē vai raksti pie $out pa pārdesmit simboliem iekšā no tā koda kas tev tur ir, līdz saproti kas par vainu.

Edited by yancho
Link to comment
Share on other sites

Uzraksti šādi:

$in = array('\[spoiler\](.*?)\[/spoiler\]');
$out = array('');

ja strādā, tad kopē vai raksti pie $out pa pārdesmit simboliem iekšā no tā koda kas tev tur ir, līdz saproti kas par vainu.

problema ir site php nenem preti html kodu

<input type="button" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';      	this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" style="width: 45px; font-size: 10px; margin: 0px; padding: 0px;" value="Show"></div>

pat ar echo to pasu var piedzivot vot nevaru izdomat ka eskeipot tagus tada aizdoma ka bez php strom cauri netiksu ja ne vien kads cits nepateiks labaku varijantu !

Edited by Faks
Link to comment
Share on other sites

Kas ir 'site php' un 'php strom'?

 

Atdali PHP no HTML. HTML no CSS un JS.

problema ka nemaz ta te nevar darit jo tas ir ieksa out .... un iet cauri preg_replace ...

ja spamos topiks iet ciet !

Edited by Faks
Link to comment
Share on other sites

Kas ir 'ieksa out'? 0_o

 

Man jau drīz būs jācitē Tevi... Kas Ko ? 4o ? What ?

  $in = array
(
                          	'\[spoiler\](.*?)\[/spoiler\]'

);
   	// nestrada jo php nenem preti :
(
   	$out = array(

   	'<div align="center">
<div style="margin: 5px 20px 20px; width: 60%;">
<div style="text-align: right; padding: 4px; background: #72B73A; repeat-x scroll 0% 0% transparent; border: 1px solid #2C6302; -moz-border-radius:5px; color:#ffffff; text-shadow:0 -1px #4B7926; font-weight:bold; ">Spoiler: <input type="button" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = '';      	this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }" style="width: 45px; font-size: 10px; margin: 0px; padding: 0px;" value="Show"></div><div class="quotecontent"><div style="border-right: 1px solid #000000; border-width: 0px 1px 1px; border-style: none solid solid; border-color: #000000; padding: 4px; -moz-border-radius:5px; display: none;">$1</div></div></div></div>'
);


preg_replace($in, $out, $text);

Edited by Faks
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...