PDA

View Full Version : Solved How to remove the vbet language code



norku
05-10-11, 10:41
I uninstalled vbet but the language code wasn't removed [lang=x], [langtitle=x] etc I don't want to have to go through hundreds of pages to remove them manually so did I miss a step? Can the code be removed without having to go through every single thread/post?

r.dziadusz
05-10-11, 12:33
Right now uninstalling vBET will not clean BBcode, please note that pages in foreign language will stay in this language, so you lost users after removing vBET, moreover it will be very difficult to read untranslated posts therefore - maybe better solution is to delete these posts at all.
But if you want only to delete "[lang=x " etc I can code for you a robot-cleaner by the end of the week

norku
05-10-11, 12:42
What I need cleaning are the urls... The url for threads which were posted by someone who had a foreign language set in their profile are still showing [ langtitle=x] [ /langtitle] How do I fix that?

I got rid of [ lang=x], [ /lang], [notranslate] etc by using vb censoring. I desperately need help with the urls though...

Here's one: .xxxxx.com/forum/f23/[ langtitle=fr]insigne-vrai-ou-faux-[-langtitle]-5565/


How do I get the rubbish out and turn it into:

http://www.xxxxx.com/forum/f23/Dinsigne-vrai-ou-faux-5565/

norku
05-10-11, 13:46
Sorry but I need to bump this...

Also, redirecting the now redundant links in the Google index to foreign language pages on my forum?

vBET
05-10-11, 13:59
As Radek wrote - we will prepare for you robot (PHP script) which will remove all lang, langtitle and notranslate BBCodes. This will be done and provided to you in this week.

If you have langtitle in URL it means that langtitle is included into thread title. Simply change title of thread and remove it. In places which are important and cannot wait please just change it manually. In other places please wait for the script.

norku
05-10-11, 14:05
Hi,

Why don't you warn people that the vbet bb code isn't removed when you uninstall? Why don't you already have the tool if you know that this happens? I appreciate the assistance but I'd kinda like to fully uninstall and not wait for week while Google indexes incorrect urls...

What about the redirect for the /da, /de, /es etc threads which Google has already indexed?

vBET
06-10-11, 02:24
Hi,

The answer for booth your question is - because it was really uncommon to uninstall vBET when it is really needed and used. We had ask for such tool once before, but the user decided to stay with vBET and just tuned it appropriately.

Also we cannot do this in uninstall code - uninstall cannot be potentially harmful. What you need will require database backup in case of any troubles.

Also please note that if you have disabled vBET then Google will not index incorrect URLs, because such are not displayed.

For already indexed - just create redirection rules which will redirect all those requests back to the original one. Use this (please test those):


#RewriteRule ^/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/$ / [L,QSA]
#RewriteRule ^/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/(.*)?$ /$2 [L,QSA]

Add your forum directory there. if you have trouble just give us your vBET rules and we will send you back changed. Or in other words - those are 2 first vBET rules where you should remove vbenterprisetranslator_seo.php?vbet_lang=$1&redirected=

norku
06-10-11, 09:51
The rewrite rules don't work. Whenever an old vbet page is called it generates a 404.

I have vb installed in /forum

.htaccess is in public_html


RewriteRule ^forum/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/$ / [L,QSA]
RewriteRule ^forum/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/(.*)?$ /$2 [L,QSA]



Any news on the BB code removal tool?

vBET
06-10-11, 11:37
Forum directory added in wrong place, use this one:


RewriteRule ^/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/$ /forum/ [L,QSA]
RewriteRule ^/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/(.*)?$ /forum/$2 [L,QSA]
#just comment to see whole 2nd rule


But this suppose to be not in public_html just in forum directory. Best way is - just use rules you had before and modify those. If you do not have any, then we will have to find right one. Use this in your forum directory first. If you want to use it in main directory, then check first without additional /forum

norku
06-10-11, 13:18
Everything worked fine with htaccess in / when I had vbet installed. Yes, I tried my old rules first but they are being ignored. I can't get your rules to work in either /forum or /. I could just leave things as they are and watch Google piling 404 after 404 into Webmaster Tools but I would prefer a clean redirect.

