News:

SMF 2.1.2 has been released! Take it for a spin! Read more.

Main Menu

SmileyLimit

Started by snork13, August 22, 2006, 08:53:53 AM

Previous topic - Next topic

Maria_HH

Hi,

download the file, SmileyLimit.zip [nofollow] and edit the package-info.xml

Search Line 47:

Quote<install for="2.0 RC3">
      <readme type="file">readme_2_0_x.txt</readme>
      <modification>modification_2_0_x.xml</modification>
      <code>add_settings_2_0_x.php</code>
   </install>

   <!-- Don't forget something to make it uninstallable! -->
   <uninstall for="2.0 RC3">
      <readme type="inline">Thanks for trying this mod. -Snork13</readme>
      <modification reverse="true">modification_2_0_x.xml</modification>
   </uninstall>

and replaced with:

Quote<install for="2.0.1">
      <readme type="file">readme_2_0_x.txt</readme>
      <modification>modification_2_0_x.xml</modification>
      <code>add_settings_2_0_x.php</code>
   </install>

   <!-- Don't forget something to make it uninstallable! -->
   <uninstall for="2.0.1">
      <readme type="inline">Thanks for trying this mod. -Snork13</readme>
      <modification reverse="true">modification_2_0_x.xml</modification>
   </uninstall>

It works fine with SMF 2.0.1 and SimplePortal 2.3.3 with me

bdtcomp

I installed this app. on 2.0.2 and finally got it to work. BUT I am pasting what you need to be aware of, otherwise you may do what I did and it doesn't function, though gives you the box to add the smiley number limit.

Re: Smiley Limit
  :) :) :) :) :) :) SUCCESS  8) 8) 8) 8) 8) 8) 8)

Sorry about the smiles, but I wanted to make an impression. OK, this works in 2.0.2  ;)

What you need to be carefull is in the first file you parse. the code for post.php has the first line to parse and add after: But there are two identical lines, so add the code to parse after this snippet of code.

Quote<blockquote>// Prepare the message a bit for some additional testing.
$_POST['message'] = $smcFunc['htmlspecialchars']($_POST['message'], ENT_QUOTES);</blockquote>

FrizzleFried

Installed... no errors... I can set the smiley limit... tested it once and it gave me an error saying I couldn't post more than 10 smileys... since then... nothing.  I can post,  respond,  or quick reply and the 10 smiley limit isn't being enforced.

:(

EDIT: BTW ... looking at the above reply,  I checked and the the code was correctly installed in the proper place (the first instance of the search string above)... so that's not the problem.

I need help bad as I have a bunch of smart-ass users who think it's funny to post 2500 (no... I am not kidding) smileys in a post.  That pretty much crashes my forum when they pull that crap.  It's happened 3x in the last week now. 

FrizzleFried

Nevermind...

(A) My users were messing with my by posting dozens of IMG tags for the smileys...

(B) When I tested I was testing with PREVIEW.... the error doesn't hit until you try to save.

Mod is working out of the box.

Sorry for the confusion.

Skaty

i think this mod is count these quotes like a smile. i limited post to 10 smileys but gave me error for this post, cant send it.


Hristo

Thanks for the mod!

Just word of caution:

The mod uses <search position="after"><![CDATA[?>]]></search> when installing the language string, but the string ends without new row "...try again.';]]>...."
the end result is "...try again.';?>" and that works, but if you install another mod after that which uses <search position="end" /> it's string(s) install after the "?>" and obviously that is a problem.

IMO the best solution is to replace
<search position="after"><![CDATA[?>]]></search>
with
<search position="end" />

Strannik64

Please Update for 2.1 RC4  ::)

Arantor

It would need a complete rewrite for 2.1. Fairly certain it would even need a complete rewrite for current 2.0 actually as well.

Though honestly, if members continually use too many smileys in posts, it's not like you don't have other options for moderation, including deleting posts, issuing warnings and post moderation. Not all sociological problems need technical solutions.
No good deed goes unpunished / All helpful urges should be circumvented

I have something to say: it's better to burn out than to fade away. There can be only one.

FrizzleFried

I... personally... am lazy.  I don't want to work.  Technology > Work

Just saying.

;)

Advertisement: