Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 30,101 through 30,125 (of 32,431 total)
  • Author
    Search Results
  • #56809

    In reply to: What is a bozo?

    drmike
    Member

    Heh heh.

    Can I suggest my ex? :)

    #57573
    fel64
    Member

    Perhaps someone can, but probably it’s unnecessary. :) I think adding ads does make it commercial, but that’s pedantism. We could tell you how to fill out your config.php for you and the rest is veeeery likely plain sailing. Did you install your own wordpress?

    Off the top of my head required info is the URL you want the forum at, if you want ugly URLs ( ?topic_id=59), pretty (/topic/59 I think?) or awesome (/glorified-notebook-discussion-thread/), the absolute path to your wordpress install, and your Akismet key (it’ll be in your wordpress wp-config.php file). Database info you’ll be able to copy from wp-config yourself plus it’s stupid to publish such a thing on a forum.

    #57438
    Vili
    Participant

    My header title tag reads like follows, I think you can modify it to fit your setup:

    <title>
    <?php if ($forumpage == TRUE) {
    bb_title();
    echo " :.: AKNI";
    } else { ?>
    <?php wp_title(' '); ?>
    <?php if(wp_title(' ', false)) { echo ' :.: '; } else { echo "AKNI: "; } ?>
    Akira Kurosawa News and Information
    <?php if (is_utwtag()) { echo ': '; UTW_ShowCurrentTagSet('tagsettextonly'); } ?>
    <? } ?>
    </title>

    The last condition with UTWTAG is for the Ultimate Tag Warrior plugin — remove it if you don’t use it.

    To see how the title works across the site, I think it’s easiest if you just visit http://akirakurosawa.info/

    #1848

    I would like to know if someone can install and integrate BBpress with my WordPress site. I know that people install wordpress on non-commercial sites for free. My site is a blog for professionals, that I may ad some advertising just to pay for the site space. Can someone help me?

    However I read (http://bbpress.org/forums/topic/1140?replies=28#post-7450 atomAstro wrote) that there were some problems with integrating it. Any suggestions? I don’t know much about php and the like. I know minimal html and most of that has been depracated (I assume).

    I am good at following instructions though. As long as they are step by step :-)

    #57437
    fel64
    Member

    If you have the same code for the header then I think you need some conditional if statements in there to check if it’s wp or bb. This isn’t really straightfoward I’m afraid, but then I’m in the dark here (haven’t done it myself) so perhaps it is and I don’t know about it.

    #57673

    In reply to: Tags not separating

    Arlo
    Member

    Brackets were just my (apparently needless) way of indicating a text field. Sorry :)

    Flickr works with spaces and quotes, but if you use commas, they are stripped.

    #57672

    In reply to: Tags not separating

    fel64
    Member

    I don’t understand the system. Spaces are stripped, or alternatively commas are ignored? What’s with the square brackets?

    Not that it really matters, I’m just curious about what could be a good system :)

    #57434
    davidbaldiwn
    Member

    snakefoot, Thanks!

    I fell kinda stupid, I moved this up to the top and now it works!

    $bb->WP_BB = true;
    require_once( '../wp-blog-header.php' );

    It still dosn’t work with an absolute path, which means this meathod dosn’t work for subdomains.

    Now that the header and footer work, I’ll follow the rest of vilimaunula’s steps to see if I can get this looking better…

    Thanks for helping a nooob!

    -Baldwin

    #57432
    davidbaldiwn
    Member

    I changed my config file to this:

    $bb->WP_BB = true;
    require_once( '../wp-blog-header.php' );

    and to this:

    $bb->WP_BB = true;
    if (file_exists('../wp-blog-header.php'))
    require_once('../wp-blog-header.php');
    else
    if (file_exists('../../wp-blog-header.php'))
    require_once('../../wp-blog-header.php');

    and in either instance I still recieve this error:

    Fatal error: Cannot redeclare is_serialized() (previously declared in /home/turner/public_html/ppacp/forums/bb-includes/wp-functions.php:976) in /home/turner/public_html/ppacp/wp-includes/functions.php on line 165

    Thanks for the help!

    -Baldwin

    http://www.ppacp.org/forums/

    #57431
    fel64
    Member

    Baldwin, looks like your second error is a good error because it’s loading! I believe that the problem is that WP and BB are not set up to synchronise. Have you got this in your config.php?

    $bb->WP_BB = true;
    require_once( '../wp-blog-header.php' );

    #57429
    davidbaldiwn
    Member

    I tryed just about everything, and I kept getting this error:

    Warning: main(home/turner/public_html/ppacp/wp-blog-header.php) [function.main]: failed to open stream: No such file or directory in /home/turner/public_html/ppacp/forums/config.php on line 62

    Fatal error: main() [function.require]: Failed opening required ‘home/turner/public_html/ppacp/wp-blog-header.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/turner/public_html/ppacp/forums/config.php on line 62

    So, I changed the location to this:

    require_once('../wp-blog-header.php');

    and now I get this error (something different, yay!):

    Fatal error: Cannot redeclare is_serialized() (previously declared in /home/turner/public_html/ppacp/forums/bb-includes/wp-functions.php:976) in /home/turner/public_html/ppacp/wp-includes/functions.php on line 165

    I’m not an expert, but I think the former worked, but that there’s something else wrong.

    Thanks for your help!

    -Baldwin

    #57428
    fel64
    Member

    Yes! In many cases using a relative path is essential to the require and include functions.

    Maybe it’s like this? You’ll know what I mean, anyway.

    /home/turner/public_html/wordpress/wp-blog-header.php

    #57427
    davidbaldiwn
    Member

    Mine looks like this:

    require_once('http://ppacp.org/wp-blog-header.php');

    am I supposed to use a relative path?

    Thank you,

    -Baldwin

    #57706
    M
    Member

    An admin page would be handy. That’s why I had said “the ‘hard’ part would be making an admin page.” It is necessary for this in my opinion.

    I think with this it would be better to put the post count in the usermeta, rather than the user title. That way for added and deleted posts all you have to do is add or subtract. The most accurate way, however, would probably be to count all the posts and update the meta every time a post is made. If a topic is deleted, a recount would need to be made too. That’s why I liked the “on the fly” method. Fewer errors that way.

    Also, regarding query count, I believe it’s still one query per post, but I could be wrong. I guess the difference would be whether you’re pulling the user title from the usermeta or counting the posts on the fly. I’ll mess around with this more this afternoon.

    And sorry to irritate, it’s just not that complex IMO. Even your method :)

    #57767
    M
    Member

    Hmm, I tried that yesterday and it didn’t seem to work. I checked out the WPAjax class and tried commodAjax.transport.responseText, this.responseText, and a couple more variations on that theme.

    Once I get an admin backend for my plugin I’m going to upload it so that everyone can see the source. It’ll probably be a little easier to answer questions then.

    commodAjax.request(commodAjax.url); is requesting the admin-ajax.php file, sending it some postdata, and it’s responding with a 1 (success), 0 (borked data), or -1 (permissions error).

    Thanks.

    #1877

    Topic: localizing plugins

    in forum Plugins
    nicola86
    Member

    Hi,

    I’ve localized a plugin with

    $ xgettext --keyword=__ --keyword=_e -j --from-code=UTF-8 -o plugin.pot *.php

    I translated it all and made the .mo file from the .po

    $ msgfmt plugin-it_IT.po -o plugin-it_IT.mo

    Now, what I have to write in the plugin file? With this line the plugin outputs in english, instead of italian:

    load_plugin_textdomain('onlinelist','my-plugins/');

    #57705
    fel64
    Member

    About two lines of your plugin are counting posts, and if you didn’t write the query into a variable first it would be one. Far more code is taken up with anything else, hence it’s not just a modification.

    In my opinion a neat and efficient solution would be to hook onto the new and delete posts hooks, recalculate title, set in usermeta, and let bb grab that title when it’s needed exactly the same as now. This means an additional database query and calculation of the new title only when new posts are made. Your method means that you do that extra work every time a post is fetched.

    To make this also be neat, you should have the possibility of setting titles and corresponding post count values in bb admin rather than having to change values across several lines to get the desired modifications (changing/adding one line of code would still be acceptableish, I suppose). You should also (in my opinion, yeah) use a far neater method of comparing the post count and setting the title from a code perspective; I dislike a long list of elseifs (at least use cases if you have to do it in this sort of way). I would, off the top of my head, use

    //$postcount already found
    foreach( $possibletitles AS $postcountrequired => $title ) {
    if( $postcount >= $postcountrequired ) {
    $newtitle = $title;
    }
    }

    because that’s like five lines of code and it doesn’t matter how many different post count/title combinations are set, it does not increase in complexity. Putting $possibletitles together from the bb admin would not be difficult either.

    So the three or four things you have to do to make this plugin as I like it are counting posts, bb admin panel set up, comparing postcount and possible titles and setting this in the usermeta. “All this hate” comes from the fact that I thought I’d just explained that you can’t just modify the post count plugin to have this functionality – you need way more code than there is in counting posts to do all this – and then you came along and said that all you need to do is just modify the post count plugin. That irritated me.

    Sam, I don’t agree with this approach in all cases either but I prefer the very small amount of extra (unnecessary) data in the database (maximally one new record per member with one post or more) to re-querying and recalculating every time a post is displayed. :)

    #57766
    Sam Bauers
    Participant

    Try:

    alert(commodAjax.transport.responseText);

    I’m not sure if it will work though.

    Would it be too insulting to refer you to the source code of the WPAjax class? There are answers there if you are able to interpret the code.

    Also, if you are not actually returning some output at the page you are requesting, then it might be returning undefined. Again I’m not sure, being that I (like fel64) volunteer my time to answer queries here, I am not necessarily able to fully troubleshoot your issue (especially since you only present half of the equation – i.e. the client side AJAX request).

    You catch more flies with honey. Etc., etc.

    #57765
    M
    Member

    I find it a bit insulting that all I get is Google links. Don’t get me wrong… for most people who don’t search the forums that’s a great solution. I have searched the forums and Google extensively however, and I’m not seeing a whole lot of helpful stuff when it comes to WordPress’s custom wpAjax class. I’ve gone over prototype tutorials, documentation pages, and more and I haven’t found a solution.

    Also, please explain yourself a little further regarding your “function call” comment. Are you referring to commodAjax.request(commodAjax.url);? Because I believe that’s correct. At least that’s how other people have been doing it. If you’re talking about alert(commodAjax.responseText); that was for debug purposes only. I’m trying to get the value. That’s my original request.

    #57702
    M
    Member

    Wow, so much hate… I’m not trying to insult anyone’s sense of intelligence by making this appear easier than it is. It’s just dead simple. I see no great complexity in it. It’s still a “basic MySQL query.”

    Why muck around in the usermeta? That’s far too much work if you ask me.

    Perhaps I’m wrong.

    function get_user_title( $id ) {
    global $bbdb;

    $pc_query = "SELECT COUNT(post_id)
    FROM $bbdb->posts
    WHERE poster_id = $id
    AND post_status = 0";
    $post_count = $bbdb->query( $pc_query );

    if( $post_count <= 10 ) {
    $title = "Noob";
    } elseif( $post_count <= 20 ) {
    $title = "Might stick around";
    } elseif( $post_count <= 30 ) {
    $title = "Title for 30";
    } elseif( $post_count <= 40 ) {
    $title = "Over the hill";
    .
    .
    .
    } elseif( $post_count <= 90 ) {
    $title = "Post whore";
    } elseif( $post_count > 100 ) {
    $title = "Regular";
    } else {
    $title = "Error";
    }

    return $title;
    }

    This way you don’t have to mess around with updating anything… it’s generated on the fly.

    Do take note that I haven’t tested the code. I wrote it in about 5 minutes, so I didn’t get around to testing. It’s the concept I’m talking about though.

    #57426
    Vili
    Participant

    Just to make sure, you don’t actually use “require_once(‘path/to/wp-blog-header.php’);”, but rather have the “path/to/” bit modified to correspond with the correct folder path to your WordPress installation, right?

    As far as I can see (and I am no real coder, either), somehow your current setup still fails to connect to WordPress, and therefore the WP functions, including get_header, are unavailable to bbPress.

    #1875
    M
    Member

    Here’s the code:

    var commodAjax = new WPAjax( false, 'post-'+postid );
    commodAjax.options.parameters += '&action=rate_post&id=' + postid + '&rate=' + rate;

    // Execute Order 66
    commodAjax.request(commodAjax.url);
    alert(commodAjax.responseText);

    Here’s the response: undefined

    According to FireBug, I am successfully sending postdata and getting a response of “1”. I’d like to take the response and make use of it, but it’s not working.

    I’m writing an extension that allows post rating (user moderation) and this is the final hitch I’m running into. I want to make sure that if the request is not sucessful (ie, it returns 0 or -1) that the browser doesn’t continue executing stuff.

    Sorry, it’s a bit borked, I’ll post more code if necessary.

    #1873
    Vili
    Participant

    If you have integrated your bbPress with WordPress, you must have at least once thought about the problem of your users having two separate interfaces for modifying their profile settings.

    Furthermore, if your bbPress and WordPress both use a good deal of plugins, you end up with a situation where some settings (say, email notifications for new WordPress posts) have to be set on a WordPress profile page, whereas other settings (for example email notifications for new forum topics or replies) must be set through the bbPress interface. This will confuse your average user so much that they will simply not use any of your website’s fancy features at all.

    It would therefore be good to have just one user profile page that would merge everything from the two together. Preferably, this should also be a page that could be displayed within the website template, so that it would really look like being part of the website, and not behind a completely different-looking interface as is the case with WordPress user pages. (Those also scare people.)

    Would this be doable?

    I am personally not much of a coder, so I don’t know all the details of what is going on when the WordPress and bbPress profile pages get served, and how various plugins get to modify that process by adding new fields and buttons on those pages.

    I assume, however, that the most difficult thing for a “one profile page to rule them all” sort of an approach that I am thinking about here would be to keep track of additions to those profile pages. It should somehow be able to notice that some new bbPress or WordPress plugin has modified one of those user profile pages, and incorporate those changes to the merged profile page that is actually displayed to the end user.

    I would love to hear some input from those of you who know more than I do about the behind-the-scenes activity when it comes to user profiles in bbPress and WordPress. What do you think, how difficult would a plugin like this be to code?

    #57667

    In reply to: Tags not separating

    Arlo
    Member

    Ok, I changed line 1255 in functions.php to:

    $words = explode(' ', $tags);

    And this seems to allow both spaces AND commas in new post tags. If there’s a better way to do this, I’d like to know :)

    #57517
    tecfre
    Member

    finally i was able to do it myself .. hehehe :D … Still more things need to be added. it was all from avatar_upload plugin and memberlist plugin. I just tried to modified some code and it worked …

    :-D

    check out

    http://www.tecfre.com/memberlist/ (hosted on wordpress)

    http://www.tecfre.com/forum/mlist.php (on forum)

Viewing 25 results - 30,101 through 30,125 (of 32,431 total)
Skip to toolbar