Want to take a look? I can PM you admin/ftp access.

norku
06-10-11, 14:34
Still here

norku
06-10-11, 16:20
and still here. You're not here any more though despite the PM over two hours ago when you definitely were here. I'm going to make some tea. I can wait

norku
06-10-11, 19:39
and back. Any news?

vBET
06-10-11, 21:25
Everything worked fine with htaccess in / when I had vbet installed. Yes, I tried my old rules first but they are being ignored. I can't get your rules to work in either /forum or /. I could just leave things as they are and watch Google piling 404 after 404 into Webmaster Tools but I would prefer a clean redirect.

Want to take a look? I can PM you admin/ftp access.

Please show me your .htaccess before vBET was removed. Also please do not SPAM - it has no sense. Also please note that PM messages are private messages - those are waiting longer for evaluation if wasn't requested and can wait longer if one of our staff is absent busy. Until asked to send access data please write on forum so all our staff can help you. Access details are not needed here - just please send your full .htaccess before vBET was removed.

PS.
I'm working now on corrections in new BETA release - Radek was here and couldn't help you because you send info to me by PM. Sorry you had to wait.

norku
07-10-11, 09:05
Spam?! You were on the forum before, during and after the point where I sent that PM. I sent it after waiting for a considerable period of time for an answer on the thread. If you can't be bothered dragging yourself away for a couple of seconds to answer a question then you could at least have acknowledged receipt of the PM. YOU caused the problem I'm experiencing. Vbet DOESN'T WORK as advertised (yes, beyond your control I know) and all I want is to get it off my forum quickly. But it can't just be uninstalled like every other Vb add-on. Oh no, because Vbet leaves its BB code splattered all over the place.

Nowhere on your site is there a full description of how to remove Vbet. No where do you tell us that the BB code will not be removed when we uninstall and that we will have to wait for days for a tool to remove it. That tool should be part of the install package but you clearly don't like talking about that. Instead I get an unbelievably arrogant answer where you effectively said that you never considered the possibility that anyone would want to uninstall Vbet?!

So, I now have thousands of indexed links which are now all producing 404s and a few hundred posts containing your BB code and I AM THE PROBLEM??

As far as the redirects are concerned what do you want to know? I have the vb suite installed at /forum as I've told you repeatedly. To get Vbet working with Vb installed at /forum only one set of redirects will work and I know that you know that. I offered you ftp and admin access so that you can take a look for yourself but you clearly don't have the same amount of time as you had when I was still a customer....


Here is htaccess prior to removing vbet. It was located in public_html and worked perfectly (I have vb installed at /forum)



# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On

# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/)
#RewriteBase /


#RewriteCond %{HTTP_HOST} !^www\.xxxx\.com
RewriteCond %{HTTP_HOST} !(^www\.xxxx\.com$|^cdn\.xxxx\.com$)
RewriteRule (.*) http://www.xxxx.com/$1 [R=301,L]

#RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
#RewriteRule (.*) http://www.yourdomain.com/forum/$1 [L,R=301]

