Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 29,726 through 29,750 (of 32,432 total)
  • Author
    Search Results
  • #58882

    Thank you for the help! Actually I solved it just now, I had to put

    global $current_user; echo $current_user->ID;

    to get it right!

    #55233

    In reply to: Favourites

    _ck_
    Participant

    Heh, thanks for the compliment but I am completely self-trained and rather unprofessional in my code (translation: I’d make a mess)

    I just seem to have a knack at code, I learn very quickly from examples and can figure out how to apply them. Also, exhaustive hours at hacking pre-2.0 wordpress taught me a lot.

    ps. what “serious” issues – I might have a go… maybe…

    #58881
    _ck_
    Participant

    Just an untested guess on my part but what you want is something like this?

    <a href="/forum/profile.php?id=<? echo $user_ID; ?>">your profile</a>

    #58901
    _ck_
    Participant

    Yeah I’ve already hacked the core code to make it say “Track this topic in your forum favorites” to make it sound different than adding to your bookmarks which every site nags the visitors to do and so they ignore it.

    Too much hacking needed to change the term “favorites” everywhere unfortunately and it was the first thing I sadly had to touch the core for. After hacking up wordpress so much that I cannot easily upgrade it, I swore not to do that on BBpress, especially since it’s so early in alpha/beta

    It’s also going to be a problem eventually that a tracking level is not set for each “favorite”, so now they can only get every topic emailed, or none at all.

    When in doubt, study vbulletin as a model I suggest…

    Detective
    Member

    This is what i do to solve the problem:

    function wpbb_add_user_role_rk($user_id) {

    $user = new WP_User($user_id);

    $user->set_role(get_option('default_role'));

    }

    add_action( ‘bb_new_user’, ‘wpbb_add_user_role_rk’);

    #58859
    Trent Adams
    Member

    I would just add this as a request in TRAC because I think that is important as well as I have currently 5 plugins (I know I could combine them to 1) to allow code. Maybe a checkbox in the admin?

    Trent

    #55231

    In reply to: Favourites

    _ck_
    Participant

    Here’s a function I whipped up to grab the number of users who call any particular topic a favorite.

    If you don’t send it a topic id, it return the currently displayed topic’s favorite count

    function get_topic_favorites_count( $topic_id=0) {
    global $bbdb, $topic;
    if (!$topic_id) $topic_id = (int) $topic->topic_id;
    return $bbdb->get_var("SELECT COUNT(*) FROM ".$bbdb->usermeta." WHERE meta_key='bb_favorites' AND meta_value REGEXP ':<:".$topic_id.":>:'");
    }

    use it this way:

    <? echo get_topic_favorites_count(); ?>

    within your topic.php template

    #56708

    In reply to: Plugin: Avatar Upload

    LMD
    Participant

    @Beaver6813:

    The error sounds like it’s trying to call the add_action() function when either the file containing the function (wp-functions.php) isn’t included for some reason, or the plugin is being called before it has been included.

    I do not know why this might occur, although the fact you are using an integrated WordPress/bbPress combo might be a factor. We really need somebody who knows more about the internals of both system to help.

    Anyway, by commenting out the add_action() function all you have done is prevent the plugin from automatically creating an identicon for newly registered users. So, it’s not such a biggie while trying to solve the problem.

    @_ck_

    Feel free to hack the script however you see fit — I realise I have been rather too strict with the filenames, especially as it is really only a first-stage precaution (the file gets renamed n the server anyway). Also, I believe some browsers add the whole path to the uploaded filename (something I neglected to address).

    A solution I am adding to the next version will be to extract the actual filename from the path before checking.

    $img_name = basename($img['name']);

    Then, the number of necessary characters to allow is greatly reduced. I just prefer to approach it from the other end, block everything except what I explicitly allow. But as I said, feel free to hack it to suit your needs.

    I was completely unaware that you could enter a URL into a file input (“browse”) field? You indicate that it forces Windows to download the file, but I am wondering whether it is a browser specific feature and whether it is supposed to work like that? I would not rely on it.

    The mime-type comes from the uploaded file in $_FILES which, you are right should not be trusted. I’m experimenting with checking whether the uploaded file is areally an image doing something like imagecreatefromjpeg() – obviously using the appropriate function for the reported file extension (so if it’s all wrong/missing/forged an error will result). Alternatively, a simple solution might be to use getimagesize() (just the one function for all types), which I already use later in the code.

    #57831
    howtogeek
    Member

    I should mention that my code is a horrible hack… hopefully they’ll fix the problem in the core.

    #58858
    _ck_
    Participant

    Well with wordpress, the override is right in the code but obviously to leave the bbpress core alone it would have to be a plugin. (Kinda wondering what all these plugins are doing to the supposedly high performance of BBpress).

    I’d like to see admin/mods have zero limits on what they put into their posts. So to write a plugin I need to find out how to check the user level, then figure out what filter to attach it to (probably pre_post)

    #57830
    _ck_
    Participant

    Wow this is a very serious issue – I couldn’t figure out why half my members could not log into the forum! Thought it was a cookie issue, but it was the space!

    I suggest this be moved to the integration section and highly recommend to everyone trying to merge BB with WP. I would never have spotted this if it had not been bumped by signpost (who’s code did not solve it unfortunately, I had to use the plugin)

    #56707

    In reply to: Plugin: Avatar Upload

    _ck_
    Participant

    I found visitors were getting really hassled by the filename restrictions so I decided to relax them while still keeping some safety since you already check mime types & file extensions

    instead of:

    !eregi("^([-a-z0-9_]+).([a-z]+)$", $img_name)

    I reduced it to only exclude the four bad characters I can think of:

    eregi("#|?|&|%", $img_name)

    What do you think? Safe enough?

    Is your mime check from the physical file itself or just the sent headers? Hopefully the physical file or it’s not secure enough.

    My change allows people to click browse and enter a url into their file browser, which forces Windows to pull down the file first, then upload it to the site. Not sure what other OS’s will do. Windows adds [1] to the filename in the temp area, so your name filter was blocking it from uploading.

    My next ideas are to give lazy people a section of default avatars to choose from instead, and to allow members several stored avatars to chose from (your table should allow multiple entries per member I think, though the code to deal with it will have to be changed of course).

    #57829
    signpostmarv
    Member

    I came across the same problem on a combined wp/bbpress setup.

    twas a simple case of changing line 1079, template-functions.php

    $r = bb_get_option('uri') . "profile/" . $user->$column . ( 1 < $page ? "/page/$page" : '' ); to $r = bb_get_option('uri') . "profile/" . urlencode($user->$column) . ( 1 < $page ? "/page/$page" : '' );

    #58878
    _ck_
    Participant

    Yay! I figured out how to hack it to make it happen.

    To leave the core files alone, I did it through a plugin.

    The balancetags in bbpress takes less parameters than from WP.

    function force_balance_tags($text) { return balanceTags($text, true);}

    add_filter('pre_post', 'force_balance_tags');

    Tested working.

    Another nice addition in there would be to add nofollow to any post links.

    add_filter('pre_post', 'bb_rel_nofollow');

    #58877
    _ck_
    Participant

    AHA!

    I found a bug. Finally I can contribute.

    WordPress does indeed auto-close tags and has a fantastic routine, the balancetags I mentioned above.

    HOWEVER

    it was copied raw into BBpress and it won’t work by default because it’s looking for an option that will never be set because BBpress doesn’t have it

    function balanceTags($text, $is_comment = 0, $force = false) {

    if ( !$force && get_option(‘use_balanceTags’) == 0 )

    return $text;

    See what I mean? There’s no manually way to set use_balanceTags in BBpress.

    So how do we force the filter on? I know it has to be balanceTags ($text,1,1) to work.

    #58854

    Awesome! Works perfectly, thank you :)

    #58880

    Ok so it won’t type out the code the way I want to here. I did the backsticks thing… But I know someone out there will be able to help me out anyway :)

    #58848
    Trent Adams
    Member

    It is defined in style.css through the following:

    /* Profile Page
    =================================== */

    #profile-menu {
    list-style: none;
    position: absolute;
    right: 0;
    }

    #profile-menu li {
    font-size: 1.1em;
    background-color: #eee;
    padding: 4px 7px;
    display: inline;
    border-top: 3px double #9e9e9e;
    position: relative;
    top: -10px;
    }

    #profile-menu li.current {
    background-color: #ddd;
    border-top: 1px solid #9e9e9e;
    }

    My guess would be that you have to change the position from absolute to a margin call, but maybe someone else can give you some more hints. I am a trial and error CSS changing kind of guy….. ;)

    Trent

    #2063

    I’m calling the wp-headers in forum as advised in seamless integration thread. I need to add a link to the forum profile in the header as users get confused when they only see the admin tab for wordpress. I have the loginanywhere script, and need a link to the users profile edit somewhere in this code:

    `echo “<div class=’greeting’>nHej, “; echo $user_identity; echo “! Inställningar | “;

    echo “Logga utn</div>n”;`

    My forum is here: http://www.doublepeace.se/forum/

    #2062
    _ck_
    Participant

    I’ve got sloppy members not closing their tags and the markup runs through the rest of the page. Doesn’t WP already do auto close on tags? Did bbpress not pick up that part of the code?

    #58870
    M
    Member

    Found the problem, it is indeed a plugin issue (Allow Images), but deactivating the plugin had no effect for some reason and I only saw it when I worked on my test forum and did a fresh install of the plugin. The plugin still works to display images, you just can’t display code.

    Will pop over and give the plugin author a heads up.

    M
    Member

    After trying to add code between backticks, all I’m left with is something like this:

    `

    m

    `

    Instead of:

    <img src="http://www.yourimghosthere.com/yourimage.gif" />

    Deactivating plugins didn’t fix it, and nothing else has changed other than the upgrade. Is anyone else running into this?

    Edit: okay, at least now I know it works on the bbPress forums. I’ve no clue where to look to fix this, can anyone toss out an idea or two?

    ‘code’ works, so long as I don’t include the brackets around the code I’m trying to show.

    #2055
    _ck_
    Participant

    You may notice that the table row highlighting doesn’t work in IE (at least in IE 6.0 which many people use)

    I found this easy, drop-in solution to use IE’s HTC support

    http://www.xs4all.nl/~peterned/csshover.html

    save this file into your template folder

    http://www.xs4all.nl/~peterned/htc/csshover.htc

    then add this to your stylesheet

    body {behavior:url("/path-to-your-template/csshover.htc");}

    optionally but recommended, you might also want to add this to your .htaccess in apache since it probably won’t serve the right mime type for HTC by default which breaks XP sp2

    AddType text/x-component .htc

    Now :hover can work on almost anything in IE just like real CSS browsers.

    #58853
    _ck_
    Participant

    Ah I’ve now learned this is from the moderation plugin which apparently is moderating ALL posts even though it’s set not to :(

    #58080

    In reply to: bbSync

    starrett
    Member

    fel, everything seems to be working great except that when I use <?php bbrepliestext(); ?> I get this error message: “Fatal error: Call to undefined function: get_topic() in /path_to/wp/wp-content/plugins/bbsync/bbsync.php on line 495”

    Any suggestions?

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