Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Tue Aug 16, 2005 1:59 am Reply with quote

Note: Topic was split by Admin into a new Feature Request as it was burried in a Bug Report

While I am here (and not enough time to make another post in the appropriate forum) one feature I would like to see with regard to pulling the forum posts into the news letter is the ability to block specific forum categories from being displayed in the results.
I dont think this needs to have bells and whistles admin settings just a simple file edit a user could make to one file variable would be good.

I do have some code that my good friend Raven wrote for me for a center forum block so I can send this to you (for a sample DB call/ select statement) if you think it might be a good idea for V1.3
I only mention this as more and more people seem to be using forum hacks to either insert mail into forums (CM2F), or news into forums and now even RSS feeds into forums - sometimes this results in information overload so being able to switch some forum cats off might be really useful.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Aug 16, 2005 9:27 am Reply with quote

Guardian,

Another excellent idea! Thank you! Actually, feel free to post the sample code here or in a PM. I have decided that although I usually like to figure out my own coding, as it helps me learn even more along the way, I am quickly finding out that my time is a limited commodity. Very Happy

Thanks!
montego

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Tue Aug 16, 2005 10:37 am Reply with quote

My pleasure to enclose the code;
Code:
<?php

########################################################################
# PHP-Nuke Block: Helius Center Forum Block v.9                        #
# Made for PHP-Nuke 6.* and the phpbb2 Nuke port 2.06 only             #
# Modified to incorporate my site theme - Guardian                     #
# Made by coldblooded http://www.nukemods.com                          #
########################################################################
# This program is free software. You can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License.       #
# If you modify this, let me know for fun. =)                          #
########################################################################
## Modified by Gaylen Fraley (aka Raven) 8/13/2005 to allow blocking  ##
## certain categories. Also changed $dbi calls to $db                 ##
########################################################################

if (eregi("block-LIMITED_CAT_CENETER_FORUM.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}
global $user_prefix, $db, $theme, $sitename, $admin, $bgcolor1, $bgcolor2, $bgcolor4;

$HideViewReadOnly = 1;
$Last_New_Topics  = 5;
$ThemeSel = get_theme();
$show = "  <tr>
    <td bgcolor=\"#FABF0D\" height=\"25\" colspan=\"6\" align=\"center\" background=\"themes/$ThemeSel/forums/images/top_center.gif\"></td>
  </tr>
</table></td>
        </tr>
      </table></td>
  </tr>
</table>";

$Count_Topics = 0;
$Topic_Buffer = "";

$catIdsToSkip = '17'; // enter cat ID'd to be removed
// retrieve DB data
$sql = "SELECT t.topic_id, f.forum_id, t.topic_last_post_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_moved_id FROM ".$user_prefix."_bbtopics t, ".$user_prefix."_bbforums f where f.cat_id NOT IN($catIdsToSkip) AND t.forum_id=f.forum_id ORDER BY topic_last_post_id DESC";
$result = $db->sql_query($sql);

while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = $db->sql_fetchrow( $result) )

{
// finished data retreival
   $skip_display = 0;
   if( $HideViewReadOnly == 1 )
   {
      $result2 = $db->sql_query( "SELECT auth_view, auth_read FROM ".$user_prefix."_bbforums where forum_id = '$forum_id'");
      list( $auth_view, $auth_read ) = $db->sql_fetchrow( $result2 );
      if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }
   }

   if( $topic_moved_id != 0 )
   {
     // Shadow Topic !!
      $skip_display = 1;
   }

   if( $skip_display == 0 )
   {
     $Count_Topics += 1;

$result2 = $db->sql_query("SELECT username, user_id FROM ".$user_prefix."_users where user_id='$topic_poster'");
list($username, $user_id)=$db->sql_fetchrow($result2);
$avtor=$username;
$sifra=$user_id;

$result3 = $db->sql_query("SELECT poster_id, FROM_UNIXTIME(post_time,'%m/%d/%Y at %H:%i') as post_time FROM ".$user_prefix."_bbposts where post_id='$topic_last_post_id'");
list($poster_id, $post_time)=$db->sql_fetchrow($result3);

$result4 = $db->sql_query("SELECT username, user_id FROM ".$user_prefix."_users where user_id='$poster_id'");
list($username, $user_id)=$db->sql_fetchrow($result4);

                         $viewlast .="  <tr>
    <td height=\"34\" nowrap bgcolor=\"#EAEDF4\" class=\"row1\"><img src=\"themes/$ThemeSel/forums/images/folder_new.gif\" border=\"0\" /></td>
    <td width=\"100%\" bgcolor=\"#EAEDF4\" class=\"row1\"> <a href=\"forums.html&file=viewtopic&t=$topic_id#$topic_last_post_id\">$topic_title</a></td>
    <td align=\"center\" bgcolor=\"#F8F9FA\" class=\"row2\">$topic_replies</td>
    <td align=\"center\" bgcolor=\"#EAEDF4\" class=\"row3\"><a href=\"profile-.html$sifra\">$avtor</a></td>
    <td align=\"center\" bgcolor=\"#F8F9FA\" class=\"row2\">$topic_views</td>
    <td align=\"center\" nowrap bgcolor=\"#EAEDF4\" class=\"row3\"><font size=\"-2\"><i>  $post_time </i></font><br>
      <a href=\"profile-.html$user_id\">$username</a> <a href=\"forums.html&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"><img src=\"themes/$ThemeSel/forums/images/icon_minipost_new.gif\" border=\"0\" alt=\"Latest Post\"></a></td>
  </tr>";
}

   if( $Last_New_Topics == $Count_Topics ) { break 1; }

}

    $content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <td bgcolor=\"#567188\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
        <tr>
          <td><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">
  <tr>
    <th height=\"25\" colspan=\"2\" align=\"center\" nowrap background=\"themes/$ThemeSel/forums/images/top_center.gif\" class=\"thcornerl\"><font color=\"#FABF0D\"><strong>Topics</strong></font></th>
    <th width=\"50\" align=\"center\" nowrap background=\"themes/$ThemeSel/forums/images/top_center.gif\" class=\"thtop\"><font color=\"#FABF0D\"><strong> Replies </strong></font></th>
    <th width=\"100\" align=\"center\" nowrap background=\"themes/$ThemeSel/forums/images/top_center.gif\" class=\"thtop\"><font color=\"#FABF0D\"><strong> Author </strong></font></th>
    <th width=\"50\" align=\"center\" nowrap background=\"themes/$ThemeSel/forums/images/top_center.gif\" class=\"thtop\"><font color=\"#FABF0D\"><strong> Views </strong></font></th>
    <th align=\"center\" nowrap background=\"themes/$ThemeSel/forums/images/top_center.gif\" class=\"thcornerr\"><font color=\"#FABF0D\"><strong> Last Post </strong></font></th>
  </tr>";
    $content .= "$viewlast";

 $content .= "$show";

