Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for '+.+default+.+'

Viewing 25 results - 6,551 through 6,575 (of 6,788 total)
  • Author
    Search Results
  • #1557

    Topic: Hooks & Filters Docu

    in forum Plugins
    fel64
    Member

    Rather than just keeping private notes on the hooks and filters I found, I thought it best to maybe start a list here with everyone, just as a rough working documentation of the hooks and filters.

    For future ref/for people that don’t know, a hook is a means of bbPress making your plugin run every time a certain thing happens. To get that to work, put this code at the very bottom of your plugin:

    add_action( 'hook_name', 'functionname' );

    Filters are very similar to hooks, only it gives your plugin some data, you can then do something with the data (filter it), and then pass it back. To register for filters, put this code at the bottom of your application; remember to accept the parameters in your function and return them as appropriate.

    add_filter( 'filter_name', 'functionname' );

    Note that in both cases you want the name as a string and the function’s name as a string, no brackets or parameters at the end of it! An optional third parameter is the priority of your function; default is 10, so set this higher if you want it to execute last or lower if you want it to execute earlier.

    Some Filters

    topic_title – this passes the topic title to your function when the threads are being listed, like on the (default) front page.

    bb_allowed_tags – this is the array of HTML tags you can use in your posts. Hang a filter on this and add elements to the array if you want to allow more tags.

    Some Hooks

    bb_head – this is called when the HTML <head> element is being filled, so you can add stylesheets or javascript and the like.

    bb_user_logout obviously gets called when someone logs out.

    bb_init when someone logs in?

    bb_new_user when someone registers; passes the ID along I think

    bb_profile_menu – haven’t figured out how it works; I think it’s to do with the tabs at the top of the profile.

    If you know any more hooks or filters, or find ’em, please post them here with a quick description if necessary!

    #56887
    gtim
    Member

    I doubt that this is the most efficient way, but it seems to work. Add the following code in post.php in the default theme (/bb-templates/kakumei/post.php), you probably want it within the .threadauthor div.

    <?php
    $puser = bb_get_user( get_post_author_id() );
    if ( isset( $puser->from ) ) {
    echo $puser->from;
    }
    ?>

    It is not possible to do this with a plugin yet because there is no hook there, but there is a Trac ticket for it.

    Also, I compiled a list of all template functions.

    #56912
    chrishajer
    Participant

    I’m not worried about fixing it for me. I’m worried about fixing it for every new person who comes along and installs it and has a problem immediately. If the above works, that should be the default and that should be released. Anyone who downloads the latest.tar.gz should not have to edit out anything to fix the bozo problem. The default doesn’t work, so it should be changed until it’s fixed. No patches: a new release.

    #56866
    Trent Adams
    Member

    Have you taken a look at this thread? As well, http://kaespace.com/bbpress/ doesn’t show up for me at all. Is that the correct address? As for the link just having “style.css” in the address, it is because it is referenced off the theme folder and not the root directory. I can’t access your site, so what is your theme as well? The default one?

    Trent

    #56848
    slozano
    Member

    Thank you for the help. I tried the plug in proposed by Tren

    and the solution at https://bbpress.org/forums/topic/988?replies=4#post-6373. Only Charly54’s solution worked (Thank you Charly54), but only partially. The solution works with the default theme (Kakumei). I downloaded Bloody Gray 1.1 by Aditya Naik, removed Tren’s patch-to-URL plugin, Kakumei still works, I can see the preview of “Bloody Gray” in the Admin/presentation page. Once “Bloody Gray” is selected as the theme Firefox 2.0 show nothing and no code. When looking at the same page in IE 7.0 I get `<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>

    <HTML><HEAD>

    <META http-equiv=Content-Type content=”text/html; charset=utf-8″></HEAD>

    <BODY></BODY></HTML>`

    An empty page!. Thank you for you help, I will get another theme and try to understand what is happening, looks like many have struggle with this issue.

    #56865
    minkuei
    Member

    Actually I know I have to make my-templates folder and I do have it.

    But before I put css file in the root, the forum don’t even read the default theme.

    I do try to change it in admin panel, but somwhow it just don’t work.

    #56857

    In reply to: login form wordpress

    fel64
    Member

    To change where the user is redirected, add a hidden field to the login form called redirect_to, with a value of where-ever you want the user to end up (default is in the dashboard).

    #56864
    fel64
    Member

    You have to do it differently. To apply a css file, make a new folder in /bbpress/ called my-templates, open it, make a new folder for your “theme”, and put in your css file called style.css. Now go to the Admin Panel > Presentation and pick your theme.

    Note that you can change the HTML output of files as well. If you do not have a file for a particular page (such as forum.php) bbpress will look for the default file (located in /bbpress/bb-templates/kakumei) and use that instead. If you wish to use a modified file, copy the default into your theme’s folder and change it there.

    #56641

    In reply to: Plugin: BB-Ads

    wittmania
    Member

    UPDATE: The sample ad file now includes the code necessary to display different ads based on the context. For example, if it is a topics page, it will display one ad and if it is a forum page, it will display a different one.

    The code is something like this:

    <?php
    if ( strpos($_SERVER['REQUEST_URI'], 'topic.php') ) { ?>
    <div>An ad for a topics/posts page</div>
    <?php
    } elseif { another specific page;
    } else { default ad;
    } ?>

    The sample file includes elseif checks for topic.php, forum.php, profile.php, and a “default” if none of the above pages are detected.

    This would allow you to have one file per sponsor/advertiser, with a different context-based ad for each situation.

    #56838

    In reply to: Candy!

    fel64
    Member

    I can’t find the Category Patch plugin, sorry. That plugin browser is annoying. >_<

    The statistics are included by default, but not linked to in the default theme. Just go to www.example.com/forums/statistics.php and it’s there. The file for it is in your root forum folder.

    #56593
    archasek
    Member

    it works in my default template so i have right files in my-plugins folder.

    whats wrong? maybe i missed something in scripts/template files?

    #56592
    archasek
    Member

    in wordpress ofcourse yes. in bbpress there is not polish lang file (as i know).

    yes i have plugin and js in my-plugins folder. tomorrow i’ll check it in my default.

    in my wordpress, in adminpanel i also don’t have quicktags panel in visual mode in my adding post site. may it has something in common with bbpress plugin?

    #56591
    Trent Adams
    Member

    The quicktags plugin should work automatically if you drop the plugin file and the JS file into your /my-plugins/ folder. That should bring up the buttons you requested. If it doesn’t, it might be a problem with it displaying in your theme. Quick way to test that is test it out on the default template and not your custom template.

    As for the translating, are you using the language files for your chosen language?

    Trent

    #55011
    Trent Adams
    Member

    You cannot click a checkbox that says “turn off registration”, but you can do it indirectly through the following steps by editing your theme files. If you have the default template, please upload the changed files to a new folder off the root of /my-templates/

    1) Remove the following file out of your root directory, register.php.

    2) Edit your template file login-form.php and remove the following:

    <p><?php printf(__('<a href="%1$s">Register</a> or log in'), bb_get_option('uri').'register.php') ?>:</p>

    3) Put something like the following in register.php from your template folder:

    <?php bb_get_header(); ?>

    <h3 class="bbcrumb"><a href="<?php bb_option('uri'); ?>"><?php bb_option('name'); ?></a> &raquo; <?php _e('Register'); ?></h3>

    <h2 id="register"><?php _e('Registration Turned Off, Sorry!'); ?></h2>

    <?php bb_get_footer(); ?>

    Unless I am missing something, that should do it!

    Trent

    #56671

    In reply to: Plugin: Avatar Upload

    LMD
    Participant

    If you are using the default template, ‘kakumei’, then yes, you can put ‘avatar.php’ in the default ‘bb-templates/kakumei’ folder.

    If you are using a custom template, then you need to upload it to your custom template folder (which is how I’m using it) – it does not cause problems if the file does not exist in the default template.

    #56562
    Atsutane
    Member

    Glad it work for you. For some reason i notice the default plugin setup not work on some server. Fix the problem already.

    #52644
    wittmania
    Member

    OK, to answer the “where do I put the code question (0.8.1)…

    In functions.php, find the get_profile_info_keys() function, which should be on or around line 1761. In the line that starts with array('user_email'..., add the following code before the last “)” in the line. Note the comma.

    , 'sig' => array(0, __('Signature'))

    This will add the signature field to the profile edit page, enabling users to input their own signatures.

    Next, we need to add the code to display the signatures in their posts. In post.php, find this line (for me it was line 17):

    <div class="post"><?php post_text(); ?></div>

    BEFORE the closing div tag, add the following:

    <?php /*Is the signature field blank?*/
    if (get_sig( get_post_author_id() ) != "") { ?>
    <div class="signature"><?php post_sig(); ?></div>
    <?php } ?>

    (NOTE: Make sure the existing closing div tag still follows the code above.)

    This checks to see if a signature exists, and if it does it adds a nested div with the signature class stylization applied to it, and the content of the signature field is placed inside this div.

    Finally, add the following to your style sheet:

    .signature {
    border-top: 1px dotted #ccc;
    margin: 5px 0 0;
    padding: 5px 0 0;
    }

    If you are using the default theme, this will style the signature div exactly like the poststuff div that follows it.

    Please note that (at this time) signatures are text-only. You may want to let your users know by adding a note in the functions.php array declaration. Something like 'Signature (text only)' would do the trick.

    I don’t know if it’s possible, but it would be nice if this plugin would be modified so that it can display images, links, and so on in the signature. Does anyone know how to do that?

    Thanks!

    #56496
    Trent Adams
    Member

    Daddo,

    You have the following error on your forum right now:

    Fatal error: Cannot redeclare is_tag() (previously declared in /home/.mardi/driftk27/driftkikker.com/wp-content/plugins/UltimateTagWarrior/ultimate-tag-warrior.php:117) in /home/.mardi/driftk27/forum.driftkikker.com/bb-includes/template-functions.php on line 251

    My suggestion would be to get the cookies and logins working with the default template and then break it with tring to include WP content like the UTW plugin ;)

    Trent

    Sam Bauers
    Participant

    By default, the alphanumeric code is an md5 hash of the bb_table_prefix that is set in config.php

    For default installs this effectively makes the cookie names:

    'bb_user_' . md5('bb_')

    'bb_pass_' . md5('bb_')

    You can override the name of the cookie by setting values for the following somewhere in config.php:

    $bb->usercookie = 'my_great_user_cookie_name'

    $bb->passcookie = 'my_great_pass_cookie_name'

    Then provided that your website is in the same domain as your forum, you should have no trouble reading these cookies using your own code.

    #56388

    In reply to: Syntax questions

    lonemadmax
    Member

    fel64’s assumption is correct. You can see the definition of _e() and __() in bb-includes/l10n.php:

    // Return a translated string.

    function __($text, $domain = 'default') {

    // Echo a translated string.

    function _e($text, $domain = 'default') {

    #56371

    In reply to: Plugin: bbMenu 1.1

    Null
    Member

    Well most izi way:

    Wait for the next release, it will have custom tabs adding feature.

    Hard way:

    Using phpmyadmin you can add into the menu table:

    DEFAULT, 'Excample tab', 'inactive', 'pagename.php', 'front-page', 0

    Well ‘front-page’ is more complicated to add it should be changed to something else and added as a plugin (i know this sounds weird), so let it in and see what happens….

    About the pm issue, i am not familair with it what does it do? Can you show me? If it is a page that is added then this is possible INCLUDING that the tab stays active…

    problem that could happen is for non logged in visitors, they will see the tab too

    #1670

    Topic: Syntax questions

    in forum Themes
    wittmania
    Member

    A couple of questions about what syntax to use, especially on template pages:

    1. I see that a lot of people use _e('string...') instead of echo('string...'). Is this just a bbpress/wordpress thing or is this generally acceptable php coding?

    2. In front-page.php of kakumei (and many other places), I see people using this shorthand echo where normal text would work just fine. For instance, in the hottags div, it is:

    <h2><?php _e('Hot Tags'): ?></h2>

    Why would you have PHP echo that when you could just have it as plain ol’ text in the first place? Am I missing something?

    I realize neither of these is of any earth-shaking importance, but I would like to know so I can keep my code modifications in line with the default syntax that is used throughout. Thanks!

    #56368

    In reply to: Plugin: bbMenu 1.1

    Null
    Member

    Darn that error again, there must be something wrong with that insert part when a table is created.

    Check with phpmyadmin if the table bb_menu is created. If not do so manually (this is not tested, but it contains the stuff needed in the table):

    "CREATE TABLE$bbdb->menu` (

    item_id INT(3) NOT NULL AUTO_INCREMENT,

    item varchar(50) NOT NULL default ”,

    set varchar(50) NOT NULL default ”,

    page varchar(50) NOT NULL default ”,

    location varchar(50) NOT NULL default ”,

    order int(9) NOT NULL default ‘0’,

    PRIMARY KEY (item_id)

    );`

    Then you will have to fill it (again not tested, but it contains what needed):

    "INSERT INTO$bbdb->menu` VALUES

    (DEFAULT, ‘Forums’, ‘active’, ‘index.php’, ‘front-page’, 0),

    (DEFAULT, ‘Search’, ‘active’, ‘search.php’, ‘search-page’, 1),

    (DEFAULT, ‘Statistics’, ‘inactive’, ‘statistics.php’, ‘stats-page’, 0);”`

    When sucesfully created this table, things should work…

    #1667
    davetropeano
    Member

    I recently did my first bbpress install on localhost and it went miserably. I used the latest download from today.

    Checking on this forum I had the same path seperator issues and stylesheet issues others had, etc.

    My $bb->domain and $bb->path were fine. The fresh install just didn’t work properly under xampp and then again a retry on easyPHP.

    This is the solution and findings I found:

    1. The first issue is because in config.php and bb-load.php dirname(__FILE__) is used to get the base path for BBPATH. This is not a good thing on localhost Windows based installs.

    2. There are a number of attempted workarounds to this that I’ve read about in this forum. All of them that I saw didn’t work. Focusing on the issue with the stylesheet href not being correct I noticed that there was logic in the bb_get_active_theme_folder() function.

    By default, the installer does NOT create an option entry ‘bb_active_theme’ in the database table topicmeta. The code logic doesn’t make the correct uri.

    To fix this, do an install and then add a database field bb_active_theme in the topicmeta table.

    For example, I set mine to:

    http://localhost/dev/bbpress/

    Playing regular expression games to change x: and in general is not worth it. This seemed to be simple and worked right out of the box.

    #50826

    In reply to: Avatars

    cweb
    Member

    It works for me, just had to change your variable name $usermail because it’s supposed to be $email – so the code looks like this:

    function get_avatar() {

    global $bbdb;

    $id = get_post_author_id();

    $user = bb_get_user( $id );

    $email = $user->user_email;

    $default = "http://eastcoastwahines.com/images/gravatar.gif"; // Put your default avatar link

    $size = 40;

    $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($email)."&default=".urlencode($default)."&size=".$size;

    echo "<img src="$grav_url" alt="Gravatar" width="$size" height="$size" />";

    }

Viewing 25 results - 6,551 through 6,575 (of 6,788 total)
Skip to toolbar