[1]

kuschelknaeuel
Guest
October 14th, 2008 at 12:50 pm

Hi,
I recently started a weblog about movies at the german TV and some people requested a form for non-registered users. That’s how I came to TDO Miniforms.
I need a lot of select boxes (year, month, day, hour, minute, channel) – inserting the values via the widgets is very boring and exhausting, so I made it by hand with the form hacker. Now I can’t change the alignment of the inserted values in the widget without having to change everything, because they appear as “textfield” again (hacking forms didn’t change the widget).
Another question is about the output. I would like to create a url to a recording-website from the data stored in the custom fields (e.g. http://www.createrecording.de/create.php?startdate=value1&starttime=value2&station=value3 etc.). Any ideas about how to do this?

Permalink | Quote

[2]

admin
Guest
October 14th, 2008 at 1:02 pm

kuschelknaeuel said:
I need a lot of select boxes (year, month, day, hour, minute, channel) – inserting the values via the widgets is very boring and exhausting, so I made it by hand with the form hacker. Now I can’t change the alignment of the inserted values in the widget without having to change everything, because they appear as “textfield” again (hacking forms didn’t change the widget).

Won’t work. The Form Hacker should be used to hack the appearance of the form, nothing else. It does not modify the backend, so adding extra text-fields in the form hacker without adding the widgets to the form will do nothing. You could add a “Append to Content” widget and manually write the code to add values from the text fields to the post. But thats just plain mad!

i guess, if you’re adding lots of custom fields it is time consuming, but then it’s really only a once-off job isnt it?

Another question is about the output. I would like to create a url to a recording-website from the data stored in the custom fields (e.g. http://www.createrecording.de/create.php?startdate=value1&starttime=value2&station=value3 etc.). Any ideas about how to do this?

You’ll have to be a little more specific about what you mean. Do you mean add it to the post or just have it on the page?

If you’re storing the data in Custom Fields, just use the Custom Fields API to add in your theme.

You could also add the “Append to Content” widget to your form, below the relevant fields and then write the same piece of PHP code to add it to the post. FYI heres an example that uses Custom Fields to change the title of the post – some slight changes and you can do the URL. :)

Permalink | Quote

[3]

kuschelknaeuel
Guest
October 14th, 2008 at 3:01 pm

admin said:
Won’t work. The Form Hacker should be used to hack the appearance of the form, nothing else. It does not modify the backend, so adding extra text-fields in the form hacker without adding the widgets to the form will do nothing. You could add a “Append to Content” widget and manually write the code to add values from the text fields to the post. But thats just plain mad!

i guess, if you’re adding lots of custom fields it is time consuming, but then it’s really only a once-off job isnt it?

Well, that is what I was afraid off – would’ve been to easy for me, only to copy & paste.

admin said:
You’ll have to be a little more specific about what you mean. Do you mean add it to the post or just have it on the page?

If you’re storing the data in Custom Fields, just use the Custom Fields API to add in your theme.

You could also add the “Append to Content” widget to your form, below the relevant fields and then write the same piece of PHP code to add it to the post. FYI heres an example that uses Custom Fields to change the title of the post – some slight changes and you can do the URL. :)

I’m not sure about whether you mean the same thing as I do for my english is not that good.
To go further into detail: There is a website onlinetvrecorder.com. It records almost everything in the german TV for members, but due to german rights you need to assign the recordings.
In my blog people can write if they get to know about good films (maybe insiders’ tip) and should leave a recording link. In the form are the custom-fields (currently numbered 1-7) with the information you need for a correct recording link (take a look here: http://kuschelknaeuel.de/filmtipp/?page_id=108 – It’s overwritten with “Sendungsdaten*” and “Sender”).
If these fields are what you get with get_post_meta(), I have no more problems (except for my laziness ;) ). If not, please tell me.
Thanks a lot in advance,
Kuschelknaeuel (in english: cuddle-clew ^^)

Permalink | Quote

[4]

kuschelknaeuel
Guest
October 15th, 2008 at 9:19 am

Seems like my last posting hasn’t been sent. Well, I’ll try the get_post_meta() function, after I’ve added the whole select-boxes… Just a lot of work ;)

Permalink | Quote

[5]

admin
Guest
October 15th, 2008 at 9:51 am

