Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 28,551 through 28,575 (of 32,499 total)
  • Author
    Search Results
  • #61931

    In reply to: Excerpts

    livibetter
    Member

    fel64 is right. So I made a change.

    <?php
    // from wp_trim_excerpt() in WordPress 2.3.1 formatting.php, just removed few lines
    function make_excerpt($text) { // Fakes an excerpt if needed
    $text = str_replace(']]>', ']]>', $text);
    $text = strip_tags($text);
    $excerpt_length = 55;
    $words = explode(' ', $text, $excerpt_length + 1);
    if (count($words) > $excerpt_length) {
    array_pop($words);
    array_push($words, '[...]');
    $text = implode(' ', $words);
    }
    return $text;
    }

    if ( $topics ) :
    $last_post_ids = array();
    foreach ( $topics as $topic )
    $last_post_ids[] = $topic->topic_last_post_id;
    global $bbdb;
    $post_ids = $bbdb->get_col( "SELECT post_id, post_text FROM $bbdb->posts WHERE post_id IN (" . implode(',', $last_post_ids) . ")");
    $post_texts = $bbdb->get_col( null, 1 );
    $post_excerpts = array();
    foreach($post_ids as $idx => $post_id)
    $post_excerpts[$post_id] = make_excerpt( $post_texts[$idx] );
    endif;
    ?>
    <?php if ( $topics ) : foreach ( $topics as $topic ) : ?>
    <tr<?php topic_class(); ?>>
    <td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a>
    <?php echo $post_excerpts[$topic->topic_last_post_id]; ?>
    </td>
    <td class="num"><?php topic_posts(); ?></td>
    <td class="num"><?php topic_last_poster(); ?></td>
    <td class="num"><small><?php topic_time(); ?></small></td>
    </tr>
    <?php endforeach; endif; // $topics ?>

    On my test forum, 15 posts, without excerpts takes .119 sec, with excerpts takes .127 sec. Previous code takes .140 sec.

    #61929

    In reply to: Excerpts

    livibetter
    Member

    Replace the similar part with it in front-page.php (Kakumei):

    <?php if ( $topics ) : foreach ( $topics as $topic ) : ?>
    <tr<?php topic_class(); ?>>
    <td><?php bb_topic_labels(); ?> <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a>
    <?php
    // from wp_trim_excerpt() in WordPress 2.3.1 formatting.php, just removed few lines
    function make_excerpt($text) { // Fakes an excerpt if needed
    $text = str_replace(']]>', ']]>', $text);
    $text = strip_tags($text);
    $excerpt_length = 55;
    $words = explode(' ', $text, $excerpt_length + 1);
    if (count($words) > $excerpt_length) {
    array_pop($words);
    array_push($words, '[...]');
    $text = implode(' ', $words);
    }
    return $text;
    }

    echo make_excerpt( get_post_text( $topic->topic_last_post_id ) );
    ?>
    </td>
    <td class="num"><?php topic_posts(); ?></td>
    <td class="num"><?php topic_last_poster(); ?></td>
    <td class="num"><small><?php topic_time(); ?></small></td>
    </tr>
    <?php endforeach; endif; // $topics ?>

    It generates an excerpt of latest reply of topic.

    #61976
    toxicshocktv
    Member

    I’m going to try a fresh reinstall and see if I can get it working, otherwise I’m off to Vbulletin. :(

    #62020

    In reply to: database MINOR issue

    Trent Adams
    Member

    Glad to help ;)

    Trent

    #61974
    Trent Adams
    Member

    Logins and such are best used with default everything until you know they work. Try the default template again and report back any specific things you have going on there. As well, once you start fiddling with integrating with WP in the config.php it will use the WordPress members. Another thing if you don’t have Akismet setup would be to put:

    $bb->akismet_key = false;

    Trent

    Trent Adams
    Member

    #1) This is simple enough as MU is built for that.

    #2) If you are talking about each member having their own bbPress forum as well in #2, I would suggest that would be a massive problem. If you just mean having them using a single forum, I think this can be done.

    #3) Avatars can be down with many plugins you can find in these forums or over at https://bbpress.org/plugins/ . Combining with MU might be a little difficult or require a plugin. I would suggest looking around to see if anyone on MU has come up with a solution already. That or use Gravatar ;)

    #4) Combination of plugins and RSS feed grabbers could do that without very much hassle. What is written already might be sufficient from the plugins area, but a couple different database requests would make new plugins for this quickly I am sure.

    #5) You didn’t have one ;)

    #6) People out there have successfully integrated bbPress and WordPressMU logins, but you might need to search a bit over at http://mu.wordpress.com/forums/ as well for the answer ;) It also depends on your answer to #2 though…..

    #7) You already know the answer and Null helped with the others.

    Trent

    #61927

    In reply to: Excerpts

    Doobus
    Member

    I’m mediocre at best when it comes to php, so I’m a bit confused as to what to call, all I really know are the functions for WordPress, any code suggestions would be greatly appreciated.

    talbina
    Member

    Come on in guys :) .

    #58228

    In reply to: bbSync

    fel64
    Member

    Comment duplication fixed, ns gotten rid of as far as I can tell! o/

    #62016
    Trent Adams
    Member

    The forum theme I put up was also with permission of Matt himself before I even put it up for download ;)

    Trent

    #62015
    Sam Bauers
    Participant

    I believe the theme for this forum is available for download somewhere, it might even be Trent’s theme?

    The GPL doesn’t work that way. The idea of “linking” is very compiler specific terminology, it doesn’t really apply to php scripts calling other php scripts.

    Changing GPL code is OK and you can’t be forced to redistribute it (hand over source), but if you do, the source must be made available and the licensing must remain the same GPL license.

    #61953

    In reply to: i need …

    العاب
    Member

    Hello all …

    I need more :)

    I need to adds description and keywords meta tags for both is_topic and is_forum.

    i was search in this forum i see one plugin but it wasn’t work with 0.8.3

    #62002
    itissue
    Member

    Nevermind. I created a plugin that I can modify anytime I want. Here’s the code if you’re interested. You don’t even need the add image plugin.

    <?php
    /*
    Plugin name: Extra html tags
    plugin author: Sue
    plugin description: Allow extra html tags, even depreciated
    */

    function allow_extra_tags( $tags )
    {
    $tags['a'] = array(
    'href' => array(),
    'title' => array(),
    'rel' => array(),
    'target' => array(),
    'alt' => array()
    );
    $tags['i'] = array();
    $tags['b'] = array();
    $tags['del'] = array();
    $tags['p'] = array(
    'style'=> array()
    );
    $tags['strike'] = array();
    $tags['img'] = array(
    'src'=> array(),
    'alt' => array(),
    'title' => array(),
    'width' => array(),
    'height' => array(),
    'style' => array()
    );
    $tags['font'] = array(
    'style' => array(),
    );
    $tags['br'] = array();
    $tags['h1'] = array();
    $tags['h2'] = array();
    $tags['h3'] = array();
    $tags['h4'] = array();

    return $tags;
    }
    add_filter( 'bb_allowed_tags', 'allow_extra_tags' );
    ?>

    #2701
    itissue
    Member

    I was wondering if there’s a plugin already out there for font size and font color. They should enable the font tag or style=””; in the tags. Also, why can’t we use heading tags such as <h1> or choose an image width and height in our image tags?

    #57589
    itissue
    Member

    I tried what post #2 did but it doesn’t work. I’m not sure why but it doesn’t. If only you can set the width in the <img/> tag.

    #61998
    hishamabu
    Member

    Thank you so much for your response livibetter, but I’m not getting this at all. I’m not a programmer/coder by any stretch of the imagination. My abilities go no further than copy & pasting code.

    With regards to Unix sockets, I’m on a Dreamhost hosting package if that helps at all.

    Can you please tell me how the trac thing work?

    Thank you again.

    #61926

    In reply to: Excerpts

    livibetter
    Member

    If you just call the template functions of WordPress, that won’t work. I meant get the part you need. (sorry for misleading)

    PS. If you still can’t get it work, please paste your code and error message, if any.

    #61986
    Trent Adams
    Member

    That is a beauty! I really like that one and might have to come up with a use for it ;)

    Trent

    #61971
    Trent Adams
    Member

    Change the following:

    $bb->mod_rewrite = 'false';

    to:

    $bb->mod_rewrite = false;

    Trent

    #61961
    jamwol
    Member

    silly me. just download the plugin ;)

    #61921

    In reply to: Replace word in Post

    livibetter
    Member

    I just finished uploading talkPress 002: A Simple bbPress Plugin – Bad Words Filter. You can watch this here.

    The code mentioned in video is:

    <?php
    /*
    Plugin Name: Bad Words Filter
    Plugin URI: http://www.livibetter.com/
    Description: Removing bad words from post content
    Author: Yu-Jie Lin
    Author URI: http://www.livibetter.com/
    Version: 0.1
    */

    function BadWordsFilter($post_text) {
    // $post_text = str_ireplace('bad', '*****', $post_text);

    $bad_words = array('bad', 'topic', 'cialis');
    foreach($bad_words as $bad)
    // $post_text = str_ireplace($bad, '*****', $post_text);
    $post_text = preg_replace("/\b$bad\b/i", '*****', $post_text);

    return $post_text;
    }

    add_filter('post_text', 'BadWordsFilter');
    ?>

    #54810
    itissue
    Member

    Nevermind. I figured it out. I needed a .htaccess file, and it needed to contain this:

    <IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteBase /

    RewriteRule ^forum/([^/]+)/page/([0-9]+)/?$ /forum.php?id=$1&page=$2 [L,QSA]

    RewriteRule ^forum/([^/]+)/?$ /forum.php?id=$1 [L,QSA]

    RewriteRule ^topic/([^/]+)/page/([0-9]+)/?$ /topic.php?id=$1&page=$2 [L,QSA]

    RewriteRule ^topic/([^/]+)/?$ /topic.php?id=$1 [L,QSA]

    RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ /tags.php?tag=$1&page=$2 [L,QSA]

    RewriteRule ^tags/([^/]+)/?$ /tags.php?tag=$1 [L,QSA]

    RewriteRule ^tags/?$ /tags.php [L,QSA]

    RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&page=$2 [L,QSA]

    RewriteRule ^profile/([^/]+)/([^/]+)/?$ /profile.php?id=$1&tab=$2 [L,QSA]

    RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ /profile.php?id=$1&tab=$2&page=$3 [L,QSA]

    RewriteRule ^profile/([^/]+)/?$ /profile.php?id=$1 [L,QSA]

    RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ /view.php?view=$1&page=$2 [L,QSA]

    RewriteRule ^view/([^/]+)/?$ /view.php?view=$1 [L,QSA]

    RewriteRule ^rss/?$ /rss.php [L,QSA]

    RewriteRule ^rss/forum/([^/]+)/?$ /rss.php?forum=$1 [L,QSA]

    RewriteRule ^rss/topic/([^/]+)/?$ /rss.php?topic=$1 [L,QSA]

    RewriteRule ^rss/tags/([^/]+)/?$ /rss.php?tag=$1 [L,QSA]

    RewriteRule ^rss/profile/([^/]+)/?$ /rss.php?profile=$1 [L,QSA]

    </IfModule>

    #61952

    In reply to: i need …

    العاب
    Member

    chrishajer,Thank you!

    1.the FCK wysiwyg editor is very Nice … but how i can install it in my BBpress ?

    2.This sitemap : http://boakes.org/download/bbpress_sitemap.txt

    not working whith 0.8.3

    3.I will try to add this code .

    Thank you agin … By.

    #61951

    In reply to: i need …

    chrishajer
    Participant

    1. You can integrate FCK Editor or TinyMCE if you are looking for a wysiwyg editor.

    http://www.fckeditor.net/

    http://tinymce.moxiecode.com/

    1a. To allow all that type of content, you’re going to need a plugin. Check out this thread:

    https://bbpress.org/forums/topic/plugin-youtube-in-bbpress?replies=18#post-5707

    2. Does the regular sitemap plugin NOT work with 0.8.3? I never tried it. http://boakes.org/download/bbpress_sitemap.txt

    3. To show hot tags, you are going to need to edit the template files for each page, then insert this tag where you want it:

    <p class="frontpageheatmap"><?php bb_tag_heat_map(); ?></p>

     

    Depending on the layout of each of your pages, you might need to create a new div to insert that tag heat map into, or maybe there is room inside an existing div.

    The things you are asking for are going to require a substantial amount of work on your part. It can all be done (probably) but it’s not going to be super quick.

    Good luck.

    #61923

    In reply to: Excerpts

    Doobus
    Member

    I’ve already looked into that as a viable solution, but WordPress’ back-end just complicates things for new users. bbPress is a lot simpler solution in that a forum is built around the idea of community, I’m just theming it not to look like a forum for advertising purposes, everyone knows that the ctr for forums are terrible. Plus I already gutted Kakumei beyond recognition, can’t turn back now :).

    Anyhoo, anyone know of how to put excerpts?

Viewing 25 results - 28,551 through 28,575 (of 32,499 total)
Skip to toolbar