How to make html editor free and usable

Yes, I have seen all the posts regarding how to allow to embed youtube and vimeo, I've done it and can add youtube, and  I have already re installed like four times and can't find a way to make this editor to permit anything I post and specially soundcloud embed player.

I am not a programmer, so would you be so kind to instruct me on how to make it to accept anything, I think I already lost hair.

- I will be the only one to add content, so no harm to my baby here -

Thanks a lot

Quote · 5 Apr 2014

if referring to the tinyMCE editor for html blocks, change to html view before pasting content. If this does not work still, then after adding your content this way, go into the database table and edit there.

caredesign.net
Quote · 5 Apr 2014

Be more specific, even if you think you are being redundant, about where and what and how you are wanting to do this thing.

Geeks, making the world a better place
Quote · 5 Apr 2014

 

if referring to the tinyMCE editor for html blocks, change to html view before pasting content. If this does not work still, then after adding your content this way, go into the database table and edit there.

 lol, can you imagine like more than 100 pages and going to add the music via database. You can't be serious!! That is just crazy.

 

@

Currently I can embed youtube videos, and I always use html, actually I always write my pages on html with a kinda template to simulate my site and then I just paste the snippet into the editor.

But now, when I put any soundcloud iframe it simply cleans everything and leaves a <p></p>

Quote · 5 Apr 2014

 

 

if referring to the tinyMCE editor for html blocks, change to html view before pasting content. If this does not work still, then after adding your content this way, go into the database table and edit there.

 lol, can you imagine like more than 100 pages and going to add the music via database. You can't be serious!! That is just crazy.

 

@

Currently I can embed youtube videos, and I always use html, actually I always write my pages on html with a kinda template to simulate my site and then I just paste the snippet into the editor.

But now, when I put any soundcloud iframe it simply cleans everything and leaves a <p></p>

Still not specific enough for my feeble brain but I will assume.  You are talking about building pages in the page builder?

If that is the case, then you should be able to add iframes.  I was told that in the backend/admin that when you add content it is not passed through the htmlpurifier.  So if you turn off TinyMCE (TinyMCE will strip out iframes unless you change the editor to allow them); if you turn off TinyMCE, then you should be able to post any firame you wish.  If you can not, then something is broken and to figure out where would mean being able to access your site and poke around and try to figure out what is stripping out the iframe.

 

Wait, hold the lift.  Instead of writing your html in some external editor... Wait, explain exactly what you are doing, how you are doing it, what editor you may be using, are you using Dolphin page builder, etc.?

Geeks, making the world a better place
Quote · 5 Apr 2014

What are you adding Soundcloud Music to & how? I have added to Articles & Pages without any problem at all. Are you allowing the Soundcloud Player time to load? Sometimes it can be slow off Soundcloud.

Edited to include Pages as I've since tested & works fine for me on Pages too.

Quote · 5 Apr 2014

 I am dead serious. If you do a search through these forums, you will find other posts where the tinyMCE is not allowing iframed and javascript items to be used in the editor, and one of the recommended solutions was to manually enter into database table. But, I have a different solution - use a php block instead. Start code with ?> and end with <?php { }, like this

 

?>

blah blah html code, iframe code or whatever

<?php

 

The tinyMCE is stripping the code out, so using a php block will not because there is not tinyMCE to deal with.

 

if referring to the tinyMCE editor for html blocks, change to html view before pasting content. If this does not work still, then after adding your content this way, go into the database table and edit there.

 lol, can you imagine like more than 100 pages and going to add the music via database. You can't be serious!! That is just crazy.

 

@

Currently I can embed youtube videos, and I always use html, actually I always write my pages on html with a kinda template to simulate my site and then I just paste the snippet into the editor.

But now, when I put any soundcloud iframe it simply cleans everything and leaves a <p></p>

 

caredesign.net
Quote · 5 Apr 2014

Why would that be when it works fine on mine, ProfessorSr? Would it be to do with the server architecture? Just trying to understand how it can work for me with no problems.

Quote · 5 Apr 2014

