Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 31,951 through 31,975 (of 32,419 total)
  • Author
    Search Results
  • #51555
    ardentfrost
    Member

    you can do

    echo get_user($topic->topic_last_poster);

    EDIT:

    Oops, better way

    echo $topic->topic_last_poster_name;

    #51554
    Null
    Member

    Perfect thank you so much

    One more question, this way I can also add things like topic_poster right?

    Can you give me one more excample of how to add the topic poster to this code as well? I think I get the hang of this and can figure things like topic_time etc out myself if I get that last part I asked!

    Greetz

    #51553
    so1o
    Participant

    <?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;

    ?>

    #51552
    Null
    Member

    Made some changes, but this works:

    <?php

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

    <?php foreach($forum_one_topics as $topic) :

    ?>

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

    <?php endforeach; ?>

    but it doesnt show the typed text only the title of the forum. What to add to also show the typed text (NOT the replies ofcourse)

    Many thx

    #51551
    so1o
    Participant

    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

    #51550
    Null
    Member

    Ow I forgot the forum_id…

    K I now have this in frontpage.php:

    <?php

    $forum_id = 1;

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

    This takes away the error but doesn’t display anything either..

    Greetz The Noob :)

    It can be done by a plugin, using the actions bb_new_user and extra_profile_info.

    But the problem would be, that an random password must be generated (no access to tweak insert-function) and then updated to the password the user has chosen. The the user would receive an email with his random password and not with his chosen password. This isn’t cool :(

    Does somebody know, if there is a plugin-way to overwrite/rewrite a whole function (like bb_new_user();)?

    #51667
    spencerp
    Member

    You’re awesome thomasklaiber!! Thanks so much!! :) ;) Once I get my new domain name situated and stuff, Im going to install it.. thanks again!

    spencerp

    #51666

    For english version, you have a typo. Favorite vs. Favorit

    I don’t really know whats right …? (Pupil from Germany O_o)

    #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!

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