php – Hide Approved status for certain users in users list

In the list of all users in wp-admin, i would like to hide the “Approved” status for certain users. These users only need to see “Pending” status to accept them.
I didn’t find any plugin to make this, and I don’t know how to code it in PHP/JS.

If you can help and send me an idea 🙂

Thank you

how to instll PHP Mailparse PECL extension in Virtualmin

I am trying to install PHP Mailparse PECL extension in virtualmin
I go to software packages and search to install when I search PECL I se… | Read the rest of https://www.webhostingtalk.com/showthread.php?t=1814669&goto=newpost

php – Array Function Failling

Iam fixing a script that i had for a few time.
Got stuck on this function.
It wa suposed to output the $streamI(“servers”)
But allways get undefined index servers

 function getStreams($type = Null, $sID = "id", $orderBy = "DESC", $C395e1a7f4405d2f03555fd903d1e930 = false)
    {
    
        global $ipTV_db;
        $streamArray = array();
        switch ($type) {
            case NULL:
                $sql = "INNER JOIN `streams_types` t3 ON t3.type_id = t1.type";
                break;
            default:
                $sql = "INNER JOIN `streams_types` t3 ON t3.type_id = t1.type AND t3.type_key = '" . $type . "'";
        }
        $ipTV_db->query("SELECT t1.*,t2.category_name,t3.*,t4.*n                       FROM `streams` t1n                       LEFT JOIN `stream_categories` t2 ON t2.`id` = t1.`category_id`    n                       LEFT JOIN `movie_containers` t4 ON t4.container_id = t1.target_container_id             n                       " . $sql . "                                   n                       ORDER BY t1." . $sID . " " . $orderBy . ",t1.id DESC");
        if (0 < $ipTV_db->num_rows()) {
            $streamArray = $ipTV_db->get_rows(true, "id");
            if (!$C395e1a7f4405d2f03555fd903d1e930) {
            } else {
                $output = array();
                $ipTV_db->query("n                        SELECT *n                        FROM `streams_sys` t1 n                        INNER JOIN `streaming_servers` t3 ON t3.id = t1.server_idn                        WHERE t1.stream_id IN(" . implode(",", array_keys($streamArray)) . ")n                        ORDER BY FIELD(t1.stream_id, " . implode(",", array_keys($streamArray)) . ")");
                while (($row = mysqli_fetch_array($ipTV_db->result, MYSQLI_ASSOC))) {
                    if ($type != "movie") {
                        $output("running_pids") = Servers::getPidFromProcessName(array_keys(ipTV_lib::$StreamingServers), FFMPEG_PATH);
    
                    }
                    foreach ($streamArray as $streamI) {
                        $output("streams")($streamI("id"))("info") = $streamI;
                    }
                    $ipTV_db->query("SELECT a.server_id,a.stream_id , COUNT(a.activity_id) AS online_clients FROM `user_activity_now` a WHERE a.stream_id = (" . implode(",", array_keys($output("streams"))) . ") GROUP BY a.server_id,a.stream_id;");
                    foreach ($ipTV_db->get_rows() as $row) {
                        if (isset($output("streams")($row("stream_id"))) && array_key_exists($row("server_id"), $output("streams")($row("stream_id"))("servers"))) {
                            $output("streams")($row("stream_id"))("servers")($row("server_id"))("online_clients") = $row("online_clients");
    
                        }
    
                    }
                    print_r($output("streams"));
    
                    return $output;
    
                }
    
                $row("online_clients") = 0;
                $output("streams")($row("stream_id"))("servers")($row("server_id")) = $row;
    
            }
        }
    
        return $streamArray;
    }
    

