1. How to disable links in comments

How to disable links in comments

  |   14
How to disable links in comments

Hi Guys!

I would like to introduce you to the right quite a hack to make external links can not be placed on your favorite site. Spam in the comments no one wants. Once the hack is installed, and user when adding a link is cautioned that link may not be available, in principle, the text can be any warning.


hack Installation:

open file engine/modules/addcomments.php

look for the line:

if( strlen($name) > 50){$stop[] = $lang['news_err_1'];$CN_HALT = TRUE;}



or


if( $is_logged and ($member_id['restricted'] == 2 or $member_id['restricted'] == 3) ) {$stop[] = $lang['news_info_3'];$CN_HALT = TRUE;}


after insert the code:

if (preg_match ("/href|url|http|www|.ru|.com|.net|.info|.org/i", $_POST['comments']) || preg_match ("/href|url|http|www|.ru|.com|.net|.info|.org/i", $_POST['name'])){if (preg_match ("/DLEStarter.com/i", $_POST['comments']) || preg_match ("/DLEStarter.com/i", $_POST['name'])){}else{$stop[] = "Links in comments is PROHIBITED!";$CN_HALT = TRUE;}}
Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

+13

Comments 14

tbenmcp
tbenmcp
DLE TEAM
Commented By tbenmcp on November 15, 2011 (10:48 pm)
I have tested the hack..it works fine on 9.3 and 9.4 too...

the point of view about the hack...in the code:
if (preg_match ("/dlefor.ru/i", $_POST['comments']) || preg_match ("/dlefor.ru/i", $_POST['name']))


Make sure you replace the url dlefor.ru with your own website URL so that your site url will not be blacklist, this also include leech and url tag...so make sure you change that.
20 150Forum topics : 11Forum replies : 248Forum likes : 32

"A True Friend is Someone Who Sees the Pain in Your Eyes while Everyone Else Believes the Smile on Your Face"
Let me Google for you!
Gozan
Gozan
V.I.P.
Commented By Gozan on November 16, 2011 (2:39 am)
thank you Tben for your advise

i didn`t tested this hack, that`s why i don`t change urls.

include leech and url tag...so make sure you change that.


i don`t understand this point,so,can you help me to fix it or can you change it by you ^^
33 132Forum topics : 20Forum replies : 88Forum likes : 7
spamhater
spamhater
DLE TEAM
Commented By spamhater on November 16, 2011 (3:19 am)
What he meant is like this
if (preg_match ("/freevipcare.com/i", $_POST['comments']) || preg_match ("/freevipcare.com/i", $_POST['name']))
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
Gozan
Gozan
V.I.P.
Commented By Gozan on November 16, 2011 (4:51 am)
okey, thanks spamhater to clear point bravo

i was thinking there is a misprint in edit this article,
coz always i make some mistakes in add articles and mr.Tben Instruct me to fix it. ^^
33 132Forum topics : 20Forum replies : 88Forum likes : 7
newchap
newchap
V.I.P.
Commented By newchap on February 18, 2012 (7:24 pm)
hmmm nice, working with 9.5 i tested...
code to find is
if( dle_strlen( $name, $config['charset'] ) > 20 ) {
	$stop[] = $lang['news_err_1'];
	$CN_HALT = TRUE;
}
1 61Forum topics : 6Forum replies : 34Forum likes : 0
bizniz78
bizniz78
Members
Commented By bizniz78 on March 6, 2012 (3:06 am)
it works in website also...

thanksssssss!!!
N/A 6Forum topics : 0Forum replies : 0Forum likes : 0

Please Check My Free Online Movie Website >> http://adzip.us/ << Please Make Comment
GARID
GARID
Members
Commented By GARID on March 19, 2012 (2:53 am)
Works fine in 9.2 :)))
N/A 2Forum topics : 0Forum replies : 0Forum likes : 0
ioloman
ioloman
Members
Commented By ioloman on June 12, 2012 (10:48 pm)
Works well in 9.6, 10XXXXX
N/A 14Forum topics : 1Forum replies : 3Forum likes : 0
ivanov16
ivanov16
V.I.P.
Commented By ivanov16 on August 4, 2012 (9:05 pm)
Work but Can't reply with people
tested on dle 9.5
N/A 60Forum topics : 27Forum replies : 106Forum likes : 1
B00T
B00T
Members
Commented By B00T on August 5, 2012 (9:47 pm)
ivanov16,
Me too
N/A 3Forum topics : 3Forum replies : 5Forum likes : 0
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on August 6, 2012 (2:12 am)
Try this
if (preg_match ("/href|url|http|www|.ru|.com|.net|.info|.org/i", 
$_POST['comments']) || preg_match ("/href|url|http|www|.ru|.com|.net|.info|.org/i", 
$_POST['comments'])){if (preg_match ("DLEStarter.com/i", 
$_POST['comments']) || preg_match ("DLEStarter.com/i", $_POST['comments'])){}
else{$stop[] = "Links in comments is PROHIBITED!";
$CN_HALT = TRUE;}
}
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
onchannel
onchannel
V.I.P.
Commented By onchannel on August 16, 2012 (2:14 pm)
i have the mstarter 9.6 theme and i can`t find the codes provided . what code should i find?

thanks in advance
N/A 84Forum topics : 8Forum replies : 14Forum likes : 0

full movies
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on August 16, 2012 (7:06 pm)
the hack has nothing to so with theme, in 9.6 use the second code.
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
letsdl
letsdl
Members
Commented By letsdl on April 22, 2013 (5:41 am)
work very well in 9.8
N/A 6Forum topics : 5Forum replies : 12Forum likes : 0
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.
DLEStarter Notice!Please note...Every hack and every module will get additional queries from your database and some hacks and some modules may result your server overload, so install only what you "need", remove any hacks and modules from your script when you don't need them, all hacks and modules appears in this website are not guaranteed by DLEStarter Team for your script security and compatibility, please read instruction carefully and use hacks and modules at your own risk...Thank you.