Customise wordpress theme search.php

I want my search results to show an image of the product, the products title and link to the product’s page. Currently the search results only show a text link. Search results also show attachments which I do not want. My wordpress theme is Intuition Pro and the website is https://heritagecountrypottery.com. I am also using the Ivory search wordpress plugin

I have searched online for a solution but have not found one that works with my theme

In the application I developed with Flutter, I am pulling data with php json, but I am getting an error

I’m developing a country-city-like system. I’m pulling the data with json via phpmyadmin. but even if the system is working, it crashes from time to time. someone who lives and can solve it, urgently need a solution please.

Padding(
  padding: const EdgeInsets.only(left: 20, right: 20),
  child: DropdownButton(
  dropdownColor: Colors.white,
  value: selectedfakId,

  hint: Text("Fakülte Seçin"),
  items: datafak?.map((faklist) {
                        
  return new DropdownMenuItem(
     child: Text(faklist["name"]),
     value: faklist["fakulte_id"],
  );
}).toList() ??[],
onChanged: (value) {
   setState(() {
      selectedfakId = value as String?;
});

},

Future fakliste() async {
var url = "https://www.forumuni.com/forumunimob/unilist.php?send=faklist";

// ignore: unused_local_variable
var response = await http.post(Uri.parse(url),
    body: {"uniid": selectedId}, headers: {"Accept": "application/json"});

var jsonbody = response.body;
var jsondata = json.decode(jsonbody);

setState(() {
  datafak = jsondata;
});

// ignore: avoid_print
print(jsondata);
return "success";

}

I think I explained it very clearly when you look at the images.

Error 1

How can I grep parameter from plugins Joomla?

I write a plugin joomla and I need to pass some parameters as {myPlugin start= “D02/02/2021″ end=”F02/02/2025” }some text{/myPlugin}.
I want to use regex to grep params but I am not an expert for regex. I have began here my work for extracting all values but I can’t get all I want. I want to get

  1. All the values params,
  2. Each content of the tag (here : some text)
    Can I have some help ?

Thanks

I have tried to write some regex

I’m trying to retrieve the whole 1st row inside phpmyadmin: USERNAME; PASSWORD; EMAIL, and make it the value of three label.text in visual basic

Imports MySql.Data.MySqlClient
Module Module1
Public con As New MySqlConnection
Public cmd As New MySqlCommand

Sub openCon()
    con.ConnectionString = "server=localhost;username=root;password=;database=mydatabase"
    con.Open()


End Sub

End Module


Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If TextBox1.Text = “” Or TextBox2.Text = “” Or TextBox3.Text = “” Or TextBox4.Text = “” Or TextBox5.Text = “” Then
MsgBox(“Please fill up all the boxes”)
ElseIf TextBox2.Text <> TextBox3.Text Then

        MsgBox("Password doesn't match. Please check your input.")
    Else
        openCon()
        Try
            cmd.Connection = con
            cmd.CommandText = "INSERT INTO register (`USERNAME`,`PASSWORD`,`EMAIL`) VALUES('" & TextBox1.Text & "','" & TextBox2.Text & "','" & TextBox4.Text & "')"
            cmd.ExecuteNonQuery()
            MsgBox("Registered successfully!")
            TextBox1.Clear()
            TextBox2.Clear()
            TextBox3.Clear()
            TextBox4.Clear()
            TextBox5.Clear()


            Form3.Show()
            Me.Hide()

            con.Close()

        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    End If
End Sub

All I know is to insert value to phpmyadmin but not retrieving it back to visual basic.

Get Webhook PHP and send by email

I have created a PHP file that receives webhook notifications and writes them to a TXT file but I also want to receive them via email so I added the send email function but it doesn’t work because there is a bug in testing. When I remove the lines “mail(“[email protected]”,”NEW MSG”,”$json”);” it works without errors, so did I do something wrong? Please help.

<?php
$headers = "X-Event-Name: product.update";
$headers = "X-Event-Secret: my_key";
$json = file_get_contents("php://input");
file_put_contents('log.txt', "$json", FILE_APPEND | LOCK_EX);
mail("[email protected]","NEW MSG","$json");
http_response_code(204);

Creating TRIGGER before UPDATE with WHERE clause

I am working on a one page quick password reset module. I am asking username and email address on FULLTEXT field using a simple HTML form.

I want to be able to get these two fields from user on html form and compare it on mysql table and where ever these 2 fields viz Username and Email address matches I want to update the password field.

Please note that I am not using unique emails as usernames because of the design requirements. I am generating Username with PHP unique id with a bit of salting to get a capital letter username of 8 characters long.

For doing this i am setting a trigger before update query but but I am keep getting 2 different errors sometimes “Syntex error” and if I do a bit of modification to the query it becomes “Field Exits” error while it should mot because it is an update query.

$sql = "CREATE TRIGGER usr_pas before UPDATE ON tbl_uesrs
for each row
set NEW.usr_pas = (
(select `usr_email`,`usr_name`,`usr_pas` 
    from tbl_uesrs 
 where `usr_email` = $usremail and `usr_name` = $usernametomatch
),
NEW.usr_pas.$myhashnsaltnpepper)";

I tried creating this “trigger before update” but it errors into echoing Field Exist error.

I cannot seem to resolve this error as i have no idea whatsoever is wrong with this query.
i am giving complete components to this query.

Want To Add Percentage To Number [closed]

I Am Working In Project Required Online Payment Service And My Clients Will Pay The Cost Of Service (Online Payment) , My Provider Rate Is 2%

For Example
My Client Want To Pay 500 EGP , Now When I Put 2% On The Amount Will Be 510 EGP But I Still In Trouble Because My Provider When He Judges Me Will Put The 2% On 510 EGP Not 500 EGP And The Cost Will Be 10.2 EGP NOT 10 EGP

Can Anyone Help My Out !!

When I Tried It’s Not Working As Expected

PHP – If a function parameter has a default value of null, should its type be declared as nullable?

Is it a best practice to mark as nullable (?string) the type of parameters that have a default value of null, given that the parameter is always passed as a string, for example, or some other non null value? The default value of null is only specified to make the parameter optional.

function example(?string $param = null) {
    // Function logic here
}

change the files name while that file is copying through source folder to destination folder in php?

AND I AM COPYING THESE FILES FROM SOURCE PATH TO DESTINATION PATH

src is a folder, and i have to change the name of files that are inside the folder.
Like :-

src/abc.css
abc.css to abc.src.css (abc.css is stored in src folder)

And also src folder contains sample folder and in that also files are there like my.css, to.css, eg.css and so on
src_foldder/sample_folder/my.css…….

and i have to change that also in my.src.css , to.src.css, eg.src.css and so on
how can i do this changes through php code? Please help.

if ($file == “css”) {
custom_copy($your textsrc . ‘/’ . $file, $dst .’/’.$file.’/’.’src’);
}

I WANT TO CHANGE THE NAME OF THE FILES WHILE OF AFTER COPYING FILES.
WHAT I HAVE TO IMPLEMENT IN THIS CODE.
I WANT TO USE PATHINFO FUNCTION, BUT CANT ABLE TO UNDERTAND HOW TO DO

PHP Parse error: syntax error, unexpected ‘|’, expecting variable

I’m trying to switch PHP version from 8.1 to 7.1 and run composer install. Here’s my method:-

cd /etc/php && ls -la
drwxr-xr-x   4 root root  4096 Jan 27 09:18 .
drwxr-xr-x 141 root root 12288 Jan 27 09:18 ..
drwxr-xr-x   5 root root  4096 Jan 27 09:18 7.1
drwxr-xr-x   4 root root  4096 Dec  5 20:21 8.1

php -v
PHP 8.1.2-1ubuntu2.10 (cli) (built: Jan 16 2023 15:19:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.2, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.2-1ubuntu2.10, Copyright (c), by Zend Technologies
    with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans

composer
   ______
  / ____/___  ____ ___  ____  ____  ________  _____
 / /   / __ / __ `__ / __ / __ / ___/ _ / ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__  )  __/ /
____/____/_/ /_/ /_/ .___/____/____/___/_/
                    /_/
Composer 2.2.6 2022-02-04 17:00:38
...

However, upon switching PHP versions, from 8.1 to 7.1, I get an error…

update-alternatives --config php
There are 3 choices for the alternative php (providing /usr/bin/php).

  Selection    Path                  Priority   Status
------------------------------------------------------------
  0            /usr/bin/php.default   100       auto mode
  1            /usr/bin/php.default   100       manual mode
  2            /usr/bin/php7.1        71        manual mode
* 3            /usr/bin/php8.1        81        manual mode

Press <enter> to keep the current choice[*], or type selection number: 
2

php -v
PHP 7.1.33-51+ubuntu22.04.1+deb.sury.org+1 (cli) (built: Jan  6 2023 15:54:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.1.33-51+ubuntu22.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

composer
PHP Parse error:  syntax error, unexpected '|', expecting variable (T_VARIABLE) in /usr/share/php/Composer/IO/BaseIO.php on line 163

Parse error: syntax error, unexpected '|', expecting variable (T_VARIABLE) in /usr/share/php/Composer/IO/BaseIO.php on line 163

help

Unable to display google map using javascript

I am working on javascript,Right now i am trying to display google map using “lat long” but map is not displaying,How can i do this ? Here is my current complete code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title></title>

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
    <script language=javascript src='http://maps.google.com/maps/api/js?sensor=false'></script>
    <script>
    $(document).ready(function (){
        
     var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
     var myOptions = {
         zoom: 4,
         center: myLatlng,
         mapTypeId: google.maps.MapTypeId.ROADMAP
         }
      map = new google.maps.Map($('#map'), myOptions);
      var marker = new google.maps.Marker({
          position: myLatlng, 
          map: map,
        title:"Fast marker"
     });
});
    </script>

    </head>
    <body>

    <div id="map"></div>
    </body>
    </html>

Is there a way to convert to json object in php

I have this in my text tile

[{"id":20,"tokenType":"Keyfob","tokenValue":"9037119","isLost":false}][{"id":22,"tokenType":"Keyfob","tokenValue":"47690743","isLost":false}]

But i am trying to convert it to json object like this below:

$cache_file = $_SERVER['DOCUMENT_ROOT']."/site/users/sample-keys-test.txt";

              $file = fopen($cache_file, "r");
              $file_content = fread($file, filesize($cache_file));
              $file_content = preg_replace("/[(.*?)]/", "$1,", $file_content);
              $file_content = rtrim($file_content, ",");
              $data = json_decode("{"items": [".$file_content."]}", true);
              var_dump($data);

              foreach($data["items"] as $json_object) {
                  // Do something with each JSON object
                  echo $json_object["id"]."<br>";
                  echo $json_object["tokenType"]."<br>";
                  echo $json_object["tokenValue"]."<br>";
                  echo $json_object["isLost"]."<br>";
              }
              fclose($file);

But in the line with var_dump i get null which means there is something wrong with converting it to json object.