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] Staff Navigation Block
Controls ·  Search New posts · Mark unread

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

Unknown User
2010-12-03 19:48:28
This mod was posted in the premium section Aug 17, 2008 so since it has been there long enough I though I would move it to the normal members section.

This is a Staff Navigation Block. Only your staff will see this block. It uses the links for V.2.04 so you may need to add some links to match it to your inks.

SQL:

CREATE TABLE `staffnavigate` (

 `id` bigint(20) NOT NULL auto_increment,

 `link` varchar(100) NOT NULL default '',

 `name` varchar(100) NOT NULL default '',

 PRIMARY KEY  (`id`)

) ENGINE=MyISAM  DEFAULT CHARSET=latin1;



--

-- Dumping data for table `staffnavigate`

--



INSERT INTO `staffnavigate` VALUES(1, 'admincp.php?action=avatars', 'Avatar Log');

INSERT INTO `staffnavigate` VALUES(2, 'admincp.php?action=backups', 'Backups');

INSERT INTO `staffnavigate` VALUES(3, 'admincp.php?action=bannedtorrents', 'Banned Torrents');

INSERT INTO `staffnavigate` VALUES(4, 'admincp.php?action=blocks&do=view', 'Blocks');

INSERT INTO `staffnavigate` VALUES(5, 'admincp.php?action=cheats', 'Detect Possible Cheaters');

INSERT INTO `staffnavigate` VALUES(6, 'admincp.php?action=emailbans', 'Email Bans');

INSERT INTO `staffnavigate` VALUES(7, 'faq-manage.php', 'FAQ');

INSERT INTO `staffnavigate` VALUES(8, 'admincp.php?action=freetorrents', 'Free Leech Torrents');

INSERT INTO `staffnavigate` VALUES(9, 'admincp.php?action=lastcomm', 'Latest Comments');

INSERT INTO `staffnavigate` VALUES(10, 'admincp.php?action=masspm', 'Mass PM');

INSERT INTO `staffnavigate` VALUES(11, 'admincp.php?action=messagespy', 'Message Spy');

INSERT INTO `staffnavigate` VALUES(12, 'admincp.php?action=news&do=view', 'News');

INSERT INTO `staffnavigate` VALUES(13, 'admincp.php?action=peers', 'Peers List');

INSERT INTO `staffnavigate` VALUES(14, 'admincp.php?action=polls&do=view', 'Polls');

INSERT INTO `staffnavigate` VALUES(15, 'admincp.php?action=reports&do=view', 'Reports');

INSERT INTO `staffnavigate` VALUES(16, 'admincp.php?action=rules&do=view', 'Rules');

INSERT INTO `staffnavigate` VALUES(17, 'admincp.php?action=sitelog', 'Site Log');

INSERT INTO `staffnavigate` VALUES(18, 'teams-create.php', 'Teams');

INSERT INTO `staffnavigate` VALUES(19, 'admincp.php?action=categories&do=view', 'Torrent Categories');

INSERT INTO `staffnavigate` VALUES(20, 'admincp.php?action=torrentmanage', 'Torrents');

INSERT INTO `staffnavigate` VALUES(21, 'admincp.php?action=torrentlangs&do=view', 'Torrent Languages');

INSERT INTO `staffnavigate` VALUES(22, 'admincp.php?action=groups&do=view', 'User Groups');

INSERT INTO `staffnavigate` VALUES(23, 'admincp.php?action=users', 'Users');

INSERT INTO `staffnavigate` VALUES(24, 'admincp.php?action=warned', 'Warned Users');

INSERT INTO `staffnavigate` VALUES(25, 'admincp.php?action=whoswhere', 'Who\'s Where');

INSERT INTO `staffnavigate` VALUES(26, 'admincp.php?action=style', 'Theme Management');

INSERT INTO `staffnavigate` VALUES(27, 'admincp.php?action=censor', 'Word Censor');





add in functions.php:





