Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8151847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:31:34+00:00 2026-06-06T15:31:34+00:00

I’m using JsTree stable version from Github and I’m trying the add the logic

  • 0

I’m using JsTree stable version from Github and I’m trying the add the logic for it to be dynamic enough to hold the data in a table for each category whether a discussion, file, a contact to be tagged, so basically is a tagging system.

My question is basically, if the following DB design can be preventing to do the ‘Copy’ operation:

          `id` int(11) NOT NULL AUTO_INCREMENT,
          `parent_id` int(11) NOT NULL DEFAULT '0',
          `user_id` int(11) NOT NULL DEFAULT '0',
          `label` varchar(16) DEFAULT NULL,
          `position` bigint(20) unsigned NOT NULL DEFAULT '0',
          `left` bigint(20) unsigned NOT NULL DEFAULT '0',
          `right` bigint(20) unsigned NOT NULL DEFAULT '0',
          `level` bigint(20) unsigned NOT NULL DEFAULT '0',
          `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
          `h_label` varchar(16) NOT NULL DEFAULT '',
          `fulllabel` varchar(255) DEFAULT NULL,
          UNIQUE KEY `uidx_3` (`id`),
          KEY `idx_1` (`user_id`),
          KEY `idx_2` (`parent_id`)
        ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;

The original looks like this instead:

        CREATE TABLE IF NOT EXISTS `tree` (
          `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
          `parent_id` bigint(20) unsigned NOT NULL,
          `position` bigint(20) unsigned NOT NULL,
          `left` bigint(20) unsigned NOT NULL,
          `right` bigint(20) unsigned NOT NULL,
          `level` bigint(20) unsigned NOT NULL,
          `title` text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
          `type` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
          PRIMARY KEY (`id`)
        ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;

        INSERT INTO `tree` (`id`, `parent_id`, `position`, `left`, `right`, `level`, `title`, `type`) VALUES
        (1, 0, 2, 1, 14, 0, 'ROOT', ''),
        (2, 1, 0, 2, 11, 1, 'C:', 'drive'),
        (3, 2, 0, 3, 6, 2, '_demo', 'folder'),
        (4, 3, 0, 4, 5, 3, 'index.html', 'default'),
        (5, 2, 1, 7, 10, 2, '_docs', 'folder'),
        (6, 1, 1, 12, 13, 1, 'D:', 'drive'),
        (12, 5, 0, 8, 9, 3, 'zmei.html', 'default');

We are using JSON to pass the data back to the server in where I’m adding some small logic to get the min and max values for records that matches the user_id. That way I’m updating on each interaction with the operations the first two record values for the ‘left’ and ‘right’. Can someone please help me with understanding why if every other operation works, the Copy / Paste doesn’t? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T15:31:35+00:00Added an answer on June 6, 2026 at 3:31 pm

    it ended up being at the source code deleted previously, I mean the fix is in many places to render only the records based on the user that is currently logged into the system, but merely these lines should be credited to Ivan Bozhanov which in the image below provided with the offending line. hope that it helps anyone out there that is stuck at that same spot. We are making reference to another table with the user_id that matches the records with nested set

                if($is_copy) {
                            $sql[] = "" . 
                                "INSERT INTO `".$this->table."` (" . 
                                    "`".$this->fields["parent_id"]."`, " . 
                                    "`".$this->fields["position"]."`, " . 
                                    "`".$this->fields["left"]."`, " . 
                                    "`".$this->fields["right"]."`, " . 
                                    "`".$this->fields["level"]."` ," . 
                                                            "`user_id`," . 
                                                            "`label`" . 
                                ") " . 
                                    "SELECT " . 
                                        "".$ref_id.", " . 
                                        "`".$this->fields["position"]."`, " . 
                                        "`".$this->fields["left"]."` - (".($idif + ($node[$this->fields["left"]] >= $ref_ind ? $ndif : 0))."), " . 
                                        "`".$this->fields["right"]."` - (".($idif + ($node[$this->fields["left"]] >= $ref_ind ? $ndif : 0))."), " . 
                                        "`".$this->fields["level"]."` - (".$ldif."), `user_id`,`label` " . 
                                    "FROM `".$this->table."` " . 
                                    "WHERE " . 
                                        "`user_id`= ".$uid." AND `".$this->fields["id"]."` IN (".implode(",", $node_ids).") " . 
                                    "ORDER BY `".$this->fields["level"]."` ASC";
                        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.