Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#265 2012-02-15 22:51:50

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

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

Dale, for sure you don’t lack in concision but I’m still not telepathic ;)

so:

1) which “save issue” are you referring to? Maybe the one mentioned by Jason above? In this case it deals with an older version of the plugin and an older txp version so I may only suggest you to upgrade.

2) are you referring to the infamous suhosin module issue? In this case I fear I can do nothing since it is up to you to change your server settings (Maniqui shows how in the post I linked to).

3) You are talking about something totally different that I don’t get? Probably. In this last case can you be just a little more verbose?

Offline

#266 2012-02-20 16:56:12

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

redbot wrote:
1) Maybe the one mentioned by Jason above?

nope

2) are you referring to the infamous suhosin module issue?

nope

3) You are talking about something totally different that I don’t get? Probably.

YES! Sorry for the confusion, I have a habit of starting to write up issues and then randomly cleaning out my garage.

Here’s the scoop.

I’m using glz_custom_fields with this plugin (0.7.1).

When I apply the hack that allows multi-selects and checkboxen to work, I still have an issue with those items not being hidden. On saving bot_wtc prefs it throws these errors…

Warning: You have an error in your SQL syntax; ... update bot_wtc set sections = 'section-a|section-b|section-c' where item = '$("p:has(*[name='custom_17'])")' in a/directory/txplib_db.php on line 89

Warning: You have an error in your SQL syntax; ... insert into bot_wtc set item = '$("p:has(*[name='custom_17'])")', sections ='section-a|section-b|section-c' a/directory/txplib_db.php on line 89

Last edited by mrdale (2012-02-20 16:59:07)

Offline

#267 2012-02-20 18:23:42

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

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

mrdale wrote:

…When I apply the hack that allows multi-selects and checkboxen to work, I still have an issue with those items not being hidden. On saving bot_wtc prefs it throws these errors…

This is so strange, needless to say it works ok for me, it looks like for some reason it doesn’t recognize multiselects and checkboxes at all, which of course shouldn’t happen.

A few questions/suggestions:

  1. You say “When I apply the hack that allows…” but which hack are you referring to? You shouldn’t need to apply any hack if you are using the latest version (0.7.1)
  2. Maybe it has to do with some values stored in the db which were created with an older version of the plugin? It shouldn’t be but, just to be sure, have you tried to delete and recreate only the rules you are having issues with?
  3. Another desperate suggestion is to try to install the plugin again (without uninstalling it – if you want to keep your already saved rules) as v. 7.0.1 should automatically emend any legacy data stored in the db

Let me know if some of these works (of course it won’t)

Last edited by redbot (2012-02-20 18:24:41)

Offline

#268 2012-02-21 01:08:02

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

  1. deleted plugin prefs
  2. deleted bot_wtc
  3. reinstalled 0.7.1

On first turning on plugin …

alter table bot_wtc CHANGE sections sections TEXT Warning: Table 'my_db.bot_wtc' doesn't exist alter table bot_wtc CHANGE sections sections TEXT in /a/directory/textpattern/lib/txplib_db.php on line 89

.p thereafter saving advanced prefs for any field

Warning: 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 'custom_2'])")'' at line 1 update bot_wtc set sections = 'about-us|club|contact|default|events|general|news|newsletter|store|vineyards' where item = '$("p:has(*[name='custom_2'])")' in /a/dir/textpattern/lib/txplib_db.php on line 89

Warning: 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 'custom_2'])")', sections = 'about-us|club|contact|default|events|general|news|ne' at line 1 insert into bot_wtc set item = '$("p:has(*[name='custom_2'])")', sections = 'about-us|club|contact|default|events|general|news|newsletter|store|vineyards' in /a/dir/textpattern/lib/txplib_db.php on line 89

Offline

#269 2012-02-21 14:21:18

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

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

Eeek! I think now I have an idea what could be wrong, I’ll try to fix it asap (not in the next 48 hours I fear since I can’t even access my computer).

For now – if you like to help testing – you can try this:
around line 647 change

"item = '".$item."'"

to:

"item = '".doslash($item)."'"

Does it fix at least the save issue?

Offline

