Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 25,451 through 25,475 (of 32,481 total)
  • Author
    Search Results
  • gradek
    Member

    I was able to fix the Error using the following .htaccess code:

    AddHandler x-httpd-php5 .php

    AddHandler x-httpd-php .php4

    I got the info here, since I am using a godaddy server.

    http://help.godaddy.com/article/1082

    gradek
    Member

    I am also having the same issue, the .htaccess trick didn’t help either. any other ways of ensure the use of php5?

    #72569
    _ck_
    Participant

    untested theoretical plugin

    add_filter('post_text','first_reply',999);
    function first_reply($text) {global $bb_post;
    if (!is_bb_feed() && (int) $bb_post->post_position==1) {$text.="<a name='first-reply'></a>";}
    return $text;
    }

    Then to get the first-reply link for any topic,

    <?php echo "<a href='".get_topic_link()."#first-reply'>replies</a>"; ?>

    #72568
    _ck_
    Participant

    They are trying to link to the first reply.

    It far easier to inject an anchor at the very bottom of the first post and link to that instead.

    It could be done via a plugin that appends post_text and checks the $bb_post->post_position to see if it’s equal to 1

    If it’s equal to 1 then append <a name="first-reply"></a>

    Then your first reply is always at http ://topic-link-blah-blah#first-reply

    Note that my unread-posts plugin already solves the problem of linking to the first unread reply per user.

    #72579
    bruinfelix
    Member

    The creators of bbPress, are putting their head in to the sand, the function most people wants (theme integration) isnt still available in bbPress, and that’s a big shame! ;)

    #72602

    In reply to: Footer

    Eleeist
    Member

    Thanks ;).

    #72601

    In reply to: Footer

    chrishajer
    Participant

    In the directory of your current template, you want to add it to the file called footer.php. Just put it right after this line:

    <?php printf(__('%1$s is proudly powered by bbPress.'), bb_option('name'), "http://bbpress.org") ?>

    Before the closing </div>.

    #72498
    john32
    Member

    Can anyone who has successfully got both WP and bbPress to use the same cookies please post what code you used in your wpconfig and bbconfig to them to work?

    I understand there are countless thread with this information but I’ve tried different various combinations of the code to no avail.

    Thanks!!

    #59344

    In reply to: Adding a new User Type

    lelandf
    Member

    Okay, it took me a couple hours but I finally got this to work (sorta) using a variation of fel64’s code. I was using it to create a special usergroup with the same capabilities as regular members for use with the Hidden Forums plugin.

    The original code kinda worked, because it did create a new user group with the name I had chosen. I soon realized, however, the users in the user group I made had no capabilities and therefore couldn’t post, edit their profile at all, etc. I was expecting they would have the same capabilities as members.

    So I made a few changes and…here’s the plugin code I used:

    <?php
    /*
    Plugin Name: Add lusers
    Description: adds the luser role
    Author: fel64
    */

    add_filter('get_roles', 'addlusers');

    function addlusers( $roles ) {
    $roles['luser'] =& $luser; //convenience
    $luser['name'] = __('Luser');
    $lusercaps = array('participate','edit_favorites','edit_tags','edit_topics','edit_posts','edit_profile','write_topics','write_posts','change_password','read');
    foreach( $lusercaps AS $cap ) {
    $luser['capabilities'][$cap] = true;
    }
    return $roles;
    }
    ?>

    Basically I removed the first line of the function, because for some reason it wasn’t working. I then copied all the capabilities of a regular member in an array format. You can get other capabilities (like for moderators, admins, and key masters) from the capabilities.php file in /bb-includes/.

    Just save the code in a .php file and upload it to your plugins folder and activate. You would also probably want to change the “Luser” name to something else.

    Now I know this probably isn’t the best way to do it, but it worked for me, so I thought I’d share it here. Hopefully some of you get some use out of it.

    #72532

    THANK YOU detective!

    (also thanks to _ck_ and Ipstenu – i’m sure we would not have gotten there without you).

    So in idiots terms (so i can understand ;-] )…

    All functions hardcoded into BBpress’s template-functions can be overwritten, but only if they are on a hardcoded list within the core?

    And if you want to write a plugin to overwrite one of these template functions that’s hard coded into the core, and not on another the hardcoded list in the core, we have to include a file in the theme directory and not the plugin directory?

    Am i the only one that thinks that this hampers theme development with all this hardcoded stuff? Anyway, as long as this works it’s cool with me – thank you all for your help!

    #72530

    HI _ck_,

    Yeah it was a typo.

    I know that functions can have things added to them and overwitten as your plugins prove, i’m not doubting that for a second, and i’m sorry if it came across that way. What i’m saying is that while i’m able to either overwrite or add to some functions, some i’m only able to add to, and some i’m not able to either add to nor overwrite.

    Now if that’s not a bug, then cool. Really cool! But i can’t see why that would be, and i’m hoping you can point me in the right direction. You’ve said countless times it works in the same way as wordpress plugins, but a google search of how to overwrite wordpress functions leads me to (see pages below). And the code supplied here works on every function i’ve tried (so far – 9 plugins in) except BB_GET_HEADER, BB_GET_FOOTER and POST_FORM. and i’m wondering why that is.

    I’m absolutely 100% cool with the fault being at my end, it would be a relief tbh, but with no documentation and no examples or other plugins that overwrite these functions i’m totally lost.

    Basically, typos and what pepole think i’m wanting do to aside, what i really want to know is this:

    What code do i have to write so that my function is called instead of the one hard coded into template-functions.php?

    Thank you so much.

    Edit: Websites i use as a plugin resource:

    http://www.catswhocode.com/blog/how-to-overwrite-wordpress-core-functions

    https://codex.wordpress.org/Plugin_API

    http://comox.textdrive.com/pipermail/wp-hackers/2008-February/018013.html

    #72529
    _ck_
    Participant

    I assume this is just a typo in your example and not what you are really using:

    add_filter('topic_pages', 'output_what_i_want, 11');

    because the quote should close before the 11

    add_filter('topic_pages', 'output_what_i_want', 11);

    There’s nothing wrong with the action or filter triggers in bbpress (only that there are not enough of them or in the right places). The code for that is taken right out of wordpress and works fine. My dozens of plugins kinda prove they all work.

    #72527

    HI _ck_,

    thanks for this. I’m not trying to stop something being called with an add_action, but i’m sorry if i didn’t phrase it well enough. What I have found is that i cannot either get an added filter nor an action to add to certain functions in BBpress. Thats the issue i’ve hit.

    Nor am i wanting dynamic theme’s, as your wonderful plugin covers that.

    My plugin does this:

    ON activation checks for wordpress integration.

    If wordpress integrated copies the header file form the wordpress template to a directory.

    Inserts BBcode Hooks into the new file.

    Now that bit works well and dandy; but what i want in this instance is to overwrite the function BB_GET_HEADER as it’s hardcoded in the template_functions.php file.

    So here is my question, how can i/we overwrite the BB_GET_HEADER function ?

    1) can we overwrite functions in the template-functions.php file?

    2) how?

    3) is there an example of this anywhere?

    I ask not to be pedantic, but because i think you answered my post based on what you think i’m trying to do with my plugin rather than the issue at hand – namely that i can over write some functions and not others.

    You are pretty much the authority on this, so i really appreciate any help insight you might have on how to overwrite the BB_GET_HEADER function. thank you!

    #72588
    _ck_
    Participant

    My theme switcher plugin is capable of doing this quite easily, it already allows each visitor to select the theme they want.

    All you would need to do is change the cookie support code into session support code so the server controls which theme is seen instead of the visitor.

    Should take all of an hour to convert for someone who understands cookies and sessions.

    Actually if the domain is fixed you can just use $_SERVER['HTTP_HOST'] or $_SERVER['SERVER_NAME'] to determine the theme to use which makes it even easier.

    #72356

    In reply to: Bulgarian translation

    wiseacre
    Member

    Че аз така и направих – с текстовия редактор. Замених навсякъде тоя текст с празен. Може и да има друг по-хубав начин ама не го зная.

    Сега ще се мъча да инсталирам и уча KBabel примерно ;).

    #72524

    Stupid question – Don’t you have to remove_filter('filter_i_want_to_replace') first?

    #72578
    Postmatic
    Member

    Hey Kevin,

    I need to do all 3. I have that database, user table, and cookies all nicely set up… but am trying to figure out the best way to tackle the theme.

    Thanks a lot for the code. I’ll try it out on Monday. Ya, I too hope we get an answer on that bug soon. Maybe something will move on it over the weekend.

    Fingers crossed,

    Jason

    #72355

    In reply to: Bulgarian translation

    Между другото, в .po файла мисля, че ще е добре навсякъде трябва да се махне онова

    хахах, да :) трябва да се зачистят пътищата но нямам идея как да стане освен направо да бръкна в .po файла с текстов редактор.

    #72354

    In reply to: Bulgarian translation

    wiseacre
    Member

    Представа нямам. Попаднах на превода ти търсейки точно същата информация. Ще трябва да питаме.

    Между другото, в .po файла мисля, че ще е добре навсякъде да се махне онова

    “E:my-documentsprojectscomicsbistro_software”

    Не, че пречи кой знае колко – и с него и без него успях да направя другия файл ма стои някак … не много стилно. :)

    #72566
    Null
    Member

    I know, that’s why I ask it here :) The forum has to know some way what topics belong to him and in what order, so there must be a way to get it…. the only questions is: how???

    #72577

    Rather than using the crazy structure of BBpress’s header.php file – actually while i’m on that can i ask why BBpress DID NOT use the same div nesting as WP so that integration was simple? madness – if you use this one, your BBpress forum should automatically look 90% like it’s in your WordPress page if you use the default theme, default K2 or sandbox.

    You will have to tweak bits of course, this isn’t fool proof, but in terms of the basics, it makes life alot easier.

    I mentioned these changes back in October, so i’m used to the copying and pasting of them now as it doesn’t look like making thing easy for the end user is part of the goal here; hence the plugin. I too hope we get an answer on the bug soon :)

    #72353

    In reply to: Bulgarian translation

    Благодаря :)

    Когато излезе бета версия на 1.0 ще обновя и превода, засега остава на стабилната 0.9

    Колкото до конкретните преводи на някои думички – за нашите нужди звучи приемливо добре :) Променили сме и още някои нещица – сещам се за “Стил” вместо “Тема”(Theme), защото Topic също се превежда като “Тема” и става объркване. Макар, че сега влиза в разрез с превода на WordPress… може би трябва да стане “Тема”(Theme) и “Дискусия”(Topic)

    Може би трябва да се произнесе някой от комисията по стандартизация ;) (Н.Бачийски?)

    А знаеш ли какъв да подновим превода в официалното хранилище с този?

    #72576

    Hi Vernal,

    In terms of integration in a software sense, you have to answer yourself this:

    1) Do they need to look the same?

    2) Do I need shared login ?

    3) Do i need shared wordpress functions (menu, sidebar, otehr cool wordpress stuff) ?

    If you answered yes to 1) and no to 2) and 3) you only need to make your style sheets and HTML look similar and dont need any integration.

    If you answered yes to 1) and 2) and no to 3) then you should be able to use the latest alpha and latest wordpress and all should be fine. Personally, i’d not ouch with with a bargepole and i’d use BBpress 0.9 and WP 2.7.1 with _ck_’s Freshly Baked Cookies plugin (link coming up in a bit).

    If you answered yes to 1) 2) and 3) then you need to use Ann’s plugin (again link coming up).

    In terms of fixing your BBpress to integrate into your wordpress theme easily, that one is simple. Replace the code in your header.php file with this:

    <body id="<?php bb_location(); ?>">
    <div id="page">
    <div id="wrapper">
    <div id="header">
    <div id="headerimg">
    <h1 id="blog-title"><!-- PUT YOUR WP LINK HERE --></h1>
    <div id="blog-description">
    <div class="description">
    <!-- PUT YOUR WP DESCRIPTION HERE -->
    </div> <!-- #description -->
    </div> <!-- #blog-description -->
    </div> <!-- #headerimg -->

    <!--
    K2 USERS
    THIS IS WHERE YOU PUT YOUR MENU CODE
    -->
    </div>

    <div id="access">
    <div class="skip-link"><a href="#content" title="Skip to content">Skip to content</a></div>
    <div id="menu">
    <!--
    SANDBOX USERS:
    THIS IS WHERE YOU PUT YOUR MENU CODE
    -->
    </div>
    </div><!-- #access -->

    <div id="container">
    <div id="primary">
    <div id="current-content">
    <div id="content">
    <div id="post">
    <div id="main">

    <h1><a>"><?php bb_option('name'); ?></a></h1>
    <?php if ( bb_get_option('description') ) : ?><p class="description"><?php bb_option('description'); ?>
    <?php endif; ?>

    <?php login_form(); ?>

    <?php if ( is_bb_profile() ) profile_menu(); ?>

    #72574

    Hi Chris,

    I’ve actually made a plugin that makes theme integration between BBpress and WordPress an absolute breeze (one click!), but it used to require one of my customized baseline theme’s.

    Last week I converted it to work with any standard BBpress installation but alas hit some bugs in the BBpress core. I have posted about them, but have had no reply yet. You can find the post here: https://bbpress.org/forums/topic/overwriting-template-functions

    Basically all of my original customized themes have a far more usable div nesting in the header and footer, so that it matched 3 of the most common wordpress theme’s (standard, sandboz, K2); thus anyone loading up an integrated BBpress would see their own website styling/menus etc. While not 100% accurate, it saved me a great deal of time when customising.

    But then last week i converted this into a much better plugin. It reads the directory of the wordpress theme you are using and automatically outputs the WordPress theme’s header and footer files with the necessary BBpress code injected. It effectively encapsulates your BBpress forum inside wordpress pages for seemlesss moving around (basically like simpleforums).

    But the whole thing’s on pause until we can get answer to https://bbpress.org/forums/topic/overwriting-template-functions . On a side note, as someone who is attempting to build plugins for BBpress, getting answers to questions like these to help development is really difficult, and the standard answer of “read other plugins that’s how i learnt” really doesn’t help when you come up against something new. Maybe we should have a plugin developer section (as the current plugin section has become a request section)?

    Billy Wilcosky
    Participant

    I’m confused though. I thought that IE8 automatically renders pages like IE7 unless you tell it to behave better with a meta tag. At least that is what this article says:

    Version targeting in IE 8, and an alternative path for Microsoft

    So why is a code needed to tell IE8 to act like IE7, when supposedly it already does this?

    I’m still researching and just not learning about IE8 so maybe I’m reading the above article wrong.

Viewing 25 results - 25,451 through 25,475 (of 32,481 total)
Skip to toolbar