RewriteRule ^forum/((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

#vbet translator rules start
RewriteRule ^forum/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/$ forum/vbenterprisetranslator_seo.php?vbet_lang=$1&redirected=/forum/ [L,QSA]
RewriteRule ^forum/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/(.*)?$ forum/vbenterprisetranslator_seo.php?vbet_lang=$1&redirected=/forum/$2 [L,QSA]

RewriteCond %{REQUEST_URI} !(admincp/|modcp/|vbseo_sitemap/|cron)
RewriteRule ^forum/((archive/)?(.*.php(/.*)?))$ forum/vbenterprisetranslator_seo.php [L,QSA]


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !^(admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ forum/vbenterprisetranslator_seo.php [L,QSA]
#vbet translator rules end


RewriteCond %{REQUEST_URI} !(media/|admincp/|modcp/|cron|vbseo_sitemap)
RewriteRule ^forum/((archive/)?(.*\.php(/.*)?))$ forum/vbseo.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/(media|admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ forum/vbseo.php [L,QSA]

## Expires
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 3456000 seconds"
ExpiresByType image/jpeg "access plus 3456000 seconds"
ExpiresByType image/png "access plus 3456000 seconds"
ExpiresByType text/css "access plus 3456000 seconds"
ExpiresByType text/javascript "access plus 3456000 seconds"
ExpiresByType application/javascript "access plus 3456000 seconds"
ExpiresByType application/x-javascript "access plus 3456000 seconds"
</ifModule>

## Compression
<ifmodule mod_headers.c>
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css text/xml application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
</ifmodule>
</ifmodule>

#Remove index.php from xxxx.com/index.php
#rewrite engine on
RewriteCond %{THE_REQUEST} index\.php
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^index\.php$ / [L,R=301]

vBET
07-10-11, 12:35
Please note that repeating messages is considered SPAM - on every forum I know. I do not want to discuss about definition of SPAM - just please do not repeat. I understand if your message was waiting few days, because we miss it some how - it would be even appreciated to remind, but 3 times same day...

Your .htaccess should look like this:


# Comment the following line (add '#' at the beginning)
# to disable mod_rewrite functions.
# Please note: you still need to disable the hack in
# the vBSEO control panel to stop url rewrites.
RewriteEngine On

# Some servers require the Rewritebase directive to be
# enabled (remove '#' at the beginning to activate)
# Please note: when enabled, you must include the path
# to your root vB folder (i.e. RewriteBase /forums/)
#RewriteBase /


#RewriteCond %{HTTP_HOST} !^www\.xxxx\.com
RewriteCond %{HTTP_HOST} !(^www.xxxx.com$|^cdn.xxxx.com$)
RewriteRule (.*) http://www.xxxx.com/$1 [R=301,L]

#RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com
#RewriteRule (.*) http://www.yourdomain.com/forum/$1 [L,R=301]

RewriteRule ^forum/((urllist|sitemap_).*.(xml|txt)(.gz)?)$ forum/vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

#vbet translator rules start
RewriteRule ^forum/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/$ forum/ [L,R=301]
RewriteRule ^forum/?(af|sq|ar|hy|az|eu|be|bg|ca|zh-CN|hr|cs|da|nl|en|et|tl|fi|fr|gl|ka|de|el|ht|iw|hi|hu|is|id|ga|it|ja|ko|lv|lt|mk|ms|mt|no|fa|pl|pt|ro|ru|sr|sk|sl|es|sw|sv|zh-TW|th|tr|uk|ur|vi|cy|yi)/(.*)?$ forum/$2 [L,R=301]

RewriteCond %{REQUEST_URI} !(media/|admincp/|modcp/|cron|vbseo_sitemap)
RewriteRule ^forum/((archive/)?(.*.php(/.*)?))$ forum/vbseo.php [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !/(media|admincp|modcp|clientscript|cpstyles|images)/
RewriteRule ^(.+)$ forum/vbseo.php [L,QSA]

## Expires
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 seconds"
ExpiresByType text/html "access plus 1 seconds"
ExpiresByType image/gif "access plus 3456000 seconds"
ExpiresByType image/jpeg "access plus 3456000 seconds"
ExpiresByType image/png "access plus 3456000 seconds"
ExpiresByType text/css "access plus 3456000 seconds"
ExpiresByType text/javascript "access plus 3456000 seconds"
ExpiresByType application/javascript "access plus 3456000 seconds"
ExpiresByType application/x-javascript "access plus 3456000 seconds"
</ifModule>

## Compression
<ifmodule mod_headers.c>
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css text/xml application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
</ifmodule>
</ifmodule>

#Remove index.php from xxxx.com/index.php
#rewrite engine on
RewriteCond %{THE_REQUEST} index.php
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^index.php$ / [L,R=301]


Also my apologies - I forgot to tell you about 301 redirect before. It is set there now. Please check and tell is it OK (I'm not sure does rules require / before forum or maybe full URL, but it is something to check on forum). If not I will use your access data you send yesterday and set it right on place.

PS.
Radek is testing right now script removing vBET BBCodes - it should be available soon.

r.dziadusz
07-10-11, 14:46
Hi,
Note!
This is beta version of this script!

1.Please create file and save it as "clearBB.php"
2.Put the code below into it and save it
3.Upload to your server, forum root
4.Do the backup of your database
5.Turn off your forum
6.Log in as admin
7.In your browser, put url with destination to your "clearBB.php"
8.Press "clear" button


<?php echo "<input type=\"hidden\" name=\"securitytoken\" value=\"" . $vbulletin->userinfo['securitytoken'] . "\" />\n";?>

<p style="text-align: center">
Use this program to remove all bbcode tags (from posts, and urls) added by vBET </br>
To use this script, please log into your forum in other tab
</br>This script has big influence on your
database and changes are permanent - <b>can not be undone</b> therefore:
</br>
make sure you did the <b>backup of your database!</b> and remember to <b>turn
off your forum</b> during using this script!</p>


<form action="clearBB.php?do=execute" method="post"><input type="submit"
value="clear" style="width: 70%; margin-left: 15%" /></form>

<?php

function &basic_clear($pagetext, $what_to_clear) {
if ((strpos($pagetext, $what_to_clear)) === 0 ){
$i = 0;
} else {
$i = 1;
}
$message_tab = explode($what_to_clear, $pagetext);
for ($i;$i<count($message_tab); $i++){
if ($message_tab[$i][2] == ']')
$message_tab[$i]=substr($message_tab[$i],3);
}
$new_message = implode('',$message_tab);
return $new_message;
}

function update_pagetext(&$new_message, $message_id) {
global $vbulletin;

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "post
SET pagetext = '".addslashes($new_message)."'
WHERE postid = " .$message_id
);
}

function update_tittle(&$new_tittle, $tittle_id) {
global $vbulletin;

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "post
SET title = '".addslashes($new_tittle)."'
WHERE postid = " .$tittle_id
);
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "thread
SET title = '".addslashes($new_tittle)."'
WHERE firstpostid = " .$tittle_id
);
}

require_once('./global.php');
$charset = vB_Template_Runtime::fetchStyleVar('charset');

if ($_REQUEST['do'] == 'execute') {

$result = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."post WHERE pagetext LIKE '%, 'lang')) !== FALSE) || ((strpos($message['pagetext'], '<!--vBET_SNTA-->')) !== FALSE)){
$new_message = $message['pagetext'];
$to_remove = array("", "[lang=zh-TW]", "[lang=zh-CN]", "[notranslate]", "");
$new_message = str_replace($to_remove,'',$new_message);
if ((strpos($message['pagetext'], '[lang=')) !== FALSE){
$new_message = basic_clear($new_message, '[lang=');
}
update_pagetext($new_message,$message['postid'] );
}
// end block of clear for post


//block for clearing urls and thread titles
if ((strpos($message['title'], 'langtitle')) !== FALSE){
$new_message_title = $message['title'];
$to_remove_title = array('[langtitle=zh-CN]','','');
$new_message_title = str_replace($to_remove_title,'',$new_message_title);
if ((strpos($new_message_title, '[langtitle=')) !== FALSE){
$new_message_title=basic_clear($new_message_title, '[langtitle=');
}
update_tittle($new_message_title, $message['postid']);
}

// end of block for clearing urls and threads titles
}
}
?>

If you want only to have "clear" urls please cut part of code bordered with:

//block for clearing urls and thread titles <--> // end of block for clearing urls and threads titles
Than in your browser type destination to it, and push the "clear" button

norku
07-10-11, 18:13
Thanks very much. I'll let you know if I have any problems but the information seems clear enough.

norku
07-10-11, 18:30
.htaccess doesn't work. It doesn't redirect and adds home/public_html/user/ etc to the url. Removed.

Why are there two boxes in post 17 above? I'm guessing that box 1 is script one and that box 2 is script two. Does it matter which is run first?

r.dziadusz
07-10-11, 22:05
Ther is only one script - first one
Second box is to remove if you onlu want to clear bbcode from your urls

norku
08-10-11, 11:20
Thanks. I'm getting this when I try to run it:

"Your submission could not be processed because a security token was missing.

If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error".

I tried the script using the default skin and also with plugins disabled in config.php. Still doesn't work.

vBET
08-10-11, 12:09
Please try first to login in your forum, and then open the script in same browser. Please tell did it help.

norku
08-10-11, 12:33
:) I was logged in. I also opened the script in the same window.


Edit: the smilie doesn't mean that the problem went away. I can't run the script.

Further edit: please see post 19. The htaccess you posted doesn't work.

I sent you ftp and admincp access a few hours ago as you requested.




One more edit just to avoid the inevitable question and to save some time here is an example link currently in the Google index:
http://www.xxxx.com/forum/no/f72/just-an example-726/

This is the result of the redirect when I use your htaccess in post 16:
http://www.xxxx.com/home/xx/public_html/forum/f72/just-an-example-726/

What do I need to edit in your rules to remove home/xx/public_html/ ?

vBET
08-10-11, 23:44
I was on your server and your .htaccess issue is solved. As I wrote I was not sure do you need / at the beginning of redirect address or not -it was necessary. It is OK now - please check and confirm.

Radek will help you with your script issue - he will be work Monday. Sorry it will take some more time, but Radek was creating and testing the script - he will be best person to help you. If it is really something what cannot wait until Monday please let me know and I will spend Sunday time to check it. Hope it is not really so urgent.

norku
09-10-11, 13:19
Great. Thank you. The redirect is working perfectly.

The script isn't so urgent but if it can be looked into on Monday that would be excellent.

r.dziadusz
10-10-11, 08:39
Sorry you have to wait so long
I've edited code in my previous post(CLICK (http://www.vbenterprisetranslator.com/forum/vbet4-troubleshooting/2466-how-remove-vbet-language-code-2.html#post10556))
Please try to use new one