function staffnavigatelist() {

$ret = array();

$res = mysql_query("SELECT id, link, name FROM staffnavigate ORDER BY id ASC");

while ($row = mysql_fetch_array($res))

$ret[] = $row;

return $ret;

}





make a new file called staffnavigate_block.php and put this inside:





<?

if (!$site_config["MEMBERSONLY"] || $CURUSER && $CURUSER["control_panel"]=="yes") {

begin_block("" . STAFFCP . "");



?>

<center>

<form>

<select name="staffnavigate" onChange="location = options[selectedIndex].value">

<option value="0">Please Select</option>

<?

$staffnavigate = staffnavigatelist();

$staffnavigatedropdown = "";

foreach ($staffnavigate as $staffnavigate) {

$staffnavigatedropdown .= "<option value=\"" . $staffnavigate["link"] . "\"";

if ($staffnavigate["id"] == $_GET["navigate"])

$staffnavigatedropdown .= " selected=\"selected\"";

$staffnavigatedropdown .= ">" . htmlspecialchars($staffnavigate["name"]) . "</option>\n";

}

?>

<?= $staffnavigatedropdown ?>

</select>

<input type="hidden">

</form>

</center>



<?

end_block();

}

?>





now find in admincp.php:





<td align="center"><a href=admincp.php?action=censor><img src="images/admin/censor.png" border=0 width=32 height=32><BR>Word Censor</a><BR></td>





add after:





<td align="center"><a href=admincp.php?action=staffnavigatelinks><img src="images/admin/external.gif" border=0 width=32 height=32><BR>Staff<BR>Navigation Links</a><BR></td>





now add at the end of admincp.php:





#======================================================================#

# Staff Navigation Links

#======================================================================#

if ($action == "staffnavigatelinks") {

if ($CURUSER["class"] < "15"){

show_error_msg("Error","Sorry you do not have the rights to view this page!",1);

}

if ($_GET["id"] != ""){

$id = $_GET["id"];

mysql_query("DELETE FROM staffnavigate WHERE id= $id") or sqlerr(__FILE__, __LINE__);

}

stdhead("Staff Navigation Links");

navmenu();

begin_frame("Staff Navigation Links");

?>

<CENTER><table align=center cellpadding="0" cellspacing="0" class="table_table" width="100%" border="1">

<tr>

<td class=table_head align=center>ID</td>

<td class=table_head align=center>Link</td>

<td class=table_head align=center>Name</td>

<td class=table_head align=center>Delete</td>

</tr>

<?

$res=mysql_query("SELECT id,link,name FROM staffnavigate ORDER BY id ASC") or sqlerr();

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

extract ($row);

$id=$row["id"];

$link=$row["link"];

$name=$row["name"];

echo "<tr><td class=table_col1>$id</td><td class=table_col1>$link</td><td class=table_col1>$name</td><td class=table_col1><a href='admincp.php?action=staffnavigatelinks&id=$id'>Delete</a></td></tr>\n";

}



echo "</table></CENTER>\n";

end_frame();

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

if ($_POST["link"] == "" || $_POST["name"] == "")

show_error_msg("Error", "missing form data.");

$name = $_POST["name"];

$link = $_POST["link"];

mysql_query("INSERT INTO staffnavigate (link, name) VALUES('$link', '$name')") or sqlerr(__FILE__, __LINE__);

}

begin_frame("Add Links");

?>

<form method="post" action=admincp.php?action=staffnavigatelinks>

<? begin_table(TRUE); ?>

<div align=center>

<br><font size=3><b>Example Link: admincp.php?action=avatars</b></font><br>

<br></div><br>

<tr><td class="tableb">Link:</td><td class="tablea"><input type="text" name="link" size="60"></td></tr>

<tr><td class="tableb">Name:</td><td class="tablea"><input type="text" name="name" size="60"></td></tr>

<tr><td class="tablea" colspan="2" style="text-align:center"><input type="submit" value="Okay" class="btn"></td></tr>

<? end_table(); ?>

</form>

<?

end_frame();

stdfoot();

}

#======================================================================#

# END Staff Navigation Links

