Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 30,926 through 30,950 (of 32,433 total)
  • Author
    Search Results
  • #54965

    In reply to: Users Website in Topic

    Hi, öffne die template-functions.php im bb-includes Ordner und editiere die funktion “post_author_url()”. Such einfach in der Datei nach dieser Funktion.

    Man kann es mit SEO auch übertreiben. Deine User schreiben wertvolle Beiträge (gerade in deinem Bereich ist jede Zeile Gold wert). Lediglich meine Meinung, mach wie du denkst. Hoffe ich konnte behilflich sein :)

    Steven

    #54338
    kirkk
    Member

    I did everything but it is still the same :/

    #54268
    spencerp
    Member

    Hi Sam, I already got SVN access on my spencerp.net domain. :) I just hadn’t did any SVN-ing on the WP blog itself, and the bbPress forums though. I manually uploaded the files, ran install, upgrades when needed..

    But, I guess I could though. Just make my way to the forums/ directory, and do a SVN checkout for bbPress right? Here’s how I usually do my SVN checkouts, into a specific folder:

    svn co http://svn.automattic.com/bbpress/trunk .

    Once I’m done with that, then run the upgrade, right? Then worry about applying the patch for the Forum Categories?

    I never applied a “patch” via the SVN way before, I just want to know step by step, briefly even, how-to do this… Do I just slap in the patch URL.. or.. ? Thanks in advanced…

    spencerp

    #54821

    In reply to: Rewriting URLs

    marky
    Member

    Well, I’ve found the solution! Apparently, ModRewrite doesn’t count the query string as part of the URL, so it needs to be addressed separately. These rules did the trick:

    RewriteEngine On
    RewriteBase /forums/
    RewriteCond %{QUERY_STRING} ^t=([0-9]+)$
    RewriteRule ^viewtopic.php$ /forums/topic/%1 [R,L]

    #54337
    chrishajer
    Participant

    Kirkk: that is what the plugin is supposed to do, I think: turn the slashes around. When you pasted the code into that file, did it have line numbers? You should use the plain text version here:

    https://trac.bbpress.org/attachment/ticket/575/path-to-url.2.php

    Is the my-plugins directory readable (0755 permissions) and the file is readable by the webserver (0644 permissions at least)?

    Also, I don’t know the answer to this question, but should it have the .2. in the file name, or should the file be named path-to-url.php? I don’t know if the filename matters at all. I know there was a version one without the 2 in the filename.

    Keep plugging away. You’ll get it.

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

Viewing 25 results - 30,926 through 30,950 (of 32,433 total)
Skip to toolbar