Jump to content

f3nnix

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://anctu.com/marko

Profile Information

  • Gender
    Male
  • Location
    Croatia

f3nnix's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So, I've been writing a...search engine lets say. For some wierd reason of understanding the project, I've writed it in plain php, no frameworks, not shortcuts or so... While doing that, I been thinking after I finish the core point of it, I will rewrite it into some framework, eather some third party fw or I will write my own one. The time passed, I've been hardcoding even after I finished the whole core structure and even came to a point of finalization, even with css & js. So now, gess what? I whant to rewrite it in some framework. Crazy me. So the questions are: 1. Should I use some third framework like codeigniter or start by writing my own? 2. If i should get some third, which one? 3. Which one does work best with praseing json data and mainly praseing with cUrl? Most of anwsers I know, but I whana hear others opinion... mabey mine changes! Thanks for reading!
  2. pff, not really sure what you whant but something like this could help //Get the document in a string $document = file_get_contents("sample.rtf",true); //translate into these entities $htmlCode = htmlentities($document); //print it out (exp.) echo $htmlCode;
  3. Yea it's acceptable, I don't whana act a smartass but you could tweek it abit for changeing stuff later in it For example, you can make you'r self or others who work or will work with you, a life easyer later on by flexible image changeing, same you can do with 'width' or 'alt'. class onlineStat{ public function runOnlineStatus($lastActivity,$onlineImg,$idleImg,$offlineImg){ //Set the time $minutesOnline = $this->setTime($lastActivity); if ($minutesOnline < 15){ $indicator = $this->online($onlineImg); } else if ($minutesOnline < 30){ $indicator = $this->idle($idleImg); } else{ $indicator = $this->offline($offlineImg); } return $indicator; } // time unix public function setTime($lastActivity){ $minutesOnline = (time() - strtotime($lastActivity))/60; return $minutesOnline; } // set images for statuses public function online($img){ $indicator = '<img src="images/'.$img.'" width="10" alt="Member Online" /><br />'; return $indicator; } public function idle($img){ $indicator = '<img src="images/'.$img.'" width="10" alt="Member Online" /><br />'; return $indicator; } public function offline($img){ $indicator = '<img src="images/'.$img.'" width="10" alt="Member Online" /><br />'; return $indicator; } } /** So now you can go like this in you'r html */ // Your last activity string $lastActivity; //Run the class $onlineStatus = new onlineStat; //set Images $onlineImg = "Light_Green_10.png"; $idleImg = "Light_Yellow_10.png"; $offlineImg = "Light_Gray_10.png"; //get Indicator $indicator = $onlineStatus->runOnlineStatus($lastActivity,$onlineImg,$idleImg,$offlineImg); Hope it helps
  4. Hello folks! Been playing with PHP for several years, working on few projects & leading a fresh company. I feelt kinda lack of php community, so here I am, I hope we will go along! Cheers all!
×
×
  • 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.