Jump to content

Sandakelum

Apprentice
  • Posts

    34
  • Joined

  • Last visited

Everything posted by Sandakelum

  1. Following functions are very useful to you but they haven't built-in right into IP.Board yet. So you gotta add them manually. Those two functions as follows... 1. timespan( $timespanToDate ) - Counts how much time between a pass date your specify through parameters and today. 2. daysleft( $toDate ) - Counts how much days left for a future date you specify through parameters. You can use these functions as an example to show how much days left to christmas and/or how much time spent since your board started! Open admin/sources/classes/class_localization.php and add following code right after getTimeOffset() function. (You're free to place wherever you like, but remember to add it outside of functions and inside the class) /** * Timespan to get years, months, days and etc between a specified date and the current timestamp * * @access public * @param string Date target * @return string */public function timespan( $timespanToDate ){ if( !is_int( $timespanToDate ) ) { $timespanToDate = strtotime( $timespanToDate ); } $diff = abs( time() - $timespanToDate ); $years = floor( $diff / ( 365 * 60 * 60 * 24 ) ); $months = floor( ( $diff - $years * 365 * 60 * 60 * 24 ) / ( 30 * 60 * 60 * 24 ) ); $days = floor( ( $diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 ) / ( 60 * 60 * 24 ) ); // $hours = floor( ( $diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24 ) / ( 60 * 60 ) ); // $minutes = floor( ( $diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24 - $hours * 60 * 60 ) / 60 ); // $seconds = floor( ( $diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24 - $days * 60 * 60 * 24 - $hours * 60 * 60 - $minutes * 60 ) ); $string = ""; if( $years AND $years >= 1 ) { $string .= $years. " years, "; } if( $months AND $months >= 1 ) { $string .= $months. " months and "; } if( $days AND $days >= 1 ) { $string .= $days. " days ago"; } return $string;}/** * Count how much days left from the current timestamp * * @access public * @param string Date target * @return integer */public function daysleft( $toDate ){ if( !is_int( $toDate ) ) { $toDate = strtotime( $toDate ); } $timeleftTime = $toDate - time(); $timeleftDays = round( ( ( $timeleftTime / 24 ) / 60 ) / 60 ); return $timeleftDays;} Indent the code once to keep the code structure intact. That's it! Enjoy using these in your board. Examples (PHP)... $this->registry->getClass('class_localization' )->timespan( '02 September 1993' );$this->registry->getClass('class_localization' )->daysleft( '05 April 2013' );
  2. http://www.7skyhost.com Location: Ukraine, Netherlands (Offshore) Available: Shared, VPS, Dedicated Warez?: Yes, allowed (No pornography though) Just try them and you'll know. I have a big IP.Board powered community and yet, it is very very fast. And recently they introduced SSD drives to their VPS and dedicated packages. I think you can order one to yours too. However, usually they have EHCP as the control panel (So awesome than cPanel) and server software is NGINX, which is blazing fast, stable and lightweight than Apache.
  3. Name sucks! So not gonna even try it
  4. Best... post... ever! Made my day
  5. Just checkout http://www.7skyhost.com
  6. IPB is not that much heavy. All you need is a well optimized server. Most community suites doesn't practically work well on shared servers. So get yourself a VPS or a Dedicated Server. Checkout http://www.7skyhost.com I'm a IPB-only user and I don't see any single reason why should I even care about any other community suite software... So in short, I recommend IPB Thanks...
  7. Implemented a "Best Answer" feature on my IP.Board community!

    1. Show previous comments  3 more
    2. Skye

      Skye

      Why are you staying on ipb 3.0.0 ?

    3. Guest

      Guest

      because he has a lot of custom modifications :P

    4. Sandakelum

      Sandakelum

      Para said it right :D I can't lose them all, can I... :P

  8. Congratz WebFlake for 1000+ users and 4000+ posts... again... :)

  9. Developing my IP.Board Community...

    1. Show previous comments  1 more
    2. Sandakelum

      Sandakelum

      Thanks Phun... Just doing some minor updates... :)

    3. Skye

      Skye

      Your board is maybe the most advenced/modified board. (running with ipb) :P

    4. Sandakelum

      Sandakelum

      Yeah, it's look that way :) Thanks, really appreciate it :)

  10. Version 1.1.0

    198 downloads

    This hook will create a new sidebar block to list the users with more 'best answer' on forums.
  11. IP.Board (IPB) because of the amount of customizations I could do on my community easily...
  12. Behold! Sandakelum is here!

×
×
  • Create New...