vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Replace Text (https://vborg.vbsupport.ru/showthread.php?t=50116)

amykhar 03-12-2003 10:00 PM

Replace Text
 
This is more of a getting you started piece of code than a copy and paste your board is hacked kind of release. If you don't know how to code in PHP, this hack is NOT for you.


What this "hack" does is it allows you to replace a word in a post with something else. It doesn't replace the word in titles or anywhere else like replacements do. Just in a post.

What I use it for: I replace the word Netflix in every post with a link to my Netflix affilliate.

What you might use it for: affilliate links, swear word replacements with style, pranks, whatever :D

You will need to modify the function that I have included to set up your own replacement words. You might want to replace more than one thing. It's up to you. Have fun with this and share what you have done.

Demo:

http://www.eaforums.com/forums/showt...threadid=22557

I will help as much as I can in customizing this for you within reason.

FleaBag 03-14-2003 12:27 AM

Useful for updating smilie names, I'll check it out sometime. Nice work! :)

Boofo 03-14-2003 12:28 AM

I don't mean to sound negative, but can't you do the same thing with tags in vbcode without hacking? ;)

filburt1 03-14-2003 12:40 AM

The idea is you just type Netflix and it happens to turn into an affiliate link.

Boofo 03-14-2003 01:11 AM

I understand that. But a tag would be more versatile instead of having to hack the php file every time you wanted to change it. But to each his own, I guess.

Sho 03-14-2003 01:48 AM

How is this different from the Replacement Variable system? I use it to replace the phrase "closednow" with an image of a padlock, sort of a funny tradition on my forums. Works for me.

Merjawy 03-14-2003 03:16 AM

I think this is more of a filter wich is biult in vB but doesn't work well with other languages... at least it didn't work for me

this could be a better way to make it censer certain words ..

Erwin 03-14-2003 04:41 AM

What this hack does is it replaces the word with a link or whatever you want retrospectively as well (I think). Also, it's better than replacement, as replacement affects post titles, whereas this doesn't (from what I can understand).

amykhar 03-14-2003 01:14 PM

Erwin is correct. Replacements changed the word in thread titles, as well, which then effectively rendered the thread unreadable because it became a link to Netflix.

I didn't use vbbcode because I don't want to have to edit each post and I don't want to have to rely on the membership to put it in.

I use this in conjunction with a hack Logician wrote for me eons ago that changes any link somebody posts to Amazon to a link that uses my affilliate ID. That hack helped quite a bit; so I am trying to expand slowly into other relevant affiliates.

Amy

Brad 03-14-2003 01:46 PM

wow i was just thinking of doing something like this. Im ganna build a page (might use the glossery hack) and have said word link to the glossery when its typed. this saves me some time :)

[high]* Brad licks install[/high]


All times are GMT. The time now is 09:13 PM.

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.01018 seconds
  • Memory Usage 1,728KB
  • 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
  • (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
  • (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