Support Forum
In sp-topic-view-class.php
Within sp_topicview_query(), lines 270-296
The "Is this post to be edited" code is repeated. The second instance goes a bit further and adds edit history.
# Is this post to be edited? if ($sfvars['displaymode'] == 'edit' && $sfvars['postedit'] == $r->post_id) { $t[$tidx]->editmode = 1; $t[$tidx]->editpost_id = $r->post_id; $t[$tidx]->editpost_content = sp_filter_content_edit($r->post_content); $t[$tidx]->posts[$pidx]->editmode = 1; } # Add edit history if ($r->post_edit) { $edits = unserialize($r->post_edit); $eidx = 0; foreach ($edits as $e) { $t[$tidx]->posts[$pidx]->edits[$eidx]->by = $e['by']; $t[$tidx]->posts[$pidx]->edits[$eidx]->at = $e['at']; $eidx++; } } # Is this post to be edited? if ($sfvars['displaymode'] == 'edit' && $sfvars['postedit'] == $r->post_id) { $t[$tidx]->editmode = 1; $t[$tidx]->editpost_id = $r->post_id; $t[$tidx]->editpost_content = sp_filter_content_edit($r->post_content); $t[$tidx]->editpost_history = $r->post_edit; $t[$tidx]->posts[$pidx]->editmode = 1; }
The database column is called 'post_edits' and in the first cut of the code (the bit I commented out) I was passing that column. But is is a serialized array and I wanted to explode it to a normal array and format it along the way which is what the bit in the middle does. I then pass it as 'edits' instead of 'post_edits'. I could pass both but it seems redundant.
Reckon I copied the block - pasted it above - removed the post_edits line and then wrote the new piece below. Just forgot to remove the old block.
But... that is why the code is commented out and not removed. Just in case I am wrong... 🙂
YELLOW
SWORDFISH
|
hey, we appreciate your help around here!
Visit Cruise Talk Central and Mr Papa's World
1 Guest(s)