PDA

View Full Version : edit post subject & icon?


Peter Porker
09-18-2001, 05:09 PM
I've done a search, and near as I can tell, this doesn't exist for v2.0.3

Can someone come up with a hack that would allow users to edit the subject heading and icon of their own posts (and if the post is the thread-starter, also have it update the thread title)?

I had devised my own hack for this in v1.1.6, but I'm having no success at all with v2.0.3 and I suspect I'm not the only one who would find this useful.

As a side-note, if someone attempts this, please watch out that an edited reply does not change the subject heading in the post which starts a thread...a small snag I ran into on the earlier version (I solved it, but it was a snag none the less).

I'd just like to be able to update thread-starting titles & icons, that's all.

Hope I haven't missed the obvious.... ;)

Admin
09-18-2001, 05:16 PM
For posts (non-thread-starters) this is possible.

The thing about threads is that title and icon are stored in two tables, post and thread.
In the post - for displaying on showthread.
And in the thread table - for displaying on forumdisplay.

This can probably be solved in no time.

Admin
09-18-2001, 05:22 PM
In editpost.php, replace this:
$DB_site->query("DELETE FROM searchindex WHERE postid=$postid");
indexpost($postid);
with
if ($isfirst) {
$DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."',iconid='$iconid' WHERE postid='$postid'");
}
$DB_site->query("DELETE FROM searchindex WHERE postid=$postid");
indexpost($postid);
that should work.

Peter Porker
09-18-2001, 06:09 PM
WOW!!! Very very close! The rest of it was obvious after you cleared away the cobwebs for me...

The working substitution is acually like this:

replace this:
$DB_site->query("DELETE FROM searchindex WHERE postid=$postid");
indexpost($postid);

with this:
if ($isfirst) {
$DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',iconid='$iconid' WHERE postid='$postid'");
$DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."',iconid='$iconid' WHERE threadid='$threadid'");
}
$DB_site->query("DELETE FROM searchindex WHERE postid=$postid");
indexpost($postid);

That will allow thread titles & icons to be edited without being affected by similarly edited replies.
Both work perfectly now...THANKS A BUNCH, DUDE!!!...my headache is fading already. :D