Welcome to Geeklog, Anonymous Monday, November 25 2024 @ 07:52 am EST
Geeklog Forums
forum hack that shows who and when the topics was last edited
this is how i did it. this is a dirty hack but its working properly. you must back up your database and the files you are going to edit...
add these 4 database fields to your forum topics database.
1. edited(tinyint, length 1, not null, defualt=0) - tells if a topic is edited.
2. lastedited(varchar, length 12, null, default=NULL) - time of last edit.
3.editby(varchar, length 50, null, default=null) - username of the one who edit the topic.
4. eid(mediumint, length 8, null, default=nulll) -uid of the one who edits the topic.
----forum/createtopic.php ----
at around line 61, look for this code
below that line, add this code
$edited = "1";
if($aname != '') {
$name = $aname;
}
at around line 85, look for this code
DB_query("UPDATE {$_TABLES['gf_topic']} SET subject='$subject',comment='$comment',postmode='$postmode', mood='$mood', sticky='$sticky', locked='$locked' WHERE (id='$editid')");
alter it so it would look like this
---forum/include/gf_showtopic.php----
at around line 93, inside function showtopic find this code
below that add these codes
if ($showtopic['edited'] == 1) {
$datee = COM_getUserDateTimeFormat($showtopic['lastedited']);
$dateedited = $LANG_GF01['EDITED']. ' ' .$datee[0];
$editby = '<b>' .$showtopic['editby']. '</b>';
$editedby='<A HREF="' .$_CONF['site_url'] .'/users.php?mode=profile&uid=' .$showtopic['eid']. '">' .$editby . '</a>';
}
set variables.
before this
$retval .= $topictemplate->finish ($topictemplate->get_var('output'));
add
$topictemplate->set_var ('last_edit', $dateedited);
$topictemplate->set_var ('editedby', $editedby);
at the root derictory
--plugins/forum/language/english.php--
add something like this
$LANG_GF01['EDITED'] = 'edited this post on';
---public_html/layout/yourtheme/forum/layout/topic.thtml---
find this
<td align="left" valign="top">{topic_comment}</td>
alter it so it would look something like this
<td align="left" valign="top">{topic_comment}<br><br><br><br> <i>{editedby} {last_edit}</i></td>
we are just shadows of our hidden identities
add these 4 database fields to your forum topics database.
1. edited(tinyint, length 1, not null, defualt=0) - tells if a topic is edited.
2. lastedited(varchar, length 12, null, default=NULL) - time of last edit.
3.editby(varchar, length 50, null, default=null) - username of the one who edit the topic.
4. eid(mediumint, length 8, null, default=nulll) -uid of the one who edits the topic.
----forum/createtopic.php ----
at around line 61, look for this code
Text Formatted Code
$editid = gf_applyFilter($HTTP_POST_VARS['editid'],true);below that line, add this code
Text Formatted Code
$edited = "1";
if($aname != '') {
$name = $aname;
}
at around line 85, look for this code
Text Formatted Code
DB_query("UPDATE {$_TABLES['gf_topic']} SET subject='$subject',comment='$comment',postmode='$postmode', mood='$mood', sticky='$sticky', locked='$locked' WHERE (id='$editid')");
alter it so it would look like this
Text Formatted Code
DB_query("UPDATE {$_TABLES['gf_topic']} SET subject='$subject',comment='$comment',postmode='$postmode', mood='$mood', sticky='$sticky', locked='$locked', lastedited='$date', edited='$edited', editor='$name', eid='$uid' WHERE (id='$editid')");---forum/include/gf_showtopic.php----
at around line 93, inside function showtopic find this code
Text Formatted Code
$date = COM_getUserDateTimeFormat($showtopic['date']);below that add these codes
Text Formatted Code
if ($showtopic['edited'] == 1) {
$datee = COM_getUserDateTimeFormat($showtopic['lastedited']);
$dateedited = $LANG_GF01['EDITED']. ' ' .$datee[0];
$editby = '<b>' .$showtopic['editby']. '</b>';
$editedby='<A HREF="' .$_CONF['site_url'] .'/users.php?mode=profile&uid=' .$showtopic['eid']. '">' .$editby . '</a>';
}
set variables.
before this
Text Formatted Code
$retval .= $topictemplate->finish ($topictemplate->get_var('output'));
add
Text Formatted Code
$topictemplate->set_var ('last_edit', $dateedited);
$topictemplate->set_var ('editedby', $editedby);
at the root derictory
--plugins/forum/language/english.php--
add something like this
Text Formatted Code
$LANG_GF01['EDITED'] = 'edited this post on';
---public_html/layout/yourtheme/forum/layout/topic.thtml---
find this
Text Formatted Code
<td align="left" valign="top">{topic_comment}</td>
alter it so it would look something like this
Text Formatted Code
<td align="left" valign="top">{topic_comment}<br><br><br><br> <i>{editedby} {last_edit}</i></td>
we are just shadows of our hidden identities
9
10
Quote
All times are EST. The time is now 07:52 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content