Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 4th May 2008, 09:14
Kotafi Kotafi is offline
Senior Member
 
Join Date: Jan 2008
Posts: 139
Cool [Help request] For stylesheets manager
Hello, i found this mod on tblatvia but cant understand a word of latvia or find even a freaking translator. :unknown:
It is based on that Category Manager from tbdev.net

Original post at tblatvia.bmx.lv
Board Message

screenshot
Click image for larger version

Name:	themescy2.png
Views:	25
Size:	3.4 KB
ID:	416

Mod should be work so that you can add, edit and delete stylesheets from your tracker but im having some problems with it.. The adding new theme works but it keeps adding that same theme every browser rehresh over and over again! lol

Also the Modify and Delete part dont work, it redirect's me on some strange url like this:
Code:
http://localhost/?editid=1&name=(default)&uri=default.css
Hehe, so basicly nothing works with this mod :D

themes.php
Code:
<?php
ob_start();
require_once("include/bittorrent.php");
dbconn(false);
loggedinorreturn();
if (get_user_class() < UC_SYSOP) {
die("Access denied.");
}
mysql_connect($mysql_host,$mysql_user,$mysql_pass);
mysql_select_db($mysql_db);
stdhead("Stylesheets");
print("<h1>Manage Stylesheets</h1>\n");
print("</br>");
print("<table width=70% border=1 cellspacing=0 cellpadding=2><tr><td align=center>\n");

///////////////////// D E L E T E T H E M E \\\\\\\\\\\\\\\\\\\\\\\\\\\\

$sure = htmlspecialchars($_GET['sure']);
if($sure == "yes") {
$delid = 0+$_GET['delid'];
$query = "DELETE FROM stylesheets WHERE id=" .sqlesc($delid) . " LIMIT 1";
$sql = mysql_query($query);
echo("theme succesfully deleted! [ Back ]");
end_frame();
stdfoot();
die();
}
$delid = 0+$_GET['delid'];
$name = $_GET['stylesheet'];
if($delid > 0) {
echo("Are you sure you would like to delete this theme? ($name) ( Yes! / No )");
end_frame();
stdfoot();
die();

}

///////////////////// E D I T A T H E M E \\\\\\\\\\\\\\\\\\\\\\\\\\\\
$edited = 0+$_GET['edited'];
if($edited == 1) {
$id = 0+$_GET['id'];
$name = htmlspecialchars($_GET['name']);
$uri = htmlspecialchars($_GET['uri']);
$query = "UPDATE stylesheets SET
name = ".sqlesc($name).",
uri = '$uri' WHERE id=".sqlesc($id);
$sql = mysql_query($query);
if($sql) {
echo("<table class=main cellspacing=0 cellpadding=5 width=50%>");
echo("<tr><td><div align='center'>Well done! Your theme has been edited succesfully! [ Back ]</div></tr>");
echo("</table>");
end_frame();
stdfoot();
die();
}
}

