Jump to content

[SOLVED] translate into php?


jwk811

Recommended Posts

   function delete_offline_users()
   {
  	 $time = time();
  	 // usuniecie uzytkownikow ktorzy wyszli z chata

  	 $result = mysql_query("select * from ".LTChat_Main_prefix."who_is_online where online = '1' and action_time < {$time}-".get_ConfVar("LTChart_offline_user_after")." and chat_id = '".LTChat_Main_CHAT_ID."'") or debug(mysql_error(), "LTChatDataKeeper", __LINE__);
  	 while ($row = mysql_fetch_object($result))
  	 {
   mysql_query("delete from ".LTChat_Main_prefix."who_is_online where who_id = '{$row->who_id}' and room = '{$row->room}' and chat_id = '".LTChat_Main_CHAT_ID."'") or debug(mysql_error(), "LTChatDataKeeper", __LINE__);
  	   mysql_query("insert into ".LTChat_Main_prefix."who_is_online(action_time, users_id, room, online, chat_id) values  ('{$time}', '{$row->users_id}','{$row->room}','0','".LTChat_Main_CHAT_ID."')") or debug(mysql_error(), "LTChatDataKeeper", __LINE__);
  	 }
   }

Link to comment
https://forums.phpfreaks.com/topic/172895-solved-translate-into-php/
Share on other sites

i realize thats a lot to translate and the code thing made it weird. well how could i? heres the code again:

 

 

  function delete_offline_users()

  {

  $time = time();

  // usuniecie uzytkownikow ktorzy wyszli z chata

 

  $result = mysql_query("select * from ".LTChat_Main_prefix."who_is_online where online = '1' and action_time < {$time}-".get_ConfVar("LTChart_offline_user_after")." and chat_id = '".LTChat_Main_CHAT_ID."'") or debug(mysql_error(), "LTChatDataKeeper", __LINE__);

  while ($row = mysql_fetch_object($result))

  {

  mysql_query("delete from ".LTChat_Main_prefix."who_is_online where who_id = '{$row->who_id}' and room = '{$row->room}' and chat_id = '".LTChat_Main_CHAT_ID."'") or debug(mysql_error(), "LTChatDataKeeper", __LINE__);

    mysql_query("insert into ".LTChat_Main_prefix."who_is_online(action_time, users_id, room, online, chat_id) values  ('{$time}', '{$row->users_id}','{$row->room}','0','".LTChat_Main_CHAT_ID."')") or debug(mysql_error(), "LTChatDataKeeper", __LINE__);

  }

  }

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.