Thanks. I'm getting this when I try to run it:

"Your submission could not be processed because a security token was missing.

If this occurred unexpectedly, please inform the administrator and describe the action you performed before you received this error".

I tried the script using the default skin and also with plugins disabled in config.php. Still doesn't work.

Yes but it is well known issue of vbulletin, I'm describing it them, right now, but for now please use this new code one more time, and please try to change file name

EDIT
Please tell me which version of vbulletin do you use?

norku
10-10-11, 11:11
Hi,

I added your new code, renamed the file and tried to run it but I'm still getting the message concerning the security token. I'm using the vb suite version 4.1.6

r.dziadusz
10-10-11, 21:46
I've included some vbulletin hint, and make this code faster, please try it now: CLICK (http://www.vbenterprisetranslator.com/forum/vbet4-troubleshooting/2466-how-remove-vbet-language-code-2.html#post10556) and let me know, if it helps

raymond
11-10-11, 04:26
I looked at the code and saw this.


<form action="clearBB.php?do=execute" method="post"><input type="submit"
value="clear" style="width: 70%; margin-left: 15%" /></form>

Maybe the script will have to be named as clearBB.php?

raymond
11-10-11, 04:49
Worked for me.
I copied the code, pasted to a text editor and save it as clearBB.php
Upload clearBB.php at the root of vbulletin forum.
Logged in as admin, close the board and run clearBB.php from my web browser.
Click the clear button.

Voila, all language tag has been cleared.

Thanks to vBSEO, all those dead links are permanently redirected to the original thread :)

r.dziadusz
11-10-11, 06:08
I looked at the code and saw this.

<form action="clearBB.php?do=execute" method="post"><input type="submit"
value="clear" style="width: 70%; margin-left: 15%" /></form>

Maybe the script will have to be named as clearBB.php?

Yes, you were right, but problem with missing token, is about other line is this code - one that gives you right to execute file.
Consider this issue solved, or have you got any questions

norku
11-10-11, 10:20
Thanks Raymond. That fixed the token error for me.

This isn't 'solved' though r.dziadusz...

Problem after running the script: all previous apostrophes (and quotation marks) are now in Ascii Html': &#039 , &quot; Any ideas on how to fix this? (I have vbseo and tried the character replacement function - doesn't work. I also rebuilt the post cache after running the BB script - didn't change anything). Only apostrophes and quotation marks which were there before the script was run have been affected (new posts containing them will display normally) I can 'cheat' a partial fix by using vb censoring but I'd rather not.