For some reason Aksimet is flagging your comments as spam. I’ve de-spammed them. Don’t know why. Anyway…

kuschelknaeuel said:
I’m not sure about whether you mean the same thing as I do for my english is not that good.
To go further into detail: There is a website onlinetvrecorder.com. It records almost everything in the german TV for members, but due to german rights you need to assign the recordings.
In my blog people can write if they get to know about good films (maybe insiders’ tip) and should leave a recording link. In the form are the custom-fields (currently numbered 1-7) with the information you need for a correct recording link

Okay. I’m still not sure what you’re trying to do. What specifically do you want to do with the recording link/URL after someone has submitted it? Do you want publish it on the post or is it used internally for some other application?

(take a look here: http://kuschelknaeuel.de/filmtipp/?page_id=108 – It’s overwritten with “Sendungsdaten*” and “Sender”).
If these fields are what you get with get_post_meta(), I have no more problems (except for my laziness ;) ). If not, please tell me.

Are you saying that, when you use get_post_meta() after submission, you only get the values of “Sendungsdaten*” and “Sender”? Make sure that each Custom Field has a unique key. If it doesn’t, it’ll stick them all in the first custom field.

Permalink | Quote

[6]

kuschelknaeuel
Guest
October 15th, 2008 at 10:48 am

hmm, again my last answer doesn’t appear in here – maybe it’s in the spam?
Now I have a new problem – I wanted to add two custom fields of which I thought they might be helpful (ending time: hour and minute). They should be select-fields but after hitting save changes and looking again at their properties, nothing changed. They still have no title and this cryptic “TDOMF Form #2 Custom Field #8″ unique key, textfields and so on.
So far: thanks a lot for your help.

Permalink | Quote

[7]

kuschelknaeuel
Guest
October 15th, 2008 at 2:42 pm

As I can’t edit my post, I think I’m going to spam ;)

So, I saved and deleted the “old” form and created a new one.
For the first 7 custom-widgets everything went fine. When I came to custom-widget no. 8 it saved nothing. Being prepared for something like that I only had few changes (Title, unique key, textfield to select) and, as expected, the changes weren’t saved.
So I took a look at my database and I saw in table wp_ft_tdomf_table_widgets the tdomf_customfields_widget_7 record is the last one. I think that’s the problem. I could solve this manually in the database by adding tdomf_customfields_widget_8 & tdomf_customfields_widget_9 to the table. Imho that would be to much work, but as long as there’s no other solution I’m willing to do this.

Permalink | Quote

[8]

kuschelknaeuel
Guest
October 15th, 2008 at 2:55 pm

Update (really sorry for posting endless): Can’t even solve the problem by creating a record named tdomf_customfields_widget_8
Next thing I’m going to try is a re-install of tdomf…

Permalink | Quote

[9]

admin
Guest
October 15th, 2008 at 2:59 pm

kuschelknaeuel said:
So, I saved and deleted the “old” form and created a new one.
For the first 7 custom-widgets everything went fine. When I came to custom-widget no. 8 it saved nothing. Being prepared for something like that I only had few changes (Title, unique key, textfield to select) and, as expected, the changes weren’t saved.
So I took a look at my database and I saw in table wp_ft_tdomf_table_widgets the tdomf_customfields_widget_7 record is the last one. I think that’s the problem. I could solve this manually in the database by adding tdomf_customfields_widget_8 & tdomf_customfields_widget_9 to the table. Imho that would be to much work, but as long as there’s no other solution I’m willing to do this.

I suspect I know what might be the cause of this. Any chance you can export your form and post it somewhere for me to download?

Permalink | Quote

[10]

admin
Guest
October 15th, 2008 at 3:01 pm

kuschelknaeuel said:
Update (really sorry for posting endless): Can’t even solve the problem by creating a record named tdomf_customfields_widget_8
Next thing I’m going to try is a re-install of tdomf…

I wouldn’t! You’ll only drive yourself up the wall. Instead could you tell me what browser you using to do the changes and also would it be possible to get a dump of some the info in your phpinfo?

Permalink | Quote

[11]

kuschelknaeuel
Guest
October 16th, 2008 at 8:16 am

admin said:

I suspect I know what might be the cause of this. Any chance you can export your form and post it somewhere for me to download?

Of course I can: here it is

