News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Stopping Censoring Effecting Titles

Started by PurpleCrow, July 23, 2010, 07:29:12 PM

Previous topic - Next topic

PurpleCrow

Is it possible to prevent word censoring to effect topic titles?
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

Antechinus

That would require some custom coding. It would be possible but offhand I'm not sure how much a of performance problem it might be, and I don't think anyone would be interested in doing a mod package for it as it is such an unusual request. Why would you want to censor post content but not titles?

PurpleCrow

I was planning on having a bit of fun with images by having small icons appear next to certain words (eg, a coffee cup next to the word coffee) but if I do it via censoring it means that the title ends up full of BBCode if the word is used in a title.
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

Antechinus

What are you entering in your censor? I haven't checked but I'm thinking the censor probably reads html instead of bbc.

ɔɔɔɔɔɔuɥoɾ

Quote from: PurpleCrow on July 23, 2010, 08:26:23 PM
I was planning on having a bit of fun with images by having small icons appear next to certain words (eg, a coffee cup next to the word coffee) but if I do it via censoring it means that the title ends up full of BBCode if the word is used in a title.

I use it to make censored words change to a smiley, which requires no bbc or html, IMO that's the easiest way to add images using the censor system, just add the custom smileys for those images.


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Antechinus

That's a good trick. I've just been playing with it at my place. People are going to freak. ;D

ɔɔɔɔɔɔuɥoɾ

Quote from: Antechinus on July 24, 2010, 01:05:33 AM
That's a good trick. I've just been playing with it at my place. People are going to freak. ;D

Yea, I use this one, works like a charm

Only bug is it does not work on Preview, but who cares lol


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

PurpleCrow

Sorry, I'm being really thick (not had coffee yet!) - how would I go about adding the images before certain words?
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

Antechinus

I tried it and there's a catch: it will show the smiley codes in thread titles. It works in post content but not in titles.

PurpleCrow

Yeah, thats what I dont want and like you say no one is likely to make a mod for it. Oh well, that ideas gone out the window.
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

ɔɔɔɔɔɔuɥoɾ

#10
Quote from: PurpleCrow on July 24, 2010, 07:27:59 AM
Sorry, I'm being really thick (not had coffee yet!) - how would I go about adding the images before certain words?

Well, lets use you coffee example.

add a smiley with a coffee cup, call it maybe :coffee: (the trigger word) then using the word censor replace coffee with  :coffee: coffee (for posts)

Quote from: Antechinus on July 24, 2010, 08:00:12 AM
I tried it and there's a catch: it will show the smiley codes in thread titles. It works in post content but not in titles.

It would be possible to make titles parse the smileys and bb code too with some additional coding.
As for making a mod for it, all coding would probably only be adding the titles to parse bbc and smileys, I know the code for parsing bbc is not that much, their would be an extra split second for loading time, but not much I'd imagine


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

PurpleCrow

If I could get titles to parse Smileys it would be perfect, how would I go about it? What code changes would I need to make?
SMF 2.0 RC3

Looking for staff!

Forums Galore, a brand new Admin Forum is looking for staff to help with the launch. Send me a PM or sign up to Forums Galore if you're interested!

Add your forum to the Forums Galore Community Showcase

ɔɔɔɔɔɔuɥoɾ

Making inputs to parse bbc is relativity easy something similar to
parse_bbc($somvar['some_input']
I think you could get this mod request popular though, just request a mod like


Smileys in Topic Subject :)


SMF 2.0 RC5

   
Webhost to New Webhost file transfer service, PM me - Fast transfers

Kill Em All

PurpleCrow, do you need any further assistance with this topic? Unfortunately, I can't think of a way to get it to work either.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

klausd

It must be possible and i've done it almost. Just delete lines like this in Display.php censorText($topicinfo['subject']); and some other files in the sources folder.

But the title is still beeing replaced in a catergory. Not on the Bord index or in the thread itself. So which files have to modified to stop censoring effecting Titles?

SlammedDime

find in all files (or grep) is our friend...

