Textpattern Forum

You are not logged in. Register | Login | Help

#31 2006-08-06 14:03:58

xjosie729
Member
From: Framingham, MA
Registered: 2006-07-22
Posts: 39
Website

Re: [archived] mtp_subsections

I made another installation in a different database without any prefixes, and the result was the same.

Is there something that I might not have from my web hosting that could have caused this?

Last edited by xjosie729 (2006-08-06 14:05:10)


Josie

Offline

#32 2006-08-06 22:10:07

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 685
Website

Re: [archived] mtp_subsections

Problem installing table. In debug mode I get this:

Fatal error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘DEFAULT CHARSET=latin1’ at line 9 CREATE TABLE `txp_mtp_section` ( `parent` varchar(128) character set utf8 NOT NULL default ‘Default’, `name` varchar(128) character set utf8 NOT NULL default ‘’, `lft` int(6) NOT NULL default ‘0’, `rgt` int(6) NOT NULL default ‘0’, `sort` int(6) NOT NULL default ‘0’, PRIMARY KEY (`name`), KEY `parent` (`parent`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; in /home/boscarto/public_html/textpattern/lib/txplib_db.php on line 61

Bye

Z

Offline

#33 2006-08-17 17:59:48

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,396

Re: [archived] mtp_subsections

Hi, is it possible to modify the plugin so that the list of sections in the “write” tab looks like a nested list of sections and subsections, just like the one under the “subsections” tab?
I’m asking this because I think it would be very useful for the end user to have a visual cue of the sections tree of the site they are updating.
By the way, I think this is a great plugin which could be super with some improvements, like sections/subsections urls…

L.

Offline

#34 2006-08-21 12:39:32

bit
Plugin Author
From: Philippines
Registered: 2005-02-14
Posts: 65
Website

Re: [archived] mtp_subsections

I was having the same problem as xjosie729.

Earlier in the thread, Matt mentioned to check if the table, txp_mtp_subsections, existed and had the right content. I checked and found that it didn’t exist… and I’m absolutely sure that I logged-in under an admin account. I tried Installing and Uninstalling then Installing again several times and still get nothing.

Turns out that the table creation wasn’t working in the “Installation”. So I created the table manually, then did the “Install” in the extensions tab. It finally worked and my Presentation > Subsections tab is no longer empty. :-)

I’ve tried this on two separate servers (one WAMP and the other LAMP) and both have the same problem. I can’t verify if my solution works on the LAMP server though cuz I don’t have phpMyAdmin access.

Last edited by bit (2006-08-21 12:49:10)


“The neighboring marshmallow factory fared no better, having been unable to absorb the incredible pressure wave.”

Offline

#35 2006-08-21 12:53:15

xjosie729
Member
From: Framingham, MA
Registered: 2006-07-22
Posts: 39
Website

Re: [archived] mtp_subsections

…I checked again, and didn’t find txp_mtp_subsections, but I did find mtp_subsections under txp_plugins


Josie

Offline

#36 2006-08-21 13:38:02

bit
Plugin Author
From: Philippines
Registered: 2005-02-14
Posts: 65
Website

Re: [archived] mtp_subsections

Aha! Found the problem. :-)

On line 360 of the source, remove ENGINE=MyISAM DEFAULT CHARSET=latin1 from the SQL command. After that, try installing the table again in the Extensions tab. If I’m not mistaken, your MySQL should be smart enough to declare the appropriate engine and charset defaults which shouldn’t be a problem for most of us.

It works fine now. :-)

Is it possible that you can have the mtp_section_tree start at the current section? For example, I just set startlevel='?' to do that… if you don’t have the time, I’d be happy to try it myself…

I actually did try to, but I don’t really understand the lft and rgt fields. “Left” and “right”, right? Beyond that, I have no idea. Hehe.

Last edited by bit (2006-08-21 13:47:11)


“The neighboring marshmallow factory fared no better, having been unable to absorb the incredible pressure wave.”

Offline

#37 2006-08-21 13:48:44

xjosie729
Member
From: Framingham, MA
Registered: 2006-07-22
Posts: 39
Website

Re: [archived] mtp_subsections

Thank you SO much. Now it works!


Josie

Offline

#38 2006-08-21 14:02:13

bit
Plugin Author
From: Philippines
Registered: 2005-02-14
Posts: 65
Website

Re: [archived] mtp_subsections

bit wrote:

Is it possible that you can have the mtp_section_tree start at the current section? For example, I just set startlevel='?' to do that…

It seems that I misunderstood how this works. If I just set $root to $pretext['s'], that would set the root to the current section right? If that’s the case, the following line of code would do what I’m asking for…

if(isset($s) && $root = "?") $root = $s;

Right?

Last edited by bit (2006-08-21 14:03:16)


“The neighboring marshmallow factory fared no better, having been unable to absorb the incredible pressure wave.”

Offline

#39 2006-08-21 16:50:10

plummerm
Plugin Author
Registered: 2006-06-19
Posts: 22

Re: [archived] mtp_subsections

Hi everyone,
I’m sorry I haven’t been in contact about this plugin. Thanks to everyone for checking into these problems!! I have a preliminary version with support for directories and I was waiting to finish debugging that.

Bit- the “startlevel” and “endlevel” just show what the menu will display relative to its root. Setting those is not the answer for what you want to do. Instead, you can set the root (tag attribute root) to the current section ($pretext[‘s’]). If course, you can’t pass a variable like that into a normal textpattern tag, but you can break the tag into a php function with the attributes elements in an array.

it is like this, i’m out of town and don’t have the code in front of me, so be sure to check the actual name of the tag and attributes with the plugin help(!):
<pre>
<txp:php>
echo mtp_section_tree( array(
‘root’ => $pretext[‘s’],
‘startlevel’ => 1,
‘endlevel’ => 2,
));
</txp:php>
</pre>
and of course that php code would be wrapped in a txp:php tag.

Last edited by plummerm (2006-08-21 16:51:23)

Offline

#40 2006-08-21 16:54:11

plummerm
Plugin Author
Registered: 2006-06-19
Posts: 22

Re: [archived] mtp_subsections

redbot-
it is absolutely possible. I did that the “easy” way on my TXP by replacing the stock textpattern section_list function with the section list function that is already in the plugin. However, this is a hack, so I didn’t include it with the plugin. If you want to know more, I can tell you in a few days when i have better computer access.

Offline

Board footer

Powered by FluxBB