Search found 21 matches

by dakotaroar
Thu Jan 24, 2008 3:45 pm
Forum: Plugins
Topic: A Simple Plugin? Adding to the entryproperties table.
Replies: 8
Views: 4209

The thing is, the field doesn't exist in that table with that entry id as far as I am aware, which is why I was using INSERT instead of UPDATE.
by dakotaroar
Wed Jan 23, 2008 8:58 pm
Forum: Plugins
Topic: A Simple Plugin? Adding to the entryproperties table.
Replies: 8
Views: 4209

I think I found my problem.

Say the entryproprties table looks like this:
23 prop1 val23
24 prop2 val24
25 prop3 val25

And say I have the following custom fields:
prop1
prop2
prop3

Now, if I try to use this query:
serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}entryproperties ...
by dakotaroar
Wed Jan 23, 2008 5:15 pm
Forum: Plugins
Topic: A Simple Plugin? Adding to the entryproperties table.
Replies: 8
Views: 4209

Re: A Simple Plugin? Adding to the entryproperties table.

Hi!

Actually, you should be able to do all of this inside the "backend_save" / "backend_publish" hooks.

There you can access the entryproperties (either read them from the DB, or check the $_POST array
Yup, I can get things out of $_POST.

- maybe even $eventData holds this) and send it to your ...
by dakotaroar
Wed Jan 23, 2008 3:53 pm
Forum: Plugins
Topic: A Simple Plugin? Adding to the entryproperties table.
Replies: 8
Views: 4209

Is there a good tutorial on hooks toward which you could direct me? I'm really a beginner at this.
by dakotaroar
Wed Jan 23, 2008 4:53 am
Forum: Plugins
Topic: A Simple Plugin? Adding to the entryproperties table.
Replies: 8
Views: 4209

A Simple Plugin? Adding to the entryproperties table.

I am having a hard time getting the hang of how all these plugins work. Basically, I want to modify the Extended Properties plugin to actually do something with the data that is input (and then I can strip out the rest of the code that I don't need. So say I create some custom fields (Field1, Field2 ...
by dakotaroar
Tue Jan 22, 2008 3:32 pm
Forum: General discussions
Topic: Problems using Smarty code in entries (custom fields)
Replies: 6
Views: 3087

{$GLOBALS|@print_r} outputs "1" as well. I tried it on the fresh install and it doesn't work there either.

My event plugins are:

[C] Markup: Serendipity

[C] Markup: Emoticate

[C] Markup: NL2BR

Browser Compatibility

[C] Spam Protector

[C] Static Pages

[C] Show links to services like ...
by dakotaroar
Tue Jan 22, 2008 12:02 am
Forum: General discussions
Topic: Problems using Smarty code in entries (custom fields)
Replies: 6
Views: 3087

I've just tried this on a new install and it works in the sidebar but not in the post itself. I must have done something to my old install (not the theme, because it doesn't work in the default theme either) that is messing with the plugin in some way.

I'll look into it later tonight.
by dakotaroar
Mon Jan 21, 2008 8:34 pm
Forum: General discussions
Topic: Problems using Smarty code in entries (custom fields)
Replies: 6
Views: 3087

{$eventData|@print_r} gives me '1' as an output.

Yes, I am trying to use the Smarty tags within the entry body, and I have installed the Smarty Markup Plugin and everything is turned on.

If I try putting {$entry.properties.ep_Test} in entries.tpl, it outputs '0' even when there is a value in the ...
by dakotaroar
Mon Jan 21, 2008 8:10 pm
Forum: General discussions
Topic: Problems using Smarty code in entries (custom fields)
Replies: 6
Views: 3087

Problems using Smarty code in entries (custom fields)

I can't seem to get my custom field data to show up in Smarty entries. I have it set up to parse Smarty within entries, and I have the extended properties cache turned off. So if I name a custom field "Test", and then try to call it with {$entry.properties.ep_Test}, it doesn't output anything.

Also ...
by dakotaroar
Tue Nov 27, 2007 3:08 am
Forum: Plugins
Topic: How do I access Custom Field data on the PHP side of things?
Replies: 15
Views: 7829

Wow, print_r really is my friend!

Thanks for your patience, I've finally figured it out. It took a while of dealing with the arrays, but everything works now. Using POST was a good idea, it even saves having to do the database query.

Thanks again!
by dakotaroar
Mon Nov 26, 2007 5:08 pm
Forum: Plugins
Topic: How do I access Custom Field data on the PHP side of things?
Replies: 15
Views: 7829

Thank you! That is exactly what I was looking for.

Unfortunately I have run into another problem. When are the extended properties actually put into the database? I am trying to add a section of code that will run right after the entry is posted, but there seem to be no values that are accessible ...
by dakotaroar
Sat Nov 24, 2007 9:31 pm
Forum: Plugins
Topic: How do I access Custom Field data on the PHP side of things?
Replies: 15
Views: 7829

All I want to know is the structure of the array that serendipity_fetchEntryProperties($id) returns.

This is probably some misunderstanding of PHP on my part. How do I get a value back out of this array if I know that the property I am looking for is, for example, "CustomField1"?
by dakotaroar
Tue Nov 20, 2007 3:22 pm
Forum: Plugins
Topic: How do I access Custom Field data on the PHP side of things?
Replies: 15
Views: 7829

I'm not talking about my own plugin. All the other coding sections of this board have big labels that say "DON'T POST IF YOU AREN'T A DEVELOPER!!!!!", so I posted it here.

I don't have time to make a plugin. Maybe someone else will later, but all I am trying to do is make it work.

This code is ...
by dakotaroar
Mon Nov 19, 2007 11:10 pm
Forum: Plugins
Topic: How do I access Custom Field data on the PHP side of things?
Replies: 15
Views: 7829

I don't know how this will help you any more, but maybe you can tell me how this entry_properties array should be called?

I already have $entry['id'] at this point. All I want to know is how to get into what I have called $entry_properties. It's probably something really stupid.


/* ADDED CODE ...
by dakotaroar
Fri Nov 16, 2007 4:04 pm
Forum: Plugins
Topic: How do I access Custom Field data on the PHP side of things?
Replies: 15
Views: 7829

I have no idea how to use hooks. I just want to hard code this for now to see if it will work, and then it may take someone else to make it into a real plugin.

Can't I just use serendipity_fetchEntryProperties($id)? That seems to be the most appropriate way to do this.