How to add an iframe or Youtube embed code ?

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
bambinou
Veteran Member
Posts: 163
Joined: 2013-02-01 15:09

How to add an iframe or Youtube embed code ?

Post by bambinou » 2013-02-05 22:12

Hello,

I have noticed that the html editor won't let us add a simple Youtube embed or iframe code, any idea how to go around this problem please? I do not want to upload videos to the server, it takes too long and also can breach the copyright of the video maker if not used in Youtube itself.

Regards,

Ben

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: How to add an iframe or Youtube embed code ?

Post by a.gneady » 2013-02-07 11:01

Hi Ben, if the field where you want to embed youtube video would always be used for this purpose in all records, you could follow the procedure in this article: http://bigprof.com/appgini/tips-and-tut ... ypal-links ... the article describes integrating Paypal links as iframes, but it would work for youtube as well by changing the iframe code to that for youtube.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

bambinou
Veteran Member
Posts: 163
Joined: 2013-02-01 15:09

Re: How to add an iframe or Youtube embed code ?

Post by bambinou » 2013-02-07 23:50

Thanks for the reply.

One little thing I do not understand in the tutorial, is seems that we have to hardcode the file but will our records not be erased each time we add a new row in the table?

Thank you,

Ben

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: How to add an iframe or Youtube embed code ?

Post by a.gneady » 2013-02-08 20:25

Umm .. you'll have to hard-code the file indeed .. but that won't get overwritten on adding new records: records are stored in the database, and this file is a template file on the server storage ... Unless I misunderstood your question.
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

bambinou
Veteran Member
Posts: 163
Joined: 2013-02-01 15:09

Re: How to add an iframe or Youtube embed code ?

Post by bambinou » 2013-02-09 17:07

Thank you for the reply Ahmad,

Ben

bdurfee
Veteran Member
Posts: 32
Joined: 2013-02-07 17:44

Re: How to add an iframe or Youtube embed code ?

Post by bdurfee » 2013-03-07 17:58

Another option works if you are just using your AG code for managing database content, but actually displaying the database content on your web site. (In other words, AG is not your whole web site.)

Add the YouTube code as normal in the AG form as normal. It will convert certain characters into codes. In the output on your web page, convert the codes back into characters.

Code: Select all

$pattern = array();
$pattern[0] = '/</';
$pattern[1] = '/>/';

$replacement = array();
$replacement[0] = '<';
$replacement[1] = '>';

$video = preg_replace($pattern, $replacement, $youtube_fieldcontents);
My concerns are:

1. What kind of security issues could this cause?
2. Are there ways to address those security issues?

Post Reply