/** * content of the middle column - this is the most important part */ protected function column_col3() { // get the translation module $words = $this->getWords(); echo ' <h3>Admin Links</h3> <p> Updating Tree of links </p> '; $model = new LinkModel(); // $listitem = array('fromID' => '10', 'toID' => '11', 'degree' => '1', 'rank' => '1', 'path' => '2'); // var_dump($listitem); // $model->createLinkList($listitem); $model->updateLinks(); //$flush = $model->deleteLinkList(); //$model->getTree(); }
/** * content of the middle column - this is the most important part */ protected function column_col3() { echo ' <h3>The hello universe middle column</h3> using the class HellouniverseSimplePage.<br> More beautiful in <a href="hellouniverse/advanced">hellouniverse/advanced</a>!<br> With tabs in <a href="hellouniverse/tab1">hellouniverse/tab1</a>! '; $model = new LinkModel(); $listitem = array('fromID' => '10', 'toID' => '11', 'degree' => '1', 'rank' => '1', 'path' => '2'); var_dump($listitem); //$model->createLinkList($listitem); $comments = $model->getLinks(); var_dump($comments); foreach ($comments as $comment) { echo "From: " . $comment->IdFromMember . " To: " . $comment->IdToMember . "<br>"; $link = array('fromID' => "{$comment->IdFromMember}", 'toID' => "{$comment->IdToMember}", 'degree' => '1', 'rank' => '1', 'path' => "'({$comment->IdFromMember},{$comment->IdToMember})'"); var_dump($link); $model->createLinkList($link); } }
/** * content of the middle column - this is the most important part */ protected function column_col3() { // get the translation module $words = $this->getWords(); echo ' <h3>Admin Links</h3> <p> Rebuildin the Tree of links </p> '; $type = PRequest::get()->request; $model = new LinkModel(); switch ($type[1]) { case 'rebuild': $model->rebuildLinks(); break; case 'rebuildmissing': $model->rebuildMissingLinks(); break; } }
public function del() { $id = I('id', NULL); if (!empty($id)) { $model = new LinkModel(); if (is_array($id)) { $where = 'id in (' . implode(',', $id) . ')'; } else { $where = 'id = ' . $id; $link = $model->where('id=' . $id)->find(); if ($link['is_sys'] == 1) { $this->message('系统内置,删除失败!', __URL__ . '/index'); } } if (false !== $model->where($where)->delete()) { $this->message('删除成功', __URL__ . '/index'); } else { $this->message('删除失败:' . $model->getError(), __URL__ . '/index'); } } else { $this->message('请选择删除对象', __URL__ . '/index'); } }
/** * content of the middle column - this is the most important part */ protected function column_col3() { // get the translation module $words = $this->getWords(); echo ' <h3>The hello universe (advanced) middle column</h3> <p> Using the class "' . get_class($this) . '".<br> Simple version in <a href="hellouniverse">hellouniverse</a>.<br> More beautiful in <a href="hellouniverse/advanced">hellouniverse/advanced</a>!<br> With tabs in <a href="hellouniverse/tab1">hellouniverse/tab1</a>! </p> <br> <p> A translated word (wordcode "Groups"): ' . $words->getFormatted('Groups') . ' </p> '; $model = new LinkModel(); $comments = $model->getLinks(); //var_dump($comments); $link = $model->getLinks(1, 95); $path = unserialize($link->path); }
/** * 底部链接:type_id==3 */ public static function footers() { return LinkModel::where('cid', 0)->where('type_id', 3)->orderBy('sort', 'desc')->paginate(10); }