Jump to content

Iosys

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Everything posted by Iosys

  1. Thanks Pickachu, that worked for what I wanted to do and wasn't that hard to implement.
  2. Thanks for the advice but how would I do that? I'm note sure how i would make it to not show certain row based on first value for that row?
  3. No i don't want to add a button to be clicked to hide or display? I have reason for wanting row to hide if value in column is something
  4. No i just assume it can be done with javascript and I don't know if it's possible with anything else but if there is a better way i would love to hear about it. thanks for reply!
  5. I'm wondering how to do this with javascript for a table that i have made in php and html. I want to hide the row for the table based on the value inside my first column for each row of the table. Like if column 1 has "apple" inside it, then the row would not be shown. I'm pretty sure this can be done in javascript but i'm not a coding guy, so any help would be appreciated! My table.php file that has the table i want to do this for: <script language="javascript"> imageX1='plus'; imageX2='plus'; imageX3='plus'; function toggleDisplay(e){ imgX="imagePM"+e; tableX="table"+e; imageX="imageX"+e; tableLink="tableHref"+e; imageXval=eval("imageX"+e); element = document.getElementById(tableX).style; if (element.display=='none') {element.display='block';} else {element.display='none';} if (imageXval=='plus') {document.getElementById(imgX).src='http://www.pvpstreams.com/icons/wowicon.png';eval("imageX"+e+"='minus';");document.getElementById(tableLink).title='Hide WoW';} else {document.getElementById(imgX).src='http://www.pvpstreams.com/icons/wowicon.png';eval("imageX"+e+"='plus';");document.getElementById(tableLink).title='Show WoW';} } </script> <?php $username="user"; $password="password"; $tmp="database"; mysql_connect(localhost,$username,$password); @mysql_select_db($tmp) or die( "Unable to select database"); $query="SELECT * FROM users"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> <table class="sortable" id="wow" border="1" cellpadding="0" cellspacing="0" style="margin-left:auto;margin-right:auto;text-align:left"> <tr> <th><font face="Arial, Helvetica, sans-serif">Game</font></th> <th><font face="Arial, Helvetica, sans-serif">Character</font></th> <th><font face="Arial, Helvetica, sans-serif">Rating</font></th> <th><font face="Arial, Helvetica, sans-serif"><img src="http://www.pvpstreams.com/table-images/xfirelogo.png"> Status</font></th> <th><font face="Arial, Helvetica, sans-serif"><img src="http://www.pvpstreams.com/table-images/xfirelogo.png"> Link</font></th> <th><font face="Arial, Helvetica, sans-serif">Realm</font></th> <th><font face="Arial, Helvetica, sans-serif"><img src="http://www.pvpstreams.com/table-images/livestreamlogo.png"> Status</font></th> <th><font face="Arial, Helvetica, sans-serif"><img src="http://www.pvpstreams.com/table-images/livestreamlogo.png"> Link</font></th> <th><font face="Arial, Helvetica, sans-serif">Team Setup</font></th> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"wowcharacter"); $f2=mysql_result($result,$i,"username"); $f3=mysql_result($result,$i,"livestream"); $f4=mysql_result($result,$i,"wowserver"); $f5=mysql_result($result,$i,"wowplayer1"); $f6=mysql_result($result,$i,"wowplayer2"); $f9=mysql_result($result,$i,"wowplayer3"); $f7=mysql_result($result,$i,"wowrealm"); $f8=mysql_result($result,$i,"xfire"); $f10=mysql_result($result,$i,"xfirecheck"); $f11=mysql_result($result,$i,"wowrating"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><?php echo "<center><img src=http://www.pvpstreams.com/table-images/wowtable.png>"; ?></center></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo "<a class=blue href=http://$f4.battle.net/wow/en/character/$f7/$f1/simple>$f1</a>"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f11; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo "$f10"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo "<a class=blue href=http://www.pvpstreams.com/xfire.php?user=$f2>$f8</a>"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f7; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php include("livestreamcheck.php"); ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo "<a class=blue href=http://www.pvpstreams.com/livestream.php?user=$f2>$f3</a>"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo "<img src=http://www.pvpstreams.com/wclassicons/$f5.png><img src=http://www.pvpstreams.com/wclassicons/$f6.png><img src=http://www.pvpstreams.com/wclassicons/$f9.png>" ?></font></td> </tr> <?php $i++; } ?> </table>
  6. The delay isn't really the issue to me at all if I can get the things after the code to load before. I'll try to explain the problem more of why its an issue if I didn't really explain it good to begin with. The delay is bad because its blocking the rest of the page to load which to me is the layout and makes the page look weird by not showing rows or columns in the layout. When the php is done loading it does the layout in an instant which makes it look good again. My site is pvpstreams.com and you can see what i mean by looking at how it shifts to right in beginning and then goes back to center. So i'm trying to get the stuff in middle to load last, after the layout.
  7. thanks for the reply, I'm a very new beginner with php and I'm still having issues. If I insert <?php $table_content = include('table/table.php'); ?> at the top of the paqe, the data loads first but it shows up where i insert that code
  8. I'm trying to control the load order of the browser. The default load order is from top to bottom. Well I have a table that is made in html with more code bellow the table. My php data that I put inside the html table is <?php include("table/table.php"); ?> that grabs the data that will go into my html table. Well the problem I'm having is that the rest of the table with stuff under the table won't load till the php is done being processed. This makes my site look weird for 4 seconds and is the reason why I want to load the php content last. Is there a way to do this with php or javascript?
  9. After fooling around, I believe i need a space between $f3 but i'm not sure how to do it without creating %20 I'm very new to php :-\
  10. I'm trying to get stream to show if online or offline, the check.php works just fine if i don't have "$f3" in line 5 but I need to collect from array and put into there. Usually the array works just fine but this time it's not Well anyway the error I'm getting is Warning: DOMDocument::load() [domdocument.load]: Couldn't resolve host name in /home/dahdop/public_html/pvpstreams.com/table/check.php on line 5 Warning: DOMDocument::load(http://x.api.channel.livestream.com/2.0/livestatus.xml) [domdocument.load]: failed to open stream: operation failed in /home/dahdop/public_html/pvpstreams.com/table/check.php on line 5 Warning: DOMDocument::load() [domdocument.load]: I/O warning : failed to load external entity "http://x.api.channel.livestream.com/2.0/livestatus.xml" in /home/dahdop/public_html/pvpstreams.com/table/check.php on line 5 Offline | Viewers: To me its taking away an "x" and making the array blank for some reason. My site is pvpstreams.com if you want to see error in action. My table.php file <script language="javascript"> imageX1='plus'; imageX2='plus'; imageX3='plus'; function toggleDisplay(e){ imgX="imagePM"+e; tableX="table"+e; imageX="imageX"+e; tableLink="tableHref"+e; imageXval=eval("imageX"+e); element = document.getElementById(tableX).style; if (element.display=='none') {element.display='block';} else {element.display='none';} if (imageXval=='plus') {document.getElementById(imgX).src='http://www.pvpstreams.com/icons/wowicon.png';eval("imageX"+e+"='minus';");document.getElementById(tableLink).title='Hide WoW';} else {document.getElementById(imgX).src='http://www.pvpstreams.com/icons/wowicon.png';eval("imageX"+e+"='plus';");document.getElementById(tableLink).title='Show WoW';} } </script> <?php $username="x"; $password="x"; $tmp="x"; mysql_connect(localhost,$username,$password); @mysql_select_db($tmp) or die( "Unable to select database"); $query="SELECT * FROM users"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> <table class="sortable" id="wow" border="1" cellpadding="0" cellspacing="0" style="margin-left:auto;margin-right:auto;text-align:left"> <tr> <th><font face="Arial, Helvetica, sans-serif">Character</font></th> <th><font face="Arial, Helvetica, sans-serif">Xfire</font></th> <th><font face="Arial, Helvetica, sans-serif">Livestream</font></th> <th><font face="Arial, Helvetica, sans-serif">Livestream Status</font></th> <th><font face="Arial, Helvetica, sans-serif">Team Members</font></th> <th><font face="Arial, Helvetica, sans-serif">Realm</font></th> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"wowcharacter"); $f2=mysql_result($result,$i,"username"); $f3=mysql_result($result,$i,"livestream"); $f4=mysql_result($result,$i,"wowserver"); $f5=mysql_result($result,$i,"wowplayer1"); $f6=mysql_result($result,$i,"wowplayer2"); $f9=mysql_result($result,$i,"wowplayer3"); $f7=mysql_result($result,$i,"wowrealm"); $f8=mysql_result($result,$i,"xfire"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><?php Echo "<a class=blue href=http://$f9.battle.net/wow/en/character/$f7/$f1/simple>$f1</a>"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php Echo "<a class=blue href=http://www.pvpstreams.com/xfire.php?user=$f2>$f8</a>"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo "<a class=blue href=http://www.pvpstreams.com/livestream.php?user=$f2>$f3</a>"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"> <?php include("check.php"); ?> </font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo "<img src=wclassicons/$f5.png><img src=wclassicons/$f6.png><img src=wclassicons/$f9.png>" ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f7; ?></font></td> </tr> <?php $i++; } ?> </table> My check.php file <?php $objDOM = new DOMDocument(); // channel name here **INSERT** $objDOM->load("http://x$f3x.api.channel.livestream.com/2.0/livestatus.xml"); //make sure path is correct $channel = $objDOM->getElementsByTagName("channel"); foreach( $channel as $value ) { $isLives = $value->getElementsByTagName("isLive"); $isLive = $isLives->item(0)->nodeValue; $viewers = $value->getElementsByTagName("currentViewerCount"); $viewer = $viewers->item(0)->nodeValue; } if($isLive == "true") { echo "<font color='#00FF00'>Online</font>"; echo " | Viewers: " . $viewer; } else { echo "<font color='#FF0000'>Offline</font>"; echo " | Viewers: " . $viewer; } ?> Any help appreciated!
  11. My question is more of how do i use php to check a different server (livestream or xfire's site) that isn't mine and find out if the user is streaming or not. Like this user as example: http://www.xfire.com/live_video/boxxyilu/ he is offline and I'm wondering how i would retrieve that information using php/curl? then with that information hide my row in table
  12. I'm sad that I'm not getting replies, I really am just seeking advice for where to go, to read up on how to do what I'm trying to do. Anyone have any good books or tutorials for what I'm trying to do?
  13. Hello I'm a noob when it comes to writing code so please understand. My site is pvpstreams.com It's in development and the goal is to make it into a portal of different games that are being streamed on the web. So gamers can find streams with stats for certain games easy. Now my problem is that I'm trying to make a new column for my table which will display an image for when a user's stream is online, like a lightbulb. When stream is offline it will not show the row for the user. The main stream sites I'm creating the table for are xfire.com and livestream.com Here is my table.php file. <script language="javascript"> imageX1='plus'; imageX2='plus'; imageX3='plus'; function toggleDisplay(e){ imgX="imagePM"+e; tableX="table"+e; imageX="imageX"+e; tableLink="tableHref"+e; imageXval=eval("imageX"+e); element = document.getElementById(tableX).style; if (element.display=='none') {element.display='block';} else {element.display='none';} if (imageXval=='plus') {document.getElementById(imgX).src='http://www.pvpstreams.com/icons/wowicon.png';eval("imageX"+e+"='minus';");document.getElementById(tableLink).title='Hide WoW';} else {document.getElementById(imgX).src='http://www.pvpstreams.com/icons/wowicon.png';eval("imageX"+e+"='plus';");document.getElementById(tableLink).title='Show WoW';} } </script> <?php $username="myusername"; $password="mypassword"; $tmp="myserver"; mysql_connect(localhost,$username,$password); @mysql_select_db($tmp) or die( "Unable to select database"); $query="SELECT * FROM users"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); ?> <table class="sortable" id="wow" border="1" cellpadding="0" cellspacing="0" style="margin-left:auto;margin-right:auto;text-align:left"> <tr> <th><font face="Arial, Helvetica, sans-serif">Character</font></th> <th><font face="Arial, Helvetica, sans-serif">Xfire</font></th> <th><font face="Arial, Helvetica, sans-serif">Livestream</font></th> <th><font face="Arial, Helvetica, sans-serif">Team Members</font></th> <th><font face="Arial, Helvetica, sans-serif">Realm</font></th> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"wowcharacter"); $f2=mysql_result($result,$i,"username"); $f3=mysql_result($result,$i,"livestream"); $f4=mysql_result($result,$i,"wowserver"); $f5=mysql_result($result,$i,"wowplayer1"); $f6=mysql_result($result,$i,"wowplayer2"); $f9=mysql_result($result,$i,"wowplayer3"); $f7=mysql_result($result,$i,"wowrealm"); $f8=mysql_result($result,$i,"xfire"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><?php Echo "<a class=blue href=http://$f9.battle.net/wow/en/character/$f7/$f1/simple>$f1</a>"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php Echo "<a class=blue href=http://www.pvpstreams.com/xfire.php?user=$f2>$f8</a>"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo "<a class=blue href=http://www.pvpstreams.com/livestream.php?user=$f2>$f3</a>"; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo "<img src=wclassicons/$f5.png><img src=wclassicons/$f6.png><img src=wclassicons/$f9.png>" ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f7; ?></font></td> </tr> <?php $i++; } ?> </table> I'm thinking that I have to somehow request xfire or livestream's server if it's streaming for the user. From browsing the web I think this can be done with php and curl but I'm not sure how and I'm a beginner in coding. Any help would be greatly appreciated.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.