Jump to content
GIGN Forum

Php/html.. Or Maybe Js... Dunno :(


shine
 Share

Recommended Posts

Lieta taada... ka es beidzot atcereejos... par savu iesaakto modu... vinju var atrast sheit pat forumaa.. searchojot ar shaadiem keywordiem: release live chat

So... man ir tads jautaajums(visur izmekleejos.. zinu, ka nemaaku iisti mekleet XD). Es ielieku lapaa bildiiti.. man vaig.. ja kads uz vinjas uziet(nevis uzklikshkjina) ar peli > paraadiitos, kas liidziigs PopUp'am. Nejau kaa windows... bet vienkarshi displayotu lapas viduu citu php failu. Tikko nokjem peli no pogas.. tad tas pazustu. Nu neesmu arii no labakajiem skaidrotaajiem :lol::(. Megjinaashu to izskaidrot savaadaak.

Man ir php fails... index.php

Man ir fails > popup.php

Popup.php ir image(apaljiigs), kuraa ir sarakstiits teksts.

index.php ir image(poga or smth) uz kuras uzejot index.php lapas vidu paraadiitu popup.php, bet nejau windowaa. Varteikt paradiitu apaljo image ar tekstu viduu.

Kursors, kas neatrodas uz pogas>

image1copydc9.jpg

Kursors, kas atrodas uz pogas>

image2copycv6.jpg

Minimaali no html/php saprotu... iespeejams, ka tas ir paveicams ar JS..(ljoti iespeejams). Pats to izveidot nevareeshu :(... so, ceru, ka vareesiet paliidzeet... paargudriishiem, kuri paziist google tanti > Man nevaig, lai jus vinju iepaziistinaatu ar mani :P. So ceru uz atsauciibu.. mans 5-6topiks... un 1000+ posti :o.

Link to comment
Share on other sites

Pirmais, kas ienāca prātā, ļoti primitīvi, bet tev derēs:

<img src="http://www.blahblah.lv/poga.jpg" onmouseover="diva_nosaukums.style.display=''" onmouseout="diva_nosaukums.style.display='none'" alt="nemiiz" />
<div id="diva_nosaukums" style="display:none;">
<?php include('popup.php'); ?>
</div>

Link to comment
Share on other sites

<script type="text/javascript">
function linkTo(y)
{
var x=window.open("LINKS.php","","scrollbars=yes,width=275,height=200")
x.location.hash=y
}

</script>
</head>

<body>
<h1 align="center"><big><input type="button" value="Podzinna" onclick="linkTo(0)"></big></h1>
</body>

Cik sapratu tev vaig sito rekur sitas varetu deret :) nomaini izmerus un links.php

Edited by GOMA smile
Link to comment
Share on other sites

Hmm.. nu es negribeetu lieki sarezhgjiit visu ar ajax... skatos to pashu var panakt arii vienkarshi ar html/php. Tad nu izmantoju dupleta snippetu. Uztaisu jaunu failu: file.php>

<html>

<head>

<title>lol</title>

</head>

<body>

<img src="img/poga.jpg" onmouseover="diva_nosaukums.style.display=''"

onmouseout="diva_nosaukums.style.display='none'" alt="nemiiz" />

<div id="diva_nosaukums" style="display:none;">

<?php include('popup.php'); ?>

</div>

</body>

</html>

Ierakstu sho. Viss iet ideaali. popup.php es iebaazu <img...>. So uzejot uz pogas paraadas bildiite. Tur viss ir kartiibaa... tikko es meegjinu to pashu iebaazt index.php... tur kur pilns ar visaadiem kjeburiem... tad neraada... Uztaisiiju papildus style sheet, jo vaig, lai vinjsh kruti staav lapas stuurii(poga). Nelieku css ieksh php, jo man tur diezgan daudz visaadu formateejumu. Ieliku dupleta kodu tieshi zem <body>. Protams saliku attieciigaas lietas kaa image src e.c. Varteikt ieliku to pashu, kas ir example nedaudz augstaak... visu kas ir starp <body> un </body> es ieliku zem index.php <body>... Poga smuki staav stuuriiti.. taa aizdomiigi skataas uz mani... es bailiigi ar kursoru uzeju vinjai virsu... un nekas nenotiek :o. Kapec?

Kodu pieliku attachmentaa :S... Tagad luudzu nebrauciet virsu, ka es esmu kaut ko ar tagiem sajaucis vai ko taadu.. esmu galiigs iesaaceejs weba jomaas :(.

code.zip

Edited by shine
Link to comment
Share on other sites

Liels paldies :). Viss chiki niekaa :). Liels paldies arii tiem, kas meegjinaaja paliidzeet :). Um.. lai netaisiitu jaunu topiku sazin veel kur... Kads lielisks mekleetaajs vai cilveeks, kas parzin js.. vareetu uztaisit ieprieksh dotajam php skriptam, lai refresho tikai PHP dalju? Or iedodiet kaadu labu piemeru/paraugu :S.

