PDA

View Full Version : Description length check mod


Nobody
09-22-2005, 07:54 PM
Does anybody have the code to the mod that goes like this:
"Description requires between xx-xx characters."

Romario
09-25-2005, 09:11 AM
Min and Max check.

Nobody
09-25-2005, 01:50 PM
Exactly, that's what I'm trying to say. Thank you! :)

Anyone? Jim, you have that mod?

Nobody
10-22-2005, 12:13 AM
I think Jim Westergren is using this mod, for instance. Please, I would be very happy of someone posted the mod here?

Ap0s7le
10-22-2005, 12:57 AM
Something like this?
{url no longer in service}


-Casey

yktan
10-22-2005, 10:18 AM
Beautifully done Casey!

Nobody
10-22-2005, 12:50 PM
Not exactly. I like that mod and I would like to have it, but what I'm actually looking for is a mod that says "Hey! The description field must contain minimun XX letters and max XX letters." in the sumbit procedure.

yktan
10-22-2005, 03:08 PM
Hi Nobody,

What you want is a validation during submission that validates whether or not a text field contains text of a certain length. To achieve that, submit.php would have to be modified. Personally, I am not able to do this now, maybe our good man Casey can give you some help?

Ap0s7le
10-22-2005, 05:23 PM
Hmm, so just flag an error message eh?

Yup, we can do that if you need it.

eli03
02-07-2006, 10:16 PM
anyone want to share a mod for this topic?

SEO-Man
02-10-2006, 07:04 AM
i second that i could use this i feel it would cut down on a lot of spam.

I dont like caned spam dont taste good so please help me get rid of it. :D

Ap0s7le
02-10-2006, 09:36 PM
This is doable for sure.

You can ask yktan, we get so busy that it's hard to leave the house and so sometimes it takes forever for smaller things to get done.

We'll get her hammered out.

Regards,

-Casey

SEO-Man
02-11-2006, 12:07 AM
@ Ap0s7le

Thank you for the offer but $20 is more then one should pay since it dont take an hour to do and i could hire some one local to do it for that amount.

Looks like i will have to outsource this just like i have outsourced all my other work on my directory.

Ap0s7le
02-11-2006, 12:23 AM
SEO-Man,

It depends, really.

What you would have gotten for that price was more secure then what you asked for. Do you know why?

I like to leave a site better off, and not just give them something that wont work in the future. What's nice about my mod would be that people using scripts to submit would also be checked, rather than completely bypass the JS validation.

I'm sorry that I value my time, I'm sure you could ask many here about me and find out I go above and beyond.

Heck, sometimes I overprice just to get rude people off my back. :)

Kind Regards,

-Casey

SEO-Man
02-11-2006, 12:39 AM
Content visible to registered users only.

kind of like the way it should be how else would some one do it?

I mean if your going to pay for something you think some one is going to do it any different?

Content visible to registered users only.

No its called you try and find a sucker that you can charge an hour labor for something that takes 10 mins tops.

Content visible to registered users only.

yes i can see why your making an hours labor for something that takes 10 mins to do.

If i was charging peolpe an hour labor and new it would take 10 mins to do i would help out a lot of peolpe as well.

I wish you luck in finding more peolpe that are willing to pay 5 times the amount that some one should pay.

One thing i like to mention is that i never would mind paying but when i know something is over priced i feel the person is trying to take me for a ride and does not respect his clients.

Ap0s7le
02-11-2006, 12:57 AM
Haha

You asked for a JS validation, most people would take what you said and provide you JUST that. Especially if you're paying them 5 bucks.

Today I got a bonus from a man. Strange isn't it? He must have been suckered into thinking I did a great job. Those crazy people ;)

I'm done with the convo, it can't take over this thread because then I'll have to delete it and then it'll look like a coverup of some evil mastermind.

Thanks for your thoughts SEO-Man, I hope you find what you're looking for and it's better than I could have provided.

Kind Regards and Best Wishes.

-Casey

SEO-Man
02-11-2006, 01:02 AM
Content visible to registered users only.

Well i offerd you $10 but it didnt matter what i offerd you.

The fact of the matter was i new i was getting ripped off for what i wanted.

If i wanted what you offerd then i would have said i wanted what you offerd.

Did i ask for what you offerd? NO

I feel in business you listen to your clients needs not what you want to do.

Its like if i asked you for a ford car are going to charge me the price for a BMW?

