X7 Chat Support Board
Welcome, Guest. Please login or register.
July 31, 2010, 07:42:53 PM

Login with username, password and session length
Search:     Advanced search
X7 Chat Version 3.0.0 Alpha 2 is now available (http://x7chat.com/support_forum/index.php?topic=3198.msg11497#new).
13036 Posts in 3760 Topics by 66536 Members
Latest Member: usheeenkogon
* Home Help Search Login Register
+  X7 Chat Support Board
|-+  X7 Chat Mods
| |-+  Mod Support
| | |-+  Categories - Help needed
« previous next »
Pages: [1] Reply Send this topic Print
Author Topic: Categories - Help needed  (Read 2117 times)
Alcazar
Guest


Email
« on: July 23, 2008, 08:28:23 AM »
Reply with quote

Hello Folks.
Just working on some enhancements to x7chat2, like adding categories for better room-display and control of room_creation.
Its working for now (room_list and admin_room) but in the form for creating rooms not.
If you want to create a room there should be a select_list for choosing the category to create the room in, but there's only the "500 Error Internal Server Error). When commenting code out it works as normal.
If someone wants the code to look at, just ask cool

Thanks

Screenshot:
Report to moderator   Logged
E-Oreo
Administrator
Member
*****
Offline Offline

Posts: 3710


View Profile Email
« Reply #1 on: July 23, 2008, 04:32:23 PM »
Reply with quote

Check the server log and see if it gives you any more information about the problem.

If you can narrow down the section of code that's causing the error post it here and I'll see if anything sticks out.
Report to moderator   Logged
Alcazar
Guest


Email
« Reply #2 on: July 24, 2008, 10:00:34 AM »
Reply with quote

Thanks boss cool
But its working now, thanks to applying the cats manually rolleyes
(sufficient for us)

If you want to add it in v3, feel free...
(Not only categories, also the ability to control who may create rooms here -> noone (only in acp), registered only, all (+guests))
Report to moderator   Logged
Alcazar
Guest


Email
« Reply #3 on: November 04, 2008, 03:29:01 PM »
Reply with quote

Can the almighty boss help again? rolleyes
Categories worked manually fine so far.
Now tried to manage them via ACP, and adding and updating is working.
But when editing or deleting a category its not doing what it should.
When editing the category name isn't displayed and the "allow userrooms" flag is always set to "no".
When deleting a category (it should be only possible if no rooms in this) it always show that there are no rooms in this cat.
It seems if the queries have no results, when using in MySQL or printing as echo-string they are working.
Here's the code about the categorys in sources/admin.php
Code:
} elseif(isset($_GET['deletec'])) {
// del cat
if(!isset($_GET['confirmc'])){
$body = "<div align=\"center\">$txt[637]<Br>
<a href=\"index.php?act=adminpanel&cp_page=rooms&deletec=$_GET[deletec]&confirmc=yes\">$txt[392]</a> |
<a href=\"index.php?act=adminpanel&cp_page=rooms\">$txt[393]</a>
</div>";
}
else {
$queryc = $db->DoQuery("SELECT COUNT(*) AS roomcount FROM {$prefix}rooms WHERE cat='$_GET[deletec]'");
if($queryc['roomcount'] == 0) {
echo "ok";
// delete cat
}
else {
echo "Not ok";
// delete rooms first
}
//$body = $txt[638]."<br><br><a href=\"index.php?act=adminpanel&cp_page=rooms\">$txt[77]</a>";
}
} elseif(isset($_GET['editc'])) {
// edit cat
$datac = $db->DoQuery("SELECT * FROM {$prefix}category WHERE id='$_GET[editc]'");
$cat_name = $datac['name'];
if($datac['allow_user'] == 1) {
$defy = " checked=\"true\"";
$defn = "";
}
else {
$defy = "";
$defn = " checked=\"true\"";
}
$body = "<Br>
<form action=\"index.php?act=adminpanel&cp_page=rooms&updatec=$cat_name\" method=\"post\">
<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<td>Category Name:</td>
<td>$cat_name</td>
</tr>
<tr>
<td>$txt[634]</td>
<td><input type=\"radio\" name=\"allow_users\" value=\"1\"$defy>$txt[392]&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"allow_users\" value=\"0\"$defn>$txt[393]</td>
</tr>
<tr>
<td colspan=\"2\"><div align=\"center\"><input type=\"submit\" value=\"$txt[187]\" class=\"button\"></div></td>
</tr>
</table></form><Br>";
} elseif(isset($_GET['updatec'])) {
Thanks.
Report to moderator   Logged
Pages: [1] Reply Send this topic Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.293 seconds with 15 queries.