Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 29,401 through 29,425 (of 32,481 total)
  • Author
    Search Results
  • #59727

    In reply to: plugin: bb-Polls

    mazdakam
    Member

    You should really change the default colors to something compatible with bbPress… it’s easy to change them, but still.

    i agree with i! vey bad color :(

    #59718

    In reply to: plugin: bb-Polls

    _ck_
    Participant

    Installing it will definitely answer all your questions.

    Many answers are yes. The current options near the top will give you an idea.

    I designed it from the start to allow votes on multiple selections or single section – the poll creator can decide.

    bbpress cleans up the topic meta on its own, so if the topic is deleted in theory the meta is deleted (but bbpress doesn’t really delete topics yet, it just flags the differently)

    you can decide if polls close with the topic or not

    you can also decide if the poll is shown on each page of the topic or just the first

    only members can vote – I do not have any plans to implement non-member voting, it defeats the purpose and makes the code much more complex

    Eventually I will do more than horizontal bars which will make a higher load (I am sure I can find an existing easy library). Bars are currently done in pure CSS which makes it lightning fast and completely customisable with colours and even rounded corners with images.

    #59717

    In reply to: plugin: bb-Polls

    Null
    Member

    Some questions:

    Vote, more then 1 option possible option? (max setting like classic (just 1 option possible) 2 options, 3 etc :)

    If a topic is deleted, does it clean-up the poll as well? (since a real deletion isn’t happening in bbPress, this wouldn’t be a problem for now)

    What happends if a poll is deleted? (but topic still excists)

    Who can vote? All? Members?

    If a topic is closed, automaticly close voting aswell?

    Results are in horizontal bars? Perhaps option to show them like a pie (or even vertical bars) :D Even better if a user can choose this when seeing the results:

    Option result 1: ===============

    Option result 2: =====

    Option result 3: =========

    Show as bars | Show as pie

    Would like to see a demo, cause can’t test this at work :(

    Greetz

    #59707
    Sam Bauers
    Participant

    I don’t think your code was correct in any case. But I’m not sure what the correct procedure is.

    Apply the patch in the ticket (or make the changes manually) and try again.

    #59705
    Null
    Member

    So I accedentily discovered a bug? :p Is the rest of my code correct? And how about: on plugin activation? Perhaps it has the same issue?

    #59694
    Sam Bauers
    Participant

    You also need to have the “bb_head” hook in your template head below the enqueue javascript call.

    <?php bb_head(); ?>

    #59492
    skipdaddyo
    Member

    Also in bb-includes/functions.php

    function get_latest_topics – added $now and tweaked $where

    $now = bb_current_time('mysql');
    $where = "WHERE topic_status = 0 AND topic_start_time <= '$now'";

    #59491
    skipdaddyo
    Member

    The names of the inputs on post-form.php are year, month etc

    bb-includes/functions.php

    new_topic becomes

    function bb_new_topic( $title, $forum, $tags = '', $year, $month, $day, $hour, $minute, $second ) {

    and $now

    if ($year == NULL )
    {
    $now = bb_current_time('mysql');
    }
    else
    {
    $now = $year . '-' . $month . '-' . $day . ' ' . $hour . ':' . $minute . ':' . $second;
    }

    bb_new_post becomes the same

    function bb_new_post( $topic_id, $bb_post, $year, $month, $day, $hour, $minute, $second ) {

    and $now is calculated in the same way

    #56380

    In reply to: Plugin: bbMenu 1.1

    Null
    Member

    Hmmm got this error:

    Warning: Invalid argument supplied for foreach() in /home/sites/site116/web/bbpress/my-plugins/bbmenu.php on line 390

    the foreach:

    foreach( $r1 as $rw ) {

    Null

    #2203
    Null
    Member

    Hi,

    There is a hook so that, on plugin deactivation, you can do an action. In my case, I want to drop a table when the plugin is deactivated.

    I can’t seem to get it to work. What am I missing?

    The code:

    function bb_deactivate_bbmenu() {
    bb_register_deactivation_hook( bbmenu.php, 'drop_bbmenu_table' );
    }

    do_action( 'bb_deactivate_bbmenu' . $plugin );

    function drop_bbmenu_table() {
    global $bbdb;

    $query = "DROP TABLE <code>$bbdb->menu</code>";

    $bbdb->query( $query );
    }

    Also where does $plugin come from? Do I need to set it or does it grab the plugin’s name? And same about __file__ I used the plugins php file for this. Is this correct?

    Some help plz

    #58116

    In reply to: bbSync

    fel64
    Member

    Alright. That makes it somewhat more difficult because I cannot tell what functions are called with that hook, but maybe it is possible to find out.

    No post, you say? The mystery deepens.

    Thanks for the phpinfo. Unfortunately OS X is somewhat difficult for me … perhaps I’ll be able to do this at a friend’s house. We shall see.

    Cheers. :)

    #56751

    In reply to: Plugin: Avatar Upload

    LMD
    Participant

    Just to confirm, version 0.8.1 is definitely now available to download — but the same “missing files” problem is still happening, so until it’s fixed, you’ll need to download the contents of the additional-files/my-templates/ and additional-files/avatars/* folders via the svn.

    (* if you’ve already got a copy of the plugin, don’t bother to download the additional-files/avatars/content, it hasn’t changed.)

    #59490
    _ck_
    Participant

    I’d actually make this plugin for you as it doesn’t take much for it to happen – I just wanted to save some time by understanding how you are sending bbpress a predetermined future time and date rather than the current time and date for a new post. I haven’t looked at the core code but I didn’t think it was looking for time/date fields in a new post.

    a quick look shows bb_new_post posting post_time as bb_current_time(‘mysql’) – so it’s not even checking if a different time has been submitted, it’s forcing it to use the time it calculates…

    _ck_
    Participant

    The front page topics plugin was driving me crazy because I really did want to have a different number of topics for the front page, forum pages, view pages, while leaving the posts per topic page alone and not have to hack the core.

    But there is a huge flaw in the fundamental design in that if you force bbpress to see a different number of topics-per-page, it will calculate the last post page entirely wrong, based on the page IT’S ON, vs the destination page.

    ie. front page set to 50 topics, posts-per-topic-page set to 25, last post is #30 on the page -> bbpress will calculate the page number for the last post as PAGE ONE off the front page, because that’s what the topic count is set to for the front page.

    This got me really annoyed so I researched the heck out of it and figured out this trick – it’s nasty but works (for 8.2.1 at least).

    so in config.php you’ve got

    // The number of topics that show on each page.
    $bb->page_topics = 20;

    now you can make a plugin with this, edit each page limit to your heart’s desire (anything without a $limit defined uses the config.php default)

    function custom_topic_limit($limit) {
    switch (bb_get_location()) :
    case 'front-page': $limit=45; break;
    case 'forum-page': $limit=35; break;
    case 'tag-page': break;
    case 'topic-page': break;
    case 'feed-page': break;
    case 'search-page': break;
    case 'profile-page': break;
    case 'favorites-page': break;
    case 'view-page': $limit=50; break;
    case 'stats-page': $limit=50; break;
    case 'login-page': break;
    default: $limit=20;
    endswitch;
    return $limit;
    }
    add_action( 'bb_get_option_page_topics', 'custom_topic_limit' );

    function fix_post_link ($link,$post_id) {
    remove_action( 'bb_get_option_page_topics', 'custom_topic_limit' );
    $bb_post = bb_get_post( get_post_id( $post_id ) );
    $page = get_page_number( $bb_post->post_position );
    return get_topic_link( $bb_post->topic_id, $page ) . "#post-$bb_post->post_id";
    }
    add_filter( 'get_post_link','fix_post_link',10, 2);

    The magic is in fix_post_link where it trashes whatever incorrect calculation that “get_post_link” has now done because of custom topic limits, and relculates it after unhooking the custom_topic_limit.

    No core hacks required!

    #59489
    skipdaddyo
    Member

    template/post-form.php gets a section for normal users

    <?php if ( !is_topic() && !bb_current_user_can('moderate') ) { ?>

    and for mods

    <?php } elseif ( !is_topic() && bb_current_user_can('moderate') ) { ?>

    It’s in this section that I’ve added the year, month, day etc form fields

    Sorry for the time it took to get back to you… Only just fired up my RSS reader…

    I’d decided to kill off my main RSS feed (to get around the RSS visibility issue) and not to sweat over the post/topic count being out by one.

    #59676

    In reply to: OpenID for bbpress

    _ck_
    Participant

    Too bad Google also has it’s own API and doesn’t do openid (yet?)

    But in theory bbpress could be made to use google identities… interesting….

    http://code.google.com/apis/accounts/Authentication.html

    #59658

    In reply to: Caching in bbPress?

    howtogeek
    Member

    We are in perfect sync on that one… having xml-rpc pingbacks in a forum is the most worthless feature idea to ever be thought of. I’ve completely disabled them on wordpress because I don’t think they provide any true value to the reader, and most of them are spam anyway. I’ve written my own simple spam plugin to run in conjunction with Akismet because I was unsatisfied with what I was getting.

    Your idea of the wordpress logins would work if they implemented OpenID in bbPress and had wordpress.com as an openid server. Would actually be a killer feature, I’d think.

    I’ve hacked up my wp-cache2 to allow for more dynamic code to be called on each post. Most of my content is really very static, so I don’t need it to be updated often.

    I’ve never had any issues with it caching the wrong versions though.

    #59657

    In reply to: Caching in bbPress?

    _ck_
    Participant

    Oh I didn’t realize xcache is just an opcode cache. I already use eaccelerator which seems to have zero quirks compared to other solutions. But yeah, any opcode cache for wordpress/bbpress is a must for any active site.

    I already create the sidebar statically across my sites, saves a lot of work and repetition on the db.

    the wp-cache “plugin” has flaws in it’s logic. I noticed that unregistered visitors were getting edit links on posts, not good, even if they couldn’t actually edit. Then it has an exclude feature to keep certain parts dynamic, but you can’t have wordpress calls in those dynamic parts because wordpress isn’t actually loaded, which is the whole point. so it won’t work and gives error (#1 confusion to most people trying to use it)

    In the end, I hacked wp-cache to only cache the RSS feeds which were causing the most requests, yet the most static of all the content. Caching rss feeds on bbpress should be an easy, useful thing too, but then on a forum I highly doubt the use of rss feeds on anything but the latest discussions.

    What really worries me about the 0.84 release is the xml-rpc pingbacks. bbpress is going to become known as the spammers forum of choice with a bad rep, until novices are given an easy option to turn it off, or better yet it’s off by default. I cannot disagree more highly with the entire feature idea. It defeats the entire purpose of a forum. What they are trying to do is have a universal way to cross post across forums but the whole point of a forum is *community* and getting people to actually visit, not stay away.

    What they really should do instead of pingbacks if they want easy cross communication, is have a universal login based on a database at wordpress.com – Basically anyone with a wordpress account could visit your wordpress or bbpress site and instantly post if they wanted as “wp.membername” without having to register again and again. Sure there are security issues to be tackled but it’s better than anonymous spam heaven on pingbacks. Akismet won’t protect pingbacks, I see spam in my wordpress.com account every week.

    #59655

    In reply to: Caching in bbPress?

    Sam Bauers
    Participant

    > I have to eventually code it to store the country data in the usermeta. But there’s the issue that their IP/location can change on a per-post basis

    An upcoming feature is post tagging, you’ll be able to store this data in an “invisible” post tag I believe.

    #59644
    Sam Bauers
    Participant

    Downloadable ZIP of latest trunk is via a link at the bottom of that page.

    The trunk is pretty stable actually, and is more bug free than the latest release usually.

    You are better off setting up a subversion client and “checking out” a copy of the code. You can then keep up-to-date on changes in the core with the click of a button.

    Search the forum for info on using SVN to checkout a copy.

    A lot has changed, the best thing to do is to trawl through the changelog on the Trac site. Only a couple of things have changed dramatically, how views works is one.

    BB_Query is in the latest trunk in bb-includes/classes.php

    #59653

    In reply to: Caching in bbPress?

    _ck_
    Participant

    How do you handle caching a page with items only a moderator should see, and then pages that are okay for subscribers, and then pages that are for open public? The cache will have to be rather smart. And then you can’t show any personal information on the page like the user’s name if it’s going to be cached.

    bbpress still has some non-optimised routines that don’t use the soft cache, for example on the topic page, I’ve noticed it does a query at the end to fetch all the forums names for the moderator “move this topic” tool. Those should definitely be in the cache but it’s not used.

    For a logged out user, I have my topic pages down to 15 queries. That’s the most “expensive page”. It uses 3 more queries for a logged in user (one of them listed above).

    But I’ve got this geoip flag function that I wrote to show country flags and unfortunately it’s very “expensive” and adds an extra query for every unique poster on the topic page. There’s no way to stack requests since it must search by range (researched it like crazy but no solutions). I have to eventually code it to store the country data in the usermeta. But there’s the issue that their IP/location can change on a per-post basis and that sometimes I have to patch the geo information because the db gets it wrong. Oh well.

    #59643
    riddle
    Member

    Thanks, Sam.

    I’m not sure whether to even touch your last suggestion, about using the latest trunk rather than the latest release. I see the trunk code browser at https://trac.bbpress.org/browser/trunk but I don’t know where to find it as one downloadable archive. And surely the trunk has new bugs and unfinished features, which is why it hasn’t been turned into a new release, right?

    Can you give us any hints about what has changed that plugin writers need to know about?

    P.S. Where do I find BB_Query?

    #59642
    Sam Bauers
    Participant

    There are lots of built-in functions for querying the topic meta, they are all in the same place in the code, so searching in the code for the functions I mentioned above will reveal them all.

    Joining tables to create one query is better than using two queries to retrieve the same data. The new BB_Query class could easily handle the query you wrote up there.

    By the way, I suggest you build your plugin against the latest trunk rather than the latest release.

    #59665
    howtogeek
    Member

    I’m probably going to have to create a bunch of new plugins over the next month… of course I’ll post them here for everybody to share =)

    #59664
    citizenkeith
    Participant

    I suppose I should write a plugin for it then.

    I’d certainly welcome it! :)

Viewing 25 results - 29,401 through 29,425 (of 32,481 total)
Skip to toolbar