admin said:
I wouldn’t! You’ll only drive yourself up the wall. Instead could you tell me what browser you using to do the changes and also would it be possible to get a dump of some the info in your phpinfo?

I’m using Firefox 3.0.3, Scripts allowed on my domain, AddBlock Plus activated. Which part of my phpinfo do you need? Won’t post the whole thing ;)

Permalink | Quote

[12]

admin
Guest
October 16th, 2008 at 10:10 am

I successfully imported the form into my test bed and was easily able to configure Custom Field 8 and add a Custom Field 9. I’m afraid my suspicion was not valid here and I suspect there is some host configuration that is preventing this.

Could you check, in your phpinfo, what your ‘memory_limit’ is set to? On my host configuration it is set very high, around 128M.

Permalink | Quote

[13]

kuschelknaeuel
Guest
October 16th, 2008 at 10:20 am

admin said:
I successfully imported the form into my test bed and was easily able to configure Custom Field 8 and add a Custom Field 9. I’m afraid my suspicion was not valid here and I suspect there is some host configuration that is preventing this.

Could you check, in your phpinfo, what your ‘memory_limit’ is set to? On my host configuration it is set very high, around 128M.

It has the limit at 128M too.

Permalink | Quote

[14]

admin
Guest
October 16th, 2008 at 10:23 am

kuschelknaeuel said:
It has the limit at 128M too.

Okay. Scratch that line of inquiry.

Are you using a translation for TDOMF? It might also be worth disabling all other plugins, if you have any active, just to make sure. If you’re using wp-super-cache that can require some additional work to properly disable.

Permalink | Quote

[15]

kuschelknaeuel
Guest
October 16th, 2008 at 11:00 am

german version of wordpress, english version of tdomf (didn’t find a german one), no other plugins except Askimet active. Disabled Askimet, retried configuring custom field 8, no success.
I did very few changes on the original WP – only “Welcome”, “HowTo” and “Credits” as pages. Activated the Askimet-Plugin, added a few links and link categories.. the usual stuff.
fyi: PHP is version 5.2.6 (latest)

Permalink | Quote

[16]

admin
Guest
October 16th, 2008 at 1:03 pm

There is obviously some error occurring that won’t let you save the data to the db. Could you check the log and see if there is any errors reported there?

Permalink | Quote

[17]

kuschelknaeuel
Guest
October 16th, 2008 at 1:44 pm

Output from last try:

[xx.xx.xx.xx][16-10-08(14:35:12)] tdomf-form-post: No Form ID set!
[xx.xx.xx.xx][16-10-08(14:35:13)] AJAX: Using old argument method
[xx.xx.xx.xx][16-10-08(14:35:13)] tdomf-form-ajax: No Form ID set!
[admin][16-10-08(14:36:26)] tdomf-edit-form.php:620: current memory footprint: 15128212
[admin][16-10-08(14:36:26)] tdomf-edit-form.php:638: current memory footprint: 15199028
[admin][16-10-08(14:36:26)] tdomf-edit-form.php:441: current memory footprint: 15142960
[admin][16-10-08(14:36:26)] tdomf-edit-form.php:445: current memory footprint: 15145040
[admin][16-10-08(14:36:26)] tdomf-edit-form.php:453: current memory footprint: 15146956
[admin][16-10-08(14:36:26)] tdomf-edit-form.php:455: current memory footprint: 15205224
[admin][16-10-08(14:36:26)] tdomf-edit-form.php:458: current memory footprint: 15157844
[xx.xx.xx.xx][16-10-08(14:36:27)] tdomf-form-post: No Form ID set!
[xx.xx.xx.xx][16-10-08(14:36:28)] AJAX: Using old argument method
[xx.xx.xx.xx][16-10-08(14:36:28)] tdomf-form-ajax: No Form ID set!
[admin][16-10-08(14:36:42)] tdomf-edit-form.php:620: current memory footprint: 15261076
[admin][16-10-08(14:36:42)] tdomf-edit-form.php:638: current memory footprint: 15332692
[admin][16-10-08(14:36:42)] tdomf-edit-form.php:649: current memory footprint: 15278444
[admin][16-10-08(14:36:43)] tdomf-edit-form.php:441: current memory footprint: 15276804
[admin][16-10-08(14:36:43)] tdomf-edit-form.php:445: current memory footprint: 15278048
[admin][16-10-08(14:36:43)] tdomf-edit-form.php:453: current memory footprint: 15280100
[admin][16-10-08(14:36:43)] tdomf-edit-form.php:455: current memory footprint: 15339512
[admin][16-10-08(14:36:43)] tdomf-edit-form.php:458: current memory footprint: 15294640
[xx.xx.xx.xx][16-10-08(14:36:44)] tdomf-form-post: No Form ID set!
[xx.xx.xx.xx][16-10-08(14:36:44)] AJAX: Using old argument method
[xx.xx.xx.xx][16-10-08(14:36:44)] tdomf-form-ajax: No Form ID set!

