Crítico con todo

Html tags en comentarios en Pligg

Para nada es algo necesario mostrar emoticonos y letras en colores o en negrita pero hay gente que le gusta. El sistema Pligg está bastante truncado en el tema de etiquetas html según sus desarrolladores, por la seguridad y evitar ataques de inyección SQL. Sin embargo, si un administrador tiene el control total de sus usuarios y confía en ellos no creo que sea muy necesaria tanta restricción. O sí, pero eso dependerá de su responsabilidad.

He conseguido mostrar  etiquetas html en una caja de comentarios con Tinymce y CKeditor. Hay gente que piensa que en Pligg, por ejemplo, instalando esta caja de comentarios ya va a tener todas sus virtudes: no, Tinymce y CKeditor sólo serán un comment box normal, sin caritas, texto subrayado, ni negrita, ni colores. Para ello hay que hacer ciertos cambios en las entrañas de Pligg .

Manos a la obra. Antes de nada aconsejo renombrar los archivos originales para que no sean sobrescritos por los que adjunto por si algo no fuera bien. Yo lo he probado en dos webs y ha funcionado a la perfección pero no todos los hosting tienen activados todos los plugins del servidor APACHE/PHP. Descargado el archivo .zip y descomprimido hay que respetar la jerarquía y rutas. Adjunto la versión de Tinymce que funciona en Pligg, las más actualizadas no sirven. En el directorio template hay dos archivos que no debes subir porque es posible que no funcionen con tu template actual. Tienes que abrir tu /template/bootstrap (o cualquier otro que uses) comment_form.tpl y edit_submission_center.tpl y pegar (solo lo marcado en negrita) :

Opción 1 (Tinymce)

comment_form.tpl

</fieldset>
</div><!–/.form-horizontal –>
</form>

<script type=”text/javascript” src=”{$my_pligg_base}/tinymce/jscripts/tiny_mce/tiny_mce.js”></script>
{literal}
<script type=”text/javascript”>
tinyMCE.init({
// General options
mode : “textareas”,
entity_encoding : “raw”,
theme : “advanced”,
// Theme options
theme_advanced_buttons1 : “save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect”,
theme_advanced_buttons2 : “cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor”,
theme_advanced_buttons3 : “tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen”,
theme_advanced_buttons4 : “insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks”,
theme_advanced_toolbar_location : “top”,
theme_advanced_toolbar_align : “left”,
theme_advanced_statusbar_location : “bottom”,
theme_advanced_resizing : true,
plugins : “emotions”
});
</script> {/literal}

{checkActionsTpl location=”tpl_pligg_story_comments_form_end”}
<!–/comment_form.tpl –>

Y en edit_submission_center.tpl

{checkActionsTpl location=”submit_step_2_pre_extrafields”}
{include file=$tpl_extra_fields.”.tpl”}
<br />
<input type=”submit” value=”{#PLIGG_Visual_Submit2_Continue#}” class=”btn btn-primary” />
</form>

<script type=”text/javascript” src=”{$my_pligg_base}/tinymce/jscripts/tiny_mce/tiny_mce.js”></script>
{literal}
<script type=”text/javascript”>
tinyMCE.init({
// General options
mode : “textareas”,
entity_encoding : “raw”,
theme : “advanced”,
// Theme options
theme_advanced_buttons1 : “save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect”,
theme_advanced_buttons2 : “cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor”,
theme_advanced_buttons3 : “tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen”,
theme_advanced_buttons4 : “insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks”,
theme_advanced_toolbar_location : “top”,
theme_advanced_toolbar_align : “left”,
theme_advanced_statusbar_location : “bottom”,
theme_advanced_resizing : true,
plugins : “emotions”
});
</script> {/literal}

{checkActionsTpl location=”tpl_pligg_submit_step2_after_form”}

Una vez subidos los archivos es aconsejable borrar la caché del Template.

comments2

captura

Opción 2 (Mejor CKeditor)

CKeditor funciona y se adapta a Pligg mejor que Tinymce. Para ello una vez que has colocado los archivos que nos hemos descargado tenemos que ir a la página del proyecto y seleccionamos Ckeditor Full  y lo subimos a nuestro directorio raíz del servidor. Ahora tenemos que editar y dejar comment_form.tpl en las líneas que antes mencionado arriba:

 

<script type=”text/javascript” src=”{$my_pligg_base}/ckeditor/ckeditor.js”></script>
{literal}
<script type=”text/javascript”>
CKEDITOR.replace( ‘comment_content’, {
fullPage: true,
uiColor: ‘#a4aea4′,
allowedContent: true
});

</script>

 {/literal}

En ckeditor/config.js hay que dejarlo así:

CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
config.language = ‘es’;
// config.uiColor = ‘#AADC6E’;
CKEDITOR.config.entities_latin = false;
CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
CKEDITOR.config.fillEmptyBlocks = false;
CKEDITOR.config.autoParagraph = false;
config.entities = true;
config.height = ’300px’;
config.width = ’600px’;
config.toolbar = ‘Basic’;
config.resize_enabled = true;

};

 

Y voilá, tu Pligg quedará así:

17.41

For nothing is something necessary to show emoticons and letters or bold colors but some people liked . The system is quite Pligg truncated theme html tags according to its developers , for safety and to avoid SQL injection attacks . However, if an administrator has full control of its users trust them and do not think much restraint is very necessary. Or yes, but that depends on your responsibility.

I managed to show some html tags in a comment box with TinyMCE and CKeditor . Some people think that Pligg , for example, by installing this comment box and will have all their virtues : no, TinyMCE or CKeditor will only be a normal comment box without emotions , underline, or bold text, and colors. This requires making certain changes in the bowels of Pligg .

Hands . First of all advise to rename the original files that are not overwritten by the adjoint that if something was not right. I’ve tried it on two sites and it worked perfectly but not all hosting have activated all plugins APACHE / PHP server. Downloaded the zip file. comments2 Unzipped and you have to respect the hierarchy and routes. Under the version of TinyMCE running on Pligg , the latest not work. In the template directory there are two files that must not upload because it may not work with your current template. You have to open your / template / bootstrap (or any other you use) and edit_submission_center.tpl & comment_form.tpl and paste ( just as marked in bold) below :

Option 1 (Tinymce)

comment_form.tpl

< / fieldset >
< / div > < –/.form-horizontal ->
</ form>

<script type=”text/javascript” src=”{$my_pligg_base}/tinymce/jscripts/tiny_mce/tiny_mce.js”> < / script >
{ literal}
<script type=”text/javascript”>
tinyMCE.init ( {
/ / General options
mode: “textareas”
entity_encoding : “raw”,
theme: “advanced” ,
/ / Theme options
theme_advanced_buttons1 :
theme_advanced_buttons2 :
theme_advanced_buttons3 :
theme_advanced_buttons4 :
theme_advanced_toolbar_location : “top” ,
theme_advanced_toolbar_align : “left”,
theme_advanced_statusbar_location : “bottom” ,
theme_advanced_resizing : true,
plugins: “emotions”
} ) ;
< / script > { / literal }

checkActionsTpl { location = “tpl_pligg_story_comments_form_end”}
< ! –/comment_form.tpl ->

And edit_submission_center.tpl

checkActionsTpl { location = ” submit_step_2_pre_extrafields “}
{include file = $ tpl_extra_fields . . ” tpl “}
<br />
<input type=”submit” value=”{#PLIGG_Visual_Submit2_Continue#}” class=”btn btn-primary” />
</ form>

<script type=”text/javascript” src=”{$my_pligg_base}/tinymce/jscripts/tiny_mce/tiny_mce.js”> < / script >
{ literal}
<script type=”text/javascript”>
tinyMCE.init ( {
/ / General options
mode: “textareas”,
entity_encoding : “raw”,
theme: ” advanced ” ,
/ / Theme options
theme_advanced_buttons1 :
theme_advanced_buttons2 :
theme_advanced_buttons3 :
theme_advanced_buttons4 :
theme_advanced_toolbar_location : “top” ,
theme_advanced_toolbar_align : “left”,
theme_advanced_statusbar_location : “bottom” ,
theme_advanced_resizing : true,
plugins: “emotions”
} ) ;
< / script > { / literal }

checkActionsTpl { location = ” tpl_pligg_submit_step2_after_form “}

Once uploaded files is advisable to clear the Template cache.

Option 2 (Best, CKeditor)

CKeditor works and fits better than TinyMCE in Pligg. To do once you have placed the files we downloaded have to go to the project page and select Full CKEditor Ckeditor Full  and got on our server root directory. Now we need to edit and leave comment_form.tpl on the lines  above:

 

<script type=”text/javascript” src=”{$my_pligg_base}/ckeditor/ckeditor.js”></script>
{literal}
<script type=”text/javascript”>
CKEDITOR.replace( ‘comment_content’, {
fullPage: true,
uiColor: ‘#a4aea4′,
allowedContent: true
});

</script>

 {/ literal}

In ckeditor/config.js with this content:

 

CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
config.language = ‘es’;
// config.uiColor = ‘#AADC6E’;
CKEDITOR.config.entities_latin = false;
CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
CKEDITOR.config.fillEmptyBlocks = false;
CKEDITOR.config.autoParagraph = false;
config.entities = true;
config.height = ’300px’;
config.width = ’600px’;
config.toolbar = ‘Basic’;
config.resize_enabled = true;

};

 

And voila, your Pligg will be different.

Enjoy

 

3,568 total views, 1 views today

3 Responses to “Html tags en comentarios en Pligg

  1. How do add pligg linksummary.tpl page in Followers Count Numbers?
    is it posible?
    followers avathar in index page & new page side bar?
    Plese help me…

    • maslinux

      Hello,

      Depend of your template pack. I think that not too difficult.

    • maslinux

      I have a question for you.. Followers Count Numbers is a module or a page? May be Friend Status Updates?
      I not find Followers Count Numbers..

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos necesarios están marcados *

Puedes usar las siguientes etiquetas y atributos HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>