UBB.Dev
Posted By: Zarzal V6.5 and Blogs - 10/10/2004 11:07 PM
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.
Posted By: Anno Re: V6.5 and Blogs - 10/11/2004 3:54 AM
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.
Posted By: Anno Re: V6.5 and Blogs - 10/11/2004 10:15 AM
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);
}
Posted By: Zarzal Re: V6.5 and Blogs *DELETED* - 10/11/2004 1:46 PM
Post deleted by Zarzal
Posted By: Zarzal Re: V6.5 and Blogs *DELETED* - 10/11/2004 3:23 PM
Post deleted by Zarzal
Posted By: Zarzal Re: V6.5 and Blogs - 10/11/2004 5:34 PM
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 ?
Posted By: Anno Re: V6.5 and Blogs - 10/11/2004 6:56 PM
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.
Posted By: Zarzal Re: V6.5 and Blogs - 10/11/2004 7:26 PM
YES, this looks good. *bows*
I will do some wordlets for this if I find the time. Thank you.
Posted By: AKD96 Re: V6.5 and Blogs - 12/14/2004 10:54 PM
I'd be interested in knowing the progress of this, and offering any help I can if needed.
Posted By: Zarzal Re: V6.5 and Blogs - 12/14/2004 11:45 PM
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
© UBB.Developers