Jump to content
php.lv forumi

Sadalju boldaa


Sandis

Recommended Posts

Man webaa no DB izsviezh laukaa laukus-sadaljas, kuri satur gada skaitljus (..., 1999, 2000, 2001, ...)

Kaa pareizi 'uztamboreet' kodinju JavaScriptaa, kas, nospiezhot konkreetu sadalju, atstaaj to boldaa!?

Kods:

for($i = 0; $i < $hmg; $i++){
	 if (isset($_REQUEST["g"]))
	 {
   $bold='<b>'.$gal[$i][0].'</b>';
	 }
	 else
	 {
   $bold=$gal[$i][0];
	 }
	 // pieskjiiru boldu - bet, logjiski, ka nospiezhot uz vienas sadaljas, tas boldaa paarveersh visas sadaljasb :)
	 $buf .= '<td height="40" align="center" valign="middle"><a id="mt1" href="./index.php?id=2&g='.($i+1).'" onmouseover="Javascript: mon(this);" onmouseout="Javascript: mou(this);">'.$bold.'</a><td>';
 }

Edited by Sandis
Link to comment
Share on other sites

Un itkaa to visu vajadzeetu atrisinaat ar onmouseclick..! Bet neiekraaso viss! :(

 

for($i = 0; $i < $hmg; $i++){
 if (isset($_REQUEST["g"]))
 {
  $bold='<b>'.$gal[$i][0].'</b>';
 }
 else
 {
  $bold=$gal[$i][0];
 }
 // pieskjiiru boldu - bet, logjiski, ka nospiezhot uz vienas sadaljas, tas boldaa paarveersh visas sadaljasb :)
 $buf .= '<td height="40" align="center" valign="middle"><a id="mt1" href="./index.php?id=2&g='.($i+1).'" onmouseover="Javascript: mon(this);" onmouseout="Javascript: mou(this);"  onmouseclick="Javascript: mon(this);" >'.$bold.'</a><td>';
}

Link to comment
Share on other sites

Risinaajums:

...
$gal = $GLOBALS["gal"];
$ha = $_REQUEST["g"];
...
// ja galerijas masiiva elements == ar galerijas id ($ha jeb $_REQUEST["g"]), tad pieliek <b></b> tagus, citaadi - printee bez tiem (taatad - risinaajums bez JavaScripta, kaut gan likaas, ka bez taa neizdosies ieboldot sadalju)
for($i = 0; $i < $hmg; $i++){
if ($gal[$i][0] == $gal[$ha-1][0] && $_REQUEST["g"]==$ha) {
  $buf .= '<td height="40" align="center" valign="middle"><a id="mt1" href="./index.php?id=2&g='.($i+1).'" onmouseover="Javascript: mon(this);" onmouseout="Javascript: mou(this);"><b>'.$gal[$i][0].'</b></a><td>';}
else{
  $buf .= '<td height="40" align="center" valign="middle"><a id="mt1" href="./index.php?id=2&g='.($i+1).'" onmouseover="Javascript: mon(this);" onmouseout="Javascript: mou(this);">'.$gal[$i][0].'</a><td>';}
}

 

Triviaala situaacija ar triviaalu risinaajumu, kaut gan pamatiigi ieberzos! :)

Link to comment
Share on other sites

×
×
  • Create New...