Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Torrent Strike
Reply
  #1  
Old 21st February 2009, 17:40
InFeRnO InFeRnO is offline
Senior Member
 
Join Date: Jul 2008
Posts: 29
Default Shoutbox Announce
Hi does anyone know of a way to have the shoutbox display when a user posts in a forum thread or makes a bet in casino or black jack and radio tracks i know its been done but think where to start lol thanx
Reply With Quote
  #2  
Old 21st February 2009, 21:13
wMan wMan is offline
Banned
 
Join Date: Feb 2008
P2P
Posts: 1,433
Default
also some code for cleanup or forums to announce new threads or posts for forums/shoutbox thx

PHP Code:
<?

require_once("include/bittorrent.php");
require_once(
"include/phpbb2Bridge.php");



$res mysql_query("SELECT COUNT(*) FROM users") or sqlerr(__FILE____LINE__);
$arr mysql_fetch_row($res);
if (
$arr[0] >= $maxusers)
    
stderr("Error""Sorry, user limit reached. Please try again later.");

if (!
mkglobal("wantusername:wantpassword:passagain:email:country"))
    die();

function 
bark($msg) {
  
stdhead();
    
stdmsg("Signup failed!"$msg);
  
stdfoot();
  exit;
}

function 
validusername($username)
{
    if (
$username == "")
      return 
false;

    
// The following characters are allowed in user names
    
$allowedchars "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

    for (
$i 0$i strlen($username); ++$i)
      if (
strpos($allowedchars$username[$i]) === false)
        return 
false;

    return 
true;
}

function 
isportopen($port)
{
    
$sd = @fsockopen($_SERVER["REMOTE_ADDR"], $port$errno$errstr1);
    if (
$sd)
    {
        
fclose($sd);
        return 
true;
    }
    else
        return 
false;
}
/*
function isproxy()
{
    $ports = array(80, 88, 1075, 1080, 1180, 1182, 2282, 3128, 3332, 5490, 6588, 7033, 7441, 8000, 8080, 8085, 8090, 8095, 8100, 8105, 8110, 8888, 22788);
    for ($i = 0; $i < count($ports); ++$i)
        if (isportopen($ports[$i])) return true;
    return false;
}
*/
$year $_POST["year"];
$month $_POST["month"];
$day $_POST["day"];
$birthday date("$year.$month.$day");

if (
$year == '0000')
   
bark("Please set your birthday year.");

if (
$month == '00')
   
bark("Please set your birthday month.");

if (
$day == '00')
   
bark("Please set your birthday day.");

if (empty(
$country))
    
bark("You must select a country.");

if (empty(
$wantusername) || empty($wantpassword) || empty($email))
    
bark("Don't leave any fields blank.");

if (
strlen($wantusername) > 12)
    
bark("Sorry, username is too long (max is 12 chars)");

if (
$wantpassword != $passagain)
    
bark("The passwords didn't match! Must've typoed. Try again.");

if (
strlen($wantpassword) < 6)
    
bark("Sorry, password is too short (min is 6 chars)");

if (
strlen($wantpassword) > 40)
    
bark("Sorry, password is too long (max is 40 chars)");

if (
$wantpassword == $wantusername)
    
bark("Sorry, password cannot be same as user name.");

if (!
validemail($email))
    
bark("That doesn't look like a valid email address.");

if(
EmailBanned($email))
    
bark("This email address is banned!");

if (!
validusername($wantusername))
    
bark("Invalid username.");

// make sure user agrees to everything...
if ($_POST["rulesverify"] != "yes" || $_POST["faqverify"] != "yes" || $_POST["ageverify"] != "yes")
    
stderr("Signup failed""Sorry, you're not qualified to become a member of this site.");

// check if email addy is already in use
$a = (@mysql_fetch_row(@mysql_query("select count(*) from users where email='$email'"))) or die(mysql_error());
if (
$a[0] != 0)
  
bark("The e-mail address $email is already in use.");

/*
// do simple proxy check
if (isproxy())
    bark("You appear to be connecting through a proxy server. Your organization or ISP may use a transparent caching HTTP proxy. Please try and access the site on <a href=http://torrentbits.org:81/signup.php>port 81</a> (this should bypass the proxy server). <p><b>Note:</b> if you run an Internet-accessible web server on the local machine you need to shut it down until the sign-up is complete.");
*/

$secret mksecret();
$wantpasshash md5($secret $wantpassword $secret);
$editsecret = (!$arr[0]?""ENA_EMAIL_CONFIRM?mksecret():"");

