Jump to content

Orio

Staff Alumni
  • Posts

    2,491
  • Joined

  • Last visited

    Never

Everything posted by Orio

  1. Gone again... ??? Have you restored or upgraded again the software? Orio.
  2. Why would you input something like that? It's like using in SQL "... LIKE 'something%%' ...". I can't see what you're trying to achieve using double wildcards and that's why the function is not build for such input. Orio.
  3. No, I don't believe there's a higher power. But that doesn't prevent me from celebrating our holidays with my family, or from having a big dinner with family/friends every Friday evening. You can call me "traditional", but at least here in Israel being traditional means more than what I've stated above (for an example- eating only kosher food or going to the synagogue every Friday/Saturday). That's why I am classifying myself as an atheist. Orio.
  4. Do atheist middle-easterns/arabs even exist? I know I live in a small country so maybe you all forgot about it... But I am an atheist- from Israel, so as far as I know I am a middle-eastern. Quite popular here by the way, most of the (Jewish) Israeli people are atheists. I mean we all do celebrate our holidays etc', but most of the Israelis don't go as far as eating only kosher food or not using electricity/cars at Saturday. Orio.
  5. Woops I've misread the post. Please ignore it. Orio.
  6. If you're using Apache, that's done through the htaccess: http://www.google.coml/search?q=htaccess+custom+error Orio.
  7. From your post I can't really understand how your numbers are stored. Database? An array? Something else? If it's in an array, you could use array_count_values() and then just go over them using a foreach (If you want to sort it, use ksort() first): <?php $numbers = array(1,5,2,1); $count = array_count_values($numbers); ksort($count); foreach($count as $key => $val) echo "Number {$key} appears {$val} times"; ?> Orio.
  8. lol CV you're evil Shitalabad hehe Orio.
  9. Try replacing this line: $pagenum = floor($data['C'] / $page_rows) + 1; With: <?php if($data['C'] == 0) $pagenum = 1; else $pagenum = ceil($data['C'] / $page_rows); ?> I hope that will work well. Orio.
  10. That piece of code is familiar... It's like I've written it I don't really understand where you're having problems. Maybe you can post/PM me the link so I could see it? Anyway, for debugging purposes, check the output given by: <?php if($pagenum === "last") { $query = "Select COUNT(*) as C from forumtutorial_posts where parentid='$id'"; $result = mysql_query($query); $data = mysql_fetch_array($result); $pagenum = floor($data['C'] / $page_rows) + 1; die ("Count is: ".$data['C']."<br>page_rows: ".$page_rows."<br>Pagenum: ".$pagenum); } ?> Orio.
  11. I also see you are deleting the user from the vip table according to their expire_time. That's not a smart thing to do- you could be deleting more than one user this way. It's better to delete them by their unique value- their ID. Orio.
  12. You can't compare strings of dates. You need to convert them into time stamps. Try this: <?php $date = time(); $res = mysql_query("SELECT id, myspaceid, nick, image, expire_time FROM `vip` WHERE game = $game_no order by id asc"); while($associate = mysql_fetch_array($res)) { $id = $associate['id']; $expire_time = $associate['expire_time']; if($date > strtotime($expire_time)) { $delete = mysql_query("DELETE FROM `vip` WHERE `expire_time` = $expire_time"); } else { ?> Orio.
  13. Check out the user comments in nl2br(). Someone made such a function. Orio.
  14. In my opinion this is what you have to do: Use ignore_user_abort() and set_time_limit(0) and just redirect your user to some other page so he could continue and do whatever he wants. This way the user won't have to be stuck in the updating page. This way, if you want to notify the user if the process was finished successfully you could do something like this: Add a column to your users table called "alert". Default value is 0. At the end of your long script, update the alert column to 1 if the task was completed successfully. Other values could symbolize different errors that could occur. The rest of your pages (let's say in your header or whatever, something that is included in all of the other pages), the alert column would be checked to see if a certain task was finished successfully or if it failed. A message would show up in that case (as a javascript pop up for an example). You'd have to update back the alert column to 0 of course. This notifying system is somewhat similar to SMF's PM notification system (which asks you if you want to open the message in a new window when you receive one). Anyway, this solution seems to me much cleaner and nicer. Orio.
  15. Just added some brackets for the ORs: <?php echo boldWords(array("one", "t*"), "One is before two and three is too."); function boldWords($words, $string) { foreach($words as $k => $w) { $w = '('.str_replace('\*', '.*?)', preg_quote($w), $count); if(!$count) $w .= ')'; $words[$k] = $w; } $regex = "~(".implode('|', $words).")\b~i"; return preg_replace($regex ,'<strong>$0</strong>',$string); } ?> Orio.
  16. Good point. But that will require a small fix: <?php echo boldWords(array("one", "t*"), "One is before two and three is too."); function boldWords($words, $string) { foreach($words as $k => $w) { $w = '('.str_replace('\*', '.*?)', preg_quote($w), $count); if(!$count) $w .= ')'; $words[$k] = $w; } $regex = "~".implode('|', $words)."\b~i"; return preg_replace($regex ,'<strong>$0</strong>',$string); } ?> Orio.
  17. Nope.. There's the "Report to moderator" option in the post itself (you can only report on a bad post, not on the a whole topic). Anyway, Notify is the way to go Orio.
  18. Hit the "Notify" button, by the "Reply" button (See image). Orio. [attachment deleted by admin]
  19. The problem is that these values don't exist unless a form submission was made. You have to make sure that what you're echoing exists, IE: <?php if(isset($_POST['fname'])) echo $_POST['fname']; ?> Orio.
  20. This worked for me: <?php echo boldWords(array("one", "t*"), "One is before two and three is too."); function boldWords($words, $string) { foreach($words as $k => $w) { $w = '('.str_replace('*', '.*?)', $w, $count); if(!$count) $w .= ')'; $words[$k] = $w; } $regex = "~".implode('|', $words)."\b~i"; return preg_replace($regex ,'<strong>$0</strong>',$string); } ?> Enjoy Orio.
  21. The manual is correct... Use the rename() function as instructed. Although you still have to build the script that will decide whether a file needs to be archived. Orio.
  22. But the array will be sorted (it's passed by reference, not by value). The 1 indicates boolean true- the sort was successful. Orio.
  23. That's called pagination. There are tons of tutorials about this topic, just google to find one you find good. Take a look into phpfreak's tutorial: http://www.phpfreaks.com/tutorial/basic-pagination Orio.
  24. That's something you have to ask SMF to do. PHPfreaks simply uses this board, and the staff tries to avoid modifying it's source as much as they can. Orio.
×
×
  • 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.