#270 2012-02-21 17:10:37

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

That works… I’m still having an issue with one multi select but I think I know what the issue is… The multi select that won’t be hidden is dynamically generated by a glz custom script…

the markup is like this

<p class="glz_custom_field_script">
<label for="custom-17">my Dynamic multi Select</label><br />
<select id="custom-17" name="custom_17[]" class="list" multiple="multiple" size="5">
<option value="item-1">Item 1</option>
<option value="item-2">Item 2</option>
<option value="item-3">Item 3</option>
</select>

but the call that bot_wtc generates is like this


$("p:has(*[name='custom_17'])");

instead of

$("p:has(*[name='custom_17[]'])");

Last edited by mrdale (2012-02-21 17:11:20)

Offline

#271 2012-02-21 21:41:07

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

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

Ok Dale, thanks for the help.
asap I’ll release a new version which fixes the save bug as well as the installation bug (the first error message you reported – which actually isn’t a serious bug, just an annoyance).
Regarding the issue with the script-generated multiselect it can’t be fixed at plugin-code level (since the select is created after the plugin execution) but probably it can be solved by adding a specific jquery rule in the js box… more on this when I’ll have a moment.
BTW, tough not necessary, would you mind showing what the script does?

Offline

#272 2012-02-22 15:36:02

mrdale
Member
From: Walla Walla
Registered: 2004-11-19
Posts: 2,215
Website

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

Here’s the glz _cf script. The following will output a multi-select of non sticky articles from “mySection” showing titles, where the selection becomes a url_title. I use it to associate multiple articles from “mySection” with the current article for display purposes.

function my_section_articles($custom_field, $custom_id, $custom_value) {
$titles = array();
$query = safe_rows('url_title, title', 'textpattern', "section like 'mySection' AND status !=5");
$titles[] = '&nbsp;';
foreach ($query as $title)
$titles[$title['url_title']] = $title['title'];
return glz_selectInput($custom_field, $custom_id, $titles, $custom_value, "1", true); }

Offline

#273 2012-07-31 00:08:15

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

It seems that this very useful plugin will no longer works in the next version 4.5 of Textpattern (look the following rah_section_titles forum posts).

Do you plan to adapt it to the next version of Textpattern?

Thank you very much for your plugins.

Offline

#274 2012-08-29 14:53:31

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

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

Sharing a tip:

This is a replacement/alternative for jmd_save (use Ctrl+S to save articles on Write tab) which I’m not sure it’s currently working in some modern browsers (I’ve had some issues with Chromium).

Using bot_write_tab_customize, you can add additional Javascript code to the Write panel.

Visit the “Extensions -> Write tab customize” tab, click on the “Additional JS code”, paste this code into the textarea and click on “Update”.

<script type="text/javascript">
var jmd_save = {};
jmd_save.main = function()
{

  $(window).keydown(function(event) {
      //19 for Mac Command+S
      if (!( String.fromCharCode(event.which).toLowerCase() == 's' && event.ctrlKey) && !(event.which == 19)) return true;
      event.preventDefault();
      jmd_save.submit();
      return false;
  });

}();

/**
 * Submits the main-editing form.
 */
jmd_save.submit = function()
{
    var btn = $('.publish');
    if (btn.length > 0)
        return btn[0].click();
};
</script>

And that’s all. Just hit Ctrl+S when writing an article, and it should get saved.
An ideal companion to rah_expanding and the new AJAX article save functionality in Textpattern 4.5.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#275 2012-08-30 17:41:47

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

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

maniqui wrote:

And that’s all. Just hit Ctrl+S when writing an article, and it should get saved.

Damn knots. Thought to give the code a spin and run it through a blender.

Offline

#276 2012-08-30 19:52:28

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:

It seems that this very useful plugin will no longer works in the next version 4.5 of Textpattern (look the following rah_section_titles forum posts).

Do you plan to adapt it to the next version of Textpattern?

Thank you very much for your plugins.

I’m experiencing the same troubles as GugUser, it seems. Given the juicy changes to the Write tab, it’s no surprise that this plugin would be affected, but are we the only ones?

Offline

Board footer

Powered by FluxBB