Just replaced the IP adresses ;)
But if it was a restriction of my database, why and how could I have done the first seven custom fields?

Permalink | Quote

[18]

admin
Guest
October 16th, 2008 at 2:12 pm

I can’t figure why, on your setup, that an 8th or 9th Custom Field would not save but on my setup it does. The problem is that it’s a bit of a pain to trace through the code.

If you’re willing, you could insert this line of code in widgets/tdomf-customfield-widget.php around line 305:


  if(is_array($params) && count($params) >= 1){
     $number = $params[0];
  }
  tdomf_log_message( "Processing control options for 'tdomf_customfields_widget_$number' on form $form_id..." );
  $options = tdomf_widget_customfields_get_options($number,$form_id);

And around line 331:


     if ( $options != $newoptions ) {
        $options = $newoptions;
        tdomf_log_message( "Saving options for 'tdomf_customfields_widget_$number' on form $form_id: <pre>" . htmlentities(var_export($options,true)) . '</pre>' );
        tdomf_set_option_widget('tdomf_customfields_widget_'.$number, $options,$form_id);
     }

What this will do is put lines into the log to say if it’s attempting to process the custom field widget for saving and what its attempting to save.

Permalink | Quote

[19]

kuschelknaeuel
Guest
October 16th, 2008 at 2:35 pm

Hoping, this helps

[xx.xx.xx.xx][16-10-08(15:29:23)] tdomf-form-post: No Form ID set!
[xx.xx.xx.xx][16-10-08(15:29:24)] AJAX: Using old argument method
[xx.xx.xx.xx][16-10-08(15:29:24)] tdomf-form-ajax: No Form ID set!
[xx.xx.xx.xx][16-10-08(15:29:27)] tdomf-form-post: No Form ID set!
[xx.xx.xx.xx][16-10-08(15:29:28)] AJAX: Using old argument method
[xx.xx.xx.xx][16-10-08(15:29:28)] tdomf-form-ajax: No Form ID set!
[..]
[admin][16-10-08(15:29:32)] tdomf-edit-form.php:458: current memory footprint: 15163384
[admin][16-10-08(15:29:33)] Processing control options for ‘tdomf_customfields_widget_1′ on form 1…
[admin][16-10-08(15:29:33)] Processing control options for ‘tdomf_customfields_widget_2′ on form 1…
[admin][16-10-08(15:29:33)] Processing control options for ‘tdomf_customfields_widget_3′ on form 1…
[admin][16-10-08(15:29:33)] Processing control options for ‘tdomf_customfields_widget_4′ on form 1…
[admin][16-10-08(15:29:33)] Processing control options for ‘tdomf_customfields_widget_5′ on form 1…
[admin][16-10-08(15:29:33)] Processing control options for ‘tdomf_customfields_widget_6′ on form 1…
[admin][16-10-08(15:29:33)] Processing control options for ‘tdomf_customfields_widget_7′ on form 1…
[admin][16-10-08(15:29:33)] Processing control options for ‘tdomf_customfields_widget_8′ on form 1…
[admin][16-10-08(15:29:33)] Processing control options for ‘tdomf_customfields_widget_9′ on form 1…
[admin][16-10-08(15:29:33)] Processing control options for ‘tdomf_customfields_widget_10′ on form 1…
[admin][16-10-08(15:29:33)] Processing control options for ‘tdomf_customfields_widget_11′ on form 1…
[..]
[admin][16-10-08(15:29:47)] tdomf-edit-form.php:458: current memory footprint: 15301856
[admin][16-10-08(15:29:48)] Processing control options for ‘tdomf_customfields_widget_1′ on form 1…
[admin][16-10-08(15:29:48)] Saving options for ‘tdomf_customfields_widget_1′ on form 1:

