ALTER TABLE `uploadapp` ADD `grpacct` tinyint(1) NOT NULL DEFAULT '0';
ALTER TABLE `uploadapp` ADD `grpname` varchar(100) NOT NULL DEFAULT '';
ALTER TABLE `uploadapp` ADD `grpdes` varchar(4) NOT NULL DEFAULT '';
ALTER TABLE `uploadapp` ADD `othergrps` tinyint(1) NOT NULL DEFAULT '0'; while($menu=mysql_fetch_array($affiche_menu)) {
and after add:
$num_rows_class = get_row_count("staffnavigate", "WHERE categorie = $menu[id] AND $max_classe >= classe");
if ($num_rows_class != '0') {
then find
print(" </tr>
</table>
</fieldset><br/>");
and after add:
) case 'dl':
echo "<th class='ttable_head'>".T_("DL")."</th>";and Before add: case 'thanks':
echo "<th class='ttable_head' width=10%>Thanks</td>";
break;
and then search for
case 'dl':
print("<td class=ttable_col$x align=center><a href=\"download.php?id=$id&name=" . rawurlencode($row["filename"]) . "\"><img src=" . $site_config['SITEURL'] . "/images/icon_download.gif border=0 alt=\"Download .torrent\"></a></td>");
and before add:
case 'thanks':
$res_thanks = SQL_Query_exec("SELECT `thanks` FROM torrents WHERE id=".$row["id"]);
$row_thanks = mysql_fetch_row($res_thanks);
mysql_free_result($res_thanks);
$your_thanks = explode(",", $row_thanks[0]);
if (!in_array($CURUSER["username"], $your_thanks)) {
$mythank = '<form action="thanks2.php" method="post"><input type="hidden" name="torrent" value="'.$row["id"].'" /><input type="submit" value="Thanks!" /></form>';
print("<td class=ttable_col$x align=center>$mythank</td>");
} else {
print("<td class=ttable_col$x align=center>Thanks<br />Added</td>");
}
break;
now create a new file called thanks2.php with the following stuff and upload it the root of your server aka where index.php is <?php
require_once("backend/functions.php");
dbconn(false);
loggedinonly();
$id = (int)$_POST['torrent'];
if (!is_valid_id($id)) die;
$res = mysql_query("SELECT `thanks` FROM torrents WHERE id=$id");
$row = mysql_fetch_assoc($res);
mysql_free_result($res);
if (!$row) show_error_msg("Error", "Sorry no .torrent found with this ID, it has probably been deleted.",1);
$thanksl = explode(",", $row['thanks']);
if (in_array($CURUSER['username'], $thanksl)) show_error_msg("Error", "You have already left thanks for this torrent.",1);
mysql_query(sprintf("UPDATE `torrents` SET thanks = CONCAT_WS(',', `thanks`, %s) WHERE `id`=%d", sqlesc($CURUSER['username']), $id)) or die(mysql_error());
$referring_url = $_SERVER['HTTP_REFERER'];
$requested_url = $_SERVER['REQUEST_URI'];
header("Refresh: 3;url=$referring_url");
show_error_msg("Success", "Thanks added.<BR>Redirecting...", 1);
?>
after that to get it to not show the thanks button if already thanked in index.php find
, torrents.anon
and replace it with
, torrents.anon, torrents.thanks
$arr5[peer_id]withCutName($arr5['peer_id'], 8)
Quote:Parse error: syntax error, unexpected $end, expecting T_VARIABLE or '$' in /home/xxx/public_html/languages/english.php on line 103
function navmenu(){and BEFORE it add: $action = $_REQUEST["action"];
$do = $_REQUEST["do"];
DROP TABLE IF EXISTS `log_error`;
CREATE TABLE IF NOT EXISTS `log_error` (
`id` int(10) NOT NULL auto_increment,
`added` datetime default NULL,
`txt` text,
`type` text,
`minclass` tinyint(2) NOT NULL default '5',
`ip` varchar(70) NOT NULL default '',
`username` varchar(70) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `added` (`added`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;2nd: add the following function to backend/functions.php function write_errorlog($text)
{
$ip = $_SERVER['REMOTE_ADDR'];
$text1 = $text ." On: ". $ip;
$text = sqlesc($text1);
$added = sqlesc(get_date_time());
$type = "error_log";
SQL_Query_exec("INSERT INTO log_error (added, txt, type) VALUES($added, $text, '$type')");
}
3: add the following function to languages/english.php
$LANG["LOG_ERROR"] = "Error Log";
4: find in backend/mysql.class.php
error_log($msg);
and after add:
write_errorlog($msg);
That basically the hard part, now to link to the errorlog, I personally use an link in blocks/navigate_block.php
makes it easier to find due to the fact its on every page but in thory if wanted to could add it to the main control panel for staff.
but in this post I will show how to do it in the navigate block
now some place in blocks/navigate_block.php add:
if ($CURUSER && $CURUSER["edit_users"]=="yes")
{
echo "<li><a href='errorlog.php'>".T_("LOG_ERROR")."</a></li>";
}
now create the following page in the root of your site:
errorlog.php
<?
error_reporting(E_ALL ^ E_NOTICE);
require_once("backend/functions.php");
dbconn(false);
loggedinonly();
global $site_config;
global $CURUSER;
$staff_page = T_("LOG_ERROR");
if (!$CURUSER || $CURUSER["edit_users"]!="yes"){
show_error_msg(T_("ERROR"), T_("SORRY_NO_RIGHTS_TO_ACCESS"), 1);
}
stdhead("$staff_page");
$res = SQL_Query_exec("SELECT COUNT(*) FROM log_error WHERE type='error_log'");
$row = mysql_fetch_array($res);
$count = $row[0];
$perpage = 100;
list($pagertop, $pagerbottom, $limit) = pager(100, $count, "errorlog.php?");
$res = SQL_Query_exec("SELECT added, txt FROM log_error WHERE type='error_log' ORDER BY added DESC $limit");
if (mysql_num_rows($res) == 0)
print("<b>".T_("LOG_IS_EMPTY")."</b> For: $staff_page\n");
else
{
echo $pagertop;
print("<table border=1 cellspacing=0 cellpadding=5>\n");
print("<tr><td class=tabletitle align=left>Date</td><td class=tabletitle align=left>Time</td><td class=tabletitle align=left>Event</td></tr>\n");
while ($arr = mysql_fetch_assoc($res))
{
$color = '#ececec';
if (strpos($arr['txt'],T_("WAS_CREATED"))) $color = "#ececec";
if (strpos($arr['txt'],T_("WAS_DELETED_BY"))) $color = "#ececec";
if (strpos($arr['txt'],T_("WAS_UPLOADED_BY"))) $color = "#ececec";
if (strpos($arr['txt'],T_("WAS_EDITED_BY"))) $color = "#ececec";
$date = substr($arr['added'], 0, strpos($arr['added'], " "));
$time = substr($arr['added'], strpos($arr['added'], " ") + 1);
print("<tr class=tableb><td style=background-color:$color><font color=black>$date</td><td style=background-color:$color><font color=black>$time</td><td style=background-color:$color align=left><font color=black>".$arr['txt']."</font></font></font></td></tr>\n");
}
print("</table>");
}
echo $pagerbottom;
print("<p>Times are in GMT.</p>\n");
stdfoot();
?>
if ($CURUSER["class"] < "7")changing 7 to what ever # you setif (!$CURUSER || $CURUSER["control_panel"]!="yes")echo "[<a href='torrents-edit.php?id=$row[id]&returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "'><b>".T_("EDIT_TORRENT")."</b></a>]";
Replace by:
echo "[<a href='torrents-edit.php?id=$row[id]&returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "'><b>".T_("EDIT_TORRENT")."</b></a>]";
echo "[<a href='viewsnatches.php?id=".$row['id']."'><b>View Snatched List</b></a>]"; show_error_msg(T_("ERROR"),"No Torrent ID, Please dont direct link to this page without an torrent ID"),1);to show_error_msg(T_("ERROR"),"No Torrent ID, Please dont direct link to this page without an torrent ID",1);if ($CURUSER){
// 1 set of querys to access forum db info
}
else {
// other set of querys to access only forums you want guests to view
}in thory if (get_user_class() >