Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   [Help request] For stylesheets manager (http://www.bvlist.com/showthread.php?t=277)

Kotafi 4th May 2008 09:14

[Help request] For stylesheets manager
 
1 Attachment(s)
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
Attachment 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:

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("

Manage Stylesheets

\n");
print("
");
print("
\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("");
echo("");
echo("
Well done! Your theme has been edited succesfully! [ Back ]
");
end_frame();
stdfoot();
die();
}
}

$editid = 0+$_GET['editid'];
$name = htmlspecialchars($_GET['name']);
$uri = htmlspecialchars($_GET['uri']);
if($editid > 0) {
echo("
");
echo("");
echo("
Now editing theme "$name"
");
echo("
");
echo("");
echo("");
echo("");
echo("");
echo("
Name:
uri:
");
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("
");
echo("");
echo("");
echo("");
echo("");
echo("
Name:
uri:
");
if($success == TRUE) {
print("Success!");
}
echo("
");
echo("
");

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

print("Existing stylesheets:");
print("
");
print("
");
echo("");
echo("");
$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("");
}

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
ID:Name:URI:Modify:Delete:
$id $name $uri

snakebite 4th May 2008 20:43

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.. :drink:
PS. im from Latvia :D

Kotafi 5th May 2008 04:06

Re: [Help request] For stylesheets manager
 
that would be cool or just post your working themes.php so i can compare them? :smile:

snakebite 5th May 2008 10:28

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 :drink: :dance:

Code:

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("

Stylesheets

\n");
print("
");
print("
\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("");
echo("");
echo("
Well done! Your theme has been edited succesfully! [ Back ]
");
end_frame();
stdfoot();
die();
}
}

$editid = $_GET['editid'];
$name = $_GET['name'];
$uri = $_GET['uri'];
if($editid > 0) {
echo("
");
echo("");
echo("
Now editing theme "$name"
");
echo("
");
echo("");
echo("");
echo("");
echo("");
echo("
Name:
uri:
");
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("
");
echo("");
echo("");
echo("");
echo("");
echo("
Name:
uri:
");
if($success == TRUE) {
print("Success!");
}
echo("
");
echo("
");

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

print("Existing stylesheets:");
print("
");
print("
");
echo("");
echo("");
$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("");
}

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

?>
ID:Name:URI:Edit:Delete:
$id $name $uri

Kotafi 5th May 2008 13:24

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 :sad:

snakebite 5th May 2008 16:08

Re: [Help request] For stylesheets manager
 
what source are you using?

Kotafi 5th May 2008 16:18

Re: [Help request] For stylesheets manager
 
TbDev 01 01 08 :bubble:

joeroberts 13th October 2008 06:55

try to edit this string
Code:


to the location of your page ther are 2 instances


All times are GMT +2. The time now is 23:05.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.