[ABD] WordLinks MOD v0.0.1 -- NO SUPPORT

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
MrTorrance
Registered User
Posts: 92
Joined: Thu Nov 18, 2004 10:41 pm
Location: Idaho
Contact:

[ABD] WordLinks MOD v0.0.1 -- NO SUPPORT

Post by MrTorrance »

WordLinks MOD v0.0.1

Adds a seperate section below the Word Censors link in the ACP. There you can create word replacement strings in HTML and possibly other formats(haven't tested fully). Basically functions just like word censor only it allows for HTML tags as well as a lot more room for code. You could use it to make banner adds, forms, secret custom smiles, ect. all by imputing a unique string (ie. thisismysecretbannercode) in you post message area. Also use it for basic word to link changes, like amazon to amazon.

FEATURES:
  • * ACP section
    * Preview only for ADMINS and MODERATORS
    * Works on just the message body(so as no to destroy phpbb links)
ADD LATER:
  • * Button to create unique strings (MD5?)
    * Help Sheet in ACP ( show diff tags and css codes )
    * Improve Language file
    * TAKE SUGGESTIONS :)
TESTED IN 2.0.11

Code: Select all

############################################################## 
## MOD Title: WordLinks
## MOD Author: MrTorrance <admin@upkill.com > (Casey) http://www.upkill.com
## MOD Description: Add an ACP section where you can have words(strings) automatically replaced by HTML code in the message body of forum posts. Allowing admins to quickly add code, banners, pictures, secret smiles, or whatever else you want to put in.
## MOD Version: 0.0.1
## 
## Installation Level: moderate
## Installation Time: 25 minutes.
## Files To Edit: viewtopic.php
##              search.php
##              privmsg.php
##              posting.php
##              modcp.php
##              language/lang_english/lang_admin.php
##              includes/functions.php
##              includes/functions_validate.php
##              includes/topic_review.php
##              admin/admin_words.php
## Included Files: admin/admin_wordslinks.php
##              templates/subSilver/wordslinks_edit_body.tpl
##              templates/subSilver/wordslinks_list_body.tpl
##              WordLinks.sql
##              WordLinks.mod
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
############################################################## 
## Author Notes: [DEV] Use at your own risk.  Program is in test phase.
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

SEE DOWNLOAD FOR FULL UP TO DATE MOD
ACP SCREENSHOT

:arrow: DOWNLOAD MOD [7KB] :D updated 12/28/04
Last edited by MrTorrance on Thu Sep 01, 2005 11:22 pm, edited 9 times in total.
~MrsTorrance~
~Wife's Blog~
...it must be that darn flux capacitor again!?
[DEV]CC_2ND_EMAIL : [DEV]WordLinks
tanner_S.
Registered User
Posts: 446
Joined: Sun Oct 10, 2004 9:04 pm

Post by tanner_S. »

Looks very, very cool yet, might take a while for us admins with MODs on ye boards. Can you smack it into some kind of instructional templete?

-Tanner
MrTorrance
Registered User
Posts: 92
Joined: Thu Nov 18, 2004 10:41 pm
Location: Idaho
Contact:

Post by MrTorrance »

If I can swing some time tommorrow I will make a MOD template. I love mods, and you just can't install them without a list of all the changes. :)
~MrsTorrance~
~Wife's Blog~
...it must be that darn flux capacitor again!?
[DEV]CC_2ND_EMAIL : [DEV]WordLinks
iloserman
Registered User
Posts: 1147
Joined: Wed Aug 20, 2003 7:45 pm
Location: My Closet Mode: Working
Contact:

Post by iloserman »

MrTorrance wrote: If I can swing some time tommorrow I will make a MOD template. I love mods, and you just can't install them without a list of all the changes. :)


Not only can you not install them without a list of the changes, it also can't be released if it is a "Pre-MODDED" files 8)


Just a heads up.


BTW: Looks good. I like the idea.


ILM
- Have a problem? I would love to help you out.
[ AIM ] [ MSN ] [ PM ] [ E-MAIL ] [ Website ] <- Contact info below.

Over 2,550+ users assisted, outside of phpBB. 37 Hosted.
MrTorrance
Registered User
Posts: 92
Joined: Thu Nov 18, 2004 10:41 pm
Location: Idaho
Contact:

Post by MrTorrance »

MOD FILE DONE 8O

WordLinks MOD
~MrsTorrance~
~Wife's Blog~
...it must be that darn flux capacitor again!?
[DEV]CC_2ND_EMAIL : [DEV]WordLinks
Velcro Warrior
Registered User
Posts: 79
Joined: Wed Jul 30, 2003 5:04 am

Post by Velcro Warrior »

I'm getting an "unexpected $ at line 1452 in posting.php"

1452 is the end of the file.
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

