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
[ADDON]Shoutbox Message Edit
Controls ·  Search New posts · Mark unread

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

Unknown User
2012-03-06 19:20:23
Take this test, no frame.

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=5583"]shoutedit.php[/url]
shoutedit.php
Download
Unknown User
2012-03-07 21:33:42
i meant when click edit, it opens  small box inside shout rather than its own page
Unknown User
2012-03-08 22:38:41
Maybe it can be opened in a popup like this...

<script language="javascript" type="text/javascript">

<!--

function popitup(url) {

newwindow=window.open(url,'name','height=200,width=600');

if (window.focus) {newwindow.focus()}

return false;

}



// -->

</script>

echo "<div align='right' style='float: right'><a onclick='return popitup('popupex.html')' href='".$site_config['SITEURL']."/shoutedit.php?action=edit&msgid=".$row['msgid']."' style='font-size: 8px'>[E]</a>&nbsp;&nbsp;<a href='".$site_config['SITEURL']."/shoutbox.php?del=".$row['msgid']."' style='font-size: 8px'>[D]</a><div>";



Something like that might work, you can test and see and get back to us hehe

edit: popupex.html should probably be changed for the page you want to show in the popup, probably ".$site_config['SITEURL']."/shoutedit.php?action=edit&msgid=".$row['msgid']."
Unknown User
2012-03-09 14:38:18
ok it opens inside shoutbox how i like it, but when hit submit it shows whole site inside as its redirecting then shout appears as normal. almost there, myabe the shoutedit needs tobe inside shout to
Unknown User
2012-03-09 14:51:48
ok i used your code, and edited shoutedit.php, changing



Autolink("index.php", "Edit complete....");



to this






  header("Refresh: 0; url=shoutbox.php");






works just how i wanted it cheers
Unknown User
2012-03-09 15:16:39
Read my comments in this file and you can do it this way



<?php

//

//  TorrentTrader v2.x

//  $LastChangedDate: 2011-12-03 08:29:47 +0000 (Sat, 03 Dec 2011) $

//  $LastChangedBy: nikkbu $

//

//  http://www.torrenttrader.org

//

//

require_once("backend/functions.php");

dbconn(false);



