|
Joined: Jul 2001
Posts: 808
Coder
|
Coder
Joined: Jul 2001
Posts: 808 |
At first: I hate blogs Its waste of time in my eyes. Some people on my board ask my about a way to post blogs in Threads. They should be public readable but only editable by topic starter. As I know, there is no included way to do this. Have anyone seen a modification that do something like this: Only one forum is a special forum. In this forum every registered user have creation rights for new topics. No user have the rights to post replys in any thread except in his own started thread. Mods and Admins have normal rights.
|
|
|
|
Joined: May 2001
Posts: 550
Code Monkey
|
Code Monkey
Joined: May 2001
Posts: 550 |
Well....this would go like this: In newreply.php you would build a check if we are in this special forum, and then if the replier is either the topic starter, a mod or an admin. If not send them an error message. An easy mod to do.
|
|
|
|
Joined: May 2001
Posts: 550
Code Monkey
|
Code Monkey
Joined: May 2001
Posts: 550 |
Here you go, untested code, curious if it will work.
in rewreply.php line ~124
find:
// Check to see if they can reply to this thread $query = " SELECT B_Sticky,B_Status FROM {$config['tbprefix']}Posts WHERE B_Number='$Main' "; $sth = $dbh->do_query($query,__LINE__,__FILE__); list($issticky,$bstatus) = $dbh->fetch_array($sth); if ($issticky == "2" && ($user['U_Status'] != "Administrator")) { $html->not_right($ubbt_lang['NO_R_ANNOUNCE'],$Cat); }
replace with:
// Check to see if they can reply to this thread $query = " SELECT B_Sticky,B_Status,B_PosterId FROM {$config['tbprefix']}Posts WHERE B_Number='$Main' "; $sth = $dbh->do_query($query,__LINE__,__FILE__); list($issticky,$bstatus,$mainposterid) = $dbh->fetch_array($sth); if ($issticky == "2" && ($user['U_Status'] != "Administrator")) { $html->not_right($ubbt_lang['NO_R_ANNOUNCE'],$Cat); }
// --------------------------------------------------------------------------- // If we are in the special forum and not a admin or mod //and not the user that started the thread they can't proceed if (($Board == "short_name_of_the_special_forum") && ($user['U_Number'] != $mainposterid) && ($user['U_Status'] != "Administrator") && ($user['U_Status'] != "Moderator") ){ $html -> not_right("This is the special Blog forum, you can only reply to your own threads!",$Cat); }
|
|
|
|
Joined: Jul 2001
Posts: 808
Coder
|
Coder
Joined: Jul 2001
Posts: 808 |
Post deleted by Zarzal
Last edited by Zarzal; 10/11/2004 7:51 AM.
|
|
|
|
Joined: Jul 2001
Posts: 808
Coder
|
Coder
Joined: Jul 2001
Posts: 808 |
|
|
|
|
Joined: Jul 2001
Posts: 808
Coder
|
Coder
Joined: Jul 2001
Posts: 808 |
it works so far, but only the reply function is not checked by this way. You can enter a quickreply anyway. I cant find out where is the difference between reply and quick reply. There is no own quickreply.php and in newreply i cant find the right place to put a check in. Can you help me again ?
|
|
|
|
Joined: May 2001
Posts: 550
Code Monkey
|
Code Monkey
Joined: May 2001
Posts: 550 |
ok...quickreply gives its data to addpost.php
So, in addpost.php
search for: if ($Main) { $query = " SELECT B_Board FROM {$config['tbprefix']}Posts WHERE B_Number='$Main' "; $sth = $dbh->do_query($query,__LINE__,__FILE__); list($Board) = $dbh->fetch_array($sth); }
Insert underneath:
if ($Main) {
// Check to see if they can reply to this thread $query = " SELECT B_Sticky,B_Status,B_PosterId FROM {$config['tbprefix']}Posts WHERE B_Number='$Main' "; $sth = $dbh->do_query($query,__LINE__,__FILE__); list($issticky,$bstatus,$mainposterid) = $dbh->fetch_array($sth); if ($issticky == "2" && ($user['U_Status'] != "Administrator")) { $html->not_right($ubbt_lang['NO_R_ANNOUNCE'],$Cat); }
// --------------------------------------------------------------------------- // If we are in the special forum and not a admin or mod //and not the user that started the thread they can't proceed if (($Board == "short_name_of_the_special_forum") && ($user['U_Number'] != $mainposterid) && ($user['U_Status'] != "Administrator") && ($user['U_Status'] != "Moderator") ){ $html -> not_right("This is the special Blog forum, you can only reply to your own threads!",$Cat); } }
This should work, but again, I didn't test it.
|
|
|
|
Joined: Jul 2001
Posts: 808
Coder
|
Coder
Joined: Jul 2001
Posts: 808 |
YES, this looks good. *bows* I will do some wordlets for this if I find the time. Thank you.
|
|
|
|
Joined: Aug 2000
Posts: 1,609
Addict
|
Addict
Joined: Aug 2000
Posts: 1,609 |
I'd be interested in knowing the progress of this, and offering any help I can if needed.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 5,833
Joined: January 2000
|
|
Forums63
Topics37,573
Posts293,925
Members13,849
|
Most Online5,166 Sep 15th, 2019
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|