"shadows, post: 66838, member: 20311":
It works for me. Can anyone confirm does this scrape http/https as well trackers?
$result = mysqli_num_rows($query);
if($result == 0) {
echo T_("NO_ACTIVE_PEERS")."\n";
}else{
?>
<table border="0" cellpadding="3" cellspacing="0" width="100%" class="table_table">
<tr>
<th class="table_head"><?php echo T_("PORT"); ?></th>
<th class="table_head"><?php echo T_("UPLOADED"); ?></th>
<th class="table_head"><?php echo T_("DOWNLOADED"); ?></th>
<th class="table_head"><?php echo T_("RATIO"); ?></th>
<th class="table_head"><?php echo T_("_LEFT_"); ?></th>
<th class="table_head"><?php echo T_("FINISHED_SHORT"). "%"; ?></th>
<th class="table_head"><?php echo T_("SEED"); ?></th>
<th class="table_head"><?php echo T_("CONNECTED_SHORT"); ?></th>
<th class="table_head"><?php echo T_("CLIENT"); ?></th>
<th class="table_head"><?php echo T_("USER_SHORT"); ?></th>
</tr>
?>
$result = mysqli_num_rows($query);
if($result == 0) {
echo T_("NO_ACTIVE_PEERS")."\n";
}else{
?>
<table border="0" cellpadding="3" cellspacing="0" width="100%" class="table_table">
<tr>
<th class="table_head"><?php echo T_("PORT"); ?></th>
<th class="table_head"><?php echo T_("UPLOADED"); ?></th>
<th class="table_head"><?php echo T_("DOWNLOADED"); ?></th>
<th class="table_head"><?php echo T_("RATIO"); ?></th>
<th class="table_head"><?php echo T_("_LEFT_"); ?></th>
<th class="table_head"><?php echo T_("FINISHED_SHORT"). "%"; ?></th>
<th class="table_head"><?php echo T_("SEED"); ?></th>
<th class="table_head"><?php echo T_("CONNECTED_SHORT"); ?></th>
<th class="table_head"><?php echo T_("CLIENT"); ?></th>
<th class="table_head"><?php echo T_("USER_SHORT"); ?></th>
</tr>
<script language="JavaScript">
//--| Configure refresh interval (in seconds)
<?php
if ($count)
echo "var countDownInterval = 6;";
else
echo "var countDownInterval = 600;"; // No torrents to scrape, refresh in 10 minutes
?>
//--| Configure width of displayed text, in px (applicable only in NS4)
var c_reloadwidth=200
</script>
<ilayer id="c_reload" width=&{c_reloadwidth}; ><layer id="c_reload2" width=&{c_reloadwidth}; left=0 top=0></layer></ilayer>
<script>
var countDownTime=countDownInterval+1;
function countDown(){
countDownTime--;
if (countDownTime <=0){
countDownTime=countDownInterval;
clearTimeout(counter)
window.location.reload()
return
}
if (document.all) //if IE 4+
document.all.countDownText.innerText = countDownTime+" ";
else if (document.getElementById) //--| else if NS6+
document.getElementById("countDownText").innerHTML=countDownTime+" "
else if (document.layers){ //--| CHANGE TEXT BELOW TO YOUR OWN
document.c_reload.document.c_reload2.document.write('Next <a href="java script:window.location.reload()">rafraîchir</a> dans <b id="countDownText">'+countDownTime+' </b> seconds')
document.c_reload.document.c_reload2.document.close()
}
counter=setTimeout("countDown()", 1000);
}
function startit(){
if (document.all||document.getElementById) //--| CHANGE TEXT BELOW TO YOUR OWN
document.write('Suivant <a href="javascript:window.location.reload()">rafraîchir</a> dans <b id="countDownText">'+countDownTime+' </b> seconds')
countDown()
}
if (document.all||document.getElementById)
startit()
else
window.onload=startit
</script>
<?php
function show_error_msg($title, $message, $wrapper = "1") {
if ($wrapper) {
ob_start();
ob_clean();
stdhead($title);
}
begin_frame("<font class='error'>". htmlspecialchars($title) ."</font>");
print("<center><b>" . $message . "</b></center>\n");
end_frame();
if ($wrapper){
stdfoot();
die();
}
}
// Erreur Block by spiritblue
function block_error_msg($title, $message, $wrapper = "1") {
if ($wrapper) {
ob_start();
ob_clean();
stdhead($title);
}
begin_error_block("<font class='error'>". htmlspecialchars($title) ."</font>");
print("<center><b>" . $message . "</b></center>\n");
end_error_block();
if ($wrapper){
stdfoot();
die();
}
}
// Erreur frame
function show_error_msg($title, $message, $wrapper = "1") {
if ($wrapper) {
ob_start();
ob_clean();
stdhead($title);
}
begin_error("<font class='error'>". htmlspecialchars($title) ."</font>");
print("<center><b>" . $message . "</b></center>\n");
end_error();
if ($wrapper){
stdfoot();
die();
}
}
show_error_msgblock_error_msg
//Update topic last post
update_topic_last_post($topicid);
//Update topic last post
update_topic_last_post($topicid);
$debut ="[url=".$site_config['SITEURL']."/forums.php?action=viewtopic&topicid=".$topicid."&page=last]";
$fin = "[/url]New Post on the Forum :[url=".$site_config['SITEURL']."/forums.php?action=viewtopic&topicid=".$topicid."]here " .$subjectp. "to see the subject [/url] which was published by [url=".$site_config['SITEURL']."/account-details.php?id=".$CURUSER['id']."]" .$CURUSER['username']. "[/url]";
$post_text = sqlesc($debut." ".$_POST["subject"]." ".$fin);
SQL_Query_exec("INSERT INTO ajshoutbox(uid, date, name, text) VALUES('0', '".get_date_time()."', 'System',".$post_text.")");
input[type=radio] {
}
input[type=radio]:hover{
}
/* Action ratio Off/On by spiritblue*/
input[type="radio"] {
background-color: #ddd;
background-image: -webkit-linear-gradient(0deg, transparent 20%, hsla(0,0%,100%,.7), transparent 80%),
-webkit-linear-gradient(90deg, transparent 20%, hsla(0,0%,100%,.7), transparent 80%);
border-radius: 10px;
box-shadow: inset 0 1px 1px hsla(0,0%,100%,.8),
0 0 0 1px hsla(0,0%,0%,.6),
0 2px 3px hsla(0,0%,0%,.6),
0 4px 3px hsla(0,0%,0%,.4),
0 6px 6px hsla(0,0%,0%,.2),
0 10px 6px hsla(0,0%,0%,.2);
cursor: pointer;
display: inline-block;
height: 15px;
margin-right: 15px;
position: relative;
width: 15px;
-webkit-appearance: none;
}
input[type="radio"]:after {
background-color: #444;
border-radius: 25px;
box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.4),
0 1px 1px hsla(0,0%,100%,.8);
content: '';
display: block;
height: 7px;
left: 4px;
position: relative;
top: 4px;
width: 7px;
}
input[type="radio"]:checked:after {
background-color: #f66;
box-shadow: inset 0 0 0 1px hsla(0,0%,0%,.4),
inset 0 2px 2px hsla(0,0%,100%,.4),
0 1px 1px hsla(0,0%,100%,.8),
0 0 2px 2px hsla(0,70%,70%,.4);
}
"m-jay, post: 66743, member: 20288":
Did you fix this spirtblue, for white page i do this, this helps to show whats wrong. For forums add to top of forums.php etc
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
this code is for testing, do not keep it on live site
"MicroMonkey, post: 66740, member: 311":
hmm, did you install this first? https://www.torrenttrader.xyz/index.php?threads/sticky-torrents-ttv3.9800/#post-66657
I actually installed this backwards by installing this mod first then I went back and installed the other one with the SQL edits and tested it and it appears to work fine. I am testing on TTv3
"MicroMonkey, post: 66723, member: 311":
I cant duplicate your problem. Worked perfectly when I tested it just now.
$sql = "SELECT c.* FROM ajshoutbox c left join users u on c.uid=u.id left join groups g on g.group_id=u.class WHERE c.id > ".$lastID." ORDER BY c.id DESC LIMIT 10";
// Online in Offline by spiritblue
$query = SQL_Query_exec("SELECT `id`, `class`, `username`, `last_access` FROM `users` WHERE enabled = 'yes' AND status = 'confirmed' AND privacy !='strong' AND UNIX_TIMESTAMP('".get_date_time()."') - UNIX_TIMESTAMP(users.last_access) <= 900");
// For class
#$datetime = get_date_time(gmtime() - 180);
#$query = SQL_Query_exec("SELECT `id`, `class`, `username`, `last_access` FROM `users` WHERE `class` >= 2 AND `enabled` = 'yes' AND `status` = 'confirmed'");
echo "<font color='AliceBlue'>En Ligne ➣</gfont>";
while ($row = mysqli_fetch_array($query)){
echo "<span id='online'><a href=account-details.php?id=".$row["id"]."'><b>".$row["username"]."</b><img src='images/button_o".($row["last_access"] > $datetime ? "n":"ff")."line.png' border='0' /></a> </span>";
}
//End Online in Offline
"MicroMonkey, post: 66658, member: 311":
"spiritblue, post: 66702, member: 401":
hi
for all that staff can not edit or delete messages? ?
Thank you for this shout ;)
if ($CURUSER['id'] == $row['uid'] ) {
$mid=$row['id'];
if ($CURUSER["edit_users"]=="yes") {
$edit="<a href='javascript:editup($mid,$CURUSER[id]);' style='font-size: 8px'><img id='EditSwap' src='images/ajshoutbox/shout_edit_gray.gif' border='0' title=".T_("EDIT")."\n></a><a href='javascript:delup($mid);' style='font-size: 8px'><img id='DeleteSwap' src='images/ajshoutbox/shout_delete_gray.png' border='0' title=".T_("_DEL_")."\n></a>";
}
}else
if ($CURUSER['id']) {
$edit="<a href='mailbox.php?compose&id=$uid'><img src='images/ajshoutbox/pm.png' border='0' width='22' height='22' title='Send a private message' alt='Send a private message'></a><a href=javascript:Reply_code('➤".$row['name'].":','chatForm','chatbarText')><img src='images/ajshoutbox/reply.png' border='0' width='22' height='22' style='padding: 0px 0px 0px 3px;' title='Reply to this shout' alt='Reply to this shout'\n></a>";
}
[/color]
if ( ($CURUSER["edit_users"]=="yes") || ($CURUSER['id'] == $row['uid']) ){
$mid=$row['id'];
$edit="<a href='javascript:editup($mid,$CURUSER[id]);' style='font-size: 8px'><img id='EditSwap' src='images/ajshoutbox/shout_edit_gray.gif' border='0' title=".T_("EDIT")."\n></a><a href='javascript:delup($mid);' style='font-size: 8px'><img id='DeleteSwap' src='images/ajshoutbox/shout_delete_gray.png' border='0' title=".T_("_DEL_")."\n></a>";
}else
if ($CURUSER['id']) {
$edit="<a href='mailbox.php?compose&id=$uid'><img src='images/ajshoutbox/pm.png' border='0' width='22' height='22' title='Send a private message' alt='Send a private message'></a><a href=javascript:Reply_code('➤".$row['name'].":','chatForm','chatbarText')><img src='images/ajshoutbox/reply.png' border='0' width='22' height='22' style='padding: 0px 0px 0px 3px;' title='Reply to this shout' alt='Reply to this shout'\n></a>";
}
"m-jay, post: 66368, member: 20288":
Updated for V3 credit to original author.
Ive put in progress because i dont use this and havent tested
[color=rgb(251, 160, 38)]SQL[/color]
CREATE TABLE IF NOT EXISTS `ajshoutbox` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
`uid` mediumint(9) NOT NULL,
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`name` tinytext NOT NULL,
`text` text NOT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM;
[color=rgb(251, 160, 38)]In each theme.css[/color]
#chat {
overflow: auto;
width: 100%;
height: 450px;
padding: 0px;
}
#chatoutput ul {
list-style: none;
margin:0px;
padding:0px;
font-size: 10pt;
padding:5px 4px 6px 5px;
}
div.chatoutput {
/*background:#465151;#323232;*/
background:#A8A8A8;
padding:5px 0px 3px 10px;
margin:0px;
color:#000000;
line-height: 150%;
margin-bottom:2px;
border-radius: 5px;
}
div.loader {
background-image: url('images/ajshoutbox/random.php');
background-repeat: no-repeat;
background-position:center center;
width:199px;
height:137px;
}
#chatoutput ul li {
}
#chatoutput ul li span.name {
display: block;
background:url(images/ajshoutbox/bubble.png) no-repeat left;
padding-left:19px;
margin-bottom:1px;
font-weight: normal;
color:#000000;
}
#chatoutput ul li:hover span.name {
background:url(images/ajshoutbox/bubblehover.png) no-repeat left;
}
form {
padding:0px;
margin:0px;
}
#chatoutput {
text-align: left;
margin-right: 0px;
color: #999;
}
/* swaps edit and delete images on mouse over */
#EditSwap {
width:0px;
height:0px;
background:url(images/ajshoutbox/shout_edit_gray.gif) no-repeat bottom;
padding:10px;
}
#EditSwap:hover {
background:url(images/ajshoutbox/shout_edit.png) no-repeat bottom;
}
#DeleteSwap {
width:0px;
height:0px;
background:url(images/ajshoutbox/shout_delete_gray.gif) no-repeat bottom;
padding:10px;
}
#DeleteSwap:hover {
background:url(images/ajshoutbox/shout_delete.png) no-repeat bottom;
}
/* end of swaping */
img.form {
background:url(images/ajshoutbox/frame.png) no-repeat;
}
img.form:hover {
background:url(images/ajshoutbox/frame_hover.png) no-repeat;
}
#chatcornerup {
width:50%;
padding: 10px;
background-color: #E2E2E2;
border:1px solid #777;
border-bottom-style:none;
border-top-right-radius: 2em;
border-top-left-radius: 2em;
}
#chatcornerdown {
width:65%;
padding: 10px;
background-color: #E2E2E2;
border:1px solid #777;
border-bottom-style:none;
border-top-right-radius: 2em;
border-top-left-radius: 2em;
}
.marquee {
width: 650px;
margin: 0 auto;
white-space: nowrap;
overflow: hidden;
box-sizing: border-box;
}
.marquee span {
display: inline-block;
padding-left: 100%; /* show the marquee just outside the paragraph */
animation: marquee 15s linear infinite;
}
.marquee span:hover {
animation-play-state: paused
}
/* Make it move */
@keyframes marquee {
0% { transform: translate(0, 0); }
100% { transform: translate(-100%, 0); }
}
[color=rgb(251, 160, 38)]Replace shoutbox code on index.php with[/color]
//AJAX SHOUTBOX/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if ($site_config['SHOUTBOX'] && !($CURUSER['hideshoutbox'] == 'yes')){
require_once("backend/smilies.php");
require_once("shoutfun_new.php");
begin_frame("".$site_config['SITENAME']." Shoutbox");
function smile() {
print "<div align='center'><table cellpadding='3' cellspacing='3'><tr>";
global $smilies, $count;
reset($smilies);
while ((list($code, $url) = thisEach($smilies)) && $count<16) {
print("\n<td><a href=\"javascript: SmileIT('".str_replace("'","\'",$code)."')\">
<img border=\"0\" src=\"images/smilies/$url\" alt=\"$code\" /></a></td>");
$count++;
}
print '<br /><td> <a href="javascript:show_hide(\'sextra\');"><img src=./images/ajshoutbox/down.gif title=more border=0></a></td></tr></table></div>';
}
function smileextra() {
global $smilies;
reset($smilies);
# getting smilies
while (list($code, $url) = thisEach($smilies)) {
print("\n<a href=\"javascript: SmileIT('".str_replace("'","\'",$code)."')\">
<img border=\"0\" src=\"images/smilies/$url\" alt=\"$code\" /></a>");
// $count++;
}
}
?>
<script src="js/ajshoutbox.js" language="Javascript" type="text/javascript"></script>
<br />
<table align=center class=ajshoutboxbackground width=98%><tr>
<td align=center>
<div align='center'><b><font color=green>Member</font> | <font color=brown>Power User</font> | <font color=dimgray>VIP</font> | <font color=purple>Uploader</font> |<font color=pink>Moderator</font> | <font color=#009AFF>Super Moderator</font> | <font color=red>Administrator</font>| <font color=#00ffbf>Site Owner</font></b></br></br>
<p class="microsoft marquee"><span><?php echo "".T_("SHOUTINFO").""; ?></span></p></div></div>
<div id="shoutheader">
<form id="chatForm" name="chatForm" onsubmit="return false;" action="">
<input type="hidden" name="name" id="name" value="<?php echo $CURUSER["username"] ?>" />
<input type="hidden" name="uid" id="uid" value="<?php echo $CURUSER["id"] ?>" />
<table align=center width=98%><tr>
<td align=center>
<div align=center><?php echo smile();?></div><br />
<input type="text" size="105" maxlength="500" placeholder=<?php echo"'".T_('SHOUT_HERE')."'" ;?> name="chatbarText" id="chatbarText" onblur="checkStatus('');" onfocus="checkStatus('active');" />
<input onclick="sendComment();" type="submit" id="submit" name="submit" value="Confirm" />
<a href="javascript: PopMoreSmiles('chatForm','chatbarText');">
<img src="images/ajshoutbox/smile.gif" border="0" class="form" title="smilies" align="top" alt="" /></a>
<a href="javascript: Pophistory()">
<img src="images/ajshoutbox/quote.gif" width="24" height="24" border="0" class="form" title="History/Moderate" align="top" alt="" /><b><font color = red><--View old shouts or edit shouts</font></b></a>
<br /><br />
<div style="display: none;" id="sextra"><?php echo shoutfun('chatForm','chatbarText');?></div><div style="display: none;" id="sextra1"><br><?php echo smileextra();?></div>
<br />
</td>
</tr>
</table><br />
</form>
</div>
<div id="chat">
<div id="chatoutput">
<ul id="outputList">
<li>
<span class="name"><b><?php echo $site_config['SITENAME'];?> Shoutbox:</b></span><h2 style='padding-left:20px;'>WELCOME</h2>
<center><div class="loader"></div></center>
</li>
</ul>
</div>
</div>
</td>
</tr>
</table><br /><br />
<!--<script language="Javascript">
$(".toggle").on("click", function () {
$(".marquee").toggleClass("microsoft");
})
</script>-->
<script language="Javascript">
function show_hide(sextra)
{
if(document.getElementById(sextra))
{
if(document.getElementById(sextra).style.display == 'none')
{
document.getElementById(sextra).style.display = 'inline';
}
else
{
document.getElementById(sextra).style.display = 'none';
}
}
}
function show_hide(sextra1)
{
if(document.getElementById(sextra1))
{
if(document.getElementById(sextra1).style.display == 'none')
{
document.getElementById(sextra1).style.display = 'inline';
}
else
{
document.getElementById(sextra1).style.display = 'none';
}
}
}
</script>
</center>
<?php
end_frame();
}
//END_AJAX_SHOUTBOX////////////////////////////////////////////////////////////////////////////////////////////////////////
[color=rgb(251, 160, 38)]In english.php add[/color]
//ajax chat
$LANG["SHOUT_HERE"] = "Shout Here";
$LANG["STAFF_SHOUT"] = "Staff Shout";
$LANG["SHOUTINFO"] = "<b><u>Shoutbox Rules</u></b>: English Only, <font color='red'>No</font> <i>Swearing, Personal Attacks, Abuse,</i> or <i>Spamming</i> and <font color='red'>No</font> <i>Publishing Serials, or Cracks</i> ETC. <img src=images/smilies/razz.png>";
Add contents of root folder to root
to clear shoutbox, in functions.php in format_comment find
return $s;
}
add
global $CURUSER;
$is_mod=$CURUSER["control_panel"]=='yes';
if ((preg_match_all ('' . '#^/clean(.*)$#', $s, $Matches, PREG_SET_ORDER) AND $is_mod))
{
return execcommand_clean ($Matches);
}elseif ((preg_match_all ('' . '#^/clean(.*)$#', $s, $Matches, PREG_SET_ORDER) AND !$is_mod))
{return execcommand_noclean($Matches);}
// MESSAGE TO THE AJSHOUTBOX FOR A NEW TORRENT by @spiritblue
$image = $inames[0];
$msg_shout = sqlesc("[img]".$site_config["SITEURL"]."/images/torrents/NewTorrent.png[/img]\n[url=".$site_config['SITEURL']."/torrents-details.php?id=".$id."]".$torrent."[/url]\r[img1]".$site_config["SITEURL"]."/uploads/images/".$image."[/img1]\nPartagé ".($anon == 'no' ? "Par [url=".$site_config['SITEURL']."/account-details.php?id=".$CURUSER['id']."]" .$CURUSER['username']. "[/url]" : "")."");
SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES(0,NOW(), 'System' ,".$msg_shout.")");
// MESSAGE TO THE SHOUTBOX FOR A NEW TORRENT by @spiritblue
$image = $inames[0];
$msg_shout = sqlesc("[img]".$site_config["SITEURL"]."/images/torrents/NewTorrent.png[/img]\n[url=".$site_config['SITEURL']."/torrents-details.php?id=".$id."]".$torrent."[/url]\r[img1]".$site_config["SITEURL"]."/uploads/images/".$image."[/img1]\nPartagé ".($anon == 'no' ? "Par [url=".$site_config['SITEURL']."/account-details.php?id=".$CURUSER['id']."]" .$CURUSER['username']. "[/url]" : "")."");
SQL_Query_exec("INSERT INTO shoutbox (userid, date, user, message) VALUES(0,NOW(), 'System' ,".$msg_shout.")");
/* Announcing New Torrent On Sharing At The Chat Room (In Pictures) From The Beacon > img1 */
.img1-shout{
width:160px; height:230px;
background-color: transparent; /* Fond de couleur */
border: 2px double #F0F8FF;
border-radius: 8px 8px 8px 8px;
box-shadow: 0px 0px 15px 0px #60C1D0; /* intensiter de dégrader de la couleur des 4 faces + couleur */
-moz-border-bottom-colors: #60C1D0 #777777 #2090FF #E9ED74 #E3E934 #2090FF #1771C0; /* dégrader de couleur des 4 faces */
-moz-border-top-colors: #60C1D0 #777777 #2090FF #E9ED74 #E3E934 #2090FF #1771C0;
-moz-border-left-colors: #60C1D0 #777777 #2090FF #E9ED74 #E3E934 #2090FF #1771C0;
}
"m-jay, post: 66697, member: 20288":
I do not use the ajax shout box but the issue will be the sql query try replace
INSERT INTO shoutbox (userid, date, user, message)
with
INSERT INTO ajshoutbox (uid, date, name, text)
style='vertical-align: middle;'
"m-jay, post: 66295, member: 20288":
Updated for V3 credit to Original Author
shoutbox post new members
in account-signup.php find
$signupclass = '2';
after add
$msg_shout = sqlesc("New User: ".$wantusername." has joined.");
SQL_Query_exec("INSERT INTO shoutbox (userid, date, user, message) VALUES(0,NOW(), 'System' ,".$msg_shout.")");
shoutbox post new torrent
in torrents-upload.php.php find
write_log( sprintf(T_("TORRENT_UPLOADED"), htmlspecialchars($name), $CURUSER["username"]) );
add after
$msg_shout = sqlesc("New Torrent: [url=".$site_config['SITEURL']."/torrents-details.php?id=".$id."]".$torrent."[/url] has been uploaded ".($anon == 'no' ? "by [url=".$site_config['SITEURL']."/account-details.php?id=".$CURUSER['id']."]" .$CURUSER['username']. "[/url]" : "")."");
SQL_Query_exec("INSERT INTO shoutbox (userid, date, user, message) VALUES(0,NOW(), 'System' ,".$msg_shout.")");