if ($site_config['SHOUTBOX']){



//DELETE MESSAGES

if (isset($_GET['del'])){



   if (is_numeric($_GET['del'])){

       $query = "SELECT * FROM shoutbox WHERE msgid=".$_GET['del'] ;

       $result = SQL_Query_exec($query);

   }else{

       echo "invalid msg id STOP TRYING TO INJECT SQL";

       exit;

   }



   $row = mysql_fetch_row($result);

       

   if ($row && ($CURUSER["edit_users"]=="yes" || $CURUSER['username'] == $row[1])) {

       $query = "DELETE FROM shoutbox WHERE msgid=".$_GET['del'] ;

       write_log("<b><font color='orange'>Shout Deleted: </font> Deleted by   ".$CURUSER['username']."</b>");

       SQL_Query_exec($query);    

   }

}



if ( is_valid_id($_REQUEST['edit']) )

{  

 

# Do some Validation... Maybe check if there mod or user owns that message?

$res = SQL_Query_exec("SELECT `message`, `user` FROM `shoutbox` WHERE `msgid` = " . $_REQUEST['edit']);

$row = mysql_fetch_assoc($res);



if ( $row )

{



if (!empty($_POST['message']))

{

   

# Update db with edited message but dont use die so shoutbox can continue loading...  

}

else

{

   echo "HTML Form for editing, we use die to stop rest of the shoutbox loading...";

   die;

}    

}  

}



//INSERT MESSAGE

if (!empty($_POST['message']) && $CURUSER) {    

   $_POST['message'] = sqlesc($_POST['message']);

   $query = "SELECT COUNT(*) FROM shoutbox WHERE message=".$_POST['message']." AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP('".get_date_time()."')-UNIX_TIMESTAMP(date) < 30";

   $result = SQL_Query_exec($query);

   $row = mysql_fetch_row($result);



   if ($row[0] == '0') {

       $query = "INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', ".$_POST['message'].", '".get_date_time()."', '".$CURUSER['id']."')";

       SQL_Query_exec($query);

   }

}



//GET CURRENT USERS THEME AND LANGUAGE

if ($CURUSER){

   $ss_a = @mysql_fetch_assoc(@SQL_Query_exec("select uri from stylesheets where id=" . $CURUSER["stylesheet"]));

   if ($ss_a)

       $THEME = $ss_a["uri"];

}else{//not logged in so get default theme/language

   $ss_a = mysql_fetch_assoc(SQL_Query_exec("select uri from stylesheets where id='" . $site_config['default_theme'] . "'"));

   if ($ss_a)

       $THEME = $ss_a["uri"];

}



if(!isset($_GET['history'])){

?>

<html>

<head>

<title><?php echo $site_config['SITENAME'] . T_("SHOUTBOX"); ?></title>

<?php /* If you do change the refresh interval, you should also change index.php printf(T_("SHOUTBOX_REFRESH"), 5) the 5 is in minutes */ ?>

<meta http-equiv="refresh" content="300" />

<link rel="stylesheet" type="text/css" href="<?php echo $site_config['SITEURL']?>/themes/<?php echo $THEME; ?>/theme.css" />

<script type="text/javascript" src="<?php echo $site_config['SITEURL']; ?>/backend/java_klappe.js"></script>

</head>

<body class="shoutbox_body">

<?php

   echo '<div class="shoutbox_contain"><table border="0" style="width: 99%; table-layout:fixed">';

}else{

   

   if ($site_config["MEMBERSONLY"]) {

   loggedinonly();

   }

   

   stdhead();

   begin_frame(T_("SHOUTBOX_HISTORY"));

   echo '<div class="shoutbox_history">';



   $query = 'SELECT COUNT(*) FROM shoutbox';

   $result = SQL_Query_exec($query);

   $row = mysql_fetch_row($result);

   echo '<div align="center">Pages: ';

   $pages = round($row[0] / 100) + 1;

   $i = 1;

   while ($pages > 0){

       echo "<a href='".$site_config['SITEURL']."/shoutbox.php?history=1&amp;page=".$i."'>[".$i."]</a>&nbsp;";

       $i++;

       $pages--;

   }



   echo '</div><br /><table border="0" style="width: 99%; table-layout:fixed">';

}



if (isset($_GET['history'])) {

   if (isset($_GET['page'])) {

       if($_GET['page'] > '1') {

           $lowerlimit = $_GET['page'] * 100 - 100;

           $upperlimit = $_GET['page'] * 100;

       }else{

           $lowerlimit = 0;

           $upperlimit = 100;

       }

   }else{

       $lowerlimit = 0;

       $upperlimit = 100;

   }    

   $query = 'SELECT * FROM shoutbox ORDER BY msgid DESC LIMIT '.$lowerlimit.','.$upperlimit;

}else{

   $query = 'SELECT * FROM shoutbox ORDER BY msgid DESC LIMIT 20';

}





$result = SQL_Query_exec($query);

$alt = false;



while ($row = mysql_fetch_assoc($result)) {

   if ($alt){    

       echo '<tr class="shoutbox_noalt">';

       $alt = false;

   }else{

       echo '<tr class="shoutbox_alt">';

       $alt = true;

   }



   echo '<td style="font-size: 9px; width: 118px;">';

   echo "<div align='left' style='float: left'>";



   echo date('jS M, g:ia', utc_to_tz_time($row['date']));

   



   echo "</div>";



   if ( ($CURUSER["edit_users"]=="yes") || ($CURUSER['username'] == $row['user']) ){

       echo "<div align='right' style='float: right'><a href='".$site_config['SITEURL']."/shoutbox.php?del=".$row['msgid']."' style='font-size: 8px'>[D]</a><a href='".$site_config['SITEURL']."/shoutbox.php?edit=".$row['msgid']."' style='font-size: 8px'>[E]</a></div>";

   }



   echo    '</td><td style="font-size: 12px; padding-left: 5px"><a href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'" target="_parent"><b>'.$row['user'].':</b></a>&nbsp;&nbsp;'.nl2br(format_comment($row['message']));

   echo    '</td></tr>';

}

?>



</table>

</div>

<br />



<?php



//if the user is logged in, show the shoutbox, if not, dont.

if(!isset($_GET['history'])) {

   if (isset($_COOKIE["pass"])){

       echo "<form name='shoutboxform' action='shoutbox.php' method='post'>";

       echo "<center><table width='100%' border='0' cellpadding='1' cellspacing='1'>";

       echo "<tr class='shoutbox_messageboxback'>";

       echo "<td width='75%' align='center'>";

       echo "<input type='text' name='message' class='shoutbox_msgbox' />";

       echo "</td>";

       echo "<td>";

       echo "<input type='submit' name='submit' value='".T_("SHOUT")."' class='shoutbox_shoutbtn' />";

       echo "</td>";

       echo "<td>";

   echo '<a href="javascript:PopMoreSmiles('shoutboxform', 'message');"><small>'.T_("MORE_SMILIES").'</small></a>';

   echo ' <small>-</small> <a href="javascript:PopMoreTags();"><small>'.T_("TAGS").'</small></a>';

       echo "<br />";

       echo "<a href='shoutbox.php'><small>".T_("REFRESH")."</small></a>";  

       echo " <small>-</small> <a href='".$site_config['SITEURL']."/shoutbox.php?history=1' target='_blank'><small>".T_("HISTORY")."</small></a>";

       echo "</td>";

       echo "</tr>";

       echo "</table></center>";

       echo "</form>";

   }else{

       echo "<br /><div class='shoutbox_error'>".T_("SHOUTBOX_MUST_LOGIN")."</div>";

   }

}



if(!isset($_GET['history'])){

   echo "</body></html>";

}else{

   end_frame();

   stdfoot();

}





}//END IF $SHOUTBOX