I would just like to make a suggestion/feature request. The ability to have different links associated to one word would be great. So that a word "science" could be linked to several different urls and each time the page is loaded a different link would be present as well as the ability to make the link appear how you want it to. Just a suggestion.
MrTorrance
Registered User
Posts: 92
Joined: Thu Nov 18, 2004 10:41 pm
Location: Idaho
Contact:

Post by MrTorrance »

Velcro Warrior - PM your posting.php file to me and I'll take a look to see what I can figure out. It sounds like your missing a bracket or comma somewhere. ???

khisanthax - Thanks for the suggestion. When the holidays are over, I want to redesign the whole admin section to make it easier for the tech. challenged.

FYI **SECURITY PROBLEM??**
When using Quote in POSTING.PHP, your HTML code is exposed. I wrote a fix that isn't in the MOD yet. I'm not sure if I really consider this an issue, becuase it all depends on what your doing with the word replacements.

POSTING.PHP
if ( $mode == 'quote' )
{
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);

// MOD WordLinks
$orig_word_topic = array();
$replacement_word_topic = array();
obtain_word_list_topic($orig_word_topic, $replacement_word_topic);
// END MOD WordLinks

$msg_date = create_date($board_config['default_dateformat'], $postrow['post_time'], $board_config['board_timezone']);

// Use trim to get rid of spaces placed there by MS-SQL 2000
if ( !empty($orig_word) )
{
$subject = ( !empty($subject) ) ? preg_replace($orig_word, $replacement_word, $subject) : '';
$message = ( !empty($message) ) ? preg_replace($orig_word, $replacement_word, $message) : '';
}

// MOD WordLinks
if ( !empty($orig_word_topic) )
{
if( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD )
{
$message = $message;
}
else
{
$message = ( !empty($message) ) ? preg_replace($orig_word_topic, $nothing, $message) : '';

}
}


This basically keeps anyone but ADMIN and MOD's from seeing the original word, and blanks out the word for everyone else on the QUOTE. I know its sketchy, but it works for me.
~MrsTorrance~
~Wife's Blog~
...it must be that darn flux capacitor again!?
[DEV]CC_2ND_EMAIL : [DEV]WordLinks
Velcro Warrior
Registered User
Posts: 79
Joined: Wed Jul 30, 2003 5:04 am

Post by Velcro Warrior »

I'll have to redo the modifications and PM it; Another possible feature would be for an admin to have the ability to track the links and see how many times a particular word was clicked, and maybe even who clicked it.
Velcro Warrior
Registered User
Posts: 79
Joined: Wed Jul 30, 2003 5:04 am

Post by Velcro Warrior »

it seems the fix still leaves the html open, even for guests.
MrTorrance
Registered User
Posts: 92
Joined: Thu Nov 18, 2004 10:41 pm
Location: Idaho
Contact:

Post by MrTorrance »

ERROR FOUND BY VELCRO WARRIOR :oops:
// MOD WordLinks Preview for ADMIN and MODERATORS
if( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD) {
$orig_word_topic = array();
$replacement_word_topic = array();
obtain_word_list_topic($orig_word_topic, $replacement_word_topic);
// END MOD WordLinks


SHOULD BE:

Code: Select all

	// MOD WordLinks Preview for ADMIN and MODERATORS
	if( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD) 
   {
		$orig_word_topic = array();
		$replacement_word_topic = array();
		obtain_word_list_topic($orig_word_topic, $replacement_word_topic);
   }
	// END MOD WordLinks
I left out the closing } in the MOD file. MOD FILE HAS BEEN CORRECTED
~MrsTorrance~
~Wife's Blog~
...it must be that darn flux capacitor again!?
[DEV]CC_2ND_EMAIL : [DEV]WordLinks
Velcro Warrior
Registered User
Posts: 79
Joined: Wed Jul 30, 2003 5:04 am

Post by Velcro Warrior »

another note about that syntax fix, it appears twice; Once in privmsg.php as well as posting.php.
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

Have you taken a look at the banner mod? I think that would be a great way for you to make an admin panel for this mod as you mentioned earlier that you would do later.
Supachoups
Registered User
Posts: 2
Joined: Tue Mar 08, 2005 11:56 am

Post by Supachoups »

Hi,

Thanks for you mod, it is very handy :)

I was wondering if you could add a functionnality. Some sort of priority ranks for the word links.

Per example, I wish the expression Panthera leo could take me to a specific place and the expression Panthera leo melanochaita to another. P. leo melanochaitai should have the priority over P. leo. Without a priority rank, this sort of thing is impossible as the shorter word link negate the longer.
khisanthax
Registered User
Posts: 443
Joined: Sun Mar 02, 2003 1:49 am

Post by khisanthax »

has this been dropped?
Locked

Return to “[2.0.x] MODs in Development”