本文整理汇总了PHP中link类的典型用法代码示例。如果您正苦于以下问题:PHP link类的具体用法?PHP link怎么用?PHP link使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了link类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: module_link_edit
function module_link_edit()
{
global $global, $smarty;
$obj = new link();
$obj->set_where('lin_id = ' . $global['id']);
$smarty->assign('link', $obj->get_one());
}
示例2: updateContent
function updateContent($obj)
{
$link = new link();
$link->objectInit($obj);
unset($link->id);
$this->content[$obj->id] = $link;
$obj->save();
}
示例3: index
public function index($id = NULL, $page = 1)
{
if (is_null($id) or is_numeric($id)) {
$this->redirect($this->conf['blog_siteurl']);
}
$tag = $id;
$post = new post();
$link = new link();
$comment = new comment();
$this->html->useTheme($this->conf['blog_current_theme']);
$info = array();
$info["isAdmin"] = false;
if ($this->cookie->check("logged") and $this->cookie->id_user == 1) {
$info["isAdmin"] = true;
}
$this->themes->info = $info;
$includes['charset'] = $this->html->charsetTag("UTF-8");
$includes['rssFeed'] = $this->html->includeRSS();
if ($page > 1) {
$includes['canonical'] = "<link rel=\"canonical\" href=\"{$this->conf['blog_siteurl']}/tag/" . rawurlencode($post->sql_escape($id)) . "/{$page}\" />";
} else {
$includes['canonical'] = "<link rel=\"canonical\" href=\"{$this->conf['blog_siteurl']}/tag/" . rawurlencode($post->sql_escape($id)) . "\" />";
}
$this->registry->includes = $includes;
$this->plugin->call('index_includes');
$includes = null;
foreach ($this->registry->includes as $include) {
$includes .= $include;
}
$this->themes->includes = $includes;
$this->themes->links = $link->findAll();
$this->themes->single = false;
$total_rows = $post->countPosts(array('status' => 'publish', 'tag' => $tag));
$page = (int) is_null($page) ? 1 : $page;
$limit = $this->conf['blog_posts_per_page'];
$offset = ($page - 1) * $limit;
$limitQuery = $offset . "," . $limit;
$targetpage = $this->path . "tag/{$tag}/";
$this->themes->pagination = $this->pagination->init($total_rows, $page, $limit, $targetpage);
$posts = $post->getPostsByTag($tag, $limitQuery);
foreach ($posts as $k => $p) {
$posts[$k]['title'] = htmlspecialchars($p['title']);
$posts[$k]['tags'] = $post->getTags($p['ID']);
$posts[$k]['comments_count'] = $comment->countCommentsByPost($posts[$k]['ID']);
$user = new user();
if ($posts[$k]['id_user'] < 2) {
$posts[$k]['autor'] = $user->find(1);
} else {
$posts[$k]['autor'] = $user->find($posts[$k]['id_user']);
}
}
$this->registry->posts = $posts;
$this->plugin->call("index_post_content");
$this->themes->posts = $this->registry->posts;
$this->themes->title_for_layout = "{$this->conf['blog_name']} - {$tag}";
$this->render();
}
示例4: add_or_edit_link
function add_or_edit_link()
{
global $smarty, $lang;
$lin_id = post('lin_id');
$lin_word = post('lin_word');
$lin_url = post('lin_url');
$lin_img = post('lin_img');
$lin_title = post('lin_title');
if ($lin_img == 'http://' || $lin_img == '') {
$lin_img = 'none';
}
$obj = new link();
$obj->set_value('lin_word', $lin_word);
$obj->set_value('lin_url', $lin_url);
$obj->set_value('lin_img', $lin_img);
$obj->set_value('lin_title', $lin_title);
if ($lin_id != '') {
$obj->set_where("lin_id = {$lin_id}");
$obj->edit();
$info_text = '修改友情链接成功';
} else {
$obj->set_value('lin_lang', S_LANG);
$obj->add();
$info_text = '添加友情链接成功';
}
$smarty->assign('info_text', $info_text);
$smarty->assign('link_text', $lang['return_list']);
$smarty->assign('link_href', url(array('channel' => 'service', 'mod' => 'link_list')));
}
示例5: module_link
function module_link()
{
global $smarty;
$obj = new link();
$obj->set_field('lin_url,lin_img,lin_word,lin_title');
$obj->set_where("lin_img <> 'none'");
$smarty->assign('img_link', $obj->get_list());
$obj = new link();
$obj->set_field('lin_url,lin_img,lin_word,lin_title');
$obj->set_where("lin_img = 'none'");
$smarty->assign('word_link', $obj->get_list());
}
示例6: getEdit
public function getEdit($id)
{
Allow::permission($this->module['group'], 'groups');
if ($id == 1 && !Allow::superuser()) {
Redirect(link::auth($this->module['rest']));
}
$groups = Group::all();
$group = Group::find($id);
$mod_actions = Config::get('mod_actions');
$mod_info = Config::get('mod_info');
#Helper::dd($mod_actions);
#Helper::dd($mod_info);
$group_actions = Action::where('group_id', $group->id)->get();
#$actions = $group->actions();
$actions = array();
foreach ($group_actions as $action) {
#Helper::d($action->status);
#continue;
if ($action->status) {
$actions[$action->module][$action->action] = $action->status;
}
}
#Helper::dd($actions);
$group_actions = $actions;
return View::make($this->module['tpl'] . 'edit', compact('groups', 'group', 'mod_actions', 'mod_info', 'group_actions'));
}
示例7: GetLinks
public function GetLinks()
{
$link = new link();
$sql = "\n\t\tSELECT lid, header, www, description, type, date\n\t\tFROM links\n\t\t";
$stmt = DBConnection::getInstance()->Prepare($sql);
if ($stmt = DBConnection::getInstance()->Prepare($sql)) {
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_OBJ);
}
if (is_array($result)) {
foreach ($result as $object) {
$m_links[] = $link->createLink($object->lid, $object->header, $object->www, $object->description, $object->type, $object->date);
}
}
return $m_links;
}
示例8: createThumbnail
/**
* create thumbnail from existing image with max sizes
*
* @param link $im - ImageMagick object
* @param string $targetFilePath
* @param int $maxX
* @param int $maxY
*/
public function createThumbnail($im, $sourceInfo, $targetFilePath, $width, $height, $save_dimensions = false)
{
if ($sourceInfo) {
if ($width && $height) {
if ($save_dimensions) {
$ratio_orig = $sourceInfo[0] / $sourceInfo[1];
if ($width / $height > $ratio_orig) {
$width = round($height * $ratio_orig);
} else {
$height = round($width / $ratio_orig);
}
}
if ($sourceInfo[0] < $width) {
$width = $sourceInfo[0];
$height = $sourceInfo[1];
}
$width && $height ? $im->cropThumbnailImage($width, $height) : false;
}
$im->setImageCompression(imagick::COMPRESSION_JPEG);
$im->setImageCompressionQuality(95);
$im->stripImage();
$result = $im->writeImage($targetFilePath);
$im->destroy();
return $result;
}
}
示例9: checkSession
public function checkSession($username)
{
$link = new link();
$con = $link->connect();
if (!isset($_SESSION['user'])) {
return "Session expired";
$session_state = 0;
} else {
$user_active_session = $_SESSION['user'];
$character_get = $_GET['character'];
$check_char_belong_session = mysqli_query($con, "SELECT * FROM v_user_characters\n WHERE username = '{$username}' AND character_eve_idcharacter = '{$character_get}'") or die(mysqli_error($con));
if (mysqli_num_rows($check_char_belong_session) == 0) {
$session_state = 0;
echo "Sneaky sneaky";
//exit();
} else {
$session_state = 1;
}
}
}
示例10: show
/**
* Method to build the menu in html for display purposes.
*
* @param string $iconPath The path to the icons within the skins
* icons folder. Default: false.
*
* @return string $menu The menu
*/
public function show()
{
$homeLabel = $this->objLanguage->languageText('word_home', 'system', 'Home');
$logoutLabel = $this->objLanguage->languageText('word_logout', 'system', 'Logout');
$confirmLabel = $this->objLanguage->languageText('phrase_confirmlogout');
$home = $this->objConfig->getdefaultModuleName();
$str = '<ul id="menuList" class="adxm">';
//this is not using this javascript menu. its using the css one
$str .= '<li id="home" class="navigation-list first" ><a href="' . $this->uri('', $home) . '">' . $homeLabel . '</a></li>';
foreach ($this->menu as $key => $item) {
$objLink = new link('#');
$objLink->link = $key . ' ';
$str .= '<li id="' . strtolower($key) . '" class="navigation-list">' . $objLink->show() . '<ul class="inner-menu" >' . "\n";
$counter = 1;
$numitems = count($item);
foreach ($item as $link => $val) {
$this->toolbarIcon->setIcon($link, null, 'icons/modules/');
$this->toolbarIcon->title = $val;
$this->toolbarIcon->align = 'left';
$this->toolbarIcon->extra = ' vspace="3" hspace="5" width="17" height="17"';
$icon = $this->toolbarIcon->show();
$objLink = new link($this->uri('', $link));
$objLink->link = $icon . '<div class="menulinktext">' . $val . '</div>';
$valLink = $objLink->show();
if ($counter == 1) {
$cssclass = 'first';
} else {
if ($counter == $numitems) {
$cssclass = 'last';
}
}
$str .= '<li id="" class="' . $cssclass . '">' . $valLink . "</li>\r\n";
$counter++;
}
$str .= "</ul></li>\n";
}
$str .= '<li id="logout" class="navigation-list last"><a href="javascript: if(confirm(\'' . $confirmLabel . '\')) {document.location= \'' . $this->uri(array('action' => 'logoff'), 'security', '', FALSE, TRUE) . '\'};">' . $logoutLabel . '</a></li>';
$str .= "</ul>";
return $str;
}
示例11: show
/**
* Method to build the menu in html for display purposes.
* @param string $iconPath The path to the icons within the skins
* icons folder. Default: false.
* @return string $menu The menu
*/
public function show()
{
$homeLabel = $this->objLanguage->languageText('word_home', 'system', 'Home');
$logoutLabel = $this->objLanguage->languageText('word_logout', 'system', 'Logout');
$confirmLabel = $this->objLanguage->languageText('phrase_confirmlogout');
$postlogin = 'cms';
//$this->objConfig->getdefaultModuleName();
$home = $this->objConfig->getPrelogin();
$showLogout = FALSE;
// Check if the user is logged in
if ($this->objUser->isLoggedIn()) {
$home = $postlogin;
$showLogout = TRUE;
}
$str = '<ul style="list-style: none; background-color:#fff;">';
// Home link
$objLink = new link($this->uri('', $home));
$objLink->link = $homeLabel;
$link = $objLink->show();
$str .= '<li style="border-right: 1px #ead0cf dotted; background-image: none;">' . $link . '</li>';
if (!empty($this->menu)) {
foreach ($this->menu as $item) {
$actArr = !empty($item['action']) ? array('action' => $item['action']) : '';
$objLink = new link($this->uri($actArr, $item['module']));
$objLink->link = $item['text'];
$link = $objLink->show();
$str .= '<li style="border-right: 1px #ead0cf dotted; background-image: none;">' . $link . '</li>';
}
}
if ($showLogout) {
$url = $this->uri(array('action' => 'logoff'), 'security');
$objLink = new link("javascript: if(confirm('{$confirmLabel}')) {document.location= '{$url}'};");
$objLink->link = $logoutLabel;
$link = $objLink->show();
$str .= '<li style="background-image: none;">' . $link . '</li>';
}
$str .= '</ul><br />';
return $str;
}
示例12: show
/**
* Method to generate the postlogin side menu
* @return string Generated menu
*/
public function show()
{
// Get menu items
$options = $this->objMenu->getSideMenus('elearnpostlogin');
$objUserPic = $this->getObject('imageupload', 'useradmin');
$header = new htmlHeading();
$header->type = 2;
$header->str = $this->objUser->fullName();
$str = '';
//$header->show();
$str .= '<p align="center"><img src="' . $objUserPic->userpicture($this->objUser->userId()) . '" alt="User Image" style="margin-bottom: 2px;" /></p>';
//$str .= '<br />';
// First add user pic
//$str = $this->sideMenu->userDetails();
$objBlock = $this->getObject('blocks', 'blocks');
$str .= $objBlock->showBlock('mycontexts', 'context', NULL, 20, TRUE, FALSE);
// If menu items exist
if (count($options) > 0) {
// Prepare items - will be sorted alphabetically
$menuItems = array();
// Loop through items
foreach ($options as $option) {
// Get proper name of module
$name = ucwords($this->objLanguage->code2Txt('mod_' . $option['module'] . '_name', $option['module']));
// Create link
$link = new link($this->uri(NULL, $option['module']));
$link->link = $name;
// add to array
$menuItems[$name] = $link->show();
}
// Sort alphabetically
ksort($menuItems);
// Generated proper menu
$str .= '<ul id="nav-secondary">';
foreach ($menuItems as $item => $link) {
$str .= '<li>' . $link . '</li>';
}
$str .= '</ul><br />';
}
return $str;
}
示例13: link
$table->startRow("sysconfig_configsite");
$this->loadClass('link', 'htmlelements');
$link = new link($this->uri(array('action' => 'step2', 'pmodule_id' => '_site_')));
$link->link = 'Configure site parameters';
$objIcon->setIcon('computer');
$table->addCell($objIcon->show());
$table->addCell($link->show(), NULL, NULL, NULL, NULL, 'colspan="3"');
$table->endRow();
//Loop and give the module configs
//$modules = array_reverse($modules);
$rClass = 'even';
foreach ($modules as $module) {
if ($module['pmodule'] != '_site_') {
$rClass = $rClass == 'odd' ? 'even' : 'odd';
$table->startRow();
$link = new link($this->uri(array('action' => 'step2', 'pmodule_id' => $module['pmodule'])));
$link->link = ucfirst($this->objLanguage->code2Txt('mod_' . $module['pmodule'] . '_name', $module['pmodule']));
$objIcon->setModuleIcon($module['pmodule']);
$table->addCell($objIcon->show(), NULL, 'top', NULL, $rClass);
$table->addCell($link->show(), NULL, 'top', NULL, $rClass);
$table->addCell(ucfirst($this->objLanguage->code2Txt('mod_' . $module['pmodule'] . '_desc', $module['pmodule'])), NULL, 'top', NULL, $rClass);
$table->addCell($module['paramcount'], '10%', 'top', NULL, $rClass);
$table->endRow();
}
}
//Set up the title
$this->loadClass('htmlheading', 'htmlelements');
$header = new htmlheading();
$header->type = 1;
$header->str = $this->objLanguage->languageText("help_sysconfig_about_title", 'sysconfig');
$ret = $header->show() . "<br />" . $table->show();
示例14: addNavigationRow
/**
* This method adds rows to the global table.
*
* @param string $moduleName: Name to be displayed
* @param string $iconPicture: Icon to be displayed
* @param string $moduleId: Module URI
* @param array $linkArray: Additional parameters for URI
* @param boolean $iconsFolder: If true, get image from icons folder, else get image from the icons/module folder
* @param boolean $popup: Create a link or a popup window
*/
public function addNavigationRow($moduleName, $iconPicture, $moduleId = null, $linkArray = null, $iconsFolder = false, $popup = false)
{
$this->loadClass('link', 'htmlelements');
$this->globalTable->startRow();
if ($iconsFolder) {
$this->icon->setIcon($iconPicture);
} else {
$this->icon->setModuleIcon($iconPicture);
}
$this->icon->alt = $moduleName;
$this->icon->title = $moduleName;
$this->globalTable->addCell($this->icon->show(), 20, 'absmiddle', 'center');
$moduleLink = new link($this->uri($linkArray, $moduleId));
$moduleLink->link = $moduleName;
$this->globalTable->addCell($moduleLink->show(), null, 'absmiddle');
$this->globalTable->endRow();
}
示例15: stdClass
$menu = $this->getObject('menu', 'toolbar');
$toolbar = $menu->show();
// Get any header params or body onload parameters for objects on the toolbar.
$menu->getParams($headerParams, $bodyOnLoad);
}
// Create a variable to hold the Footer depending on the login status.
if (isset($footerStr)) {
if (isset($this->footerNav)) {
$this->footerNav->str = $footerStr;
} else {
$this->footerNav = new stdClass();
$this->footerNav->str = $footerStr;
}
} elseif ($objUser->isLoggedIn()) {
$this->loadClass('link', 'htmlelements');
$link = new link($this->URI(array('action' => 'logoff'), 'security'));
$link->link = $objLanguage->languageText("word_logout");
$footerStr = $objLanguage->languageText("mod_context_loggedinas", 'context') . ' <strong>' . $objUser->fullname() . '</strong> (' . $link->show() . ')';
}
// Create an empty array for the header paramseters unless it is already set.
if (!isset($headerParams)) {
$headerParams = array();
}
// Create an empty array for the body onload paramseters unless it is already set.
if (!isset($bodyOnLoad)) {
$bodyOnLoad = array();
}
// Set the header style depending on whether we must suppress banner.
if (isset($pageSuppressBanner)) {
$headerStyle = "header_no_banner";
} else {