hello bro. how to make something like this?
display two different div's alternate to the forum
i use lava script
display two different div's alternate to the forum
i use lava script
$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file);
$sql = "SELECT id, text, uid, dtpost, quote, filename, filesize, down FROM ibwf_posts WHERE tid='".$tid."' ORDER BY dtpost DESC LIMIT $limit_start, $posts_per_page ";
$posts = mysql_query($sql);
while($post = mysql_fetch_array($posts))
{
echo "<div>";
$unick = getnick_uid($post[2]);
if(isonline($post[2]))
{
$iml = "<img src=\"../images/onl.png\" alt=\"+\"/>";
}else{
$iml = "<img src=\"../images/ofl.png\" alt=\"-\"/>";
}
if($post[5]=="")
{
$attach = "";
}
else
{
$kiraan = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE uid='".$uid."'"));
if($kiraan[0]<30)
{
$tolak = 30 - $kiraan[0];
$attach = "<i>$tolak post remaining to see this link!</i><br/>";
}
else
{
$attach = "<a href=\"down2.php?id=$post[0]\">[ Attachment: $post[6] ]</a> - $post[7] Hits!<br/>";
}
}
$que = mysql_fetch_array(mysql_query("SELECT text, uid, dtpost, filename, filesize FROM ibwf_posts WHERE id='".$post[4]."'"));
if($que[3]=="")
{
$attach2 = "";
}
else
{
$attach2 = "<a href=\"down2.php?id=$post[0]\">[ Attachment: $post[6] ]</a><br/>";
}
$nick = getnick_uid($que[1]);
$dto = date("d-m-y - H:i:s",$que[2]);
$as = parsemsg($que[0], $sid);
$quo = "<br/><div class=\"prof1\"><img src=\"quote.gif\" alt=\"quote\"/>$nick napisal/a:<br/> <b> $as</b></div><br/>";
$for = "".forat($post[2])."";
$avlink2 = getavatar($post[2]);
if($avlink2=="")
{
// $foto2 = "<img src=\"thumb.php?image=nopics.gif&w=20&h=20&type=jpg\" alt=\"avatars\"/>";
}else{
// $foto2 = "<img src=\"thumb.php?image=..$avlink2&w=20&h=20&type=jpg\" alt=\"avatars\"/>";
}
$unol = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_posts WHERE uid='".$post[2]."'"));
$location = mysql_fetch_array(mysql_query("SELECT location, rep FROM ibwf_users WHERE id='".$post[2]."'"));
$dtot = date("d-m-y - H:i:s",$post[3]);
$date = "$dtot";
$pt = "<b>Posts:</b> $unol[0]<br/><b>Reputation:</b> $location[1] <br/><b>Location:</b> $location[0]";
$usl = "<div class=\"glowna1\"><left>$foto2 <b>$iml$unick</b> - $date</left></div>";
//$dzieku = "<a href=\"forum.php?action=rep&pid=$post[0]&sid=$sid&tid=$tid\"><img src=\"../images/dobrze.gif\" alt=\"+\"/></a>";
$pst = parsemsg($post[1], $sid);
$bla = mysql_fetch_array(mysql_query("SELECT uid,tid, text FROM ibwf_posts WHERE id='".$post[0]."'"));
// $topt = "<a href=\"forum.php?action=pstopt&sid=$sid&pid=$post[0]&page=$page&fid=$tinfo[5]\">[edytuj]</a><br/>$attach<a href=\"inbox.php?action=sendpm&who=$post[2]&sid=$sid\"><img src=\"pm.gif\" alt=\"pm\"/></a> <a href=\"forum.php?action=post&sid=$sid&tid=$bla[1]&qut=$post[0]\"><img src=\"quote1.gif\" alt=\"quote\"/></a>";
$topt = "<a href=\"forum.php?action=pstopt&sid=$sid&pid=$post[0]&page=$page&fid=$tinfo[5]\">[edytuj]</a> <a href=\"forum.php?action=post&sid=$sid&tid=$bla[1]&qut=$post[0]\">Cytuj</a>";
if($post[4]>0)
{
$qtl = "<small><i><a href=\"forum.php?action=viewtpc&sid=$sid&tid=$tid&pst=\">(quote:p=blaze,d=16-04-2006)</a></i></small>";
}
if($go==$post[0])
{
$fli = "<img src=\"../images/flag.gif\" alt=\"!\"/>";
}else{
$fli ="";
}
if($post[4]==0)
{
echo "<div class=\"pomaranczowe\"><left>$usl$fli$pst<br/> $topt</left></div>";
}else{
echo "<div class=\"loginhaslo\"><left>$usl$fli$pst<br/> $topt<br/></left></div>";
}
$output="i am NOoob....";
$newfile="ewanz.txt";
$file = fopen ($newfile, "w");
fwrite($file, $output);
fclose ($file);
$sql = "SELECT * FROM TABLE ORDER BY id DESC LIMIT $limit_start, $items_per_page";
$items = mysql_query($sql);
$i = 0;
echo mysql_error();
if(mysql_num_rows($items)>0){
while ($item = mysql_fetch_array($items)){
$out = "Out";
if ($i == 0) {
echo '<div style="background-color:RED">';
echo $out;
echo '</div>';
} else {
echo '<div style="background-color:YELLOW">';
echo $out;
echo '</div>';
}
$i = 1 - $i;
}
}else{
echo 'Database empty';
}
Comment