I rarely use html blocks, and never when I need to add any kind of content that is not strictly html (such as iframes and javascript). I have always used the php block because this has been an issue from a long time ago. Whether or not it was resolved by dolphin, I do not know, because I have always used php blocks. So, if it is not working for someone, then they can try using a php block - they may find things more easier. If you search the forums for 'stripping'. You will see the countless number of related psots

caredesign.net
Quote · 5 Apr 2014

Here is one problem with the HTML Blocks.  You can not switch off TinyMCE and have the block remember it was off.  So if you go back to edit the HTML Block, you will lose the code because the HTML Block will load with the TinyMCE editor and when TinyMCE loads it removes the code you added by hand.  It would be nice if the HTML Block could remember if you turned off the TinyMCE when it loads the editor for the block.  If you are turning off TinyMCE for an HTML Block, save the code you enter externally in a text file.  You will have to reenter any javascript code and if you don't save it to an external text file, you won't have it any more.

 

So, the gist of it is that Dolphin needs to remember the state of the WYSIWYG editor for HTML blocks.

 

However, Professor has the correct idea, don't use HTML blocks if you are going to be adding javascript code, iframes, etc. because TinyMCE will strip out code.  To make it easy to add a PHP Block, use Deano's Tools or his other free module, add PHP block item to the builders,  Just visit Dean's Market page to find those tools.

Geeks, making the world a better place
Quote · 5 Apr 2014

Sorry, its not html blocks, its the editor in a group. -- There is no point to use those html blocks anyway --

Update: Don't know where I touched, but its accepting everything now.

Why don't boonex make that thing free and usable?

 

Thanks to all, I will compare the files with a original boonex and share the modifs soon

Quote · 5 Apr 2014

The editor that available when you create or edit a group is not just available to admin. Anyone that creates a group can. So iframe are stripped because they are dangerous. That's why it not free and usable as you put it. It must be restricted to protect your site from malicious code.

https://www.deanbassett.com
Quote · 5 Apr 2014

in my case only admins will use it, no one will create groups. 

Does the forums also use the same editor?

(now that I think, In this case there will be users answering)

Quote · 5 Apr 2014

this is an option (I will just give a brief description). Since you say only admin will be adding Groups, you could create a php block on the Groups View page which contains the code to display the soundcloud player. This block could be coded to not appear if no data.

You could use:

?>

<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/<?php echo $track_id ?>&amp;auto_play=false&amp;hide_related=false&amp;visual=true"></iframe>

<?php { }

 

then - create a field on the Add/Edit form called Soundcloud. This field would be used to enter the track id of the sound you are embedding

 

as an example, I have a section for youtube videos that I have added. You could use the same technique for just about anything you want to add.

 

EDIT - if by chance later on you want to allow users to add Soundcloud embeds, this will keep the stripping from happening, and keep persons from putting in content that could screw your website up.

video id.png · 93.2K · 524 views
on group page.png · 453.4K · 492 views
caredesign.net
Quote · 5 Apr 2014

I have touched on this before, users are controlled by the htmlpurifer, so just edit the htmpurifier as I have done and change it to a whitelist of allowed iframe sites.

You can give your users the freedom to add iframes from any source you trust.  The switch over to a whitelist of trusted sources is quite easy to do.

Geeks, making the world a better place
Quote · 5 Apr 2014

 

this is an option (I will just give a brief description). Since you say only admin will be adding Groups, you could create a php block on the Groups View page which contains the code to display the soundcloud player. This block could be coded to not appear if no data.

You could use:

?>

<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/<?php echo $track_id ?>&amp;auto_play=false&amp;hide_related=false&amp;visual=true"></iframe>

<?php { }

 

then - create a field on the Add/Edit form called Soundcloud. This field would be used to enter the track id of the sound you are embedding

 

as an example, I have a section for youtube videos that I have added. You could use the same technique for just about anything you want to add.

 

EDIT - if by chance later on you want to allow users to add Soundcloud embeds, this will keep the stripping from happening, and keep persons from putting in content that could screw your website up.

 ok, sounds really nice and clean. I added the PHP block, now to create the field, should it be created manually on modules/boonex/groups/classes/BxGroupsFormAdd.php or should it be on the DB or in the administration panel?