view page

  $streamArray = getStreams("live", "order", "ASC", true);
        if (empty($streamArray)) {
            $errordash = $_LANG("add_some_streams");
        }
        $streamPid = $streamArray("running_pids");
    
        foreach ($streamArray("streams") as $streamI) {
    $info = $streamI("info");
            $html = "";
            if ($info("enable_transcode") == 1) {
                $html = " ( <font color="red">" . $_LANG("transcoding") . "</font> )";
            }
            echo "<article class="module width_full"><header><h3 class="tabs_involved">";
            if (!empty($info("notes"))) {
                echo "<a style="float: left;" href="#" class="tooltip-bottom" data-tooltip="" . $info("notes") . ""><img src="https://pt.stackoverflow.com/templates/images/notes.png"></a>";
            }
            echo (string) $info("stream_display_name");
            if (!is_null($info("category_name"))) {
                echo " <font color="#FFC266">( " . $info("category_name") . " )</font>";
            }
            echo "</h3></header>";
            echo "<center>";
            echo "<table id="tfhover" class="tftable" border="0" style="width:100%;text-align: center;" >";
            echo "<tr>";
            echo "<th>" . $_LANG("status") . "</th>";
            echo "<th>" . $_LANG("server") . "</th>";
            echo "<th>" . $_LANG("node") . "</th>";
            echo "<th>" . $_LANG("online_clients") . "</th>";
            echo "<th>" . $_LANG("uptime_stream") . "</th>";
            echo "<th>" . $_LANG("audio_codec") . "</th>";
            echo "<th>" . $_LANG("video_codec") . "</th>";
            echo "<th>" . $_LANG("bitrate") . "</th>";
            echo "<th>" . $_LANG("view_output") . "</th>";
            echo "<th>" . $_LANG("options") . "</th>";
            echo "</tr>";
    
    
            foreach ($streamI("servers") as $server_id => $server) {

Anyone can explain me whats wrong on the code?

html – Export PDF file as seperate name when specific row is selected and shows result first and included an image in php

Index.php File: This file shows all records from database id wise and in last column there is buttons in every row for export the data of each specific row.

<td><a href="pictures/<?php echo $row('file') ?>" target="_blank">Download</a></td>
<td>
     <form method="post" action="export_pdf.php">
 <input type="hidden" name="id" value="<?php echo $row('id'); ?>">
 <input type="submit" name="export_click" value="Export">
    </form> 
</td>

When I press the export button of row 1. It displays records of this row in export_pdf.php file
I m retrieving the variable of $id from index.php file and using in export_pdf.php file like:

 include "dbConnection.inc";
 session_start();


 if (isset($_POST("export_click"))) {
 $id = "" . $_POST("id") . ".pdf";
 echo $id;//Displays 1.pdf It is Okay.
 }

export_pdf.php File: It displays the records of 1 selected row after press button of row 1 in html and also exporting the pdf file with results of row 1 when I use WHERE id = 1 and so on. See problem 1.

  function fetch_data()  
  {  

  $output = '';  
 
  $connection = mysqli_connect("localhost", "root", "", "sage"); 
  $sql = "SELECT * FROM users WHERE id='".$_POST("id")."'";//**(Problem 1)** Not working in pdf file
  $result = mysqli_query($connection, $sql);  
  while($row = mysqli_fetch_array($result))  
  {       

  $output .= ' 

    
 
  <tr> 
  <th width="45%">S. No.</th>
  <td>'.$row('id').'</td>
  </tr>  

  <tr> 
  <th width="45%">Title</th>
  <td> '.$row('title').'</td>
  </tr>  

  <tr> 
  <th width="45%">Surname</th>
  <td>  '.$row('surname').'</td>
  </tr>  

  <tr> 
  <th width="45%">Full Name</th>
  <td>  '.$row('full_name').'</td>
  </tr>  
       ';  
  }  

  return $output;  
  }  

  if(isset($_POST("create_pdf")))  
  {  
  ob_clean();
  //ob_end_clean();
  require_once('tcpdf/tcpdf.php');  
  $obj_pdf = new TCPDF('P', PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);  
  $obj_pdf->SetCreator(PDF_CREATOR);  
  $obj_pdf->SetTitle("SINDH ASSOCIATION OF GRADUATE ENGINEERS");  
  $obj_pdf->SetHeaderData('', '', PDF_HEADER_TITLE, PDF_HEADER_STRING);  
  $obj_pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));  
  $obj_pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));  
  $obj_pdf->SetDefaultMonospacedFont('helvetica');  
  $obj_pdf->SetFooterMargin(PDF_MARGIN_FOOTER);  
  $obj_pdf->SetMargins(PDF_MARGIN_LEFT, '5', PDF_MARGIN_RIGHT);  
  $obj_pdf->setPrintHeader(false);  
  $obj_pdf->setPrintFooter(false);  
  $obj_pdf->SetAutoPageBreak(TRUE, 10);  
  $obj_pdf->SetFont('helvetica', '', 12);  
  $obj_pdf->AddPage();  
  $content = '';  
  $content .= '  
  <h3 align="center">SINDH ASSOCIATION OF GRADUATE ENGINEERS</h3><br /><br />  
  <table border="1" cellspacing="0" cellpadding="5">  
      
  ';  
 

  $content .= fetch_data();  
  $content .= '</table>';  
  $obj_pdf->writeHTML($content);  
  
  //$obj_pdf->Output('file.pdf', 'I'); 
  $obj_pdf->Output($_POST('id').'.pdf', 'I'); //**(Problem 2)** Not working
  }  

  <!DOCTYPE html>  
  <html>  
  <head>  
  </head>  
  <body>  
  <table class="table table-bordered">  

  <?php  
  echo fetch_data();  
  ?>  
  </table>  
                
  <form method="post">                            
  <input type="submit" name="create_pdf" class="btn btn-danger" value="Create PDF" />  
  </form>  

