Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 31,726 through 31,750 (of 32,467 total)
  • Author
    Search Results
  • #52811
    vaelrith
    Member

    thanks :)

    #52810

    I think there is no plugin needed for this. It only requires a small template change in front-page.php.

    Just replace in line 37:

    topic_link();

    with

    echo get_topic_last_post_link($topic->topic_id);

    … I think it should work.

    #1143

    Topic: Plugin: Summon user

    in forum Plugins

    I just made another quick plugin. You can specify a user to be noticed by mail about the recent topic. Read more here:

    http://bbpress.org/forums/topic/458

    To install put the file into your /my-plugins folder and add

    <p>

    <label for="summon_user_id"><?php _e('Summon:'); ?>

    <?php summon_user_dropdown(); ?>

    </label>

    </p>

    behind the last endif; to your /my-templates/post-form.php

    Download here:

    http://la-school.com/2006/downloads/summon_1_0.zip

    merry christmas.

    #1141
    Null
    Member

    Well I’ve created this form but it aint updating the db. What am I doing wrong?

    function update_portal($number_of_topics) {

    global $bbdb, $bb_table_prefix;

    $bbdb->query("UPDATE ".$bb_table_prefix."portal SET number_of_topics = '$number_of_topics'");

    }

    if ($_SERVER['REQUEST_METHOD'] == "POST")

    {

    update_portal($_POST['number_of_topics']);

    }

    // Show form

    function portal_form() {

    ?>

    <h2><?php _e('Management'); ?></h2>

    <form action="" method="post">

    <?php do_action('update_portal',''); ?>

    <h3><?php _e('Portal settings'); ?></h3>

    <table>

    <tr><th scope="row"><?php _e('Number of topics on the portal:'); ?></th>

    <td><input type="text" name="number_of_topics" id="number_of_topics" /></td>

    </tr>

    </table>

    <p class="submit alignleft"><input type="submit" value="Submit" name="submit">

    </form>

    <?php

    }

    Thx

    #50208

    In reply to: About Freshness

    ryuuguu
    Member

    I have not really investigated the what problem in the code is so I am not sure what things should be set to. I set my GMT offset to to get right (+9) and my posts started showing right then changed $hours around until I got freshness right in my case it was -18, but all I can suggest is get the post time right by changing $bb->gmt_offset and then use $hours to bring freshness time into line. This plugin is really only a tempory fix till later beta version bbpress fixes the code properly.

    #1142

    Basically I’m working on a plugin for bbpress that will skip wordpress all together ( no offense wordpress :-) )

    Frankly I think wordpress is too advanced for the average “myspace” type user / target visitor. And, I want to have a community like system like myspace or livejournal.

    So I want to basically add a blog section to bbpress where you can keep a private journal… with privacy options on each blog entry to either Private or Public, and if you select Public it will put it in a Forum as a new topic for people to discuss.

    I was hoping to get a few pointers as to what functions to look at to help me achieve this through bbpress or if I should even continue doing this and try to customize wordpress-mu instead to fit the visitor

    Heres what I have looked at so far:

    1) Add new topic / Write blog

    bb-templates/post-form.php

    ......

    <label for=”forum_id”><?php _e(‘Pick a section:’); ?>

    <?php forum_dropdown(); ?>

    </label>

    <!– DIRT_PRIVACY –>

    Set the privacy:

    <select name=”dirt_privacy” id=”dirt_privacy” tabindex=”6″>

    <option value=”public” selected>Public</option>

    <option value=”private”>Private</option>

    </select>

    <small>**Choose ‘Private’ if you want this to be a blog only readable by you</small>

    <!– END DIRT_PRIVACY –>

    <?php endif; ?>

    <p class=”submit”>

    <input type=”submit” id=”postformsub” name=”Submit” value=”<?php _e(‘Send Post’); ?> »” tabindex=”4″ />

    bb-includes/functions.php -> bb_new_topic();

    function bb_new_topic( $title, $forum, $tags = '' ) {

    // function bb_new_topic( $title, $forum, $tags, $dirt_privacy = ” ) {

    global $bbdb, $bb_cache, $bb_current_user;

    $title = apply_filters(‘pre_topic_title’, $title, false);

    $forum = (int) $forum;

    $now = bb_current_time(‘mysql’);

    if ( $forum && $title ) {

    // if ($dirt_privacy==’public’){

    // ADD AS NORMAL TOPIC HERE (depending on whether ‘adding new topic’ or ‘writting new blog’, determine whether to add as default normal Forum Topic (public) or include in users blog but also as public Blog Forum Topic

    $bbdb->query(“INSERT INTO $bbdb->topics

    (topic_title, topic_poster, topic_poster_name, topic_last_poster, topic_last_poster_name, topic_start_time, topic_time, forum_id)

    VALUES

    (‘$title’, $bb_current_user->ID, ‘{$bb_current_user->data->user_login}’, $bb_current_user->ID, ‘{$bb_current_user->data->user_login}’, ‘$now’, ‘$now’, $forum)”);

    $topic_id = $bbdb->insert_id;

    if ( !empty( $tags ) )

    add_topic_tags( $topic_id, $tags );

    $bbdb->query(“UPDATE $bbdb->forums SET topics = topics + 1 WHERE forum_id = $forum”);

    $bb_cache->flush_many( ‘forum’, $forum_id );

    do_action(‘bb_new_topic’, $topic_id);

    return $topic_id;

    //} elseif ($dirt_privacy == ‘private’) {

    // ADD TO DB AS PRIVATE BLOG HERE

    //}

    } else {

    return false;

    }

    }

    Sorry if I’m a bit confusing as I am a bit confused right now :-)

    Again, any functions/documentation/help I should look at would be appreciated.

    -BHensley.com

    -Bakedlog.com

    #52195
    weirdtherapy
    Member

    the easiest way would be a link to a zip to download it I think :)

    I just tried to piece it together with the information from the sourcecode … and I think it might be done, but for me it looked easier to build it new.

    The CSS file as jonlandrum metioned would be a start for it, but it’s still a bit of work to do because it doesn’t use all the same id’s (like rap instead of wrapper).

    #50206

    In reply to: About Freshness

    ryuuguu
    Member

    I wrote a quick plugin to correct this it is at

    http://www.ryuuguu.com/wordpress/2006/12/22/correcting-bbpress-freshness-1/

    you will need to edit

    $hours=-18;
    [code]
    to find the right number for your offset

    [code]

    $hours=-18;

    to find the right number for your offset

    [code]

    to find the right number for your offset

    #52785
    cgavin
    Member

    Right, cant fix the timezone as I have no idea what time zone it is in. Its 3000 miles away.

    Cant be bothered with this – clicking a topic redirects me to my WordPress homepage? Eh?

    Then it says the admin user I created and logged in as 10 mins ago doesnt exhist anymore. Riight.

    Think I’ll stick with something more mature.

    See you when bbpress gets there init. ;)

    Thanks again, but I dont have anymore time to waste ..

    I just spunked 3 hrs on this! Thats more than enough ..

    #52784
    cgavin
    Member

    Fun fun fun.

    :)

    #52783
    chrishajer
    Participant

    Also, the config.php editing thing was addressed for version .74 here:

    https://trac.bbpress.org/ticket/477

    <strong>Description</strong>

    There are many common errors made when editing config.php.

    We can check for these errors prior to installation refuse to install if things are out of whack.

    It’s not an install script, but it does at least validate the config. It won’t prevent the errors but it will catch them.

    #52791
    chrishajer
    Participant

    I have WP and bbPress integrated and have no problem logging in as admin in WP then also being admin in bbPress. I have the opposite problem (not really a problem): when I log into bbPress as a normal user, and I try to access wp-admin, it gives me an error about not having sufficient permissions. In wp-admin > users, I edited the permissions for the “normal” bbPress user, and he can act as admin at WP now. Never tried to admin bbPress as that user…

    I think it’s probably something else: I did not require the hack you are suggesting to make this work.

    In bbPress, does it say:

    Welcome, admin! View your profileĀ» (Admin | Logout)

    up top?

    If it does, clicking the Admin link there will take you to the bbPress dashboard. Is that not happening for you?

    #52780
    cgavin
    Member

    Nevermind, I fixed it.

    Just kidding.

    I hate it when people dont post how. :)

    I left a ‘ in there after editing the config. It was unattached to anything.

    Hence the error.

    Again ^ re-iterating my suggestion that you take away the config editing at least superficially (ie you can if you really must) and have it as fields in a PHP form so you cant f*** it up.

    #1140
    #52778
    cgavin
    Member

    I took the config down because it was publishing the entire file before the function error – ie all my passwords were freely advertised! :)

    Anyway I tried again with a fresh config:

    http://www.cjgavin.com/bbpress/bb-admin/install.php

    Parse error: syntax error, unexpected T_VARIABLE in /home/virtual/site122/fst/var/www/html/bbpress/config.php on line 53

    Better than undefined function. :)

    (line 53) $bb->wp_home = ‘http://www.cjgavin.com&#8217;; // WordPress – Options->General: Blog address (URL) // No trailing slash

    Whats wrong with that??

    Lines 52 > 54:

    $bb->;wp_table_prefix = ‘wp_;’

    $bb->;wp_home = ‘http://www.cjgavin.com&#8217;;

    $bb->;wp_siteurl = ‘http://www.cjgavin.com&#8217;;

    #52777
    chrishajer
    Participant

    When I go here:

    http://www.cjgavin.com/bbpress/

    I get this:

    There doesn't seem to be a config.php file. I need this before we can get started. Open up config-sample.php, fill in your details, and save it as config.php.

    Did you rename config-sample.php to config.php?

    When I try to load config-sample.php directly, I get this error:

    Parse error: syntax error, unexpected ':' in /home/virtual/site122/fst/var/www/html/bbpress/config-sample.php on line 53

    Maybe that colon is related to one of the wp_ URL lines (URLs must be quoted.)

    Hang in there: you’re close.

    #52773
    chrishajer
    Participant

    I wonder if the problem with this line:

    bb_get_user($bb_post->poster_id)->user_login

    is related to this style syntax and could be fixed in a similar manner (if necessary):

    https://bbpress.org/forums/topic/401?replies=42#post-2140

    #52772
    chrishajer
    Participant

    Update: the above was working, but on the command line, php -l complained:

    parse error, unexpected T_OBJECT_OPERATOR in … that line

    I got this to work:

    <?php _e(' by ') ?><a href="<?php user_profile_link($bb_post->poster_id); ?>"><?php echo get_user_name($bb_post->poster_id); ?></a>

    That’s what was suggested initially: I’ m not sure what I did wrong the first time around, but this is what is working now, with no parse errors. Thanks.

    #52771
    chrishajer
    Participant

    <?php _e(' by ')?><?php echo bb_get_user($bb_post->poster_id)->user_login ?>

    Returns the user’s name. Perfect. Thanks.

    #52768
    ardentfrost
    Member

    Try this

    echo bb_get_user($bb_post->poster_id)->user_login

    Or you can try to do it the way topics do it and just use this:

    post_author_link();

    That will also return the name as a link to their webpage.

    Worth a try I guess.

    #52767
    chrishajer
    Participant

    bb_get_user($bb_post->poster_id) also did not work (does not error, just shows no output.)

    also

    $bb_post->poster_id does not return anything either.

    #52766
    chrishajer
    Participant

    That does not work :)

    Here is the code I am using:

    <?php foreach ( $recent as $bb_post ) : ?>

    <li><a href="<?php post_link(); ?>"><?php topic_title($bb_post->topic_id); ?></a><small> <?php _e('Posted') ?> <?php echo date(__('F j, Y, h:i A'), bb_get_post_time()); ?><?php _e(' by ')?><?php get_user_name($bb_post->poster_id) ?></small>

    seems like it should work. It doesn’t error out, it’s just blank after the ” by “

    Is there a list of functions, similar to the WP codex, where I could learn about them?

    Thanks.

    #52765
    ardentfrost
    Member

    You should be able to do this:

    get_user_name($bb_post->poster_id)

    Tell me if that doesn’t work.

    #52774
    ardentfrost
    Member

    Not a bad idea. It doesn’t seem like it’d be too hard, and I think you could probably gank a lot of the post notification code someone else wrote to do it.

    #1135
    chrishajer
    Participant

    I’ve modified search.php a bit to make the results a little more readable (to my eye) and I was wondering how to get the poster name, to display with the results for recent posts and relevant posts.

    I would like to display something like:

    <a href="<?php post_link(); ?>"><?php topic_title($bb_post->topic_id); ?></a> <small><?php _e('Posted') ?> <?php echo date(__('F j, Y, h:i A'), bb_get_p

    ost_time()); ?></small> [BY MEMBER]

    the [BY MEMBER] part, to get the name of the member who made the post that is listed is the part I need help with. Thank you.

Viewing 25 results - 31,726 through 31,750 (of 32,467 total)
Skip to toolbar