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
Auto Shoutbox Announce 2.06
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2012-01-15 01:28:33
All Credits go to djhowarth (Mostvotedplaya) for making the mod.

CREATE TABLE IF NOT EXISTS `shoutannounce` (

`id` int(10) unsigned NOT NULL AUTO_INCREMENT,

`title` varchar(100) NOT NULL DEFAULT '',

`descr` text NOT NULL,

`added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

`active` enum('yes','no') NOT NULL DEFAULT 'yes',

`time` int(11) unsigned NOT NULL DEFAULT '0',

`last_time` int(11) unsigned NOT NULL DEFAULT '0',

PRIMARY KEY (`id`)

) ENGINE=MyISAM AUTO_INCREMENT=1;









Make new link in admincp.php for navigation





<td align="center"><a href="admincp.php?action=shoutannounce"><img src="images/admin/blocked.gif" border="0" width="32" height="32"><br />Shoutbox Announce<br /></a></td>





Now add the code below to bottom of admincp.php





if ($action == "shoutannounce")

{

 if (@count($_POST['id'])) {



 foreach ($_POST['id'] as $id) {

 mysql_query("DELETE FROM `shoutannounce` WHERE `id` = $id");

 }



 show_error_msg("Success", "Announcement Removed.", 1);

 }



 stdhead("Shoutbox Announce");

 navmenu();



 begin_frame("Shoutbox Announce");



 echo("<center>[<a href='admincp.php?action=shoutannouncecreate'>Create Announcement</a>]</center><br />");



 $sql = mysql_query("SELECT * FROM `shoutannounce` ORDER BY `id` DESC");



 if (mysql_num_rows($sql) > 0)

 {  

 echo("<form method='post' action='admincp.php?action=shoutannounce'>");

 echo("<table border='0' cellpadding='5' cellspacing='3' align='center' width='100%' class='ttable_headinner'>");

 echo("<tr>");

 echo("<td class='ttable_head'><strong>Title</strong></td>");

 echo("<td class='ttable_head'><strong>Message</strong></td>");

 echo("<td class='ttable_head'><strong>Added</strong></td>");

 echo("<td class='ttable_head'><strong>Run at</strong></td>");

 echo("<td class='ttable_head'><strong>Last Run</strong></td>");

 echo("<td class='ttable_head'><strong>Enabled</strong></td>");

 echo("<td class='ttable_head'><strong>Delete</strong></td>");

 echo("</tr>");



 while ($row = mysql_fetch_array($sql))

 {

 echo("<tr>");

 echo("<td class='ttable_col1' align='center'><a href='admincp.php?action=shouteditannounce&id=" . $row['id'] . "'>" . htmlspecialchars($row['title']) . "</a></td>");

 echo("<td class='ttable_col2' align='center'>" . format_comment($row['descr']) . "</td>");

 echo("<td class='ttable_col1' align='center'>" . utc_to_tz($row['added']) . "</td>");

 echo("<td class='ttable_col1' align='center'>" . $row['time'] . "</td>");  

 echo("<td class='ttable_col2' align='center'>" . utc_to_tz(date('Y-m-d H:i:s', $row['last_time'])) . "</td>");  

 echo("<td class='ttable_col1' align='center'>" . htmlspecialchars($row['active']) . "</td>");  

 echo("<td class='ttable_col2' align='center'><input type='checkbox' name='id[]' value='".$row['id']."'/></td>");

 echo("</tr>");

 }



 echo("</table>");

 echo("<div align='right'><input type='submit' value='Remove'/></div>");

 echo("</form>");

 }

 else {

 echo("<center>No Current announcements.</center>");

 }



 end_frame();

 stdfoot();

}



if ($action == "shoutannouncecreate")

{

 if ($_SERVER['REQUEST_METHOD'] == 'POST')

 {

 if (empty($_POST['title']) || empty($_POST['descr']) || !is_valid_id($_POST['time']))

 show_error_msg("Error", "Form not completed. <a href='admincp.php?action=shoutannouncecreate'>return</a>?", 1);



mysql_query("INSERT INTO `shoutannounce` (`title`, `descr`, `added`, `time`) VALUES (" . sqlesc($_POST['title']) . ", " . sqlesc($_POST['descr']) . ", " . sqlesc(get_date_time()) . ", " . sqlesc($_POST['time']) . ")");



 show_error_msg("Success", "Announcement Created. <a href='admincp.php?action=shoutannounce'>return</a>?", 1);

 }



 stdhead("Create New Announcement");

 navmenu();



 begin_frame("Create New Announcement");



 echo("<form name='shoutannouncecreate' method='post' action='admincp.php?action=shoutannouncecreate'>");

 echo("<table border='0' cellpadding='5' cellspacing='0' align='center'>");

 echo("<tr>");

 echo("<td><strong>Title:</strong></td>");

 echo("<td><input type='text' name='title' size='30' /></td>");

 echo("</tr>");

 echo("<tr>");

 echo("<td><strong>Time:</strong></td>");

 echo("<td><select name='time'><option value='1800'>30 Mins</option><option value='3600'>1 Hour</option></select></td>");

 echo("</tr>");

 echo("</table>");



 require_once("backend/bbcode.php");

 echo(textbbcode("shoutannouncecreate","descr","$descr"));



 echo("<input type='reset' value='Reset' /><input type='submit' value='Submit' />");

 echo("</form>");



 end_frame();

 stdfoot();

}



if ($action == 'shouteditannounce')

{

 $id = isset($_GET['id']) ? $_GET['id'] : '';



 if (!is_valid_id($id))

  show_error_msg("Error", "Thats an Invalid ID O_o", 1);

 

 $sql = mysql_query("SELECT * FROM `shoutannounce` WHERE `id` = $id");

 $row = mysql_fetch_array($sql);



 if (!$row)

  show_error_msg("Error", "Invalid ID.", 1);



 if ($_SERVER["REQUEST_METHOD"] == "POST")

 {

 if (empty($_POST['title']) || empty($_POST['descr']) || !is_valid_id($_POST['time']))

 show_error_msg("Error", "Form not completed. <a href='admincp.php?action=shouteditannounce&id=$id'>return</a>?", 1);



 mysql_query("UPDATE `shoutannounce` SET `title` = " . sqlesc($_POST['title']) . ", `descr` = " . sqlesc($_POST['descr']) . ", `time` = " . sqlesc($_POST['time']) . ", `active` = " . sqlesc($_POST['active']) . " WHERE `id` = $id");

 show_error_msg("Success", "Announcement edited. <a href='admincp.php?action=shoutannounce'>return</a>?", 1);

}



 stdhead("Edit Announcement");

 navmenu();



 begin_frame("Edit Announcement");



 echo("<form name='shouteditcreate' method='post' action='admincp.php?action=shouteditannounce&id=$id'>");

 echo("<table border='0' cellpadding='5' cellspacing='0' align='center'>");

 echo("<tr>");

 echo("<td><strong>Title:</strong></td>");

 echo("<td><input type='text' name='title' size='30' value='" . htmlspecialchars($row['title']) . "' /></td>");

 echo("</tr>");

 echo("<tr>");

 echo("<td><strong>Time:</strong></td>");

 echo("<td><select name='time'><option value='1800' " . ($row['time'] == '1800' ? 'selected="selected"' : '' ). ">30 Mins</option><option value='3600' " . ($row['time'] == '3600' ? 'selected="selected"' : ''). ">1 Hour</option></select></td>");

 echo("</tr>");

 echo("<tr>");

 echo("<td><strong>Enabled:</strong></td>");

 echo("<td><select name='active'><option value='yes' " . ($row['active'] == 'yes' ? 'selected="selected"' : '' ). ">Yes</option><option value='no' " . ($row['active'] == 'no' ? 'selected="selected"' : ''). ">No</option></select></td>");

 echo("</tr>");

 echo("</table>");



 require_once("backend/bbcode.php");

 echo(textbbcode("shouteditcreate","descr", $row['descr']));



 echo("<input type='reset' value='Reset' /><input type='submit' value='Submit' />");

 echo("</form>");



 end_frame();

 stdfoot();

}







Open backend/cleanup.php FIND





mysql_query("OPTIMIZE TABLE `peers` , `torrents` , `tasks` , `guests` , `users` , `messages`; ");







Above Add





$query = mysql_query("SELECT `id`, `descr`, `time`, `last_time` FROM `shoutannounce` WHERE `active` = 'yes'");

while ($row = mysql_fetch_array($query)) {



if ($row['last_time'] + $row['time'] > gmtime())

continue;



mysql_query("INSERT INTO `shoutbox` (`user`, `message`, `date`, `userid`) VALUES ('System', " . sqlesc($row['descr']) . ", '" . get_date_time() . "', '0')");  

mysql_query("UPDATE `shoutannounce` SET `last_time` = '" . gmtime() . "' WHERE `id` = " . $row['id'] . "");

}





Note....! if your using cooly's shoutbox u need to replace





mysql_query("INSERT INTO `shoutbox` (`user`, `message`, `date`, `userid`) VALUES ('System', '" . $row['descr'] . "', '" . get_date_time() . "', '0')");







with





mysql_query("INSERT INTO ajshoutbox (uid, date, name, text) VALUES(0,NOW(), 'System', " . sqlesc($row['descr']) . ")");







If you have thib's bbcode image set changer then u will need to make changes after if installed this mod



Find





echo(textbbcode("shoutannouncecreate","descr","$descr"));





Replace with





echo(textbbcode("shoutannouncecreate","descr", $CURUSER['bbcode'], "$descr"));





Find





echo(textbbcode("shouteditcreate","descr", $row['descr']));





replace by





echo(textbbcode("shouteditcreate","descr", $CURUSER['bbcode'], $row['descr']));
Unknown User
2012-01-15 02:18:12
did you get that mod from the zip file here [url="http://www.bvlist.com/mods/7082-djhowarth-30-premium-mods.html"]http://www.bvlist.com/mods/7082-djhowarth-...emium-mods.html[/url] lmfao you really should leave in your post a credit to the person who's mod you copied.  i have edited your post for you.
Unknown User
2012-01-15 02:31:05
ok no problem
Unknown User
2012-04-20 14:41:52
Moi jai un soucis le robot fonctionne mais par moment il maffiche l'heure et la date avec un 0 sa serais pas cette ligne qui merde

mysql_query("INSERT INTO ajshoutbox (uid, date, name, text) VALUES(0,NOW(), 'System', " . sqlesc($row['descr']) . ")");

jai une shoutbox ajax

merci
Unknown User
2012-04-20 15:30:07
2.08





$query = SQL_Query_exec("SELECT `id`, `descr`, `time`, `last_time` FROM `shoutannounce` WHERE `active` = 'yes'");

while ($row = mysql_fetch_array($query)) {

 

if ($row['last_time'] + $row['time'] > gmtime())

continue;

 

SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES(0,NOW(), '<font color=red >BoT</font>', " . sqlesc($row['descr']) . ")");

SQL_Query_exec("UPDATE `shoutannounce` SET `last_time` = '" . gmtime() . "' WHERE `id` = " . $row['id'] . "");

}

Unknown User
2012-04-21 16:44:03
toujours pareil le 0 apparait

versio 2.06 pourtant
Unknown User
2012-05-06 09:44:09
How do I get this work for 2.08?
Unknown User
2012-10-03 15:42:12
merci sirus fonctionne nickel et super simple a installer :D
Unknown User
2012-10-03 22:13:58


SQL_Query_exec("INSERT INTO ajshoutbox (uid, date, name, text) VALUES(0,NOW(), 'System', " . sqlesc($row['descr']) . ")");

Unknown User
2012-10-03 22:18:39
208



if ($action == "shoutannounce")

{

if (@count($_POST['id'])) {



$ids = implode(',', array_map('intval', $_POST['id']));

 SQL_Query_exec("DELETE FROM `shoutannounce` WHERE `id` IN ($ids)");



}



show_error_msg("Success", "Announcement Removed.", 1);

}



stdhead("Shoutbox Announce");

navmenu();



begin_frame("Shoutbox Announce");



echo("<center>[<a href='admincp.php?action=shoutannouncecreate'>Create Announcement</a>]</center><br />");



$sql = SQL_Query_exec("SELECT * FROM `shoutannounce` ORDER BY `id` DESC");



if (mysql_num_rows($sql) > 0)

{

echo("<form method='post' action='admincp.php?action=shoutannounce'>");

echo("<table border='0' cellpadding='5' cellspacing='3' align='center' width='100%' class='ttable_headinner'>");

echo("<tr>");

echo("<td class='ttable_head'><strong>Title</strong></td>");

echo("<td class='ttable_head'><strong>Message</strong></td>");

echo("<td class='ttable_head'><strong>Added</strong></td>");

echo("<td class='ttable_head'><strong>Run at</strong></td>");

echo("<td class='ttable_head'><strong>Last Run</strong></td>");

echo("<td class='ttable_head'><strong>Enabled</strong></td>");

echo("<td class='ttable_head'><strong>Delete</strong></td>");

echo("</tr>");



while ($row = mysql_fetch_array($sql))

{

echo("<tr>");

echo("<td class='ttable_col1' align='center'><a href='admincp.php?action=shouteditannounce&id=" . $row['id'] . "'>" . htmlspecialchars($row['title']) . "</a></td>");

echo("<td class='ttable_col2' align='center'>" . format_comment($row['descr']) . "</td>");

echo("<td class='ttable_col1' align='center'>" . utc_to_tz($row['added']) . "</td>");

echo("<td class='ttable_col1' align='center'>" . $row['time'] . "</td>");

echo("<td class='ttable_col2' align='center'>" . utc_to_tz(date('Y-m-d H:i:s', $row['last_time'])) . "</td>");

echo("<td class='ttable_col1' align='center'>" . htmlspecialchars($row['active']) . "</td>");

echo("<td class='ttable_col2' align='center'><input type='checkbox' name='id[]' value='".$row['id']."'/></td>");

echo("</tr>");

}



echo("</table>");

echo("<div align='right'><input type='submit' value='Remove'/></div>");

echo("</form>");

}

else {

echo("<center>No Current announcements.</center>");

}



end_frame();

stdfoot();

}

if ($action == "shoutannouncecreate")

{

if ($_SERVER['REQUEST_METHOD'] == 'POST')

{

if (empty($_POST['title']) || empty($_POST['descr']) || !is_valid_id($_POST['time']))

show_error_msg("Error", "Form not completed. <a href='admincp.php?action=shoutannouncecreate'>return</a>?", 1);



SQL_Query_exec("INSERT INTO `shoutannounce` (`title`, `descr`, `added`, `time`) VALUES (" . sqlesc($_POST['title']) . ", " . sqlesc($_POST['descr']) . ", " . sqlesc(get_date_time()) . ", " . sqlesc($_POST['time']) . ")");



show_error_msg("Success", "Announcement Created. <a href='admincp.php?action=shoutannounce'>return</a>?", 1);

}



stdhead("Create New Announcement");

navmenu();



begin_frame("Create New Announcement");



echo("<form name='shoutannouncecreate' method='post' action='admincp.php?action=shoutannouncecreate'>");

echo("<table border='0' cellpadding='5' cellspacing='0' align='center'>");

echo("<tr>");

echo("<td><strong>Title:</strong></td>");

echo("<td><input type='text' name='title' size='30' /></td>");

echo("</tr>");

echo("<tr>");

echo("<td><strong>Time:</strong></td>");

echo("<td><select name='time'><option value='1800'>30 Mins</option><option value='3600'>1 Hour</option></select></td>");

echo("</tr>");

echo("</table>");



require_once("backend/bbcode.php");

echo(textbbcode("shoutannouncecreate","descr","$descr"));

echo("<input type='reset' value='Reset' /><input type='submit' value='Submit' />");

echo("</form>");



end_frame();

stdfoot();

}

if ($action == 'shouteditannounce')

{

$id = isset($_GET['id']) ? $_GET['id'] : '';



if (!is_valid_id($id))

show_error_msg("Error", "Thats an Invalid ID O_o", 1);



$sql = SQL_Query_exec("SELECT * FROM `shoutannounce` WHERE `id` = $id");

$row = mysql_fetch_array($sql);



if (!$row)

show_error_msg("Error", "Invalid ID.", 1);



if ($_SERVER["REQUEST_METHOD"] == "POST")

{

if (empty($_POST['title']) || empty($_POST['descr']) || !is_valid_id($_POST['time']))

show_error_msg("Error", "Form not completed. <a href='admincp.php?action=shouteditannounce&id=$id'>return</a>?", 1);

SQL_Query_exec("UPDATE `shoutannounce` SET `title` = " . sqlesc($_POST['title']) . ", `descr` = " . sqlesc($_POST['descr']) . ", `time` = " . sqlesc($_POST['time']) . ", `active` = " . sqlesc($_POST['active']) . " WHERE `id` = $id");

show_error_msg("Success", "Announcement edited. <a href='admincp.php?action=shoutannounce'>return</a>?", 1);

}



stdhead("Edit Announcement");

navmenu();



begin_frame("Edit Announcement");



echo("<form name='shouteditcreate' method='post' action='admincp.php?action=shouteditannounce&id=$id'>");

echo("<table border='0' cellpadding='5' cellspacing='0' align='center'>");

echo("<tr>");

echo("<td><strong>Title:</strong></td>");

echo("<td><input type='text' name='title' size='30' value='" . htmlspecialchars($row['title']) . "' /></td>");

echo("</tr>");

echo("<tr>");

echo("<td><strong>Time:</strong></td>");

echo("<td><select name='time'><option value='1800' " . ($row['time'] == '1800' ? 'selected="selected"' : '' ). ">30 Mins</option><option value='3600' " . ($row['time'] == '3600' ? 'selected="selected"' : ''). ">1 Hour</option></select></td>");

echo("</tr>");

echo("<tr>");

echo("<td><strong>Enabled:</strong></td>");

echo("<td><select name='active'><option value='yes' " . ($row['active'] == 'yes' ? 'selected="selected"' : '' ). ">Yes</option><option value='no' " . ($row['active'] == 'no' ? 'selected="selected"' : ''). ">No</option></select></td>");

echo("</tr>");

echo("</table>");



require_once("backend/bbcode.php");

echo(textbbcode("shouteditcreate","descr", $row['descr']));

echo("<input type='reset' value='Reset' /><input type='submit' value='Submit' />");

echo("</form>");



end_frame();

stdfoot();

}

Unknown User
2012-10-03 22:21:25


$query = SQL_Query_exec("SELECT `id`, `descr`, `time`, `last_time` FROM `shoutannounce` WHERE `active` = 'yes'");

while ($row = mysql_fetch_array($query)) {



if ($row['last_time'] + $row['time'] > gmtime())

continue;



SQL_Query_exec("INSERT INTO `shoutbox` (`user`, `message`, `date`, `userid`) VALUES ('System', " . sqlesc($row['descr']) . ", '" . get_date_time() . "', '0')");

SQL_Query_exec("UPDATE `shoutannounce` SET `last_time` = '" . gmtime() . "' WHERE `id` = " . $row['id'] . "");

}

Unknown User
2012-10-03 22:23:50
not tested let me know if working or not
Unknown User
2012-10-04 00:42:24
Change this



foreach ($_POST['id'] as $id) {

SQL_Query_exec("DELETE FROM `shoutannounce` WHERE `id` = $id");

}

to






$ids = implode(',', array_map('intval', $_POST['id']));

SQL_Query_exec("DELETE FROM `shoutannounce` WHERE `id` IN ($ids)");




It's better security + performance wise...
Unknown User
2012-10-04 20:37:41
ok very nice of you add to the 208 post

[url="http://www.torrenttrader.org/user/69200-mostvotedplaya/"]mostvotedplaya[/url]
Unknown User
2012-10-06 20:55:12
It should be rewriten for 2.08
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: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728