Skip to main content

Topics

This section allows you to view all Topics made by this member. Note that you can only see Topics made in areas you currently have access to.

Topics - claudiomg

1
Questions / Include third party plugin on PhpRad
Hi, there is any way to integrate a third-party plugin on PHPRad?
I want to use the plugin below
https://www.tawk.to/

I also want to add Google Analytics too.
To add Google Analytics, I just need to add this snippet of code in any part of the page.

<!-- Google Analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->

The only way to use it is editing manually or there is an alternative way to do that by using some field or form on PhpRad?
2
Questions / How to treat Mysql Error with unique constraint violation
I have a unique constraint in one of my tables in the database.

UNIQUE KEY `url_de_busca` (`url_de_busca`,`id_usuarios`),

This unique constraint forbids that two rows have the same values in these two fields.

When the user inserts a value that is already in the database, the following error appears



The error is correct, but I want to know how can I show a friendly error screen.

How can I do that?
3
Questions / How to create an update page with an invisible
Hi, I'd like to change behavior on the list screen, see image below



The edit button on that page must update only a single field on the database instead of open a new screen to allow the user to edit the values.

The field called 'active' by default has a value of 1, it must update the field with a value 0.

And after that, load the list again, the list doesn't show rows that have the 'active' field with a value of 0 (I do that using SQL).

How can I create a action button and create a custom SQL to update the row value?
4
Questions / How use the parameter USER_ID in sql query
I want to create a sql query using the USER_ID (Active User ID that is logged in)

Check the image below



I write the number 2, but I want to use the USER_ID, if I change the number 2 to USER_ID or $USER_ID, the query fails, how can I use correctly the USER_ID in a query?