Jump to content

Ken2k7

Members
  • Posts

    5,196
  • Joined

  • Last visited

    Never

Everything posted by Ken2k7

  1. preg_replace will work. It can take in arrays as arguments so you can just put up 2 arrays. First array is the regexp and the second array is the replacement. So for example: $bb = array( '#\[b\](.+?)\[/b\]#i', '#\[i\](.+?)\[/i\]#i', ); $replacement = array( '<b>$1</b>', '<i>$1</i>', ); $new_str = preg_replace($bb, $replacement, $str);
  2. Read the manual - date It's second (optional) parameter is a timestamp, not a date format of "yyyy-mm-dd". That's why it didn't work. You need to convert it into a timestamp if you plan to do it that way.
  3. In what way is this a PHP coding problem?
  4. You need usort. Read about it. function c ($a, $b) { if (!array_key_exists('order', $a) || !array_key_exists('order', $b)) return 2; if ($a['order'] == $b['order']) return strcmp($a['title'], $b['title']); return $a['order'] < $b['order']? -1 : 1; } usort($myarray, 'c'); var_dump($myarray);
  5. I actually spotted an error in my update. Missing a parenthesis. UPDATE members SET last_report_n = CONCAT_WS('-', RIGHT(last_pirep, 4), LEFT(last_pirep, 2), RIGHT(LEFT(last_pirep, LOCATE('.', last_pirep, 3), 2)));
  6. Do you understand the code or SQL statements we posted up? Apparently you just run them.
  7. Breaking it down: $xR = array(3 => "ar", "br", 6 => "cr", "de", 10 => "en", "fr"); That gives this: [3] => "ar" [4] => "br" [6] => "cr" [7] => "de" [10] => "en" [11] => "fr" $xR[8] = "ge"; That says position at 8 will be "ge": [3] => "ar" [4] => "br" [6] => "cr" [7] => "de" [10] => "en" [11] => "fr" [8] => "ge" $xR[] = "hr"; Since the last index stopped at 11 when you created the array, the next one is 12, not 9. $xR[8] = "ge"; doesn't do any increment. It just says to store the value of "ge" at index 8. You can run $xR[8] = "ge"; 100 times and it won't change the index because that's just replacing a value. [3] => "ar" [4] => "br" [6] => "cr" [7] => "de" [10] => "en" [11] => "fr" [8] => "ge" [12] => "hr"
  8. It's pretty simple actually. If you're allowed to change your name, then everyone else is going to want to change theirs too. It's just like your mailing address or telephone number... or PO Box #. You can't just up and say "Hey, I'd like my digits to be 123 instead of 56185145486156-2" (Assuming 123 just happened to be available) Even if you argue against that and say "Yes you can!?".. You'd still have to sacrifice some money for that actual change to happen. There's no merit badge privilege out there that awards you those changes for free. [ot]Unless your in witness protection, but then still you have no real say so in the digits you get.[/ot] I did make the case to allow certain members the right to change it, like the Supporter group or those who are active, helpful, etc. Not newcomers with 1 to 2 posts. 1. How many people would care? If I ask a question, I'd post it up on the forum. Whoever answers it, answers it. I can't PM anyone for help according to the rules, so there's no need for me or anyone else to keep track. Many forums allow their members to change their username. I don't see them having issues with this. 2. New-comers should not have the privilege. 3. You can hide your online status anyways. That doesn't do anything. Clients usually get PMed by the freelancer. Assuming the DB is set up correctly, they can view the PM if they haven't deleted it. But then again, if you're the freelancer and you changed your name without telling the client, that's the freelancer's fault and the client has the right to go somewhere else. Obviously the freelancer doesn't care about the client enough to mention it or even possibly take the job seriously enough. 4. Well, assuming the DB is set up correctly, the name in the posts should change. That's not a problem.
  9. Well, it's kind of dumb the way you did it. The call_images.php will select from people and you loop through to display the image. Problem is, you didn't specify which one in your SQL so it will grab them all and since your while loop exits after the first iteration, it will always print the first image. Since you're passing the file path to the call_images.php, why aren't you using it? The path is right there. There's no need to run a query. I agree with Muddy_Funster that you shouldn't select * from your database table, unless the table only has 2 columns lol.
  10. You forgot to mention MySQL database/table/column names or MySQL keywords. Don't quote those either. I've seen many people do that.
  11. Ooh nice. Forgot that one. Good show.
  12. #usernameMessage, not #username. Typo. Did you not catch that?
  13. I wonder if this will work: UPDATE members SET last_report_n = CONCAT_WS('-', RIGHT(last_pirep, 4), LEFT(last_pirep, 2), RIGHT(LEFT(last_pirep, LOCATE('.', last_pirep, 3), 2));
  14. So if it's mm.dd.yyyy, chop it up into yyyy-mm-dd. What's confusing about it? =\ That would be backwards lol, well the values that is.
  15. Oh right. Stupid me. $("#username").text("Right"); For html, $("#username").html("Right");
  16. Do you have the site up? Mind providing the link?
  17. If you're using sessions, you need to add session_start at the top of your file. Make sure it's at the top of the account.php page too. 404.
  18. I mean in the success function of your $.get request, the variable data is of type string, but you're comparing it to a boolean value. "true" != true. o.O
  19. A valid date type is YYYY-MM-DD as you have it set. So assuming last_pirep is YYYY.MM.DD, why are you updating last_report_n to be YYYY.MM.DD? Think dude.
  20. You sure you got the path "../php/checkuser.php" correct? Also, data is a string, not a boolean.
  21. I created this account back when I was new to PHP and was learning for the first time. I just picked the first thing that came to mind just to get in and ask a question. But being around here and having loved this place for a long time, I'd like to change my username to something I'd like. Ken2k7 doesn't sound too fitting lol. And this name change should not be available to those who have one or two posts.
×
×
  • 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.