so1o (@so1o)

Forum Replies Created

Viewing 25 replies - 126 through 150 (of 151 total)
  • In reply to: Private Forum script

    so1o
    Participant

    @so1o

    this is a plugin.. create a something.php in the plugins directory and drop it in there..

    the plugin will not restrict user on a forums basis..


    so1o
    Participant

    @so1o

    <?php

    foreach($forum_one_topics as $topic) :

    $forum_one_topic_posts = get_thread( $topic->topic_id);

    ?>

    <?php topic_title(); ?><br/>

    <?php

    echo $forum_one_topic_posts[0]->post_text;

    endforeach;

    ?>


    so1o
    Participant

    @so1o


    so1o
    Participant

    @so1o

    sorry Null .. but this is the core code.. that will give you the topics..

    you will have to write a loop to display the topics eg:

    $forum_id = 1;

    $forum_one_topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id ORDER BY topic_time DESC LIMIT 0,10")

    foreach($forum_one_topics as $topic) :

    ?>

    <a href="<?php topic_link(); ?>"><?php topic_title(); ?></a>

    <?php

    endforeach;

    again: i warn watch where you put it. there are a lot of global variables. dont put in place where you are displaying other topics and stuff


    so1o
    Participant

    @so1o

    As you can see in the sql.. you have not defined your $forum_id.. before you call the sql define $forum_id which is the id of the forum for which you want to display the topics..

    let me know

    In reply to: Private Forum script

    so1o
    Participant

    @so1o

    i think this would be safer option..

    function my_check_private_forum() {

    global $bb;

    $login_page = $bb->path . 'bb-login.php';

    if (!bb_is_user_logged_in() && $_SERVER['PHP_SELF'] != $login_page) {

    header('Location: ' . $bb->domain . $bb->path . 'bb-login.php');

    }

    }

    add_action( 'bb_init', 'my_check_private_forum');

    any thoughts?.. any one?

    In reply to: Private Forum script

    so1o
    Participant

    @so1o

    but i find some problem when we long in my forum chases its tail on the login.php form.. do you find that problem?


    so1o
    Participant

    @so1o

    you can put this where you want to display the 10 topics from the forum.. if you want to display it on frontpage then you put it in template for frontpage…

    note that the variable names will need to be changed as there are lot of global variables by the same names.. give some unique variable names

    In reply to: Private Forum script

    so1o
    Participant

    @so1o

    i would think it is standalone..

    are you sure you aren’t logged in.. it would redirect the user to login.php if he isnt logged in. if you are logged in it would load normally

    also check the bb-settings.php file.. check what is the name of the hook for initialization. as i mentioned the hook name was changed from init to bb-init.

    if the bb-settings file has this

    do_action('init', '');

    then change the last line of the plugin to

    add_action( 'init', 'my_check_private_forum');

    In reply to: Private Forum script

    so1o
    Participant

    @so1o

    here is the plugin..

    please note that the bb hook for initialization was change after the blix release (0.73). it was changed from ‘init’ to ‘bb_init’

    function my_check_private_forum($test='') {

    global $bb,$bb_current_user;

    $login_page = $bb->path . 'bb-login.php';

    if ($_SERVER['PHP_SELF'] != $login_page) {

    if ( !$bb_current_user ) {

    header('Location: ' . $bb->domain . $bb->path . 'bb-login.php');

    }

    }

    }

    add_action( 'bb_init', 'my_check_private_forum');


    so1o
    Participant

    @so1o

    you can use this

    $topics = get_latest_topics( $forum_id);

    but this will give you number of topics/page that you set in your config

    to get just 10 topics from the forum

    $topics = $bbdb->get_results("SELECT * FROM $bbdb->topics WHERE forum_id = $forum_id ORDER BY topic_time DESC LIMIT 0,10")


    so1o
    Participant

    @so1o

    Hey Spencer

    create a plugin with this code.. that should do the trick.. i think..

    function my_resolve_title($id){

    global $topic;

    if ('yes' == $topic->topic_resolved)

    return sprintf(__('[resolved] %s'), $topic->topic_title);

    return $topic->topic_title;

    }

    add_filter( 'topic_title', 'my_resolve_title');

    In reply to: Help with a plugin

    so1o
    Participant

    @so1o

    cheers

    In reply to: Help with a plugin

    so1o
    Participant

    @so1o

    Spencer

    two ways..

    1) edit /index.php

    change line 12 to

    $topics = get_latest_topics(0,1,'x');

    where x is the forum id of the ‘Blog Article Discussions’ forum

    2) plugin

    create a file named my-own-blog-forum-filter.php plugin in the my-plugins directory.. or any name you want.. and have the following code in it

    <?php

    function my_frontpage_forum_filter($where) {

    $where .= " AND forum_id NOT IN ('x') ";

    }

    add_filter('get_latest_topics_where', 'my_frontpage_forum_filter');

    ?>

    again replace x with the forum id that you need

    In reply to: Error for tags.php

    so1o
    Participant

    @so1o

    double check the $bb->domain and $bb->path variables..

    make sure you have the latest code..

    disable any plugins you have… specially if they have a filter applied to bb_tags.php

    also do you have custom templates or have you modified templates..

    In reply to: Error for tags.php

    so1o
    Participant

    @so1o

    richard can you give some more info on the installation..

    may be the config info, permalink/rewrite status


    so1o
    Participant

    @so1o

    try this

    <div class="the_content">

    <?php $blogposts = get_thread( $topic->topic_id); ?>

    <?php echo $blogposts[0]->post_text; ?>

    </div>

    In reply to: Importing from vanilla

    so1o
    Participant

    @so1o

    vanilla has rss feeds


    so1o
    Participant

    @so1o

    thanks!


    so1o
    Participant

    @so1o

    I have written a plugin to search the wp posts from bbpress search.

    you can find the details here

    http://www.adityanaik.com/projects/plugins/wp-search-from-bbpress/


    so1o
    Participant

    @so1o

    with the change set 554 you can now create a function to sort the tags in array as you like and add a filter to sort_tag_heat_map

    add_filter('sort_tag_heat_map', 'your_custom_sorting_function')

    In reply to: Post Via URL?

    so1o
    Participant

    @so1o

    i havent seen post thru url but i think the bookmarklet to post a new topic is like the one you have up here..

    if you want to prepopulate the title and the content, you can create a template for the post-form.php in my-template directory and then change the template the print the url variables.


    so1o
    Participant

    @so1o


    so1o
    Participant

    @so1o

    the easiest way right now is to change the function tag_heat_map()

    change the line

    uksort($counts, 'strnatcasecmp');

    to

    asort($counts); //or

    arsort($counts); //reverse

    may we should have a filter in the function make it pluggable..

    In reply to: search whole site

    so1o
    Participant

    @so1o

    you can change the template to replace the standard search function by a google search and give three radio buttons one with root, one with the forum and the third with www

Viewing 25 replies - 126 through 150 (of 151 total)