Home » » Blog Tips 블로그 팁

How to remove forum and topic keyword from bbpress url 어떻게 bbpress URL에서 포럼 주제 키워드를 제거하려면

I had been trying lot of forum softwares ( around 5 till now ) from last Friday and was testing BBPRESS yesterday. 난 5 일 (주위에 지금까지)에서 지난 금요일 포럼 소프트웨어의 많은 노력왔다 어제 BBPRESS 테스트했다. The new version9.x has lot of improvement over its 8.x version but one thing I found common in both of them 새로운 version9.x은 8.x 버전 이상하지만 많이 개선의 공통점은 양쪽 모두에서 발견 한가지

  • “Forum” keyword was appended when you accesss any forum eg http://sitename.com/<forum-directory>/ forum /<forum slug> "포럼"키워드를하면 어떤 포럼 예 http://sitename.com/ <forum-directory> / 포럼 / <forum slug> accesss 추가되었습니다
  • “topic” keyword was also appended for every post made eg http://sitename.com<forum-directory>/ topic /<actualy topic slug> "항목을"키워드는 또한 모든 게시물에 대한 <forum-directory> / 주제 / <actualy 주제 http://sitename.com 예를 들어, 추가 제출되었다 slug>

Now I understand why both the keywords are reqired but again from SEO point it has no meaning unless somebody runs a forum on “forums” topic. 이제 이해가 왜 두 키워드를하지만, 다시는 아무 의미도하지 않는 사람 "항목을"포럼에서 포럼을 운영하고있다 SEO 시점에서 reqired있습니다. The next thing I did was look around for a hack and luckily 그 다음 일은 다행히 및 해킹에 대한 주위를 둘러했을 뿐인데 at this post there was a solution 이 게시물을 거기에서 해결되었다 , but not actual plugin was supported. 하지만 실제 플러그인을 지원했다. I copied the code given there and tested around and was successful. 나는 거기에 주어진 코드를 복사하고 주위에 테스트를 성공적이었다.

Before I start, I have just tested around with the code given by the memebers over there. 시작하기 전에, 난 그냥 코드를 거기 memebers에 의해 주어진 주변을 테스트했다. So test it before you use it. 당신은 그것을 사용하기 전에 그래서 그것을 테스트합니다. And moreover I am not supporting it as I did not make it and cant do it either. 내가 그것을하지 못할하거나 그렇게하지 않았다 그리고 또 내가지지 아니에요.

I made a plugin from the code given and took re-write code for .htaccess files. 내가 코드를 부여에서 다시했다 -에 대한 코드를 작성하는 플러그인이다. htaccess 파일. Here is how they look 여기에 그들이 어떻게 보이는

PLUGIN:( Taken from the forum link ) 플러그인 : (포럼 링크에서 촬영한 것)

<?php "? PHP는
/* / *
Plugin Name: Remove Topic Forum 플러그인 이름 : 주제 포럼 제거
Plugin URI: http://bbpress.org/ 플러그인 URI가 : http://bbpress.org/
Description: Allows to remove forum and topic word in url 설명 : URL에 포럼 주제 단어를 제거할 수있습니다
Author: Ashish Mohta 작성자 : Ashish Mohta
Version: 1.0 버전 : 1.0
Author URI: http://www.technospot.net/blogs/ 저자 URI가 : http://www.technospot.net/blogs/
*/ * /

