|
#1
|
|||
|
|||
[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 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 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(); ?> // Hatchet |
#2
|
|||
|
|||
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" |
#3
|
|||
|
|||
Re: [Help request] For stylesheets manager
that would be cool or just post your working themes.php so i can compare them? :smile:
|
#4
|
|||
|
|||
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" |
#5
|
|||
|
|||
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 |
#6
|
|||
|
|||
Re: [Help request] For stylesheets manager
what source are you using?
__________________
Go here! ----> "HERE" |
#7
|
|||
|
|||
Re: [Help request] For stylesheets manager
TbDev 01 01 08 :bubble:
|
#8
|
||||
|
||||
try to edit this string
Code:
<form name='form1' method='get' action='" . $_SERVER['PHP_SELF'] . "'>
__________________
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/ |
Tags |
manager , request , stylesheets |
|
|
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 |