Quote · 6 Apr 2014

You would need to create the field on the form and in the database. the whole process is a bit more involved (you have to make the template for the block as well) but we can walk you through each part. My earlier example was a half written one just to give an example.

After you add the field to the database and to the form on the Add page, you next have to create the block that displays the soundcloud embed.

Add this to BxGroupsPageView.php (change the section in blue to match your database field name):

    function getBlockCode_Soundcloud()
    {
        if ($this->aDataEntry['soundcloud_id']) {
        return array($this->_oTemplate->blockSoundcloud ($this->aDataEntry));
        }
        else
        {
        return;
        }
    }

 

Add this to BxGroupsTemplate.php:

    function blockSoundcloud (&$aDataEntry)
    {
        $aVars = array (
            'soundcloud_id' => $aDataEntry['soundcloud_id'],
        );
        return $this->parseHtmlByName('block_soundcloud', $aVars);
    }

 

create a page called block_soundcloud.html and save in groups/templates/base/ and add this to that page:

<div class="bx-def-font-large" style="margin-top: 15px;">
<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/__soundcloud_id__&amp;auto_play=false&amp;hide_related=false&amp;visual=true"></iframe>
</div>

Then, run this sql query:

INSERT INTO `sys_page_compose` (`ID`, `Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`, `Cache`) VALUES (NULL, 'bx_groups_view', '1140px', 'Group''s soundcloud block', '_bx_groups_block_soundcloud', '0', '0', 'Soundcloud', '', '1', '71.9', 'non,memb', '0', '0');

 

Then clear cache, and that should be it.

caredesign.net
Quote · 6 Apr 2014

Hi,

Would you mind to explain how to "You would need to create the field on the form and in the database"

Thanks

Quote · 13 Apr 2014

You would need to add a field to the BxGroupsFormAdd.php file to display the field. Similar to this:

               
                'soundcloud_id' => array(
                    'type' => 'text',
                    'name' => 'soundcloud_id',
                    'caption' => _t('_bx_groups_form_caption_soundcloud_id'),
                    'required' => false,
                    'db' => array (
                        'pass' => 'Xss',
                    ),
                ),

 

And in the bx_groups_main table, you would need to add the field. In my example it would be called soundcloud_id.

caredesign.net
Quote · 13 Apr 2014

 

You would need to add a field to the BxGroupsFormAdd.php file to display the field. Similar to this:

               
                'soundcloud_id' => array(
                    'type' => 'text',
                    'name' => 'soundcloud_id',
                    'caption' => _t('_bx_groups_form_caption_soundcloud_id'),
                    'required' => false,
                    'db' => array (
                        'pass' => 'Xss',
                    ),
                ),

 

And in the bx_groups_main table, you would need to add the field. In my example it would be called soundcloud_id.

 All done and received a :

Found error in the file '/home/site/public_html/crash/inc/classes/BxDolForm.php' at line206.
Called 'db_res' function with erroneous argument #0.

 

Mysql error:
Unknown column 'soundcloud_id' in 'field list'

I created the mysql by copying the bx_groups_sounds table


Capture.PNG · 13.7K · 466 views
Quote · 13 Apr 2014

You do not need to create a new database table. Just add the field to the existing Bx_Groups_Main table.

 

you can run this in phpMyadmin:

 

ALTER TABLE `bx_groups_main` ADD `soundcloud_id` VARCHAR(45) NOT NULL ;

caredesign.net
Quote · 13 Apr 2014

 

You do not need to create a new database table. Just add the field to the existing Bx_Groups_Main table.

 

you can run this in phpMyadmin:

 

ALTER TABLE `bx_groups_main` ADD `soundcloud_id` VARCHAR(45) NOT NULL ;

 Thank you very much Sir. You've made my day //

Quote · 13 Apr 2014

Coolio!!! Glad to be of some help around here. Cool

caredesign.net
Quote · 13 Apr 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.