Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
mail after confirmation of guests by code
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Requests

2022-04-24 20:34:28
Hello

I am looking for a code so that as soon as I confirm the validation of my guest by code that this is an email to tell him that the person who gave you an invitation code has validated your registration and you can collect yourself at site.
I searched the forum but couldn't find anything, hence my question.

Thank you very much for your help.

========================================||

Bonjour

Je recherche un code pour que dès j'ai confirmer la validation de mon invité par code que ce lui ci est un email pour lui dire que la personne qui vous a remis un code d'invitation a validé votre inscription et vous pouvez vous collecter au site.
J'ai chercher sur le forum mais j'ai rien trouver, d'où ma demande.

Merci beaucoup de votre aide.
2022-04-25 13:55:02
For clarification is this after admin confirm users - we just need to add mail here is admincp
      autolink("admincp.php?action=confirmreg", "Entries Confirmed");


Is this right and ill play with it  👍
2022-04-25 23:45:49
M-jay:
For clarification is this after admin confirm users - we just need to add mail here is admincp
      autolink("admincp.php?action=confirmreg", "Entries Confirmed");
Is this right and ill play with it  👍  


thanks for your help 😉
But I'm not talking about the invitation code by email but him by code in admincp in invite.php

and the mode i have in admincp is him and i can just delete:
#======================================================================#
# Invited Users - Created by djhowarth
#======================================================================#
if ($action == "invited")
{
   if ($do == "del")
   {
       if (!@count($_POST["users"])) show_error_msg(T_("ERROR"), "Rien de sélectionné.", 1);

       $ids = array_map("intval", $_POST["users"]);
       $ids = implode(", ", $ids);
       
       $res = SQL_Query_exec("SELECT u.id, u.invited_by, i.invitees FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' AND u.id IN ($ids)");
       while ($row = mysqli_fetch_assoc($res))
       {    
            # We remove the invitee from the inviter and give them back there invite.
            $invitees = str_replace("$row[id] ", "", $row["invitees"]);
            SQL_Query_exec("UPDATE `users` SET `invites` = `invites` + 1, `invitees` = '$invitees' WHERE `id` = '$row[invited_by]'");
            deleteaccount($row['id']);
       }

       autolink("admincp.php?action=invited", "Entrées supprimées");
   }
   
   $count = get_row_count("users", "WHERE status = 'confirmed' AND invited_by != '0'");
   
   list($pagertop, $pagerbottom, $limit) = pager(25, $count, 'admincp.php?action=invited&');  
                                                                   
   $res = SQL_Query_exec("SELECT u.id, u.username, u.email, u.added, u.last_access, u.class, u.invited_by, i.username as inviter FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'confirmed' AND u.invited_by != '0' ORDER BY u.added DESC $limit");
   
   stdhead("Invited Users");
   #navmenu();
                   
   begin_frame("Utilisateurs Invités");
   ?>
   
   <center>
   Cette page affiche tous les utilisateurs invités auxquels des invitations ont été envoyées et ont activé leur compte. En supprimant des utilisateurs, l'invité recevra une invitation et toutes les données associées à l'invité seront supprimées.<hr class="barre"/><?php echo number_format($count); ?> les membres ont confirmé les invitations.
   </center>

   <?php if ($count > 0): ?>
   <br />
   <form id="invited" method="post" action="admincp.php?action=invited">
   <input type="hidden" name="do" value="del" />
   <table border="0" cellpadding="3" cellspacing="0" width="100%" align="center" class="table_table">
   <tr>
       <th class="table_head">PSeudo</th>
       <th class="table_head">E-mail</th>
       <th class="table_head"><?php echo T_("CLASS");?></th>
       <th class="table_head">Invité</th>
       <th class="table_head">Dernier Accès</th>
       <th class="table_head">Invité Par..</th>
       <th class="table_head"><input type="checkbox" name="checkall" onclick="checkAll(this.form.id);" /></th>
   </tr>
   <?php while ($row = mysqli_fetch_assoc($res)): ?>
   <tr>
       <td class="table_col1" align="center"><a href="account-details.php?id=<?php echo $row["id"]; ?>"><?php echo $row["username"]; ?></a></td>
       <td class="table_col2" align="center"><?php echo $row["email"]; ?></td>
       <td class="table_col1" align="center"><?php echo get_user_class_name($row["class"]); ?></td>    
       <td class="table_col2" align="center"><?php echo utc_to_tz($row["added"]); ?></td>
       <td class="table_col1" align="center"><?php echo utc_to_tz($row["last_access"]); ?></td>  
       <td class="table_col2" align="center"><?php echo ( $row['inviter'] ) ? '<a href="account-details.php?id='.$row["invited_by"].'">'.$row["inviter"].'</a>' : 'Unknown User'; ?></td>
       <td class="table_col1" align="center"><input type="checkbox" name="users[]" value="<?php echo $row["id"]; ?>" /></td>
   </tr>
   <?php endwhile; ?>
   <tr>
       <td colspan="7" align="right">
       <input type="submit" value="Supprimer Les Cochés" />
       </td>
   </tr>
   </table>        
   </form>
   <?php
   endif;
   
   if ($count > 25) echo $pagerbottom;
   
   end_frame();
navmenu();
   stdfoot();
}
#======================================================================#
# End Invited Users - Created by djhowarth
#======================================================================#  


and he who is for the mode of invitation by email:
#======================================================================#
# View Pending Invited Users - Created by djhowarth
#======================================================================#
if ($action == "pendinginvite")
{
   if ($do == "del")
   {
       if (!@count($_POST["users"])) show_error_msg(T_("ERROR"), "Rien de sélectionné.", 1);

       $ids = array_map("intval", $_POST["users"]);
       $ids = implode(", ", $ids);
       
       $res = SQL_Query_exec("SELECT u.id, u.invited_by, i.invitees FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' AND u.id IN ($ids)");
       while ($row = mysqli_fetch_assoc($res))
       {    
            # We remove the invitee from the inviter and give them back there invite.
            $invitees = str_replace("$row[id] ", "", $row["invitees"]);
            SQL_Query_exec("UPDATE `users` SET `invites` = `invites` + 1, `invitees` = '$invitees' WHERE `id` = '$row[invited_by]'");
            SQL_Query_exec("DELETE FROM `users` WHERE `id` = '$row[id]'");
       }

       autolink("admincp.php?action=pendinginvite", "Entrées supprimées");
   }
   
   $count = get_row_count("users", "WHERE status = 'pending' AND invited_by != '0'");
   
   list($pagertop, $pagerbottom, $limit) = pager(25, $count, 'admincp.php?action=pendinginvite&');  
                                                                   
   $res = SQL_Query_exec("SELECT u.id, u.username, u.email, u.added, u.invited_by, i.username as inviter FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' ORDER BY u.added DESC $limit");
   
   stdhead("Invited Pending Users");
   #navmenu();
   
   begin_frame("Utilisateurs en attente d'invitations");
   ?>
   <center>
   Cette page affiche tous les utilisateurs invités auxquels des invitations ont été envoyées mais qui n'ont pas encore été activées. En supprimant un utilisateur, l'invité recevra son invitation et toutes les données associées à l'invité seront supprimées. <hr class="barre"/><?php echo number_format($count); ?> les membres sont en attente.
   </center>

   <?php if ($count > 0): ?>
   <br />
   <form id="pendinginvite" method="post" action="admincp.php?action=pendinginvite">
   <input type="hidden" name="do" value="del" />
   <table border="0" cellpadding="3" cellspacing="0" width="100%" align="center" class="table_table">
   <tr>
       <th class="table_head">Pseudo</th>
       <th class="table_head">E-mail</th>
       <th class="table_head">Invité</th>
       <th class="table_head">Invité Par..</th>
       <th class="table_head"><input type="checkbox" name="checkall" onclick="checkAll(this.form.id);" /></th>
   </tr>
   <?php while ($row = mysqli_fetch_assoc($res)): ?>
   <tr>
       <td class="table_col1" align="center"><?php echo $row["username"]; ?></td>
       <td class="table_col2" align="center"><?php echo $row["email"]; ?></td>
       <td class="table_col1" align="center"><?php echo utc_to_tz($row["added"]); ?></td>
       <td class="table_col2" align="center"><a href="account-details.php?id=<?php echo $row["invited_by"]; ?>"><?php echo $row["inviter"]; ?></a></td>
       <td class="table_col1" align="center"><input type="checkbox" name="users[]" value="<?php echo $row["id"]; ?>" /></td>
   </tr>
   <?php endwhile; ?>
   <tr>
       <td colspan="5" align="right">
       <input type="submit" value="Supprimer Les Cochés" />
       </td>
   </tr>
   </table>        
   </form>
   <?php
   endif;
   
   if ($count > 25) echo $pagerbottom;
   
   end_frame();
navmenu();
   stdfoot();
}
#======================================================================#
# End View Pending Invited Users - Created by djhowarth
#======================================================================#

Last edited by spiritblue on 2022-04-26 00:02:21
2022-04-26 17:40:12
for quick test try

in invite.php

find this line
$site_config[SITEURL]/account-signup.php?invite=$id&secret=$psecret

copy the line above this line
$body = <<<EOD

then replace line with new link
$site_config[SITEURL]/account-signup.php?invite=$id&code=$psecret

uncomment first line = this will be setting code or secret
//$site_config[SITEURL]/account-signup.php?invite=$id&secret=$psecret

so

//$site_config[SITEURL]/account-signup.php?invite=$id&secret=$psecret // need setting
$body = <<<EOD
You have been invited to $site_config[SITENAME] by $CURUSER[username]. They have specified this address ($email) as your email.
If you do not know this person, please ignore this email. Please do not reply.

Message:
-------------------------------------------------------------------------------
$mess
-------------------------------------------------------------------------------

This is a private site and you must agree to the rules before you can enter:

$site_config[SITEURL]/rules.php
$site_config[SITEURL]/faq.php


To confirm your invitation, you have to follow this link:

$site_config[SITEURL]/account-signup.php?invite=$id&code=$psecret

move these lines
$secret = mksecret();;

$psecret = md5($secret);

above
if ($_GET["take"]) {

find
<form method="post" action="invite.php?take=1">

under add
<input type="hidden" name="code" value="$psecret" />

above
<form method="post" action="invite.php?take=1">

add
echo $psecret;

in account-signup.php add at top (for test only)
if ($_GET["code"]) {
    echo 'code is here we just need to do signup ';
    die();
}


the code displayed on invite and in url should match - this is just for test
Last edited by M-jay warn on 2022-04-26 18:03:48
2022-04-26 21:06:39
thanks M-jay

but I have no request line in my invite.php file lol
invite.zip
File missing

Last edited by spiritblue on 2022-04-26 21:09:50
2022-04-27 18:03:34
file is hard to read - missing takeconfirm.php, language & invite sql

but i think we can make it simple - you can then build - i like this idea - maybe you can offer invites on torrentinvite sites

we just nee to create user from email that will be the takeconfirm.php maybe something in file to guide us  but this is the code i played with - very simple - once it works we can add everything back

example
1) we make user
2) remove 1 invite
3) send email with code
4) if code on signup - we welcome

if you sell or give invites we just add to array see line 21 of my code - maybe should be in database so we can delete if used
$os = array(222, 333, 444, 555);


create invitecode.php  progress ideas welcome
<?php
require_once "backend/functions.php";
require_once "backend/config.php";
dbconn();
loggedinonly();

stdhead("Invite");

// submitted form
$mail = $_POST['email'];
$code = $_POST['secretcode'];
$specailcode = $_POST['specialcode'];

// create secret
$secret = mksecret();
$psecret = md5($secret);

// show page
begin_frame("Invites");

if (!empty($code)) {
echo "<center>This is old code $code</center>";
echo "<center>This is email $email</center>";
echo "<center>now we make user</center>";

// Maybe sell codes or give away
$os = array(222, 333, 444, 555);
if (in_array($specailcode, $os)) {
echo "<center>Great you used specail code $specailcode</center>";
}
}

echo "<center>This is last code $psecret</center>";
?>
<form method="post"  action="invitecode.php">
email only - code automatic
<input type="hidden" name="secretcode" value="<?php echo $psecret ?>">
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br><br>


code we buy try 222 or 333
<label for="specialcode">specialcode:</label>
<input type="number" id="specialcode" name="specialcode"><br><br>
<input type="submit" value="Submit">
</form>
<?php
end_frame();

stdfoot();

Last edited by M-jay warn on 2022-04-27 18:17:14
2022-04-27 21:26:41

SQL :
[CREATE TABLE `invites` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `inviter` int(10) unsigned NOT NULL DEFAULT '0',
 `inviteid` int(10) NOT NULL DEFAULT '0',
 `invite` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',
 `time_invited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
 `confirmed` char(3) COLLATE utf8_bin NOT NULL DEFAULT 'no',
 PRIMARY KEY (`id`),
 KEY `inviter` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=182 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

ALTER TABLE `users` ADD `invited_by` int(10) NOT NULL default '0';
ALTER TABLE `users` ADD  `invites` smallint(4) NOT NULL default '3';


config.php  :
// Mod invite code
$site_config['INVITE_TIMEOUT'] = '604800';  //Sur (7 Jours...)
$site_config['INVITEONLY'] = true;   //Seulement permettent inscriptions via invitent ->IMPORTENT
$site_config['ENABLEINVITES'] = true;   // Activer invite indépendamment du paramètre INVITEONLY

ago takeconfirm.php
<?php
require_once("backend/functions.php");
dbconn();
$id = (int) $_GET["id"];
if (!@count($_POST['conusr'])) autolink("invite.php", "Nothing Selected.");
SQL_Query_exec("UPDATE invites SET confirmed='yes' WHERE inviteid IN (" . implode(", ", $_POST['conusr']) . ") AND confirmed='no'");
SQL_Query_exec("UPDATE users SET status = 'confirmed' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND status='pending'");
SQL_Query_exec("UPDATE users SET uploaded='2150000000' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND uploaded='0'");
$result = SQL_Query_exec("SELECT * from users WHERE username = '".$CURUSER['username']."'");
while ($row = mysqli_fetch_array($result)){ $old_upload_value = $row['uploaded'] + 2150000000; }
SQL_Query_exec("UPDATE users SET uploaded='$old_upload_value' WHERE username = '".$CURUSER['username']."'");
header("Refresh: 0; url=invite.php?id=$id");
?>


takeinvite.php:
<?php
require_once("backend/functions.php");


dbconn();

function bark($msg) {
stdhead();
show_error_msg("Invitation failed!", $msg);
stdfoot();
exit;
}

$id = 0 + $_GET["id"];

if ($id == 0){
$id = $CURUSER["id"];
}
if (get_user_class() <= 6)
$id = $CURUSER["id"];


$re = SQL_Query_exec("SELECT invites FROM users WHERE id = $id") or sqlerr();
$tes = mysql_fetch_assoc($re);
if ($tes[invites] <= 0)
show_error_msg("Vous avez aucune invitation!");





$ret = SQL_Query_exec("SELECT username FROM users WHERE id = $id") or sqlerr();
$arr = mysql_fetch_assoc($ret);


$hash = md5(mt_rand(1,1000000));

SQL_Query_exec("INSERT INTO invites (inviter, invite, time_invited) VALUES ('$id', '$hash', '" . get_date_time() . "')");
SQL_Query_exec("UPDATE users SET invites = invites - 1 WHERE id = $id") or sqlerr(__FILE__, __LINE__);


header("Refresh: 0; url=invite.php?id=$id");


?>

great all that but I just want the member once I validate them, can have this if he has an email to tell him who is validated. 😉


if you can add a confirmation link as for the email change mode, I say no lol

To come back to your change, you should test it and make it available for v3, I think it's a great idea, even if it's not my request here, you had a good idea and it would be nice to put it into action.  💣  👍
Invitation par code.zip
File missing

Last edited by spiritblue on 2022-04-27 21:35:36
2022-04-29 17:03:29
in your files i do not see insert user
if new user with code is status pending if this code changes user to confirmed then sending mail is easy

try this in admincp this is link admincp.php?action=pendinginvitecode
if this

# View Pending Invited Users - Created by mjay
#======================================================================#
if ($action == "pendinginvitecode")
{
  if ($do == "confirm")
  {
      if (!@count($_POST["users"])) show_error_msg(T_("ERROR"), "Rien de sélectionné.", 1);

      $ids = array_map("intval", $_POST["users"]);
      $ids = implode(", ", $ids);
     
      $res = SQL_Query_exec("SELECT u.id, u.invited_by, i.invitees FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' AND u.id IN ($ids)");
      while ($row = mysqli_fetch_assoc($res))
      {    
           
           SQL_Query_exec("UPDATE `users` SET `status` = 'confirmed' WHERE `id` = '$row[id]'");
      }

      autolink("admincp.php?action=pendinginvitecode", "Entrées supprimées");
  }
 
  $count = get_row_count("users", "WHERE status = 'pending' AND invited_by != '0'");
 
  list($pagertop, $pagerbottom, $limit) = pager(25, $count, 'admincp.php?action=pendinginvite&');  
                                                                 
  $res = SQL_Query_exec("SELECT u.id, u.username, u.email, u.added, u.invited_by, i.username as inviter FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' ORDER BY u.added DESC $limit");
 
  stdhead("Invited Pending Users");
  #navmenu();
 
  begin_frame("Utilisateurs en attente d'invitations");
  ?>
  <center>
  Cette page affiche tous les utilisateurs invités auxquels des invitations ont été envoyées mais qui n'ont pas encore été activées. En supprimant un utilisateur, l'invité recevra son invitation et toutes les données associées à l'invité seront supprimées. <hr class="barre"/><?php echo number_format($count); ?> les membres sont en attente.
  </center>

  <?php if ($count > 0): ?>
  <br />
  <form id="pendinginvite" method="post" action="admincp.php?action=pendinginvitecode">
  <input type="hidden" name="do" value="confirm" />
  <table border="0" cellpadding="3" cellspacing="0" width="100%" align="center" class="table_table">
  <tr>
      <th class="table_head">Pseudo</th>
      <th class="table_head">E-mail</th>
      <th class="table_head">Invité</th>
      <th class="table_head">Invité Par..</th>
      <th class="table_head"><input type="checkbox" name="checkall" onclick="checkAll(this.form.id);" /></th>
  </tr>
  <?php while ($row = mysqli_fetch_assoc($res)): ?>
  <tr>
      <td class="table_col1" align="center"><?php echo $row["username"]; ?></td>
      <td class="table_col2" align="center"><?php echo $row["email"]; ?></td>
      <td class="table_col1" align="center"><?php echo utc_to_tz($row["added"]); ?></td>
      <td class="table_col2" align="center"><a href="account-details.php?id=<?php echo $row["invited_by"]; ?>"><?php echo $row["inviter"]; ?></a></td>
      <td class="table_col1" align="center"><input type="checkbox" name="users[]" value="<?php echo $row["id"]; ?>" /></td>
  </tr>
  <?php endwhile; ?>
  <tr>
      <td colspan="5" align="right">
      <input type="submit" value="confirm Les Cochés" />
      </td>
  </tr>
  </table>        
  </form>
  <?php
  endif;
 
  if ($count > 25) echo $pagerbottom;
 
  end_frame();
navmenu();
  stdfoot();
}


users emails code to friend - friend signups up - you confirm - is this correct

here is what i have so far on my side for v3
https://torrenttrader.uk/topic?topicid=10452
Last edited by M-jay warn on 2022-04-29 17:26:17
2022-05-03 15:25:35
do you have the v3 function send mail because this should work in admincp - this is link url/admincp.php?action=pendinginvitecode

For test not live

# View Pending Invited Users - Created by mjay
#======================================================================#
if ($action == "pendinginvitecode")
{
 if ($do == "confirm")
 {
     if (!@count($_POST["users"])) show_error_msg(T_("ERROR"), "Rien de sélectionné.", 1);

     $ids = array_map("intval", $_POST["users"]);
     $ids = implode(", ", $ids);

     // Add Email to sql
     $res = SQL_Query_exec("SELECT u.id, u.invited_by, u.email, i.invitees FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' AND u.id IN ($ids)");
     while ($row = mysqli_fetch_assoc($res))
     {    
          // confirm user
          SQL_Query_exec("UPDATE `users` SET `status` = 'confirmed' WHERE `id` = '$row[id]'");
          // Send mail
          sendmail($row["email"], "Confirm", "Admin has confirmed", "", "-f".$site_config['SITEEMAIL']);
     }

     autolink("admincp.php?action=pendinginvitecode", "Entrées supprimées");
 }

 $count = get_row_count("users", "WHERE status = 'pending' AND invited_by != '0'");

 list($pagertop, $pagerbottom, $limit) = pager(25, $count, 'admincp.php?action=pendinginvite&');  
                                                               
 $res = SQL_Query_exec("SELECT u.id, u.username, u.email, u.added, u.invited_by, i.username as inviter FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' ORDER BY u.added DESC $limit");

 stdhead("Invited Pending Users");
 #navmenu();

 begin_frame("Utilisateurs en attente d'invitations");
 ?>
 <center>
 Cette page affiche tous les utilisateurs invités auxquels des invitations ont été envoyées mais qui n'ont pas encore été activées. En supprimant un utilisateur, l'invité recevra son invitation et toutes les données associées à l'invité seront supprimées. <hr class="barre"/><?php echo number_format($count); ?> les membres sont en attente.
 </center>

 <?php if ($count > 0): ?>
 <br />
 <form id="pendinginvite" method="post" action="admincp.php?action=pendinginvitecode">
 <input type="hidden" name="do" value="confirm" />
 <table border="0" cellpadding="3" cellspacing="0" width="100%" align="center" class="table_table">
 <tr>
     <th class="table_head">Pseudo</th>
     <th class="table_head">E-mail</th>
     <th class="table_head">Invité</th>
     <th class="table_head">Invité Par..</th>
     <th class="table_head"><input type="checkbox" name="checkall" onclick="checkAll(this.form.id);" /></th>
 </tr>
 <?php while ($row = mysqli_fetch_assoc($res)): ?>
 <tr>
     <td class="table_col1" align="center"><?php echo $row["username"]; ?></td>
     <td class="table_col2" align="center"><?php echo $row["email"]; ?></td>
     <td class="table_col1" align="center"><?php echo utc_to_tz($row["added"]); ?></td>
     <td class="table_col2" align="center"><a href="account-details.php?id=<?php echo $row["invited_by"]; ?>"><?php echo $row["inviter"]; ?></a></td>
     <td class="table_col1" align="center"><input type="checkbox" name="users[]" value="<?php echo $row["id"]; ?>" /></td>
 </tr>
 <?php endwhile; ?>
 <tr>
     <td colspan="5" align="right">
     <input type="submit" value="confirm Les Cochés" />
     </td>
 </tr>
 </table>        
 </form>
 <?php
 endif;

 if ($count > 25) echo $pagerbottom;

 end_frame();
navmenu();
 stdfoot();
}

Last edited by M-jay warn on 2022-05-03 16:17:21
2022-05-03 21:35:39
I had link v3 /admincp.php?action=pending invite

correction made, thank you very much

but it is possible to have in the invite.php part a validation input tag that as soon as it is validated that there is an automatic email sent to the person I have just validated?
like for the change of are email in the account, I have an automatic email to confirm the change of my email, you understand?...
Last edited by spiritblue on 2022-05-03 21:53:16
2022-05-28 14:24:01
Résolu !

Merci Gollum !

****************************//

Solved!

Thank you Golum!
2022-05-29 18:14:36
What the hell is this 🤣

if (!@count($_POST["users"])) show_error_msg(T_("ERROR"), "Rien de sélectionné.", 1);


Is $_POST["users"] an array or a key?

count($array) only counts arrays, not indexes.
Alternatively, you can also just use array_count_values($array) > 0.

Secondly, you dont need to silence '@' count(), its bad code practice and often
results in fatal errors due to the lack of conditional checks. Always compare with greater than 0 (> 0).

If this code is in a class, you want to use the Countable interface, and return result back.


if (isset($_POST["users"]) && count($_POST["users"]) > 0)) {
  show_error_msg(T_("ERROR"), "Rien de sélectionné.", 1);
}


It still makes no sense. 😲
Last edited by STorrents2020 on 2022-05-29 18:28:04
2022-05-29 19:21:30
thanks STorrents2020
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728