Some one please put me out of my misery. I've been reading so much my head spins and I'm still not getting it.
I've taken out the template code and resorted to hard coding it into there for now - just to get things moving, if I can.
So please what am I missing?
newthread_post_start
PHP Code:
$vbulletin->input->clean_gpc('p','stickyfirstpost', TYPE_BOOL);
$newpost['stickyfirstpost'] =& $vbulletin->GPC['stickyfirstpost'];
threaddata_start & threadfpdata_start
PHP Code:
$this->validfields['stickyfirstpost'] = array(TYPE_BOOL, REQ_NO);
threadmanage_update
PHP Code:
$vbulletin->input->clean('p', 'stickyfirstpost', TYPE_BOOL);
$threadman->setr('stickyfirstpost', $vbulletin->GPC['stickyfirstpost']);
newthread template additions
PHP Code:
<!-- Sticky Posts -->
<div style="padding:{vb:stylevar formspacer}px">
<div class="blockrow">
<label>{vb:rawphrase stickyfirstpost_options}:</label>
<ul class="checkradio group rightcol">
<li>
<label for="stickyfirstpost"><input type="checkbox" class="bginput" name="stickyfirstpost" value="{vb:var threadinfo['stickyfirstpost']}" tabindex="1" /> {vb:phrase stickyfirstpost_name}</label>
<p class="description">{vb:phrase stickyfirstpost_desc}</p>
</li>
</ul>
</div>
<!-- end Stick Posts -->
--------------- Added [DATE]1374489104[/DATE] at [TIME]1374489104[/TIME] ---------------
Well as it was all quiet in here, no one replying I thought I'd fix the darned thing myself
Turns out it was so simple and relates to the template additions. I'm using a check box, but in order for it to work it must have a value of "1".
I found this by using the HttpFox plugin and watching the post variables. It was sending 'stickyfirstpost' but it was always empty. So setting the value to "1" meant once it was ticked the value passed was then "1". I imagine I should really be checking to see if 'stickyfirstpost' is checked - not the value, as the value is meaningless.
but here it is fixed.
PHP Code:
<!-- Sticky Posts -->
<div style="padding:{vb:stylevar formspacer}px">
<div class="blockrow">
<label>{vb:rawphrase stickyfirstpost_options}:</label>
<ul class="checkradio group rightcol">
<li>
<label for="stickyfirstpost"><input type="checkbox" class="bginput" name="stickyfirstpost" value="1" tabindex="1" /> {vb:phrase stickyfirstpost_name}</label>
<p class="description">{vb:phrase stickyfirstpost_desc}</p>
</li>
</ul>
</div>
<!-- end Sticky Posts -->