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


All times are GMT. The time now is 06:33 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.01158 seconds
  • Memory Usage 1,749KB
  • 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
  • (3)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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