当前位置: 首页>>代码示例>>PHP>>正文


PHP Kernel::addInfo方法代码示例

本文整理汇总了PHP中Kernel::addInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Kernel::addInfo方法的具体用法?PHP Kernel::addInfo怎么用?PHP Kernel::addInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kernel的用法示例。


在下文中一共展示了Kernel::addInfo方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generateAjax

 public function generateAjax()
 {
     $this->contentType = Kernel::CONTENT_TYPE_XML;
     $removeNode = Util::tagToXml('remove', $this->rootNode);
     if (isset($this->url->getPageParams()->filter)) {
         if (!empty($_POST)) {
             //Kernel::addInfo(Kernel::INFOBOX_INFO, "Filter test! ".$_POST['filter']." ".$_POST['timelimit']);
             AVM::setFilter($_POST['filter']);
             AVM::setTimelimit($_POST['timelimit']);
             $this->feedList();
         }
     } else {
         if (isset($this->url->getPageParams()->watched)) {
             if (isset($this->url->getPageParams()->id)) {
                 $id = $this->url->getPageParams()->id;
                 $type = $this->url->getPageParams()->watched;
                 if ($type == 'movie') {
                     Kernel::mysqli()->query("INSERT INTO movie (id, name, year, url, format, watched, file, torrent, ver)\n\t\t\t\t\t\t\t\t\t\t\t SELECT id, name, year, url, format, NOT watched, file, torrent, (ver + 1) FROM movie WHERE id={$id} ORDER BY ver DESC LIMIT 1");
                     Kernel::addInfo(Kernel::INFOBOX_OK, "Watched status changed!");
                     Util::objToXml((object) array('id' => $id), $removeNode, 'movie');
                 } else {
                     if ($type == 'episode') {
                         Kernel::mysqli()->query("INSERT INTO episode (id, serieid, seasonid, episode, title, format, watched, file, torrent, ver)\n\t\t\t\t\t\t\t\t\t\t\t SELECT id, serieid, seasonid, episode, title, format, NOT watched, file, torrent, (ver + 1) FROM episode WHERE id={$id} ORDER BY ver DESC LIMIT 1");
                         Kernel::addInfo(Kernel::INFOBOX_OK, "Watched status changed!");
                         Util::objToXml((object) array('id' => $id), $removeNode, 'episode');
                     }
                 }
             }
         }
     }
 }
开发者ID:jramstedt,项目名称:AVM,代码行数:31,代码来源:Mainpage.class.php

示例2: mysqli

 public static function mysqli()
 {
     if (!isset(Kernel::$mysqli)) {
         Kernel::$mysqli = new mysqli(MYSQL_HOSTNAME, MYSQL_USERNAME, MYSQL_PASSWORD, MYSQL_DATABASE);
         Kernel::$mysqli->set_charset('utf8');
         if (Kernel::$mysqli->connect_error) {
             Kernel::addInfo(INFOBOX_ERROR, 'MySQLi connection failed.');
         }
     }
     return Kernel::$mysqli;
 }
开发者ID:jramstedt,项目名称:AVM,代码行数:11,代码来源:Kernel.class.php

示例3: generateAjax

 public function generateAjax()
 {
     $this->contentType = Kernel::CONTENT_TYPE_XML;
     if (isset($this->url->getPageParams()->edit)) {
         $this->template = NULL;
         // No xsl transform!
         $this->contentType = Kernel::CONTENT_TYPE_PLAIN;
         if (!empty($_POST)) {
             if (!isset($_POST['id']) || !isset($_POST['value'])) {
                 return;
             }
             $elementInfo = explode(':', $_POST['id']);
             $id = Kernel::mysqli()->escape_string($elementInfo[1]);
             $value = Kernel::mysqli()->escape_string($_POST['value']);
             $seekResult = Kernel::mysqli()->query("SELECT * FROM seek WHERE id = {$id} LIMIT 1");
             $seekObj = $seekResult->fetch_object();
             $seekResult->close();
             $element = Kernel::mysqli()->escape_string($elementInfo[0]);
             if ($element == 'name') {
                 $seekObj->name = $value;
             } else {
                 if ($element == 'year') {
                     $seekObj->year = $value;
                 } else {
                     if ($element == 'url') {
                         $seekObj->url = $value;
                     }
                 }
             }
             Kernel::mysqli()->query("UPDATE seek SET name='{$seekObj->name}', year={$seekObj->year}, url='{$seekObj->url}' WHERE id={$id}");
             echo $value;
         }
     } else {
         if (isset($this->url->getPageParams()->add)) {
             if (!empty($_POST)) {
                 if (empty($_POST['name'])) {
                     Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must enter name.');
                 } else {
                     $name = Kernel::mysqli()->escape_string($_POST['name']);
                     $year = Kernel::mysqli()->escape_string($_POST['year']);
                     $url = Kernel::mysqli()->escape_string($_POST['url']);
                     Kernel::mysqli()->query("INSERT INTO seek (name, year, url)\n\t\t\t\t\t\t\t\t\t\t\tVALUES('{$name}','{$year}','{$url}')");
                     $this->seekList(0, 15);
                     Kernel::addInfo(Kernel::INFOBOX_OK, "{$name} ({$year}) added!");
                 }
             }
         }
     }
 }
开发者ID:jramstedt,项目名称:AVM,代码行数:49,代码来源:Seeking.class.php

示例4: generate

 public function generate()
 {
     if (isset($this->url->getPageParams()->logout)) {
         Sessionmanager::logout();
         $this->url->setPage('Login');
         $this->url->clearPageParams();
         header('Location: ' . $this->url->buildUrlString());
     } else {
         if (!empty($_POST)) {
             if (Sessionmanager::login($_POST['username'], $_POST['password'])) {
                 header('Location: ' . $this->url->buildUrlString());
             } else {
                 Kernel::addInfo(Kernel::INFOBOX_ERROR, 'Login failed.');
             }
         }
     }
 }
开发者ID:jramstedt,项目名称:AVM,代码行数:17,代码来源:Login.class.php

示例5: generateAjax

 public function generateAjax()
 {
     $this->template = 'AVM';
     if (isset($this->url->getPageParams()->getserielist)) {
         $this->template = NULL;
         // No xsl transform!
         $this->contentType = Kernel::CONTENT_TYPE_JSON;
         $serieArray = array(array('id' => '0', 'name' => '-- Select serie'));
         $seriesResult = Kernel::mysqli()->query("SELECT a.* FROM serie a WHERE a.ver IN (SELECT MAX(b.ver) FROM serie b WHERE b.id = a.id)");
         if (is_object($seriesResult)) {
             while ($serieObj = $seriesResult->fetch_object()) {
                 $serieArray[] = $serieObj;
             }
             $seriesResult->close();
         }
         echo json_encode($serieArray);
     } else {
         if (isset($this->url->getPageParams()->getseasonlist)) {
             $this->template = NULL;
             // No xsl transform!
             $this->contentType = Kernel::CONTENT_TYPE_JSON;
             $this->template = null;
             if (isset($this->url->getPageParams()->id)) {
                 $id = Kernel::mysqli()->escape_string($this->url->getPageParams()->id);
                 $details = $this->getFileDetailsObjFromUrl();
                 $seasonArray = array();
                 $seasonsResult = Kernel::mysqli()->query("SELECT a.id, a.season FROM season a WHERE a.ver IN (SELECT MAX(b.ver) FROM season b WHERE b.id = a.id AND serieid = {$id})");
                 if (is_object($seasonsResult)) {
                     while ($seasonObj = $seasonsResult->fetch_object()) {
                         if ($details->season == $seasonObj->season) {
                             $seasonObj->selected = true;
                         }
                         $seasonArray[] = $seasonObj;
                     }
                     $seasonsResult->close();
                 }
                 echo json_encode($seasonArray);
             }
         } else {
             if (isset($this->url->getPageParams()->addserie)) {
                 if (!empty($_POST)) {
                     if (empty($_POST['name'])) {
                         Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must enter serie name.');
                     } else {
                         if (empty($_POST['year'])) {
                             Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must enter serie year.');
                         } else {
                             $name = Kernel::mysqli()->escape_string($_POST['name']);
                             $year = Kernel::mysqli()->escape_string($_POST['year']);
                             $url = Kernel::mysqli()->escape_string($_POST['url']);
                             $file = Kernel::mysqli()->escape_string($_POST['file']);
                             $torrent = Kernel::mysqli()->escape_string($_POST['torrent']);
                             Kernel::mysqli()->query("INSERT INTO serie (name, year, url, file, torrent)\n\t\t\t\t\t\t\t\t\t\t\tVALUES('{$name}','{$year}','{$url}','{$file}','{$torrent}')");
                             Kernel::addInfo(Kernel::INFOBOX_OK, "Serie {$name} ({$year}) added!");
                         }
                     }
                 }
             } else {
                 if (isset($this->url->getPageParams()->addseason)) {
                     if (!empty($_POST)) {
                         if (empty($_POST['serieid'])) {
                             Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must select serie.');
                         } else {
                             if (empty($_POST['season'])) {
                                 Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must enter season number.');
                             } else {
                                 $serieid = Kernel::mysqli()->escape_string($_POST['serieid']);
                                 $season = Kernel::mysqli()->escape_string($_POST['season']);
                                 $state = Kernel::mysqli()->escape_string($_POST['state']);
                                 $watched = Kernel::mysqli()->escape_string($_POST['watched']);
                                 $file = Kernel::mysqli()->escape_string($_POST['file']);
                                 $torrent = Kernel::mysqli()->escape_string($_POST['torrent']);
                                 Kernel::mysqli()->query("INSERT INTO season (serieid, season, state, watched, file, torrent)\n\t\t\t\t\t\t\t\t\t\t\tVALUES('{$serieid}','{$season}','{$state}','{$watched}','{$file}','{$torrent}')");
                                 Kernel::addInfo(Kernel::INFOBOX_OK, "Season {$season} added!");
                             }
                         }
                     }
                 } else {
                     if (isset($this->url->getPageParams()->addepisode)) {
                         if (!empty($_POST)) {
                             if (empty($_POST['serieid'])) {
                                 Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must select serie.');
                             } else {
                                 if (empty($_POST['seasonid'])) {
                                     Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must select season.');
                                 } else {
                                     if (empty($_POST['episode'])) {
                                         Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must enter episode number.');
                                     } else {
                                         if (empty($_POST['title'])) {
                                             Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must enter title.');
                                         } else {
                                             if (!isset($_POST['format'])) {
                                                 Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must enter format.');
                                             } else {
                                                 $serieid = Kernel::mysqli()->escape_string($_POST['serieid']);
                                                 $seasonid = Kernel::mysqli()->escape_string($_POST['seasonid']);
                                                 $episode = Kernel::mysqli()->escape_string($_POST['episode']);
                                                 $title = Kernel::mysqli()->escape_string($_POST['title']);
                                                 $format = AVM::$videoFormat[Kernel::mysqli()->escape_string($_POST['format'])];
//.........这里部分代码省略.........
开发者ID:jramstedt,项目名称:AVM,代码行数:101,代码来源:Unhandled.class.php

示例6: generateAjax

 public function generateAjax()
 {
     $this->contentType = Kernel::CONTENT_TYPE_XML;
     if (isset($this->url->getPageParams()->edit)) {
         $this->template = NULL;
         // No xsl transform!
         $this->contentType = Kernel::CONTENT_TYPE_PLAIN;
         if (!empty($_POST)) {
             if (!isset($_POST['id']) || !isset($_POST['value'])) {
                 return;
             }
             $elementInfo = explode(':', $_POST['id']);
             $id = Kernel::mysqli()->escape_string($elementInfo[1]);
             $value = Kernel::mysqli()->escape_string($_POST['value']);
             $movieResult = Kernel::mysqli()->query("SELECT * FROM movie WHERE id = {$id} ORDER BY ver DESC LIMIT 1");
             $movieObj = $movieResult->fetch_object();
             $movieResult->close();
             $element = Kernel::mysqli()->escape_string($elementInfo[0]);
             if ($element == 'name') {
                 $movieObj->name = $value;
             } else {
                 if ($element == 'year') {
                     $movieObj->year = $value;
                 } else {
                     if ($element == 'url') {
                         $movieObj->url = $value;
                     } else {
                         if ($element == 'format') {
                             $value = AVM::$videoFormat[$value];
                             $movieObj->format = $value;
                         } else {
                             if ($element == 'watched') {
                                 $movieObj->watched = $value;
                             } else {
                                 if ($element == 'file') {
                                     $movieObj->file = $value;
                                 } else {
                                     if ($element == 'torrent') {
                                         $movieObj->torrent = $value;
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
             Kernel::mysqli()->query("INSERT INTO movie (id, name, year, url, format, watched, file, torrent, ver)\r\n\t\t\t\t\t\t\t\t\t\t SELECT {$movieObj->id}, '{$movieObj->name}', {$movieObj->year}, '{$movieObj->url}', '{$movieObj->format}', {$movieObj->watched}, '{$movieObj->file}', '{$movieObj->torrent}', (coalesce(max(ver), 0) + 1) FROM movie WHERE id={$id}");
             echo $value;
         }
     } else {
         if (isset($this->url->getPageParams()->watched)) {
             if (isset($this->url->getPageParams()->id)) {
                 $id = $this->url->getPageParams()->id;
                 Kernel::mysqli()->query("INSERT INTO movie (id, name, year, url, format, watched, file, torrent, ver)\r\n\t\t\t\t\t\t\t\t\t\t SELECT id, name, year, url, format, NOT watched, file, torrent, (ver + 1) FROM movie WHERE id={$id} ORDER BY ver DESC LIMIT 1");
                 Kernel::addInfo(Kernel::INFOBOX_OK, "Watched status changed!");
                 $movieResult = Kernel::mysqli()->query("SELECT * FROM movie WHERE id = {$id} ORDER BY ver DESC LIMIT 1");
                 $movieObj = $movieResult->fetch_object();
                 $movieResult->close();
                 Util::objToXml($movieObj, $this->rootNode, 'movie');
             }
         } else {
             if (isset($this->url->getPageParams()->add)) {
                 if (!empty($_POST)) {
                     if (empty($_POST['name'])) {
                         Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must enter movie name.');
                     } else {
                         if (empty($_POST['year'])) {
                             Kernel::addInfo(Kernel::INFOBOX_ERROR, 'You must enter year.');
                         } else {
                             $name = Kernel::mysqli()->escape_string($_POST['name']);
                             $year = Kernel::mysqli()->escape_string($_POST['year']);
                             $url = Kernel::mysqli()->escape_string($_POST['url']);
                             $format = AVM::$videoFormat[Kernel::mysqli()->escape_string($_POST['format'])];
                             $watched = empty($_POST['watched']) ? 0 : 1;
                             $file = Kernel::mysqli()->escape_string($_POST['file']);
                             $torrent = Kernel::mysqli()->escape_string($_POST['torrent']);
                             Kernel::mysqli()->query("INSERT INTO movie (name, year, url, format, watched, file, torrent)\r\n\t\t\t\t\t\t\t\t\t\t\tVALUES('{$name}','{$year}','{$url}','{$format}','{$watched}','{$file}','{$torrent}')");
                             //$id = Kernel::mysqli()->insert_id;
                             $this->movieList(0, 15);
                             Kernel::addInfo(Kernel::INFOBOX_OK, "{$name} ({$year}) [{$format}] added!");
                             /*
                             $movieResult = Kernel::mysqli()->query("SELECT * FROM movie WHERE id = $id ORDER BY ver DESC LIMIT 1");
                             $movieObj = $movieResult->fetch_object();
                             $movieResult->close();
                             
                             Util::objToXml($movieObj, $this->rootNode, 'movie');
                             */
                         }
                     }
                 }
             }
         }
     }
 }
开发者ID:jramstedt,项目名称:AVM,代码行数:94,代码来源:Movies.class.php

示例7: generateAjax

 public function generateAjax()
 {
     if (isset($this->url->getPageParams()->seed)) {
         if (isset($this->url->getPageParams()->serie)) {
             $id = $this->url->getPageParams()->serie;
             Kernel::addInfo(Kernel::INFOBOX_OK, "Seeding started!");
         } else {
             if (isset($this->url->getPageParams()->season)) {
                 $id = $this->url->getPageParams()->season;
                 Kernel::addInfo(Kernel::INFOBOX_OK, "Seeding started!");
             } else {
                 if (isset($this->url->getPageParams()->episode)) {
                     $id = $this->url->getPageParams()->episode;
                     Kernel::addInfo(Kernel::INFOBOX_OK, "Seeding started!");
                 }
             }
         }
     } else {
         if (isset($this->url->getPageParams()->watched)) {
             if (isset($this->url->getPageParams()->season)) {
                 $id = $this->url->getPageParams()->season;
                 Kernel::mysqli()->query("INSERT INTO season (id, serieid, season, state, watched, file, torrent, ver)\r\n\t\t\t\t\t\t\t\t\t\t SELECT id, serieid, season, state, NOT watched, file, torrent, (ver + 1) FROM season WHERE id={$id} ORDER BY ver DESC LIMIT 1");
                 Kernel::addInfo(Kernel::INFOBOX_OK, "Watched status changed!");
                 $this->getSeason($id);
             } else {
                 if (isset($this->url->getPageParams()->episode)) {
                     $id = $this->url->getPageParams()->episode;
                     Kernel::mysqli()->query("INSERT INTO episode (id, serieid, seasonid, episode, title, format, watched, file, torrent, ver)\r\n\t\t\t\t\t\t\t\t\t\t SELECT id, serieid, seasonid, episode, title, format, NOT watched, file, torrent, (ver + 1) FROM episode WHERE id={$id} ORDER BY ver DESC LIMIT 1");
                     Kernel::addInfo(Kernel::INFOBOX_OK, "Watched status changed!");
                     $this->getEpisode($id);
                 }
             }
         } else {
             if (isset($this->url->getPageParams()->getserielist)) {
                 $this->template = NULL;
                 // No xsl transform!
                 $this->contentType = Kernel::CONTENT_TYPE_JSON;
                 $serieArray = array(array('id' => '0', 'name' => '-- Select serie'));
                 $seriesResult = Kernel::mysqli()->query("SELECT a.* FROM serie a WHERE a.ver IN (SELECT MAX(b.ver) FROM serie b WHERE b.id = a.id) ORDER BY name");
                 if (is_object($seriesResult)) {
                     while ($serieObj = $seriesResult->fetch_object()) {
                         $serieArray[] = $serieObj;
                     }
                     $seriesResult->close();
                 }
                 echo json_encode($serieArray);
             } else {
                 if (isset($this->url->getPageParams()->getseasonlist)) {
                     $this->template = NULL;
                     // No xsl transform!
                     $this->contentType = Kernel::CONTENT_TYPE_JSON;
                     if (isset($this->url->getPageParams()->id)) {
                         $id = Kernel::mysqli()->escape_string($this->url->getPageParams()->id);
                         $seasonArray = array();
                         $seasonsResult = Kernel::mysqli()->query("SELECT a.id, a.season FROM season a WHERE a.ver IN (SELECT MAX(b.ver) FROM season b WHERE b.id = a.id AND serieid = {$id}) ORDER BY season");
                         if (is_object($seasonsResult)) {
                             while ($seasonObj = $seasonsResult->fetch_object()) {
                                 $seasonArray[] = $seasonObj;
                             }
                         }
                         $seasonsResult->close();
                         echo json_encode($seasonArray);
                     }
                 } else {
                     if (isset($this->url->getPageParams()->edit)) {
                         $this->template = NULL;
                         // No xsl transform!
                         $this->contentType = Kernel::CONTENT_TYPE_PLAIN;
                         if (!empty($_POST)) {
                             $typeInfo = explode(':', $this->url->getPageParams()->id);
                             $type = Kernel::mysqli()->escape_string($typeInfo[0]);
                             if ($type == 'serie') {
                                 if (!isset($_POST['id']) || !isset($_POST['value'])) {
                                     return;
                                 }
                                 $elementInfo = explode(':', $_POST['id']);
                                 $id = Kernel::mysqli()->escape_string($elementInfo[0]);
                                 $value = Kernel::mysqli()->escape_string($_POST['value']);
                                 $serieResult = Kernel::mysqli()->query("SELECT * FROM serie WHERE id = {$id} ORDER BY ver DESC LIMIT 1");
                                 $serieObj = $serieResult->fetch_object();
                                 $serieResult->close();
                                 $element = Kernel::mysqli()->escape_string($elementInfo[1]);
                                 if ($element == 'name') {
                                     $serieObj->name = $value;
                                 } else {
                                     if ($element == 'year') {
                                         $serieObj->year = $value;
                                     } else {
                                         if ($element == 'url') {
                                             $serieObj->url = $value;
                                         } else {
                                             if ($element == 'file') {
                                                 $serieObj->file = $value;
                                             } else {
                                                 if ($element == 'torrent') {
                                                     $serieObj->torrent = $value;
                                                 }
                                             }
                                         }
                                     }
//.........这里部分代码省略.........
开发者ID:jramstedt,项目名称:AVM,代码行数:101,代码来源:Series.class.php


注:本文中的Kernel::addInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。