Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   Invites mod (http://www.bvlist.com/showthread.php?t=5151)

Bigjoos 19th December 2011 20:09

You run a tracker this should be bread and butter creating table entrys anyhoo :

PHP Code:

ALTER TABLE users ADD `invitedbyint(10unsigned NOT NULL default '0'



The op must have neglected to check that there was 2 user table entries required for this mod when he posted it. I'll assit with missing sql i was on Tbdev long enough to know every single modification used, there is no way im fixing the code, i already done that for Tbdev.

wdq 24th December 2011 08:37

a little help
 
so i installed succesfully the invitation mod but now i added in bittorrent.php this line
PHP Code:

$TBDEV['openreg'] = true//==true=open, false = closed 

so in takesignup.php i need to add something like

PHP Code:

 if(!$TBDEV['openreg']) 

what do i need to add to the second part to make takesignup.php to let people signup without a invitation code when TBDEV OPENREG = TRUE ?

and if it`s closed to require the invitation code

Bigjoos 24th December 2011 11:10

PHP Code:

if(!$TBDEV['openreg']) 
    
stderr('Sorry''Invite only - Signups are closed presently if you have an invite code click <a href="'.$TBDEV['baseurl'].'/invite_signup.php"><b> Here</b></a>'); 

If false invite signup only , if true open signup.

wdq 24th December 2011 17:55

Thanks for your Great HELP Bigjoos
 
a last question if someone knows how to do it .... is there any way ... so i can
change

$TBDEV['openreg'] = true; //==true=open, false = closed


from true to false, from staffpanel.php ?

thanks in advance!

Bigjoos 25th December 2011 19:50

Could make a table named site_configs, move any global you want to that and execute a select to have the values available just as it would be hard coded, then you make a simple admin script to allow you to edit them, if your not sure how ask.

wdq 26th December 2011 20:21

Thanks For the Quick answer
 
well i did a config.php file but ... i`m lost in how to make that admin.php and the line that will change that line pfff , sorry but i`m like new but i learned a lot,
so a tip will be great ... thanks a lot Bigjoos but now i`m geting a little bit lost

ndbj 10th October 2015 15:22

Quote:

Originally Posted by rara (Post 27535)
Where i can find a checkuser.php and takeconfirm.php ?
I need it for confirm the invited users....

I also need those two files, anybody can post them here?
Thanks in advance.

Maybe this for takeconfirm.php?
Code:


require_once("include/bittorrent.php");
dbconn();
loggedinorreturn();
$id = intval($_GET["id"]);
if (!is_valid_id($id))
    stderr("Error", "...");
if (isset($_POST["conusr"]))
    sql_query("UPDATE users SET status = 'confirmed' WHERE id IN (" . implode(", ", array_map("sqlesc", $_POST["conusr"])) . ") AND status = 'pending'".( get_user_class() < UC_SYSOP ? " AND invitedby = $CURUSER[id]" : "")) or sqlerr(__FILE__,__LINE__);
else
    header("Location: invite.php?id=$id");
header("Refresh: 0; url=invite.php?id=$id");

?>

Bump: and perhaps this to checkuser.php?

PHP Code:

<?
require "include/bittorrent.php";

dbconn(false);

loggedinorreturn();

function 
bark($msg)
{
  
stdhead();
  
stdmsg("Error"$msg);
  
stdfoot();
  exit;
}

function 
how_many_days_left($iy,$im,$id,$dy,$dm,$dd) {
$init_date mktime(12,0,0,$im,$id,$iy);
$dst_date mktime(12,0,0,$dm,$dd,$dy);
$offset $dst_date-$init_date;
$days floor($offset/60/60/24);
return 
$days;
}


function 
mkage($birthdate) {
$curyear date("Y");
$curmonth date("m");
$curday date("d");
$bdexpl explode("-",$birthdate);
$byear $bdexpl[0];
$bmonth $bdexpl[1];
$bday $bdexpl[2];
$udate date("U");


$inforeturn = array();

if ((
$curmonth == $bmonth) and ($curday == $bday)) {
$dudesage $curyear $byear;
$inforeturn["age"] = $dudesage;
$inforeturn["birthday"] = "now";
}
else {

if (
$bmonth $curmonth) {
$agetype 1// birthday is already gone for this year
}
if ((
$bmonth == $curmonth) and ($bday $curday)) {
$agetype 1;
}
if ((
$bmonth == $curmonth) and ($bday $curday)) {
$agetype 2// birthday is yet to come
}
if (
$bmonth $curmonth) {
$agetype 2;
}
if (
$agetype == 1) {
$dudesage $curyear $byear;
$days how_many_days_left($curyear,$curmonth,$curday,$curyear+1,$bmonth,$bday);
}
elseif (
$agetype == 2) {
$dudesage $curyear $byear 1;
$days how_many_days_left($curyear,$curmonth,$curday,$curyear,$bmonth,$bday);
}
$inforeturn["birthday"] = $days;
$inforeturn["currentage"] = $dudesage;
$inforeturn["become"]= $dudesage+1;
}
return 
$inforeturn;
}


$id $_GET["id"];

if (!
is_valid_id($id))
  
bark("Bad ID $id.");

$r = @mysql_query("SELECT * FROM users WHERE id=$id") or sqlerr();
$user mysql_fetch_array($r) or bark("No user with ID $id.");

if (
$user["ip"] && (get_user_class() >= UC_MODERATOR || $user["id"] == $CURUSER["id"]))
{
  
$ip $user["ip"];
  
/* if (get_user_class() == UC_SYSOP)
  $dom = @gethostbyaddr($user["ip"]); */
  
  
if ($dom == $user["ip"] || @gethostbyname($dom) != $user["ip"])
    
$addr $ip;
  else
  {
    
$domparts explode("."$dom);
    
$domain $domparts[count($domparts) - 2];
    if (
$domain == "COM" || $domain == "CO" || $domain == "NET" || $domain == "NE" || $domain == "ORG" || $domain == "OR" )
      
$l 2;
    else
      
$l 1;
    
$addr "$ip ($dom)";
  }
}
if (
$user[added] == "0000-00-00 00:00:00")
  
$joindate 'N/A';
else
  
$joindate "$user[added] (" get_elapsed_time(sql_timestamp_to_unix_timestamp($user["added"])) . " ago)";

$res mysql_query("SELECT name,flagpic FROM countries WHERE id=$user[country] LIMIT 1") or sqlerr();
if (
mysql_num_rows($res) == 1)
{
  
$arr mysql_fetch_assoc($res);
  
$country "<img src=/pic/flag/$arr[flagpic] alt=\"$arr[name]\" style='margin-left: 8pt'>";
}

/*$res = mysql_query("SELECT name FROM clients WHERE id=$user[client] LIMIT 1") or sqlerr();
if (mysql_num_rows($res) == 1)
{
  $arr = mysql_fetch_assoc($res);
$client = "<td align=left>" . ($arr["name"]) . "</td>";
}*/
$client "<td align=left>" $user["client"] . "</td>";

stdhead("Details for " $user["username"]);

/*$res = mysql_query("SELECT image FROM contacts WHERE id=$user[contacttype] LIMIT 1") or sqlerr();
if (mysql_num_rows($res) == 1)
{
 $arr = mysql_fetch_assoc($res);
 $contacttype = "<img src=pic/$arr[image]>";
}*/
 
$contacttype "<img src=pic/apps.jpg>";

if (
$user["invited_by"] > 0){
$blah mysql_query("SELECT id, username FROM users WHERE id = $user[invited_by]") or sqlerr();
$invite mysql_fetch_assoc($blah);
}

  if (
$user["status"] == 'confirmed')
      
$status "<a href=userdetails.php?id=$user[id]><font color=#1f7309>Confirmed</font></a>";
      else
      
$status "<font color=#ca0226>Pending</font>";


begin_main_frame();
print(
"<table width=100% class=main border=1 cellspacing=0 cellpadding=2>".
"<tr class=tabletitle><td class=embedded><p align=center>$user[username]get_user_icons($usertrue) . "&nbsp;$country</p></tr></table>\n"); ?>
<table width=100% border=1 cellspacing=0 cellpadding=5>
<? 
if ($user[invited_by] > 0)
print(
"<tr class=tableb><td width=15%>Invited By</td><td align=left><a href=userdetails.php?id=$invite[id]>$invite[username]</a></td></tr>\n");
print(
"<tr class=tableb><td width=15%>Status</td><td align=left width=99%>$status</td></tr>\n");
print(
"<tr class=tableb><td width=15%>" JOINDATE "</td><td align=left width=99%>$joindate</td></tr>\n");
if (
get_user_class() >= UC_MODERATOR)
  print(
"<tr class=tableb><td>" EMAIL "</td><td align=left><a href=mailto:$user[email]>$user[email]</a></td></tr>\n");
if (
$addr)
  print(
"<tr class=tableb><td>" IPADDRESS "</td><td align=left>$addr</td></tr>\n");

//////// admins and curuser only ///////

if (get_user_class() >= UC_ADMINISTRATOR || $user["id"] == $CURUSER["id"]){
print(
"<tr class=tableb><td>Max. Torrents</td><td align=left>$user[maxtorrents]</td></tr>\n");

 
 
 
if (
$user['donated'] > && (get_user_class() >= UC_MODERATOR || $CURUSER["id"] == $user["id"]))
print(
"<tr class=tableb><td>" DONATED "</td><td align=left>€ $user[donated]</td></tr>\n");




if (
$user[avatar] == '')
$avatar "<img src=pic/default_avatar.gif width=150>";
elseif (
$user[avatar] == $user[id].".jpg")
$avatar "<img src=Avatars/Gallery/users/$user[avatar] width=150>";
elseif (
$user[gallery] == '1')
$avatar "<img src=Avatars/Gallery/$user[avatar] width=150>";
else
$avatar "<img src=$user[avatar] width=150>";
    print(
"<tr class=tableb><td>" AVATAR "</td><td align=left>$avatar</td></tr>\n");





print(
"<tr class=tableb><td>" GENDER "</td><td align=left>$user[gender]</td></tr>\n");



        
     
/// BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY
        
        
if ($user["birthdate"]) {
        
$bdoutput mkage($user[birthdate]);
        if (
$bdoutput["birthday"] == "now") {
        print(
"<tr class=tableb><td>Birthday</td><td align=left>$user[username] celebrates ");
        if (
$user[gender] == "Female") echo "her "; else echo "his ";
        
$lastdigit strrev($bdoutput["age"]);
        if (
$lastdigit{0} == 1) { $bdayending "st"; }
        elseif (
$lastdigit{0} == 2) { $bdayending "nd"; }
        elseif (
$lastdigit{0} == 3) { $bdayending "rd"; }
        else { 
$bdayending "th"; }
        print 
$bdoutput["age"];
        print 
"$bdayending ";
        print (
"birthday today! Congratulations!</td></tr>\n");

}
else {
        print(
"<tr class=tableb><td>Birthday</td><td align=left>$user[username] is currently $bdoutput[currentage]. But ");
        if (
$user[gender] == "Female") echo "she "; else echo "he ";
        print (
"will become $bdoutput[become] in $bdoutput[birthday] days!</td></tr>\n");
        }

        



}
else {
print (
"<tr class=tableb><td>Birthday</td><td align=left>No birthdate is set for this user. Too bad...</td></tr>\n");
}

     
/// BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY BIRTHDAY





if ($user["client"] > 0)
print(
"<tr class=tableb><td>" BTCLIENT "</td>$client</tr>\n");

if (
$user["website"])
        print(
"<tr class=tableb><td>" WEBSITE "</td><td align=left><a href=$user[website] target=_blank>$user[website]</a></td></tr>\n");
print(
"<tr class=tableb><td>Class</td><td align=left>" get_user_class_name($user["class"]) . "</td></tr>\n");
if (
$CURUSER[id] == $user[id] || get_user_class() >= UC_ADMINISTRATOR)
print(
"<tr class=tableb><td>Invitations</td><td align=left><a href=invite.php?id=$user[id]>$user[invites]</a></td></tr>\n");
else
print(
"<tr class=tableb><td>Invitations</td><td align=left>$user[invites]</td></tr>\n");
if (
$user["contacts"])
print(
"<tr class=tableb><td>Contact</td><td align=left>$contacttype&nbsp;$user[contacts]</td></tr>\n");
if (
$user["title"])
     print(
"<tr class=tableb><td>" TITLE "</td><td align=left>" format_comment($user[title]) . "</td></tr>\n");
if (
$user["info"])
 print(
"<tr valign=top class=tableb><td align=left colspan=2 class=text>" format_comment($user["info"]) . "</td></tr>\n");
print(
"</table>\n");


end_main_frame();
stdfoot();
?>


elvira 13th December 2015 09:59

If you won't change invites in userdetails.php....that you can add a user invites.....do somebody have this mod

\n");
}
then create inviteadd.php and upload to root

Code:

// invite add/remove from users by Alex2005 for TBDEV.NET \\
include('include/bittorrent.php');
dbconn();
loggedinorreturn();

if (get_user_class() < UC_ADMINISTRATOR)
stderr("Error","Access denied!");

if ($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST"){
$class = $_POST['class'];
if(empty($class) && $class != '0')
stderr("Error","Please select a class.");
if(!is_numeric($class))
stderr("Error","Invalid class number.");
$res = mysql_query("SELECT id, invites FROM users WHERE class ".($class == '0' ? ">= '0'" : "= '$class'")." AND enabled = 'yes' AND status = 'confirmed'") or sqlerr(__FILE__, __LINE__);
while ($arr = mysql_fetch_assoc($res)){
$userid = 0+$arr["id"];
$curinvites = 0+$arr['invites'];
$added = sqlesc(get_date_time());
if (!empty($_POST['inviteadd'])){
$toadd = $_POST["inviteadd"];
if (!is_numeric($toadd))
stderr("Error","Invalid invite number.");
mysql_query("UPDATE users SET invites = invites + ".sqlesc($toadd)." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
if (!empty($_POST['sendpm'])){
$subject = sqlesc("Invite(s) added.");
$msg = sqlesc("We have added to your class, ".number_format($toadd)." invite(s).");
mysql_query("INSERT INTO messages (sender, receiver, msg, added, subject) VALUES(0, ".sqlesc($userid).", $msg, $added, $subject)") or sqlerr(__FILE__, __LINE__);
}}elseif (!empty($_POST['inviteremove'])){
$toremove = $_POST["inviteremove"];
if (!is_numeric($toremove))
stderr("Error","Invalid invite number.");
mysql_query("UPDATE users SET invites = ".(($curinvites - $toremove) <= 0 ? "0" : "invites - ".sqlesc($toremove))." WHERE id = ".sqlesc($userid)) or sqlerr(__FILE__, __LINE__);
if (!empty($_POST['sendpm'])){
$subject = sqlesc("Invite(s) removed.");
$msg = sqlesc("We have removed from your class, ".number_format($toremove)." invite(s).");
mysql_query("INSERT INTO messages (sender, receiver, msg, added, subject) VALUES(0, ".sqlesc($userid).", $msg, $added, $subject)") or sqlerr(__FILE__, __LINE__);
}}elseif (!empty($_POST['removeallinvites'])){
if (!empty($_POST['sendpmremoveallinvites'])){
$subject = sqlesc("Invites removed from ".($class == '0' ? "all the classes" : "your class").".");
$msg = sqlesc("We have removed from ".($class == '0' ? "all the classes" : "your class")." the invites.");
mysql_query("INSERT INTO messages (sender, receiver, msg, added, subject) VALUES(0, ".sqlesc($userid).", $msg, $added, $subject)") or sqlerr(__FILE__, __LINE__);
}
mysql_query("UPDATE users SET invites = 0 WHERE class ".($class == '0' ? ">= '0'" : "= '$class'")) or sqlerr(__FILE__, __LINE__);
}else stderr("Error", "Please select something.Go back.");
}}
stdhead("Add Invites");
?>


sharpe1983 13th January 2016 14:34

Quote:

Originally Posted by elvira (Post 48025)
If you won't change invites in userdetails.php....that you can add a user invites.....do somebody have this mod

add this in userdetails.php

Code:

if (get_user_class() > UC_ADMINISTRATOR)
print("
\n");
print("
Invites





Update User's Invites



























Select Class(es):



































All Classes Peasant Users Users Power Users eXtreme Users
VIP's Uploaders Moderators Administrators SysOp

Number of Invites you want to add:
Number of Invites you want to remove:
Send PMs: 

Send PMs: 


       
stdfoot();
?>


alexdinu93 1st March 2017 06:14

Invited bonus upload
 
hello guys, I use this invites mod.
I want to give you 10 GB each member invited another member on the my website.
I tried everything but I could not do it, please if anyone can help me.


All times are GMT +2. The time now is 03:40.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.