Also, & is showing everywhere as &amp;

Problem 2: for some reason I have this BB code in some places: [Lang=x], [lang = x] etc How do I amend your script (clearBB.php) to kill those too?

r.dziadusz
11-10-11, 12:18
Sorry I've marked it as solved, I supposed it work for both of you
I will investigate why you get &#039, please tell me what charset do you use (describe how to do it, you can find it in readme.html file )
About second problem, it appeard becouse users add "lang" code manualy
If you want to remove ii using my script for first case [ Lang=x]
please find these lines:

if ((strpos($message['pagetext'], '[lang=')) !== FALSE){
$new_message = basic_clear($new_message, '[lang=');
}

and put exactly after it:

if ((strpos($message['pagetext'], '[Lang=')) !== FALSE){
$new_message = basic_clear($new_message, '[Lang=');
}


-this wasn't tested is just a quick fix
but in second case [ lang = x] this bbcode doesn't work and it is more complicated, also can affect with some more problems, becouse you show me tag with two gaps, but i don't know if there were ones with three gaps etc, and becouse of that you can have some text cutted, i need to figure out if it is possible to remove tags like this safely.

Edit
About &#039 we are curently working on it pleae wait a second

norku
11-10-11, 12:45
Hi and thanks. I started a new thread on this so could you delete it please?

My charset is ISO-8859-1

Thanks also for the info on the script.

Looking forward to hearing from you on the Ascii html thing as I would really like to get that fixed.

r.dziadusz
11-10-11, 19:17
Hi we still working on it, we have to overcome some temporary vbulletin issue in our test forum, sorry for delay, you will get the solution as soon as possible!

r.dziadusz
12-10-11, 11:09
Hi i know what seems to be the issue, I guess you use previous version of clearBB so like I said it was a beta version.
To remove &amp etc. please restore your database from your backup just before using the robot, and create this file again exactly as is descrption:CLICK (http://www.vbenterprisetranslator.com/forum/vbet4-troubleshooting/2466-how-remove-vbet-language-code-2.html#post10556), using current - (not previous, it could create problem - sorry for that)version of script

norku
12-10-11, 15:04
And lose 2 days worth of posts/threads on the affected forum? I can't do that...

r.dziadusz
12-10-11, 16:20
Ok i can create for you another script that will remove all of it &#039 , &quot , &amp
I'm sorry that this ASCI html codes appears, but please note that you use beta version of this product, we will do anything to help you

norku
12-10-11, 17:19
That would be excellent. Thanks. Will the script remove them even if they are joined onto other words like this: &quot;Munchen-Nordwest&quot; ?

r.dziadusz
12-10-11, 17:31
It is also beta version

1.Please create file and save it as "decode.php"
2.Put the code below into it and save it
3.Upload to your server, forum root
4.Do the backup of your database
5.Turn off your forum
6.Log in as admin
7.In your browser, put url with destination to your "clearBB.php"
8.Press "clear" button
<?php echo "<input type=\"hidden\" name=\"securitytoken\" value=\"" . $vbulletin->userinfo['securitytoken'] . "\" />\n";?>

<p style="text-align: center">
Use this program to change asci html code into "normal" signs
</br>This script has big influence on your
database and changes are permanent - <b>can not be undone</b> therefore:
</br>
make sure you did the <b>backup of your database!</b> and remember to <b>turn
off your forum</b> during using this script!</p>


<form action="decode.php?do=execute" method="post"><input type="submit"
value="clear" style="width: 70%; margin-left: 15%" /></form>

<?php

function update_pagetext(&$new_message, $message_id) {
global $vbulletin;

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "post
SET pagetext = '".addslashes($new_message)."'
WHERE postid = " .$message_id
);
}

function update_tittle(&$new_tittle, $tittle_id) {
global $vbulletin;

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "post
SET title = '".addslashes($new_tittle)."'
WHERE postid = " .$tittle_id
);
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "thread
SET title = '".addslashes($new_tittle)."'
WHERE firstpostid = " .$tittle_id
);
}


require_once('./global.php');


