Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#349 2016-05-20 03:58:08

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

GugUser wrote #299164:

The subject of the experiment was to find out, whether both plugins, glz_custom_fields 1.4.0-beta1 and bot_write_tab_customize v0.7.4beta might work together. That’s crucial for me to decide if I will be able in the near (near?) future to update to Textpattern 4.6.

I need both of these too, for most of my Txp installations.

Last edited by johnstephens (2016-05-20 03:58:21)

Offline

#350 2016-05-20 06:37:11

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

redbot can probably deal with this much better than me, but I looked a little further at the txp source and it seems the db-prefix/engine/type/charset stuff is all now incorporated into the in-built txp functions and that there is an own create table function in txp.

What if you replace the whole bot_wtc_install function with this?

function bot_wtc_install()
{

	// Create the bot_wtc table
	safe_create('bot_wtc',"
	    id           INT          NOT NULL AUTO_INCREMENT,
	    item		 VARCHAR(255) NOT NULL,
	    position     VARCHAR(255) NOT NULL,
	    destination  VARCHAR(255) NOT NULL,
	    sections     TEXT		  NOT NULL,
	    class    	 VARCHAR(255) NOT NULL,
	    PRIMARY KEY (id)
	");

	// entries in txp_prefs table
	set_pref ('bot_wtc_script','', 'bot_wtc_','2');
	set_pref ('bot_wtc_static_sections','', 'bot_wtc_', '2');

}

TXP Builders – finely-crafted code, design and txp

Offline

#351 2016-05-21 01:22:37

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: bot_write_tab_customize: rearrange and style items in the write tab

jakob wrote #299168:

What if you replace the whole bot_wtc_install function with this?

function bot_wtc_install()...

I made a new Textpattern 4.6. dev installation with a new database and tried to install bot_wtc with your proposed changes as the first plugin, but:

User_Error “Table ‘textpattern.bot_wtc’ doesn’t exist”.

This is the plugin with “your” changes.

Offline

#352 2016-05-22 02:27:36

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: bot_write_tab_customize: rearrange and style items in the write tab

For a new experiment I wanted to do an online Textpattern 4.6 dev installation. After the first login, an error message was displayed and I couldn’t do anything (PHP version 5.5.19):

User_Error “INDEX command denied to user ‘web111’@‘localhost’ for table ‘txp_css’”
in /home/www/web111/html/versuch/textpattern/lib/txplib_db.php at line 405.

textpattern/lib/txplib_misc.php:1677 adminErrorHandler()
updateErrorHandler()
textpattern/lib/txplib_db.php:405 trigger_error()
textpattern/lib/txplib_db.php:666 safe_query()
textpattern/update/_to_4.6.0.php:168 safe_drop_index()
textpattern/update/_update.php:84 include()
textpattern/index.php:180 include()

I made a second installation with the result of the same error message.

The experiment with the plugin wasn’t possible.

Offline

#353 2016-05-22 22:36:45

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

See if this one works better for you:

EDIT: code deleted – see below

Important: Textpattern v4.6 only and beta. I’ve shifted the install/uninstall from the buttons on the extension panel to the regular plug install/deinstall routines and installing appears to work with my testing. I also made the tables only delete on deleting the plugin, not on deactivating plus some further modifications. There’s more that could be done, like switching error messages to using the built-in txp system and some legacy stuff that I think needs taking out / converting for use with the new div-layout like the handling of tables from the old layout.

I hope it works for you!


TXP Builders – finely-crafted code, design and txp

Offline

#354 2016-05-23 00:58:00

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: bot_write_tab_customize: rearrange and style items in the write tab

jakob, thank you for working on this plugin. I think it will be useful for many other Textpattern users. Or even, in my opinion, its functions should be part of the core.

I tried your new version on MAMP with PHP 7 and the installation works fine, the table was created. After that, I selected the item “Excerpt” and “hide in” all sections. After saving, appeared a error message:

Fatal error: Uncaught Error: Call to undefined function mysql_real_escape_string() in /Applications/MAMP/htdocs/textpattern/textpattern/lib/txplib_misc.php(1783) : eval()’d code:213 Stack trace: #0 /Applications/MAMP/htdocs/textpattern/textpattern/lib/txplib_misc.php(1783) : eval()’d code(620): bot_wtc_is_td(‘$(“.excerpt”)’) #1 /Applications/MAMP/htdocs/textpattern/textpattern/lib/txplib_misc.php(1896): bot_wtc_tab(‘bot_wtc_tab’, ‘update’) #2 /Applications/MAMP/htdocs/textpattern/textpattern/index.php(214): callback_event(‘bot_wtc_tab’, ‘update’, 0) #3 {main} thrown in /Applications/MAMP/htdocs/textpattern/textpattern/lib/txplib_misc.php(1783) : eval()’d code on line 213

The saving failed.

On the other (online) installation (PHP 5.5.19) I couldn’t test because the installation failed.

Offline

#355 2016-05-23 22:29:08

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

I think Phil already suggested that in a future version a re-arrangeable write tab was planned. It may also be possible to do what bot_wtc does more effectively using the pluggable_ui rather than jQuery reorganisation.

As redbot has written elsewhere, it is also more effective to use css to hide parts permanently from the admin-side, and Phil has a set of extra css files in his hive theme that do that.

Anyhow, like you and others, I use bot_wtc on well-nigh all installations, so am interested in getting it working, so here’s another attempt that should remedy the above in php 7. There are still some other things that could be neatened up, like using txp’s built-in error messaging system, and in general I think the code could be slightly revamped as it has grown over many versions and several of the functions in bot_wtc are now obsolete as available in the core:

(I’ve removed all previous interim versions from earlier posts)


TXP Builders – finely-crafted code, design and txp

Offline

#356 2016-05-24 00:55:56

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: bot_write_tab_customize: rearrange and style items in the write tab

Thanks jakob, now it works perfectly on my installation on MAMP with PHP 7, also together with glz_custom_fields 1.4.0-beta1 (according to the first tests).

jakob wrote #299221:

I think Phil already suggested that in a future version a re-arrangeable write tab was planned.

Very good, but at the moment we don’t know when those future version will coming.

As redbot has written elsewhere, it is also more effective to use css to hide parts permanently from the admin-side, and Phil has a set of extra css files in his hive theme that do that.

Yes, I know and I do it so, the one with the excerpt was only a quick test with a random field. In practice excerpt can be hidden in the preferences or in CSS.

I use bot_wtc if I want to hide a field depending on the section, for example. And until now, it offers the possibility to rearrange custom fields.

We still don’t know when version 4.7 will be released and must make the things with what exists. In this sense, we must prepare us for version 4.6.

Thank you for your great help!

Offline

#357 2016-05-24 21:19:33

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,595
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

I’ve put the current version of the source code on github for anyone who wants to fork/improve/expand on what’s been done so far, or if redbot wants to take this as a starting point for his own revisions:


TXP Builders – finely-crafted code, design and txp

Offline

#358 2016-05-24 21:38:18

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,473

Re: bot_write_tab_customize: rearrange and style items in the write tab

Good news, thank you.

Offline

#359 2016-05-24 21:58:32

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: bot_write_tab_customize: rearrange and style items in the write tab

jakob wrote #299258:

I’ve put the current version of the source code on github for anyone who wants to fork/improve/expand on what’s been done so far, or if redbot wants to take this as a starting point for his own revisions:

:bread:

Thank you, Jakob!

Offline

#360 2016-06-21 16:42:45

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

Re: bot_write_tab_customize: rearrange and style items in the write tab

Eeek!
How many messages I didn’t read, sorry all!
Anyway..
first af all thanks Jakob for the help and for putting the code on github.
Secondly, I’d like to apologize for my prolonged absence, you know in the last 2-3 years I’ve experienced some sort of rejection towards everything code-related.
I hope I’ll find the enthusiasm to update my plugins (at least the most useful) soon. In any case putting the code on github was a good move, thanks again Jakob!

Offline

Board footer

Powered by FluxBB