$ret mysql_query("INSERT INTO users (username, passhash, secret, editsecret, email, birthday, country, status, ". (!$arr[0]?"class, ":"") ."added) VALUES (" .
        
implode(","array_map("sqlesc", array($wantusername$wantpasshash$secret$editsecret$email$birthday$country, (!$arr[0] || !ENA_EMAIL_CONFIRM?'confirmed':'pending')))).
        
", ". (!$arr[0]?UC_SYSOP.", ":""). "'"get_date_time() ."')");

if (!
$ret) {
    if (
mysql_errno() == 1062)
        
bark("Username already exists!");
    
bark("borked");
}

$id mysql_insert_id();

//write_log("User account $id ($wantusername) was created");

$psecret md5($editsecret);

$body = <<<EOD
You have requested a new user account on $SITENAME and you have
specified this address (
$email) as user contact.

If you did not do this, please ignore this email. The person who entered your
email address had the IP address 
{$_SERVER["REMOTE_ADDR"]}. Please do not reply.

To confirm your user registration, you have to follow this link:

$DEFAULTBASEURL/confirm.php?id=$id&secret=$psecret

After you do this, you will be able to use your new account. If you fail to
do this, you account will be deleted within a few days. We urge you to read
the RULES and FAQ before you start using torrentbits.
EOD;


if (!
$arr[0]) //sysop
{
    
logincookie($id$wantpasshash);
    
header("Refresh: 0; url=ok.php?type=sysop");
    die();
}

insert_phpBB2user($wantusernamemd5($wantpassword), $id$email0);

if (
ENA_EMAIL_CONFIRM)
{
  
mail($email"$SITENAME user registration confirmation"$body"From: $SITEEMAIL""-f$SITEEMAIL");
}
else
{
      
logincookie($id$wantpasshash);
      
activate_and_login_phpBB2user($wantusername);
}

header("Refresh: 0; url=ok.php?type=". (!$arr[0]?"sysop"ENA_EMAIL_CONFIRM ? ("signup&email=" urlencode($email)):"confirm"));

$text ":hi: [color=green]TO OUR NEWEST MEMBER[/color]".htmlspecialchars($wantusername)." WE HOPE YOU ENJOY YOUR STAY";
$userid 12;
$username SYSTEM;
//$date=time();
$date=time()-3600;
mysql_query("INSERT INTO shoutbox (id, userid, username, date, text) VALUES ('id'," sqlesc($userid) . ", " sqlesc($username) . ", $date, " sqlesc($text) . ")") or sqlerr(__FILE____LINE__);
 
$added sqlesc(get_date_time());
header("Refresh: 0; url=ok.php?type=". (!$arr[0]?"sysop"ENA_EMAIL_CONFIRM ? ("signup&email=" urlencode($email)):"confirm"));
?>
on line 175
take this takesignup and make new user call it SYSTEM and put id in
Reply With Quote
  #3  
Old 29th November 2012, 00:33
robbie's Avatar
robbie robbie is offline
Member
 
Join Date: Nov 2012
United Kingdom
Posts: 6
Default
Quote:
Originally Posted by InFeRnO View Post
Hi does anyone know of a way to have the shoutbox display when a user posts in a forum thread or makes a bet in casino or black jack and radio tracks i know its been done but think where to start lol thanx
this is what ya after...

PHP Code:
$message "".$CURUSER['username']." Replied To The Thread [URL="http://$BASEURL/forums.php?action=viewtopic&topicid=$topicid&page=p$postid#$postid"]".$subject."[/URL]";

  
if (in_array($forumid,$staffforum))
  
//if (in_array($forumid))
  
{
  echo 
"";
  } else {
  
autoshout($message);
  }



  
//$message = "".$CURUSER['username']." Started A New Thread [URL="http://$BASEURL/forums.php?action=viewtopic&topicid=$topicid&page=p$postid#$postid"]".$subject."[/URL]";
  
if (in_array($forumid,$staffforum))
  
//if (in_array($forumid))
  
{
  echo 
"";
  } else {
  
autoshout($message);
  } 

Last edited by joeroberts; 29th November 2012 at 13:36. Reason: Please use code tags!
Reply With Quote
Reply

Tags
announce , shoutbox

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
IRC Announce azza2102 Torrent Strike 2 26th February 2013 14:15
[FTS 1.1] Announce new forum topics on shoutbox benjaminbih Mods & Themes 2 31st December 2009 22:14
Forum announce in shoutbox lanks Torrent Strike 3 15th August 2009 20:56
[HELP] Change /announce.php to /announce dopeboy xBTiT 4 20th July 2009 01:42
Announce murda Torrent Strike 6 27th July 2008 13:39



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