Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'code'

Viewing 25 results - 27,726 through 27,750 (of 32,516 total)
  • Author
    Search Results
  • #64874
    bobbyh
    Member

    This also happens to me! However, I’ve never looked into it…

    I just looked, and bbPress uses newlines to indicate breaks. This is parsed into <p>’s by a filter upon display. However, the edit textarea shows the unparsed text with just the newlines, and this gets mangled by tinymce.

    If you set this tinymce config value, though, it will turn newlines into br’s, which should fix this problem for new posts:

    * http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/convert_newlines_to_brs

    I just tested this, and it works on new posts! (It won’t work on old posts…)

    #64831
    bobbyh
    Member

    Try this (inserted into the code I had above):

    <?php if ( ( $i == 0 ) && ( $page == 1 ) ) { echo 'class="firstpost"'; } elseif !($i % 2) { echo ('class="alt"'); }?>>

    #64602
    bryan868
    Member

    I’m having this same problem. Fresh installation using version 0.9.0.2.

    Referrer is OK, beginning installation…
    >>> Setting up custom user table constants

    Step 1 - Creating database tables
    >>> Create table bb_forums
    >>> Create table bb_posts
    >>> Create table bb_topics
    >>> Create table bb_topicmeta
    >>> Create table bb_tags
    >>> Create table bb_tagged
    >>> Added index wp_users UNIQUE KEY user_nicename (user_nicename)
    >>>
    >>>>>> Duplicate key name 'user_nicename'

    Step 2 - WordPress integration (optional)
    >>> WordPress address (URL): MYURL
    >>> Blog address (URL): MYURL
    >>> WordPress cookie secret key set.
    >>> WordPress database secret set.
    >>> User database table prefix: wp_

    Step 3 - Site settings
    >>> Site name: MYSITENAME
    >>> Site address (URL): MYURL
    >>> From email address: MYEMAIL
    >>> Key master role assigned to existing user
    >>>>>> Username: admin
    >>>>>> Email address: MYEMAIL
    >>>>>> Password: Your existing password
    >>> Description: Just another bbPress community
    >>> Forum could not be created!
    >>> Key master email sent

    There were some errors encountered during installation!

    I should note that I assigned the key master as my admin user in WordPress. When I go to my forum I receive the following error….

    Parse error: syntax error, unexpected T_STRING in /MYPATH/bb-config.php on line 22

    #64615
    lmsalgado
    Member

    I was having the exact same problem, but with normal WP (not WPMU).

    My problem was that I instaled wp and bbPress both in subfolders, like:

    http://www.mysite.com/wordpress

    http://www.mysite.com/bbpress

    The problem was on cookies, since bbPress was creating them on root and wordpress both on root and on ./wordpress – but it seems that the ‘good cookie’ was the one on ./wordpress.

    The ideal solution would be to set WP to use cookies only on root, but I wasn’t able to do it in a simple way. So I configured bbPress to set cookies on ./wordpress.

    This was done by simply adding a line to bb-config.php:

    $bb->cookiepath = ‘./wordpress’;

    Now it seems that all is working fine.

    Hope it helps you too ;)

    #3349

    Topic: My Private Forum

    in forum Showcase
    Shagalaga
    Member

    <—(Link)

    for me and my Friends, it´s new :-)

    i pimped mikelothars scoun a little bit.

    #64253

    In reply to: Set Topic ID

    _ck_
    Participant

    Not quite sure what you are asking/doing buy try adding global $topic; before your code if you find the function don’t know which topic is active.

    #64867
    mrhoratio
    Member

    I’ve tried mod_rewrite, but running into problems with the wp_redirect functions in bbPress redirecting the page after the URL has been rewritten, so that the URL changes back to the longer form.

    For example, this mod_rewrite rule:

    RewriteRule ^profile/username forums/profile/username [L]

    will rewrite:

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

    to:

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

    Except, that after its been rewritten, bbPress forces a redirection, causing the URL in the browser window to change to the longer form.

    #64854
    chrishajer
    Participant

    It made sense to me, but I didn’t think it would be happening any time soon. Since WordPress just got this functionality in 2.5, I figured it would be a while until bbPress got it since it’s not quite to version 1 right now. The projects they took on for the Google Summer of Code were related to import/export, not anything like this, that I know of.

    https://codex.wordpress.org/GSoC2008#Web_Forums_Export.2FImport_Standard_and_Tools

    #3348
    mrhoratio
    Member

    Is it possible to shorten a profile link such as:

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

    to:

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

    or to:

    http://www.example.com/username

    or to:

    http://my.example.com/username

    or to:

    http://username.example.com

    Thanks in advance.

    #64283
    hmcnally
    Participant

    For those using a 1and1.com hosting package, try adding..

    Options -MultiViews

    to the top of the .htaccess file, and append the mod_rewrite stuff after it. I guess with their shared serving packages, the MultiViews just goes nutty (apparently it’s enabled, though), and needs to be turned off before using mod_rewrite. They actually document this behavior at http://faq.1and1.com/dedicated_servers/managed_server/3.html

    I guess this means I’m in favor of dropping MultiViews, though not fervently.

    #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…

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