Fuhrmann
Well-known member
Is it any differant? I couldn't get the one on here to work ever.
Same. What's the probem? Error?
Is it any differant? I couldn't get the one on here to work ever.
I would keep trying to add the database to the connection string's url at the begining. example "xenforo.mywebsite.com" Xenforo being the databaseSame. What's the probem? Error?
Same. What's the probem? Error?
<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
Same problem here too, running xf 1.2.3.Got all the way to the end with little trouble. However, when hitting Send Message, it says "Route simpletext/write could not be found." Something change in the new version of Xenforo that might be causing it? I've gone so far as to to copy and paste the tutorial just to be sure there were no typos.
This is embarrassing, but, my problem was due to the fact that I had the add-on disabled (while testing other stuff). Enabling the add-on again got it working as advertised.Same problem here too, running xf 1.2.3.
Has anyone managed to find a solution?
Thanks for creating this tutorial. It's helpful, but Step 5 lost me.
And, finally, how would you actually go about writing a new entry to the xf_simple_text table?
- What is the purpose of defining all of the fields and their type in _getFields()?
- What is _getUpdateCondition($tableName) and what does it actually do? What do you mean by getting the "SQL condition"?
- Why is _getSimpleTextModel() useful to have in the DataWriter?
//Create a instance of our DataWriter
$dwSimpleText = XenForo_DataWriter::create('SimpleText_DataWriter_SimpleText');
//Set the field with the data we filtered
$dwSimpleText->set('simple_text', 'YOUR TEXT HERE');
//Save in the database
$dwSimpleText->save();
Yeah, somehow I got mine working again, too. Then I had to step away from it a bit. Can't quite remember why it started working, but as I recall, I had something configured elsewhere wrong.This is embarrassing, but, my problem was due to the fact that I had the add-on disabled (while testing other stuff). Enabling the add-on again got it working as advertised.
Thanks for this resource. With that said, this is a crap ton of code for a simple database write and read. I guess this the way intended by xenforo but then again it has turned what should have only required 5 lines of code into dozens of lines of needless code.
On step 10 you have to add
PHP:<input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
Otherwise you get a security error.
IDK if there's another work around but I just searched the error and that's the line that seems to be suggested to solve the security error.
Great tutorial
We use essential cookies to make this site work, and optional cookies to enhance your experience.