Skip to main content

PHPMOTION CHANGE COMMENT BOX FROM FCKEDITOR TO TEXTAREA

phpmotion comes with fckeditor as the comment box.in this tutorial am going to show how it is possible to remove that fckeditor and inert textarea. I am also going to show how to filter html tags from the comment.

phpmotion commentbox modification


here i am going to change the fckeditor for inner_play.htm (video comment box on video play page).
please follow the below steps to change the comment box.

01.open themes/default/templates/inner_play.htm
goto

<script type="text/javascript">
     <!--
     var sBasePath = '[var.base_url]/fckeditor/';
     var oFCKeditor = new FCKeditor('FCKeditor1');
     oFCKeditor.BasePath = sBasePath;
     oFCKeditor.ToolbarSet = 'Basic';
     oFCKeditor.Config['SkinPath'] = sBasePath + 'editor/skins/silver/';
     oFCKeditor.Height = 150;
     oFCKeditor.Value = '';
        oFCKeditor.Create();
     //-->
   </script>

and delete it and add the below code.

 <textarea id="FCKeditor1" name="FCKeditor1" rows='10' cols='60'/></textarea>


02.to change the fckeditor in edit comment open edit/editcomments.php
goto

///FCK EDITOR________________________________________________________________________
    include('../fckeditor/fckeditor.php');

    $sBasePath = "$base_url/fckeditor/";
    $oFCKeditor = new FCKeditor('FCKeditor1');
    $oFCKeditor->BasePath = $sBasePath;
    $oFCKeditor->CustomConfigurationsPath = "fckconfig.js";
    $oFCKeditor->ToolbarSet = 'Basic';
    $oFCKeditor->SkinPath = $sBasePath + 'editor/skins/silver/';

    $oFCKeditor->Value   = $comment;
    $oFCKeditor->Width   = '600';
    $oFCKeditor->Height = '220';
    $FCKeditor1 = $oFCKeditor->CreateHtml();
    $my_edit = $FCKeditor1;

and remove this
and add the below code

$my_edit  = "<textarea id='FCKeditor1' name='FCKeditor1' rows='20' cols='60'>$comment</textarea>";

now to filter html tags from the comments you may apply below steps.

01.open comments.php
goto

if ( isset( $_POST ) )
   $postArray = &$_POST;
else
   $postArray = &$HTTP_POST_VARS;

foreach ( $postArray as $sForm => $value ) {

and add the below code

$value   = strip_tags($value);

goto
$post_check = sizeof($postedValue);
if ( $post_check > 2) {
echo '<p align="center"><font color="#FF4242" face="Arial"><b>'.$config['video_comments_error_comment'].'</b></font>';
die();
}

$comments = $postedValue[0];
]

and add the below code
$comments   = strip_tags($comments);
]


now goto 
$user_id = mysql_real_escape_string($user_id);
$user_name = mysql_real_escape_string($user_name);
$vid = mysql_real_escape_string($vid);

and add the below code
$comments   = strip_tags($comments);

02.now open comments_ajax.php
goto

$text = $result['comments'];

and add the below code
$text = strip_tags($text);

03.open edit/editcomments.php
goto
if( isset($_POST['submit']) ) {
$commentid = (int) mysql_real_escape_string($_POST['id']);
$type = (int)mysql_real_escape_string($_POST['type']);
$comment = @mysql_real_escape_string($_POST['FCKeditor1']);

and add the below code

$comment = strip_tags($comment);

you may apply similar steps to change the comment box and also to filter html tags for other contents.



good day,

Comments

  1. Hello you have any demo of this panel comments?

    ReplyDelete
  2. hi
    welcome,
    sorry I don't have any demo now but it will be available shortly as I am going to have demo site ready in short time.

    good day,
    Hiren Patel.

    ReplyDelete
  3. Hire PHP developer for coding as the work in web field is solely depends on the web developer.

    ReplyDelete

Post a Comment

Hi, Thanks for the comment will try to reply at the earliest.

Good Day,
Hiren Patel
http://www.renruhak.org

Popular posts from this blog

PHPMOTION JW Player SD/HD Integration.

jw player is really a great video player.it contains great features like it allows users to choose from SD/HD video. so user may play video as per his/her internet speed. in this post i am going to show how its possible to integrate jw player with its SD/HD options with phpmotion video script.

PHPMOTION VIDEOJS PLAYER INTEGRATION

videojs is the open source HTML5 video player. today we are going to see how videojs player can be integrated with phpmotion video script. some popular sites using videojs are  http://twitpic.com/  ,  http://telly.com/  ,  http://vine.co/  ,  http://www.theonion.com/  , http://web.mit.edu/   ,  https://www.airbnb.com/?cdn_locale_redirect=1

PHPMOTION JW Player Integration

phpmotion  is a popular video script.by default phpmotion uses flash player to show/play videos at home page as well as video play page.The JW Player is the Internet's most advanced and flexible media player. in this tutorial I am going to show how it is really easy to do phpmotion jw player integration.