else{

   echo T_("SHOUTBOX_DISABLED");

}

?>



Unknown User
2012-03-09 16:10:41
:rolleyes:
Unknown User
2012-04-09 17:36:54
"Noname12, post: 81159":
In 2.08 is ok the below code with advices

in shoutbox.php

i change the



echo "<div align='right' style='float: right'><a href='".$site_config['SITEURL']."/shoutbox.php?del=".$row['msgid']."' style='font-size: 8px'>[D]</a><div>";

to




echo "<div align='right' style='float: right'><a href='".$site_config['SITEURL']."/shoutedit.php?action=edit&msgid=".$row['msgid']."' style='font-size: 8px'>[E]</a>&nbsp;&nbsp;<a href='".$site_config['SITEURL']."/shoutbox.php?del=".$row['msgid']."' style='font-size: 8px'>[D]</a><div>";




and the shoutedit.php

this one works perfectly in 2.08
Unknown User
2012-04-09 17:39:52
"mostvotedplaya, post: 81376":
Read my comments in this file and you can do it this way



<?php

//

//  TorrentTrader v2.x

//  $LastChangedDate: 2011-12-03 08:29:47 +0000 (Sat, 03 Dec 2011) $

//  $LastChangedBy: nikkbu $

//

//  http://www.torrenttrader.org

//

//

require_once("backend/functions.php");

dbconn(false);



