Jump to content

lalnfl

Members
  • Posts

    136
  • Joined

  • Last visited

    Never

Everything posted by lalnfl

  1. I don't now that you gave me that answer lol. Just not grasping what I want yet...
  2. Would there be a way to sort without putting values into an array?
  3. By not using the order by function in SQL. Like I have $match_1 and $segment_1. They are two seperate tables so how would I order them like the ORDER BY in sql. Is there a way to do that?
  4. $sql_get_match = mysql_query("SELECT SUM(length) FROM Match_1v1 WHERE show_id='$show_id'"); $get_match = mysql_result($sql_get_match, 0); This seems to fix the problem.
  5. What would my solution be then to get 60?
  6. $sql_get_match = mysql_query("SELECT length FROM Match_1v1 WHERE show_id='$show_id'"); $get_match = array_sum(mysql_fetch_array($sql_get_match)); I have two fields in the database with length's of 31 and 29, but it comes out as a total of 58. What am I doing wrong?
  7. lalnfl

    Sessions

    The reason why it was not allowing me to change the value is because I am being hosted by a free server currently. Once I upgrade to a paid server I can change the session.gc_maxlifetime. Thanks for the help guys!
  8. lalnfl

    Sessions

    Is there a way to get in the php.ini file and manually change the session.gc_maxlifetime? The other methods don't seem to be working.
  9. lalnfl

    Sessions

    The session_set_cookie_params. When I do this: session_set_cookie_params("86400"); session_start(); The session will destroy always in 10 mins if not active even when I set the params.
  10. lalnfl

    Sessions

    Doesn't work, anyone have a solution?
  11. lalnfl

    Sessions

    The issue is that when I do not reload or refresh the page for more then 10 mins or so, the session ends. And then it logs me out. I want the sessions to stay there for as long as the browser is open.
  12. lalnfl

    Sessions

    Really? I will try that. Because on PHP.net they say to call the function before you call session_start. http://us2.php.net/manual/en/function.session-set-cookie-params.php
  13. So I am trying to set my session length, but it doesn't seem to be working. session_set_cookie_params("84600"); session_start();
  14. Sorry I posted the wrong thing. if (isset ($_POST['rp'])){ // define variables $rp = $_POST['rp']; $rp_event = $_POST['rp_event']; $rp_title = $_POST['rp_title']; $rp_preview = $_POST['rp_preview']; $rp_category1 = $_POST['rp_category1']; $rp_category2 = $_POST['rp_category2']; $rp_category3 = $_POST['rp_category3']; $rp_global = $_POST['rp_global']; // error handling $rp = strip_tags($rp); $rp_title = strip_tags($rp_title); $rp_preview = strip_tags($rp_preview); $rp = stripslashes($rp); $rp_title = stripslashes($rp_title); $rp_preview = stripslashes($rp_preview); $rp = htmlspecialchars($rp); $rp_title = htmlspecialchars($rp_title); $rp_preview = htmlspecialchars($rp_preview); $rp = strtr($rp,"`",""); $rp_title = strtr($rp_title,"`",""); $rp_preview = strtr($rp_preview,"`",""); // current number of RP's for event $sql_get_counter = mysql_query("SELECT * FROM Worker_RP WHERE worker_id='$worker_id' AND promo_id='$promo_id' AND event_id='$rp_event'"); $counter = mysql_num_rows($sql_get_counter); // error messages if ((!$rp_event) || (!$rp_title) || (!$rp) || (!$rp_category1) || (!$rp_global)){ $errormsg = "<p class='text3' style='font-weight: bold; color: #ff0000;'>You did not fill in the following fields</p>"; if (!$rp_event){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>Roleplay Event</p>"; } if (!$rp_title){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>Roleplay Title</p>"; } if (!$rp){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>Roleplay</p>"; } if (!$rp_category1){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>Roleplay Category</p>"; } if (!$rp_global){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>Roleplay Global Grade</p>"; } } else if (str_word_count($rp) > $word_limit){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You went over the word limit!</p>"; } else if (strlen($rp_preview) > 500){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You went over the maximum 500 character count for your roleplay preview!</p>"; } else if ($counter >= $rp_limit){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You cannot post more than $rp_limit roleplays!</p>"; } else if (substr_count($rp, "[b]") != substr_count($rp, "[/b]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open bold tags!</p>"; } else if (substr_count($rp, "[i]") != substr_count($rp, "[/i]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open italic tags!</p>"; } else if (substr_count($rp, "[u]") != substr_count($rp, "[/u]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open underline tags!</p>"; } else if (substr_count($rp, "[ARIAL]") != substr_count($rp, "[/ARIAL]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open arial tags!</p>"; } else if (substr_count($rp, "[TIMES]") != substr_count($rp, "[/TIMES]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open times tags!</p>"; } else if (substr_count($rp, "[COURIER]") != substr_count($rp, "[/COURIER]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open courier tags!</p>"; } else if (substr_count($rp, "[GEORGIA]") != substr_count($rp, "[/GEORGIA]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open georgia tags!</p>"; } else if (substr_count($rp, "[VERDANA]") != substr_count($rp, "[/VERDANA]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open verdana tags!</p>"; } else if (substr_count($rp, "[GENEVA]") != substr_count($rp, "[/GENEVA]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open geneva tags!</p>"; } else if (substr_count($rp, "[sMALL]") != substr_count($rp, "[/sMALL]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open small tags!</p>"; } else if (substr_count($rp, "[NORMAL]") != substr_count($rp, "[/NORMAL]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open normal tags!</p>"; } else if (substr_count($rp, "[LARGE]") != substr_count($rp, "[/LARGE]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open large tags!</p>"; } else if (substr_count($rp, "[bLUE]") != substr_count($rp, "[/bLUE]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open blue tags!</p>"; } else if (substr_count($rp, "[RED]") != substr_count($rp, "[/RED]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open red tags!</p>"; } else if (substr_count($rp, "[GREEN]") != substr_count($rp, "[/GREEN]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open green tags!</p>"; } else if (substr_count($rp, "[YELLOW]") != substr_count($rp, "[/YELLOW]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open yellow tags!</p>"; } else if (substr_count($rp, "[ORANGE]") != substr_count($rp, "[/ORANGE]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open orange tags!</p>"; } else if (substr_count($rp, "[GRAY]") != substr_count($rp, "[/GRAY]")){ $errormsg .= "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have open gray tags!</p>"; } else { // error messages are done $rp = mysql_real_escape_string($rp); $rp_title = mysql_real_escape_string($rp_title); $rp_preview = mysql_real_escape_string($rp_preview); $rp = strtr($rp,"`",""); $rp_title = strtr($rp_title,"`",""); $rp_preview = strtr($rp_preview,"`",""); $rp = strtr($rp,"[b]","<b>"); $rp = strtr($rp,"[/b]","</b>"); $rp = strtr($rp, "[i]","<i>"); $rp = strtr($rp,"[/i]","</i>"); $rp = strtr($rp,"[u]","<u>"); $rp = strtr($rp,"[/u]","</u>"); $rp = str_replace('[TIME]',"<span style='color: blue'>",$rp); /* $rp = strtr($rp,"[TIMES]","<span style='font-family: Times New Roman, Times, serif'>"); $rp = strtr($rp,"[/TIMES]","</span>"); $rp = strtr($rp,"[COURIER]","<span style='font-family: Courier New, Courier, mono'>"); $rp = strtr($rp,"[/COURIER]","</span>"); $rp = strtr($rp,"[GEORGIA]","<span style='font-family: Georgia, Times New Roman, Times, serif'>"); $rp = strtr($rp,"[/GEORGIA]","</span>"); $rp = strtr($rp,"[VERDANA]","<span style='font-family: Verdana, Arial, Helvetica, sans-serif'>"); $rp = strtr($rp,"[/VERDANA]","</span>"); $rp = strtr($rp,"[GENEVA]","<span style='font-family: Geneva, Arial, Helvetica, sans-serif'>"); $rp = strtr($rp,"[/GENEVA]","</span>"); $rp = strtr($rp,"[sMALL]","<span style='font-size: 11px'>"); $rp = strtr($rp,"[/sMALL]","</span>"); $rp = strtr($rp,"[NORMAL]","<span style='font-size: 12px'>"); $rp = strtr($rp,"[/NORMAL]","</span>"); $rp = strtr($rp,"[LARGE]","<span style='font-size: 14px'>"); $rp = strtr($rp,"[/LARGE]","</span>"); $rp = strtr($rp,"[color=blue]","<span style='color: #0000ff'&gt"); $rp = strtr($rp,"[/color]","</span>"); $rp = strtr($rp,"[RED]","<span style='color: #ff0000'>"); $rp = strtr($rp,"[/RED]","</span>"); $rp = strtr($rp,"[GREEN]","<span style='color: #00ff00'>"); $rp = strtr($rp,"[/GREEN]","</span>"); $rp = strtr($rp,"[YELLOW]","<span style='color: #ffff00'>"); $rp = strtr($rp,"[/YELLOW]","</span>"); $rp = strtr($rp,"[ORANGE]","<span style='color: #ffa500'>"); $rp = strtr($rp,"[/ORANGE]","</span>"); $rp = strtr($rp,"[GRAY]","<span style='color: #c0c0c0'>"); $rp = strtr($rp,"[/GRAY]","</span>"); */ $rp_replace = array("<b>" => "","</b>" => "","<i>" => "","</i>" => "","<u>" => "","</u>" => "","<span style='font-family: Arial, Helvetica, sans-serif;'>" => "","<span style='font-family: 'Times New Roman', Times, serif;'>" => "","<span style='font-family: 'Courier New', Courier, mono;'>" => "","<span style='font-family: Georgia, 'Times New Roman', Times, serif;'>" => "","<span style='font-family: Verdana, Arial, Helvetica, sans-serif;'>" => "","<span style='font-family: Geneva, Arial, Helvetica, sans-serif;'>" => "","<span style='font-size: 11px;'>" => "","<span style='font-size: 12px;'>" => "","<span style='font-size: 14px;'>" => "","<span style='color: #0000ff;'>" => "","<span style='color: #ff0000;'>" => "","<span style='color: #00ff00;'>" => "","<span style='color: #ffff00;'>" => "","<span style='color: #ffa500;'>" => "","<span style='color: #c0c0c0;'>" => "","</span>" => ""); $new_rp = strtr($rp, $rp_replace); $rp_word_count = str_word_count($new_rp); if ($rp_preview == ""){ $rp_preview = substr($rp, 0, 500); } $sql_insert_rp = mysql_query("INSERT INTO Worker_RP (worker_id, promo_id, event_id, category_id1, category_id2, category_id3, words, time_posted, date_posted, preview, content, title, allow_global_grade, posted) VALUES ('$worker_id' , '$promo_id' , '$rp_event' , '$rp_category1' , '$rp_category2' , '$rp_category3' , '$rp_word_count' , CURTIME() , CURDATE() , '$rp_preview' , '$rp' , '$rp_title' , '$rp_global' , now())") or die (mysql_error()); $errormsg = "<p class='text3' style='font-weight: bold; color: #ff0000;'>You have successfully submitted your Roleplay!</p>"; // clear variables $rp = ""; $rp_event = ""; $rp_title = ""; $rp_preview = ""; $rp_category1 = ""; $rp_category2 = ""; $rp_category3 = ""; $rp_global = ""; } } else { $errormsg = "<p class='text3' style='font-weight: bold; color: #ff0000;'>All of the fields are required except for you only need one Roleplay Category!</p>"; } $content = " $errormsg <form action='fed_roleplays.php?promotion_id=$promo_id&create_rp' method='post'> <p class='text3'>Roleplaying as <a href='workers.php?worker_id=$worker_id' style='font-weight: bold'>$worker_firstname $worker_lastname</a></p> <div style='width: 250px; float: left;'> <p class='text3' style='font-weight: bold;'>Roleplaying for</p> </div> <div style='width: 538px; float: left;'> <p class='text3'> <select name='rp_event' size='1'> <option value='$rp_event'>$rp_event</option> $upcoming_events </select> </p> </div> <div class='line'></div> <div style='width: 250px; float: left;'> <p class='text3' style='font-weight: bold;'>Title</p> </div> <div style='width: 538px; float: left;'> <p class='text3'> <input class='text4' type='text' name='rp_title' value='$rp_title' size='20' /> </p> </div> <div class='line'></div> <div style='width: 250px; float: left;'> <p class='text3' style='font-weight: bold;'>Roleplay (Word Limit: $word_limit_format)</p> </div> <div style='width: 538px; float: left;'> <p class='text3'> <input type='button' id='bold_text' class='text3' style='padding: 3px; font-weight: bold;' value='B' onclick='changeBold()' /> <input type='button' id='italic_text' class='text3' style='padding: 3px; font-weight: bold;' value='I' onclick='changeItalic()' /> <input type='button' id='underline_text' class='text3' style='padding: 3px; font-weight: bold;' value='U' onclick='changeUnderline()' /> <select id='font_text' class='text4' onchange='changeFont()'> <option value='0'>FONT</option> <option value='ARIAL'>Arial</option> <option value='TIMES'>Times</option> <option value='COURIER'>Courier</option> <option value='GEORGIA'>Georgia</option> <option value='VERDANA'>Verdana</option> <option value='GENEVA'>Geneva</option> </select> <select id='size_text' class='text4' onchange='changeSize()'> <option value='0'>SIZE</option> <option value='SMALL'>Small</option> <option value='NORMAL'>Normal</option> <option value='LARGE'>Large</option> </select> <select id='color_text' class='text4' onchange='changeColor()'> <option value='0'>COLOR</option> <option value='BLUE' style='color: #0000ff;'>Blue</option> <option value='RED' style='color: #ff0000;'>Red</option> <option value='GREEN' style='color: #00ff00;'>Green</option> <option value='YELLOW' style='color: #ffff00;'>Yellow</option> <option value='ORANGE' style='color: #ffa500;'>Orange</option> <option value='GRAY' style='color: #c0c0c0;'>Gray</option> </select> </p> <p class='text3'> <textarea class='text4' cols='100' rows='15' name='rp' id='rp_area'>$rp</textarea> </p> </div> <div class='line'></div> <div style='width: 250px; float: left;'> <p class='text3' style='font-weight: bold;'>Custom Preview (Leave blank if no, max. 500 characters)</p> </div> <div style='width: 538px; float: left;'> <p class='text3'> <textarea class='text4' cols='100' rows='7' name='rp_preview'>$rp_preview</textarea> </p> </div> <div class='line'></div> <div style='width: 250px; float: left;'> <p class='text3' style='font-weight: bold;'>Category (min. 1, max. 3)</p> </div> <div style='width: 179px; float: left;'> <p class='text3'> <select name='rp_category1' size='1'> <option value='$rp_category1'>$rp_category1</option> <option value='1'>Action</option> </select> </p> </div> <div style='width: 179px; float: left;'> <p class='text3'> <select name='rp_category2' size='1'> <option value='$rp_category2'>$rp_category2</option> </select> </p> </div> <div style='width: 179px; float: left;'> <p class='text3'> <select name='rp_category3' size='1'> <option value='$rp_category3'>$rp_category3</option> </select> </p> </div> <div class='line'></div> <div style='width: 250px; float: left;'> <p class='text3' style='font-weight: bold;'>Allow global grading?</p> </div> <div style='width: 538px; float: left;'> <p class='text3' style='font-weight: bold;'> <input type='radio' name='rp_global' value='a' /> All Users </p> <p class='text3' style='font-weight: bold;'> <input type='radio' name='rp_global' value='f' /> Only Friends </p> <p class='text3' style='font-weight: bold;'> <input type='radio' name='rp_global' value='n' /> No One </p> </div> <div class='line'></div> <div style='width: 788px;' align='center'> <p class='text3'> <input type='submit' class='text3' value='Create Roleplay' /> </p> </div> </form>"; } }
  15. <select id='font_text' class='text4' onchange='changeFont()'> <option value='0'>FONT</option> <option value='ARIAL'>Arial</option> <option value='TIMES'>Times</option> <option value='COURIER'>Courier</option> <option value='GEORGIA'>Georgia</option> <option value='VERDANA'>Verdana</option> <option value='GENEVA'>Geneva</option> </select> <textarea class='text4' cols='100' rows='15' name='rp' id='rp_area'>$rp</textarea> Javascript: function changeFont(){ if (document.getElementById('font_text').selected=true){ var v = document.getElementById('font_text').value; var ls = "["; var rs = "]"; var s = "/"; var y = document.getElementById('rp_area').value; var x = document.getElementById('rp_area').innerHTML=ls+v+rs; var z = document.getElementById('rp_area').innerHTML=ls+s+v+rs; var xz = x+z; var xy = y+xz; document.getElementById('rp_area').focus(); document.getElementById('rp_area').value=xy; document.getElementById('font_text').value=0; } }
  16. It is a textarea field. And I tested it again with search [TIME] as my replace <span style='color: blue'> and it still comes out with the result <TiME>
  17. How do I get str_replace to not match characters or parts of words? Because when I get the end result I come up with <TiMES> as my result. I tried putting in [a] in for [TIMES] and it came out as <a> as my result. Any ideas?
  18. How come this is not replacing correctly? $rp = strtr($rp,"[TIMES]","<span style='font-family: Times New Roman, Times, serif'>")
  19. I have this php code: length is 15 , that is what it is coming out of the database $length = $get['length']; $time = date('Y-m-d', strtotime('+$length days')); But when I echo time it comes out with this result 1969-12-31 What am I doing wrong?
  20. Don't get worked up about this, it was just a question. Anyways, I solved the problem.
  21. So how would I get my value to go back to numbers? Because its doing the (an 'T' + 1 is a 'U') thing? How do I get it back to incrementing numbers?
  22. Does anyone know what the T and U mean in the database? I shouldn't be getting them, but yet I am.
  23. $sql_show_name = mysql_query("SELECT * FROM Live_Event WHERE id='$show_id' AND promo_id='$promotion_id'"); $show_name = mysql_fetch_array($sql_show_name); $show_name = $show_name['name']; $matches = $show_name['matches'];
×
×
  • 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.