Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 28,676 through 28,700 (of 32,460 total)
  • Author
    Search Results
  • #61037
    vafaaaan
    Member

    What 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'));

    #61646
    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

    #61644
    livibetter
    Member

    Haven’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)

    #57097

    In reply to: Code backtick bug

    Arlo
    Member

    Fel -yup, that was apparently the problem

    Livi- and that plugin works without borking code. Thanks!

    #61650

    In reply to: Suggestions and misc

    vafaaaan
    Member

    Im 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() in D:xxxxxbb-includesbozo.php on line 173

    Warning: Missing argument 3 for bb_bozo_pre_post_status() in D:xxxxxbb-includesbozo.php on line 173

    then.. i get when i post..

    Warning: Missing argument 2 for bb_bozo_pre_post_status() in D:xxxxxbb-includesbozo.php on line 173

    Warning: Missing argument 3 for bb_bozo_pre_post_status() in D:xxxxxbb-includesbozo.php on line 173

    Warning: Cannot modify header information - headers already sent by (output started at D:xxxxxbb-includesbozo.php:173) in D:xxxxxwp-includespluggable.php on line 391

    #61643
    Null
    Member

    Okay 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

    #53524
    Null
    Member

    Tried this, it aint working :(

    #61640
    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.

    #61639
    Null
    Member

    Hi 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

    #61649

    In reply to: Suggestions and misc

    vafaaaan
    Member

    Now .. 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() ) { ?> &raquo; 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 :)

    #61638
    livibetter
    Member
    #61637
    chrishajer
    Participant

    I 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?

    #61547

    In reply to: How Do I Do This?

    chrishajer
    Participant

    For 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 to Theme 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.

    #61648

    In reply to: Suggestions and misc

    vafaaaan
    Member

    hmm 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 :D

    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!

    #61647

    In reply to: Suggestions and misc

    vafaaaan
    Member

    Hey.. 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 :)

    #2624
    #60983
    scottdavis
    Member

    Tracked 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

    #61625
    chrishajer
    Participant

    Not 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?

    #61634
    Trent Adams
    Member

    It is for the benefit of others. OK with me :)

    Trent

    #2622
    refueled
    Member

    A 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.

    #61389
    Sam Bauers
    Participant

    Yes, by design of the system… :)

    #61631
    livibetter
    Member

    Try forum_name($topic->forum_id);

    #57096

    In reply to: Code backtick bug

    livibetter
    Member

    Try my plugin: http://www.livibetter.com/it/topic/plugin-html-tag-attributes-validator

    It supports Image <img>, YouTube and Google Video embedding.

    #2621
    intellivision
    Participant

    On 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.

    #57095

    In reply to: Code backtick bug

    fel64
    Member

    You 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.

Viewing 25 results - 28,676 through 28,700 (of 32,460 total)
Skip to toolbar