if ($_REQUEST['do'] == 'execute') {
$to_remove = array("&gt;", "&lt;", "&amp;", "'", "&quot;");

$result = $vbulletin->db->query_read("SELECT * FROM ".TABLE_PREFIX."post WHERE pagetext LIKE '%&gt;%' OR pagetext like '%&lt;%' OR pagetext like '%&amp;%' OR pagetext like '%&#039%' OR pagetext like '%&quot;%' OR title LIKE '%&amp;%' OR title LIKE '%&#039%' OR title LIKE '%&lt;%' OR title LIKE '%&gt;%' OR title LIKE '%&quot;%' " );
while ($message = $db->fetch_array($result)){
$new_message = $message['pagetext'];
if ((strpos($message['pagetext'], '&gt;')) !== FALSE){
$new_message = str_replace('&gt;','>',$new_message);
}
if ((strpos($message['pagetext'], '&lt;')) !== FALSE){
$new_message = str_replace('&lt;','<',$new_message);
}
if ((strpos($message['pagetext'], '&amp;')) !== FALSE){
$new_message = str_replace('&amp;','&',$new_message);
}
if ((strpos($message['pagetext'], '&#039')) !== FALSE){
$new_message = str_replace('&#039',"'",$new_message);
}
if ((strpos($message['pagetext'], '&quot;')) !== FALSE){
$new_message = str_replace('&quot;','"',$new_message);
}

update_pagetext($new_message,$message['postid']);

$new_title = $message['title'];
if ((strpos($message['title'], '&gt;')) !== FALSE){
$new_title = str_replace('&gt;','>',$new_title);
}
if ((strpos($message['title'], '&lt;')) !== FALSE){
$new_title = str_replace('&lt;','<',$new_title);
}
if ((strpos($message['title'], '&amp;')) !== FALSE){
$new_title = str_replace('&amp;','&',$new_title);
}
if ((strpos($message['title'], '&#039')) !== FALSE){
$new_title = str_replace('&#039',"'",$new_title);
}
if ((strpos($message['title'], '&quot;')) !== FALSE){
$new_title = str_replace('&quot;','"',$new_title);
}
update_tittle($new_title, $message['postid']);
}
}
?>

r.dziadusz
12-10-11, 17:36
Sorry for style but if i put it into [php] tag, &amp; changes into & etc.

norku
12-10-11, 17:53
Just tried the script and it doesn't remove the ascii html if it is joined onto a word. Here's an example: These are stunning. I can&amp;#039;t help with an assessment...

Should I be seeing a results screen after I run the script?

norku
12-10-11, 18:49
Oh great, at some stage of the uninstall http://&quot/;xxxxxxxxxxxxxxxx&quot; has been added to a load of internal links in posts.... None of them now work of course. Not happy

r.dziadusz
13-10-11, 10:18
some stage of the uninstall
While You are using second script yes? Also if something goes wrong just restore your database from backup, during using the code you forum should be shut down so you will have no losts.
Also I can esly chang second script to remove html code even if it is inside some words, sorry for this unonvinient

norku
13-10-11, 23:33
Hi,

I have run all versions of the script on the same database (yes, with forum closed as per your instructions).

I spent 8 hours today going through hundreds of threads correcting internal links and &quot etc. I am seriously bored now so if you could do me a script which will remove #039; , &quot; , &amp; even if they are parts of words that would be absolutely great :)

Edit: Will the script also fix internal links like the one in post #43 above?

r.dziadusz
14-10-11, 08:45
The script which now I write to you will change every #039; , &quot; , &amp; into ' etc. could you also PM me thread url with broken links appears