Problem 1: Not retrieving id value in this line and shows error “TCPDF ERROR: Some data has already been output, can’t send PDF file” when I use in terms of variable.

Problem 2: I want that when I click on each row the pdf file which is downloaded renamed as id name.pdf. Because every time I export It is replacing with the previous file. It should be exported as seperate file with each id name without asking for replacing.

Problem 3: I have images in database which can be downloaded after click download button in each row in index.php file. I want to export specific row image to pdf file also and also displays first in export_pdf.php file with e.g row 1 details. Then press create pdf button and It will be exported to seperate pdf file of each row.
Thanks. Please solve these problems, I will be very thankful to you.

sql – How, if possible, do I fake the current date/time in PHP and PostgreSQL?

I’m trying to, without actually changing my clock in the OS, make PHP believe that it’s current the year 1980-03-07, 14:00:05 o’clock (in 24-hour format).

That is, I wish for all time-related or system clock-using functions in PHP now act as if the current date and time is 1980-03-07 14:00:05 instead of whatever the system clock is.

I also wish to do this to PostgreSQL so that all time calculations are done according to that “fake time”.

The purpose of this would be to calculate a complex table of financial data according to the conditions that were true in that moment in time. I then plan to try various other times and compare what numbers are calculated in my table.

I hope I’ve been very clear about what I’m trying to do, and that this is possible. Changing the system clock is not an acceptable solution both for practical and philosophical reasons.

I’ve made numerous web searches the last half hour and find nothing relevant whatsoever.

php – Como fazer uma requisição para uma api rest sem o Postman ou outro programa de teste?

Como fazer uma requisição para uma api rest ?eu já tenho uma api rest pronta, e já testei utilizado postman, no entanto, não sei como fazer essa requisição sem o Postman, direito no código, isso é, eu informo os dados do POST, e faço a requisição do tipo POST… Procurei na internet e não encontrei exatamente isso, só mostra pessoas usando o Postman ou outro programa de teste, mas eu queria saber como fazer a requisição direito no código – no meu caso, com PHP… Alguém pode me indicar um link sobre o assunto ?

unicode – PHP Back End Development Assignment

I have been taking a Dynamic Website course and I can’t seem to grasp the content at all! I spend hours a week trying to figure out the basics yet am stuck. I have an assignment to work on and I’m not sure how to even start.

Operation
A visitor’s initial access to the application will be through its main page. The main page will be named index.php.
The main page will display a single form composed of a selection field and two text fields.
The visitor will select a course from the selection field.
The visitor will enter a student name in one text field and a student number in one text field. The visitor must not be shown a list of student names or student numbers.
If the student information does not match an existing student record, the visitor must not be told which part of the student information does not match.
If the student name and student number match an existing student record and if the course selected has not reached maximum enrolment and if the student has not enrolled in the course already, the student can be enrolled into the course.
The visitor must be informed of the results of the enrolment attempt and allowed to select from the course list again.

Make no assumptions about which client platform will be used to test and grade the assignment. The application must work equally well with any web browser on any platform. See Any Browser Campaign’s Accessible Design Guide and search the W3C web site for information on accessibility standards. For example, the W3C specification for Tables in HTML documents makes recommendations for designing tables that can be rendered by non-visual user agents.

PHP Swagger – path at area level

How do I specify paths at the area level?

Currently I have this:

paths:
      /internal_api/token/refresh:
        post:
          tags:
            - Auth
...
areas:
      default:
          path_patterns: 
              - ^/api(?!/doc$)(?!/doc/)(?!/.+/audit/) 
      internal:
          path_patterns: 
              - ^/internal_api(?!/doc$)(?!/.+/audit/) 

I don’t want the refresh token path appear for public api docs.
Tried to move path under area but it didn’t work.

I tried moved a path under area but got an error.