?>
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Tue Aug 16, 2005 11:01 pm Reply with quote

Most excellent. Thank you! Now, if I can just get done with my current project so I can get started on 1.3... I am getting excited about incorporating all these good ideas.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Mon Aug 29, 2005 6:38 am Reply with quote

I am having problems even locating the DB calls for this - any clues?
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Mon Aug 29, 2005 9:26 am Reply with quote

Guardian wrote:
I am having problems even locating the DB calls for this - any clues?


Guardian,

Did you post this in the wrong Forum/Topic? I appologize, but based on the context of this Topic, I cannot figure out what you are referring to. If you meant to post this elsewhere, would you please do so in the right Topic so I can respond appropriately?

NEVER MIND: I found your other post too and responded.

Thank you,
montego

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Nefar
Newbie
Newbie



Joined: Sep 10, 2005
Posts: 6

PostPosted: Sun Sep 11, 2005 12:58 pm Reply with quote

Couldn't you use nsn groups to set permissions on what users could see what category of newlsetters?
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sun Sep 11, 2005 2:49 pm Reply with quote

NSN Groups could be used for this, however, I think the problem statement really is that Guardian still wants those Forums to be accessible to others on his site, but he just doesn't want to include them in the newsletter. NSN Groups would not work for this use model.

Regards,
montego

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Mon Sep 12, 2005 12:02 pm Reply with quote

Yes, that is correct.
To explain more fully for Nefar;
I am using a forum add-on called FIND Input. What this does is allows me to specify RSS or XML feeds from other sites and post the results directly into specific forums.
As these additional streams of information are not exactly 'on topic' for my target audience (security officers) and are provided just as an extra resource for them (e.g. latest world news, latest sports news etc) I would prefer them NOT to be shown in the newsletter as the add-on can generate hundreds of posts a day.
I would therefor be showing 'off-topic' forum posts in my newsletter which is not really doing me any favours as it would be bettter to show 'on-topic' forum posts.

I hope this explains why I requested this additional feature and perhaps even gives some other readers idea's of their to create extra live content for their sites.
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©