Home Heim » » Blog Tips Blog-Tipps

How to remove forum and topic keyword from bbpress url Wie Forum und Thema Stichwort entfernen bbpress url

I had been trying lot of forum softwares ( around 5 till now ) from last Friday and was testing BBPRESS yesterday. Ich hatte versucht, viel Software Forum (rund 5 bis jetzt) vom vergangenen Freitag und testete BBPress gestern. The new version9.x has lot of improvement over its 8.x version but one thing I found common in both of them Die neue version9.x hat viele Verbesserungen gegenüber seinen Version 8.x aber eins fand ich häufig in beiden

  • “Forum” keyword was appended when you accesss any forum eg http://sitename.com/<forum-directory>/ forum /<forum slug> "Forum" Stichwort wurde angefügt, wenn Sie zB http://sitename.com/ <forum-directory> forum / forum / <forum accesss slug>
  • “topic” keyword was also appended for every post made eg http://sitename.com<forum-directory>/ topic /<actualy topic slug> "Thema" Schlüsselwort war auch für jeden Beitrag angehängt hat zB http://sitename.com <forum-directory> / Thema / <actualy Thema 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. Jetzt verstehe ich, warum sowohl die Stichworte reqired sind aber wieder von SEO Punkt hat es keinen Sinn, es sei denn jemand betreibt ein Forum zum Thema "Foren" zu gelangen. The next thing I did was look around for a hack and luckily Das nächste, was ich tat, war sich nach einer hacken und zum Glück at this post there was a solution Auf diesem Posten gab es eine Lösung , but not actual plugin was supported. , Aber nicht die tatsächlichen Plugin unterstützt wurde. I copied the code given there and tested around and was successful. Ich kopierte den Code dort gegebenen und getestet um und war erfolgreich.

Before I start, I have just tested around with the code given by the memebers over there. Bevor ich beginne, habe ich nur mit dem Code von der memebers dort gegebenen rund getestet. So test it before you use it. So testen, bevor Sie es verwenden. And moreover I am not supporting it as I did not make it and cant do it either. Und außerdem bin ich es nicht unterstützen, da ich nicht machen und cant do it either.

I made a plugin from the code given and took re-write code for .htaccess files. Ich habe ein Plugin aus dem angegebenen Code und nahm wieder Schreiben von Code für. Htaccess-Dateien. Here is how they look Hier ist, wie sie aussehen

PLUGIN:( Taken from the forum link ) PLUGIN: (aus dem Forum Link Taken)

<?php <? php
/* / *
Plugin Name: Remove Topic Forum Plugin Name: Entfernen Topic Forum
Plugin URI: http://bbpress.org/ Plugin URI: http://bbpress.org/
Description: Allows to remove forum and topic word in url Beschreibung: Erlaubt das Forum und Thema Wort in der URL entfernen
Author: Ashish Mohta Autor: Ashish Mohta
Version: 1.0 Version: 1.0
Author URI: http://www.technospot.net/blogs/ Autor URI: http://www.technospot.net/blogs/
*/ * /

function my_get_forum_link_filter( $link , $forum_id = 0 ) { Funktion my_get_forum_link_filter ($ link, $ forum_id = 0) (
//retrieve the forum object / / Objekt abzurufen, das Forum
$forum = get_forum( get_forum_id( $forum_id )); $ forum = get_forum (get_forum_id ($ forum_id));

//check for rewrite / / check for rewrite
$rewrite = bb_get_option( 'mod_rewrite' ); $ rewrite = bb_get_option ( 'mod_rewrite');
if ( $rewrite ) { if ($ rewrite) (
//what kind of rewrite there is? / / was für ein neu zu schreiben ist da? slug use “forum_slug” column, else the column is “forum_id” Slug nutzen "forum_slug"-Spalte, sonst wird die Säule "forum_id"
$column = ($rewrite === 'slugs')?('forum_slug'):('forum_id'); $ column = ($ rewrite === 'Schnecken')?(' forum_slug'):(' forum_id');

// change /forum/pets-discussions in /pets-discussions / / Change / forum / Haustiere-Gespräche in / Haustiere-Diskussionen
// this work only if the rewrite module is modded! / / Das funktioniert nur, wenn der Rewrite-Modul ist modded!
// and this work only if the slugged name will NEVER / / Und diese nur funktionieren, wenn die verpaßte Name wird NIE
// be a reserved word like “rss” or “bb-images” / / Ein reserviertes Wort wie "rss" oder "bb-Bilder"
// and this is achieved by a filter on bb_slug_sanitize / / Und dies wird durch einen Filter über die erzielten bb_slug_sanitize
$link = str_replace('forum/' . $forum->$column , $forum->$column, $link); $ link = str_replace ( 'forum /'. $ forum-> $ column, $ forum-> $ column, $ link);
} )
return $link.”/”; // Very important line! return $ link ."/"; / / Sehr wichtig line! // Added extra slash :Ashish / / Added extra slash: 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) { Funktion my_get_topic_link_filter ($ link, $ topic_id = 0) (
//retrieve the topic object / / Objekt abzurufen, das Thema
$topic = get_topic( get_topic_id( $topic_id )); $ topic = get_topic (get_topic_id ($ topic_id));

//retrieve the forum object that is the topic container / / Objekt abzurufen, das Forum, dass das Thema Container
$forum = get_forum( get_forum_id( $topic->forum_id )); $ forum = get_forum (get_forum_id ($ topic-> forum_id));

//check for rewrite / / check for rewrite
$rewrite = bb_get_option( 'mod_rewrite' ); $ rewrite = bb_get_option ( 'mod_rewrite');
if ( $rewrite ) { if ($ rewrite) (
//what kind of rewrite there is? / / was für ein neu zu schreiben ist da? slug use “forum_slug” column, else the column is “forum_id” Slug nutzen "forum_slug"-Spalte, sonst wird die Säule "forum_id"
$column = ($rewrite === 'slugs')?('forum_slug'):('forum_id'); $ column = ($ rewrite === 'Schnecken')?(' forum_slug'):(' forum_id');

//create the “forum/pets-discussions” chunk to show the hierarchical relation forum->topic / / create the "forum / Haustiere-Gespräche" Blocks in der hierarchischen Beziehung Forum Show-> topic
$forum_nice_uri = “forum/” . $ forum_nice_uri = "forum /". $forum->$column . $ forum-> $ column. “/”; "/";

//attach the hierarchical chunk to the link / / attach die hierarchische Stück auf den Link
$link = str_replace(bb_get_option('uri'), bb_get_option('uri') . $forum_nice_uri, $link); $ link = str_replace (bb_get_option ( "uri"), bb_get_option ( "uri"). forum_nice_uri $, $ link);

// change /forum/pets-discussions/topic/my-sweet-dog in /pets-discussions/my-sweet-dog / / Change / forum / Haustiere-Diskussionen / Thema / my-sweet-Hund / pets-discussions/my-sweet-dog
// this work only if the rewrite module is modded! / / Das funktioniert nur, wenn der Rewrite-Modul ist modded!
// and this work only if the slugged name will NEVER / / Und diese nur funktionieren, wenn die verpaßte Name wird NIE
// be a reserved word like “rss” or “bb-images” / / Ein reserviertes Wort wie "rss" oder "bb-Bilder"
// and this is achieved by a filter on bb_slug_sanitize / / Und dies wird durch einen Filter über die erzielten bb_slug_sanitize
$link = str_replace('forum/' . $forum->$column , $forum->$column, $link); $ link = str_replace ( 'forum /'. $ forum-> $ column, $ forum-> $ column, $ link);
$link = str_replace('topic/' . $topic->$column , $topic->$column, $link); $ link = str_replace ( 'Thema /'. $ topic-> $ column, $ topic-> $ column, $ link);
} )

return $link.”/” ; // Very important line! return $ link. "/"; / / Sehr wichtig line! // Added Extra Slash :Ashish / / Added Extra Slash: 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 ) { Funktion my_bb_slug_sanitize_filter ($ text_slug, $ text_original = ", $ length = 0) (
// add “r-” by regex when the string begins with “bb-” or “my-” or is a reserved word / / Add "-r" durch den String regex, wenn beginnt mit "BB-" oder "mein-" oder ein reserviertes Wort ist
return preg_replace('/^(my-.*|bb-.*|rss|tags|view|profiles)$/', 'r-$1′, $text_slug); return preg_replace ('/^( my-.* | bb-.* | RSS | Tags | Ansicht | Profile )$/', '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-Datei:

( Taken from one same forum link and modified a little. You will need to remove the MULTIVIEW from your existing .htaccess file ) (Auszug aus einer gleichen Forum Link und um ein wenig. Sie müssen die MultiView aus Ihren bestehenden. Htaccess-Datei zu entfernen)

<IfModule mod_rewrite.c> <IfModule Mod_rewrite.c>
RewriteEngine On RewriteEngine On
RewriteBase /forums RewriteBase / forums

Options +FollowSymlinks Options + FollowSymLinks

RewriteRule ^tags/([^/]+)/page/([0-9]+)/?$ tags.php?tag=$1&page=$2 [L,QSA] RewriteRule ^ tags /([^/]+)/ page / ([0-9 ]+)/?$ tags.php? Tag = $ 1 & page = $ 2 [L, QSA]
RewriteRule ^tags/([^/]+)/?$ tags.php?tag=$1 [L,QSA] RewriteRule ^ tags /([^/]+)/?$ tags.php? Tag = $ 1 [L, QSA]
RewriteRule ^tags/?$ tags.php [L,QSA] RewriteRule ^ tags /? $ Tags.php [L, QSA]
RewriteRule ^profile/([^/]+)/page/([0-9]+)/?$ profile.php?id=$1&page=$2 [L,QSA] RewriteRule Profile ^ /([^/]+)/ page / ([0-9 ]+)/?$ profile.php? Id = $ 1 & page = $ 2 [L, QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/?$ profile.php?id=$1&tab=$2 [L,QSA] RewriteRule ^ Profil /([^/]+)/([^/]+)/?$ profile.php? Id = $ 1 & tab = $ 2 [L, QSA]
RewriteRule ^profile/([^/]+)/([^/]+)/page/([0-9]+)/?$ profile.php?id=$1&tab=$2&page=$3 [L,QSA] RewriteRule ^ /([^/]+)/([^/]+)/ profile page / ([0-9 ]+)/?$ profile.php? Id = $ 1 & tab = $ 2 & page = $ 3 [L, QSA ]
RewriteRule ^profile/([^/]+)/?$ profile.php?id=$1 [L,QSA] RewriteRule ^ Profil /([^/]+)/?$ profile.php? Id = $ 1 [L, QSA]
RewriteRule ^view/([^/]+)/page/([0-9]+)/?$ view.php?view=$1&page=$2 [L,QSA] RewriteRule ^ Blick /([^/]+)/ page / ([0-9 ]+)/?$ view.php? View = $ 1 & page = $ 2 [L, QSA]
RewriteRule ^view/([^/]+)/?$ view.php?view=$1 [L,QSA] RewriteRule ^ Blick /([^/]+)/?$ view.php? View = $ 1 [L, QSA]
RewriteRule ^rss/?$ rss.php [L,QSA] RewriteRule ^ rss /? $ Rss.php [L, QSA]
RewriteRule ^rss/forum/([^/]+)/?$ rss.php?forum=$1 [L,QSA] RewriteRule ^ rss / forum /([^/]+)/?$ rss.php? Forum = $ 1 [L, QSA]
RewriteRule ^rss/topic/([^/]+)/?$ rss.php?topic=$1 [L,QSA] RewriteRule ^ rss / Thema /([^/]+)/?$ rss.php? Topic = $ 1 [L, QSA]
RewriteRule ^rss/tags/([^/]+)/?$ rss.php?tag=$1 [L,QSA] RewriteRule ^ rss / tags /([^/]+)/?$ rss.php? Tag = $ 1 [L, QSA]
RewriteRule ^rss/profile/([^/]+)/?$ rss.php?profile=$1 [L,QSA] RewriteRule ^ rss / profile /([^/]+)/?$ rss.php? Profile = $ 1 [L, QSA]

RewriteRule ^([^.]+)/([^.]+)/page/([0-9]+)/?$ topic.php?id=$2&page=$3 [L,QSA] RewriteRule ^([^.]+)/([^.]+)/ page / ([0-9 ]+)/?$ topic.php? Id = $ 2 & page = $ 3 [L, QSA]
RewriteRule ^([^/.]+)/([^.]+)/?$ topic.php?id=$2 [L,QSA] RewriteRule ^([^/.]+)/([^.]+)/?$ topic.php? Id = $ 2 [L, QSA]

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

Place the plugin file in my-plugin directory and .htaccess file in bbpress root directory. Legen Sie das Plugin-Datei in meinem Plugin-Verzeichnis und. Htaccess-Datei im Root-Verzeichnis bbpress. Active the plugin. Active das Plugin. and it should work fine. und es sollte funktionieren.

The Problem I find with this. Das Problem finde ich mit diesem.

  • The Link to BBpress admin board link does not work from main site. Der Link zu BBPress admin Board-Link funktioniert nicht von den Haupt-Website. It redirects to home page. Für die Weiterleitung zur Startseite. You will need to manually type the link to go inside. Sie müssen manuell die Verbindung nach innen zu gehen.
  • 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 . Im Fall Sie etwas, das nicht existiert http://sitename.com/ <bbpress-directory> / sdaksda es gibt http://sitename.com/ <bbpress-directory> / /. Eine zusätzliche Schrägstrich.

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. Außer diesen 2 gibt es kein Problem sehe ich so weit, aber Its not easy, vorherzusagen, wie ich dont haben viele Posts oder Nutzer. So if you want to try it out Also, wenn Sie wollen, probieren Sie es aus download the files here Download der Dateien hier . . You can give your feedback here if you can improve it. Sie können Ihr Feedback geben, hier, wenn Sie sie zu verbessern. And If somebody wants they can support the plugin and enhance it. Und wenn jemand will, können sie das Plugin-Unterstützung und es zu verbessern. You can see Sie können sehen, demo of this on the forum Demo von diesem auf dem Forum I tested on but You wont be able to register and anyways it just a test forum Getestet habe ich auf Sie, sondern pflegt registrieren lassen kann, und es sowieso nur ein Test-Forum

Tagged with: Tagged with: | Need more help ? | Benötigen Sie weitere Hilfe? Ask your Questions at our Stellen Sie Ihre Fragen in unserem Support Center Support Center | Follow us on Twitter | Folgen Sie uns auf Twitter @TSNW @ TSNW or oder Facebook Facebook
Facebook teilen 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 Geschrieben am 4. April 2008 von Ashish Mohta Ashish Mohta , A tech blogger who writes about solving day to day problems of people who use computer. , A-Tech-Blogger schreibt über die Lösung der täglichen Probleme der Menschen, die Computer benutzen. He also writes on How to use the applications like Office, PC tips, Online tools,Browsers and more. All posts by Er schreibt auch, wie die Anwendungen wie Office, PC-Tipps, Online-Tools, Browser und vieles mehr. Alle Beiträge von Ashish Mohta Ashish Mohta | Connect with me @ | Connect with me @ Twitter Twitter | | Linkedin Linkedin | | Facebook Facebook | | Stumble Stumble

One Comment Ein Kommentar » »

  • Tommie said: Tommie sagte:

    Thanks! Danke! It works wonders. Es wirkt Wunder. Running it now on the community site Callofduty.se. Laufen sie nun auf der Community-Site Callofduty.se. Your sh*t is the only EASY solution to this problem – thanks again! Ihre sh * t ist die einzige einfache Lösung für dieses Problem - thanks again!

    (Running it with bbPress 1.01 if anyone would like to know) (Laufen mit bbPress 1,01, wenn jemand wissen möchte)

Leave your response! Lassen Sie Ihre Antwort!

Be nice. Seien Sie nett. Keep it clean. Halten Sie es sauber. Stay on topic. Stay on topic. No spam. Kein Spam.