Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 30,951 through 30,975 (of 32,453 total)
  • Author
    Search Results
  • #54336
    kirkk
    Member

    I think this problem is about my server, i mean the software that my server use. Because i couldnt see any mistake in the config file, but i have realized something, if i could find BBPATH, the codes which create this variable, i would be able to fix the problem…

    Thanks

    #54694
    fel64
    Member

    Yup, I know that; I just meant that you could quite simply add it to the arguments you took and it’d be a nice addition. My modified code at the end.

    Yeah, it’s mildly annoying that the permalinks aren’t used, but it’s not a killer for me. I’d rather have this functionality than none. :) Thanks again for the plugin.

    function wp_show_posts( $args ) {
    global $bb;

    parse_str($args, $r);
    if ( !isset( $r['before'] ) )
    $r['before'] = "<li>n";
    if ( !isset( $r['after'] ) )
    $r['after'] = "<br />n</li>n";
    $posts = wp_get_posts( $args );
    foreach( $posts as $post ) {
    echo $r['before'];
    echo "<a href='".$bb->wp_home."?p=".$post->ID."'>";
    echo $post->post_title;
    echo "</a>";
    echo $r['after'];
    }
    }

    #54693
    nickbrady
    Member

    Hi, fel64, you can use wp_get_posts() instead of wp_show_posts() and then use a foreach loop, much like the examples in the WP Codex for the get_posts function

    You don’t mind that pretty permalinks are not being used? I think it’s a killer, let’s hope some expert can help us.

    #54692
    fel64
    Member

    Fantastic Nick, worked straight out of the box. I really like the way you take arguments as well. :) Nicest addition would be a before and after so that it didn’t have to be a list.

    #54691
    nickbrady
    Member

    Hi,

    I am writing a plugin for BBPress that shows the latest posts from WP (if WP and BBPress are sharing the same database). It’s still in development, but it already works, you just have to write


    <?php wp_show_posts(\"\" ); ?>

    in any BBpress template.

    As you will see, it works, but it has a problem: it does not show WP’s pretty URLs. I would like to call WP’s get_permalink() function, but it uses many WP functions that are not available when you’re in BBPress.

    Any advice on how to do this? Or maybe it would be easier to read WP’s RSS?

    Thanks!

    Here goes the code of the plugin so far (if you don’t care about pretty permalinks, you can use it, it works):


    <?php
    /*
    Plugin Name: WP Posts
    Plugin URI: http://thesandbox.wordpress.com
    Description: Get a list of WordPress posts from your bbPress (needs to be integrated with WP, sharing database)
    Author: Nick Brady
    Version: 0.1
    Author URI: http://thesandbox.wordpress.com

    Install Instructions:
    - If you don't have a /my-plugins/ directory in your bbpress installaltion, create it on the same level as config.php.

    - Check out: https://codex.wordpress.org/Template_Tags/get_posts

    */

    function wp_get_posts($args) {
    global $bbdb, $bb;

    parse_str($args, $r);
    if ( !isset($r['numberposts']) )
    $r['numberposts'] = 5;
    if ( !isset($r['offset']) )
    $r['offset'] = 0;
    if ( !isset($r['category']) )
    $r['category'] = '';
    if ( !isset($r['orderby']) )
    $r['orderby'] = 'post_date';
    if ( !isset($r['order']) )
    $r['order'] = 'DESC';

    $now = bb_current_time('mysql');

    $posts = $bbdb->get_results(
    \"SELECT DISTINCT * FROM \".$bb->wp_table_prefix.\"posts \" .
    ( empty( $r['category'] ) ? \"\" : \", \".$bb->wp_table_prefix.\"post2cat \" ) .
    \" WHERE post_date <= '$now' AND (post_status = 'publish') \".
    ( empty( $r['category'] ) ? \"\" : \"AND \".$bb->wp_table_prefix.\"posts.ID = \".$bb->wp_table_prefix.\"post2cat.post_id AND \".$bb->wp_table_prefix.\"post2cat.category_id = \" . $r['category']. \" \" ) .
    \" GROUP BY \".$bb->wp_table_prefix.\"posts.ID ORDER BY \" . $r['orderby'] . \" \" . $r['order'] . \" LIMIT \" . $r['offset'] . ',' . $r['numberposts'] );

    return $posts;
    }

    function wp_show_posts( $args ) {
    global $bb;
    $posts = wp_get_posts( $args );
    foreach( $posts as $post ) {
    echo \"<li>n\";
    echo \"<a href='\".$bb->wp_home.\"?p=\".$post->ID.\"'>\";
    echo $post->post_title;
    echo \"</a><br/>n\";
    echo \"</li>n\";
    }
    }
    ?>

    flatworm
    Member

    I do not know php and html. I’ll search for this code line usind WIN. search to find <link rel=\"stylesheet\"

    I really do not want to be involved in the process of development of bbPress.

    All this really makes me think of using Vanilla.

    http://www.getvanilla.com

    Vanilla looks more professional and developed, but it is 50% bigger in size.

    Code is poetry, equaly unconceptional to everyone.

    #54881

    In reply to: Template Tags

    fel64
    Member

    Page numbers – say a thread has more than 30 replies and falls onto the second page, it’s very irritating having to click the thread’s name and then click again to get to the second page. Next to the page’s name you should simply have the page numbers displayed and clickable, hopefully in a smart way (say showing the first few and the last few). You can see it on this forum, too: say I want to read the second page of posts in the Plugin: Forum Restriction thread, I have to click on the name and then on the second page. Is there maybe even a plugin to list the page numbers next to the page name in the thread listing?

    In WordPress you have hooks that let you take actions through your plugin when they’re called, right? I guess bbPress does the same. I specifically want to create an Identicon avatar on registration – it’s not essential, just something I’d like to do. How do I register my plugin to work on that hook, and what hook do I use? Just a list of hooks would be helpful. :)

    #54928
    AphelionZ
    Participant

    Yeah, taking it out was a good idea. My forum doesnt use it and making it something that isnt in the core code makes it more useful as a ‘general’ forum right out of the box and not just a forum software for tech support.

    chrishajer
    Participant

    That is unstyled because the path to the style.css file is incorrect. Can you look at the source of that html page and find the line that begins:

    <link rel="stylesheet"

    My guess is that the path to your stylesheet is incorrect. There have been a couple threads about slashes being changed to back slashes improperly:

    https://bbpress.org/forums/topic/700?replies=28

    Even more relevant for localhost:

    https://bbpress.org/forums/topic/730?replies=9

    Here is a trac ticket for the backslash issue:

    https://trac.bbpress.org/ticket/594

    HTH

    edit: there will not be slashes before the double quotes in your html source around stylesheet , unlike this post. It’s a bug they’re working on.

    #49932

    In reply to: En español

    lonemadmax
    Member
    #54300
    lonemadmax
    Member

    From all those links, I could only get the es_AR one (I’m having some strange problems with my DNS, so it may be just me). So here is my es_ES version.

    #54903
    lonemadmax
    Member

    At the end of the plugin you can see:

    add_filter('user_sanitize', 'user_sanitize_i18n_fix', 10, 3);

    That adds the function defined in the plugin to the user_sanitize hook. Grepping the core files for user_sanitize, you find return apply_filters( 'user_sanitize'[…] in bb-includes/formatting-functions.php, in the function user_sanitize. When that function is called with strict = true, it removes what it considers not to be a letter, a number or a ‘-‘ from the first parameter (the provided username), and replaces repetitions of ‘-‘ with just one. So the underscore is removed. When strict is false, underscores are kept. Another effect is that accented characters and other such niceties of international scripts are also invalidated.

    After doing that, it runs the filters, telling them its result, the original value and the value of strict. If installed, usernames-i18n-fix will be one of those filters. It returns the original username value (that is, with whatever characters were there from the beginning) if not in strict mode. If strict is true, it just replaces repetitions of ‘-‘ with only one ‘-‘.

    So that’s how I read it. But I don’t know if the names really need the sanitazion.

    #54970
    ear1grey
    Member

    In the long run you’ll keep users more friendly if you don’t dictate how they browse. Most people (even my mum) know about tabbed browsing now and know to middle click to open a link in a background tab.

    Also, FWIW, target is not (and never has been) a standard attribute of HTML4 or XHTML, so if you want your pages to validate, avoid it.

    Having said that… :) The Google Analytics plugin for BBPress filters the content and adds stuff to the anchors, so that should help:

    http://boakes.org/download/googleanalytics.txt

    #54902
    macwise
    Member

    Lonemadmax…

    This seemed to do the trick. I looked at the plugin, and I can’t understand any of that crap. It’s only a few lines of code in the plugin, but it seemed to work. As long as there isn’t a reason why I SHOULDN’T just let it run as it was designed to do, then I’ll leave it the way it is.

    Thanks for your suggestion!

    #54911
    AphelionZ
    Participant

    Here’s hoping :)

    #1475
    macwise
    Member

    Anyone know how I might go about adding the target attribute to all <a> elements on my forum? I’d like to keep users there when they are sent to other sites/pages.

    Thanks

    #50894

    In reply to: Validation

    macwise
    Member

    Transitional solves ALL my problems… :)

    #54958
    fel64
    Member

    Hehe, no problem, and glad you like the site. The site came after the pun, if you were wondering … :P

    Not sure what a Jello Mold solution is? All I’ve done is float: lefted the sidebar and float: righted the main content bar. To get the background going all the way down I put them into another div.

    A lot of the work was already done for me, as I started with the Greenflower WP theme, so it wasn’t a great step from that. Glad you like it, though, really :D

    #54957
    macwise
    Member

    That seems to have done the trick. Thanks for posting. I can’t tell you how much searching/testing/wild uncontrollable arm-waving code experimenting I’ve been doing. I did get the WP cookie domain issue figured out, hence the conflict.

    Anyhow, all seems to be in order now, so I am just plum tickled! (no, I don’t normally say ‘plum tickled’. And yes, I really am plum tickled.) So thanks a million to you, fel64, for posting my much needed solution.

    P.S. Checked out your site…I like the look of the “blog” area quite a bit. Loinhead, eh? Funny. Are you using a “Jello Mold” type layout solution for your liquid css layout? Anyway, the site looks great…

    #54956
    fel64
    Member

    You have to add these lines to your bbPress config.php file – not sure who posted it, but it’s not my idea.

    //your try to sync cookies
    $bb->cookiedomain = '.myurl.com';
    $bb->cookiepath = '/';

    You also have to edit WP core files I think.

    wp-settings.php line 190
    FROM
    define('COOKIE_DOMAIN', false);
    TO
    define('COOKIE_DOMAIN', '.myurl.com');

    I’ve got it set up so at http://www.loinhead.net (and forums.loinhead.net) and it works nicely. :)

    #54905
    Null
    Member

    Hmm we need to talk to make this plugin bbmenu compatible :) Still working out some options, but it would be nice if it could detect the menu plugin and if it is add a draggable menu item to it… If not it will ignore this :)

    So it need to check if the table bb_menu excist and then if the memberlist record excist…

    Well I will contact you about this when I sort things out :)

    #54400
    lonemadmax
    Member

    OK, here it is. Notice though that the selection box is added using evil ways. You may be all well and good if you don’t add it, though. More info in the README.

    A few modifications and it will become a nice plugin that saves the user preferred theme in the db and id not annoying (and only works for registered users when logged in). Will that be useful to anyone?

    #54913

    In reply to: Error After Upgrade

    chrishajer
    Participant

    Error 28 is a MySQL out of disk space error:

    Error code 28: No space left on device

    #54877

    In reply to: Template Tags

    chrishajer
    Participant

    I think bbPress is still like the Wild West, and is changing so often that writing the docs would be a waste of time. It’s not super complicated, so if you have a question about how to get a specific piece of data, you can always ask here or grep through the code. There are a lot of knowledgeable people here who are very good at writing plugins. Looking through the plugin code is helpful too.

    Plugins

    Good luck and share what you learn. Thanks.

    #1466
    CMoseley
    Member

    I use aggrss to do syndication of my own website’s RSS feeds to the front page (OncTalk) and I want to be able to do the same thing on my bbPress theme (which is nearly identically to my WordPress theme). I’ve setup integration between the two theme systems, and I know it works becuase all of my WordPress Conditional tags and things I’m using in my bbPress theme are working, but when I put in aggrss, I get this error:

    Fatal error: Call to undefined function: get() in /usr/home/josh/domains/onctalk.com/public_html/wp-content/plugins/aggrss.php on line 127

    When looking up the code on that, I didn’t seen anything blatantly obvious that would cuase a screw up, but im still a beginner at this.

    This is the code around line 127 from aggrss.php:

    (From line 123-131)

    function aggrss($rssurl,$striptags=false,$num=0) {

    global $lastRSS;

    $lastRSS->CDATA= ($striptags) ? “strip” : “content” ;

    $lastRSS->items_limit=$num;

    if ($aggr = $lastRSS->Get($rssurl))

    return $aggr;

    else

    return 0;

    }

    Full view of the code can be found here.

    Any help in getting this fixed/solved would be much appreciated.

Viewing 25 results - 30,951 through 30,975 (of 32,453 total)
Skip to toolbar