Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Trium918's Achievements

Advanced Member

Advanced Member (4/5)



  1. 2 hrs. Also would a loop be necessary for multiple challenges
  2. I'm sorry about that, but to answer your question yes. The challenge is targeted at specific users.
  3. I'm trying to allow the user to accept/decline challenges from other users through submit buttons. I have it where the initial user submit his or her challenge to the database, but how do I go about retrieving the data from the database and sending it to user who is being challenged, so that they are allowed to accept or decline? I just need to be pointed in the right direction, thanks.
  4. Contact me for details.
  5. // would this be consider short hand coding in JavaScript or not? var History = function() { var self = this; var args = arguments; $(function(){ self.init.apply(self, args); }); };
  6. I am having problems writing to the file called logs.
  7. <?php class FileStorage { function FileStorage($path, $shoutLog = false) { $this->shoutLog = $shoutLog; $folder = 'logs'; if (!is_dir($folder)) $folder = '../' . $folder; if (!is_dir($folder)) $folder = '../' . $folder; $this->path = $folder . '/' . $path . '.txt'; } function open($lock = false) { $this->handle = fopen($this->path, 'a+'); if ($lock) { $this->lock(); return $this->load(); } } function close(&$array) { if (isset($array)) $this->save($array); $this->unlock(); fclose($this->handle); unset($this->handle); } function load() { if (($contents = $this->read($this->path)) == null) return $this->resetArray(); return unserialize($contents); } function save(&$array, $unlock = true) { $contents = serialize($array); $this->write($contents); if ($unlock) $this->unlock(); } function unlock() { if (isset($this->handle)) flock($this->handle, LOCK_UN); } function lock() { if (isset($this->handle)) flock($this->handle, LOCK_EX); } function read() { fseek($this->handle, 0); //return stream_get_contents($this->handle); return file_get_contents($this->path); } function write($contents) { ftruncate($this->handle, 0); fwrite($this->handle, $contents); } function resetArray() { if ($this->shoutLog) $default = array( 'info' => array( 'latestTimestamp' => -1 ), 'posts' => array() ); else $default = array(); $this->save($default, false); return $default; } } ?> Here is the complete class. I am trying to figure out why this class isn't writing to the log file.
  8. <?php class FileStorage { function FileStorage($path, $shoutLog = false) { $this->shoutLog = $shoutLog; $folder = 'logs'; if (!is_dir($folder)) $folder = '../' . $folder; if (!is_dir($folder)) $folder = '../' . $folder; $this->path = $folder . '/' . $path . '.txt'; } $show_path= new FileStorage; echo $show_path ->FileStorage(); ?> What is the correct way to call the class FileStorage's object? I am trying to test the class to see if it is working.
  9. Where would you start? I would like to write my own as my first real project.
  10. Ok, something happen. I am not able to log into the control panel after changing all short tags.
  11. I need help installing yshout 5.
  12. Thanks! I was searching shout box only without the php...
  13. Where can I found a shout box or do I have to write one myself?
  14. What are somethings that I can do to improve this code? Thanks..
  • 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.