mzuba@d000-mzuba1:/var/www/localhost/public/forum/Sources$ grep -irn "censorText(" *
Display.php:383: censorText($topicinfo['subject']);
Display.php:661: censorText($row['label']);
Display.php:1177: censorText($message['body']);
Display.php:1178: censorText($message['subject']);
Groups.php:969: 'reason' => censorText($row['reason']),
Load.php:1112: censorText($profile['signature']);
Load.php:1113: censorText($profile['personal_text']);
Load.php:1114: censorText($profile['location']);
ManagePosts.php:166: $context['censor_test'] = strtr(censorText($censorText), array('"' => '"'));
MessageIndex.php:429: censorText($row['first_subject']);
MessageIndex.php:430: censorText($row['first_body']);
MessageIndex.php:440: censorText($row['last_subject']);
MessageIndex.php:441: censorText($row['last_body']);
MessageIndex.php:448: censorText($row['first_subject']);
MessageIndex.php:453: censorText($row['last_subject']);
ModerationCenter.php:1409: $row['subject'] = censorText($row['subject']);
ModerationCenter.php:1410: $row['body'] = censorText($row['body']);
News.php:642: censorText($row['body']);
News.php:643: censorText($row['subject']);
News.php:787: censorText($row['body']);
News.php:788: censorText($row['subject']);
PersonalMessage.php:958: censorText($subject['subject']);
PersonalMessage.php:1022: censorText($message['body']);
PersonalMessage.php:1023: censorText($message['subject']);
PersonalMessage.php:1544: censorText($row['body']);
PersonalMessage.php:1545: censorText($row['subject']);
PersonalMessage.php:1675: censorText($row_quoted['subject']);
PersonalMessage.php:1676: censorText($row_quoted['body']);
PersonalMessage.php:1931: censorText($row_quoted['subject']);
PersonalMessage.php:1932: censorText($row_quoted['body']);
PersonalMessage.php:2215: censorText($context['preview_subject']);
PersonalMessage.php:2216: censorText($context['preview_message']);
Poll.php:424: censorText($row['label']);
Poll.php:449: censorText($label);
Poll.php:541: censorText($row['label']);
Poll.php:592: censorText($pollinfo['subject']);
Post.php:598: censorText($context['preview_subject']);
Post.php:599: censorText($context['preview_message']);
Post.php:777: censorText($form_message);
Post.php:778: censorText($form_subject);
Post.php:853: censorText($form_message);
Post.php:854: censorText($form_subject);
Post.php:889: censorText($form_subject);
Post.php:2206: censorText($context['announce_topic']['subject']);
Post.php:2252: censorText($context['topic_subject']);
Post.php:2253: censorText($message);
Post.php:2361: censorText($topicData[$key]['subject']);
Post.php:2362: censorText($topicData[$key]['body']);
Post.php:2518: censorText($row['body']);
Post.php:2587: censorText($row['body']);
Post.php:2594: censorText($row['subject']);
Post.php:2861: censorText($context['message']['subject']);
Post.php:2862: censorText($context['message']['body']);
Post.php:2880: censorText($context['message']['subject']);
Printpage.php:98: censorText($row['subject']);
Printpage.php:99: censorText($row['body']);
Profile-Modify.php:2105: censorText($row['subject']);
Profile-View.php:479: censorText($row['body']);
Profile-View.php:480: censorText($row['subject']);
Profile-View.php:663: $row['subject'] = censorText($row['subject']);
Recent.php:71: censorText($row['subject']);
Recent.php:72: censorText($row['body']);
Recent.php:327: censorText($row['body']);
Recent.php:328: censorText($row['subject']);
Recent.php:1175: censorText($row['first_subject']);
Recent.php:1176: censorText($row['first_body']);
Recent.php:1186: censorText($row['last_subject']);
Recent.php:1187: censorText($row['last_body']);
Recent.php:1194: censorText($row['first_subject']);
Recent.php:1199: censorText($row['last_subject']);
Search.php:834: elseif ($suggestions[$i] != censorText($s))
Search.php:1886: censorText($message['body']);
Search.php:1887: censorText($message['subject']);
Search.php:1889: censorText($message['first_subject']);
Search.php:1890: censorText($message['last_subject']);
SendTopic.php:114: censorText($row['subject']);
SplitTopics.php:427: censorText($row['subject']);
SplitTopics.php:428: censorText($row['body']);
SplitTopics.php:468: censorText($row['subject']);
SplitTopics.php:469: censorText($row['body']);
SplitTopics.php:965: censorText($row['subject']);
Stats.php:344: censorText($row_topic_reply['subject']);
Stats.php:414: censorText($row_topic_views['subject']);
Subs-BoardIndex.php:238: censorText($row_board['subject']);
Subs-Calendar.php:209: censorText($row['title'], $use_permissions ? false : true);
Subs-Members.php:949: if (censorText($censor_name) != $name)
Subs-Post.php:1189: censorText($message);
Subs-Post.php:1190: censorText($subject);
Subs-Post.php:1525: if ($suggestions[$k] != censorText($word))
Subs-Post.php:1578: censorText($row['subject']);
Subs-Post.php:1579: censorText($row['body']);
Subs-Post.php:2851: censorText($topicData[$topic][$msgKey]['subject']);
Subs-Post.php:2852: censorText($topicData[$topic][$msgKey]['body']);
Subs-Recent.php:66: censorText($row['subject']);
Subs-Recent.php:67: censorText($row['body']);
Who.php:469: $data[$k] = sprintf($session_text, $row['id_topic'], censorText($row['subject']));
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

Advertisement: