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


PHP k4_bread_crumbs函数代码示例

本文整理汇总了PHP中k4_bread_crumbs函数的典型用法代码示例。如果您正苦于以下问题:PHP k4_bread_crumbs函数的具体用法?PHP k4_bread_crumbs怎么用?PHP k4_bread_crumbs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: execute

 function execute(&$request)
 {
     global $_QUERYPARAMS;
     if (!isset($_REQUEST['id']) || !$_REQUEST['id'] || intval($_REQUEST['id']) == 0) {
         /* set the breadcrumbs bit */
         k4_bread_crumbs($request['template'], $request['dba'], 'L_INVALIDFORUM');
         $action = new K4InformationAction(new K4LanguageElement('L_FORUMDOESNTEXIST'), 'content', FALSE);
         return $action->execute($request);
     }
     /* Get the current forum/category */
     $forum = $request['dba']->getRow("SELECT * FROM " . K4FORUMS . " WHERE forum_id = " . intval($_REQUEST['id']));
     if (!$forum || !is_array($forum) || empty($forum)) {
         /* set the breadcrumbs bit */
         k4_bread_crumbs($request['template'], $request['dba'], 'L_INVALIDFORUM');
         $action = new K4InformationAction(new K4LanguageElement('L_FORUMDOESNTEXIST'), 'content', FALSE);
         return $action->execute($request);
     }
     if ($forum['is_link'] == 1) {
         if ($forum['is_forum'] == 1) {
             if ($forum['row_right'] - $forum['row_left'] > 0) {
                 header("Location: viewforum.php?id=" . intval($forum['forum_id']));
             }
         }
         if (!isset($forum['link_href']) || $forum['link_href'] == '') {
             k4_bread_crumbs($request['template'], $request['dba'], 'L_INFORMATION');
             $action = new K4InformationAction(new K4LanguageElement('L_INVALIDLINKFORUM'), 'content', FALSE);
             return $action->execute($request);
         }
         $request['dba']->executeUpdate("UPDATE " . K4FORUMS . " SET link_redirects=link_redirects+1 WHERE forum_id=" . intval($forum['forum_id']));
         header("Location: " . $forum['link_href']);
     } else {
         header("Location: viewforum.php?id=" . intval($forum['forum_id']));
     }
     return TRUE;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:35,代码来源:redirect.php

示例2: execute

 function execute(&$request)
 {
     if ($request['user']->isMember() && $request['user']->get('perms') >= SUPERADMIN) {
         //			// DEMO VERSION
         //			if(K4DEMOMODE) {
         //				no_perms_error($request, 'content');
         //				return TRUE;
         //			}
         global $_QUERYPARAMS;
         if (isset($_REQUEST['settinggroupid']) && intval($_REQUEST['settinggroupid']) > 0) {
             $settings = $request['dba']->executeQuery("SELECT * FROM " . K4SETTINGS . " WHERE settinggroupid = " . intval($_REQUEST['settinggroupid']));
             while ($settings->next()) {
                 $setting = $settings->current();
                 $new_val = ctype_digit($_REQUEST[$setting['varname']]) && $_REQUEST[$setting['varname']] != '' ? intval($_REQUEST[$setting['varname']]) : $request['dba']->quote($_REQUEST[$setting['varname']]);
                 $request['dba']->executeUpdate("UPDATE " . K4SETTINGS . " SET value = '{$new_val}' WHERE varname = '" . $request['dba']->quote($setting['varname']) . "'");
             }
         }
         k4_bread_crumbs($request['template'], $request['dba'], 'L_OPTIONS');
         reset_cache('settings');
         $request['template']->setVar('options_on', '_on');
         $request['template']->setFile('sidebar_menu', 'menus/options.html');
         $action = new K4InformationAction(new K4LanguageElement('L_UPDATEDOPTIONS'), 'content', FALSE, 'admin.php?act=options', 3);
         return $action->execute($request);
     } else {
         no_perms_error($request, 'content');
     }
     return TRUE;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:28,代码来源:options.class.php

示例3: execute

 function execute(&$request)
 {
     if ($request['user']->isMember() && $request['user']->get('perms') >= SUPERADMIN) {
         $cache = $request['dba']->executeQuery("SELECT * FROM " . K4CACHE . " ORDER BY varname ASC");
         $cache_items = array();
         $total_size = 0;
         while ($cache->next()) {
             $temp = $cache->current();
             $temp['name'] = ucwords(implode(' ', explode('_', $temp['varname'])));
             if (CACHE_IN_DB) {
                 $size = strlen($temp['data']);
             } else {
                 $file = CACHE_DIR . $temp['varname'] . '.php';
                 if (file_exists($file)) {
                     $size = filesize($file);
                     $temp['modified'] = filemtime($file);
                 }
             }
             $total_size += $size;
             $temp['size'] = number_format($size);
             $cache_items[] = $temp;
         }
         $request['template']->setVar('total_cache_size', $total_size);
         $request['template']->setVar('total_cache_size_mb', round($total_size / 1048576, 4));
         k4_bread_crumbs($request['template'], $request['dba'], 'L_CACHECONTROL');
         $request['template']->setVar('options_on', '_on');
         $request['template']->setFile('sidebar_menu', 'menus/options.html');
         $request['template']->setList('cache_items', new FAArrayIterator($cache_items));
         $request['template']->setFile('content', 'cache.html');
     } else {
         no_perms_error($request);
     }
     return TRUE;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:34,代码来源:cache.class.php

示例4: execute

 function execute(&$request)
 {
     if ($request['user']->isMember() && $request['user']->get('perms') >= ADMIN) {
         k4_bread_crumbs($request['template'], $request['dba'], 'L_WELCOME');
         $request['template']->setVar('adv_view', 1);
         $request['template']->setFile('content', 'admin_menu.html');
     } else {
         no_perms_error($request);
         return TRUE;
     }
     return TRUE;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:12,代码来源:admin.php

示例5: execute

 function execute(&$request)
 {
     if ($request['user']->isMember() && $request['user']->get('perms') >= SUPERADMIN) {
         global $_QUERYPARAMS, $_ALLFORUMS;
         k4_bread_crumbs($request['template'], $request['dba'], 'L_POSTS');
         $request['template']->setVar('posts_on', '_on');
         $request['template']->setFile('sidebar_menu', 'menus/posts.html');
     } else {
         no_perms_error($request);
     }
     return TRUE;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:12,代码来源:posts.class.php

示例6: execute

 function execute(&$request)
 {
     global $_QUERYPARAMS, $_USERGROUPS;
     k4_bread_crumbs($request['template'], $request['dba'], 'L_CALENDAR');
     # get the year month and day from request vars
     $year = isset($_REQUEST['y']) && intval($_REQUEST['y']) > 0 ? $_REQUEST['y'] : date('Y', time());
     $month = isset($_REQUEST['m']) && intval($_REQUEST['m']) > 0 ? $_REQUEST['m'] : date('n', time());
     $day = isset($_REQUEST['d']) && intval($_REQUEST['d']) > 0 ? $_REQUEST['j'] : 1;
     # new k4Calendar instance
     $c =& new K4Calendar($year, $month, $day);
     # The next and previous months, do this all first.
     $year = $month == 1 ? $year - 1 : $year;
     $html = $this->mini_month($c->getPrevMonth(), $year, $request);
     $request['template']->setVar('prev_month_cal', $html);
     $year = $month == 12 ? $year + 1 : $year;
     $html = $this->mini_month($c->getNextMonth(), $year, $request);
     $request['template']->setVar('next_month_cal', $html);
     # Get user birthdays
     $birthdays = $request['dba']->executeQuery("SELECT {$_QUERYPARAMS['user']}{$_QUERYPARAMS['userinfo']} FROM " . K4USERS . " u LEFT JOIN " . K4USERINFO . " ui ON u.id=ui.user_id WHERE ui.birthday LIKE '" . str_pad($month, 2, '0', STR_PAD_LEFT) . "/%'");
     $bdays = array();
     if ($birthdays->hasNext()) {
         while ($birthdays->next()) {
             $user = $birthdays->current();
             $parts = explode("/", $user['birthday']);
             $group = get_user_max_group($user, $_USERGROUPS);
             $user['group_color'] = !isset($group['color']) || $group['color'] == '' ? '000000' : $group['color'];
             $user['age'] = $year - intval($parts[2]);
             $user['U_MEMBERURL'] = K4Url::getMemberUrl($user['id']);
             $bdays[$parts[1]][] = $user;
         }
     }
     # Add the iterator to the template
     $c->month = $month;
     $c->year = $year;
     $iteration_c = new K4CalendarIterator($c->getData(), $c->getWeek($month, $day, $year), $bdays);
     $iteration_d = new FAArrayIterator($c->getWeekdays());
     //print_r($c->getWeekRange($month, $day, $year)); exit;
     $request['template']->setList('calendar', $iteration_c);
     $request['template']->setList('weekdays', $iteration_d);
     # url's, need fixing
     $request['template']->setVarArray(array('U_CALENDARPREVYEARURL' => K4Url::getGenUrl('calendar', 'y=' . $c->getPrevYear() . '&m=' . $c->getMonth()), 'U_CALENDARNEXTYEARURL' => K4Url::getGenUrl('calendar', 'y=' . $c->getNextYear() . '&m=' . $c->getMonth()), 'U_CALENDARPREVMONTHURL' => K4Url::getGenUrl('calendar', 'y=' . $c->getYear() . '&m=' . $c->getPrevMonth()), 'U_CALENDARNEXTMONTHURL' => K4Url::getGenUrl('calendar', 'y=' . $c->getYear() . '&m=' . $c->getNextMonth())));
     # The rest
     $request['template']->setVar('month_label', date('F', mktime(0, 0, 0, $c->getMonth(), 1, $c->getYear())));
     $request['template']->setVar('year_label', $c->getYear());
     $request['template']->setVar('month_next', $c->getNextMonth());
     $request['template']->setVar('month_prev', $c->getPrevMonth());
     $request['template']->setVar('year_next', $c->getNextYear());
     $request['template']->setVar('year_prev', $c->getPrevYear());
     $request['template']->setVar('nav_prev', $c->checkPrevYear());
     $request['template']->setVar('nav_next', $c->checkNextYear());
     $request['template']->setFile('content', 'calendar_index.html');
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:52,代码来源:calendar.php

示例7: execute

 function execute(&$request)
 {
     global $_QUERYPARAMS;
     /* set the breadcrumbs bit */
     k4_bread_crumbs($request['template'], $request['dba'], 'L_INFORMATION');
     if (!isset($_REQUEST['id']) || intval($_REQUEST['id']) == 0) {
         $action = new K4InformationAction(new K4LanguageElement('L_BAD' . strtoupper($this->table_column)), 'content', FALSE);
         return $action->execute($request);
     }
     $avatar = $request['dba']->getRow("SELECT * FROM " . $this->table . " WHERE user_id = " . intval($_REQUEST['id']));
     if (!is_array($avatar) || empty($avatar)) {
         $action = new K4InformationAction(new K4LanguageElement('L_BAD' . strtoupper($this->table_column)), 'content', FALSE);
         return $action->execute($request);
     }
     $user = $request['dba']->getRow("SELECT {$_QUERYPARAMS['user']}{$_QUERYPARAMS['userinfo']}{$_QUERYPARAMS['usersettings']} FROM ((" . K4USERS . " u LEFT JOIN " . K4USERINFO . " ui ON u.id=ui.user_id) LEFT JOIN " . K4USERSETTINGS . " us ON us.user_id=u.id) WHERE u.id=" . intval($_REQUEST['id']));
     if (!is_array($user) || empty($user)) {
         $action = new K4InformationAction(new K4LanguageElement('L_USERDOESNTEXIST'), 'content', TRUE);
         return $action->execute($request);
     }
     /* Do we have permission to view attachments in this forum? */
     if (isset($user['attach' . $this->table_column]) && $user['attach' . $this->table_column] == 0) {
         no_perms_error($request);
         return TRUE;
     }
     // send our headers
     header("Content-Type: " . $avatar['mime_type']);
     header("Content-Length: " . $avatar['file_size']);
     $avatar_file = BB_BASE_DIR . '/tmp/upload/' . $this->table_column . 's/' . intval($user['id']) . '.' . $avatar['file_type'];
     if ($avatar['in_db'] == 1) {
         $contents = $avatar['file_contents'];
     } else {
         if (file_exists($avatar_file)) {
             $contents = file_get_contents($avatar_file);
         } else {
             $action = new K4InformationAction(new K4LanguageElement('L_BAD' . strtoupper($this->table_column)), 'content', FALSE);
             return $action->execute($request);
         }
     }
     echo $contents;
     unset($contents);
     exit;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:42,代码来源:viewfile.php

示例8: execute

 function execute(&$request)
 {
     /* set the breadcrumbs bit */
     k4_bread_crumbs($request['template'], $request['dba'], 'L_INFORMATION');
     if (!isset($_REQUEST['forum']) || !isset($_REQUEST['topic'])) {
         $action = new K4InformationAction(new K4LanguageElement('L_TOPICDOESNTEXIST'), 'content', FALSE);
         return $action->execute($request);
     }
     $forum_id = intval($_REQUEST['forum']);
     $topic_id = intval($_REQUEST['topic']);
     $page = isset($_REQUEST['page']) ? intval($_REQUEST['page']) : 1;
     $file = BB_BASE_DIR . '/archive/' . $forum_id . '/' . $topic_id . '-' . $page . '.xml';
     if (!file_exists($file)) {
         $action = new K4InformationAction(new K4LanguageElement('L_TOPICDOESNTEXIST'), 'content', FALSE);
         return $action->execute($request);
     }
     $parser = new RSS_Parser();
     $feed = $parser->Parse($file);
     $channel = $feed->channel;
     $posts = $feed->items;
     k4_bread_crumbs($request['template'], $request['dba'], $channel->title);
     $request['template']->setVar('post_name', $channel->title);
     $request['template']->setVar('post_link', $channel->link);
     $request['template']->setVar('post_body_text', $channel->description);
     $request['template']->setVar('post_forum', $channel->subject);
     $request['template']->setVar('post_post_id', $channel->post_id);
     $request['template']->setVar('post_poster_name', $channel->author_name);
     $request['template']->setVar('post_poster_id', $channel->author_id);
     $request['template']->setVar('post_page', $channel->page);
     if ($channel->num_pages > 1) {
         $separator = '';
         $html = '';
         for ($i = 1; $i <= $channel->num_pages; $i++) {
             $html .= $separator . '<a href="archive.php?forum=' . $forum_id . '&topic=' . $topic_id . '&page=' . $i . '" title="" ' . ($i == $channel->page ? 'style="font-weight:bold;"' : '') . '>' . $i . '</a>';
             $separator = ', ';
         }
         $request['template']->setVar('archive_pager', $html);
         $request['template']->setList('posts', new XMLArchivedPostsIterator($posts));
     }
     $request['template']->setFile('content', 'viewtopic_lofi.html');
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:41,代码来源:archive.php

示例9: execute

 function execute(&$request)
 {
     $row_level = 1;
     $category_id = 0;
     $category = FALSE;
     $faq = FALSE;
     if (isset($_REQUEST['c']) && intval($_REQUEST['c']) > 0) {
         $category = $request['dba']->getRow("SELECT * FROM " . K4FAQCATEGORIES . " WHERE category_id = " . intval($_REQUEST['c']));
         if (is_array($category) && !empty($category)) {
             $row_level = intval($category['row_level']) + 1;
             $category_id = intval($category['category_id']);
             $request['template']->setVar('add_extra', '&c=' . $category_id);
             $request['template']->setVar('add_catname', ': ' . $category['name']);
         }
     }
     k4_bread_crumbs($request['template'], $request['dba'], !$category ? 'L_FAQLONG' : NULL, $category);
     $request['template']->setFile('content', 'faq.html');
     $result = $request['dba']->executeQuery("SELECT * FROM " . K4FAQCATEGORIES . " WHERE row_level={$row_level} AND parent_id={$category_id} AND can_view <= " . intval($request['user']->get('perms')) . " ORDER BY row_order ASC");
     $it =& new K4FAQIterator($result, $request['dba']);
     $top_level = $request['dba']->executeQuery("SELECT * FROM " . K4FAQANSWERS . " WHERE category_id = {$category_id} AND can_view <= " . intval($request['user']->get('perms')) . " ORDER BY row_order ASC");
     $request['template']->setVar('has_top_level', $top_level->hasNext() ? 1 : 0);
     $request['template']->setList('faq_categories', $it);
     $request['template']->setList('faq_answers', $top_level);
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:24,代码来源:faq.php

示例10: execute

 function execute(&$request)
 {
     if ($request['user']->isMember() && $request['user']->get('perms') >= SUPERADMIN) {
         global $_DATASTORE;
         k4_bread_crumbs($request['template'], $request['dba'], 'L_EMAILUSERS');
         $request['template']->setVar('misc_on', '_on');
         $request['template']->setFile('sidebar_menu', 'menus/misc.html');
         if (isset($_DATASTORE['massmail'])) {
             $action = new K4InformationAction(new K4LanguageElement('L_EMAILINPROGRESS'), 'content', FALSE);
             return $action->execute($request);
         }
         if (!isset($_REQUEST['subject']) || $_REQUEST['subject'] == '') {
             $action = new K4InformationAction(new K4LanguageElement('L_INSERTMAILSUBJECT'), 'content', TRUE);
             return $action->execute($request);
         }
         if (!isset($_REQUEST['message']) || $_REQUEST['message'] == '') {
             $action = new K4InformationAction(new K4LanguageElement('L_INSERTMAILMESSAGE'), 'content', TRUE);
             return $action->execute($request);
         }
         $from = isset($_REQUEST['from']) && $_REQUEST['from'] != '' ? $_REQUEST['from'] : 'noreply';
         $subject = $_REQUEST['subject'];
         $message = preg_replace("~(\r\n|\r|\n)~i", "\n", $_REQUEST['message']);
         // set where to start the userids to email in the datastore
         $update = $request['dba']->prepareStatement("INSERT INTO " . K4DATASTORE . " (varname, data) VALUES (?,?)");
         $update->setString(1, 'massmail');
         $update->setString(2, serialize(array('startid' => 0, 'from' => $from, 'subject' => $subject, 'message' => $message)));
         $update->executeUpdate();
         reset_cache('email_queue');
         // success
         $action = new K4InformationAction(new K4LanguageElement('L_EMAILSSENTTOUSERS'), 'content', FALSE);
         return $action->execute($request);
     } else {
         no_perms_error($request);
     }
     return TRUE;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:36,代码来源:email.class.php

示例11: execute

 function execute(&$request)
 {
     global $_QUERYPARAMS, $_DATASTORE, $_SETTINGS;
     /* set the breadcrumbs bit */
     k4_bread_crumbs($request['template'], $request['dba'], 'L_INFORMATION');
     /* Check the request ID */
     if (!isset($_REQUEST['id']) || !$_REQUEST['id'] || intval($_REQUEST['id']) == 0) {
         $action = new K4InformationAction(new K4LanguageElement('L_TOPICDOESNTEXIST'), 'content', FALSE);
         return !USE_XMLHTTP ? $action->execute($request) : xmlhttp_message('L_TOPICDOESNTEXIST');
     }
     /* Get our topic */
     $topic = $request['dba']->getRow("SELECT * FROM " . K4POSTS . " WHERE post_id = " . intval($_REQUEST['id']));
     if (!$topic || !is_array($topic) || empty($topic)) {
         $action = new K4InformationAction(new K4LanguageElement('L_TOPICDOESNTEXIST'), 'content', FALSE);
         return !USE_XMLHTTP ? $action->execute($request) : xmlhttp_message('L_TOPICDOESNTEXIST');
     }
     $forum = $request['dba']->getRow("SELECT * FROM " . K4FORUMS . " WHERE forum_id = " . intval($topic['forum_id']));
     if (!$forum || !is_array($forum) || empty($forum)) {
         $action = new K4InformationAction(new K4LanguageElement('L_FORUMDOESNTEXIST'), 'content', FALSE);
         return !USE_XMLHTTP ? $action->execute($request) : xmlhttp_message('L_FORUMDOESNTEXIST');
     }
     if (!isset($_REQUEST['name']) || $_REQUEST['name'] == '') {
         $name = $topic['name'];
     } else {
         $name = strip_tags($_REQUEST['name']);
     }
     $name = $name == '' ? $topic['name'] : $name;
     if (strlen($name) < intval($_SETTINGS['topicminchars']) || strlen($name) > intval($_SETTINGS['topicmaxchars'])) {
         $action = new K4InformationAction(new K4LanguageElement('L_TITLETOOSHORT', intval($_SETTINGS['topicminchars']), intval($_SETTINGS['topicmaxchars'])), 'content', TRUE);
         return !USE_XMLHTTP ? $action->execute($request) : xmlhttp_message(sprintf('L_TITLETOOSHORT', intval($_SETTINGS['topicminchars']), intval($_SETTINGS['topicmaxchars'])));
     }
     if ($name != $topic['name']) {
         $name = k4_htmlentities($name, ENT_QUOTES);
         if (!is_moderator($request['user']->getInfoArray(), $forum)) {
             no_perms_error($request);
             return !USE_XMLHTTP ? TRUE : xmlhttp_message('L_NEEDPERMS');
         }
         if ($topic['poster_id'] == $request['user']->get('id')) {
             if ($request['user']->get('perms') < get_map('topics', 'can_edit', array('forum_id' => $topic['forum_id']))) {
                 no_perms_error($request);
                 return !USE_XMLHTTP ? TRUE : xmlhttp_message('L_NEEDPERMS');
             }
         } else {
             if ($request['user']->get('perms') < get_map('other_topics', 'can_edit', array('forum_id' => $topic['forum_id']))) {
                 no_perms_error($request);
                 return !USE_XMLHTTP ? TRUE : xmlhttp_message('L_NEEDPERMS');
             }
         }
         /* If this topic is a redirect/ connects to one, update the original */
         if ($topic['moved_new_post_id'] > 0 || $topic['moved_old_post_id'] > 0) {
             $redirect = $request['dba']->prepareStatement("UPDATE " . K4POSTS . " SET name=?,edited_time=?,edited_username=?,edited_userid=? WHERE post_id=?");
             $redirect->setString(1, $name);
             $redirect->setInt(2, time());
             $redirect->setString(3, $request['user']->get('name'));
             $redirect->setInt(4, $request['user']->get('id'));
             $redirect->setInt(5, $topic['moved_new_post_id'] > 0 ? $topic['moved_new_post_id'] : $topic['moved_old_post_id']);
             $redirect->executeUpdate();
         }
         $update_a = $request['dba']->prepareStatement("UPDATE " . K4POSTS . " SET name=?,edited_time=?,edited_username=?,edited_userid=? WHERE post_id=?");
         $update_a->setString(1, $name);
         $update_a->setInt(2, time());
         $update_a->setString(3, $request['user']->get('name'));
         $update_a->setInt(4, $request['user']->get('id'));
         $update_a->setInt(5, $topic['post_id']);
         $update_a->executeUpdate();
         if ($forum['post_id'] == $topic['post_id']) {
             $update_c = $request['dba']->prepareStatement("UPDATE " . K4FORUMS . " SET post_name=? WHERE forum_id=?");
             $update_c->setString(1, $name);
             $update_c->setInt(2, $forum['forum_id']);
             $update_c->executeUpdate();
         }
         // id this is the last post in a forum
         if ($forum['post_id'] == $topic['post_id'] && $forum['post_created'] == $topic['created']) {
             $update_d = $request['dba']->prepareStatement("UPDATE " . K4FORUMS . " SET post_name=? WHERE forum_id=?");
             $update_d->setString(1, $name);
             $update_d->setInt(2, $forum['forum_id']);
             $update_d->executeUpdate();
         }
     }
     if (!USE_XMLHTTP) {
         k4_bread_crumbs($request['template'], $request['dba'], 'L_EDITTOPIC', $forum);
         $action = new K4InformationAction(new K4LanguageElement('L_UPDATEDTOPIC', $topic['name']), 'content', FALSE, referer(), 3);
         return $action->execute($request);
     } else {
         xmlhttp_header();
         echo '<a href="viewtopic.php?id=' . $topic['post_id'] . '" title="' . $name . '" style="font-size: 13px;">' . (strlen($name) > 40 ? substr($name, 0, 40) . '...' : $name) . '</a>';
         xmlhttp_footer();
     }
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:89,代码来源:moderator.class.php

示例12: execute

 function execute(&$action, &$request)
 {
     $events = array('css_removestyle', 'css_revertstyle', 'css_editstyle', 'css_updatestyle', 'css_addstyle', 'css_insertstyle', 'css_updateallclasses', 'css_editor');
     if (in_array($request['event'], $events)) {
         if ($request['user']->isMember() && $request['user']->get('perms') >= SUPERADMIN) {
             k4_bread_crumbs($request['template'], $request['dba'], 'L_MANAGECSSSTYLES');
             $request['template']->setVar('styles_on', '_on');
             $request['template']->setFile('sidebar_menu', 'menus/styles.html');
             if (!isset($_REQUEST['id']) || intval($_REQUEST['id']) == 0) {
                 //$action = new K4InformationAction(new K4LanguageElement('L_BADSTYLESET'), 'content', FALSE);
                 //return TRUE;
                 $id = $request['dba']->getValue("SELECT id FROM " . K4STYLES . " WHERE name='" . $request['user']->get('styleset') . "'");
             } else {
                 $id = $_REQUEST['id'];
             }
             $styleset = $request['dba']->getRow("SELECT * FROM " . K4STYLES . " WHERE id=" . intval($id));
             if (!is_array($styleset) || empty($styleset)) {
                 $action = new K4InformationAction(new K4LanguageElement('L_BADSTYLESET'), 'content', FALSE);
                 return TRUE;
             }
             if ($request['event'] != 'css_insertstyle' && $request['event'] != 'css_addstyle' && $request['event'] != 'css_updateallclasses') {
                 if ((!isset($_REQUEST['style_id']) || intval($_REQUEST['style_id']) == 0) && (!isset($_REQUEST['class']) || $_REQUEST['class'] == '')) {
                     $action = new K4InformationAction(new K4LanguageElement('L_CSSCLASSDOESNTEXIST'), 'content', FALSE);
                     return TRUE;
                 }
                 if (isset($_REQUEST['class'])) {
                     $class_query = " name = '." . $request['dba']->quote($_REQUEST['class']) . "'";
                 } else {
                     $class_query = " id = " . intval($_REQUEST['style_id']);
                 }
                 $style = $request['dba']->getRow("SELECT * FROM " . K4CSS . " WHERE {$class_query} AND style_id = " . intval($styleset['id']));
                 if (isset($_REQUEST['editor'])) {
                     $request['classes'] = $request['dba']->executeQuery("SELECT * FROM " . K4CSS . " WHERE name LIKE '%" . $request['dba']->quote($_REQUEST['class']) . "%'");
                 } else {
                     if (!is_array($style) || empty($style)) {
                         $action = new K4InformationAction(new K4LanguageElement('L_CSSCLASSDOESNTEXIST'), 'content', FALSE);
                         return TRUE;
                     }
                 }
             }
             $request['styleset'] = isset($styleset) ? $styleset : array();
             $request['style'] = isset($style) ? $style : array();
         } else {
             no_perms_error($request);
             return TRUE;
         }
     }
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:48,代码来源:css.class.php

示例13: execute

 function execute(&$request)
 {
     if ($request['user']->isMember() && $request['user']->get('perms') >= SUPERADMIN) {
         /* Error check */
         if (!isset($_REQUEST['id']) || intval($_REQUEST['id']) == 0) {
             $action = new K4InformationAction(new K4LanguageElement('L_INVALIDMAPID'), 'content', FALSE);
             return $action->execute($request);
         }
         $map = $request['dba']->getRow("SELECT * FROM " . K4MAPS . " WHERE id = " . intval($_REQUEST['id']));
         /* Error check */
         if (!is_array($map) || empty($map)) {
             $action = new K4InformationAction(new K4LanguageElement('L_INVALIDMAPID'), 'content', FALSE);
             return $action->execute($request);
         }
         /* Update this map's parent */
         if ($map['parent_id'] > 0) {
             $num_children = intval($map['num_children']) + 1;
             $request['dba']->executeUpdate("UPDATE " . K4MAPS . " SET num_children=num_children-" . $num_children . " WHERE id = " . intval($map['parent_id']));
         }
         /* Remove this mapp node */
         $request['dba']->executeUpdate("DELETE FROM " . K4MAPS . " WHERE id = " . intval($map['id']));
         /* Recursively remove all of its children */
         if ($map['num_children'] > 0) {
             $this->recursive_remove($map['id']);
         }
         reset_cache('maps');
         k4_bread_crumbs($request['template'], $request['dba'], 'L_PERMISSIONS');
         $request['template']->setVar('options_on', '_on');
         $request['template']->setFile('sidebar_menu', 'menus/options.html');
         /* Redirect the user */
         $action = new K4InformationAction(new K4LanguageElement('L_REMOVEDMAPSITEM'), 'content', FALSE, 'admin.php?act=permissions_gui', 3);
         return $action->execute($request);
     } else {
         no_perms_error($request);
     }
     return TRUE;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:37,代码来源:maps.class.php

示例14: execute

 function execute(&$request)
 {
     k4_bread_crumbs($request['template'], $request['dba'], 'L_NEWPOSTS');
     $topics = $request['dba']->executeQuery("SELECT * FROM " . K4POSTS . " WHERE queue=0 AND is_draft=0 AND display=1 ORDER BY created DESC LIMIT 15");
     $request['template']->setList('posts', $topics);
     $rss_version = isset($_REQUEST['v']) && intval($_REQUEST['v']) == 2 ? '2.0' : '0.92';
     $xml = $request['template']->render(BB_BASE_DIR . '/templates/RSS/rss-' . $rss_version . '/new_posts.xml');
     header("Content-Type: text/xml");
     echo $xml;
     exit;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:11,代码来源:rss.php

示例15: execute

 function execute(&$request)
 {
     if ($request['user']->isMember() && $request['user']->get('perms') >= ADMIN) {
         k4_bread_crumbs($request['template'], $request['dba'], 'L_USERTITLES');
         $request['template']->setVar('users_on', '_on');
         $request['template']->setFile('sidebar_menu', 'menus/users.html');
         if (!isset($_REQUEST['user_id']) || intval($_REQUEST['user_id']) == 0) {
             $action = new K4InformationAction(new K4LanguageElement('L_USERDOESNTEXIST'), 'content', TRUE);
             return $action->execute($request);
         }
         $user = $request['dba']->getRow("SELECT * FROM " . K4USERS . " WHERE id = " . intval($_REQUEST['user_id']));
         if (!is_array($user) || empty($user)) {
             $action = new K4InformationAction(new K4LanguageElement('L_USERDOESNTEXIST'), 'content', TRUE);
             return $action->execute($request);
         }
         $title = isset($_REQUEST['user_title']) ? $_REQUEST['user_title'] : '';
         $request['dba']->executeUpdate("UPDATE " . K4USERINFO . " SET user_title = '" . $request['dba']->quote($title) . "' WHERE user_id = " . intval($_REQUEST['user_id']));
         $action = new K4InformationAction(new K4LanguageElement('L_UPDATEDUSERTITLE', $user['name']), 'content', TRUE, 'admin.php?act=usertitles', 3);
         return $action->execute($request);
     } else {
         no_perms_error($request);
     }
     return TRUE;
 }
开发者ID:BackupTheBerlios,项目名称:k4bb-svn,代码行数:24,代码来源:titles.class.php


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