Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
jane65
Regular
Regular



Joined: Feb 24, 2009
Posts: 81
Location: UK

PostPosted: Thu Nov 18, 2010 10:10 am Reply with quote

I am modifying the Reviews module a bit but need to limit the number of characters in the textarea for the Review to 200 characters, which I can't seem to work out how to do, so I am wondering if someone here may be able to help me alter the code to do this.

This is the code that relates to the textarea that I want to modify.

Code:
echo '<b>' . _REVIEW . ':</b><br />';

   wysiwyg_textarea ('text', '', 'NukeUser', '50', '2' );
   echo '<br />';
   if (is_admin($admin)) {
      echo '<font class="content">' . _PAGEBREAK . '</font><br />';
   }


Thank you in advance for any help with this Smile
 
View user's profile Send private message
nuken
RavenNuke(tm) Development Team



Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina

PostPosted: Thu Nov 18, 2010 5:27 pm Reply with quote

There is a character count limit mod for the editor. If no one else has it, I will go through my stuff and get it for you this weekend.

_________________
Tricked Out News 
View user's profile Send private message Send e-mail Visit poster's website
nuken







PostPosted: Thu Nov 18, 2010 8:26 pm Reply with quote

Here is a mod that may do what you are looking for. Before you use it, back up your site. Especially your includes/fckeditor folder. You will need to upload the included files into your root/includes/fckeditor folder. You will then need to change the 'NukeUser' in the code to 'ReviewsUser'. After that, delete your browsers cache and test it out.
[ Only registered users can see links on this board! Get registered or login! ]
 
jane65







PostPosted: Tue Nov 23, 2010 4:06 pm Reply with quote

Thanks for your help and the mod, but unfortunately, its not working, do I have to add any code to the Reviews module code to make this work?
 
nuken







PostPosted: Tue Nov 23, 2010 4:12 pm Reply with quote

Yes. You need to change NukeUser to ReviewsUser in this code:

Code:
echo '<b>' . _REVIEW . ':</b><br />';

   wysiwyg_textarea ('text', '', 'NukeUser', '50', '2' );
   echo '<br />';
   if (is_admin($admin)) {
      echo '<font class="content">' . _PAGEBREAK . '</font><br />';
   }


You will also need to clear your browsers cache to reload the javascript.
 
nuken







PostPosted: Tue Nov 23, 2010 4:25 pm Reply with quote

There are two instances of NukeUser that need to be replaced in the modules/Reviews/index.php.

on line 169 and line 775
 
nuken







PostPosted: Tue Nov 23, 2010 4:29 pm Reply with quote

And if you want the admin to have the same limit mod, in modules/Reviews/admin/index.php you will find 2 instances of PHPNukeAdmin that need to be replaced with ReviewsAdmin. That is ONLY if you want the admin to have the 200 character limit, if not than just leave the admin alone.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©