array (
‘title’ => ‘Datum’,
‘key’ => ’startdate_day’,
‘required’ => false,
‘preview’ => true,
‘defval’ => ”,
’size’ => 30,
‘cols’ => 40,
‘rows’ => 1,
‘type’ => ’select’,
‘append’ => false,
‘format’ => ‘%%VALUE%%. Â ‘,
’s-multiple’ => false,
’s-values’ => ‘01:01;02:02;03:03;04:04;05:05;06:06;07:07;08:08;09:09;10:10;11:11;12:12;’,
’s-defaults’ => ‘test’,
)

[admin][16-10-08(15:29:48)] Processing control options for ‘tdomf_customfields_widget_2′ on form 1…
[admin][16-10-08(15:29:48)] Saving options for ‘tdomf_customfields_widget_2′ on form 1:

array (
‘title’ => ‘Monat: ‘,
‘key’ => ’startdate_month’,
‘required’ => false,
‘preview’ => true,
‘defval’ => ”,
’size’ => 30,
‘cols’ => 40,
‘rows’ => 1,
‘type’ => ’select’,
‘append’ => false,
‘format’ => ”,
’s-multiple’ => false,
’s-values’ => ‘Januar:01;Februar:02;März:03;April:04;Mai:05;Juni:06;Juli:07;August:08;September:09;Oktober:10;November:11;Dezember:12;’,
’s-defaults’ => ‘test’,
)

[..]
[admin][16-10-08(15:30:25)] tdomf-edit-form.php:458: current memory footprint: 15170612
[admin][16-10-08(15:30:26)] Processing control options for ‘tdomf_customfields_widget_1′ on form 1…
[admin][16-10-08(15:30:26)] Processing control options for ‘tdomf_customfields_widget_2′ on form 1…
[admin][16-10-08(15:30:26)] Processing control options for ‘tdomf_customfields_widget_3′ on form 1…
[admin][16-10-08(15:30:26)] Processing control options for ‘tdomf_customfields_widget_4′ on form 1…
[admin][16-10-08(15:30:26)] Processing control options for ‘tdomf_customfields_widget_5′ on form 1…
[admin][16-10-08(15:30:26)] Processing control options for ‘tdomf_customfields_widget_6′ on form 1…
[admin][16-10-08(15:30:26)] Processing control options for ‘tdomf_customfields_widget_7′ on form 1…
[admin][16-10-08(15:30:26)] Processing control options for ‘tdomf_customfields_widget_8′ on form 1…
[admin][16-10-08(15:30:26)] Processing control options for ‘tdomf_customfields_widget_9′ on form 1…
[admin][16-10-08(15:30:26)] Processing control options for ‘tdomf_customfields_widget_10′ on form 1…
[admin][16-10-08(15:30:26)] Processing control options for ‘tdomf_customfields_widget_11′ on form 1…

Maybe I should deactivate my browser plugins while working on tdomf – I don’t know if the problem lies there.

Permalink | Quote

[20]

kuschelknaeuel
Guest
October 16th, 2008 at 2:45 pm

