Olaf Lederer (@finalwebsites)

Forum Replies Created

Viewing 25 replies - 76 through 100 (of 203 total)
  • In reply to: Plugin suggestions

    @finalwebsites

    Participant

    @_ck_

    I worked on the wp-syntax plugin but it doesn’t parse the code :(

    do you have an idea what’s missing?

    function allow_syntax_tag($tags) {
    $tags['pre'] = array('lang' => array(), 'line' => array(), 'escaped' => array(), 'style' => array(), 'width' => array());
    return $tags;
    }
    add_filter('bb_allowed_tags', 'allow_syntax_tag');

    include_once("geshi/geshi.php");

    if (!defined("BB_PLUGIN_URL")) define("BB_PLUGIN_URL", bb_get_uri() . "/my-plugins");

    function wp_syntax_head()
    {
    $css_url = BB_PLUGIN_URL . "wp-syntax/wp-syntax.css";
    echo "n".'<link rel="stylesheet" href="' . $css_url . '" type="text/css" media="screen" />'."n";
    }

    function wp_syntax_code_trim($code)
    {
    // special ltrim b/c leading whitespace matters on 1st line of content
    $code = preg_replace("/^s*n/siU", "", $code);
    $code = rtrim($code);
    return $code;
    }

    function wp_syntax_substitute(&$match)
    {
    global $wp_syntax_token, $wp_syntax_matches;

    $i = count($wp_syntax_matches);
    $wp_syntax_matches[$i] = $match;

    return "nn<p>" . $wp_syntax_token . sprintf("%03d", $i) . "</p>nn";
    }

    function wp_syntax_line_numbers($code, $start)
    {
    $line_count = count(explode("n", $code));
    $output = "<pre>";
    for ($i = 0; $i < $line_count; $i++)
    {
    $output .= ($start + $i) . "n";
    }
    $output .= "</pre>";
    return $output;
    }

    function wp_syntax_highlight($match)
    {
    global $wp_syntax_matches;

    $i = intval($match[1]);
    $match = $wp_syntax_matches[$i];

    $language = strtolower(trim($match[1]));
    $line = trim($match[2]);
    $escaped = trim($match[3]);
    $code = wp_syntax_code_trim($match[4]);
    if ($escaped == "true") $code = htmlspecialchars_decode($code);
    //$code = clean_pre($code);// new
    $geshi = new GeSHi($code, $language);
    $geshi->enable_keyword_links(false);
    do_action_ref_array('wp_syntax_init_geshi', array(&$geshi));

    $output = "n<div class="wp_syntax">";

    if ($line)
    {
    $output .= "<table><tr><td class="line_numbers">";
    $output .= wp_syntax_line_numbers($code, $line);
    $output .= "</td><td class="code">";
    $output .= $geshi->parse_code();
    $output .= "</td></tr></table>";
    }
    else
    {
    $output .= "<div class="code">";
    $output .= $geshi->parse_code();
    $output .= "</div>";
    }

    $output .= "</div>n";

    return $output;
    }

    function wp_syntax_before_filter($content)
    {
    $content = preg_replace_callback(
    "/s*<pre(?:lang=["']([w-]+)["']|line=["'](d*)["']|escaped=["'](true|false)?["']|s)+>(.*)</pre>s*/siU",
    "wp_syntax_substitute",
    $content
    );
    return $content;
    }

    function wp_syntax_after_filter($content)
    {
    global $wp_syntax_token;

    $content = preg_replace_callback(
    "/<p>s*".$wp_syntax_token."(d{3})s*</p>/si",
    "wp_syntax_highlight",
    $content
    );

    return $content;
    }

    $wp_syntax_token = md5(uniqid(rand()));

    // Add styling
    add_action('bb_head', 'wp_syntax_head');

    // We want to run before other filters; hence, a priority of 0 was chosen.
    // The lower the number, the higher the priority. 10 is the default and
    // several formatting filters run at or around 6.
    add_filter('post_text', 'wp_syntax_before_filter', 0);

    // We want to run after other filters; hence, a priority of 99.
    add_filter('post_text', 'wp_syntax_after_filter', 99);

    @finalwebsites

    Participant

    just example code…

    header.php (the two divs between body and wrapper)

    <body id="<?php bb_location(); ?>">
    <div style="position:relative;width:1200px;border:1px solid red;margin:0 auto;">
    <div style="width:120px;left:0;top:200px;position:absolute;height:600px;background-color:yellow;"></div>
    <div id="wrapper">

    footer.php (the div before the action)

    </div>
    </div>

    <?php do_action('bb_foot'); ?>

    </body>
    </html>

    I checked this only i firefox (Ubuntu) and of course the header background image is only between the new container (put the background into the body style.

    @floor97,

    before you’re able to tweak themes you need to know some CSS

    @finalwebsites

    Participant

    @dragunoff, upgrade to the latest bbpress version :)

    @finalwebsites

    Participant

    Hi, to place an ad box like this you need to tweak the existing theme.

    Try to open an extra div container inside the header tpl file and close the container inside the footer tpl.

    inside this container you can place the forum plus a banner (of course you need to change some css code)

    EDIT: btw adsense doesn’t have a great CTR for forums

    @finalwebsites

    Participant

    There are several topic about custom fields, try a search and check this one:

    https://bbpress.org/forums/topic/plugin-allow-additional-or-custom-profile-fields

    @finalwebsites

    Participant

    or try some other free hosting with php/mysql enabled

    @finalwebsites

    Participant

    right login form is a function and the register form is a complete page.

    there is also a login page. The function login form is used inside the header template

    @finalwebsites

    Participant

    I think you need more since there are sites providing buddypress+wordpress+bbpress ;)

    success with your free hosting site

    @finalwebsites

    Participant

    Sure step over to SMF if you like to have:

    – more spam

    – more plugins (to get it working as a forum should work)

    I never tried to use bbpress with wordpress, but I’m sure that both are able to work together (based on the same script)

    @finalwebsites

    Participant

    lol there are thousands I guess … (check the footer: Powered by vBulletin®)

    @finalwebsites

    Participant

    Somewhere I read that Matt Cutts said that keyword rich URL’s are better (sorry cannot find that site)

    but there is more than the URL, try this SEO plugin:

    http://www.finalwebsites.com/bbpress/bbpress-seo-tools.php

    @finalwebsites

    Participant

    how about canonical links like suggested by Google?

    http://googlewebmastercentral.blogspot.com/2009/02/specify-your-canonical.html

    In reply to: Hooks & Filters Docu

    @finalwebsites

    Participant

    no that is link is Okay, but his server is hacked :)

    In reply to: css problem

    @finalwebsites

    Participant

    might be changed in my own sheet, but this is the class:

    #latest th, #forumlist th, #favorites th {
    text-align: left;
    background-color:#666666;
    font: 11px Arial, Helvetica, sans-serif;
    font-weight: normal;
    padding: 5px 9px;
    color:#fff;
    white-space: nowrap
    }

    @finalwebsites

    Participant

    bbpress registrations via facebook connect is not so strange, but there is no plugin at the moment, check facebook connect plugin from wordpress, maybe you can change it that it works.

    btw. that would be a great feature.

    In reply to: Managing Favorites

    @finalwebsites

    Participant

    Subscribe to the RSS feed in Google reader ;)

    I thought long about to have a function like in other forum scripts, but these days RSS is the way how to do it.

    I wrote an article about:

    http://www.finalwebsites.com/forums/topic/how-to-subscribe-to-topics-from-a-bbpress-forum

    @finalwebsites

    Participant

    start with the header and footer, keep the “middle part” as it is.

    if you can modify create themes for WP, than it’s not so hard to do the same for bbpress

    @finalwebsites

    Participant

    that’s a great number! I’m sure that bbpress will become more popular…

    @finalwebsites

    Participant

    hehe, I like my plugin very much, most of all if I get a notification mail about a new spam thread and that one was already filtered by Akismet :D

    In reply to: RSS feed for user

    @finalwebsites

    Participant

    this feed is not standard in bbpress, but maybe it’s quite easy to add this function (will check this tomorrow)

    In reply to: jquery @ global header

    @finalwebsites

    Participant

    bb_active_theme_uri()

    Maybe you need to use a function as dirname() or other URL function to get the directory string

    @finalwebsites

    Participant

    Hi,

    I used the almost the same version before for bbpress 0.9, it’s just the one important change for old users upgraded to 1.0. Just try it or better upgrade to bbpress 1.02

    @finalwebsites

    Participant

    I’m using a WP plugin for my blog, can’t imagine it would be that difficult…

    https://wordpress.org/extend/plugins/wp-facebookconnect/

    The connect button is automatically added to the registration page and a user is created.

    These two things need some modifications I guess

    @finalwebsites

    Participant

    @Nightgunner5,

    so you can use a wildcard here?

    glob( BB_PATH . 'avatars/' . $current_user->user_login . '.*' )

    after 6 years of php programming I found this function, thanks :)

    @finalwebsites

    Participant

    Great than it’s time to change that :)

Viewing 25 replies - 76 through 100 (of 203 total)