Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#121 2010-06-10 18:11:30
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
Ziya I ‘ve no idea… so far no one reported a similar erratic behaviour.
Let’s try some final steps before I give up:
1) Could you please post here the javascript generated by the plugin?
2) I suppose you have already tried but what happens if you disable temporanely all other plugins?
Offline
#122 2010-06-11 05:49:56
Re: bot_write_tab_customize: rearrange and style items in the write tab
i disabled all plugins except wtc, same thing…
There is full source of Write page with disabled plugins except wtc
<txp:txp_me />
Offline
#123 2010-06-11 07:13:04
Re: bot_write_tab_customize: rearrange and style items in the write tab
What an amazing plugin. Thx
I think, therefore I AM, … … er … I think :-?
Offline
#124 2010-06-12 10:56:51
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
Katalonian wrote:
…There is full source of Write page with disabled plugins except wtc
Ok. The js in the source says only this: “hide the section list dropdown when in section ‘rainmaker’”.
Is it the rule you have set with bot_wtc or there is something missing?
Other than this I thought it could be a problem with cyrillic characters in custom field names but after installing russian it seems to work for me.
Also I suppose you already tried to uninstall the plugin table (pressing the button at the bottom of the page) and reinstalling…
I’m sorry but I really have no idea. Should I find a solution I’ll post it here.
Timid&friendly wrote:
What an amazing plugin. Thx
Thank you ;-)
Offline
#125 2010-06-24 03:06:29
Re: bot_write_tab_customize: rearrange and style items in the write tab
Hi redbot – I’m trying to add some additional js:
<script type="text/javascript">
$(document).ready(function() {
$('#custom-3').val('test');
});
</script>
However when I click update
to save it then I get the following error:
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 '}); ', html='textarea' where name = 'bot_wtc_script'' at line 2 update txp_prefs set val= ' ', html='textarea' where name = 'bot_wtc_script' C:\xampp\htdocs\tiatxp.dev\textpattern\lib\txplib_misc.php(594) : eval()'d code:650 safe_update() in C:\xampp\htdocs\tiatxp.dev\textpattern\lib\txplib_db.php on line 85
Any ideas? I’m using v0.6.1 of your incredible plugin.
Thanks – Jan
TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX
Offline
#126 2010-06-24 08:21:57
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
Hi Jan,
unfortunately you are asking in the wrong time, today I’m really overloaded by work so I can’t help much…
Anyway, though I was sure to have fixed it , it seems an escaping issue (I’ve tried your script and works flawlessly for me but this my depend on my server settings).
Have you tried to escape every single quote in your script?
<script type="text/javascript">
$(document).ready(function() {
$(\'#custom-3\').val(\'test\');
});
</script>
or (this is quite nonsensical but who knows) to ‘linearize’ the script?
<script type="text/javascript"> $(document).ready(function() { $('#custom-3').val('test'); }); </script>
If this doesn’t solve the problem I’ll have a deeper look in the next days, as I have a break ok?
Offline
#127 2010-06-24 14:17:38
Re: bot_write_tab_customize: rearrange and style items in the write tab
Howdy redbot – yup, escaping did the trick… thanks for the prompt response, even though you’re busy. This plugin + glz_custom_fields = manna from the txp heavens.
TXPDream – A Textpattern Tag Library for Adobe Dreamweaver. (updated for 4.2.0) | jdw_if_ajax – Only serve certain parts of a page when requested with AJAX
Offline
#128 2010-06-24 14:49:10
Re: bot_write_tab_customize: rearrange and style items in the write tab
I will love to know how can I make a links-menu instead of the regular section select-box?
I got a code that let me changing the options of the select-box,
but it’s not hiding the fields/change positions as if I’m selecting it regularly from the select-box.
(of course after it will work I will just hide the select-box using CSS)
<script type="text/javascript">
function sselect(v) {
document.article.section.value = v;
}
</script>
<a href="#" onclick=\'sselect("default");\'>default</a>
<a href="#" onclick=\'sselect("articles");\'>articles</a>
Offline
#129 2010-06-26 15:37:52
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
JanDW wrote:
…This plugin + glz_custom_fields = manna from the txp heavens.
Thank you, but it seems to be not so manna-ish to me, if it continues to sport such silly bugs!
I was sure I fixed it but I was wrong – grrrr…
Anyway I think I found why. Can you help me to fix it definitely with a little test if you have two minutes to spend?
Edit the plugins code and replace this line (around line 649):
$bot_wtc_script = get_magic_quotes_gpc() ? $bot_wtc_script : mysql_real_escape_string($bot_wtc_script) ;
with these two lines:
$bot_wtc_script = get_magic_quotes_gpc() ? stripslashes($bot_wtc_script) : $bot_wtc_script ;
$bot_wtc_script = mysql_real_escape_string($bot_wtc_script);
Then try to insert your original js (non escaped) in the plugins jquery box. It should work now (I hope!)
Last edited by redbot (2010-06-26 15:39:22)
Offline
#130 2010-06-26 16:44:57
Re: bot_write_tab_customize: rearrange and style items in the write tab
redbot wrote:
[…]Edit the plugins code and replace this line (around line 649):[…]
Redbot, you might want to look into some Textpattern’s core functions:
doSlash()
– escapes the querygps()
– returns GET and POST with magic quotes removed. Will cause no conflicts with doSlash().ps()
– same but only for POST.gpsa()
– fetches an array of POST and GET variables.
All of those do what you are doing by checking PHP’s configuration and might make the code cleaner and easier to implement :-)
Hope it helps :-)
Offline
#131 2010-06-26 17:23:27
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
Gocom wrote:
…Hope it helps :-)
Yes, it helps indeed. Thanks Jukka! I’ll use these functions for sure in the next release, together with your other useful coding suggestions.
Thanks again!
Offline
#132 2010-06-26 18:17:00
- redbot
- Plugin Author
- Registered: 2006-02-14
- Posts: 1,410
Re: bot_write_tab_customize: rearrange and style items in the write tab
THE BLUE DRAGON wrote:
..I will love to know how can I make a links-menu instead of the regular section select-box?
1) Your js doesn’t work because the plugin is based on the change() event
2) Why did you put the links outside the <script> tag? it works but it’s sort of a hack. Create the links within the script and append them where you like instead.
I’m more familiar with Jquery nowadays so I’ll do this way
<script type="text/javascript">
$(document).ready(function() {
var sections=["default", "articles"]; // add sections here
var string = '';
for(var i=0; i<sections.length; i++) {
string += '<li><a class="sectionLinks" href="#">' + sections[i] + '</a></li>';
}
$("#section").parent().append('<ul>'+string+'</ul>');
$(".sectionLinks").click(function(){
selectedText = $(this).text();
$("#section").val(selectedText);
$("#section").change();
return false;
})
});
</script>
You have to add the sections you want to use in the array (look for the comment in the code).
In this example I appended the links to the same paragraph which is surrounding the sections list and wrapped them in a ul.
If you want the links to appear in another place or with another markup change the code accordingly (or ask here).
P.S. this could be easily automated (automatically build a list of links for each section) but this would override the hidden sections settings (it’a doable but it will require some more thinking).
Last edited by redbot (2010-06-26 18:30:01)
Offline