Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 21,251 through 21,275 (of 32,495 total)
  • Author
    Search Results
  • #88409
    Rich Pedley
    Member

    Updated to 0.9.1

    profile page: can’t use anything but text or checkbox, so I used 2 checkboxes, but would have preferred select, or radio. (yes you can add a single radio button, but a single one is of no use!)

    utilised the query, thanks.

    decided that if number of deleted posts is greater than number of valid posts then they should be checked. Though it might be better to add in a bit of math there.. thoughts? validposts / 4 perhaps.

    also if spam posts are greater than 1 they get checked as well.

    But that part may actually be redundant because they are being checked anyway at that point, or do I have the flow wrong?

    Once they hit the required number of posts they the always trust flag is set.

    Commented the code, which is a first for me…

    and hopefully it still works.

    1 question – is there an uninstall hook to clear things from the database? I wouldn’t want to do it on deactivation – hate plugins that lose settings because of that.

    #88319

    Wasn’t BBXF abandoned _ck_ ?

    I’m going on memory rather than fact here (so am happy to be wrong), but wasn’t the last bbxf bit of code added before or around the time that bbPress0.9 came out?

    It may still work (fingers crossed), but I’ve not seen anyone mention it here in a good 18 months.

    #88407
    _ck_
    Participant

    Your code is very decent so keep writing :-)

    You have the status right.

    WordPress finally has an admin menu generator? Good to hear.

    Sadly I’ve lost touch with the WP codebase since 2.5 or so, I was getting really turned off by the bloat.

    _ck_
    Participant

    The problem is every website has different needs.

    Some have only 10 visitors a day but the site operator wants every feature including the kitchen sink. They don’t care if it takes several seconds for their page to render as long a they have every fancy feature available and they can just use wp-super-cache to deal with the load.

    But other sites have thousands of visitors a day and when a page takes too much cpu time or mysql time to render, then you multiply that by hundreds of simultaneous connections. Then you fail and your host kicks you off or you have to buy a bigger server.

    WordPress started lean and mean, 1.5 was good, 2.0-2.1 was a great product. Then they started throwing in the kitchen sink. Then with every next release started breaking compatibility with every release, changing cookies, changing admin structure. 3.0 is a scary creature indeed.

    There is no doubt in my mind that a bbPress plugin under WordPress is going to require 1 megabyte of code executing per instance with plugins in a realistic environment. The site operator with 10 visitors per day won’t care because they have every feature the could want in one package. The operator with an active, growing user based is going to have to constantly upgrade their server to handle the problem.

    Active forums don’t deal well with caching, unlike blogs.

    Blogs are write once, read many times.

    Forums are write many times, read many times.

    Different environment, different needs.

    But performance should always be designed into software.

    #88406
    Rich Pedley
    Member

    [edit: thanks for the feedback ;)]

    Yeah, the option settings is a pain, they finally added that into WordPress, so I’m hoping it’ll be added into bbPress as well at some point. I copied the form from akismet, thought that way I’d get it right first time ;)

    And yes I did use that, nice starting point – hadn’t realised what was being passed to the trusted (must have missed that part). So yeah that’s trivial enough to add in.

    One reason I didn’t add in the trusted was that I totally missed it after intending to put it in! This was due to my not being able to add a user profile field in the form of a select. So I’ll re visit that and see if I can utilise radio buttons instead.

    Wasn’t sure what post_status were… so is it:

    0 for standard posts, 1 for deleted and 2 for spam ?

    I’ll work on it …

    I’ve released a few WordPress plugins (and have loads of small unreleased ones), I’m not saying I’m good, but have experience. Plus it is why I have moved back to bbPress after years of using other forums, I should be able to code plugins for it!

    #88405
    _ck_
    Participant

    Very nice! Welcome to the world of bbPress plugin authorship!

    I see you jumped on my suggestion from the other day about trusted users.

    Isn’t it crazy how it just takes 10 lines to do the actual process but 100 more for the admin menu? This is why I hate admin menus, lol.

    Some performance pointers:

    Scanning the table for the user post count is non-trivial (you can only use one index at a time in mysql and you are already using poster_id and post_status so there’s a scan somewhere). So once you know to trust the user (unless they are set to “never trust”) might as well save that in meta and let them by the next time without a scan.

    Also, you don’t appear to be looking at the already trusted status being given to the filter. If $trusted is already set true, don’t even bother with the rest as it’s probably admin or mods.

    Here’s a feature idea:

    instead of just counting post_status=0, why not gather the counts for all the status

    $bbdb->get_results("SELECT post_status,count(*) as count FROM $bbdb->posts WHERE poster_id = $user_id GROUP BY post_status ORDER BY post_status");

    Then you’ll know status 0, 1 and 2

    2 should be empty, not even set for virtually any approved user.

    If they have one, or more than one post status 2, then they should not be trusted.

    Optionally they have a very high status 1 count in comparison to 0, something is up with that because it’s a bunch of deleted posts, so maybe not trust them either.

    ps. another trick I use it to check if the user can ‘throttle’. If they can, they are already trusted in a sense because they are being allowed to post as fast as they want.

    pps. Don’t forget you can also examine the membership age of the user, here’s a hint, it’s in user_registered

    floor((time()-bb_gmtstrtotime( $user->user_registered ))/86400)

    should be the age in days

    _ck_
    Participant

    paulhawke, there is nothing “clean” about wordpress design. The code may have been cleaned up over time, but the result after 5+ years is there is a ton of code.

    But the critical part is it loads EVERYTHING, regardless of the task at hand, all functions, all options, all plugins. Only the admin area is excluded from the load. But even the admin functions in plugins are loaded because there is no api structure to load those portions only in admin. (I’ve attempted to address that last problem in some of my later plugins for bbPress).

    Loading a bbPress page as a plugin for WordPress will require the same process, EVERYTHING has to load, but now it will be worse.

    This is why caching is critical with WordPress or it gets slaughtered when there are many requests. As soon as bbPress 1.0 was retooled to use backpress, it inherited the same problems as WordPress.

    bbPress as a plugin will have the same problems as with backpress, but now even more so as all the wordpress plugins are loaded. It’s deep integration regardless if the user wants it or not. You will not be able to use bbPress functions without all of WordPress loaded because it will be substituting for backpress.

    It’s forced deep integration, easiest way to explain it, and that’s a very bad idea.

    #88316
    paulhawke
    Member

    I’m running into an issue writing the “import” side of things – my first thought is to create a plugin that mimics what is in WordPress. I found myself creating the infrastructure that is already present in the main body of WP.

    Writing both import and export tool really would be a lot simpler when bbPress is a WordPress plugin. Why make it like the WP one, when we can utilize the real one? :-)

    paulhawke
    Member

    Coming at this as a software engineering problem I cant see why a both/and rather than either/or situation shouldn’t prevail. Let me explain, as it’s not particularly outside the box for it to happen.

    I write a lot of automated tests for the code I produce day-to-day and that means I need to isolate the most important pieces of business logic from how they are invoked. For instance, a given request comes into the a webservice telling it to create a user for the system. I would separate the code that handles the webservice part (pulling parameter data from the incoming HTTP request, etc) from the code that then creates the user. I would isolate the steps, wrap automated unit tests around each, and be done.

    Applying the same thing to bbPress, there is some core code that handles the management of forums containing topics, that contain posts by users. This code is packaged into a clean unit of deployment – the WordPress plugin – and there is absolutely no reason why the code shouldn’t also have a second wrapper that allows for its deployment stand-alone from the main body of a WordPress installation.

    Just as I might have a webservice making calls to a body of well-tested code in my day-job, I dont see why a cleanly written WordPress plugin shouldn’t make calls into the tested bbPress core code. The body of WordPress code provides additional services that another wrapper could also provide – the core of bbPress should be unaware of the actual physical storage mechanisms being employed, or how it’s being invoked (assuming its written correctly).

    At the end of the day the conversion to a WordPress plugin should bring health to the codebase – a level of focus on what is most important (managing structured conversations in a forum/topic format), and an abstraction from what is not important (that is, the underlying physical storage, web-hosting, etc).

    Tellyworth
    Member

    Howdy,

    It looks like the Live Comment Preview causes unexpected API calls to Akismet – a separate API call each time the preview updates (i.e. almost every keystroke).

    I assume this happens because the preview plugin calls the pre_post filter, which in turn triggers bb_ksd_check_post().

    I imagine there may be other plugins that cause a similar problem. Would like to help fix it but I have only a superficial understanding of the bbPress code. Suggestions for the Right Way to do it?

    #88285
    _ck_
    Participant

    This could be handled with javascript and (unfortunately) a page reload.

    PHP cannot see the hash because it’s not sent by the browser to the server.

    But javascript can see it.

    When the page loads, javascript could look at the hash and then see if an object with that id exists on the page. If not, it could do a proper request from the server via a plugin.

    per your example:

    http://www.domain.org/forum/topic.php?id=5579&page=8#post-56412

    pseudo code:

    if (window.location.hash
    && window.location.hash.substring(0,5)=="post-"
    && !document.getElementById(window.location.hash)) {
    document.location="?post="+window.location.hash;
    }

    Then on the server side a plugin would look for the post request and return the proper new url.

    A little bit messy but would allow backwards compatibility if there are links out there which cannot be fixed, especially on other sites.

    WordPress has the same problem with post and comment pagination as the pages constantly move. It’s a poor design.

    #88284
    Tomcraft1980
    Member

    damn. ;-)

    So will your plugin be compatible with bbPress 1.03 or is there another solution already integrated in bbPress 1.03?

    Will my old anchor-links stop working after activating your plugin?

    Best regards

    Tom

    #87742
    _ck_
    Participant

    Hmm, my font-size increase trick is no longer working, someone changed the stylesheet.

    The default font-size is ridiculously small.

    Did someone seriously hard code the font-sizes into PX instead of percent or em?

    Ah this will fix it in Stylish

    * {font-size:98% !important;}

    #34269
    sheryll
    Member

    Is there a way to define an “if” statement for the topics page. Here is what I am trying to do. I want the topic info/meta to be displayed on the sidebar. The sidebar codes are in the footer.php file which means that it will be displayed site-wide.

    There is this line if (bb_get_forum_is_category()) : for categories, so I’m wondering if I can do something similar like “if this is a topics page, display so and so.” and if not it will be hidden.

    #88262
    MayurSomani
    Member

    Hi, fixed the issue, edited the bbpress plugin to use this,

    if (!class_exists(‘GeSHi’)) {

    include_once(“geshi/geshi.php”); }

    Thus the class is not reused on wp.

    Thanks zaerl for the hint :)

    #87386
    Arturo
    Participant

    upload the files, create a db, dump your local db and import online, adjust the URL (localhost to site.tld), make the changes in wp-config.php and bb-config.php

    enjoy your site online ;)

    #87352
    Arturo
    Participant

    hi rockyteng,

    thank you, u’re welcome ;)

    #88308
    Rich Pedley
    Member

    Check the usermeta table for user_id of 1

    You should hopefully see a meta_key of bb_capabilities

    and then the meta_value will be something like:

    a:1:{s:9:"keymaster";b:1;}

    Not sure its even possible to manually change a password any more.

    #86893

    bbPress has 3 things going for it:

    1) It can integrated a single signon with a wordpress install

    2) It’s very easy to ‘theme’

    3) It’s totally open source and easy to code for

    If you like these, then bbPress is for you. If these things are not enough (and for most people they’re not) then bbpress is not for you.

    It’s also wrong to say that bbPress is missing alot of functionality. that’s purely down to your perception of what YOU think a forum should have. bbpress documentation is shockingly thin on the ground, so if it doesn’t do what it claims to do – tell us :) But don’t judge it because it doesn’t do something it doesn’t claim to – you’ll never find the software that fits your needs that way.

    #88325

    In reply to: Avatar size

    Rich Pedley
    Member

    probably in post.php within your theme look for:

    post_author_avatar_link()

    I change mine to this:

    post_author_avatar_link('100')

    #34262

    Topic: Avatar size

    in forum Themes
    Kasparas
    Participant

    How to resize avatar in topic view, i didnt find any size codes in style.css.

    I want my forum look more like bbpress.org :)

    #88161

    In reply to: New Topic

    Rich Pedley
    Member

    not possible.

    But you could wrap the call to it in a <span> or similar and then add the class to that.

    #88283
    zaerl
    Participant

    Hi. Unfortunately the links obtained from the “#” in Kakumei theme (or similar) are just anchor links. This is due to the fact that they are generated with post_anchor_link() (file: bb-templates/kakumei/post.php:11).

    With “just anchor links” I mean that they are anchors (#post-number) of the current page. They aren’t permalinks. All that links became invalid once you change the “items per page” (and/or other values) from the bbPress admin panel.

    All you can do with the links that users have posted is to parse them and change them accordingly to the new server settings but this can (and will) be a long, tedious, hard and prone to errors work.

    I have written a plugin called “zaerl Post Permalink” that solved this problem. My plugin export a function that generate this link:

    1) http://www.domain.com/the_bbpress_path/post/post_number

    2) http://www.domain.com/the_bbpress_path/?post=post_number

    The (1) is preferred if mod_rewrite is used. These links are permanent and do adapt on the fly to the actual settings of the server. I use my function in various places of the template and post.php is one of these.

    I can share my work with you if you want. Email me za AT zaerl.com.

    p.s. keep in mind that the plugin isn’t retroactive.

    #88017
    Kasparas
    Participant
    cnc
    Member

    Recently I got this mesg who drives me crazy..

    Warning: Visiting this site may harm your computer!

    I don’t know what happened to my blog and forums.. I think all was secure and safe in my site.. I have talked to my hosting company they clean it.. but the problem is still there..

    http://www.car-n-car.com (wordpress)

    http://www.car-n-car.com/forums (bbpress)

    It’s really disturbing me… how can I fix it?

    is there any wordpress or bbpress authenticated plugin who defend my site from suspicious codes, and hackers attacks..

    please guide me to remove this bloody mesg…. otherwise my site will useless :(

    help me again…

    Regards,

    cNc

Viewing 25 results - 21,251 through 21,275 (of 32,495 total)
Skip to toolbar