Best of joomla gives you news, joomla templates, tutorials and websites about Joomla , FireBoard and FireMessage official page.
| No account yet?   |
The FireBoard forum component development is still going on. In order to get better, FireBoard will be moved from the Best of Joomla website.
During this transition period, the forum in Best of Joomla will be closed to new posts.
Welcome, Guest
Please Login or Register.    Lost Password?
FireBoard Manual Latest release discussions Download FireBoard
Allow a user to delete their own post (1 viewing) (1) Guest
TOPIC: Allow a user to delete their own post
#30948
Allow a user to delete their own post 1 Year, 1 Month ago  
Usual disclaimers: don't blame me if it breaks, back it up, and so on

Step 1: Allow the delete button to be seen by the author.

File: /components/com_firboard/template/default/view.php

Look for the link with func=post&do=delete in it. Change the code around if ($is_moderator) as follows:

[code:1] // TCC HACKS FOR AUTHOR TO DELETE THEIR POST
if ($fbConfig['useredit'] && $my_id != '' && $my_id == $fmessage->userid) {
$showedDelete = 1;
} else if ($is_moderator) {
$showedDelete = 1;
} else {
$showedDelete = 0;
}

//Offer an moderator the delete link
//if ($is_moderator)
if ($showedDelete)
// END TCC HACK[/code:1]

[b]Step 2: Allow the user to delete the post[/b]

File: /components/com_firboard/template/default/post.php

Look for the [b]do == 'delete'[/b] code, change as follows:

[code:1] else if ($do == "delete"«»)
{
// TCC HACKS FOR AUTHOR TO DELETE THEIR POST
$id = (int)$id;
$database->setQuery("SELECT * FROM #__fb_messages WHERE id=$id"«»);
$message = $database->loadObjectList();

foreach ($message as $mes)
{
if ($fbConfig['useredit'] && $my_id != '' && $my_id == $mes->userid) {
// OK, do nothing
} else if (!$is_moderator) {
die("Hacking Attempt!"«»);
}
// END TCC HACK
?>

[/code:1]

And then look for the [b]do == 'deletepostnow'[/b] code and change as follows:

[code:1] else if ($do == "deletepostnow"«»)
{
// TCC HACKS FOR AUTHOR TO DELETE THEIR POST
$id = (int)mosGetParam($_POST, 'id', '');
$dellattach = mosGetParam($_POST, 'delAttachments', '') == 'delAtt' ? 1 : 0;

$database->setQuery("SELECT * FROM #__fb_messages WHERE id=$id"«»);
if ($message = $database->loadObjectList())
{
if ($fbConfig['useredit'] && $my_id != '' && $my_id == $message[0]->userid) {
// OK, continue
} else if (!$is_moderator) {
die("Hacking Attempt!"«»);
}
}
// END TCC HACK
$thread = fb_delete_post($database, $id, $dellattach);[/code:1]

Hacks sponsored by Toowoomba City Council (Australia)
masterchief (User)
Fresh Boarder
Posts: 7
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
Andrew Eddie
Joomla! Development Coordinator
www.jxtended.com
 
 
#30979
Re:Allow a user to delete their own post 1 Year, 1 Month ago  
Is it possible for you to put a time limit on this?
TDN (User)
Junior Boarder
Posts: 25
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
#31918
Re:Allow a user to delete their own post 1 Year, 1 Month ago  
The only problem with this hack is when the person has the parent post of a topic this will allow them to delete the entire topic including children that they didn't create.

I'll post a fix for this in a bit (along with the code that allows you to put a time limit on this from the usereditTimeGrace configuration value (thanks for the suggestion TDN) )
jabberwock (User)
We're flying today.
Junior Boarder
Posts: 43
graphgraph
User Offline Click here to see the profile of this user
Dynamic Code Works michaelmiller1 @nospamrm @hotmail.com Location: Canada
Logged Logged
 
We are what we repeatedly do. Excellence, then, is not an act, but a habit - Aristotle
 
 
#31922
Re:Allow a user to delete their own post 1 Year, 1 Month ago  
I don't see that as a problem. Some forums allow you to do this. How about a different version of the hack? One that does. One that doesn't.
grumblemarc (User)
Platinum Boarder
Posts: 3559
graph
User Offline Click here to see the profile of this user
Gender: Male
Logged Logged
 
 
#31925
Re:Allow a user to delete their own post 1 Year, 1 Month ago  
I'm just thinking about this still. I've got a version which deletes the whole thread if the person deletes the Forum Topic (with it using the time limits), but it seems that in a many cases allowing a person to delete a full thread that has a hundred posts under it seems like a bad thing to do.

(think a person with a grudge decides that they don't like the forum and delete all their posts (many of which are Forum Topic posts and so deletes many other users posts in the forums))

I'm thinking on erring on the delete only one post for the user is the way to go.

Also trying to decide if the time limit should be based on the usereditTime and usereditTimeGrace variables in the configuration file (like I have it in my testing version) or create a new configuration variable userDeleteTime that can be set to a different time.
jabberwock (User)
We're flying today.
Junior Boarder
Posts: 43
graphgraph
User Offline Click here to see the profile of this user
Dynamic Code Works michaelmiller1 @nospamrm @hotmail.com Location: Canada
Logged Logged
 
We are what we repeatedly do. Excellence, then, is not an act, but a habit - Aristotle
 
 
#32116
Re:Allow a user to delete their own post 1 Year, 1 Month ago  
the hack is not working at alll


Parse error: syntax error, unexpected T_ELSE in /home/********/public_html/joomla/components/com_fireboard/template/default/post.php on line 805
manhag (User)
Junior Boarder
Posts: 84
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
idont hate a fireboard moderator

karma [size=4][color=#c0c9c0][u][url=www.bestofjoomla.com/component/option,co...rease/userid,897/pid
 
 
#32119
Re:Allow a user to delete their own post 1 Year, 1 Month ago  
Sounds like you're running PHP5. Please check that all of the FB requirements are being met.
grumblemarc (User)
Platinum Boarder
Posts: 3559
graph
User Offline Click here to see the profile of this user
Gender: Male
Logged Logged
 
 
#33254
Re:Allow a user to delete their own post 1 Year, 1 Month ago  
Well, if there's going to be problems with users deleting an entire topic, then perhaps Fireboard could implement a Trash Can (like how IPB & vBulletin work). Alternatively, prevent users from deleting the first post of a topic, unless it has zero replies.
TDN (User)
Junior Boarder
Posts: 25
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
#43576
Re:Allow a user to delete their own post 11 Months ago  
Please, improve the code so that Owner of the thread can delete his/her own post and thread within a specified Category specified by Admin from the FB-Backend (like Category property)

It will be a complete MOD.
iosoft (User)
FB Quality & Testing Team
Senior Boarder
Posts: 481
graphgraph
User Offline Click here to see the profile of this user
Gender: Male futureiosoft Location: Kolkata, INDIA Birthdate: 1981-08-06
Logged Logged
 
Developer: FB-Poll System, FB-Joomap plugin, FB-OpenSEF extension, FB-Primezilla Hacker, Fireboard WAP.
Vote my site- GigaHertZ
 
 
#51428
Re:Allow a user to delete their own post 7 Months, 2 Weeks ago  
Is there no way that this can be done on the configuration page?

Will this ONLY allow the user to delete their posts?

Thank you
daforuiner (User)
Fresh Boarder
Posts: 18
graphgraph
User Offline Click here to see the profile of this user
Logged Logged
 
 
Go to top