Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 27,701 through 27,725 (of 32,481 total)
  • Author
    Search Results
  • #64716
    Sam Bauers
    Participant

    @isaacgreen

    You guessed right. :)

    #64861
    mrhoratio
    Member

    It looks like the culprit is the wp_redirect function() which includes the header() function. This function appears in several bbPress files. I’m not exactly sure what the intent of them are.

    In the functions.php file, I commented out lines 2061 and 2062 in the bbPress functions.php file:

    if ( $check != $uri && $check != str_replace(urlencode($_original_id), $_original_id, $uri) ) {
    //wp_redirect( $permalink );
    //exit;
    }

    This seems to be helping with the problem. Not sure if it’s going to break something else though.

    #3346
    mrhoratio
    Member

    I have bbPress installed in a directory called “forums” on my web server. I have Pretty Permalinks enabled and working. To view the profile of a member, I can go to this URL:

    http://www.example.com/forums/profile/membername

    However, I would like the url to be:

    http://www.example.com/profile/membername

    I’ve tried writing a mod_rewrite rule which rewrites the latter to the former. However, instead of rewriting it, it redirect and exposes the URL. For example. Typing this into the browser:

    http://www.example.com/profile/membername

    Redirects to this, instead of rewriting it:

    http://www.example.com/forums/profile/membername

    Here is the mod_rewrite I am using:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    Options +FollowSymlinks
    RewriteRule ^profile/membername$ /forums/profile/membername [L]
    </IfModule>

    If I change the rule to rewrite the URL to a simple text file, it rewrites properly and masks the URL. For example, this works:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    Options +FollowSymlinks
    RewriteRule ^profile/membername$ /forums/textfile.txt[L]
    </IfModule>

    Another example, I wrote this rule, as a test, to rewrite a URL to the rewrite-rules.php file:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    Options +FollowSymlinks
    RewriteRule ^profile/membername$ /forums/bb-admin/rewrite-rules.php [L]
    </IfModule>

    I type in this url into my browser:

    http://www.example.com/profile/membername

    And it redirects to ths instead:

    http://test.doublebad.com/forums/

    If I replace all the text in the rewrite-rules.php file with “test text”, then the URL rewrites properly.

    So it seems that when you are rewriting and URL to a bbPress php file, it will always redirect instead of rewriting, which is quite annoying. I’m trying to trace in the bbPress functions and settings where this is occuring. But I’m having no luck.

    Any suggestions?

    #60386
    mrhoratio
    Member

    I just found a blog post about this, where the author has made the code into a plugin. It’s available for download here:

    How to remove forum and topic keyword from bbpress url

    The author lists two minor issues here, which hopefully someone here can suggest a fix for:

    • The Link to BBpress admin board link does not work from main site. It redirects to home page. You will need to manually type the link to go inside.

    • In case you type something which does not exists as http://sitename.com/<bbpress-directory>/sdaksda it returns http://sitename.com/<bbpress-directory&gt:// . An extra slash.

    #56471
    mrhoratio
    Member

    Chris, you have a point. However the URL structure of forums and topics always begin with “forum” or “topic”. As in:

    http://www.example.com/bbpress/forum/pets-discussions/

    http://www.example.com/bbpress/topic/my-sweet-dog

    So it would seem that it should be possible to remove the “bbpress” from the URL without interfering with a WordPress installation.

    Having said that, I think the solution proposed in the thread I referred to in my last post (https://bbpress.org/forums/topic/nicer-slug-url-rewrite-plugin-done) is a much more elegant solution for shortening the bbPress URLs.

    #56469
    mrhoratio
    Member

    Just found an earlier thread which hits on a similar problem with shortening the bbPress URL:

    nicer slug url rewrite plugin (done!)

    In the thread’s example. In shows you how to shorten a url like:

    http://www.example.com/bbpress/forum/pets-discussions/topic/my-sweet-dog

    to:

    http://www.example.com/bbpress/pets-discussions/my-sweet-dog

    Now, if it could also be shortened to:

    http://www.example.com/pets-discussions/my-sweet-dog

    That would be even better.

    #56464
    mrhoratio
    Member

    Hi bobby, I tried out your hack in bbPress 0.9, and it doesn’t seem to work. Here’s what I did:

    I have my bbPress directory installed in a directory called “forums” in the root web directory. So the URL to access the forums’ home page is:

    http://www.example.com/forums

    and accessing a forum titled “test forum” is at this URL:

    http://www.example.com/forums/forum/test-forum

    a topic titled “test topic” is at this URL:

    http://www.example.com/forums/topic/test-forum

    I implemented your hack, and changed “forum” to “board” in the template-functions.php. I copied the rewrite rules from rewrite-rules.php and placed them into .htaccess file in the root web directory. I also added the two lines of code you suggested in that file:

    RewriteRule ^board/(.+)/page/([0-9]+)$ /forum.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^board/(.+)/?$ /forum.php?id=$1 [L,QSA]

    I also tried adding this to the rewrite-rules.php:

    RewriteRule ^board/([^/]+)/page/([0-9]+)/?$ <?php bb_option( 'path' ); ?>topic.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^board/([^/]+)/?$ <?php bb_option( 'path' ); ?>topic.php?id=$1 [L,QSA]

    When I go to this URL:

    http://www.example.com/board/test-forum

    I get a 404 error.

    However, when I go to this url:

    http://www.example.com/forums/forum/test-forum/

    It redirects and changes the URL in the address bar in the browser window changes:

    http://www.example.com/forums/board/test-forum/

    That also brings up a 404 page.

    Also, when I go this URL:

    http://www.example.com/topic/test-topic

    The URL works, but it redirects and changes the URL in the address bar in the browser window changes to:

    http://www.example.com/forums/topic/test-forum

    I am a little perplexed as to what is going on.

    #64842
    bobbyh
    Member

    Chris, I did disable plugins, but I hadn’t wrapped the Email Notifications plugin function call with a function_exists wrapper, so my active theme stopped working when I did so. I then oh-so-intelligently reasoned that this plugin couldn’t be the cause of the problem, so I moved on…

    I couldn’t just disable all plugins and test with a default theme because of the existence of private forums. Finally, I moved the database to a private test server (and used a HOST file) and went through all the plugins carefully one-by-one until the problem was fixed.

    Let my idiocy be a lesson for others: wrap your plugin function calls with function_exists wrapper! :-)

    #64849

    In reply to: Reply Bug

    bobbyh
    Member

    gerikg, I found your site and looked at a sample page. The href of the “log in” link is as follows:

    http://kiaspeed2.com/forum/bb-post.php&quot; enctype=&quot;multipart/form-data&quot; hack=&quot;bb-login.php

    It should just be this:

    http://kiaspeed2.com/forum/bb-login.php

    The text of this href comes from function post_forum inside /bb-includes/template-functions.php. Did you do a core hack of this function? If so, reversing it should fix your problem. Otherwise, one of your plugins has screwed up this function and it needs to be disabled…

    #64829
    bobbyh
    Member

    Lookfab, here’s a slight tweak to the default kakumei topic.php theme file that should do what you want:

    <ol id="thread" start="<?php echo $list_start; ?>">

    <?php $i = 0; ?>

    <?php foreach ($posts as $bb_post) : $del_class = post_del_class(); ?>

    <li id="post-<?php post_id(); ?>"<?php if ($i == 0) { echo 'class="firstpost"'; } elseif !($i % 2) { echo ('class="alt"'); }?>>

    <?php bb_post_template(); ?>

    </li>

    <?php $i++; ?>

    <?php endforeach; ?>

    </ol>

    You can then style the class “firstpost” using CSS to make it stand out however you want…

    I didn’t test this, but I think it should work either by itself or with a tweak or two.

    #56461
    bobbyh
    Member

    I did something similar, but it required a core hack. I renamed the second “forum” to “board”. It required two steps:

    1. With version 0.8.3, I modified line 363 of /bb-includes/template-functions.php to this:

    $link = bb_get_option( 'uri' ) . "board/" . $forum->$column . ( 1 < $page ? "/page/$page" : '' );

    2. I created an htaccess file by copying the text from /bb-admin/rewrite-rules.php, with two extra lines:

    RewriteRule ^board/(.+)/page/([0-9]+)$ /forum.php?id=$1&page=$2 [L,QSA]
    RewriteRule ^board/(.+)/?$ /forum.php?id=$1 [L,QSA]

    #64840
    bobbyh
    Member

    Thanks Chris! All my PHP scripts were OK (no syntax errors), but eliminating one more possible cause is always helpful. :-)

    It turns out that this Email Notifications plugin (https://bbpress.org/forums/topic/plugin-post-notification?replies=44) was causing the problem. After disabling that plugin, there are no “delays in posting” and there is never a 500 error. There must be a scaling problem with the plugin that started after the tables hit a certain size…

    Thanks again for your help, Chris! :-)

    #64839
    chrishajer
    Participant

    How about configuring custom logging temporarily, just to be sure you are seeing the logged errors?

    http://us3.php.net/set_error_handler

    I think the delay in posting is not due to server load but due to this 500 error. It’s thinking about something then it fails.

    If the script had a syntax error, I would think it would fail more quickly. You can check all your php scripts for syntax errors if you have command line access if you do something like this:

    shell# find . -name "*.php" -print| xargs -n1 php -l

    (that’s “dash n one” and “php dash el”, lowercase L)

    Looks like you’re on CentOS so that should work OK.

    #64848

    In reply to: Reply Bug

    chrishajer
    Participant

    That’s pretty interesting. Not sure why it’s not working but I think you can cause a different problem by turning off CheckSpelling in you .htaccess file. That will cause it to fail outright, I think, rather than trying to find you a similarly named file. Put this at the top of a file called .htaccess in your forum root folder:

    CheckSpelling Off (not sure if the off needs to be capitalized or not.)

    See what errors you get after that. Worth a shot anyway.

    #64838
    bobbyh
    Member

    Thanks for thinking about my problem, Chris! :-)

    I don’t understand the problem either… I’m sure the PHP errors are being logged. I just triple-checked my httpd.include file, and it has this line: ErrorLog /var/www/vhosts/weddingbee.com/statistics/logs/error_log. This is the location that I’ve been looking for the PHP errors. There are other PHP notices/errors from this boards subdomain (mostly from bots looking for non-existent Front Page files), but nothing about this error.

    In the access_log, I do see lines like this:

    74.235.132.92 - - [06/May/2008:04:32:32 -0400] "POST /bb-post.php HTTP/1.1" 500 366 "http://boards.weddingbee.com/topic/second-guessing-everything" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727)"

    However, that’s not what we want…

    Last night, I did some searches and found this comment on php.net which said that the two reasons for a missing error in the error_log were “(1) you did not configure error_log output in php.ini, and (2) the script has a syntax error and did therefore not execute.” However, the script does appear to be executing at least partially, because the post/comment does post. Also, if you visit the bb-post.php page (http://boards.weddingbee.com/bb-post.php) directly, the page does execute (with a die).

    I too am confused by why the POST takes such a long time. The load average for the webserver and the database server are fairly low…

    #64836
    bobbyh
    Member

    I turned off permalinks (set it to false in config.php) and the error still occurred…

    #64032

    This code works fantastic! Thanks

    #3339
    bobbyh
    Member

    A few days ago, out of the blue, users of my bbpress forum reported that submitting a new topic/post resulted in an error. Previously, my bbpress forum was working perfectly. However, over the last few days, I have verified that if you submit a new post or leave a comment, the browser takes you to bb-post.php, where the page hangs. You can verify this on my forum using user “testuser” and password “test123”.

    There are a few weird things about this:

    • I hadn’t touched the server for some time prior to this sudden problem, so it’s weird that the problem started, since I hadn’t changed anything
    • I’ve been running two bbpress forums authenticated against the same WP user table. The problem is only with the first bbpress installation, while the second bbpress installation continues to work with no problems.
    • When you post, the browser returns a 500 internal server error, and doesn’t display a “die” message, e.g. “You need to actually submit some content!”
    • Although the browser returns a 500 internal server error, the posted content does go through.

    I’ve hand-inspected http://boards.weddingbee.com/bb-post.php, and it has exactly the same PHP code as http://classifieds.weddingbee.com/bb-post.php. I’ve tried everything I can think of… I disabled plugins and Akismet, and the problem didn’t go away. (I’ve turned them back on.)

    I’m using bbPress 0.83, with bb_db_version 788. I haven’t upgraded to bbPress 0.9.0.2 yet because I’ve integrated my WordPress 2.33 install with two bbPress installs and a Mediawiki install, and it will be a ton of work to reintegrate. However, that is the next step…

    Does anybody have any ideas? :-)

    #3337

    Topic: Insurgency.cz forum

    in forum Showcase
    ajvngou_
    Member

    I just use another theme and moddified, couse my code skills are not good. I moddified www theme too and i triyed create 1 nice theme for site and forum. I hope its ok now. I must change few things at code (size, avatars etc) but i hope its nice. its CZECH lang btw…

    http://www.insurgency.cz/bbpress

    #3333

    Topic: Profile hook/filter

    in forum Plugins
    Bloggsbe
    Member

    Hi!

    I’m working on a plugin that I want to show some info on the profile page. The only hook I’ve found that lets me do that is get_profile_info_keys, but that puts the info on top of the profile page (seems like it does it before the header) and where I actually want it.

    Anyone have any ideas on what I can use to get my “stuff” in the profile page?

    Regards,

    Rune

    #3282
    chilledfresh
    Member

    I’ve been running into cookies issues while trying to integrate bbPress into my existing WPMU site. My WPMU and bbPress installs are located in separate directories on my server (/blogs and /youngadults/forums).

    bbPress is currently setup so that when users log into the forums, they are automatically logged into WPMU as well. However, for some reason this is not working the other way around – if I log into WPMU first, I am not logged into bbPress.

    Does anyone know of a way to log into bbPress when going through the WPMU login?

    I am using the MD5 Insecurity and Mouldy Old Cookies plugins, along with this snippet of code in the bb-config.php file:

    $bb->usercookie = ‘wordpressuser’;

    $bb->passcookie = ‘wordpresspass’;

    chrishajer
    Participant

    In the database, the value is stored in the bb_topicmeta table. A record that has a meta_key of uri holds the value, I think. That is record #3 in my fresh installation. It might be different in yours. Just find the key of uri and the value is the one you want, I think.

    #3330
    antoniop
    Member

    I have had bbpress working on my doteasy account, and I decided to reinstall it – probably shouldn’t have :( When I contacted them, they informed me that they would try running the script and installing it…and I got this message back

    “Hello Antonio,

    This script appears to be incompatible with our hosting servers. Please try using a different script.”

    “The database failed to install. You may need to replace bbPress with a fresh copy and start again.”

    Now here is what happens when I try to install the script.

    Your site settings have been saved and we are now ready to complete the installation. So what are you waiting for?

    Then when I proceed to the final step I get this error.

    “Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, advancedsupport@doteasy.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.”

    At this point, if I refresh the page it goes back to the installer and I get this message ” bbPress Installation

    Welcome to the bbPress installer

    Step 1 – Database configuration

    « completed

    Step 2 – WordPress integration (optional)

    « skipped

    Step 3 – Site settings

    Installation complete!

    Show installation messages: “

    If I then go back to atriskstoriesofhope.com/bbpress it wants to go back through the installation. What should I do?

    #55403

    **update**: just found https://bbpress.org/documentation/faq/#pretty-permalinks

    after looking for days, don’t know why it took so long to find. this did the trick!


    Also having a problem with pretty permalinks. i am on bluehost with the following:

    wordpress 2.5.1 installed at example.com/blog

    bbpress 0.9.0.2 installed at example.com/bb

    i do have my wp akismet key applied in bbpress, but other than that no wp integration. bbpress works fine until i activate pretty permalinks. at that time, i can see all of my topics & stuff, but i just get 404 when i try to get to them.

    here’s an interesting thing i discovered: both installed to my site via SimpleScripts. WP works fine, but bb appears to have no .htaccess file at all. i do see one in attached to a theme, but that’s it, and apparently not useful there.

    since this seems to be the issue, sort of narrowed down, i created an .htaccess file using the code shown by jethro, but i know there’s something missing. it didn’t break my site, but i couldn’t even get to admin area to see if i could make the permalinks work.

    i’m not a programmer, but if anyone can tell me what code i need to have in the .htaccess file, i can make the file and upload it.

    thanks!

    #64778
    mrhoratio
    Member

    I did some more digging, and it looks a way to do is to not use BB_query at all, but to use $bbdb->get_results instead:

    $startdate=”20070602103049″;

    $enddate=”20080212090232″;

    $topics = $bbdb->get_results(“SELECT * FROM $bbdb->topics WHERE topic_start_time BETWEEN $startdate AND $enddate ORDER BY topic_start_time DESC”);

Viewing 25 results - 27,701 through 27,725 (of 32,481 total)
Skip to toolbar