function my_get_forum_link_filter( $link , $forum_id = 0 ) { 함수 my_get_forum_link_filter ($ 링크, $ forum_id = 0) (
//retrieve the forum object / / 포럼 개체를 검색할 때
$forum = get_forum( get_forum_id( $forum_id )); $ 포럼 = get_forum (($ forum_id)) get_forum_id;

//check for rewrite / / 체크 재작성
$rewrite = bb_get_option( 'mod_rewrite' ); $ ( '') mod_rewrite = bb_get_option 재작성;
if ( $rewrite ) { ($ 재작성) (만약
//what kind of rewrite there is? / / 어떤 종류의 재작성 거기에 무엇입니까? slug use “forum_slug” column, else the column is “forum_id” 총알을 사용 ""열, 다른 열 forum_slug "forum_id"입니다
$column = ($rewrite === 'slugs')?('forum_slug'):('forum_id'); $ 컬럼 = ($ 재작성 === '굼벵이 ')?(' forum_slug '):(' forum_id');

// change /forum/pets-discussions in /pets-discussions / / 변경 / 포럼 / 애완 - 토론 / 애완 - 토론
// this work only if the rewrite module is modded! / /이 작품을 재작 성하는 경우에만 모듈 modded입니다!
// and this work only if the slugged name will NEVER / /이 작업을하는 경우에만 slugged 이름 않을 것이다
// be a reserved word like “rss” or “bb-images” / / "RSS Feeds 모바일"또는 "BB 탄 - 이미지"와 같은 예약된 단어
// and this is achieved by a filter on bb_slug_sanitize / / 그리고이 필터에 의해 달성 bb_slug_sanitize
$link = str_replace('forum/' . $forum->$column , $forum->$column, $link); $ 링크 = str_replace ( '포럼 /'. $ 포럼 "$ 열 $ 포럼"$ 열 $ 링크);
} )
return $link.”/”; // Very important line! ."/"; / / 아주 중요한 라인 링크를 $로 돌아가기! // Added extra slash :Ashish / / 추가된 여분의 슬래시 : Ashish
} )

add_filter( 'get_forum_link', 'my_get_forum_link_filter' ); add_filter ( 'get_forum_link', 'my_get_forum_link_filter');

