Jump to content

turkman

Members
  • Posts

    154
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

turkman's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Im not sure the standard way of doing it. I mean would you create a seperate function for each of the seperate divs? what i imagine that way to be is, Is that the stanard way of doing it? <span id = 'pace_value'>10</span> <a href = 'javascript:updatePace()'> <img src = "plus.gif"></a> <span id = 'Shooting_value'>10</span> <a href = 'javascript:updateShooting()'> <img src = "plus.gif"></a> <span id = 'Tackling_value'>10</span> <a href = 'javascript:updateTackling()'> <img src = "plus.gif"></a>
  2. I want to have a table or divs, each table or div has a number and a plus and minus button. The amount of rows in the table or div can change. If you press a plus the number goes up and a minus makes the number go down. It seems like a waiste to make the jquery update all the divs or table rows for the sake of updating 1 number. But it seems overly complex to give them all a unique div id and only have that single div updated when the plus is clicked. Whats the standard way of doing this example layout Pace: 10 + - Shooting: 12 + - Control: 5 + - Rather than having the whole table printed by the ajax call, is there a way to update just the number in the row of the + or - clicked Hope that makes sense.
  3. i can host it online if you want, give me a sec. http://www.imgboard.co.uk/stupid_css/
  4. Ive tried lots of different fonts, with and without quotes. Im hosting it on my ubuntu apache server, whats really weird is that font-family works on other sites i have store on it i.e var/www/site1 - works var/www/site2 does not work ive been trying to get firbug to work, but it wont show up when i install it. I have tried troubleshooting it, but cant figure out whats wrong with it. I have web developer, but not sure if that can be used. Also ive tried adding font-family into the divs, does not work there either.
  5. Have this very basic css page and a very basic html page, however font-family isnt working in the body bracket. No matter what i change it too, the text remains the same. If i add monospace on the end, the text becomes monospaced and all the other styles work ok, its just not the font-family. I have no idea why. a{ color:#0099CC; } #notice_bar{ background-color: #2088B2; padding: 20px; color: #FFFFFF; } #notice_bar a{ font-weight: bold; color: #006699; } #page_wrapper{ width: 100%; margin: 20px; } #page_header{ height: 50px; font-size: 20pt; text-align: center; } #left_side{ width: 20%; padding: 10px; float: left; } #middle_bit{ width: 60%; padding: 10px; float: left } #right_side{ width: auto; padding: 10px; float: left; } body{ color: #555555; font-size: 9pt; font-family: "Verdana"; }
  6. I made a bot, that scrapes content from a forum, i cant access the forum in work, so am trying to make something discreat to read it on my own site while at work. Anyway the links to threads are something like this. I got help and i know how to extract the unique thread number using regex. However i have a problem. What i really need, now that i think about it, is a way of getting the thread number and the thread title (so i can make sense of what im reading.) The thread title is in the setWindowStatus function. I cant think of a way to do it. I dont even know if it would work in an array what id basically like is something that says 1) Thread title - Thread id 2) Thread title - Thread id etc that is stored in a way that i can easily manipulate. <img src="http://s2.images.proboards.com/xx.gif" alt=" " border="0"/></font></td><td class="windowbg" bgcolor="FFFFFF" width="48%" style="cursor:pointer;" onClick="if(!pb_bubble)location.href='/index.cgi?board=general&action=display&thread=13483';" onMouseOver="mouseOverHighlightCell(this);setWindowStatus('Lurkers, show your face ');return true;
  7. using curl, ive managed to get my program to log me into a proboards site. I can view the main forum page. The problem is, the links to viewing the page is something like href="index.cgi?board=general&thread=1111&page=45" I did a str_replace to replace the index.cgi to href= "link_processor?board=general&thread=1111&page=45" The idea was that link_processor would contain the data "board=general&thread=1111&page=45" However, i now realise that the way the php would see that as 4 different get variables link processor = board=general thread = 1111 page = 45 How could i make it all part of the link_processor variable because if i can keep the string intact, i just have to pass it to a curl function and i can display the page easily!
  8. In the source of a webpage, i have lots of data including about 40 lines similar to this. I want to extract the number of &thread= each time this line appears and store them all in an array. onClick="if(!pb_bubble)location.href='/index.cgi?board=general&action=display&thread=13377';
  9. I got it working anyway. I still have a small problem. I used HTTP live headers firefox extension to capture the headers when i start a thread. I brings back something like this -----------------------------12249266671528 Content-Disposition: form-data; name="title" Filme 2010, filme 2009, filme noi, programe TV, program cinema, premiere cinema, trailere filme - CineMagia.ro -----------------------------12249266671528 Content-Disposition: form-data; name="category" 3 -----------------------------12249266671528 Content-Disposition: form-data; name="tags" filme, programe tv, program cinema -----------------------------12249266671528 Content-Disposition: form-data; name="bodytext" Filme 2010, filme 2009, filme noi, programe TV, program cinema, premiere cinema, trailere filme -----------------------------12249266671528 Content-Disposition: form-data; name="trackback" -----------------------------12249266671528 Content-Disposition: form-data; name="url" http://cinemagia.ro -----------------------------12249266671528 Content-Disposition: form-data; name="phase" 2 -----------------------------12249266671528 Content-Disposition: form-data; name="randkey" 9510520 -----------------------------12249266671528 Content-Disposition: form-data; name="id" 17753 -----------------------------12249266671528-- how do you use curl to post data like that? Usually i just use name=blah&message=blah i dont know how to emulate this Content disposition stuff.
  10. There is a proboards site i like to visit. However, its been blocked at my work. I was trying to find a way of logging into it via my site and using that to read the proboards site. I dont really need to post or anything, just something to read when i get bored. I want to keep the name of the site secret. However this is my code. Note: When i run the code i get a blank page. Nothing at all happens. <?PHP function login($website,$username,$password){ $post_data = array( "action" => "login2", "minutes" => "-1", "username" => $username, "password" => $password, ) Post_thread($website,$post_data); } function Post_thread($url,$post_data){ $options = array( CURLOPT_COOKIEJAR => "/tmp/cookies.txt", // where we store the cookie. CURLOPT_COOKIEFILE => "/tmp/cookies.txt", // to pass the cookie if we need too. CURLOPT_RETURNTRANSFER => true, // return web page CURLOPT_HEADER => false, // don't return headers CURLOPT_FOLLOWLOCATION => true, // follow redirects CURLOPT_ENCODING => "", // handle all encodings CURLOPT_USERAGENT => "spider", // who am i CURLOPT_AUTOREFERER => true, // set referer on redirect //CURLOPT_REFERER => $url, //spoof the referer CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect CURLOPT_TIMEOUT => 120, // timeout on response CURLOPT_MAXREDIRS => 10, // stop after 10 redirects CURLOPT_POST => true, // we want to post some data CURLOPT_POSTFIELDS => $post_data, //array of what we want to post ); $ch = curl_init( $url ); curl_setopt_array( $ch, $options ); $content = curl_exec( $ch ); echo $content; $errmsg = curl_error( $ch ); echo $errmsg; } login("http://randomproboardssite.proboards.com","username","secretpassword"); ?>
  11. Hey guys this is my code. Basically what i want to happen is, i want the page to display with the last 10 results (which works) Then there is a button that when clicked should activate jQuery/AJAX and that should call display_full_results() which should update the #changeme div. Firstly, it does not show errors. Ive no idea how to debug jQuery. Secondly i don't know if you can call jQuery on a function on the same page. Thirdly, i don't know if you can stick a div in the middle of a table like i have done or will that cause it to error. I've no idea, any help would be appreciated. <?php session_start(); include $_SERVER['DOCUMENT_ROOT'] ."/includes/functions.php"; include $_SERVER['DOCUMENT_ROOT'] ."/includes/displays.php"; function display_recent_posts_by_user($userid){ $res = mysql_query("SELECT * FROM b WHERE scookie = '$userid' ORDER BY ID DESC LIMIT 10") or die(mysql_error()); while($row = mysql_fetch_array($res)){ echo "<tr><td>".substr(stripslashes($row['message']),0,100) ."</td> <td>".how_long_ago($row['Lastpost'])."</td></tr>"; } } function display_full_results($userid){ $res = mysql_query("SELECT * FROM b WHERE scookie = '$userid' ORDER BY ID DESC ") or die(mysql_error()); while($row = mysql_fetch_array($res)){ echo "<tr><td>".substr(stripslashes($row['message']),0,100) ."</td> <td>".how_long_ago($row['Lastpost'])."</td></tr>"; } } if($_SESSION['lv'] <4){ add_notice("Unauthorised access attempt."); echo "<script>location.href = 'http://www.imgboard.co.uk'</script>"; die(); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <meta http-equiv="Content-type" content="text/html;charset=UTF-8" /> <meta name="robots" content="noarchive" /> <link rel="stylesheet" type="text/css" href="http://www.imgboard.co.uk/style/blue.css"> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript"> $("#button").click( function() { $.post("info.php", { fullresults: $("#scookie").val() }, function(data){ $("#changeme").html(data); } ) ; } ); </script> </head> <body> <div id = "wrapper"> <table cellspacing = '0'> <th class = 'label'> Post </th> <th class = 'label'> When </th> <div id = "changeme"> <?PHP if(isset($_GET['onuser'])){ $usid = protect($_GET['onuser']); display_recent_posts_by_user($usid); echo "<tr class = 'nohighlight'><td><input type = 'button' value = 'View all posts by this user.' id= 'button'></td><td><input type = 'hidden' id = 'scookie' value = '$usid'</td></tr>"; } else if (isset($_POST['fullresults'])){ $uid = protect($_POST['fullresults']); display_full_results($uid); } ?> </div> </table> </body> </html>
  12. I got it sorted. The only problem was if i wanted to display the returned data in a div i had to use .html() instead of .val()
  13. After i couldnt get my last example to work, someone recommended i try and use jquery as it auto sorts out all i.e bugs. So i looked around and managed to piece together some code. In the example below #chatmsg is the input box #chatwindow is the div id where i want the output to go. Here is the problem. in the function update ... if i set the return data to #chatmsg .. it works and populates the input box with the data from the database every 1000 milliseconds. However if i change that to #chatwindow nothing happens. I have no idea why this happens. Also i have no idea why its causing the page to display funny. link here: http://www.imgboard.co.uk/chat-with-coon/chat.html <html> <head> <title>Coon Chat V 1.0</title> <style type="text/css"> body { padding-left:40px; background:#E3EDF5; font-family:arial;} input, textarea { font-family: arial; color:white; background:#57767F; font-size: 11pt; line-height: 25px } #content { width:1000px; text-align:left; } #chatwindow { border:1px solid #E8E8E8; padding:4px; background:#FFFFFF; color:#426A8A; width:1000px; margin: auto; height:auto; font-family:arial;line-height: 25px; font-size: 11pt; } #chatnick { color: black; background:#FFFFFF; } #chatmsg { color: black; background:#FFFFFF; } #button { background:#FFFFFF;} #cent{margin: auto; width 1000px;} #info { text-align:left; padding-left:0px; font-family:arial; } #info td { font-size:12px; padding-right:10px; color:#DFDFDF; } #info .small { font-size:12px; padding-left:10px; padding-right:0px;} #info a { text-decoration:underline; color:#426A8A; font-size: 9pt; } #info a:hover { text-decoration:underline; color:#426A8A;} .ai {font-size: 7pt; color: green; font-style: italic;} .actiontaken font-size: 9pt; color: red;} h3 {color: Orange; text-align: center;} .dat {color: grey; font-size: 8pt; padding-left: 10px;} .name {color: Orange; font-size: 11pt; padding-left: 5px; padding-top: 3px; padding-bottom: 3px; } .name a {color: black; color: black; text-decoration: underline;} #wrapper {width: 1200px; margin: auto; } </style> </head> <body> <div id = 'wrapper'> <div id="info"> Welcome to secret-ninja-coon -chat. <a href = 'http://www.imgboard.co.uk'>Return to the forum.<a> </div> <div id="content"> <div id="chatwindow"> </div> <!-- <textarea id="chatwindow" rows="19" cols="95" readonly></textarea><br> --> <div id = "cent"> <input id="chatnick" type="text" size="9" maxlength="9" > <input id="chatmsg" type="text" size="100" maxlength="150" onkeyup="keyup(event.keyCode);"> <input type="button" id = "button" value="Post" onclick="submit_msg()";><br><br></div> <br> </div> </div> </body> </html> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript"> function cite(num){ var reply_cite = num ; document.getElementById('chatmsg').value += reply_cite; } function update() { $.post("x.php", {}, function(data){ $("#chatwindow").val(data);}); setTimeout('update()', 1000); } $(document).ready( function() { update(); $("#button").click( function() { $.post("x.php", { m: $("#chatmsg").val()}, function(data){ $("#chatwindow").val(data); $("#chatmsg").val(""); } ); } ); }); </script> </script>
  14. I assume that wasn't helpfull what i posted? I'll post the two files when i get home. I just need help getting ajax to work on I.E . The send command works and enters txt into the databse (i can read it on my phone). However the read does not display the data. So frustrating.
  15. I'm in work right now, don't have access to it. i'm wondering if this will help. in the w.php file i have if(isset($_GET['print'])){ then i just do a select from the databse to take out each row. then do a while(mysql_fetch_array($res)) echo "data"; } the page is www.imgboard.co.uk/chat-with-coon/ if you view it on i.e you can see the error yourself. I assure you i have tried to debug myself. I spent 6 hours working on this yesterday.
×
×
  • 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.