$lastruntime) { logger("job: repostMsg - repost message: ".$channelInfoNew[$channelInfoKey]["repostinfomsg_msgid"]." on ".$channelInfoNew[$channelInfoKey]["name"].":".$channelInfoNew[$channelInfoKey]["repostinfomsg_topicid"].""); $sql="update repostmsg set lastruntime=".time().", channelname='".pg_escape_string($globalsettings["db"]["pg_conn"], $channelInfoNew[$channelInfoKey]["name"])."', lastrun='".date($globalsettings["bot"]["defaultdateformat"], time())."', nextrun='".date($globalsettings["bot"]["defaultdateformat"], $nextruntime)."' where channelid='".$channelInfoKey."';"; pg_query($globalsettings["db"]["pg_conn"], $sql); switch($channelInfoNew[$channelInfoKey]["repostinfomsg_topicid"]) { case "-1": made("messages", "forwardMessages", array("background" => true, "drop_author" => true, "from_peer" => $channelInfoNew[$channelInfoKey]["peerid"], "to_peer" => $channelInfoNew[$channelInfoKey]["peerid"], "id" => [ $channelInfoNew[$channelInfoKey]["repostinfomsg_msgid"] ])); break; default: made("messages", "forwardMessages", array("background" => true, "drop_author" => true, "from_peer" => $channelInfoNew[$channelInfoKey]["peerid"], "to_peer" => $channelInfoNew[$channelInfoKey]["peerid"], "id" => [ $channelInfoNew[$channelInfoKey]["repostinfomsg_msgid"] ], "top_msg_id" => $channelInfoNew[$channelInfoKey]["repostinfomsg_topicid"])); } // switch($channelInfoNew[$channelInfoKey]["repostmsg_topicid"]) } // if (time() > $lastruntime) } // if ($numrows == 0) } // if ($channelInfoNew[$channelInfoKey]["repostmsg_msgid"] != -1) } // foreach($channelInfoNew as $channelInfoKey) } // function end