Previous Thread
Next Thread
Print Thread
Rate Thread
#280649 10/10/2004 4:07 PM
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.

Sponsored Links
landyphil #280650 10/10/2004 8:54 PM
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
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.

landyphil #280651 10/11/2004 3:15 AM
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
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
Post deleted by Zarzal

Sponsored Links
landyphil #280654 10/11/2004 10:34 AM
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 ?

landyphil #280655 10/11/2004 11:56 AM
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
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.

domain123 #280656 10/11/2004 12:26 PM
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.

landyphil #280657 12/14/2004 3:54 PM
Joined: Aug 2000
Posts: 1,609
Addict
Addict
Offline
Joined: Aug 2000
Posts: 1,609
I'd be interested in knowing the progress of this, and offering any help I can if needed.

eslmix #280658 12/14/2004 4:45 PM
Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
we made a litte other solution. We use a combination of the 'article layout hack', a own html page and some modifications of the article layout. Its not finished yet, but it works. Sample:

http://www.dragonclan-forum.de/ubbthreads/postlist.php/Cat/0/Board/blog

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)