I did that but my postings los again :(

Permalink | Quote

[21]

admin
Guest
October 16th, 2008 at 3:03 pm

Did you attempt to configure Custom Field 8 and saves changes for that trace? Or was that just a save of the widgets with no changes?

Permalink | Quote

[22]

kuschelknaeuel
Guest
October 16th, 2008 at 3:45 pm

admin said:
Did you attempt to configure Custom Field 8 and saves changes for that trace? Or was that just a save of the widgets with no changes?

Tried to change custom field 8 – I only changed title and key to test it. And, of course, saved changes.

Permalink | Quote

[23]

admin
Guest
October 16th, 2008 at 3:57 pm

Was there a “Saving options for ‘tdomf_customfields_widget_2? on form 1:” for Custom Field 8 in the log? (I see you’ve snipped the log)

Permalink | Quote

[24]

kuschelknaeuel
Guest
October 16th, 2008 at 6:38 pm

I only cutted off the recurring things like

[admin][16-10-08(15:29:47)] tdomf-edit-form.php:458: current memory footprint: 15301856

and

[xx.xx.xx.xx][16-10-08(15:29:28)] tdomf-form-ajax: No Form ID set!

nothing else. If there was something about custom field 8 I wouldn’t remove it.

Permalink | Quote

[25]

admin
Guest
October 17th, 2008 at 9:46 am

Really? How odd. You should see the options info from Custom Field 1, 2, 3, 4, etc. when you submit. Okay thanks. I’ll look into the code some more now.

Permalink | Quote

[26]

admin
Guest
October 17th, 2008 at 10:18 am

If you can, can you put these two pieces of trace into admin/tdomf-edit-form.php?

   do_action('tdomf_control_form_start',$form_id,$mode);
   $widgets = tdomf_filter_widgets($mode,$tdomf_form_widgets);
   tdomf_log_message( 'looking at all widgets: <pre>'.htmlentities(var_export($widgets,true)).'</pre>');
   $widgets_control = tdomf_filter_widgets($mode,$tdomf_form_widgets_control);
   tdomf_log_message( 'looking at filtered widgets (control): <pre>'.htmlentities(var_export($widgets_control,true)).'</pre>');

I suspect that the other widgets are accidentially getting filtered out… not sure why as it doesn’t happen in my setup.

Permalink | Quote

[27]

kuschelknaeuel
Guest
October 17th, 2008 at 11:05 am

wow, creates huge output.. I’m not really sure whether you want me to post everything or take a look myself and tell you the important things.. I uploaded a copy
Maybe this weekend I’ll find the time to test at my xampp installation at home.

Permalink | Quote

[28]

admin
Guest
October 17th, 2008 at 3:51 pm

I can’t explain why it’s not working on your configuration. I have one suggested change left. In widgets/tdomf-customfiled-widgets.php line 308:

  // Store settings for this widget
  if (isset($_POST["customfields-$number-submit"]) ) {
     $newoptions['title'] = $_POST["customfields-title-$number"];

What host software are you using? Is it a LAMP setup?

Permalink | Quote

[29]

kuschelknaeuel
Guest
October 18th, 2008 at 4:13 pm

Just changed what you told me, but that had no effect.
I think it is a LAMP setup. I’m not sure, because I only rent the webspace.
It would make sense to me, if none of my changes were saved, but the (magical) eight? Shouldn’t make a difference.
Wow, I have to revoke this statement. Just tried to change some of the other custom fields (which are, at the moment, placeholders with names) and they don’t save the changes any more. That is really amazing!
The most promising option seems to be the complete removal of the plugin and a retry with a clear installation. Maybe with the current form saved and re-imported.

Permalink | Quote

[30]

kuschelknaeuel
Guest
October 18th, 2008 at 4:30 pm

Correction:
A new form with custom fields 1-10:
At creation it saves all predefined widgets (i.e. “Who am I” etc.), and the custom fields 1-7, but not 8-10. And changing 1-7 is also possible.
As I said: I have no more ideas about who to deal with that except a clean reinstall.

Permalink | Quote

[31]

admin
Guest
October 20th, 2008 at 9:42 am

I haven’t a clue either. It works smoothly for me – I can’t get it to fail. Have you checked your hosts error logs?

Maybe, if you could send me a complete copy of your phpinfo and I could compare it with my working configuration and try to identify what might be different.

Permalink | Quote

[32]

kuschelknaeuel
Guest
October 20th, 2008 at 10:50 am

Well, I will send the phpinfo to you, but via email. But I can tell you that I can’t change anything except using php 4.
I have no access to detailed error logs on the server, but if there were further problems, I would know.
Maybe I’ll do it the other way round: Install and configure locally and export the local form to my server.

Permalink | Quote

[33]

admin
Guest
October 20th, 2008 at 11:50 am

I’ve gone through your phpinfo. Thank you. The first thing I noticed was that your post_max_size was set to only 8M but on mine it was set to 20M. However on testing the lower size, saving the form still worked.

The next thing I saw was that your host uses “Suhosin Extension” and also that it sets the post.max_vars to 200. I can’t replicate this on my host as they don’t have the suhosin extension installed. However I added some debug and the post max variables is actually 326, so it looks like suhosin may be capping the post variables and so preventing you from saving options of several elements of the form. I assume it’s probably a bit random on what it caps too.

I assume you can increase this value by creating a php.ini file and placing it in wp-admin with the contents set to something like this:

suhosin.post.max_array_depth = 500;

This will affect any admin page. If that doesn’t work, you may need to talk to your host provider about it.

Fingers crossed this is it!

Permalink | Quote

[34]

kuschelknaeuel
Guest
October 20th, 2008 at 3:01 pm

You’re right, but it isn’t the right variable. The suhosin extension has a variable to set it to simulation-mode.

From the Configuration Page of hardened-php:
If you fear that Suhosin breaks your application, you can activate Suhosin’s simulation mode with this flag. When Suhosin runs in simulation mode, violations are logged as usual, but nothing is blocked or removed from the request. (Transparent Encryptions are NOT deactivated in simulation mode.)

I set this flag and my changes appear. I know it may be insecure, but as you said it only affects my admin-pages. I will go on trying which variable has to be set to which value until it fits, so I can activate this extension again.

Thanks a lot, great job done here!
Kuschelknaeuel

Permalink | Quote

[35]

admin
Guest
October 20th, 2008 at 3:07 pm

I’m just glad we got to the bottom of it! :)

Permalink | Quote

[36]

kuschelknaeuel
Guest
October 21st, 2008 at 9:55 am

Here I go again, coming back to my problem with creating the url.
I tried to change the title as explained in Setting up custom fields… with one of my values. i.e. I added a “Append to Post Content”-Widget and inserted the following code:
$post_id,
"post_title" => $post_title);
sanitize_post($postdata,"db");
wp_update_post($postdata);

