Welcome Guest, Not a member yet? Register   Sign In
CodeExtinguisher Release Candidate 11

[eluser]Majd Taby[/eluser]
The new release will fix that issue...among others with the ManyToMany and OneToMany plugins.

[eluser]wouldhide[/eluser]
thanks for the fast reply! i've figured out a temporary solution, i think it will be allright for a while.
my fingets itch to try the new version!

[eluser]minimal design[/eluser]
I have a datetime DB "posted" column for comments and CodeEx seems to bug out (I get: "the server unexpectedly dropped the connection" when trying to view the comments) with it, if I convert to a date field, it works fine, but of course I need the time too in order to get the comments in the right order. I could go with a timestamp, but I'm importing all the comments from another system and they're already formatted that way so I'd rather keep it the same if doable...

My question is: is a datetime plugin needed? Is it planned? or is there something else I'm missing?

Thanks!

[eluser]Majd Taby[/eluser]
you can use the Time plugin like so:

Code:
posted:
    class: Time
    params:
        -on_insert

The above will insert a unix timestamp when a record is inserted. The field in your database would be an int.

[eluser]minimal design[/eluser]
Right. But I was hoping to keep the datetime format which is already in place because I'm importing the data from another system + I like datetime better, it's easier to read if I'm messing around in the DB directly... Thanks!

[eluser]Majd Taby[/eluser]
In that case you can simply copy/paste the Time plugin, rename it, and modify the prepForDb and prepForDisplay functions.

[eluser]minimal design[/eluser]
[quote author="jTaby" date="1209413796"]In that case you can simply copy/paste the Time plugin, rename it, and modify the prepForDb and prepForDisplay functions.[/quote]

cool, I'll look into that. Thanks again.

EDIT: Actually, I just need to see the content of that field in the admin, the posted date is entered in DB via comment form on site, not in admin, so a simple TextBox class in the definition YAML actually does the trick... sometimes you just don't think about the obvious (well, I don't... Wink

[eluser]tylderdurden[/eluser]
When adding info to the database, it seems like <object> tags get stripped out (well, converted to html entities). How do I prevent that?

Seems like iframes get stripped out too.

jTaby?

[eluser]Majd Taby[/eluser]
you can create your own plugin (or just modify the TextArea plugin...which I am assuming you're using) to override the prepForDb function.. The prepForDb function filters away all HTML to prevent XSS attacks.

[eluser]tylderdurden[/eluser]
[quote author="jTaby" date="1209461845"]you can create your own plugin (or just modify the TextArea plugin...which I am assuming you're using) to override the prepForDb function.. The prepForDb function filters away all HTML to prevent XSS attacks.[/quote]

I have this in my plugin class

Code:
function prepForDB($value){
        return $value;
    }
Doesnt seem to work though?




Theme © iAndrew 2016 - Forum software by © MyBB