vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Show Thread Enhancements - Post Replacements (https://vborg.vbsupport.ru/showthread.php?t=125307)

Stoebi 09-10-2006 08:50 PM

Hi

These lines should solve all problems which i had and others posted:

@Larrysw
Replace -> Post Replacements (Hook: postbit_display_complete)
Code:

//$this->post[message]
if ($this->registry->options['post_replacements_enabled'] == '1')
{
        $replacments_array_mine = explode("|||", $this->registry->options['post_Replacements_option']);
        foreach ($replacments_array_mine as $post_replace)
        {
                $post_explode_rple = explode("===", $post_replace);
                $this->post['message']  = preg_replace("/\s(" . $post_explode_rple['0'] . ")\s?\b/iU", " " . $post_explode_rple['1'], $this->post['message']);
        }
}



Edit:
This fine addon works fine with "Hide Links From Guests". You only need to set the "Execution Order" from 5 to 4 in "Plugin Manager" -> Guests will not see links in posts (Hook: postbit_display_complete)


Kind Regards,

Stoebi

C_P 09-10-2006 11:58 PM

Quote:

Originally Posted by Stoebi
Hi

These lines should solve all problems which i had and others posted:

@Larrysw
Replace -> Post Replacements (Hook: postbit_display_complete)
Code:

//$this->post[message]
if ($this->registry->options['post_replacements_enabled'] == '1')
{
    $replacments_array_mine = explode("|||", $this->registry->options['post_Replacements_option']);
    foreach ($replacments_array_mine as $post_replace)
    {
        $post_explode_rple = explode("===", $post_replace);
        $this->post['message']  = preg_replace("/\s(" . $post_explode_rple['0'] . ")\s?\b/iU", " " . $post_explode_rple['1'], $this->post['message']);
    }
}


Edit:
This fine addon works fine with "Hide Links From Guests". You only need to set the "Execution Order" from 5 to 4 in "Plugin Manager" -> Guests will not see links in posts (Hook: postbit_display_complete)


Kind Regards,

Stoebi

Code replacement worked excellent! Thank you. Maybe you should add this in a read me for the original hack?

Nj?rd Eriksson 09-11-2006 11:48 AM

Quote:

Originally Posted by outlaw621
Working now with the updated code. Thank you. I have a feature request if possible. Can you make the text replacement case insensitive? For example, typing test or Test would be able to have the replacement text applied instead of having to setup several of the same replacements to compensate for case.

If you run PHP5, replacing str_replace with str_ireplace should do the job.

DrewM 09-13-2006 09:42 AM

Quote:

Originally Posted by Stoebi
Hi

These lines should solve all problems which i had and others posted:

@Larrysw
Replace -> Post Replacements (Hook: postbit_display_complete)
Code:

//$this->post[message]
if ($this->registry->options['post_replacements_enabled'] == '1')
{
        $replacments_array_mine = explode("|||", $this->registry->options['post_Replacements_option']);
        foreach ($replacments_array_mine as $post_replace)
        {
                $post_explode_rple = explode("===", $post_replace);
                $this->post['message']  = preg_replace("/\s(" . $post_explode_rple['0'] . ")\s?\b/iU", " " . $post_explode_rple['1'], $this->post['message']);
        }
}



Edit:
This fine addon works fine with "Hide Links From Guests". You only need to set the "Execution Order" from 5 to 4 in "Plugin Manager" -> Guests will not see links in posts (Hook: postbit_display_complete)


Kind Regards,

Stoebi

thanks again Stoebi I will update the hack.

Stoebi 09-13-2006 03:38 PM

Hi

@Larrysw
I have to thank you! :) Thank you very much! :)


Regards, Stoebi

DeanoG 09-14-2006 07:51 AM

Working perfectly ...:)

but I have noticed another small problem

Replacement Code.....

--------------------
Ultimate===<a href="http://www.xxxxxxxx.com" target="_blank">Ultimate</a>|||Ultimate DVDR===<a href="http://www.ultimate-dvdr.com" target="_blank">Ultimate DVDR</a>
--------------------


The second condition gets ignored due to the fact the Word "Ultimate" has already been replaced in the first condition.

or is it because of the Space between "Ultimate DVDR" ?

is this possible to fix ?


DeanoG

Stoebi 09-14-2006 12:01 PM

Hi

Ultimate DVDR===<a href="http://www.ultimate-dvdr.com" target="_blank">Ultimate DVDR</a>|||Ultimate===<a href="http://www.xxxxxxxx.com" target="_blank">Ultimate</a>


Regards, Stoebi


Quote:

Originally Posted by DeanoG

is this possible to fix ?


DeanoG


Snake 09-17-2006 12:41 PM

Thank you, thank you!

red24 10-06-2006 01:39 AM

this may sound like a silly question, but i installed the mod and i cant find the place where the replament codes go...... could someone please direct me

--edit--

do i just stick those into the replacement variable manager?

Stoebi 10-06-2006 08:06 AM

Quote:

Originally Posted by red24
this may sound like a silly question, but i installed the mod and i cant find the place where the replament codes go...... could someone please direct me

--edit--

do i just stick those into the replacement variable manager?

Hi

Admin -> vBulletin Options -> vBulletin Options and on the right search for Replacement Options


Regards, Stoebi

red24 10-06-2006 10:53 AM

thanks stoebi, never would have found that one myself.....

excellent plug-in :cool:

i have one comment, if the word that has to be replaced is the first one in a message than the plug-in fails to replace it.

-- edit --

Theres also a problem with non english chrsets. it can replace a string in english to a link with a non english anchor text, but it doesnt replace strings of non english chrsets.

Stoebi 10-06-2006 01:22 PM

Quote:

Originally Posted by red24
thanks stoebi, never would have found that one myself.....

excellent plug-in :cool:

i have one comment, if the word that has to be replaced is the first one in a message than the plug-in fails to replace it.

Hi,

thanks should go to LarrySW for his brilliant idea :)
Fixed the first one in a message (See attachment)


Quote:

Originally Posted by red24
Theres also a problem with non english chrsets. it can replace a string in english to a link with a non english anchor text, but it doesnt replace strings of non english chrsets.

Sorry, but i can't reproduce it. :(


Regards, Stoebi

DrewM 10-09-2006 10:35 PM

Quote:

Sorry, but i can't reproduce it.
I don't really care what you do with it after all you wrote most of the code.

Stoebi 10-10-2006 06:53 AM

Quote:

Originally Posted by Larrysw
I don't really care what you do with it after all you wrote most of the code.

Did not have hebrew characters. How can i emulate it? Found another little problem in quotes with words on the first place..

Regards, Stoebi

Stoebi 10-26-2006 08:28 AM

Quote:

Originally Posted by Larrysw
I don't really care what you do with it after all you wrote most of the code.

This version fix lot of problems ( Many thx to Christian from www.vbdesigns.de )
  • Replacement does not effect code boxes
  • First word in post and quotes will be replaced now
  • ...
Regards, Stoebi

DrewM 10-26-2006 09:11 AM

Thanks I'll update it today

SloppyGoat 11-06-2006 03:08 AM

Is there any way to make this only apply to one forum ID?

ThePimp 11-06-2006 03:52 AM

Can you configure this to work in thread titles?
Also, when you use a replaced word as the first word in the post, it fails, and the real word shows.

Tulsa 11-10-2006 06:38 PM

Nice work!

Now when the word or phrase ends with a period, as in the ends a sentence, it's not being replaced.

So if you were replacing the word "test" and the sentence was "I will see how you did on the test." Test would not be replaced.

tansu 11-11-2006 12:45 AM

great.. very nice hack

Stoebi 11-12-2006 04:26 PM

Quote:

Originally Posted by Tulsa
Nice work!

Now when the word or phrase ends with a period, as in the ends a sentence, it's not being replaced.

So if you were replacing the word "test" and the sentence was "I will see how you did on the test." Test would not be replaced.

Fixed - Thx :)

Updated - New version 1.8


Regards, Stoebi

tansu 11-13-2006 12:21 AM

Hello,
we have a problem, each link we add, adds an extra \ to some other links..
Example:
http://www.doctus.net/showpost.php?p=84884&postcount=4

Kommix 11-13-2006 12:36 AM

Problem solved (in cooperation with tansu): we had to clear the example in the XML file. in the end, the code was like this:
Code:

<phrase name="setting_post_Replacements_option_desc" date="1157204521" username="Rdsx" version="1.1"><![CDATA[]]></phrase>

DrewM 11-13-2006 09:02 AM

Quote:

Originally Posted by Stoebi (Post 1115558)
Fixed - Thx :)

Updated - New version 1.8


Regards, Stoebi

thanks I will update the hack today sorry every one for ot supporting this I for got about it :)

actolearn 11-16-2006 09:23 PM

hello,

first, thanks very much for this fantastic mod. :)

a quick question: is it possible to replace links, or entire strings of HTML? for instance i wanted to replace link and anchor text for site A to link and anchor text to site B. the code i tried was
Code:

<a href="http://www.yahoo.com">good site</a>===<a href="http://www.actoguitar.com">great site</a> ||| good site===great site
you'll notice i tried using both HTML and BBcode. i also tried using each one individually. no replacement was made, though.

i am using vbulletin 3.6.3 and version 1.8 of this hack.

any help would be most appreciated. thanks again for this fantastic mod!

DrewM 11-22-2006 04:45 PM

first I'm sorry for the late replie this is a problem with the hack I will look into it more over more though... expect 1.9

DkHelmet 11-29-2006 07:39 PM

Just to jump on the bandwagon:

A better means of specifying replacements would be nice, this can get very unwieldy if more than a dozen or so are in place. Good place to add in string sensitivity and standalone word/inside word per replacement options.

It would be nice to have an "apply only to usergroup" or "except usergroup" option.

Installed.

projectego 11-29-2006 10:31 PM

[high]* projectego clicks install ;)[/high]

Brew 01-02-2007 02:20 AM

I have no idea how or if this could be done but I would like to see this with the ability to have dynamic urls for words.

So if I were to post something about the White House that would turn into a link to somewhere like a wikipedia page on the White House.

Otherwise...Thanks!

maxicep 01-05-2007 12:36 PM

nice hack. thanks. i will install

roger.kore 01-16-2007 08:46 PM

As report:

http://img441.imageshack.us/img441/1449/testyp3.jpg

This plugin is "eating" variables em code/php/html tags on 3.6.4


$test=test
Code:

$test = test
HTML Code:

$test = test
PHP Code:

$test test 


Ducks 02-11-2007 09:09 AM

Can it shown as a dhtml popup instead?

talenak 02-17-2007 11:19 PM

I <3 this hack. I'm already abusing it too. I can't wait for april fools... lol

talenak 02-18-2007 01:35 PM

Wellll, this mod seriously damages certain post functions. Like anything with a php or code tag. Also when I try to open my thread with attachments and code pasted that is the log of modifications I make to the board I can't. I get the below error, and of course everything works fine again as soon as this mod is uninstalled. Clicking uninstalled and checking back every now and again for a fixed version :)

Quote:

Parse error: syntax error, unexpected T_BAD_CHARACTER, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /brute-force/forums/includes/class_postbit.php(296) : eval()'d code(13) : regexp code on line 8

Fatal error: preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Failed evaluating code: &quot;&lt;pre class=\&quot;alt2\&quot; dir=\&quot;ltr\&quot; style=\&quot; margin: 0px; padding: 3px; border: 1px inset; width: 640px; height: 34px; text-align: left; overflow: auto\&quot;&gt;&amp;lt;if condition=&amp;quot;$post[\'signature\']&amp;quot;&amp;gt;&lt;/pre&gt;&quot;==&quot;&lt;pre class=\&quot;alt2\&quot; dir=\&quot;ltr\&quot; style=\&quot; margin: 0px; padding: 3px; border: 1px inset; width: 640px; height: 34px; text-align: left; overflow: auto\&quot;&gt;&amp;lt;if condition=&amp;quot;$post[\'signature\']&amp;quot;&amp;gt;&lt;/pre&gt;&quot;? &quot;&lt;pre class=\&quot;alt2\&quot; dir=\&quot;ltr\&quot; style=\&quot; margin: 0px; padding: 3px; border: 1px inset; width: 640px; height: 34px; text-align: left; overflow: auto\&quot;&gt;&amp;lt;if condition=&amp;quot;$post[\'signature\']&amp;quot;&amp;gt;&lt;/pre&gt;&quot;:&quot; $post_explod in /brute-force/forums/includes/class_postbit.php(296) : eval()'d code on line 13

Kommix 02-26-2007 08:56 AM

PHP Code:

$this->post['message']  = preg_replace("/((\<a[^\>]*?\>.*?\<\/a\>|\<code[^\>]*?\>.*?\<\/code\>|\<pre[^\>]*?\>.*?\<\/pre\>)|(?<!\.)\b" preg_quote($post_explode_rple[0], '/') . "(?!\-|\:|\;)\b)/sie"'"\\2"=="\\1"? "\\1":" $post_explode_rple[1]"'$this->post['message']); 

This line has a huge code error that I couldn't figure out (yet), but it causes the problem again (tansu mentioned above) (http://www.doctus.net/showpost.php?p=84884&postcount=4). What could it be?
The problem: When the word to be replaced is used in a link, the mod adds lots of backslashed. Check out the link:
http://www.doctus.net/showpost.php?p=84884&postcount=4
"Windows'tan Ubuntu'ya kesin ge?iş" is wrapped with the [.url] bbcode. The word Ubuntu is in the replacements list. The apostrophe causes the problem.

Kommix 03-03-2007 09:12 PM

Ha! Solved!
Ha! Problem! My solution disables the plugin completely, so I deleted the solution. Dammit.

Bree 03-12-2007 09:59 PM

Installed and works great... I only ran into one prob... it was replacing in the IMG Tags I think.. cause like I had one replacement for Gallery... and in the images that are posted the word Gallery is apart of the address so it messed those up... I just took out that replacement tho - I can live without it =0) Love the mod! Thanks a bunch! Always, Bree

roger.kore 03-21-2007 08:25 AM

Is there someone working on this product?

I still have this problem:

Attachment 62137

Attachment 62138

There is no similar product T_T

millionart 03-22-2007 07:00 AM

If I use chinese or japanese ,it cant work ,can you fix it?
thanks for this great mod and help.

millionart 03-23-2007 01:12 AM

it cant get the Character of utf8,for example:
1===微软(microsoft)
it works
微软===1
doesnt work
vbb.org use charset=ISO-8859-1 maybe u cant see it
u can see it here:
http://www.google.com/search?client=...BE%AE%E8%BD%AF


All times are GMT. The time now is 11:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01520 seconds
  • Memory Usage 1,845KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (1)bbcode_html_printable
  • (2)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete