Search Results for 'code'
-
AuthorSearch Results
-
November 24, 2007 at 8:11 am #61037
In reply to: How to Write BBPress Plugins.
vafaaaan
MemberWhat does these?
add_profile_tab(__('Name on tab'), 'whats this?', 'And this?', 'file.php');
.
if i call it once in my plugin it will remain until i deactivate it ?
.
Add settings?
bb_update_option('my_options', $options);
.
Delete settings?
bb_delete_option('my_options');
.
Show notice on admin page?
bb_admin_notice(__('Settings Saved'));
November 23, 2007 at 11:00 am #61646In reply to: How to: ddlb of user roles
Null
Member… sorry for asking for help…. thought forums where here for that…
I can’t program, never said I did, I build things with trial and error, learning that way. Reading and trying to understand how and why things works. So if I get just a piece of code I’ll try that and try other suggestions too. I am more a reverse engineer. The site and things I’ve builded can be done in 2 hours if you are a phpprogrammer, I do it in two weeks or more, but I get it done (don’t give up) and am proud if I acomplisch what I wanted.
Assuming someone can program cause his plugin is awesome wont work everytime
. Most things I can figure out myself, but if some small stupid thing like a ddlb takes too much time I am gonna ask the forums (duh). Kinda get the feeling now that, if you can’t program, you shouldn’t do it or ask for help…
Like the post above from Chris, you’ve managed to make it work and you are assuming I can figure this out too cause it was apparently easy for you to figure out. But I don’t think like a programmer, it’s hard for an person like me to figure it all out. I don’t know where all code is pulled from or is placed. I use bbpulp a lot to find the needed code, but that isn’t always enough.
I’m glad Chris found an answer, but then I ask: how did you do it? Can you show me the code and explain some of it so I can learn from it…
Better look like it like this, I can build a car, but I don’t know how to construct it. I know I need an engine, but I don’t know how the engine works. I know what it does, I know I need it… and so I puzzel the car together. A mechanic will do it in 1 week, I’ll do it in 1 year…
I am weird, I know
Well I just wanted to get this of my chest and also mention I aint attacking anyone (especially Chris, just jused your post as an excample)
So no hard feelings (from me anyway) and thanks for your time
_Null
November 23, 2007 at 3:54 am #61644In reply to: How to: ddlb of user roles
livibetter
MemberHaven’t you noticed this line from bbPress source (L1296 in template-functions.php)?
$roles = $bb_roles->role_names;
I think chrishajer and me thought you knew how to program with PHP (by checking your website). Yes, chrishajer gave you a piece of code that is a hint not a just-can-work code at everywhere. I thought you can code with PHP, and you should be able to put the rest on your own code. However, I was wrong or you think someone else has taken care of the rest for you?
you also need to do
global $bb_roles;
, in case you really can not code with PHP.(edit: Sorry for this emotional post to everyone else)
November 23, 2007 at 3:36 am #57097In reply to: Code backtick bug
Arlo
MemberFel -yup, that was apparently the problem
Livi- and that plugin works without borking code. Thanks!
November 22, 2007 at 10:37 pm #61650In reply to: Suggestions and misc
vafaaaan
MemberIm getting these lines in the middle of the admin page: wp-admin/post-new.php
Error:
Warning: Missing argument 2 for bb_bozo_pre_post_status() inxxxxxbb-includesbozo.php on line 173
Warning: Missing argument 3 for bb_bozo_pre_post_status() inxxxxxbb-includesbozo.php on line 173
then.. i get when i post..
Warning: Missing argument 2 for bb_bozo_pre_post_status() in
xxxxxbb-includesbozo.php on line 173
Warning: Missing argument 3 for bb_bozo_pre_post_status() inxxxxxbb-includesbozo.php on line 173
Warning: Cannot modify header information - headers already sent by (output started atxxxxxbb-includesbozo.php:173) in
xxxxxwp-includespluggable.php on line 391
November 22, 2007 at 9:20 pm #61643In reply to: How to: ddlb of user roles
Null
MemberOkay chris, now try this:
Make a clean php file.
Now add that code you mentioned
Make the php page a plugin and activate it.
Now go to your admin -> pluginpage and you’ll see an empty ddlb too
It works in your PNG image example, cause you just copied the code in the same page. It will always work that way, but not in a clean file…
_Null
November 22, 2007 at 9:13 pm #53524In reply to: Fight Against Auto-Register Robot
Null
MemberTried this, it aint working
November 22, 2007 at 8:58 am #61640In reply to: How to: ddlb of user roles
livibetter
Member@Null: of course, you get all roles’ data. I meant you can get each role’s name from the returning result of
$bb_roles->get_roles()
(I thought you was going to do something special). However chrishajer has told you the useful information for all your need, you just need to read from https://trac.bbpress.org/browser/trunk/bb-includes/template-functions.php#L1296 to 1311. If you really want to do something with bbPress, you have to read the source of bbPress.November 22, 2007 at 8:42 am #61639In reply to: How to: ddlb of user roles
Null
MemberHi guys,
Sorry ddlb = drop down listbox
@ chris: yes i did try that one already, but it gave me a empty ddlb (proberbly because the user’s role couldn’t be defined) .
@livibetter: din’t try it but that will give (I think) all roles, but not in a ddlb.
For forums there is a function: bb_forum_dropdown, but I couldn’t adapt it to get user roles, so I think a whole new function must be written to put it in the plugin I am working on. I have the feeling all the pieces are there, but I have no idea how to put them together
Thx,
Null
November 22, 2007 at 8:03 am #61649In reply to: Suggestions and misc
vafaaaan
MemberNow .. ive managed to make WP and bbp share same theme. Dont know if its god but it works.. im running right now.
wp-content/theme/header.php
<?php
include(ROOT . '/theme/header-start.php');
?>
<title><?php bloginfo('name'); ?> - <?php if ( is_single() ) { ?> » Archive <?php } ?> <?php wp_title(); ?></title>
<?php
wp_head();
include(ROOT . '/theme/header-end.php');
?>
<body>
<?php
wp_head();
include(ROOT. '/theme/body-start.php');
?>my-themes/theme/header.php
<?php
include(ROOT . '/theme/header-start.php');
?>
<title>MyWebsite - <?php bb_title() ?></title>
<?php
bb_feed_head();
if ( is_topic() && bb_is_user_logged_in() ) : ?>
<script type="text/javascript">
var lastMod = <?php topic_time( 'timestamp' ); ?>;
var page = <?php global $page; echo $page; ?>;
var currentUserId = <?php bb_current_user_info( 'id' ); ?>;
var topicId = <?php topic_id(); ?>;
var uriBase = '<?php bb_option('uri'); ?>';
var tagLinkBase = '<?php bb_tag_link_base(); ?>';
var favoritesLink = '<?php favorites_link(); ?>';
var isFav = <?php if ( false === $is_fav = is_user_favorite( bb_get_current_user_info( 'id' ) ) ) echo "'no'"; else echo $is_fav; ?>;
</script>
<?php
bb_enqueue_script('topic');
endif;
bb_head();
include(ROOT. '/theme/header-end.php');
?>
<body id="<?php bb_location(); ?>">
<?php
include(ROOT . '/theme/body-start.php');
if ( is_bb_profile() ) profile_menu();
?>my-themes/theme/footer.php
<?php
do_action('bb_foot', '');
include(ROOT . '/theme/body-end.php');
?>wp-content/theme/footer.php
<?php
include(ROOT . '/theme/body-end.php');
?>theme/header-start.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head profile="http://gmpg.org/xfn/11">theme/header-end.php
<link rel="stylesheet" href="<?php echo URL; ?>/theme/default.css" type="text/css" title="Default style" media="screen" />
<link rel="alternate" href="<?php echo URL; ?>/?feed=rss2" type="application/rss+xml" title="RSS Feed" />
<link rel="pingback" href="<?php echo URL; ?>/xmlrpc.php" />
<link rel="EditURI" href="<?php echo URL; ?>/xmlrpc.php?rsd" type="application/rsd+xml" title="RSD" />
<link rel="wlwmanifest" href="<?php echo URL; ?>/wp-includes/wlwmanifest.xml" type="application/wlwmanifest+xml" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="generator" content="WordPress 2.3.1" />
</head>theme/body-start.php
<div id="wrapper">
<?php
get_sidebar();
// Etc...
?>theme/body-end.php
<?php
// Etc...
wp_footer();
?>
</div>
</body>
</html>Hope its all there..
URL and ROOT is defined in wp-config.php
Edit: you can of course cut BODY to include different sidebar wp / bbp
November 22, 2007 at 3:52 am #61638In reply to: How to: ddlb of user roles
livibetter
MemberTry to use
$bb_roles->get_roles()
( https://trac.bbpress.org/browser/trunk/bb-includes/capabilities.php#L25 )November 22, 2007 at 3:43 am #61637In reply to: How to: ddlb of user roles
chrishajer
ParticipantI don’t believe the roles are stored in the database, I think they’re all stored and defined in bb-includes/capabilities.php. So, I don’t believe you can pull them from anywhere other than there. Maybe I missed it and they are defined in the database somewhere, but I don’t think so.
There is already a drop down of roles in the admin section, when you go to edit a user’s profile, you can mark them member, inactive, blocked, etc. Take a look at lines 1309 – 1317 in bb-includes/template-functions.php
<tr>
<th scope="row"><?php _e('User Type:'); ?></th>
<td><select name="role">
<?php foreach( $roles as $r => $n ) : ?>
<option value="<?php echo $r; ?>"<?php if ( array_key_exists($r, $user->capabilities) ) echo ' selected="selected"'; ?>><?php echo $n; ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>Will that do what you want?
November 22, 2007 at 3:13 am #61547In reply to: How Do I Do This?
chrishajer
ParticipantFor WP header and navigation, or the logo and navigation back to WP, everything you need is in the theme files and the stylesheets. I would make a copy of the default template (create a new folder of a different name, then copy all the files from the stock theme into that new folder, and open style.css and change the
Theme Name: Kakumei
toTheme Name: ChgoGrrl99
), then make your modifications in those files. If you break it, just revert to the stock theme.But, adding links, adding the WP header and navigation, can all be done in the theme files.
November 22, 2007 at 12:40 am #61648In reply to: Suggestions and misc
vafaaaan
Memberhmm seems working .. have wp cats and stuff to the right .. same theme
forum root is.. ehh.. root
cant find where to change that to forums.php
Update: Found at the top in my-templates/topic.php and forum.php .. changed <?php bb_option(‘uri’); ?> to forums.php and it works fine
i feel happy
Update2: changed in my-templates/footer.php. Removed almost all code
<?php do_action('bb_foot', ''); ?>
<?php wp_footer(); ?>
<?php
include($_SERVER['DOCUMENT_ROOT'] . '/myname/wp-content/themes/themename/footer.php');
?>
</body>
</html>So it runs with my WP theme footer
Need to slice up my WP header so i can do the same
Im just hacking and testing so if there is something i can do better say it
Looks a bit weird to have two admin/logins at my top right corner
Update3: Since i had forums.php i change in config.php
// What are you going to call me?
$bb->name = ‘Forum index’;
Looks better
Keep up the good work developers!
November 21, 2007 at 11:56 pm #61647In reply to: Suggestions and misc
vafaaaan
MemberHey.. wtf .. think it works .. im havin wp and bbp in the same dir, root dir .. just renamed bbp´s index.php to forums.php ..bbl with a report
November 21, 2007 at 10:42 pm #2624Topic: Suggestions and misc
in forum Installationvafaaaan
MemberWhere do i put them? here? if so..
i think bbp should have 2 options at install, standalone or integrate with WP .. and since so many ppl want this under WP it should be default
So i added
require_once($_SERVER . ‘/kent/wp-blog-header.php’);
in my config and it seems working fine. Can i now use functions as is_user_logged_in() and wp_list_categories() in my bbp templates ?
Can either sides registration/login be totally skipped? ex. remove bbp´s registration?
November 21, 2007 at 7:00 am #60983In reply to: Can’t add additional tags to post
scottdavis
MemberTracked down the problem in Use Display Name. Basically, it’s a bit overzealous in replacing the user name with the display name throughout the code… including for a function that’s used to check for capabilities. Since the name doesn’t match, the capability check fails.
Quick partial fix: comment out the following line in display-name.php:
// add_filter( ‘get_user_name’, ‘bb_use_display_name’, 1, 2 );
The Display Name will now be used instead of the User Name in some places, but not in others.
A more complete fix:
1. In display-name.php, replace:
add_filter( ‘get_user_name’, ‘bb_use_display_name’, 1, 2 );
WITH
add_filter( ‘get_display_name’, ‘bb_use_display_name’, 1, 2 );
2. In template-functions.php, add the following function:
function get_display_name( $id = 0 ) {
$user = bb_get_user( bb_get_user_id( $id ) );
return apply_filters( ‘get_display_name’, $user->user_login, $user->ID );
}
3. In template-functions.php, find function bb_get_title(), replace the call to get_user_name() with get_display_name()
4. In template-functions.php, find function get_full_user_link(), replace both calls to get_user_name() with get_display_name()
5. In profile.php, replace the call to get_user_name() with get_display_name()
Enjoy
— scott
November 21, 2007 at 4:43 am #61625In reply to: editing the mod_rewrite
chrishajer
ParticipantNot sure I follow your problem description. mod_rewrite rules are in the .htaccess file normally. You set the option to use mod_rewrite true, false or slugs in config.php. Are you asking where in the code the links are created based on those choices in config.php?
November 21, 2007 at 2:54 am #61634In reply to: Article: Install bbPress Locally
Trent Adams
MemberIt is for the benefit of others. OK with me
Trent
November 21, 2007 at 2:24 am #2622Topic: Article: Install bbPress Locally
in forum Showcaserefueled
MemberA little bit of self-promotion here…
(mods: delete if not allowed)
I just wrote an article on how to install bbPress locally.
You can read it here: http://www.refueled.net/install-bbpress-locally/
For those experts out there: if there are any errors within the article, I would appreciate if you could let me know.
Hope it’s useful.
November 20, 2007 at 11:53 pm #61389In reply to: Stick to front removes topic from forum?
Sam Bauers
ParticipantYes, by design of the system…
November 20, 2007 at 11:40 pm #61631In reply to: How to show forum title on latest topics list?
livibetter
MemberTry
forum_name($topic->forum_id);
November 20, 2007 at 11:24 pm #57096In reply to: Code backtick bug
livibetter
MemberTry my plugin: http://www.livibetter.com/it/topic/plugin-html-tag-attributes-validator
It supports Image
<img>
, YouTube and Google Video embedding.November 20, 2007 at 9:19 pm #2621Topic: How to have topic_author() show “display_name”?
in forum Troubleshootingintellivision
ParticipantOn front-page.php I’d like the “first poster” column to show the users’ display_name (bbPress is synced with WP).
I’ve tried this
<td class="num"><?php echo(get_author_name(topic_author())); ?></td>
which calls this
function get_author_name( $auth_id ) {
$authordata = get_userdata( $auth_id );
return $authordata->display_name;
}but it still shows “user_login” which tend to have ugly underscores etc.
November 20, 2007 at 4:48 pm #57095In reply to: Code backtick bug
fel64
MemberYou have the allow images plugin installed, don’t you?
If my guess is right, turning it off will make backticks work again. But that may not be worth it to you.
-
AuthorSearch Results