r.dziadusz
14-10-11, 09:21
Code update : Click (http://www.vbenterprisetranslator.com/forum/vbet4-troubleshooting/2466-how-remove-vbet-language-code-4.html#post10734)

norku
17-10-11, 14:00
Hi and thanks for the update. I ran the script and got the folllowing error. Looks like one of the parameters might perhaps be wrong?


Database error in vBulletin 4.1.6:

Invalid SQL:
SELECT * FROM post WHERE pagetext LIKE '%&gt;%' OR pagetext like '%&lt;%' OR pagetext like '%&amp;%' OR pagetext like '%'%' OR pagetext like '%&quot;%' OR title LIKE '%&amp;%' OR title LIKE '%'%' OR title LIKE '%&lt;%' OR title LIKE '%&gt;%';

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%' OR pagetext like '%&quot;%' OR title LIKE '%&amp;%' OR title LIKE '%'%' OR ti' at line 1
Error Number : 1064
Request Date : Monday, October 17th 2011 @ 01:57:46 PM
Error Date : Monday, October 17th 2011 @ 01:57:46 PM
Script : http://www.xxxx.com/forum/decode.php?do=execute
Referrer : http://www.xxxx.com/forum/clearBB.php
IP Address : 79.194.232.35
Username : xxxx
Classname : vB_Database
MySQL Version : 5.0.92-community

r.dziadusz
17-10-11, 20:35
Can you please one more time give me your error mesage without puting in it any BBcode tag - when you do this some html code is changed into signs ie.: %&#039;% to %'% etc

norku
18-10-11, 12:11
Database error in vBulletin 4.1.6:
Here you go:



Invalid SQL:
SELECT * FROM post WHERE pagetext LIKE '%>%' OR pagetext like '%<%' OR pagetext like '%&%' OR pagetext like '%'%' OR pagetext like '%"%' OR title LIKE '%&%' OR title LIKE '%'%' OR title LIKE '%<%' OR title LIKE '%>%';

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%' OR pagetext like '%"%' OR title LIKE '%&%' OR title LIKE '%'%' OR ti' at line 1
Error Number : 1064
Request Date : Monday, October 17th 2011 @ 01:57:46 PM
Error Date : Monday, October 17th 2011 @ 01:57:46 PM
Script : http://www.xxxxx.com/forum/decode.php?do=execute (http://www.hj-research.com/forum/decode.php?do=execute)
Referrer : http://www.xxxx.com/forum/clearBB.php (http://www.hj-research.com/forum/clearBB.php)
IP Address : 79.194.232.35
Username : xxxx
Classname : vB_Database
MySQL Version : 5.0.92-community

r.dziadusz
18-10-11, 12:29
Hi when you put my code into text editing program, it most probably changes html Asci code into normal signs, and so that the problem has appeared. Please paste it one more time and make sure all asci code did not change - stays the way it is in my post. Especially pay attention on "%#039;%" it shouldn't become a '

norku
18-10-11, 12:49
okay. I'll try that.

norku
18-10-11, 13:09
How do I prevent that happening? I've tried Notepad++ also but when I paste your code the symbols change

r.dziadusz
18-10-11, 13:51
If you please PM your acces detail to your ftp i can place this code exatly as it should be, if you don't want to give me acces you can try manualy change symbols again after it becomes like this '

norku
18-10-11, 14:43
I ran it anyway and it seems to have worked this time. Put it down to 'operator error' :)

Thanks very much for sticking at this and I hope that thread will be useful for anyone else who has to uninstall vbet for some reason.

Tip to anyone uninstalling: DON'T do what I did and just uninstall as you would with a normal vbulletin mod. Definitely ask the guys here at vbet BEFORE you uninstall. It'll save you a lot of headaches.

r.dziadusz
18-10-11, 19:20
You welcome, if you have any other question in this thread please ask, for any other issues please open new thread.
If everything is ok i will mark it solved

schan
20-02-14, 20:37
Is this still a problem or has these issues been resolved by now? Is it still a pain in the butt to uninstall vBET?

Thanks.

Marcin Kalak
21-02-14, 13:11
The issue has been resolved.

AfrikaansAlbanianArabicBelarusianBulgarianCatalanChineseCroatianCzechDanishDutchEnglishEstonianFilipinoFinnishFrenchGalicianGermanGreekHaitian CreoleHebrewHindiHungarianIcelandicIndonesianIrishItalianJapaneseKoreanLatvianLithuanianMacedonianMalayMalteseNorwegianPersianPolishPortugueseRomanianRussianSerbianSlovakSlovenianSpanishSwahiliSwedishTaiwaneseThaiTurkishUkrainianVietnameseWelshYiddish
Translated to other languages thanks to vBET Translator 4.10.1