Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 22,151 through 22,175 (of 32,468 total)
  • Author
    Search Results
  • #84379

    In reply to: @ links (mentions)

    Gautam
    Member

    @kevinjohngallagher

    I am using javascript to only generate the @<user-link><user-name> in the post textbox when the user clicks the reply link below each post.

    #76944

    Hey Kevin,

    I tried your code, it’s not working.

    which bit mate?

    Also you’ve nit asked fir how many replies, you’ve asked for how many posts (which will included the original), so just take 1 away from the number Nd you get how many replies there are :-)

    #84396
    Michael
    Participant

    I found the smilies here: http://pinvoke.com/

    They seem to be a remake of the default WordPress ones – the others were just from all over the web. I plan to make my own set one day, once I have more experience in Icon Design.

    Glad you like the compilation. :)

    #76943
    chandersbs
    Member

    Hey Kevin,

    I tried your code, it’s not working.

    @ everyone:

    I added this piece of code (".$result->topic_posts.") to show the number of replies on each topic, so now the code is like this:

    <div id="recentetopics">
    <h2>Recente topics</h2>
    <ul>
    <?php
    global $bbdb;
    $query="SELECT * FROM bb_topics WHERE topic_status=0 ORDER BY topic_start_time DESC LIMIT 10";
    $results=$bbdb->get_results($query);
    foreach ($results as $result) {
    echo "<li>".date( strtotime( $result->topic_start_time ) < floor( current_time( 'timestamp' ) / 86400 ) * 86400 ? 'd M' : 'H.i', bb_offset_time( strtotime( $result->topic_start_time ) ) )." &rarr; <a href='/topic.php?id=".$result->topic_id."'>".$result->topic_title."</a> (".$result->topic_posts.")</li>";
    }
    ?>
    </ul>
    </div>

    The output is like this:

    19.11 → Dark Mirror Ov Tragedy - The Pregnant Of Despair (2009) (4)
    19.00 → Rammstein - Live In Muenchen (2009) (2)
    18.54 → Mnemic - Sons Of The System (2010) (1)
    26 Jan → Aanraders? (2)
    25 Jan → Duitse band Scorpions stopt (2)

    I notice that topics that don’t have any replies yet, it shows the number 1 as the number of replies. It should show zero actually.

    Whadya you guys think?

    #84394
    Michael
    Participant

    You’re welcome. :)

    #84119
    Thomaschaaf
    Member

    Thanks a lot! I will look into it and if I do write a converter I will post it here :)

    Thomas

    pv4
    Member

    Hi!

    I was trying to integrate a bbpress-1.0.2 forum with my existing WP installation and I found a funny bug.

    If I open a topic and use the interface right to the title to add a russian-language tag, only the first half of a tag is actually added.

    If I try to add a tag “mama” (written in russian, of course. I write here in english just for the english speaking people being able to read the post) only the first half of a tag (“ma”) is actually added. It happens everytime I add a tag with an even number of letters (2, 4, 6, etc). Tags with an odd number of letters are added correctly.

    BTW every russian letter in UTF-8 is encoded using exactly two bytes.

    Unfortunatelly, I don’t fully understand what the code does and the below is just my guess.

    I guess the problem is in file /bb-includes/functions.bb-formatting.php either in function seems_utf8() or in bb_utf8_cut().

    Traditionally, strlen() returned 8 for utf-8-encoded “mama”. In such case bb_utf8_cut() would work correct (althought I haven’t actually checked). But if one use php.ini mbstring.func_overload option to overload str* functions by mb_str* ones, then strlen(“mama”) returns 4 and bb_utf8_cut() thinks this’s is non-utf-8-encoded string length and assumes that the “actual” string length would be 2. That’s wrong.

    So, my general suggestions is to fix somehow one of those functions to work correctly with mbstring.func_overload both set and unset.

    The quick-fix for people having the option set is to add the following line at the very start of bb_utf8_cut() function:

    return $utf8_string;

    1. Am I correct or should I search for the problem in another piece of the system?

    2. Would this “fix” break anything else?

    #84402
    Michael
    Participant

    You’ve done a decent job with creating the bbPress theme to match your WordPress theme – now you should take a browse through the plugin gallery and make it look better. :) I highly recommend bbCumulus, bbPress Topic Icons, Allow Images, Project Honey Pot (for Spam protection), and MyViews. Someone might highlight some other important ones – those are all I can think of at the moment.

    :)

    #84373

    In reply to: @ links (mentions)

    Michael
    Participant

    @Gautam:

    There is no absolute solution for the space problem. Already, almost all sites don’t accept it (space in username), so almost all the people on net prefer taking usernames without spaces. Even if I put the code to match the spaces, then it might overload the server with so many requests.

    Update: I don’t prefer exploding the text with @ and space, that would have a huge long process…

    There is no necessity for spaces.

    +1. Most people don’t do it anyway. They think,”username” and then automatically assume that there should be no spaces. As small as my forum is, there are no members that have spaces in their usernames (except me, however I changed it to use my display name).

    Now, is the process for finding spaces really that long, or long enough to make the server load heavy?

    #84371

    In reply to: @ links (mentions)

    Gautam
    Member

    Replying to kevinjohngallagher’s post (which again went in spam):

    Let me put it this way, and outside of your plugin (which is excellent), why would someone need a link to a profile page from inside MY post, when there is a link to it one post up on your post. It serves, very little actual purpose. Anyway, that’s my PM/BA head coming out again, and that’s not liked here. Sorry.

    When Michael R said he was looking for something “like Twitter”. In this instance, it looks like twitter but acts differently (because on twitter your profile page is also the page you posted on). That’s just going to confuse the users, as the “@bob” was invented to allow people to follow conversations back the way.

    1) There is a space in the display name of Michael R, not the username – it is michael888 (though it doesnt mean that a bb username cant have spaces)

    2) I have already said that a single user can post multiple posts, so there is nothing that this plugin can interfere in. (Or you give a solution, if you have one)

    It has the potential to be a massive overhead. Again, highly unlikely, but what if someone added a spam post with just hundreds of “@bob a a @bob a b @bob a c”. I know its small stuff, but that’s 9sql queries right there. We’re really opening up the potential for someone to make a single post take 100s of SQL queries.

    There is no absolute solution for the space problem. Already, almost all sites don’t accept it (space in username), so almost all the people on net prefer taking usernames without spaces. Even if I put the code to match the spaces, then it might overload the server with so many requests.

    Update: I don’t prefer exploding the text with @ and space, that would have a huge long process…

    There is no necessity for spaces.

    #84369

    In reply to: @ links (mentions)

    Michael
    Participant

    Gautam, this looks great. Can’t wait to try it out. :)

    That can’t be helped. The plugin first checks if that username exists, if not, then checks if that nicename exists. This will be also mentioned on the plugin page.

    Is there no way to test as far as three spaces in (until it finds a username)?

    #84367

    In reply to: @ links (mentions)

    Gautam
    Member

    Replying to kevinjohngallagher’s post (maybe its in spam, but I got an email notification as I am subscribed to topic):

    1) Making “@” links is cool, and very “twitter generation”, even if its not something that’s totally globalised yet. But the “@” link is not pointing at what you’re replying to. We’re faking the functionality without the reasoning, which in the end will just confuse users.

    On Twitter, you post on your profile page. People read it on their feed, and reply on their own Profile page. So a link to “@kev” goes to the page where “kev” has written his post. That’s the point of it, to link to someone’s post.

    Here, we’re making the link “@kev” go to “/profiles/kev/” for the user to not see the post. That’s exactly the opposite of the purpose of the “‘@” linking system :)

    –> That’s basically the work of a reply plugin, not of a mentioning plugin. I also have future plans with the plugin like linking #tag, etc. Even if I do something like that which you have mentioned, then a single user can make multiple posts, then which post will the plugin link to?

    2) The other issue is that Twitter names don’t have spaces, while BBpress / wordpress names can. So if i write “@Michael R Thanks for your reply”, how does the plugin know where the username ends? What if it finds a “michael” in the usertable, it will then link “@Michael” to “/profiles/michael/” and the message will read “R Thanks for your reply”. In Twitter, it parses at the first space; but we can’t do that here.

    Oh that will also involve looping through queries until you find a match, so first for Michael, then for Michael R, then for Michael R Thanks etc. Ofcourse there could/should be a word/search limit – either way there is huge potential for database issues there. Imagine adding up to 5 sql searches, per “@” per post, per page load.

    The initial solution, and i suppose this is for Gautam, is to make a search of the user table for all users who have posted on the topic being replied to, which should narrow it down considerably, though it should be noted that if you have “Michael” and “Michael R”, or any similar naming issues, the plugin will not know that…

    –> That can’t be helped. The plugin first checks if that username exists, if not, then checks if that nicename exists. This will be also mentioned on the plugin page.

    3) You are effectively allowing a user to search your database for anything you put after your “@” symbol. Now this one is a little bit of scaremongering, but we’ve all seen bad coding before. What if I write “@drop table wp_usermeta hi bob, how much fun would this be :)“. There is a reason that we try to make sure we don’t take database queries from the user.

    –> 1) This is what is used to match the username – /[@]+([A-Za-z0-9-_]+)/, so there is no point of mysql commands going in there.

    If you want to test the plugin (how it works), you are free to use this as sandbox – http://forum.gaut.am/

    I have made some posts to test the plugin here.

    #84364

    In reply to: @ links (mentions)

    Michael
    Participant

    Nice :)

    #78849
    tobefound
    Member

    @pinpin_lelapin:

    Did you get things working? Me too interested in getting a simple and clean forum working with an existing login system on codeigniter.

    /T

    #84362

    In reply to: @ links (mentions)

    Michael
    Participant

    Great – thanks Gautam. Looking forward to it. :) (Are you maybe calling it bbMentions? ;) )

    #84358

    In reply to: @ links (mentions)

    BBprogress had two versions of this one mate, they should still be kicking around somewhere. The first one used Ajax to convert the links (it pinged a search page for @username).

    That said… My issue with it at the time is my issue with what you’re trying to achieve as well. 9/10 when someone is typing “@Michael R” they are replying to a post above. To that end, the “@Michael R” should link to that post, not to the person’s profile page. What you effectively need is a “reply to” button as well as a “quote” button that pre populates the “@Michael R” information.

    Writing that functionality isn’t a problem (check out the quote plugin), but rather that there is no hook in BBpress that doesn’t hardcode output from the core to the bottom of each post. Not only would you need a plugin, but you’d also need a theme with additional hooks/function calls.

    Its definitely doable though, once yu have defined exactly what it is you’re after/the need is for it :)

    #84357

    In reply to: @ links (mentions)

    Michael
    Participant

    Right, I have looked at the Easy Twitter Links plugin, but I’m not sure how to alter it to run through the post. I’d probably have some idea if I managed to find the code BuddyPress uses. I wish I could grep the folder, but I don’t have Linux…

    #84356

    In reply to: @ links (mentions)

    Michael
    Participant

    @OKTeaRoom – I will have a look at that – though I’d also need to find out how to check for member existance.

    @etiviti – Thanks, I’ll download it and run through the code. I’m sure it’ll be easy to make the plugin.

    #83770
    rohanduggan
    Member

    Sounds cool, thanks for the info. Sorry for the redundant post in that case… I thought somebody had just not updated the message assuming (and we know what they say about assumptions:)) that if the plug in was searchable via WP backend with an install button that it might be installable. My enthusiasm (desperation) for a decent BB for WP got the better of me :)

    #84355

    In reply to: @ links (mentions)

    if you look at the buddypress code for activity-notifications (can’t remember the filename) but they have a simple function that filters the content, checks for @<username> string, then validates against the usertable and rewrites the content with a link.

    #32936

    Topic: @ links (mentions)

    in forum Showcase
    Michael
    Participant

    Have been working on my forum recently, and I have though tof something I’d like to add to it.

    Now, I’m no plugin developer, or PHP junkie, but I’d like to know what steps would be needed to turn @ links (mentions, like those found on Twitter) into links that take the user to a members profile page/or maybe even the member’s website (if any).

    Example:

    ‘@matt’ would become ‘@matt

    It would obviously have to scan through the post, check for any mentions, check if the user exists, and if it does, then apply the link. Now, I have no idea how this would be implemented – I hope to learn more soon. :)

    This may not be a very great idea to have for a bbPress forum, but I think it would be nice. Could anyone help me with this?

    Peace, Michael

    #84176

    In reply to: Thanks plugin

    Michael
    Participant

    @gerikg – it’s more of a ‘like’ plugin. :)

    #82537
    gerikg
    Member

    1. Shut off your caching plugin first.

    2. You didn’t follow #8 correctly. “define(‘COOKIEPATH’, ‘/’ );” should be after ?php

    if it doesn’t work email me (on my profile)

    #84174

    In reply to: Thanks plugin

    Michael
    Participant

    Sounds great Paul – love the way you go beyond with plugins. Thank you for that. :)

    That wouldn’t be a problem; I’m always tweaking my theme files to make it all just look better. :)

    #84312
    Sabuntu
    Member

    actually he was cooperative and tried to explain as simple as he could but i’m not that clever to catch him up :)

Viewing 25 results - 22,151 through 22,175 (of 32,468 total)
Skip to toolbar