#======================================================================#
Unknown User
2020-11-24 09:49:42
update

[php]
CREATE TABLE `staffnavigate` (
 `id` bigint(20) NOT NULL auto_increment,
 `link` varchar(100) NOT NULL default '',
 `name` varchar(100) NOT NULL default '',
 PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8_unicode_ci;

INSERT INTO `staffnavigate` VALUES(1, 'admincp.php?action=avatars', 'Avatar Log');
INSERT INTO `staffnavigate` VALUES(2, 'admincp.php?action=backups', 'Backups');
INSERT INTO `staffnavigate` VALUES(3, 'admincp.php?action=bannedtorrents', 'Banned Torrents');
INSERT INTO `staffnavigate` VALUES(4, 'admincp.php?action=blocks&do=view', 'Blocks');
INSERT INTO `staffnavigate` VALUES(5, 'admincp.php?action=cheats', 'Detect Possible Cheaters');
INSERT INTO `staffnavigate` VALUES(6, 'admincp.php?action=emailbans', 'Email Bans');
INSERT INTO `staffnavigate` VALUES(7, 'faq-manage.php', 'FAQ');
INSERT INTO `staffnavigate` VALUES(8, 'admincp.php?action=freetorrents', 'Free Leech Torrents');
INSERT INTO `staffnavigate` VALUES(9, 'admincp.php?action=lastcomm', 'Latest Comments');
INSERT INTO `staffnavigate` VALUES(10, 'admincp.php?action=masspm', 'Mass PM');
INSERT INTO `staffnavigate` VALUES(11, 'admincp.php?action=messagespy', 'Message Spy');
INSERT INTO `staffnavigate` VALUES(12, 'admincp.php?action=news&do=view', 'News');
INSERT INTO `staffnavigate` VALUES(13, 'admincp.php?action=peers', 'Peers List');
INSERT INTO `staffnavigate` VALUES(14, 'admincp.php?action=polls&do=view', 'Polls');
INSERT INTO `staffnavigate` VALUES(15, 'admincp.php?action=reports&do=view', 'Reports');
INSERT INTO `staffnavigate` VALUES(16, 'admincp.php?action=rules&do=view', 'Rules');
INSERT INTO `staffnavigate` VALUES(17, 'admincp.php?action=sitelog', 'Site Log');
INSERT INTO `staffnavigate` VALUES(18, 'teams-create.php', 'Teams');
INSERT INTO `staffnavigate` VALUES(19, 'admincp.php?action=categories&do=view', 'Torrent Categories');
INSERT INTO `staffnavigate` VALUES(20, 'admincp.php?action=torrentmanage', 'Torrents');
INSERT INTO `staffnavigate` VALUES(21, 'admincp.php?action=torrentlangs&do=view', 'Torrent Languages');
INSERT INTO `staffnavigate` VALUES(22, 'admincp.php?action=groups&do=view', 'User Groups');
INSERT INTO `staffnavigate` VALUES(23, 'admincp.php?action=users', 'Users');
INSERT INTO `staffnavigate` VALUES(24, 'admincp.php?action=warned', 'Warned Users');
INSERT INTO `staffnavigate` VALUES(25, 'admincp.php?action=whoswhere', 'Who\'s Where');
INSERT INTO `staffnavigate` VALUES(26, 'admincp.php?action=style', 'Theme Management');
INSERT INTO `staffnavigate` VALUES(27, 'admincp.php?action=censor', 'Word Censor');
[/php]


add in functions.php:

[php]
function staffnavigatelist() {
   $ret = array();
   $res = SQL_Query_exec("SELECT id, link, name FROM staffnavigate ORDER BY id ASC");

while ($row = mysql_fetch_array($res))
   $ret[] = $row;
       return $ret;
}
[/php]


make a new file called staffnavigate_block.php and put this inside:

[php]
<?php
if (!$site_config["MEMBERSONLY"] || $CURUSER && $CURUSER["control_panel"]=="yes") {
begin_block("" . STAFFCP . "");
?>

<center>
<form>
   <select name="staffnavigate" onChange="location = options[selectedIndex].value">
   <option value="0">Please Select</option>

<?php
   $staffnavigate = staffnavigatelist();
   $staffnavigatedropdown = "";
   foreach ($staffnavigate as $staffnavigate) {
   $staffnavigatedropdown .= "<option value=\"" . $staffnavigate["link"] . "\"";

if ($staffnavigate["id"] == $_GET["navigate"])
   $staffnavigatedropdown .= " selected=\"selected\"";
   $staffnavigatedropdown .= ">" . htmlspecialchars($staffnavigate["name"]) . "</option>\n";
}  
?>

<?php echo $staffnavigatedropdown; ?>

</select>
   <input type="hidden">
</form>
</center>

<?php
end_block();
}
?>
[/php]


now find in admincp.php:

[php]
<td align="center"><a href=admincp.php?action=censor><img src="images/admin/censor.png" border=0 width=32 height=32><BR>Word Censor</a><br /></td>
[/php]


add after:

[php]
<td align="center"><a href=admincp.php?action=staffnavigatelinks><img src="images/admin/external.gif" border=0 width=32 height=32><BR>Staff<BR>Navigation Links</a><br /></td>
[/php]


now add at the end of admincp.php:

[php]
#===================================================#
#                Staff Navigation Links                #
#===================================================#
if ($action == "staffnavigatelinks") {
if ($CURUSER["class"] < "15") {
   show_error_msg("Error","Sorry you do not have the rights to view this page!", 1);
}

if ($_GET["id"] != "") {
   $id = (int) $_GET["id"];
   SQL_Query_exec("DELETE FROM staffnavigate WHERE id= $id");
}

stdhead("Staff Navigation Links");
navmenu();

begin_frame("Staff Navigation Links");
?>

<center>
<table align="center" cellpadding="0" cellspacing="0" class="table_table" width="100%" border="1">

<tr>
   <td class="table_head" align="center">ID</td>
   <td class="table_head" align="center">Link</td>
   <td class="table_head" align="center">Name</td>
   <td class="table_head" align="center">Delete</td>
</tr>

<?php
       $res=SQL_Query_exec("SELECT id,link,name FROM staffnavigate ORDER BY id ASC");
while($row=mysql_fetch_array($res)) {
extract ($row);

       $id=$row["id"];
       $link=$row["link"];
       $name=$row["name"];

       echo "<tr><td class=table_col1>$id</td><td class=table_col1>$link</td><td class=table_col1>$name</td><td class=table_col1><a href='admincp.php?action=staffnavigatelinks&id=$id'>Delete</a></td></tr>\n";
}
   echo "</table></center>\n";

end_frame();

if ($_SERVER["REQUEST_METHOD"] == "POST"){
if ($_POST["link"] == "" || $_POST["name"] == "")
   show_error_msg("Error", "missing form data.");
   $name = $_POST["name"];
   $link = $_POST["link"];
   SQL_Query_exec("INSERT INTO staffnavigate (link, name) VALUES('$link', '$name')");
}

begin_frame("Add Links");

?>
<form method="post" action=admincp.php?action=staffnavigatelinks>
<?php begin_table(TRUE); ?>
<div align=center>
<br /><font size="3"><b>Example Link: admincp.php?action=avatars</b></font><br />
<br /></div><br />
<tr><td class="tableb">Link:</td><td class="tablea"><input type="text" name="link" size="60"></td></tr>
<tr><td class="tableb">Name:</td><td class="tablea"><input type="text" name="name" size="60"></td></tr>
<tr><td class="tablea" colspan="2" style="text-align:center"><input type="submit" value="Okay" class="btn"></td></tr>
<?php end_table(); ?>
</form>

<?php
end_frame();
stdfoot();
}

#=======================================================#
#                END Staff Navigation Links                #
#=======================================================#
[/php]
2020-12-07 20:19:31
"phoenix75, post: 69616, member: 1185":

update

[php]
CREATE TABLE `staffnavigate` (
 `id` bigint(20) NOT NULL auto_increment,
 `link` varchar(100) NOT NULL default '',
 `name` varchar(100) NOT NULL default '',
 PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8_unicode_ci;

INSERT INTO `staffnavigate` VALUES(1, 'admincp.php?action=avatars', 'Avatar Log');
INSERT INTO `staffnavigate` VALUES(2, 'admincp.php?action=backups', 'Backups');
INSERT INTO `staffnavigate` VALUES(3, 'admincp.php?action=bannedtorrents', 'Banned Torrents');
INSERT INTO `staffnavigate` VALUES(4, 'admincp.php?action=blocks&do=view', 'Blocks');
INSERT INTO `staffnavigate` VALUES(5, 'admincp.php?action=cheats', 'Detect Possible Cheaters');
INSERT INTO `staffnavigate` VALUES(6, 'admincp.php?action=emailbans', 'Email Bans');
INSERT INTO `staffnavigate` VALUES(7, 'faq-manage.php', 'FAQ');
INSERT INTO `staffnavigate` VALUES(8, 'admincp.php?action=freetorrents', 'Free Leech Torrents');
INSERT INTO `staffnavigate` VALUES(9, 'admincp.php?action=lastcomm', 'Latest Comments');
INSERT INTO `staffnavigate` VALUES(10, 'admincp.php?action=masspm', 'Mass PM');
INSERT INTO `staffnavigate` VALUES(11, 'admincp.php?action=messagespy', 'Message Spy');
INSERT INTO `staffnavigate` VALUES(12, 'admincp.php?action=news&do=view', 'News');
INSERT INTO `staffnavigate` VALUES(13, 'admincp.php?action=peers', 'Peers List');
INSERT INTO `staffnavigate` VALUES(14, 'admincp.php?action=polls&do=view', 'Polls');
INSERT INTO `staffnavigate` VALUES(15, 'admincp.php?action=reports&do=view', 'Reports');
INSERT INTO `staffnavigate` VALUES(16, 'admincp.php?action=rules&do=view', 'Rules');
INSERT INTO `staffnavigate` VALUES(17, 'admincp.php?action=sitelog', 'Site Log');
INSERT INTO `staffnavigate` VALUES(18, 'teams-create.php', 'Teams');
INSERT INTO `staffnavigate` VALUES(19, 'admincp.php?action=categories&do=view', 'Torrent Categories');
INSERT INTO `staffnavigate` VALUES(20, 'admincp.php?action=torrentmanage', 'Torrents');
INSERT INTO `staffnavigate` VALUES(21, 'admincp.php?action=torrentlangs&do=view', 'Torrent Languages');
INSERT INTO `staffnavigate` VALUES(22, 'admincp.php?action=groups&do=view', 'User Groups');
INSERT INTO `staffnavigate` VALUES(23, 'admincp.php?action=users', 'Users');
INSERT INTO `staffnavigate` VALUES(24, 'admincp.php?action=warned', 'Warned Users');
INSERT INTO `staffnavigate` VALUES(25, 'admincp.php?action=whoswhere', 'Who\'s Where');
INSERT INTO `staffnavigate` VALUES(26, 'admincp.php?action=style', 'Theme Management');
INSERT INTO `staffnavigate` VALUES(27, 'admincp.php?action=censor', 'Word Censor');
[/php]


add in functions.php:

[php]
function staffnavigatelist() {
   $ret = array();
   $res = SQL_Query_exec("SELECT id, link, name FROM staffnavigate ORDER BY id ASC");

while ($row = mysql_fetch_array($res))
   $ret[] = $row;
       return $ret;
}
[/php]


make a new file called staffnavigate_block.php and put this inside:

[php]
<?php
if (!$site_config["MEMBERSONLY"] || $CURUSER && $CURUSER["control_panel"]=="yes") {
begin_block("" . STAFFCP . "");
?>

<center>
<form>
   <select name="staffnavigate" onChange="location = options[selectedIndex].value">
   <option value="0">Please Select</option>

<?php
   $staffnavigate = staffnavigatelist();
   $staffnavigatedropdown = "";
   foreach ($staffnavigate as $staffnavigate) {
   $staffnavigatedropdown .= "<option value=\"" . $staffnavigate["link"] . "\"";

if ($staffnavigate["id"] == $_GET["navigate"])
   $staffnavigatedropdown .= " selected=\"selected\"";
   $staffnavigatedropdown .= ">" . htmlspecialchars($staffnavigate["name"]) . "</option>\n";
}
?>

<?php echo $staffnavigatedropdown; ?>

</select>
   <input type="hidden">
</form>
</center>

<?php
end_block();
}
?>
[/php]


now find in admincp.php:

[php]
<td align="center"><a href=admincp.php?action=censor><img src="images/admin/censor.png" border=0 width=32 height=32><BR>Word Censor</a><br /></td>
[/php]


add after:

[php]
<td align="center"><a href=admincp.php?action=staffnavigatelinks><img src="images/admin/external.gif" border=0 width=32 height=32><BR>Staff<BR>Navigation Links</a><br /></td>
[/php]


now add at the end of admincp.php:

[php]
#===================================================#
#                Staff Navigation Links                #
#===================================================#
if ($action == "staffnavigatelinks") {
if ($CURUSER["class"] < "15") {
   show_error_msg("Error","Sorry you do not have the rights to view this page!", 1);
}

if ($_GET["id"] != "") {
   $id = (int) $_GET["id"];
   SQL_Query_exec("DELETE FROM staffnavigate WHERE id= $id");
}

stdhead("Staff Navigation Links");
navmenu();

begin_frame("Staff Navigation Links");
?>

<center>
<table align="center" cellpadding="0" cellspacing="0" class="table_table" width="100%" border="1">

<tr>
   <td class="table_head" align="center">ID</td>
   <td class="table_head" align="center">Link</td>
   <td class="table_head" align="center">Name</td>
   <td class="table_head" align="center">Delete</td>
</tr>

<?php
       $res=SQL_Query_exec("SELECT id,link,name FROM staffnavigate ORDER BY id ASC");
while($row=mysql_fetch_array($res)) {
extract ($row);

       $id=$row["id"];
       $link=$row["link"];
       $name=$row["name"];

       echo "<tr><td class=table_col1>$id</td><td class=table_col1>$link</td><td class=table_col1>$name</td><td class=table_col1><a href='admincp.php?action=staffnavigatelinks&id=$id'>Delete</a></td></tr>\n";
}
   echo "</table></center>\n";

end_frame();

if ($_SERVER["REQUEST_METHOD"] == "POST"){
if ($_POST["link"] == "" || $_POST["name"] == "")
   show_error_msg("Error", "missing form data.");
   $name = $_POST["name"];
   $link = $_POST["link"];
   SQL_Query_exec("INSERT INTO staffnavigate (link, name) VALUES('$link', '$name')");
}

begin_frame("Add Links");

?>
<form method="post" action=admincp.php?action=staffnavigatelinks>
<?php begin_table(TRUE); ?>
<div align=center>
<br /><font size="3"><b>Example Link: admincp.php?action=avatars</b></font><br />
<br /></div><br />
<tr><td class="tableb">Link:</td><td class="tablea"><input type="text" name="link" size="60"></td></tr>
<tr><td class="tableb">Name:</td><td class="tablea"><input type="text" name="name" size="60"></td></tr>
<tr><td class="tablea" colspan="2" style="text-align:center"><input type="submit" value="Okay" class="btn"></td></tr>
<?php end_table(); ?>
</form>

<?php
end_frame();
stdfoot();
}

#=======================================================#
#                END Staff Navigation Links                #
#=======================================================#
[/php]


You can simply build a array that holds all of the admincp.php URL parameters and iterate the entire list of param keys so you don’t have to write 27 INSERT statements, just call the query once.
2024-05-14 14:29:13
Thankssssss
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728