Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 32,001 through 32,025 (of 32,480 total)
  • Author
    Search Results
  • #51995
    M
    Member

    Awesome, I’ll give it a go.

    Funny you mention your avatar plugin… I saw yours but I wasn’t crazy about the modification of core files, so I wrote my own upload script. It uploads a JPG, GIF, or PNG file under 20kb, with a fixed resolution of 64×64 px. If any of these conditions aren’t met, it spits out an error.

    If your username is UserName, then the file is named username-avatar.gif or whatever image extension is.

    I have a simple detection script for the image in the file post.php. It works for now, but I’d like something a little better. If you’d like a peek at the code just let me know.

    I’m working on a PM system, and a post preview “plugin”… it’s slow going though, as college gets in the way quite a considerable bit.

    Thanks,

    Mike

    #51994
    ardentfrost
    Member

    If you go to bb-includes/functions.php you’ll see a function called “get_profile_info_keys()”

    This function holds the data you want, but you don’t want to adjust that file directly since it’s a core file, however, in the current release of my avatar plug-in, you do have to change that line.

    But if you notice, it says return apply_filters( 'get_profile_info_keys', yadda yadda );

    Anywhere it says “apply_filters” you can make your own.

    So I haven’t done this myself yet, though now that I look closer at it, I think I’m going to rerelease my avatar plugin with this change.

    Make a plug-in file in your my-plugins directory and put this in it:

    add_filter( 'get_profile_info_keys', array('user_email' => array(1, __('Email')), 'user_url' => array(0, __('Website')), 'from' => array(0, __('Location')), 'occ' => array(0, __('Occupation')), etc....

    And just keep adding stuff til you have everything you want. the ‘1’ in the “Email” part means that it’s required during registration. Everything else is 0’s because they are not required fields… you can, of course, change this.

    #51983
    so1o
    Participant

    a small mistake.. its bb_get_header() :)

    cheers!

    #51981
    so1o
    Participant

    there are two things you have to do..

    1. one change the topic tempalte to remove the call to topic_resolved()

      <li id="resolution-flipper"><?php _e('This topic is') ?> <?php topic_resolved(); ?></li>

    2. fix get_views() in the functions.php

      to that just write a plugin to remove the unwanted options from the views

      function my_no_support_views($views) {

      return array_diff($views, array('unresolved' => __('Unresolved topics')));

      }

      add_filter('bb_views', 'my_no_support_views');

    #1042
    ardentfrost
    Member

    I thought the secret to making a new page that is included into the bbpress fileset is to add the require_once('./bb-load.php');

    However, this must not be the secret because it doesn’t let me do stuff like get_header(). On the other hand, it sees my plugin file and gets the information I want from it.

    What am I doing wrong? I have a file dropped into the http root with the require_once and then requiring the work page in my-templates, but nothing inside the my-templates file works (ie. no bbpress functions in the file work).

    #51161

    In reply to: Private Forum script

    so1o
    Participant

    nothing prevents you from doing that… only thing is tomorrow if you change the template you will have to have this code there too..

    if you keep it in a plugin file in the my-plugins dir it will automatically come thru with the new files..

    cheers

    #51979
    so1o
    Participant

    try changing

    $bb->domain = 'http://www.wonderliver.com/bbpress';

    $bb->path = '/';

    to

    $bb->domain = 'http://www.wonderliver.com';

    $bb->path = '/bbpress/';

    #1040
    mkyb14
    Member

    A clean install of .73 with it’s own mysql NO wordpress integration

    After installing everything went fine till after logging in to do anything! The main screen is displaying just fine, but any links clicked after give the cookie issue below… and yes I have looked at the other postings but the all incorporate WP which I’m not. Regardless, I’m not refusing cookies so I’m at a loss as to why it would say this and refuse every other page but the dashboard…

    Thank you for your help, the error is displayed below

    Wonderliver.com/bbpress

    The page isn’t redirecting properly

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete

    * This problem can sometimes be caused by disabling or refusing to accept cookies.


    <?php

    define(‘BBDB_NAME’, ‘bbpress’); // The name of the database

    define(‘BBDB_USER’, ‘*******’); // Your MySQL username

    define(‘BBDB_PASSWORD’, ‘*******); // …and password

    define(‘BBDB_HOST’, ‘************’); // 99% chance you won’t need to change this value

    $bb_table_prefix = ‘bb_’; // Only letters, numbers and underscores please!

    $bb->domain = ‘http://www.wonderliver.com/bbpress&#8217;; // Example: ‘http://bbpress.example.com&#8217;

    $bb->path = ‘/’; // Example: ‘/forums/’

    $bb->name = ‘WonderLiver’;

    $bb->admin_email = ‘admin@gmail.com’;

    $bb->mod_rewrite = false;

    $bb->page_topics = 30;

    $bb->edit_lock = 60;

    $bb->gmt_offset = 0;

    define(‘BBLANG’, ”);

    $bb->akismet_key = false;

    $bb->wp_table_prefix = false; // WordPress table prefix. Example: ‘wp_’;

    $bb->wp_home = false; // WordPress – Options->General: Blog address (URL) // No trailing slash

    $bb->wp_siteurl = false; // WordPress – Options->General: WordPress address (URL) // No trailing slash

    /* Stop editing */

    define(‘BBPATH’, dirname(__FILE__) . ‘/’ );

    require_once( BBPATH . ‘bb-settings.php’ );

    ?>

    #49533
    Trent Adams
    Member

    define('WP_BB', true);

    and

    $bb->wp_home = 'http://www.yoursite.com; // WordPress - Options->General: Blog address (URL) // No trailing slash

    $bb->wp_siteurl = 'http://www.yoursite.com'; // WordPress - Options->General: WordPress address (URL) // No trailing slash

    Hope that helps.

    Trent

    #51730
    spencerp
    Member

    I would love to see something like sub-forums implemented into bbPress earlier in the “game”. I think that would be so awesome. phpBB hasn’t even gotten to that “point” until phpBB3 beta or whatever.. lol!

    I know it might not work, and function extacly like “that”, but.. atleast it’s a start of it.. ;) :)

    spencerp

    #51155

    In reply to: Private Forum script

    topiq
    Member

    where do i have to put this code? in the header.php file? and whats the difference between the first post’s code? can you restrict the user group of a forum with this one?!

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

Viewing 25 results - 32,001 through 32,025 (of 32,480 total)
Skip to toolbar