-
Posts
15,289 -
Joined
-
Last visited
-
Days Won
436
Everything posted by requinix
-
Need help with functions.php file on my wordpress site
requinix replied to kiko12122's topic in PHP Coding Help
Thank you for including code, but how about telling us why you're doing all this? What problem are you having? Why do you think this code is responsible? -
Look at what you call the element thing in the session according to the first bit of code, then look at what you call it in the second bit of code.
-
Varies. You're venturing into the territory of frameworks like React and Angular: the tag is managed as an object in code, then rendered into the table as a row. You can meet it halfway by embedding the tags as objects separately, like {{ tags|json_encode() }} in a script. The modal code can read the data from those objects instead of pulling them from the source. (Remember to update the edited object too.) Then the problem is getting the objects to the modal, which should be easier to deal with. Otherwise you're basically stuck pulling the data from the source. Or else loading the modal through AJAX where the server can return the modal template.
-
Upgrading PHP from 7.2.7 to 7.2.24
requinix replied to jbeitler's topic in PHP Installation and Configuration
Well you're going to need to take a crash course in learning your site's PHP and server configuration. Because if you attempt this upgrade and aren't aware of something important the site needs, you'll crash it. You need to know what configuration changes have been made from the base and what extensions are enabled. -
Upgrading PHP from 7.2.7 to 7.2.24
requinix replied to jbeitler's topic in PHP Installation and Configuration
If you're the admin then hopefully you remember when you first set up PHP, right? -
Upgrading PHP from 7.2.7 to 7.2.24
requinix replied to jbeitler's topic in PHP Installation and Configuration
You should contact your site administrator to do this. -
Setting option in a select dynamically with PHP
requinix replied to Adamhumbug's topic in PHP Coding Help
Is that the question? How to make a particular one the default? Add the "selected" attribute to the default <option>. Which you have to determine on your own. <option value='(role_id)' selected>(role_name)</option> -
Upgrading PHP from 7.2.7 to 7.2.24
requinix replied to jbeitler's topic in PHP Installation and Configuration
Windows? Go to windows.php.net and read the instructions on the left. -
Unfortunately not. We used to have that ability, but the current version of the forum software doesn't offer it anymore. Replying that you have an answer is fine.
-
The text file is probably not the right way to go with this. I'm looking for actual markup right now. What is it for the images, and for the modal?
-
They're quite a bit different, but not as drastically different as some past versions were. This is a great time to set up a local environment for yourself to develop and test with. It would make doing this upgrade much easier for you.
-
Okay. Then see the link in my first reply.
-
https://3v4l.org/040Pe YOUR CODE WORKS FINE. WHAT IS THE PROBLEM?
-
You want to do something. Your code already does it. What is the problem?
-
Okay. Are you saying that code doesn't do it? Because it looks like it would do it. PS: If you want to remove a node, remove the node.
-
It can't be both... It could be that some data was JSON-encoded, then put into a urlencoded request, like key=value&json=%7B%22a%22%3A%22b%22%7D but that would be silly.
-
Where you store the data is up to you. But what about the images? Where are those coming from? Are they just written directly into the page? Wherever those images are coming from, that's where the headings, text, and video (URLs?) should be too. For the modal, do you already have the markup for it? What is it?
-
That's JSON. Do you not know what you're doing?
-
You don't. The data will be in $_POST. You know, like it normally is.
-
To explain, the thing about converting to cents is because integers are precise while floating-point numbers (non-integers) are not precise. And when it comes to currency, being precise is very important. What DECIMAL does is give you something that looks like a non-integer, except it's precise. In exchange for the precision, you have to tell the database exactly how precise you want and you won't be able to store anything smaller. But that's perfectly fine for you because you don't care about anything more than two decimal places for cents.
-
Docblocks recommended for a class and for the methods
requinix replied to block34's topic in Application Design
I don't put comments on classes. They tend to be somewhat self-explanatory just by reading the (namespace and) name alone. Unless there's something particular complicated about them... but most of the time any complexity is with what that happens inside a method. But definitely put comments on the methods. -
Looking for help with what part, exactly? Are you not sure what the SELECT query should be? Having problems integrating it into the code and displaying the results?