Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 25,876 through 25,900 (of 32,481 total)
  • Author
    Search Results
  • #71359
    _ck_
    Participant

    Um, forum-moderators does exactly what you want, but it probably needs to be updated for 0.9 and 1.0

    I have an unreleased plugin called “extra privileges” that does something like what you are asking but it won’t be released anytime soon.

    You can see how filters on bb_current_user_can work by studying this mini-plugin I wrote to allow users to delete their own posts

    function delete_own_post($retvalue, $capability, $args) {
    global $bb_current_user, $bb_post;
    if ($capability=="delete_post" && $bb_current_user->ID && $bb_post && $bb_post->post_id && $bb_post->post_id ==intval($args[1]) &&
    $bb_post->poster_id && $bb_post->poster_id==$bb_current_user->ID && bb_current_user_can( 'edit_post', $bb_post->post_id) {return true;} // lots and lots of double checks
    return $retvalue;
    }
    add_filter('bb_current_user_can', 'delete_own_post',10,3);

    or simplier version:

    function delete_own_post($retvalue, $capability, $args) {
    if ($capability=="delete_post") {return bb_current_user_can( 'edit_post', $args[1]);}
    return $retvalue;
    }
    add_filter('bb_current_user_can', 'delete_own_post',10,3);

    #71357
    chrishajer
    Participant

    /bbpress/bb-admin/includes/defaults.bb-schema.php

    is where the table names are all set. But changing the names there is only going to change the name of the tables that are created. You would need to change every reference to a table to this new uppercase name. I can’t imagine how difficult that would be or what would happen with any plugin you install or what happens when it’s time for an upgrade.

    What host is this that changes the table names (not the database name) to uppercase? I’ve never heard of such a thing. Is there a page on their site or an email from support describing their policy?

    It’s ok to have a database name in uppercase, since you only reference that once, but tables names being restricted to uppercase sounds like a very strange thing to me.

    #71316

    tomdebruin, user integration does work. I can register on either one, but I don’t pull in the wp-blogheader at all, I just recreated my theme and hard coded the page links.

    #64641
    kirpiit
    Member

    I humbly suggest that a search field and its css couterpart is included in the default theme for future releases.

    It is far easier for many to comment out a few lines as opposed to figure out how and where to place new pieces of code.

    Thanks.

    #4690
    Burt Adsit
    Member

    It’s not the first time and it won’t be the last. I’m confused.

    I’m trying to add forum moderator capabilities to the currently logged in user in a specific forum only. I don’t want to give them the moderator role. I just need to give them additional caps in a specific forum. When the user is tooling ’round in the forum I want to give mod rights to, assign them dynamicly. When they are no longer in that forum, take ’em away on the fly.

    If found a couple of things to guide me. One was forum-moderators.php by Aditya Naik. This give specific users a forum moderator role thru the bbpress backend. That stores the rights to those caps as a meta value and assigns them when the user is on the forums. Great. There’s a fn in there that determines what forum the user is in and responds to a filter called ‘bb_user_has_cap’. I can’t find neither hide nor hair of using this filter anywhere except in a couple of plugins by sambauers. http-authentication and ldap-authentication.

    So, I found the filter ‘bb_current_user_can’. It looks to me like everyone on the planet is using this filter. The comment in the fn bb_currrent_user_can() says use ‘bb_user_has_cap’. Well, nothing is using that as far as I can determine.

    Anyway, my confusion comes in when I try to implement my filter. I’m gonna give the user the following caps:

    $forum_mod_caps = array(
    'manage_topics' ,
    'edit_closed' ,
    'edit_deleted' ,
    'browse_deleted' ,
    'edit_others_tags' ,
    'edit_others_topics' ,
    'manage_posts' ,
    'ignore_edit_lock' ,
    'edit_others_posts'
    );

    For me, reading the code for bb_current_user_can() is like the time I got curious about implementing tcp/ip for the Atari ST. I got a headache. My skill level is not up to understanding what is going on down there. Some guidance would be appreciated.

    We have 3 args to this filter:

    $retvalue, $capability, $args

    Looks like $retvalue is being passed up the filter chain. If I don’t want to touch the call I just pass $retvalue back.

    I was digging ’round and looks like $capabilities is the cap being queried. $args is specific to each call and may vary depending on what cap is queried.

    These are questions in case you haven’t noticed. My understanding breaks down when I get to what I’m being passed and what I’m supposed to do with them other than return ‘true’ if it’s a cap I want to let the user have.

    I should just return true if it’s a cap I want the user to have. It’s up to me to determine if it’s appropriate at their location in the universe. Yes?

    #4687
    deadlyhifi
    Participant

    All integration guides appear to have the userbase in WP. I was in the situation where my userbase was in bbPress, so I needed to get all my bb_users into wp_users.

    The following refers to WP2.7 and bbPress 1.06a.

    The process is actually quite straight forward but do make backups of your database beforehand!

    1. First delete ‘wp_usermeta’ and ‘wp_users’ tables (having made that backup!)
    2. Change the name of ‘bb_usermeta’ to ‘wp_usermeta’ and ‘bb_users’ to ‘wp_users’.
    3. The tables structures from bbP are the same as WP apart from one field in the ‘_users’ table. So we need to add FIELD: user_activation_key TYPE: varchar(60) NULL: NO after the ‘user_registered’ field.
    4. The problem now is that none of these users have their WP roles defined.
    5. To do this we need to insert the ‘meta_key’ and ‘meta_value’ to ‘wp_capabilities’ and ‘a:1:{s:10:”subscriber”;b:1;}’ for each user.
    6. wordpress_capabilites.sql contains an SQL insert statement for 5000 users. If your userbase is less than that you only need to run it for your number of users (although we deal with overruns in a minute).
    7. Once this has run each user will have ‘subscriber’ status within wordpress. You need to manually change your bbPress key holder (most likely user_id 1) ‘wp_capabilities’ to ‘a:1:{s:13:”administrator”;b:1;}’. This gives that account administrator status within WP.
    8. It’s highly likely that you’ll have deleted some users in the past, or run too many INSERTs from the wordpress_cabalilities file, so we need to delete all those ‘wp_capabilities’ that aren’t mapped to an exisiting user.
    9. SQL: ‘select * from wp_usermeta where user_id not in (select ID from wp_users)’ will list all these non-existent users.
    10. It probably a good idea to do a full backup of your tables right now just in case.
    11. Now run this SQL: ”delete from wp_usermeta where user_id not in (select ID from wp_users)” – this will delete all those stray entries.
    12. Done.

    All worked out with the help of someone I work with, so I can’t take all the credit ;)

    Good luck.

    #4684

    Lets say in theory I was going to try and integrate bbPress’s functions into WordPress.

    Theoretically, where would I look if I didn’t want bbPress to clear out the wp_head function? :)

    #71292

    Check your wp-config.php file, and search for “$table_prefix”

    I’ve got $5 that says you accidentally typed “ltvwff” next to it. :)

    #70735

    In reply to: bbpress vs phpbb

    eclipsenow
    Member

    Hi,

    I am using phpbb3 for now, but I’m not really good at database stuff and admin stuff. I love all open source projects, especially phpbb3, bbpress, wordpress, Joomla, Drupal, etc… even though I’m not very “Geeky” yet and am only just beginning to learn the basics of CSS (let alone php etc).

    So… I am speaking from the perspective of a non-technical forum administrator frustrated by various interactions of various software. I don’t mind doing the grunt work of setting things up IN the software, but don’t know the code to work ON software. EG: Once phpbb3 is installed, I can easily set up forums, permissions, etc. It’s just easy point and click stuff. But messing around in mysql and database stuff still terrifies me, I’m afraid of breaking something. It’s all too big. I just want to install it and have it work.

    I appreciate that there are various philosophies behind each style of software, but here goes…

    MY ULTIMATE WISH LIST

    1. Nothing to do with you guys, but number 1 on my list is to have Fantastico (or something equivalent) that can make installation of WordPress / Joomla / Whatever EASY! (My client is a volunteer campaigning group that just happened to choose Brinkster which don’t use Cpanel, let alone have Fantastico).

    2. After EASY fantastico installation, I install WordPress.

    3. Then within WordPress I browse across to the various add-ons pages in the WordPress Control Panel (A VERY cool new feature of WordPress that Drupal and Joomla should add to their systems!) and then click “INSTALL FORUM?” and WordPress suddenly installs a completely compatible forum, just like that, with all the power of phpbb3 built-in.

    4. I then choose 1 of say 20 or 30 “looks” (templates, themes, whatever) that are already pre-configured to allow sign-in of users on all pages, especially the forum page. If I want to change the colour of a background element or use a new image in the header, I just point and click to template editing and do it ala Blogger. (No CSS required).

    This sort of software is on the way. Joomla now has “Agora” which is already fairly advanced. Once Joomla is installed through the 50 second Fantastico installation, Agora only takes about 50 seconds to install as well. EVEN I CAN DO IT! But the Joomla / Agora combination does not yet have Step 4, which is killing me… I have to muck around with all sorts of plug-ins and extra bits to get a horizontal log-in menu I can put up just under my header (so it’s in the same place no matter what template I’m in).

    I saw the video of how to integrate WP and BBpress, and ran a mile screaming! It just looked very intimidating.

    So anyway, the Joomla / Agora combination is hardly perfect, but as you know these things keep on developing and Hazzaa over at Agora is MANIC in the rate he’s developing his product. Version 3 is nearly out, and it’s only been 10 months.

    Just thought I should give you guys the heads up. The competition is great, because it forces us all to evolve.

    EG: I LOVE the sound of WordPress’s new one click upgrade function, and hope Joomla gets that soon! (It’s just me and database stuff again… eeerrgh!) Combine that with easy forum upgrades, backups, etc, and software that’s Mac-like in that it “just works”, and I’m a happy camper.

    PS: I forgot to check this thread in case there were replies, because I automatically get an email from every other forum I belong to. Old habits die hard. Agora has an automatic emailing function built in, it’s not a plug in. ;-)

    #71353

    In reply to: bb Code not working

    Nevermind. I’m an idiot. I guess you need bbcode light to make it work.

    #4682

    I’m having trouble getting bb codes to work, via plugin buttons or otherwise. I even hard coded a link to a podcast on one of my other blogs, and url code isn’t working. Any idea what the problem is?

    #71343

    In reply to: Visit counter

    Fernando Tellado
    Participant

    I guess that tomdebruin refers to footer.php of your active template, always before de </body> tag ;)

    Is the same thing if you want to add the Google analytics code

    #71210

    In reply to: List all Tags?

    deadlyhifi
    Participant

    improved:

    <?php if ( bb_current_user_can( 'manage_tags', get_topic_id() )): ?> - <a href="/forum/profile.php?id=<?php echo $tag->user_id; ?>"><?php echo get_user_name( $tag->user_id ); ?></a><?php endif; ?>

    #4680

    Topic: Visit counter

    in forum Troubleshooting
    nessunowin32
    Member

    I have an account on http://www.realcounter.eu that lets you create in a personalized way of the meters to insert into right site, blog and forums.

    I wanted to know where should I include this Code because it is displayed in:

    Homepage, in the categories and finally on the individual post

    Sorry for my bad English are Italian and forgive me for a possible wrong of Section

    #71330
    ganzua
    Member

    Thanks for the fix, I will check it asap. In my case, I need to use 1.0a6 because I deep-integrated with wp.

    BTW, I couldn’t make topic views plugin work neither.


    *need code for last 10 posts loop in 404 page

    #71209

    In reply to: List all Tags?

    deadlyhifi
    Participant

    that’s good to know, thanks.

    I just added the following to topic-tags.php (after <?php bb_tag_remove_link(); ?> )

    <?php if ( bb_current_user_can( 'manage_tags', get_topic_id() )): ?><a href="/forum/profile.php?id=<?php echo $tag->user_id; ?>">user</a><?php endif; ?>

    so there is a quick link to the users profile to see who posted that tag.

    Not perfect but easier than running that SQL!

    #71328
    ganzua
    Member

    BBpress 1.06a and Topic views plugin 1.6.3. I couldn’t paginate last posts in front-page.php

    If you know how, please share some knowledge :) What I wanted is to have an unlimited number of posts in the front-page loop and set a pagination. I think this feature would be a great improvement for bbpress.

    I’m interested too in a last 10 posts loop for my 404 page :)

    #71289
    chrishajer
    Participant

    With a tool to look at the database, like phpMyAdmin, can you see if the table is still there?

    harrismarineblog.wp_lvtwfff_usermeta

    The lvtwff looks a little weird: did you really use wp_lvtwfff_ as your table prefix?

    #71208

    In reply to: List all Tags?

    chrishajer
    Participant

    > Currently the only way to see who posted what tag is to do an SQL query

    That’s not true. You can see who posted a specific tag by looking at the source of the page where a tag is displayed. In the source, you will see something like this:

    <li id="tag-1785_278"

    The 1785 is the tag_id and the 278 is the user_id. If you want to moderate a user who is posting inappropriate tags, you have your id right there.

    I learned this recently on these forums, but I can’t find the post that explained it originally.

    #4673
    #71207

    In reply to: List all Tags?

    deadlyhifi
    Participant

    I mean all the tags used on the site, so we could see two columns

    Tag | User

    so each tag could have multiple users who used it.

    Some users are using inappropriate tags on posts. We want a public list so we can name and shame them. Currently the only way to see who posted what tag is to do an SQL query along the lines of

    SELECT bb_users.user_nicename, bb_terms.slug, bb_topics.topic_slug
    FROM bb_terms
    INNER JOIN bb_term_taxonomy ON bb_term_taxonomy.term_id = bb_terms.term_id
    INNER JOIN bb_term_relationships ON
    bb_term_relationships.term_taxonomy_id =
    bb_term_taxonomy.term_taxonomy_id
    INNER JOIN bb_topics ON bb_term_relationships.object_id = bb_topics.topic_id
    INNER JOIN bb_users ON bb_term_relationships.user_id = bb_users.ID
    WHERE bb_terms.slug = 'TAG NAME'

    #4674
    ganzua
    Member

    I can’t make this plugin work :(

    Do you have it working in your bbpress installation?

    #71240

    I think the best bet would be to block the inappropriate ones. ;)

    Add to .htaccess

    RewriteEngine On
    RewriteCond %{HTTP_REFERER} ^http://(.+.)?crazy-porn-site.com/ [NC,OR]

    #71264
    Fernando Tellado
    Participant

    Same problem.

    I’m using these plugins if they affect:

    – bbcode lite

    – highlite code

    – allow images

    – buttons

    (names aren’t exact but I think you know what plugins are)

    #4670
    andersson
    Participant

    I’m on 1.0Alpha6.

    Is this just a quirk in the bb-benchmark plugin i.e. is the timer just way off?

    This is what I get when loading a normal page, with 11 queries executed in notime at all.

    time to reach each section:

    bb_underscore_plugins_loaded = 0.169

    bb_plugins_loaded = 0.179

    community.php = 0.209

    header.php = 0.209

    search-form.php = 0.209

    footer.php = 1.019

    time to render page: 1.0153 seconds (query time subtracted)

    total query count: 11

    total query time: 0.0027 seconds

    `

    if you look at that time difference from the other sections and compare it to the time it takes to load footer.php. It’s just insane. footer.php contains nothing but a “copyright” thing and a hook to do_actoion bb_foot.

    Does anyone have any thoughts on that?

    Thanks for an excellent product.

    Edit:

    Maybe I’m reading the stats wrong. It’s probably measuring the time between search-form.php and when it finally arrived at footer.php. but still, something is taking an enormous time between those two, and it doesn’t seem to be the queries to the Db. Still appreciate some thoughts here on what this could be. Thanks.

Viewing 25 results - 25,876 through 25,900 (of 32,481 total)
Skip to toolbar