if ($site_config['SHOUTBOX']){



//DELETE MESSAGES

if (isset($_GET['del'])){



if (is_numeric($_GET['del'])){

$query = "SELECT * FROM shoutbox WHERE msgid=".$_GET['del'] ;

$result = SQL_Query_exec($query);

}else{

echo "invalid msg id STOP TRYING TO INJECT SQL";

exit;

}



$row = mysql_fetch_row($result);



if ($row && ($CURUSER["edit_users"]=="yes" || $CURUSER['username'] == $row[1])) {

$query = "DELETE FROM shoutbox WHERE msgid=".$_GET['del'] ;

write_log("<b><font color='orange'>Shout Deleted: </font> Deleted by   ".$CURUSER['username']."</b>");

SQL_Query_exec($query);

}

}



if ( is_valid_id($_REQUEST['edit']) )

{  

 

# Do some Validation... Maybe check if there mod or user owns that message?

$res = SQL_Query_exec("SELECT `message`, `user` FROM `shoutbox` WHERE `msgid` = " . $_REQUEST['edit']);

$row = mysql_fetch_assoc($res);



if ( $row )

{



if (!empty($_POST['message']))

{



# Update db with edited message but dont use die so shoutbox can continue loading...  

}

else

{

echo "HTML Form for editing, we use die to stop rest of the shoutbox loading...";

die;

}

}  

}



//INSERT MESSAGE

if (!empty($_POST['message']) && $CURUSER) {

$_POST['message'] = sqlesc($_POST['message']);

$query = "SELECT COUNT(*) FROM shoutbox WHERE message=".$_POST['message']." AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP('".get_date_time()."')-UNIX_TIMESTAMP(date) < 30";

$result = SQL_Query_exec($query);

$row = mysql_fetch_row($result);



if ($row[0] == '0') {

$query = "INSERT INTO shoutbox (msgid, user, message, date, userid) VALUES (NULL, '".$CURUSER['username']."', ".$_POST['message'].", '".get_date_time()."', '".$CURUSER['id']."')";

SQL_Query_exec($query);

}

}



//GET CURRENT USERS THEME AND LANGUAGE

if ($CURUSER){

$ss_a = @mysql_fetch_assoc(@SQL_Query_exec("select uri from stylesheets where id=" . $CURUSER["stylesheet"]));

if ($ss_a)

$THEME = $ss_a["uri"];

}else{//not logged in so get default theme/language

$ss_a = mysql_fetch_assoc(SQL_Query_exec("select uri from stylesheets where id='" . $site_config['default_theme'] . "'"));

if ($ss_a)

$THEME = $ss_a["uri"];

}



if(!isset($_GET['history'])){

?>

<html>

<head>

<title><?php echo $site_config['SITENAME'] . T_("SHOUTBOX"); ?></title>

<?php /* If you do change the refresh interval, you should also change index.php printf(T_("SHOUTBOX_REFRESH"), 5) the 5 is in minutes */ ?>

<meta http-equiv="refresh" content="300" />

<link rel="stylesheet" type="text/css" href="<?php echo $site_config['SITEURL']?>/themes/<?php echo $THEME; ?>/theme.css" />

<script type="text/javascript" src="<?php echo $site_config['SITEURL']; ?>/backend/java_klappe.js"></script>

</head>

<body class="shoutbox_body">

<?php

echo '<div class="shoutbox_contain"><table border="0" style="width: 99%; table-layout:fixed">';

}else{



if ($site_config["MEMBERSONLY"]) {

loggedinonly();

}



stdhead();

begin_frame(T_("SHOUTBOX_HISTORY"));

echo '<div class="shoutbox_history">';



$query = 'SELECT COUNT(*) FROM shoutbox';

$result = SQL_Query_exec($query);

$row = mysql_fetch_row($result);

echo '<div align="center">Pages: ';

$pages = round($row[0] / 100) + 1;

$i = 1;

while ($pages > 0){

echo "<a href='".$site_config['SITEURL']."/shoutbox.php?history=1&amp;page=".$i."'>[".$i."]</a>&nbsp;";

$i++;

$pages--;

}



echo '</div><br /><table border="0" style="width: 99%; table-layout:fixed">';

}



if (isset($_GET['history'])) {

if (isset($_GET['page'])) {

if($_GET['page'] > '1') {

$lowerlimit = $_GET['page'] * 100 - 100;

$upperlimit = $_GET['page'] * 100;

}else{

$lowerlimit = 0;

$upperlimit = 100;

}

}else{

$lowerlimit = 0;

$upperlimit = 100;

}

$query = 'SELECT * FROM shoutbox ORDER BY msgid DESC LIMIT '.$lowerlimit.','.$upperlimit;

}else{

$query = 'SELECT * FROM shoutbox ORDER BY msgid DESC LIMIT 20';

}





$result = SQL_Query_exec($query);

$alt = false;



while ($row = mysql_fetch_assoc($result)) {

if ($alt){

echo '<tr class="shoutbox_noalt">';

$alt = false;

}else{

echo '<tr class="shoutbox_alt">';

$alt = true;

}



echo '<td style="font-size: 9px; width: 118px;">';

echo "<div align='left' style='float: left'>";



echo date('jS M, g:ia', utc_to_tz_time($row['date']));





echo "</div>";



if ( ($CURUSER["edit_users"]=="yes") || ($CURUSER['username'] == $row['user']) ){

echo "<div align='right' style='float: right'><a href='".$site_config['SITEURL']."/shoutbox.php?del=".$row['msgid']."' style='font-size: 8px'>[D]</a><a href='".$site_config['SITEURL']."/shoutbox.php?edit=".$row['msgid']."' style='font-size: 8px'>[E]</a></div>";

}



echo '</td><td style="font-size: 12px; padding-left: 5px"><a href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'" target="_parent"><b>'.$row['user'].':</b></a>&nbsp;&nbsp;'.nl2br(format_comment($row['message']));

echo '</td></tr>';

}

?>



</table>

</div>

<br />



<?php



//if the user is logged in, show the shoutbox, if not, dont.

if(!isset($_GET['history'])) {

if (isset($_COOKIE["pass"])){

echo "<form name='shoutboxform' action='shoutbox.php' method='post'>";

echo "<center><table width='100%' border='0' cellpadding='1' cellspacing='1'>";

echo "<tr class='shoutbox_messageboxback'>";

echo "<td width='75%' align='center'>";

echo "<input type='text' name='message' class='shoutbox_msgbox' />";

echo "</td>";

echo "<td>";

echo "<input type='submit' name='submit' value='".T_("SHOUT")."' class='shoutbox_shoutbtn' />";

echo "</td>";

echo "<td>";

echo '<a href="javascript:PopMoreSmiles('shoutboxform', 'message');"><small>'.T_("MORE_SMILIES").'</small></a>';

echo ' <small>-</small> <a href="javascript:PopMoreTags();"><small>'.T_("TAGS").'</small></a>';

echo "<br />";

echo "<a href='shoutbox.php'><small>".T_("REFRESH")."</small></a>";  

echo " <small>-</small> <a href='".$site_config['SITEURL']."/shoutbox.php?history=1' target='_blank'><small>".T_("HISTORY")."</small></a>";

echo "</td>";

echo "</tr>";

echo "</table></center>";

echo "</form>";

}else{

echo "<br /><div class='shoutbox_error'>".T_("SHOUTBOX_MUST_LOGIN")."</div>";

}

}



if(!isset($_GET['history'])){

echo "</body></html>";

}else{

end_frame();

stdfoot();

}





}//END IF $SHOUTBOX