Ap0s7le
02-11-2006, 01:17 AM
My whole point is, you asked for help to get rid of canned spam.

Plain JS wouldn't have done that, but from your site I gathered you wanted it to popup and tell them about the Min/Max.

I could have done just that, but it wouldn't have been helpful per your request in this thread to help get rid of spam.

I'm sorry for offering more than a ford, I thought you wanted a ford body, just with a decent engine.

This topic is over, please refrain from posting anymore unless it's in regards to the thread topic or all unnesessary post will be removed. That's not personal, just keeps thread hijacking down.

-Casey

eli03
02-13-2006, 12:30 AM
bummpp. anyone want to share the script for free ? I think it's only 1 to 3 line of code in php.

Jim_Westergren
02-14-2006, 01:26 AM
The first time I see this thread ...

I originally paid Casey to do it for me a long time ago. I believe $25 or something.

I am a nice guy, here it is for free:

In submit.tpl:

Content visible to registered users only.

admin/messages.tpl:

Content visible to registered users only.

submit.php:

Content visible to registered users only.

To be placed after:

Content visible to registered users only.

eli03
02-14-2006, 01:49 PM
thanks jim, i was looking for same script as yours on your directory site. Finally :)

I just added your "V7ndotcom Elursrebmem " in my footer area of my http://www.bigvertiser.com not permanet, the link will stay until the contest end.

Goodluck on the contest.

Thanks again,
eli

Jim_Westergren
02-15-2006, 02:14 AM
Thanks a lot and nice that you like it.

Kevuk2k
02-15-2006, 03:29 AM
Content visible to registered users only.

Well i offerd you $10 but it didnt matter what i offerd you.

The fact of the matter was i new i was getting ripped off for what i wanted.

If i wanted what you offerd then i would have said i wanted what you offerd.

Did i ask for what you offerd? NO

I feel in business you listen to your clients needs not what you want to do.

Its like if i asked you for a ford car are going to charge me the price for a BMW?[/quote]

Leave Casey alone man, this guy has proved invaluable behind the scenes here and I for one back him all the way. Time is money and while I understand your point your way of going about addressing the issue was out of order. Casey helps many people you know nothing about and does not charge half of what others have, I know, I've been there, seen it and done it! I think that Casey has repsonded in the way you deserved quite frankly insofar as you expect to get everything for nothing or value peoples time as worthless, or worth little. I agree that if a mod has been made widely available then it shouldn't be over capitalized but in your case this one hadn't and if it wasn't for the fact Jim was kind enough to help you out you would have had to pay someone more than five bucks for the mod even if it was only three lines of coding as you say.

Take into consideration that sometimes just three lines of script can be more difficult a task that an entire pagefull of coding, it is all relevant to the issue at hand.

I will end on saying that this is nothing personal on you as I don't know you, but as a donor on this site I do think that your comments almost brought this forum feed to the level that we never want to see it go! Please, if you have personal issues with mod writers, don't try and belittle them on here as it breads contempt and will make at least one of you bad!

We don't need this as the common goal is to get this great script to work at maximum efficiency wouldn't you agree.

Keep personal issues of line mate, you will be a better person for it. :wink:

Take care and good luck.

Kevin

clubracer
02-23-2006, 05:06 PM
Content visible to registered users only.

did you not forget the laguage file update?
...and before i forget, is this mod showing something like this: "225 characters left"?

Neticus
02-23-2006, 07:02 PM
Content visible to registered users only.

Hi, yes, 255 visual limit guide is supposed to rapidly decrease as user types in characters.

-

clubracer
02-23-2006, 07:49 PM
Content visible to registered users only.

Hi, yes, 255 visual limit guide is supposed to rapidly decrease as user types in characters.

-[/quote]

Ok installed the code from above and the error message is coming up when the input is not between 100-255, but i cannot see the tekst: "255 characters left".

anyone with the complete Mod please?

Neticus
02-23-2006, 09:07 PM
Content visible to registered users only.

Whoops! sorry! just remembered, the characters going down (as a visual guide) is a total other mod, javascript code, which I got from a scripts site. Managed to integrate it into submit.tpl. If you still want that feature then here is the script you can try:

Form field Limiter (http://www.dynamicdrive.com/dynamicindex16/limitinput.htm)

Sorry for confusion! :roll:

Net. :roll:

clubracer
02-24-2006, 12:13 AM
That will do, thnx Neticus!

Gonna give it a try first thing in the morning, it's 1u11 overhere, need some sleep after 16 hours non-stop tweaking phpld.

eli03
02-24-2006, 01:02 AM
I think this is the mod your looking for http://www.ap0s7le.com/journal/entry/2138/ :D

Boby
02-24-2006, 01:43 AM
Hello!

I will give this mod a try. We will do both client side and server side validation in case JavaScript is disabled :lol:
Also it's supports language files.

Edit "submit.php":
Look for:Content visible to registered users only.
Insert this right after:Content visible to registered users only.

Now look for:Content visible to registered users only.
Insert this right after:Content visible to registered users only.

Create a file called "formlimit.js" and write following in it:
Content visible to registered users only.

Now edit "templates/header.tpl" and add this between your "<head> .. </head>" tags:Content visible to registered users only.

Find following line in your "templates/submit.tpl" file:Content visible to registered users only.
Replace the line with this (notice also "id" elem):Content visible to registered users only.

Add this line to "templates/admin/messages.tpl":Content visible to registered users only.

And finally add this to your language file:Content visible to registered users only.

The mod is displaying how many charachters you have left, if you enter more than allowed the JavaScript will try to shorten it. If JavaScript is turned off or it fails, PHP is getting into action and display an error :) You can't fool PHP as JavaScript, hehehe.

All credits in the .js file must remain intact for use (Powered by Dynamic Drive). Thanks to Neticus for the link, I was trying before with another not that good script.
The rest of the credits goes to me, but you can use this mod as you like, for free, I don't say a small donation is not welcome, but a "Thank you!" is also great :lol:

Please feel free to edit or submit improvements, I am a bit tired at this time when posting and maybe I forgot or failed something. Hope not!

Regards, Boby.

Neticus
02-24-2006, 02:08 AM
Content visible to registered users only.

Whoa! I think it's time for an upgrade! The more bulletproof the code the better! :)

Thanks!
Net.

clubracer
02-24-2006, 09:38 AM
Hi Boby,

Content visible to registered users only.

in the header between the header gives me errors.
where do i upload the .js file?

The php validation works perfect, MANY THNX for that!

update:

found the solution, the header code must be:
Content visible to registered users only.

Boby
02-24-2006, 06:38 PM
Content visible to registered users only.
Great and sorry for the error :)
Updated the post with the fix, thanks!

Boby

Sierra
02-27-2006, 02:02 PM
Hi Boby,
Thanks for posting this. :D

All seems ok expect the 255 figure is not decreasing as I type. Is it meant to?

Boby
02-27-2006, 02:11 PM
Content visible to registered users only.
Nope, it should change on the fly as you type. Check again everything, you have somewhere an error.

Boby

anon
02-27-2006, 07:23 PM
Boby, are there any plans to consolidate all of these mods into one place, and also state which have and have not been introduced into the latest of revisions of phpld?

Rob

spyrit
10-04-2006, 04:51 PM
thanks, nice mod

thompson
10-05-2006, 08:28 AM
is this mod for v2.0 also ?

anon
10-05-2006, 08:39 AM
Content visible to registered users only.
3.05 and 3.06 already integrated into the script.

Boby
10-05-2006, 02:41 PM
And in 3.05/3.06 the limit is checked server-side (PHP), the coundown is done via a Smarty integrated library ... it's much powerful and better!

seohyderabad
06-04-2007, 09:18 PM
i get this one my page
everything works fine but it is showing this error

Warning: Smarty error: validate: validator id 'DESCRIPTION' is not registered. in /home/domain/public_html/dirtest/libs/smarty/Smarty.class.php on line 1095

and in header
Notice: SmartyValidate: [register_validator] form 'trim' is not registered. in /home/seohyd/public_html/dirtest/libs/smarty/SmartyValidate.class.php on line 375

can anybody help me ??

n thx fro this gr8 mod

medyaoyun
06-27-2007, 12:43 PM
also i got same problem. everything is working burt just there is errors on submit page.

any idea

Content visible to registered users only.

vandis
11-16-2007, 03:23 PM
I am getting the same error

validator id 'v_DESCRIPTION' is not registered

will try to fix this but I am afraid I'm no smarty hero :o

vandis
11-16-2007, 04:59 PM
ok please don't ask how, but I got it fixed :D

Content visible to registered users only.

just delete 'trim', and the errors won't show up and the mod will work fine !

Content visible to registered users only.cheers! :cool:
and thanks to Jim and Boby for sharing this mod