Link to comment
Share on other sites

Nekas man nesanaaca <_< XD... as always... izmekleeju visu php.lv.. itka daudzi linki ar visaadiem shitiem.. bet man vai nu negaaja vai arii kaut kaa tur pa maz info.. tur visi attiecas itka tie, kas lasa visu zinaatu <_<.. nu anyway. Paldies par paliidziibu.. jaameegjina kaut kaa izzurbties shim buļsūdam cauri... Maybe kaadam atrastos preciizs links :o.. kur viss kaa galiigam iesaaceejam ir izskaidrots? :o :S

Link to comment
Share on other sites

Manuprāt skaidrot var tikai arhitektūru, nevis sintaksi.

Es tev iedevu strādājošu piemēru, tiešām, ir tik grūti paņemt un paskatīties sourci un padomāt kas un ko dara?

Te nu atkal tev ir divas iespējas:

1) uzticēt kādam to izdarīt tavā vietā, protams, par attiecīgu samaksu

2) sākt skatīties un mācīties pašam (uz šito tu esi gatavs tikai virspusēji, kā redzu)

Link to comment
Share on other sites

Skačai Prototype

<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript">
  window.onload=function(){
    window.setTimeout("updatedata()",60000); // Pēc minūtes palaidīs apdeitošanas funkciju
  }
  function updatedata(){ // Apdeitošanas funkcija
    new Ajax.Updater('jauks_divs','jaunā_teksta_fails.php'); // ajax klase no prototype
  }
</script>
<div id="jauks_divs">
Teksts.
</div>

Link to comment
Share on other sites

Nekas neiet... maybe jataisa php skripts atsevishkjaa failaa? Dog, nu nevaru neko uztaisit.. vispar nekas nesanaak XD. Es lieku divos... iekshaa.. daru visu, kas jadara... nevajadzeeja saakt kaut kaadu modu saistiiba ar webu.. tas visu bremzee... =/. Nu maybe kads var pateikt Kur ir kljuda? Nelieku nevienam tagad visu code sataisit.. pasakat apmeram kur ir kljudinja?

CODE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Counter-Strike Live Chat by Sh!nE*</title>

<!--<meta http-equiv="refresh" content="1"/>-->

<link rel="stylesheet" type="text/css" href="style/style.css" media="screen">

<script type="text/javascript" src="prototype.js"></script>

<script type="text/javascript">

window.onload=function(){

window.setTimeout("updatedata()",1000);

}

function updatedata(){

new Ajax.Updater('refresher','index.php');

}

function $(eid){

return document.getElementById(eid);

}

function show(){

$('popup').style.display='block';

}

function hide(){

$('popup').style.display='none';

}

window.onload=function(){

var button = $('button');

button.onclick=function(){

return false;

}

button.onmouseover=function(){

show();

}

button.onmouseout=function(){

hide();

}

}

</script>

</head>

<body>

<div id="scoreboard">