function my_get_topic_link_filter( $link, $topic_id = 0) { 함수 my_get_topic_link_filter ($ 링크, $ topic_id = 0) (
//retrieve the topic object / / 항목 개체를 검색할 때
$topic = get_topic( get_topic_id( $topic_id )); $ 주제 = get_topic (($ topic_id)) get_topic_id;

//retrieve the forum object that is the topic container / / 그 주제에 컨테이너 개체를 검색 포럼
$forum = get_forum( get_forum_id( $topic->forum_id )); $ 포럼 = get_forum (($ get_forum_id 주제 - "forum_id));

//check for rewrite / / 체크 재작성
$rewrite = bb_get_option( 'mod_rewrite' ); $ ( '') mod_rewrite = bb_get_option 재작성;
if ( $rewrite ) { ($ 재작성) (만약
//what kind of rewrite there is? / / 어떤 종류의 재작성 거기에 무엇입니까? slug use “forum_slug” column, else the column is “forum_id” 총알을 사용 ""열, 다른 열 forum_slug "forum_id"입니다
$column = ($rewrite === 'slugs')?('forum_slug'):('forum_id'); $ 컬럼 = ($ 재작성 === '굼벵이 ')?(' forum_slug '):(' forum_id');

//create the “forum/pets-discussions” chunk to show the hierarchical relation forum->topic / / 계층적 관계를 보여 포럼 "청크 / 애완 - 토론"포럼을 만들 "주제
$forum_nice_uri = “forum/” . $ forum_nice_uri = "포럼 /". $forum->$column . $ 포럼 "$ 열. “/”; "/";

//attach the hierarchical chunk to the link / / 링크 계층 청크 첨부
$link = str_replace(bb_get_option('uri'), bb_get_option('uri') . $forum_nice_uri, $link); $ 링크 = str_replace (bb_get_option ( 'URI가'), bb_get_option ( 'URI가'). forum_nice_uri $, $ 링크);

// change /forum/pets-discussions/topic/my-sweet-dog in /pets-discussions/my-sweet-dog / / 변경 / 포럼 / 애완 - 토론 / 주제 / 내 - 달콤한 개 / pets-discussions/my-sweet-dog에서
// this work only if the rewrite module is modded! / /이 작품을 재작 성하는 경우에만 모듈 modded입니다!
// and this work only if the slugged name will NEVER / /이 작업을하는 경우에만 slugged 이름 않을 것이다
// be a reserved word like “rss” or “bb-images” / / "RSS Feeds 모바일"또는 "BB 탄 - 이미지"와 같은 예약된 단어
// and this is achieved by a filter on bb_slug_sanitize / / 그리고이 필터에 의해 달성 bb_slug_sanitize
$link = str_replace('forum/' . $forum->$column , $forum->$column, $link); $ 링크 = str_replace ( '포럼 /'. $ 포럼 "$ 열 $ 포럼"$ 열 $ 링크);
$link = str_replace('topic/' . $topic->$column , $topic->$column, $link); $ 링크 = str_replace ( '주제 /'. $ 주제 - "$ 열 $ 주제 -"$ 열 $ 링크);
} )

return $link.”/” ; // Very important line! $ 반환 링크를 누릅니다. "/"; / / 매우 중요하다 라인! // Added Extra Slash :Ashish / / 등록일 추가 베기 : Ashish
} )

add_filter( 'get_topic_link', 'my_get_topic_link_filter' ); add_filter ( 'get_topic_link', 'my_get_topic_link_filter');

function my_bb_slug_sanitize_filter( $text_slug, $text_original = ”, $length = 0 ) { 함수 my_bb_slug_sanitize_filter ($ text_slug, $ = "text_original, $ 길이 = 0) (
// add “r-” by regex when the string begins with “bb-” or “my-” or is a reserved word / / "r에"정규식 때 문자열 "bb는 시작에 추가"또는 "내"또는 예약된 단어입니다
return preg_replace('/^(my-.*|bb-.*|rss|tags|view|profiles)$/', 'r-$1′, $text_slug); 반환 preg_replace 내 - .* | BB 탄 - .* 관리 | RSS | 태그 |보기 | 프로필 )$/', 'r에 - $ 1', $ text_slug); ('/^(
} )

add_filter( 'bb_slug_sanitize', 'my_bb_slug_sanitize_filter' ); add_filter ( 'bb_slug_sanitize,'my_bb_slug_sanitize_filter ');

?> ? "

.htcaccess file: . htcaccess 파일 :

( Taken from one same forum link and modified a little. You will need to remove the MULTIVIEW from your existing .htaccess file ) (하나의 동일한 포럼 링크에서 찍은 약간 바뀌었습니다. 당신은 당신의 기존. htaccess 파일에서 Multiview 제거가 필요합니다)

<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
RewriteEngine On RewriteEngine에서
RewriteBase /forums RewriteBase / 포럼

Options +FollowSymlinks 옵션 + FollowSymlinks

RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ tags.php?tag=$1&page=$2 [L,QSA] RewriteRule ^ 태그 /([^/]+)/ 페이지 / ([0-9 ]+)/?$ tags.php? 태그 = $ 1 & 페이지 = $ 2 [패, QSA]
RewriteRule ^tags/([^/]+)/?$ tags.php?tag=$1 [L,QSA] RewriteRule ^ 태그 /([^/]+)/?$ tags.php? 태그 = $ 1 [패, QSA]
RewriteRule ^tags/?$ tags.php [L,QSA] 태그 RewriteRule ^ /? $ tags.php [패, QSA]
RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ profile.php?id=$1&page=$2 [L,QSA] RewriteRule ^ 프로필 /([^/]+)/ 페이지 / ([0-9 ]+)/?$ profile.php? 자료 ID = $ 1 & 페이지 = $ 2 [패, QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/?$ profile.php?id=$1&tab=$2 [L,QSA] RewriteRule ^ 프로필 /([^/]+)/([^/]+)/?$ profile.php? 자료 ID = $ 1 & 탭을 = $ 2 [패, QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ profile.php?id=$1&tab=$2&page=$3 [L,QSA] RewriteRule ^ 프로필 /([^/]+)/([^/]+)/ 페이지 / ([0-9 ]+)/?$ profile.php? 자료 ID = $ 1 & 탭을 = $ 2 & 페이지 = $ 3 [패, QSA ]
RewriteRule ^profile/([^/]+)/?$ profile.php?id=$1 [L,QSA] RewriteRule ^ 프로필 /([^/]+)/?$ profile.php? 자료 ID = $ 1 [패, QSA]
RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ view.php?view=$1&page=$2 [L,QSA] RewriteRule ^보기 /([^/]+)/ 페이지 / ([0-9 ]+)/?$ view.php?보기 = $ 1 & 페이지 = $ 2 [패, QSA]
RewriteRule ^view/([^/]+)/?$ view.php?view=$1 [L,QSA] RewriteRule ^보기 /([^/]+)/?$ view.php?보기 = $ 1 [패, QSA]
RewriteRule ^rss/?$ rss.php [L,QSA] RSS Feeds 모바일 RewriteRule ^ /? $ rss.php [패, QSA]
RewriteRule ^rss/forum/([^/]+)/?$ rss.php?forum=$1 [L,QSA] RewriteRule ^ RSS Feeds 모바일 / 포럼 /([^/]+)/?$ rss.php? 포럼 = $ 1 [패, QSA]
RewriteRule ^rss/topic/([^/]+)/?$ rss.php?topic=$1 [L,QSA] RewriteRule ^ RSS Feeds 모바일 / 주제 /([^/]+)/?$ rss.php? 주제 = $ 1 [패, QSA]
RewriteRule ^rss/tags/([^/]+)/?$ rss.php?tag=$1 [L,QSA] RewriteRule ^ RSS Feeds 모바일 / 태그 /([^/]+)/?$ rss.php? 태그 = $ 1 [패, QSA]
RewriteRule ^rss/profile/([^/]+)/?$ rss.php?profile=$1 [L,QSA] RewriteRule ^ RSS Feeds 모바일 / 프로필 /([^/]+)/?$ rss.php? 프로필 = $ 1 [패, QSA]

RewriteRule ^([^.]+)/([^.]+)/page/([0-9]+)/?$ topic.php?id=$2&page=$3 [L,QSA] RewriteRule ^([^.]+)/([^.]+)/ 페이지 / ([0-9 ]+)/?$ topic.php? 자료 ID = $ 2 & 페이지 = $ 3 [패, QSA]
RewriteRule ^([^/.]+)/([^.]+)/?$ topic.php?id=$2 [L,QSA] RewriteRule ^([^/.]+)/([^.]+)/?$ topic.php? 자료 ID = $ 2 [패, QSA]

RewriteRule ^([^/.]+)/page/([0-9]+)/?$ forum.php?id=$1&page=$2 [L,QSA] RewriteRule ^([^/.]+)/ 페이지 / ([0-9 ]+)/?$ forum.php? 자료 ID = $ 1 & 페이지 = $ 2 [패, QSA]
RewriteRule ^([^/.]+)/?$ forum.php?id=$1 [L,QSA] RewriteRule ^([^/.]+)/?$ forum.php? 자료 ID = $ 1 [패, QSA]
</IfModule> "/ IfModule"

Place the plugin file in my-plugin directory and .htaccess file in bbpress root directory. 그리고 bbpress 루트 디렉토리에. htaccess 파일 내 - 플러그인 디렉토리에 플러그인 파일을 놓습니다. Active the plugin. 활성 플러그인. and it should work fine. 와 괜찮 작동합니다.

The Problem I find with this. 문제는 내가 이걸 찾으십시오.

  • The Link to BBpress admin board link does not work from main site. 관리자 BBpress 보드 링크 링크 메인 사이트에서 작동하지 않습니다. 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>// . An extra slash . 경우가 존재하지 않습니다로 입력하면 뭔가가 http://sitename.com/ http://sitename.com/ 반환 <bbpress-directory> / sdaksda <bbpress-directory> / /. 여분의 슬래시.

Except these 2 there is no problem I see so far but Its not easy to predict as I dont have lot of posts or users. 이러한 2를 제외하고 내가 너무 멀리 있지만 쉽지 않은 내가 게시물 또는 사용자별로보고 해달라고 예측하는 문제입니다. So if you want to try it out 그래서 만약 당신이 그것을 밖으로 해보고 싶어 download the files here 파일 다운로드는 여기에 . . You can give your feedback here if you can improve it. 귀하의 의견을 여기에 당신이 그것을 향상시킬 수있습니다 제공할 수있습니다. And If somebody wants they can support the plugin and enhance it. 그리고 만일 누군가가 그들이 플러그인을 지원하고 향상시킬 수있습니다 싶어. You can see 당신을 볼 수있습니다 demo of this on the forum 포럼에이의 데모 I tested on but You wont be able to register and anyways it just a test forum 내가 테스트를하지만, 당신이 등록하고 그것을 어쨌든 그냥 테스트 포럼을하실 수있습니다 실거예요

Tagged with: 태그 : | Need more help ? | 좀 더 도와 줄까? Ask your Questions at our 귀하의 질문을 우리가 Support Center 지원 센터 | Follow us on Twitter | 트위터에 우리를 따르라 @TSNW @ TSNW or 또는 Facebook 페이 스북
페이스 북의 공유 Print This Post

Translate to EnglishÜbersetzen Sie zum Deutsch/GermanΜεταφράστε στα ελληνικά/GreekПереведите к русскому/RussianOversetter til Norsk/NorwegianÖversätta till Svensk/Swedishहिन्दी अनुवाद करने के लिए/Hindi
Tradueix al català/CatalanTulkot uz latviešu/LatvianPreložiť do slovenčiny/SlovakVertaal aan het Nederlands/Dutchترجمة الى العربية/ArabicTraduzca al Español/SpanishTraduisez au Français/French
Traduca ad Italiano/ItalianTraduza ao Português/Portuguese日本語に翻訳しなさい /Japanese한국어에게 번역하십시오/Korean中文翻译/Chinese Simplified中文翻译/Chinese TraditionalПереклад на українську/Ukrainian

Posted on 4th April 2008 by 2008년 4월 4일에 의해 게시됨 Ashish Mohta Ashish Mohta , A tech blogger who writes about solving day to day problems of people who use computer. 사람에 대해 하루에 컴퓨터를 사용하는 사람들이 하루에 문제를 해결하는 기술 블로거 씁니다. He also writes on How to use the applications like Office, PC tips, Online tools,Browsers and more. All posts by 그는 또 얼마나 오피스, PC의 도움말, 온라인 공구, 브라우저 및 더 많은 같은 응용 프로그램을 사용하는 방법에 씁니다. 모든 게시물에 의해 Ashish Mohta Ashish Mohta | Connect with me @ | 연결 나와 함께 @ Twitter 트위터 | | Linkedin LinkedIn에 | | Facebook 페이 스북 | | Stumble 넘어지다

One Comment 하나의 댓글 » »

  • Tommie said: Tommie있다 :

    Thanks! 감사합니다! It works wonders. 그것은 놀라운 작품. Running it now on the community site Callofduty.se. 지금은 커뮤니티 사이트에 Callofduty.se 실행. Your sh*t is the only EASY solution to this problem – thanks again! 네 쉬 * T는이 문제를 쉽게 알 수있는 유일한 솔루션 - 덕분에 또!

    (Running it with bbPress 1.01 if anyone would like to know) 누군가를 알고 싶습니다 (bbPress 1.01)를 실행

Leave your response! 귀하의 회신을 둬!

Be nice. 멋지게 굴어. Keep it clean. 깨끗하게 유지. Stay on topic. 숙박 주제에. No spam. 아니 스팸.