Joined: Jun 27, 2004 Posts: 38 Location: San Antonio, TX
Posted:
Sun Jul 04, 2004 11:54 am
I know that there used to be a way to fix this, but I haven't been able to find the answer anywhere. It's been a while since I last 'nuked' a webpage, and so I can't remember how this was fixed before.
I am using the scrolling forums block downloaded from this site, of course.
Joined: Jun 27, 2004 Posts: 38 Location: San Antonio, TX
Posted:
Sun Jul 04, 2004 1:21 pm
Hmm...I'll have to try that. I was hoping for something more along the lines of making it so that no forums marked as private will be displayed, so that I don't have to add each forum by it's ID, but I will try this.
I would experiement myself, but my coding skills are a joke. If you ever have a Cisco question, I'm yer man, but otherwise, I'm clueless.
Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Sun Jul 04, 2004 1:26 pm
I have that post somewhere too - I'll have to dig it out. Wait a minute! If you use the collapsing block like I do, or even if you just get the code, it's already in there. In that case you set a variable like
$HideViewReadOnly = 1;
and then trace the logic to see how it's done
Joined: Jun 27, 2004 Posts: 38 Location: San Antonio, TX
Posted:
Sun Jul 04, 2004 1:41 pm
Honestly, I prefer the scrolling forums block to the center collapsing block. I really don't like the center block all that much, as I find that it's a but intrusive. I prefer all my extra stuff to be in blocks on the left or right. Besides, the scrolling is just so kewl.
I'll keep looking into it, and if one of your suggestions or something else I find works, I'll post it here.
$result1 = sql_query("SELECT DISTINCT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id, f.auth_read
FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f,".$prefix."_bbuser_group a, ".$prefix."_bbauth_access b
where t.forum_id=f.forum_id and
f.forum_id=b.forum_id and
b.group_id=a.group_id and
(( a.user_id='$userid' and (b.auth_view = 1 or b.auth_mod = 1 )) OR f.auth_read = 0)
ORDER BY t.topic_last_post_id DESC LIMIT 20", $dbi);
Okay, I went through and tired to compare the differences, but when I tried to put them all together, I must have messed something up, because it didn't work.
Does anyone else want to show me what I need to combine to get the results I want? [/quote]
Joined: Aug 27, 2002 Posts: 16987 Location: Kansas
Posted:
Sun Jul 04, 2004 3:45 pm
JediStryker wrote:
Honestly, I prefer the scrolling forums block to the center collapsing block. I really don't like the center block all that much, as I find that it's a but intrusive. I prefer all my extra stuff to be in blocks on the left or right. Besides, the scrolling is just so kewl.
I'll keep looking into it, and if one of your suggestions or something else I find works, I'll post it here.
I wasn't suggesting that you use it . I was just saying the logic is in there. Just extract it and use it
Last edited by Raven on Sun Jul 04, 2004 4:09 pm; edited 1 time in total
Joined: Jun 27, 2004 Posts: 38 Location: San Antonio, TX
Posted:
Sun Jul 04, 2004 9:24 pm
Now getting this error:
Quote:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /hsphere/local/home/pmmicha/dark-frontier.com/includes/sql_layer.php on line 286
above the block, and the block is still there, but there's no posts being shown in the block.
Seems like you're on the right path, but it's still not working.
Honestly, I would help here, but I have absolutely no idea what I'm looking for.
$result = $db->sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id, u.username, u.user_id, p.poster_id, FROM_UNIXTIME(p.post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f LEFT JOIN ".$prefix."_bbposts p ON (p.post_id = t.topic_last_post_id) LEFT JOIN ".$prefix."_users u ON (u.user_id = p.poster_id) WHERE t.forum_id=f.forum_id AND f.auth_view=0 ORDER BY t.topic_last_post_id DESC LIMIT 20");
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_name, $forum_id, $username, $user_id, $poster_id, $post_time) = $db->sql_fetchrow($result)) {
Joined: May 02, 2003 Posts: 1396 Location: Puerto Rico
Posted:
Sun Jul 04, 2004 10:11 pm
The queries are the same originally found on the block (see above), i only edited one of them so that it filters what posts to show, at quick glance i'd say the second query gets the id of the person that posted and the third one grabs the username.
Joined: Jun 27, 2004 Posts: 38 Location: San Antonio, TX
Posted:
Mon Jul 05, 2004 9:18 am
Alright, we've sort of gone full-circle here...it's scrolling and looks beautiful again, but it's still showing the private forums. I tested and made sure, and you can see the forums in the block, but not in the board itself. You can also not click to them from the block.
You can see these forums whether you're logged in as Guest, a regular member, or Admin in the block, but only myself or those with permissions to the forums can access them.
$result1 = sql_query("SELECT DISTINCT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id, f.auth_read
FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f,".$prefix."_bbuser_group a, ".$prefix."_bbauth_access b
where t.forum_id=f.forum_id and
f.forum_id=b.forum_id and
b.group_id=a.group_id and
(( a.user_id='$userid' and (b.auth_view = 1 or b.auth_mod = 1 )) OR f.auth_read = 0)
ORDER BY t.topic_last_post_id DESC LIMIT 20", $dbi);
$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);
$result3 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'", $dbi);
list($username, $user_id)=sql_fetch_row($result3, $dbi);
$topic_title=parseEmoticons($topic_title);
// Remove the comment below to add the counter
//$content .="<STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Message: $count<br></b>";
$content .= "<img src=\"modules/Forums/templates/subSilver/images/icon_mini_message.gif\" border=\"0\" alt=\"\"><a href=\"forums.html&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a><br><font color=\"#666666\"><i>Last post by <A HREF=\"profile-.html$user_id\"STYLE=\"text-decoration: none\"> $username </a> in <a href=\"forums.html&file=viewforum&f=$forum_id\">$forum_name</a> on $post_time</i></font><br><br>";
$count = $count + 1;
}
$content .= "<br><center>[ <a href=\"forums.html\"STYLE=\"text-decoration: none\">$sitename ]</center>";
?>
This was in a file I downloaded from their site, so I don't know if you can use it or not; if you can, though, you might want to change the one you're suppyling so that it automatically doesn't show private forum posts to those who aren't authorized to see them. Only catch is that it requires the smileys.php file, but I bet you could change that.
Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Wed May 17, 2006 5:49 am
Quote:
Shouldn't the download be updated to include the code so this doesn't happen again?
Well, I am sure if Raven had the time to review all his downloads, assuming they are all his (which is not a valid assumption), then the answer is "yes", at least where the above patch would be made (actually it has even changed since then, but the above still works).
Regarding the private topics, try something like this post here:
Only registered users can see links on this board! Get registered or login to the forums!
That worked to supress the forums that I don't want the public to see.
This will solve the problem for now. In the future I hope this block can work the way we want..
Thanks for the suggestion/help, now I can use the block on my homepage!
The result code now look like:
Code:
$result1 = sql_query("SELECT topic_id, topic_last_post_id, topic_title FROM ".$prefix."_bbtopics where forum_id NOT IN(10,11) ORDER BY topic_last_post_id DESC LIMIT $amount", $dbi);
Is there anyway that the block can be set so that a query is made to the database to see which groups a user belongs to then only the posts within those groups are shown? At the moment, the way it's working for me is that everyone can see ALL of the topics but they just can't access them all. I don't want people to be able to see subjects that they can't access
Joined: Aug 29, 2004 Posts: 9136 Location: Arizona
Posted:
Fri Mar 09, 2007 6:06 am
I am sure that it is possible, but it would take heavy customization. I have only seen blocks which have an "exclusion list" for excluding certain forums, but not one that takes forum group permissions into account.
That would be quite the handy block though. Wish I had the time to develop it.
Joined: Apr 06, 2006 Posts: 2415 Location: Iowa, USA
Posted:
Fri Mar 09, 2007 8:15 am
I made a block to show the latest forum posts and it hides private forums. It looks like you got an answer, but if you would like to see the SQL I came up with for comparison, see this thread:
Only registered users can see links on this board! Get registered or login to the forums!
I hane a forums latest port block that will only shiow topics to the correct auths ie Public, Registered and Private stuff. It's coded for the Helius Theme, but you should be able to rip the code out/ recode to your needs.
Post a reply or PM and I'll try to help sort you out.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum