Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
  #11  
Old 19th December 2011, 20:09
Bigjoos's Avatar
Bigjoos Bigjoos is offline
U-232 Dev
 
Join Date: May 2008
United Kingdom
Posts: 244
Default
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.
Reply With Quote
The Following User Says Thank You to Bigjoos For This Useful Post:
wdq (20th December 2011)
  #12  
Old 24th December 2011, 08:37
wdq's Avatar
wdq wdq is offline
Senior Member
 
Join Date: Mar 2010
P2P
Posts: 45
Default 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
Reply With Quote
  #13  
Old 24th December 2011, 11:10
Bigjoos's Avatar
Bigjoos Bigjoos is offline
U-232 Dev
 
Join Date: May 2008
United Kingdom
Posts: 244
Default
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.
Reply With Quote
The Following User Says Thank You to Bigjoos For This Useful Post:
wdq (24th December 2011)
  #14  
Old 24th December 2011, 17:55
wdq's Avatar
wdq wdq is offline
Senior Member
 
Join Date: Mar 2010
P2P
Posts: 45
Default 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!

Last edited by wdq; 24th December 2011 at 18:19.
Reply With Quote
  #15  
Old 25th December 2011, 19:50
Bigjoos's Avatar
Bigjoos Bigjoos is offline
U-232 Dev
 
Join Date: May 2008
United Kingdom
Posts: 244
Default
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.
Reply With Quote
  #16  
Old 26th December 2011, 20:21
wdq's Avatar
wdq wdq is offline
Senior Member
 
Join Date: Mar 2010
P2P
Posts: 45
Default 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
Reply With Quote
  #17  
Old 10th October 2015, 15:22
ndbj ndbj is offline
Senior Member
 
Join Date: Dec 2012
Portugal
Posts: 35
Default
Quote:
Originally Posted by rara View Post
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:
<?php

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();
?>
Reply With Quote
  #18  
Old 13th December 2015, 09:59
elvira's Avatar
elvira elvira is offline
Senior Member
 
Join Date: Jan 2008
Slovenia
Posts: 172
Default
If you won't change invites in userdetails.php....that you can add a user invites.....do somebody have this mod
Reply With Quote
  #19  
Old 13th January 2016, 14:34
sharpe1983 sharpe1983 is offline
Member
 
Join Date: Jul 2011
P2P
Posts: 14
Default
Quote:
Originally Posted by elvira View Post
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("<form method=post action=inviteadd.php>\n");
print("<tr><td class=row5>Invites</td><td colspan=2 align=left class=row1><input type=text size=5 name=invites value=\"" . htmlspecialchars($user[invites]) . "\"></tr>\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.<br>Go <a href=/inviteadd.php>back</a>.");
}}
stdhead("Add Invites");
?>
<p>
<table align="center" border=0 class=main cellspacing=0 cellpadding=0>
<tr>
<td class=embedded></td>
<td class=embedded style='padding-left: 10px'><font size=3><b>Update User's Invites</b></font></td>
</tr>
</table>
</p>
<form method="POST" action="inviteadd.php">
<table width="60%" border="0" cellpadding="5" cellspacing="0">
<td colspan="2"><h2><b><center>Select Class(es):</center></b></h2></td>
<tr>
<td colspan="2"><table style="border: 0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td style="border: 0" width="20"><input type="radio" name="class" value="0"><!-- don't change this value --></td>
<td style="border: 0">All Classes</td>

<td style="border: 0" width="20"><input type="radio" name="class" value="<?=UC_PEASANT?>"></td>
<td style="border: 0">Peasant Users</td>

<td style="border: 0" width="20"><input type="radio" name="class" value="<?=UC_USER?>"></td>
<td style="border: 0">Users</td>

<td style="border: 0" width="20"><input type="radio" name="class" value="<?=UC_POWER_USER?>"></td>
<td style="border: 0">Power Users</td>

<td style="border: 0" width="20"><input type="radio" name="class" value="<?=UC_EXTREME_USER?>"></td>
<td style="border: 0">eXtreme Users</td>
</tr>

<tr>
<td style="border: 0" width="20"><input type="radio" name="class" value="<?=UC_VIP?>"></td>
<td style="border: 0">VIP's</td>

<td style="border: 0" width="20"><input type="radio" name="class" value="<?=UC_UPLOADER?>"></td>
<td style="border: 0">Uploaders</td>

<td style="border: 0" width="20"><input type="radio" name="class" value="<?=UC_MODERATOR?>"></td>
<td style="border: 0">Moderators</td>

<td style="border: 0" width="20"><input type="radio" name="class" value="<?=UC_ADMINISTRATOR?>"></td>
<td style="border: 0">Administrators</td>

<td style="border: 0" width="20"><input type="radio" name="class" value="<?=UC_SYSOP?>"></td>
<td style="border: 0">SysOp</td>
</tr>
</table>
</td>
</tr>

<tr>
<td colspan="2" align="center"><b>Number of Invites you want to <u>add</u>:</b><br><input type=text name='inviteadd' size=3></td>
</tr>

<tr>
<td colspan="2" align="center"><b>Number of Invites you want to <u>remove</u>:</b><br><input type=text name='inviteremove' size=3></td>
</tr>

<tr>
<td align=center><input type=submit value="Update" class=button></td>
<td><center><b>Send PMs:</b>&nbsp;<input type="checkbox" name="sendpm"></center></td>
</tr>

<tr>
<td align=center><input type=submit value="Remove all invites" class=button name='removeallinvites'>
<td align="center"><b>Send PMs:</b>&nbsp;<input type="checkbox" name="sendpmremoveallinvites"></td>
</tr>

</td></tr>
</table>
</form>
	
<?
stdfoot();
?>
Reply With Quote
  #20  
Old 1st March 2017, 06:14
alexdinu93 alexdinu93 is offline
Member
 
Join Date: Feb 2017
Posts: 2
Default 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.
Reply With Quote
Reply

Tags
invites , mod

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lockerz.com Invites DrNet Community Cafe 6 24th February 2010 14:41
Any Torrent Invites? 1only Community Cafe 0 20th December 2009 01:57
Reset Invites elvira Mods & Themes 0 30th October 2009 14:35
ICTorrents Invites kooldre Tracker Invites 2 14th March 2009 18:39
Invites in PR7 zerovz Yuna Scatari Edition (YSE) 3 27th January 2009 03:38



All times are GMT +2. The time now is 22:06. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.