Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 31,951 through 31,975 (of 32,410 total)
  • Author
    Search Results
  • #51665
    #51154

    In reply to: Private Forum script

    so1o
    Participant

    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?

    #51151

    In reply to: Private Forum script

    so1o
    Participant

    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');

    #51546
    Null
    Member

    Oke and in what file do I put this? And also where do I put the 1? (1 = forum id)

    Sorry I am noob :)

    #51150

    In reply to: Private Forum script

    Aaron
    Participant

    so1o: does this plugin need to be used with the code posted earlier in this thread, or is it standalone?

    If it is standalone (ment to function on its own) I am not getting any results. I put the plugin into my-plugins and no results. Everything loads as normal.

    Any pointers.

    #51149

    In reply to: Private Forum script

    so1o
    Participant

    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');

    #51480
    ardentfrost
    Member

    The change wasn’t hard, just added an additional check to the SQL query and I apparently saw your post soon after you made it…

    Looks impressive though doesn’t it? You posted a request and 24 minutes later, I filled it? :D

    #51545
    so1o
    Participant

    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")

    #51952
    spencerp
    Member

    Yeah true.. Trent, thanks for clarifying that for everyone, and me! ;) :) :P

    spencerp

    /Me didn’t get to bed yet, so.. my brain is now working in reverse, compared to your’s.. since you got the sleep.. lol!!

    #51951
    Trent Adams
    Member

    Needs to be an option though because with that code in there, it will exclude when most users wouldn’t really need anything excluded. As well, that is only for the sidebar part, not the widget.

    Trent

    #51950
    spencerp
    Member

    This is the block of database code that Trent had “fixed” up for me, to exclude the one forum.

    (Found near end of plugin file)

    function wp_bb_get_discuss_sidebar() {

    global $wpdb,$bbpath;

    $bbtopic = $wpdb->get_results("SELECT * FROM bb_topics WHERE topic_status = 0 AND forum_id NOT IN ('3') ORDER BY topic_time DESC LIMIT 10");

    Where => (‘3’) is the forum id to exclude.. :) ;)

    spencerp

    #51664
    spencerp
    Member

    Nice one!! Hey thomasklaiber, could there be one made up for getting Notifications, on any one’s posts? Example, Me replying here now, to your thread.. (not a favorite).. and you’d get an email on it? Just was curious… :P

    spencerp

    #51844
    spencerp
    Member

    You’re so awesome!! It works!! Thanks a ton!!

    <?php

    /*

    Plugin Name: My Resolve Title

    Plugin URI: https://bbpress.org/forums/topic/338?replies=4#post-1764

    Description: Puts [Resolved] by the thread's title, for threads that are marked as Resolved.

    Author: so1o

    Version: 0.1

    Author URI: http://www.adityanaik.com/forums/

    */

    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');

    ?>

    spencerp

    #51843
    so1o
    Participant

    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');

    #51479
    Trent Adams
    Member

    I put the plugin code under the username. Compare the following code to your post.php in your templates. Make sure you are editing post.php and placing it in /my-templates/post.php.

    <div class="threadauthor">

    <p><strong><?php post_author_link(); ?></strong><br />

    <small><?php post_author_type(); ?></small><br />

    <small><?php post_count(); ?></small></p>

    </div>

    <div class="threadpost">

    <div class="post"><?php post_text(); ?></div>

    <div class="poststuff"><?php _e('Posted:'); ?> <?php bb_post_time(); ?> <a href="<?php post_anchor_link(); ?>">#</a> <?php post_ip_link(); ?> <?php post_edit_link(); ?> <?php post_delete_link(); ?></div>

    </div>

    This is the entire post.php, but obviously where I have the code is near the top.

    Trent

    #51661

    Strange … maybe i should use a download-script :D

    Try this one.

    Did a small fix again and gave the .zip a new name ^^

    Thanks a lot for your patience!

    #51949
    Trent Adams
    Member

    It isn’t put in as an option, (though it would be easy to do), but all it really is, is adding SQL statement to exclude a forum. Maybe a guy should put a plugin code option for number of posts displayed as well as excluding a forum.

    Trent

    #51948
    Atsutane
    Member

    Glad to see someone is using my plugin :) The plugin has been listed before but it gone now, thank’s for re-posting it.

    Maybe u can send me the fix and i add it into the plugin.

    #51842
    spencerp
    Member

    Anyone? Do you think we can get the “file changes” or whatever, to be able to display [Resolved], by the thread’s title, that are marked Resolved? Just was wondering.. ;) :)

    I noticed this in: formatting-functions.php near the end, for [Closed]..

    function closed_title( $title ) {

    global $topic;

    if ( '0' === $topic->topic_open )

    return sprintf(__('[closed] %s'), $title);

    return $title;

    }

    Maybe if there’s a way to add one for [Resolved]… ? lol!!

    spencerp

    #51910

    In reply to: Help with a plugin

    spencerp
    Member

    so1o, you’re awesome! Thanks alot!

    In /index.php, made it like this:

    $topics = get_latest_topics(0,1,3,4,’2′);

    Now the ones from the “Blog Article Discussion” forum, are NOT showing in the “Latest Discussion” section.. :) ;) Thanks again!

    However.. when I did try that plugin option, it deleted ALL the threads, except for the Blog Article Discussion posts.. but, I think that’s because I used the wrong id for the forum.. lol..

    When hovering over the “Blog Article Discussion” forum, it shows as “3” being the “id”.. but, in the admin control panel.. I assigned “2” for it.. so, that’s what the problem was.. Anyway.. she’s working now! Thanks again!!

    spencerp

    #51909

    In reply to: Help with a plugin

    so1o
    Participant

    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

    #51908

    In reply to: Help with a plugin

    spencerp
    Member

    ardentfrost, maybe you can help me..? I’m using the bbPress Post (0.02) by mByte, and with his plugin.. I had made a forum for the blog posts to show up, however.. I would like to make the blog posts, stay ONLY IN the “Blog Article Discussions” forum..

    Instead of them showing up in the “Latest Discussions” part of the forums index page.. And just have ONLY the threads made in the forums, show in the “Latest Discussions” section of the forum.. Is there maybe something that could be done for this?

    I’m basically asking to exclude one of the forums, from the “Latest Discussions” section. Thanks in advanced.. :) ;)

    spencerp

    #51281
    BrendonKoz
    Member

    Since Ahni was interested, and I’ve been itching to do a conversion script to see how easy/hard it can be, I figured I’d chime in. I’m not familiar with either application’s inner workings, but looking at a database and comparing — now that I can get into! :P

    So, technically, I’m only interested to do a direct convert based on what he wants, if I get around to it at all (don’t want to make any promises here). Anyone else would be more than welcome to modify whatever code I write later on. I can make it publically available. Should be pretty simple, I would think.

    #50837

    In reply to: Error for tags.php

    so1o
    Participant

    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..

    #51916
    spencerp
    Member

    Trent, you’re so awesome!! After talking with Trent on GoogleTalk, he has helped me get this problem squashed! And, I had to slap myself twice, because I didn’t upload the bbPress Integration plugin, to my wp-content/plugins folder…

    Thanks again for letting me know that Trent.. as well as the cookiedomain settings you gave above! ;) :)

    spencerp

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