Posts by Ricardo BRGWeb • 831 points
39 posts
-
1
votes1
answer351
viewsA: Secondary thread on flutter
Asynchronous programming in Flutter is performed through the Future. I don’t understand why you use two Future. If the idea is that the second is a backup in case of an error, you can use the Future…
-
0
votes1
answer184
viewsA: Open a directory and run a PHP action
There are two ways to change the directory to exec: chdir Using the function chdir $comando="verifica_licenca.exe -v -f licencas$cnpj.dat"; $path="c:\caminho\para\verifica\licenca\"; chdir($path);…
phpanswered Ricardo BRGWeb 831 -
0
votes2
answers98
viewsA: How to sort array by key and value without losing the original key value?
Although the answer accepts to work for this specific array, it may not work for other arrays. The array_reverse only worked because the original array already had keys in descending order. To sort…
phpanswered Ricardo BRGWeb 831 -
0
votes1
answer220
viewsA: How to put more than one slideshow on the same page
The problem with reusing this code is that it has the slide selector inside the code. To be able to reuse the functions you need to abstract this selector out of the function, passing to it each…
-
0
votes1
answer121
viewsA: Display result of different tables with similar data - MYSQL
To select data from more than one table, just use one SELECT with multiple tables. Technically this would be a JOIN but without any comparison clause between them. This would return all records of…
mysqlanswered Ricardo BRGWeb 831 -
3
votes2
answers39
viewsA: Ternary operator returns error 500
Error 500 is an internal server error. To know where the error is you need to enable the error log on the server or enable the display errors in the script by putting the following code at the…
phpanswered Ricardo BRGWeb 831 -
0
votes1
answer330
viewsA: put MYSQL data in my form combobox using class and php
You need to fix the code. in this excerpt foreach($usuario as $usuario): <option value="<?$usuario['.nom_usuario.'];?>"selected>Escolha o usuario</option>you’re mixing PHP and…
-
1
votes2
answers2569
viewsA: Edit theme in Wordpress
You can edit the theme yes without changing the structure and functionalities, but it’s not ideal because all editions will be overwritten in the next theme update. The best option to edit themes is…
-
1
votes1
answer1218
viewsA: Show products from 2 categories on page (Woocommerce)
The shortcode is wrong. The number specifies the amount of products. For caetgorias you should use "ids": [product_categories number="12" parent="0" ids="20,17"] If you want to show all top level…
-
1
votes1
answer382
viewsA: Scrolling page on wordpress
The get_template_part it’s just a way ed to reuse the code more easily. It’s a way to apdronize enter the themes the way to use include in PHP. Your template doesn’t work because it doesn’t update…
-
0
votes2
answers111
viewsA: Error in Admin paging
The links you are using are generated by the class WP_List_Table And it has nothing to do with the database. However, before we try any repair, it is good to clean the link in the database and…
-
0
votes1
answer1300
viewsQ: Update an Asp section variable without refreshing the page
I’m racking my brain trying to solve this problem, but to no avail... I am with a virtual store created for another programmer who disappeared. For varying code is no documentation. To calculate the…
-
4
votes2
answers1547
viewsA: Generate PDF report with PHP
You can generate HTML within a variable and then use tcpdf to generate the pdf. Using the example of tcppdf.org to insert a sentence at the beginning of the html that came from $_POST['phrase']:…
-
1
votes1
answer59
viewsA: PHP Change text in Openoffice xml with Xmlreader and Xmlwriter
I managed to settle with an answer from Soen. I’m using the class for this Xmlreaderiterator version 0.1.8 Below the code: require('xmlreader-iterators.php'); // require XMLReaderIterator library…
-
1
votes1
answer1112
viewsA: Wordpress - error starting site
The error is not of the Wordpress path. In wp_settings.php it calls this file with ABSPATH and so the path will always be right. Usually compat.php errors are caused by some problem with the…
-
0
votes4
answers869
viewsA: How to install Wordpress Multisite?
In Multisite installation with subdomains you do not need to create subdomains. If you create them your server will direct you to the subdomain, which is empty and will give an error 404. I suggest…
-
1
votes2
answers6682
viewsA: Woocommerce registration
Woocommerce already has this option. Disable visitor checkout. So when a non-logged-in user is finalizing the purchase, Woocommerce will request login. Woocommerce -> Settings -> Checkout…
-
2
votes1
answer1180
viewsA: Alternative to converting Word to HTML
There is no solution ready for this. The conversion solutions will always generate a dirty code and the result is not always reliable, even because Word itself generates a dirty code in your…
-
1
votes2
answers620
viewsA: Validate xml file before updating database
To work with XML in PHP I like to use the Xmlreader and Xmlwriter classes because they process node by node instead of loading everything in memory like other XML manipulation classes with PHP.…
-
1
votes1
answer904
viewsA: Share count and facebook likes in wordpress loop
The function you are using to get the permalink is wrong. This function returns the link with the html tag: <a href="<?php the_permalink(); ?>">permalink</a>. It is to print the…
-
2
votes1
answer47
viewsA: Query MYSQL with WHERE clause predominance
You need to separate query checks according to the logic you described: first I pick up all posts within the given area, then I selects the ones that fit the types of assists SELECT * FROM…
mysqlanswered Ricardo BRGWeb 831 -
3
votes2
answers54
viewsA: Do not show inactive product in search of products
I believe you control the inactive products by the products.status. In your query it only refers to the last OR. So if one of the previous Ors is positive it returns the product. You have to rewrite…
mysqlanswered Ricardo BRGWeb 831 -
1
votes1
answer94
viewsA: Else in PHP to call menu as URL
If you want to use case the best is to write in a variable the final part of the URL and test it with switch. This is done using the function parse_url: <?php $uri = $_SERVER['REQUEST_URI']; //…
phpanswered Ricardo BRGWeb 831 -
1
votes1
answer178
viewsA: Take the values of a table and use to create a new database
This organization you described is not the standard of Wordpress. Usually when there are multiple Wordpress installations within the same database, a prefix is used for each installation. There you…
-
1
votes2
answers620
viewsA: Page with even post_type wordpress Slug
You have to choose which page you want to get your website.com/products URL. If it’s the page you’re creating inside the panel, you’ll need to change the post_type permalink. If you are registering…
wordpressanswered Ricardo BRGWeb 831 -
2
votes1
answer522
viewsA: Load products into Woocommerce
If you want to ignore the Wordpress database, the Woocommerce account Hooks and filters that can be used for this. Of course you will lose many internal functions and will have to rewrite most, but…
-
1
votes1
answer59
viewsQ: PHP Change text in Openoffice xml with Xmlreader and Xmlwriter
I need to change the contents of the tags of an openoffice document and copy the rest of the document contents. The problem is not finding the tag and replacing its content, but copying the parent…
-
1
votes1
answer49
viewsA: Problem with Wp Query
You have to load the $args variable before creating a new Wp_query. Just change the order and put $args and then $query_videos.
-
5
votes1
answer526
viewsA: Convert HTML menu to Wordpress
This menu should already appear in the Control Panel under Appearance -> Menus. You need now to create the menu items and add it wherever you want in the theme using the function…
-
0
votes2
answers275
viewsA: How to select a particular post in Wordpress?
You get this by counting the posts inside the loop and creating lines from 3 posts: <?php $i = 0; if ( have_posts() ) {?> <div class="row"><?php //abre a primeira linha while (…
-
1
votes2
answers108
viewsA: Remove post-type Wordpress articles
The post_type articles actually refers to the standard post_type Wordpress "posts". I find it very difficult that you can "deregister" and get away with it, because they are the basis on which the…
-
10
votes1
answer10326
viewsQ: Connect the webservice with SOAP in PHP
I’m trying to connect to the webservice but it’s not working. wsdl address is http://91.205.172.97/globalsight/services/AmbassadorWebService?wsdl PHP code: <?php if (!class_exists('SoapClient'))…
-
1
votes3
answers11729
viewsA: Insert line break in field text into database
The best way to do this is through a regular expression. Using the function preg_split() you can separate the string each -. It works that way: $string = $row_rsPesquisa['detalhes']; $id_produto =…
-
0
votes2
answers76
viewsA: How to save information "not serials" in wordpress
Your question was a bit confusing because it may have several answers depending on the use of this data. If the data you want to repeat several times in the theme will never be changed, you can use…
-
0
votes1
answer204
viewsA: Change the operation of the hook myCRED Gravity Forms
First suggestion is does not edit the original plugin file! Despite Gravity Forms its a very popular plugin I’ve never worked with it, but from what I understand you already know the action you want…
-
0
votes1
answer925
viewsA: How to translate (or edit) validation messages or "Labels" into wordpress plugins?
Every good plugin or Wordpress theme has translation files. This plugin you are using is no different. Inside the plugin folder is a folder called 'Languages' with two files…
-
3
votes1
answer1334
viewsA: Search field in a table with PHP
Apparently you are not using Wordpress for anything on this page. So just create a simple filter in your mysql query: <!-- Campo para pesquisa --> <input type="text" name="texto"…
-
1
votes1
answer214
viewsA: Allow access to other directories with . htaccess
htaccess hasn’t been configured by Wordpress yet. htaccess. You need to enter the dashboard and access Settings -> Permanent Links and choose any of the structures, except the default…
-
2
votes1
answer2077
viewsA: How to show more posts when you click button?
Your button (+ SEE MORE PRODUCTS) must call an AJAX function to load 4 more products from the database. To use paging with AJAX you need: Queue a script in Wordpress that will call the AJAX function…