?>


So even if there was no startdate_day key (but there is) it should alter the title – or am I wrong?

Permalink | Quote

[37]

kuschelknaeuel
Guest
October 21st, 2008 at 9:58 am

wuah, half of my code is gone ^^
how can I submit php – I used the -tag around my code. In the preview it looked fine.

Permalink | Quote

[38]

kuschelknaeuel
Guest
October 24th, 2008 at 8:17 am

Could you please take a look at what happened to my code?

Permalink | Quote

[39]

admin
Guest
October 24th, 2008 at 9:04 am

I’m afraid you’re code has been swallowed by Wordpress’ comment filters. If you post PHP code, make sure to replace < with &lt\; and > with &gt\;. What exactly do you want to achieve? You want to take one Custom Field and use it as a title?

Permalink | Quote

[40]

kuschelknaeuel
Guest
October 24th, 2008 at 12:00 pm

I only try to access the fields, and, like described in the thread you linked, add to the title. It’t the first step towards using the data in the custom fields to create a link. But it doesn’t change anything: whether I try to replace the title or to add a custom field value to it. Whether I’m using the key or the %%WIDGET:customfields-1%% macro.

<?php
$start_day = get_post_meta($post_id, 'startingdate_day', true);
if ($start_day != false)
{
$post_title .= ', '.$start_day;
}
else
{
$post_title .= ', something went wrong';
}
$postdata = array(
"ID" => $post_id,
"post_title" => $post_title);
sanitize_post($postdata,"db");
wp_update_post($postdata);
?>

Permalink | Quote

[41]

Mark Cunningham
Guest
October 28th, 2008 at 10:29 am

Don’t use the %%WIDGET%% macro! Thats not what is for.

To confirm if your code is being called at all, you could put a line like:

echo $post_title;

Before editing the title. This way you can see what post title is set to before it updates.

Permalink | Quote

[42]

kuschelknaeuel
Guest
October 29th, 2008 at 4:30 pm

By now it works.
There’s an error in the description you posted earlier. To access the post title the variable is content_title. To alter the title the code looks like this:

<php
$start_day = get_post_meta($post_id, 'startdate_day', true);
$start_month = get_post_meta($post_id, 'startdate_month', true);
$start_year = get_post_meta($post_id, 'startdate_year', true);
$sender = get_post_meta($post_id, 'station', true);
$content_title .= " - ".$sender.", ".$start_day.". ".$start_month.". ".$start_year;
$postdata = array(
"ID" => $post_id,
"post_title" => $content_title);
sanitize_post($postdata,"db");
wp_update_post($postdata);
?>

with this changes now everything works fine.

Permalink | Quote

Advertisments

Join the Discussion