$editid = 0+$_GET['editid'];
$name = htmlspecialchars($_GET['name']);
$uri = htmlspecialchars($_GET['uri']);
if($editid > 0) {
echo("<form name='form1' method='get' action='" . $_SERVER['PHP_SELF'] . "'>");
echo("<table class=main cellspacing=0 cellpadding=5 width=50%>");
echo("<div align='center'><input type='hidden' name='edited' value='1'>Now editing theme "$name"</div>");
echo("
");
echo("<input type='hidden' name='id' value='$editid'<table class=main cellspacing=0 cellpadding=5 width=50%>");
echo("<tr><td>Name: </td><td align='right'><input type='text' size=50 name='name' value='$name'></td></tr>");
echo("<tr><td>uri: </td><td align='right'><input type='text' size=50 name='uri' value='$uri'></td></tr>");
echo("<tr><td></td><td><div align='right'><input type='Submit'></div></td></tr>");
echo("</table></form>");
end_frame();
stdfoot();
die();
}

///////////////////// A D D A N E W T H E M E \\\\\\\\\\\\\\\\\\\\\\\\\\\\
$add = htmlspecialchars($_GET['add']);
if($add == 'true') {
$name = htmlspecialchars($_GET['name']);
$uri = htmlspecialchars($_GET['uri']);
$query = "INSERT INTO stylesheets SET
name = ".sqlesc($name).",
uri = ".sqlesc($uri);
$sql = mysql_query($query);
if($sql) {
$success = TRUE;
} else {
$success = FALSE;
}
}
print("Add A New theme:");
print("
");
print("
");
echo("<form name='form1' method='get' action='" . $_SERVER['PHP_SELF'] . "'>");
echo("<table class=main cellspacing=0 cellpadding=5 width=50%>");
echo("<tr><td>Name: </td><td align='right'><input type='text' size=50 name='name'></td></tr>");
echo("<tr><td>uri: </td><td align='right'><input type='text' size=50 name='uri'><input type='hidden' name='add' value='true'></td></tr>");
echo("<tr><td></td><td><div align='right'><input type='Submit'></div></td></tr>");
echo("</table>");
if($success == TRUE) {
print("Success!");
}
echo("
");
echo("</form>");

///////////////////// E X I S T I N G C A T E G O R I E S \\\\\\\\\\\\\\\\\\\\\\\\\\\\

print("Existing stylesheets:");
print("
");
print("
");
echo("<table class=main cellspacing=0 cellpadding=5>");
echo("<td>ID:</td><td>Name:</td><td>URI:</td><td>Modify:</td><td>Delete:</td>");
$query = "SELECT * FROM stylesheets WHERE 1=1";
$sql = mysql_query($query);
while ($row = mysql_fetch_array($sql)) {
$id = $row['id'];
$name = $row['name'];
$uri = $row['uri'];
echo("<tr><td>$id </td> <td>$name</td> <td>$uri</td> <td><div align='center'>[img]$BASEURL/pic/multipage.gif[/img]</div></td> <td><div align='center'>[img]$BASEURL/pic/warned2.gif[/img]</div></td></tr>");
}

end_frame();
end_frame();
stdfoot();

?>
I really would like to get this working so i hope someone could point out where is the problem. :smile:

// Hatchet
Reply With Quote
  #2  
Old 4th May 2008, 20:43
snakebite snakebite is offline
Senior Member
 
Join Date: Apr 2008
Default
Posts: 47
Default Re: [Help request] For stylesheets manager
i got this mode from tblatvia.bmx.lv too but it works fine for me.. so maybe you did something wrongly :bubble:
i could translate the instal guid if you realt need it..
PS. im from Latvia :D
__________________
Go here! ----> "HERE"
Reply With Quote
  #3  
Old 5th May 2008, 04:06
Kotafi Kotafi is offline
Senior Member
 
Join Date: Jan 2008
Posts: 139
Default Re: [Help request] For stylesheets manager
that would be cool or just post your working themes.php so i can compare them? :smile:
Reply With Quote
  #4  
Old 5th May 2008, 10:28
snakebite snakebite is offline
Senior Member
 
Join Date: Apr 2008
Default
Posts: 47
Default Re: [Help request] For stylesheets manager
probably you took it from the first post...but the code in the first post didnt work :)

so here is the one that works finely

Code:
<?php
ob_start();
require_once("include/bittorrent.php");
dbconn(false);
loggedinorreturn();
if (get_user_class() < UC_SYSOP) {
die("Access denied.");
}
mysql_connect($mysql_host,$mysql_user,$mysql_pass);
mysql_select_db($mysql_db);
stdhead("Stylesheets");
print("<h1>Stylesheets</h1>\n");
print("</br>");
print("<table width=70% border=1 cellspacing=0 cellpadding=2><tr><td align=center>\n");

///////////////////// D E L E T E T H E M E \\\\\\\\\\\\\\\\\\\\\\\\\\\\

$sure = $_GET['sure'];
if($sure == "yes") {
$delid = $_GET['delid'];
$query = "DELETE FROM stylesheets WHERE id=" .sqlesc($delid) . " LIMIT 1";
$sql = mysql_query($query);
echo("theme succesfully deleted! [ Back ]");
end_frame();
stdfoot();
die();
}
$delid = $_GET['delid'];
$name = $_GET['cat'];
if($delid > 0) {
echo("Are you sure you would like to delete this theme? ($name) ( Y / N )");
end_frame();
stdfoot();
die();

}

///////////////////// E D I T A T H E M E \\\\\\\\\\\\\\\\\\\\\\\\\\\\
$edited = $_GET['edited'];
if($edited == 1) {
$id = $_GET['id'];
$name = $_GET['name'];
$uri = $_GET['uri'];
$query = "UPDATE stylesheets SET
name = '$name',
uri = '$uri' WHERE id=".sqlesc($id);
$sql = mysql_query($query);
if($sql) {
echo("<table class=main cellspacing=0 cellpadding=5 width=50%>");
echo("<tr><td><div align='center'>Well done! Your theme has been edited succesfully! [ Back ]</div></tr>");
echo("</table>");
end_frame();
stdfoot();
die();
}
}

$editid = $_GET['editid'];
$name = $_GET['name'];
$uri = $_GET['uri'];
if($editid > 0) {
echo("<form name='form1' method='get' action='" . $_SERVER['PHP_SELF'] . "'>");
echo("<table class=main cellspacing=0 cellpadding=5 width=50%>");
echo("<div align='center'><input type='hidden' name='edited' value='1'>Now editing theme "$name"</div>");
echo("
");
echo("<input type='hidden' name='id' value='$editid'<table class=main cellspacing=0 cellpadding=5 width=50%>");
echo("<tr><td>Name: </td><td align='right'><input type='text' size=50 name='name' value='$name'></td></tr>");
echo("<tr><td>uri: </td><td align='right'><input type='text' size=50 name='uri' value='$uri'></td></tr>");
echo("<tr><td></td><td><div align='right'><input type='Submit'></div></td></tr>");
echo("</table></form>");
end_frame();
stdfoot();
die();
}

///////////////////// A D D A N E W T H E M E \\\\\\\\\\\\\\\\\\\\\\\\\\\\
$add = $_GET['add'];
if($add == 'true') {
$name = $_GET['name'];
$uri = $_GET['uri'];
$query = "INSERT INTO stylesheets SET
name = '$name',
uri = '$uri'";
$sql = mysql_query($query);
if($sql) {
$success = TRUE;
} else {
$success = FALSE;
}
}
print("Add A New theme!");
print("
");
print("
");
echo("<form name='form1' method='get' action='" . $_SERVER['PHP_SELF'] . "'>");
echo("<table class=main cellspacing=0 cellpadding=5 width=50%>");
echo("<tr><td>Name: </td><td align='right'><input type='text' size=50 name='name'></td></tr>");
echo("<tr><td>uri: </td><td align='right'><input type='text' size=50 name='uri'><input type='hidden' name='add' value='true'></td></tr>");
echo("<tr><td></td><td><div align='right'><input type='Submit'></div></td></tr>");
echo("</table>");
if($success == TRUE) {
print("Success!");
}
echo("
");
echo("</form>");

///////////////////// E X I S T I N G C A T E G O R I E S \\\\\\\\\\\\\\\\\\\\\\\\\\\\

print("Existing stylesheets:");
print("
");
print("
");
echo("<table class=main cellspacing=0 cellpadding=5>");
echo("<td>ID:</td><td>Name:</td><td>URI:</td><td>Edit:</td><td>Delete:</td>");
$query = "SELECT * FROM stylesheets WHERE 1=1";
$sql = mysql_query($query);
while ($row = mysql_fetch_array($sql)) {
$id = $row['id'];
$name = $row['name'];
$uri = $row['uri'];
echo("<tr><td>$id </td> <td>$name</td> <td>$uri</td> <td><div align='center'>[img]$BASEURL/pic/multipage.gif[/img]</div></td> <td><div align='center'>[img]$BASEURL/pic/warned2.gif[/img]</div></td></tr>");
}

end_frame();
end_frame();
stdfoot();

?>
__________________
Go here! ----> "HERE"
Reply With Quote
  #5  
Old 5th May 2008, 13:24
Kotafi Kotafi is offline
Senior Member
 
Join Date: Jan 2008
Posts: 139
Default Re: [Help request] For stylesheets manager
probably but i have same problem with your code too :shoot:

when i try to edit theme i get directed to this url: http://localhost/?editid=10&name=Black&uri=black.css
and when trying to delete: http://localhost/?delid=3&name=Black
Reply With Quote
  #6  
Old 5th May 2008, 16:08
snakebite snakebite is offline
Senior Member
 
Join Date: Apr 2008
Default
Posts: 47
Default Re: [Help request] For stylesheets manager
what source are you using?
__________________
Go here! ----> "HERE"
Reply With Quote
  #7  
Old 5th May 2008, 16:18
Kotafi Kotafi is offline
Senior Member
 
Join Date: Jan 2008
Posts: 139
Default Re: [Help request] For stylesheets manager
TbDev 01 01 08 :bubble:
Reply With Quote
  #8  
Old 13th October 2008, 06:55
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
try to edit this string
Code:
<form name='form1' method='get' action='" . $_SERVER['PHP_SELF'] . "'>
to the location of your page ther are 2 instances
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
Reply

Tags
manager , request , stylesheets

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NexusPHP Request ! bsf TBDev 11 29th October 2013 17:31
TS 5.4.1 Theme request alpha1969 Template Shares 0 23rd October 2009 06:31
[Netvision 2.0] Category Manager johnake Mods & Themes 2 2nd May 2009 15:05
File manager Ginno Free Torrent Source 8 29th January 2009 15:35
Guide Request Kotafi Community Cafe 1 8th February 2008 23:26



All times are GMT +2. The time now is 08:48. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.