Jump to content

dzhax

Members
  • Content Count

    363
  • Joined

  • Last visited

Everything posted by dzhax

  1. I am working on a website for a video game streamer I watch and sometimes he plays with other streamers and viewers want to watch them both or in some cases more than 2, all play at the same time. So there are sites that do "dual streams" that will allow you to show both videos on the same page. My idea was to make something similar but scale-able to however many streams are needed. So far I have js functions with all the HTML needed add the video player but not sure how i would add a new video to the page without having to refresh. I am using the document.getElementByID('streams').innerHTML = mainStream()+newStream(); right now to manually show the primary stream and a image to click on to add another stream. function mainStream() { result = "\t<div id=\"stream1\" class=\"td stream\">\n"+ "\t\t<object type=\"application/x-shockwave-flash\" class=\"stream-object\" data=\"http://www.twitch.tv/widgets/live_embed_player.swf\" width=\"100%\" height=\"100%\" style=\"visibility: visible; \">\n"+ "\t\t<param name=\"allowFullScreen\" value=\"true\">\n"+ "\t\t<param name=\"allowScriptAccess\" value=\"always\">\n"+ "\t\t<param name=\"allowNetworking\" value=\"all\">\n"+ "\t\t<param name=\"wmode\" value=\"transparent\">\n"+ "\t\t<param name=\"flashvars\" value=\"hostname=www.twitch.tv&channel=the_black_russian&auto_play=true&start_volume=100\"></object>\n"+ "\t</div>\n"; return(result); } function newStream(streamNum) { result = "\t<div id=\"stream"+streamNum+"\" class=\"td newStream\" onclick=\"getStream()\">\n"+ "\t\t<img src=\"lib/new_stream.fw.png\" style=\"width:100%; height:100%\" alt=\"new stream\" title=\"Click to open a new stream...\" />\n"+ "\t</div>\n"; return(result); } In hard code it would look like this when printed: <div id="streams"> <div id="stream1" class="td stream" style="width: 301px; height: 169.3125px;"> <object type="application/x-shockwave-flash" class="stream-object" data="http://www.twitch.tv/widgets/live_embed_player.swf" width="100%" height="100%" style="visibility: visible; "> <param name="allowFullScreen" value="true"> <param name="allowScriptAccess" value="always"> <param name="allowNetworking" value="all"> <param name="wmode" value="transparent"> <param name="flashvars" value="hostname=www.twitch.tv&channel=the_black_russian&auto_play=true&start_volume=100"></object> </div> <div id="stream2" class="td newStream" onclick="getStream()" style="width: 301px; height: 169.3125px;"> <img src="lib/new_stream.fw.png" style="width:100%; height:100%" alt="new stream" title="Click to open a new stream..."> </div></div> What I am looking to do is when someone triggers getStream() for it to add another stream and list the newStream() code last. This would make the new stream #2 and push the open a new stream part to stream #3. I also would like to add in functionality to close a specific stream. Any help is much appreciated! If I did not explain enough please let me know I will try my best to fill in any details I may have missed.
  2. thanks for that. a second pair of eyes is needed sometimes. I hate case sesitive code...
  3. ok so i guess the answer is no. @davej: Actually the billing system is web based but it is not run in a "browser" it runs in a program the makes (most likely an ie based browser) to load the page in. I dont have access to the backend of the system so I am just trying to work with what i have. They disabled viewing the source of the page otherwise i was going to try and load the page in a normal browser and inject code into it as needed. I guess I am going to have to make a compiled program to do what i need. or possibly vbscript (which i have absolutly no experience in but i know a little visual basic)
  4. I thought I would get creative with my title tonight. I am trying to set a cookie when a page loads and it will not set. <?php if(isset($_GET['directlink'])){ $expire=time()+60*60*10; //set expire 10 minutes from now setcookie("directLink", $_GET['directLink'], $expire); }?> Is there something im missing? I have been staring at this code for 30 mins now. if i echo $_Cookie['directLink']; it doesnt print anything to the screen its as if its not even being set. Some help will be much appriciated.
  5. Im basically trying to make a macro that targets the billing system application application and types into the textarea for the user. Its not editing a file/document its filling out a field in an .exe Basically can a javascript take control of the keyboard to insert text into another program. to answer Niche.Yes it will be the desktop currently being used not in another location. I do not have a webserver so i need something that i can copy to my desktop and open when needed.Due to security software on the pcs it can't be a .exe or it will be deleted. Thats why i figured my best bet is a web-based solution
  6. Is it possible to use javascript to send keystrokes to a desktop application. We have a billing system at work and they recently insituted standardized notes. So I wanted to make a html form that I can just fill out and press a button to write it to the textarea in the billing system. I currently use a program called Type It In to do similar operations but its not web based and is not flexible enough to do what I am trying to accomplish. Any help or direction on this will be much appriciated. I was planning on doing something like <form> Customer Name: <input type="text" id="custName" /><br/> Initial Reason for Call: <textarea id="callReason"></textarea><br/> Resolution:<br/> Action(s) Taken: <textarea id="actionsTaken"></textarea><br/> Trouble Ticket: <input type="text" id="troubleTicket" /><br/> Escalation Ticket: <input type="text" id="escalationTicket" /><br/> Order Confirmation Number: <input type="text" id="orderNum" /><br/> Appointment Date/Time: <input type="text" id="aptDateTime" /><br/> Additional Information:<br/> Product Offer/Education: <textarea id="productOffer"></textarea><br/> Self Help Options: <textarea id="selfHelp"></textarea><br/> Other: <textarea id="otherInfo"></textArea><br/> <input type="button" onclick="push2BillingSystem()" value=" /></form>
  7. sorry but that is not working. infact i dont even think its being called. Is this not a proper format? <div onclick="page2Load('index.php'); updateSelected(this);" id="index.php">index.php</div> I added alert('Is this working?'); to the beginning of the function and it never alerted.and yes I did change the <span>'s into <div> tags.
  8. Got another question. I need a function that will onclick give the current <span> tag a classname of "selected" while at the same time checking other <span> tags and removing the "selected" class from it. Since only one item can be selected at a time. I am printing the list of <spans> like so: <td id="pagesListed" style="width: 175px; background-color:rgba(205,205,205,25); color:dimgray;"> Pages: <hr style="color:dimgray;"/> <? $pageResult = getDirectoryList('../../../lib/pages'); asort($pageResult); foreach($pageResult as $key => $value){ echo "<span id=\"".$value."\" onclick=\"page2Load('".$value."'); updateSelected(this);\">".$value."</span><br/> \r\n"; $key_temp = $key; } $defaultPage = 'index.php'; ?></td> For those of you that are not fluent in php here is what will print when run. <td style="width: 175px; background-color: rgb(205, 205, 205); color: dimgray;" id="pagesListed"> Pages: <hr style="color: dimgray;"/> <span onclick="page2Load('404.php'); updateSelected(this);">404.php</span><br/> <span onclick="page2Load('biography.php'); updateSelected(this);">biography.php</span><br/> <span onclick="page2Load('computer-repair.php'); updateSelected(this);">computer-repair.php</span><br/> <span onclick="page2Load('construction.php'); updateSelected(this);">construction.php</span><br/> <span onclick="page2Load('contact-us.php'); updateSelected(this);">contact-us.php</span><br/> <span onclick="page2Load('custom-computers.php'); updateSelected(this);">custom-computers.php</span><br/> <span onclick="page2Load('demonstrations.php'); updateSelected(this);">demonstrations.php</span><br/> <span onclick="page2Load('home.php'); updateSelected(this);">home.php</span><br/> <span onclick="page2Load('ie6.php'); updateSelected(this);">ie6.php</span><br/> <span onclick="page2Load('ie7.php'); updateSelected(this);">ie7.php</span><br/> <span onclick="page2Load('index.php'); updateSelected(this);">index.php</span><br/> <span onclick="page2Load('upgrade-center.php'); updateSelected(this);">upgrade-center.php</span><br/></td> From what i understand function updateSelected(obj){ obj.classname="selected";} should suffice for setting the class but i have no idea how i would check for other spans currently displaying class=selected.and being that the class selected is such a generic name I would also need it to be limited check only under the parent element with id "pagesListed". Any help on this would be awesome.
  9. That worked. Thanks! Still not sure why what I previously had did not work in firefox... but oh well
  10. While waiting for some help I started poking around other posts and found someone trying something remotely similar to what I am trying to acheive http://w3schools.invisionzone.com/index.php?showtopic=42311 So I messed around with the code provided to them and tweaked it for my needs and I sort of got it working. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/jquery-ui.min.js"></script><script type="text/javascript"> function page2Load(pageName){ document.getElementById('currentFileName').innerHTML = 'File Name: '+pageName; output = document.getElementById("htmlEditorForm"); var url = "processPage.php"; $.post(url,{ fileName: pageName } , function(data) { output.innerHTML = '<textarea id="htmlContent" name="content" cols="100" rows="15" >'+data+'</textarea>'; }); } </script> ... <div id="currentFileName" style="text-align: left;"> File Name: <?= $defaultPage ?></div><form id="htmlEditorForm"> <textarea id="htmlContent" name="content" cols="100" rows="15" ><?= file_get_contents('../../../lib/pages/'.$defaultPage) ?></textarea></form> The only problem I am having now is the code will run and update in IE9 just fine. But open it in Firefox 11 and the only thing that runs updating the FIle Name listed above the textbox. Is the code deprecated or not supported in firefox? If so what do i need to change to make it cross-browser friendly.
  11. I am trying to load the source of a page into a text area.(I'm making an online file editor) I have searched all over the web using about 3+ different methods and still unable to get this to work. I need to have a function like so function page2Load(pageName){...} that gets called when clicking on a page name I have listed on the page. (I have that part down pack). From there i need to use Ajax to load the SOURCE of a local phpfile, as if i were to load the page into a browser and right-click and select view source. Below is some of what I have tried $.get('processPage.php?fileName='+pageName, function(data){ document.getElementById('htmlContent').innerText = data;});...var xmlhttp; if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById('htmlContent').innerText = xmlhttp.responseText; }else{ alert('ERROR: ' + xmlhttp.status + ' -> ' + xmlhttp.statusText); }}xmlhttp.open("GET", "processPage.php?fileName="+pageName, true);xmlhttp.send();...$('<iframe id="tempFrame" />').attr('src', 'processPage.php?fileName='+pageName);fileSource = $('#tempFrame').attr('src');$('#htmlContent').val(fileSource);$('#tempFrame').remove(); None of those worked. The only one that kind of came close was the second one, but it kept saying it could not find the file alerting error 404. but the files are there. Any help on this matter is greatly appriciated EDIT: Forgot to add I'm calling JQuery like so and it is located above all the above mentioned code on my page. <script src="http://code.jquery.com/jquery-latest.min.js" ></script>
  12. dzhax

    advanced dynamic images

    GD2 is a bust also. nothing about multiple images. Starting to think this isnt possible...
  13. dzhax

    advanced dynamic images

    currently using GD to make the image. its so i can call an img tag and put a url in the src field to display it. @birbal ill take a look at GD2. Yes that is exactly what im looking to do also adding text here and there also I might need to add more than just the avatar image wise to it also.
  14. you already have xampp why dont you get a dyndns or no-ip redirect to your pc and run it at home?
  15. dzhax

    advanced dynamic images

    Thanks for the suggestion SoltBeings but, unless i read it wrong you can't display multiple at the same time. That is more for like multiple sizes of the same image or displaying an image style button (on/off) look of the button. Correct me if im wrong.
  16. I am working on a dynamic image script for someone and I need to have a background image and also load an avatar image also. Is this possible? All the documentation i can find only shows background images that cover the whole image. Also if this make any difference the avatar must be loaded on the fly from the database becasue it can change. It is basically a online "trading card" that displays the users avatar and their stats with a nice background image.
  17. I was thinking XML at first but it would need to be an ajax request and I've never worked with XML before.
  18. I am working on a website for my work but they will not give me a webserver. So basically I have to run it off a fileshare. This limits me to HTML, Javascript, and CSS formats to get anything done. I need to be able to accept data entered into a form and store it somewhere so it can later be queried for analysis in another website type format. Any suggestions? Somethings to keep in mind also so you know what I'm working with here. - older dell workstations running XP- IE7 is the only browser we are able to use on the work machines- No web server access or ability to pull in data from outside resources since the machines do not have internet access.
  19. thanks james that was it.
  20. thanks for the prompt response. Maybe it needs to be different if i am using it with php? I tried that code and it doesn't appear to work. <? include('lib/sql.dat'); $connection = mysql_connect($server,$username,$password) or die('unable to connect'); mysql_select_db($database,$connection); if (($_GET['status'] == 'Official') or ($_GET['status'] == 'NSF')){ $tko = strpos($_GET['winningMethod'],'TKO'); if($tko === true) { // TKO found in winningMethod $fightWinner = $_GET['winner']; $fName1 = $_GET['fighter1']; $fName2 = $_GET['fighter2']; $method = 'TKO'; if($fightWinner == '1'){ $sql = "UPDATE `rank_fighter_stats` SET `t_wins` = t_wins+1 WHERE `DisplayName` = '" . $fName1 . "'"; mysql_query($sql, $connection); $sql = "UPDATE `rank_fighter_stats` SET `t_losses` = t_losses+1 WHERE `DisplayName` = '" . $fName2 . "'"; mysql_query($sql, $connection); } elseif ($fightWinner == '2') { $sql = "UPDATE `rank_fighter_stats` SET `t_wins` = t_wins+1 WHERE `DisplayName` = '" . $fName2 . "'"; mysql_query($sql, $connection); $sql = "UPDATE `rank_fighter_stats` SET `t_losses` = t_losses+1 WHERE `DisplayName` = '" . $fName1 . "'"; mysql_query($sql, $connection); } else { $sql = "UPDATE `rank_fighter_stats` SET `draws` = draws+1 WHERE `DisplayName` = '" . $fName2 . "'"; mysql_query($sql, $connection); $sql = "UPDATE `rank_fighter_stats` SET `draws` = draws+1 WHERE `DisplayName` = '" . $fName1 . "'"; mysql_query($sql, $connection); } } else { // TKO NOT found in winningMethod } } mysql_close($connection);?>
  21. I am working on a project that keeps track of someones professional record. I have a table with fields like so id name ko_wins ko_loss tko_wins tko_loss decission_wins decission_loss draws I was hoping on making an update statement that could increment the proper field + 1 when new fight data comes in Like: UPDATE fighter_stats SET ko_wins = +1 WHERE name = FIGHTERNAMEHERE; Not sure how to do it and i can not figure out how or if it is even possible. Any help is appreciated.
  22. dzhax

    Edit In Place?

    thanks james that worked like a charm!
  23. dzhax

    Edit In Place?

    ok now its working... I hate case sensitive coding lol. with the current code if i click into the field when the text field is in there it continues to add more code with different text. how would i make it check if there is a text box in the field so it doesnt keep doing that?
  24. dzhax

    Edit In Place?

    It still not working... I am thinking its just not running for some reason.
  25. dzhax

    Edit In Place?

    @ O. Samuel - I replaced mine with yours and still no dice. @ JamesB - where exactly does the [0] go? I tried this and it also did not work: document.getElementsByName(editfield+'_'+fightID)[0].innerHTML='<input type=\"text\" value=\"+currentValue+\" />'
×
×
  • Create New...