<a id="button" href="#popup"><img src="img/poga.jpg"></a>

</div>

<div id="popup" style="display:none;"><?php include('popup.php'); ?></div>

<div id="credit">

<img src="img/credit.gif">

</div>

<div id="upbar">

<img src="img/up_bar.png">

</div>

<div id="refresher">

<div id="chat">

<?php

$dbvards = 'localhost';

$dblietotajs = 'root';

$dbparole = 'parole';

$dbnosaukums = 'db';

$defaultimage = 'img/maps/noimage.jpg';

$conn = mysql_connect($dbvards, $dblietotajs, $dbparole) or die ('Nevar pieslegties!');

mysql_select_db($dbnosaukums) or die('Nevar tikt pie db!');

$query = 'SELECT * FROM chats ORDER BY rownum DESC LIMIT 5';

$result = mysql_query($query) or die('Query failed: ' . mysql_error());

while($row = mysql_fetch_array($result, MYSQL_ASSOC))

{

echo "<b>";

echo "{$row['lastentry1']}";

echo "</b>";

echo "<br>";

}

echo "</div>";

echo "<div id='winmsg' align='center'>";

$query2 = 'SELECT winmsg FROM wins';

$result2 = mysql_query($query2) or die('Query failed: ' . mysql_error());

while($row2 = mysql_fetch_array($result2, MYSQL_ASSOC))

{

echo "<b>";

echo "{$row2['winmsg']}";

echo "</b>";

}

echo "</div>";

$query3 = 'SELECT * FROM mapname';

$result3 = mysql_query($query3) or die('Query failed: ' . mysql_error());

while($map = mysql_fetch_array($result3, MYSQL_ASSOC))

{

echo "<div id='map'>";

echo "<b><font size='2' color='#ffb000'>{$map['name']}</font></b>";

echo "</div>";

if(file_exists("img/maps/{$map['name']}.jpg")) {

echo "<style type='text/css'>";

echo "body {";

echo "background: url(/img/maps/{$map['name']}.jpg) no-repeat;";

echo "background-attachment:fixed;";

echo "background-position: 0px 0px;";

echo "}";

echo "</style>";

} else {

echo "<style type='text/css'>";

echo "body {";

echo "background: url($defaultimage) no-repeat;";

echo "background-attachment:fixed;";

echo "background-position: 0px 0px;";

echo "}";

echo "</style>";

}

$query4 = 'SELECT * FROM wins';

$result4 = mysql_query($query4) or die('Query failed: ' . mysql_error());

while($wins = mysql_fetch_array($result4, MYSQL_ASSOC))

{

echo "<div id='ct'>";

echo "<b><font size='2' color='#ffb000'>{$wins['ct']}</font></b>";

echo "</div>";

echo "<div id='ts'>";

echo "<b><font size='2' color='#ffb000'>{$wins['ts']}</font></b>";

echo "</div>";

}

$query5 = 'SELECT * FROM roundtime';

$result5 = mysql_query($query5) or die('Query failed: ' . mysql_error());

while($rtime = mysql_fetch_array($result5, MYSQL_ASSOC))

{

echo "<div id='roundtime'>";

echo "<b><font size='2' color='#ffb000'>{$rtime['time']}</font></b>";

echo "</div>";

}

}

mysql_free_result($result);

mysql_close($conn);

?>

</div>

</body>

</html>

Paldies par paliidziibu.. sapratiishu, ja pa daudz prasi =/.

Edited by shine
Link to comment
Share on other sites

Jaa un ieliku taja pashaa mape kur shis php fails..

EDIT: Aizmirsu piebilst..

new Ajax.Updater('refresher','chuu.php');

Bija testiem.. vai savaadak iet.. tapec pagaidam vinjsh ir:

new Ajax.Updater('refresher','index.php');

Iisti nesaprotu kapec vaig kaadu php tur.. man vaig, lai php dalju refresho tajaa pashaa failaa. :S :o

Edited by shine
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...