Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6
Author Message
Dauthus
Worker
Worker



Joined: Oct 07, 2003
Posts: 211

PostPosted: Mon Aug 15, 2005 11:44 am Reply with quote

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:
[ Only registered users can see links on this board! Get registered or login! ]

_________________
Image
Vivere disce, cogita mori 
View user's profile Send private message Visit poster's website
snowdog
New Member
New Member



Joined: Aug 29, 2005
Posts: 2

PostPosted: Thu Sep 01, 2005 4:39 pm Reply with quote

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.
 
View user's profile Send private message
Dauthus







PostPosted: Thu Sep 01, 2005 6:16 pm Reply with quote

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







PostPosted: Thu Sep 01, 2005 9:38 pm Reply with quote

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

PostPosted: Thu Sep 01, 2005 11:07 pm Reply with quote

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) {
 
View user's profile Send private message Visit poster's website
Dauthus







PostPosted: Fri Sep 02, 2005 6:22 pm Reply with quote

Nope. No help. Still the same error. Thanks for looking into it though.
 
chatserv







PostPosted: Fri Sep 02, 2005 7:21 pm Reply with quote

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







PostPosted: Fri Sep 02, 2005 7:39 pm Reply with quote

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







PostPosted: Fri Sep 02, 2005 8:12 pm Reply with quote

LOL -- Huh?? -- HEH! You deleted it!!! ROFL
 
chatserv







PostPosted: Fri Sep 02, 2005 8:17 pm Reply with quote

[ Only registered users can see links on this board! Get registered or login! ]
 
Dauthus







PostPosted: Fri Sep 02, 2005 8:22 pm Reply with quote

That one worked! Well done. Thanks for the help.
 
chatserv







PostPosted: Fri Sep 02, 2005 8:33 pm Reply with quote

I'll add it to the patches asap
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.6

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©