else{

echo T_("SHOUTBOX_DISABLED");

}

?>





Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in/.....//shoutbox.php on line 187
Unknown User
2012-04-10 05:28:26
Make that line this



echo '<a href="javascript:PopMoreSmiles("shoutboxform", "message");"><small>'.T_("MORE_SMILIES").'</small></a>';



Its not a finished piece of work its only here as advice...
Unknown User
2012-04-15 19:02:33
sa fonctionne avec 2.08 ?
2012-07-02 04:37:08
A big thank you to the Mythos edition version 2.08 Number1 all works for version 2.08, thank you also for ca mostvotedplaya has patience! lol  :D  ;)
2012-07-02 04:37:32
"drean179, post: 82402":
sa fonctionne avec 2.08 ?
oui! a 100%
Unknown User
2012-08-13 20:23:46
ok this mod not working on the torrent trader 208 so ive removed it from site just shows old mods not working on the 208
2012-11-03 03:26:15
This works on v2.08 (and by this, I mean this mod) but I was having trouble with clicking on the screen to use my scroll wheel, and sometimes I would accidentally delete a post in the shoutbox because I would click on the screen to get my mouse active, and there was no warning I was deleting a post. So I did this. It gives a warning screen if you really want to delete a shoutbox message.

The edit you need in the shoutbox.php is this. Its only a minor change from the edits posted earlier in this thread



if ( ($CURUSER["edit_users"]=="yes") || ($CURUSER['username'] == class_user($row['user'])) ){

echo "<div align='right' style='float: right'><a href='".$site_config['SITEURL']."/shoutedit.php?action=edit&msgid=".$row['msgid']."' style='font-size: 8px'>[E]</a>&nbsp;&nbsp;<a href='".$site_config['SITEURL']."/shoutedit.php?action=delete&msgid=".$row['msgid']."' style='font-size: 8px'>[D]</a><div>";



and attached is the shoutedit.php file that works with it. If anyone can make it better, feel free  :)  but it works perfectly as far as I am concerned

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6186"]shoutedit.php[/url]
shoutedit.php
Download

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
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: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728