Author |
Message |
Dauthus
Worker


Joined: Oct 07, 2003
Posts: 211
|
Posted:
Mon Aug 15, 2005 11:44 am |
|
I have tried a couple of fixes and have not been able to add another category to the news module.
When I type in the Category Name (When admin adds story) and click on Add, i receive an error stating, "This Category already exists!"
The category doesn't exist, and it doesn't matter what I type in the box, it's always the same problem.
I looked up one of chatserv's older fixes for this problem, but it doesn't seem to work either. Anyone?
I am using 7.6 with patched 3.1
I have already tried this fix, but it doesn't work:
http://www.nukefixes.com/ftopict-482.html |
_________________ Only registered users can see links on this board! Get registered or login!
Vivere disce, cogita mori |
|
|
 |
snowdog
New Member


Joined: Aug 29, 2005
Posts: 2
|
Posted:
Thu Sep 01, 2005 4:39 pm |
|
and the link references a problem/fix for the same issue, but for v6.8 patch 2.1.
Not sure if I should try this on a 7.6 patch 3.1 install.
Any insight??
Thanks
John. |
|
|
|
 |
Dauthus

|
Posted:
Thu Sep 01, 2005 6:16 pm |
|
It didn't work for me. I just go in to the phpmyadmin and add the categories there. The only work around I could think of. |
|
|
|
 |
snowdog

|
Posted:
Thu Sep 01, 2005 9:38 pm |
|
That's what I ended up doing too. Just went in and added the categories through MyAdmin. Everything seems to be working fine.
Thanks. |
|
|
|
 |
chatserv
Member Emeritus

Joined: May 02, 2003
Posts: 1389
Location: Puerto Rico
|
Posted:
Thu Sep 01, 2005 11:07 pm |
|
Try this, in modules/News/admin/index.php find two times:
Code: $check = $db->sql_numrows($result);
if ($check) {
|
change to:
Code: if ($db->sql_numrows($result) == 1) {
|
|
|
|
|
 |
Dauthus

|
Posted:
Fri Sep 02, 2005 6:22 pm |
|
Nope. No help. Still the same error. Thanks for looking into it though. |
|
|
|
 |
chatserv

|
Posted:
Fri Sep 02, 2005 7:21 pm |
|
Let's debug it, change the two functions to the following (make a copy of the original file so that you can go back to it later):
Code:function SaveEditCategory($catid, $title) {
global $prefix, $db, $admin_file;
$title = ereg_replace("\"","",$title);
$result = $db->sql_query("select catid from ".$prefix."_stories_cat where title='$title'");
$catid = intval($catid);
$check = $db->sql_numrows($result);
if ($check) {
$what1 = _CATEXISTS;
$what2 = _GOBACK;
} else {
$what1 = _CATSAVED;
$what2 = "[ <a href=\"".$admin_file.".php\">"._GOTOADMIN."</a> ]";
$result = $db->sql_query("update ".$prefix."_stories_cat set title='$title' where catid='$catid'");
if (!$result) {
return;
}
}
include("header.php");
GraphicAdmin();
OpenTable();
echo "<center><font class=\"title\"><b>"._CATEGORIESADMIN."</b></font></center>";
CloseTable();
echo "<br>";
OpenTable();
echo "<center><font class=\"content\"><b>$what1</b> title equals $title and check equals $check</font><br><br>";
echo "$what2</center>";
CloseTable();
include("footer.php");
}
function SaveCategory($title) {
global $prefix, $db;
$title = ereg_replace("\"","",$title);
$result = $db->sql_query("select catid from ".$prefix."_stories_cat where title='$title'");
$check = $db->sql_numrows($result);
if ($check) {
$what1 = _CATEXISTS;
$what2 = _GOBACK;
} else {
$what1 = _CATADDED;
$what2 = _GOTOADMIN;
$result = $db->sql_query("insert into ".$prefix."_stories_cat values (NULL, '$title', '0')");
if (!$result) {
return;
}
}
include("header.php");
GraphicAdmin();
OpenTable();
echo "<center><font class=\"title\"><b>"._CATEGORIESADMIN."</b></font></center>";
CloseTable();
echo "<br>";
OpenTable();
echo "<center><font class=\"content\"><b>$what1</b> title equals $title and check equals $check</font><br><br>";
echo "$what2</center>";
CloseTable();
include("footer.php");
}
|
Try adding a category and post what you get. |
|
|
|
 |
Dauthus

|
Posted:
Fri Sep 02, 2005 7:39 pm |
|
Ok, I tried to create the category "Technology" (without the quotes)
I get this result:
Quote: | This Category already exists! title equals News and check equals 1 |
|
|
|
|
 |
Dauthus

|
Posted:
Fri Sep 02, 2005 8:12 pm |
|
LOL -- Huh?? -- HEH! You deleted it!!! ROFL |
|
|
|
 |
chatserv

|
Posted:
Fri Sep 02, 2005 8:17 pm |
|
|
|
 |
Dauthus

|
Posted:
Fri Sep 02, 2005 8:22 pm |
|
That one worked! Well done. Thanks for the help. |
|
|
|
 |
chatserv

|
Posted:
Fri Sep 02, 2005 8:33 pm |
|
I'll add it to the patches asap |
|
|
|
 |
|