Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Wed Apr 21, 2004 5:28 am Reply with quote

I have just come across a fancy newsletter module which auto-incorporates latest (predefined number) downloads, news articles and forum posts.
I have spent a considerable amount of time translating the thing from Portugese into English and things are coming along quite well.
As soon as it is finished, I hope to have it available as an English edition of the script.

I have one snag - the forum look-up doesn't work grr.
Is anyone willing to take a look at the script to see if it is anything obvious - its a little too complicated for my meagre brain.

I suspect the code was originally for an earlier version of the ported phpBB that comes with Nuke.

Code:
/***************************

This adds x Forum entries  *
***************************/
if ($T3 > 0) {
global $prefix, $sitename, $user_prefix, $db, $admin, $dbi;
$HideViewReadOnly = 1;
$result = $db->sql_query( "SELECT * FROM ".$prefix."_bbtopics" );
$Amount_Of_Topics = $db->sql_numrows( $result );
$result = $db->sql_query( "SELECT * FROM ".$prefix."_bbposts" );
$Amount_Of_Posts = $db->sql_numrows( $result );
$Amount_Of_Topic_Views = 0;
$result = $db->sql_query( "SELECT topic_views FROM ".$prefix."_bbtopics" );
while( list( $topic_views ) = $db->sql_fetchrow( $result ) )
{$Amount_Of_Topic_Views = $Amount_Of_Topic_Views + $topic_views;}
$Amount_Of_Topic_Replies = 0;
$result = $db->sql_query( "SELECT topic_replies FROM ".$prefix."_bbtopics" );
while( list( $topic_replies ) = $db->sql_fetchrow( $result ) )
{$Amount_Of_Topic_Replies = $Amount_Of_Topic_Replies + $topic_replies;}
$Count_Topics = 0;
$Topic_Buffer = "";
$result = sql_query( "SELECT topic_id, forum_id, topic_last_post_id, topic_title, topic_poster, topic_views, topic_replies, topic_moved_id FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC", $dbi );
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = sql_fetch_row( $result, $dbi ) )
{$skip_display = 0;
if( $HideViewReadOnly == 1 ){
$result1 = sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'", $dbi );
list( $auth_view, $auth_read ) = sql_fetch_row( $result1, $dbi );
if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }}
if( $topic_moved_id != 0 ){
$skip_display = 1;}
if( $skip_display == 0 ){
$Count_Topics += 1;
$result2 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$topic_poster'", $dbi);
list($username, $user_id)=sql_fetch_row($result2, $dbi);
$avtor=$username;
$sifra=$user_id;
$result3 = sql_query("SELECT poster_id, FROM_UNIXTIME(post_time,'%d/%m/%Y om %H:%i') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($poster_id, $post_time)=sql_fetch_row($result3, $dbi);
$result4 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'", $dbi);
list($username, $user_id)=sql_fetch_row($result4, $dbi);
global $ThemeSel;
$viewlast .="<tr>
<td height=\"10\" nowrap bgcolor=\"#DDDDDD\"><IMG src='$nukeurl/modules/Newsletter/images/forum.gif' border=0 align='absmiddle'></td>
<td width=\"100%\" bgcolor=\"#EEEEEE\"><a href=\"".$nukeurl."/modules.php?name=Forums&file=viewtopic&t=$topic_id#$topic_last_post_id\"><font size=1 color=#000000>$topic_title</font></a></td>
<td height=\"10\" align=\"center\" bgcolor=\"#DDDDDD\"><font size=1 color=#000000>$topic_replies</font></td>
<td align=\"center\" bgcolor=\"#EEEEEE\"><a href=\"".$nukeurl."/modules.php?name=Forums&file=profile&mode=viewprofile&u=$sifra\"><font size=1 color=#000000>$avtor</font></a></td>
<td height=\"10\" align=\"center\" bgcolor=\"#DDDDDD\"><font size=1 color=#000000>$topic_views</font></td>
<td align=\"right\" nowrap bgcolor=\"#EEEEEE\"><font size=1 color=#000000><i>&nbsp;&nbsp;$post_time&nbsp;</i></font><br>
<a href=\"".$nukeurl."/modules.php?name=Forums&file=profile&mode=viewprofile&u=$user_id\"><font size=1 color=#000000>$username</font></a>&nbsp;<a href=\"".$nukeurl."/modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"><img src=\"$nukeurl/modules/Newsletter/images/filr.gif\" border=\"0\"></a>&nbsp;</td>
</tr>";}
if( $T4 == $Count_Topics ) { break 1; }}
$forumbody .= "<hr noshade size=1><br><table width=\"95%\" border=\"0\" cellspacing=\"2\" cellpadding=\"2\" align=\"center\"><tr><td colspan=\"6\" width=\"100%\" height=\"20\" bgcolor=\"#808080\"><IMG src='$nukeurl/modules/Newsletter/images/forums.gif' border=0 align='absmiddle'>&nbsp;<a href=\"".$nukeurl."/modules.php?op=modload&name=Forums\" title=\"Our latest forum posts\"><b><font size='3' color='#FFFFFF'>Last $T4 Forum Posts. Click here for more.</font></b></a></td></tr>";
$forumbody .= "<tr bgcolor=\"#ABABAB\">
<td width=\"10\"></td>
<td width=\"100%\"><font size='2' color='#ffffff'><b>Subject</b></font></td>
<td width=\"10\" align='center' nowrap><font size='2' color='#FFFFFF'><b>Replies</b></font></td>
<td align='center' nowrap><font size='2' color='#FFFFFF'><b>Author</b></font></td>
<td width=\"10\" align='center' nowrap><font size='2' color='#FFFFFF'><b>Viewed</b></font></td>
<td align='center' nowrap><font size='2' color='#FFFFFF'><b>Last Reply</b></font></td>
</tr>";
$forumbody .= "$viewlast";
$forumbody .= "</table><br>";
}
// End x Forum entries
 
View user's profile Send private message Send e-mail
Guardian2003







PostPosted: Wed Apr 21, 2004 6:26 am Reply with quote

Now fixed - thanks folks!
 
Rikk03
Worker
Worker



Joined: Feb 16, 2004
Posts: 164

PostPosted: Fri Apr 23, 2004 5:30 pm Reply with quote

where - when can i get a hold of this with fix?
 
View user's profile Send private message
Guardian2003







PostPosted: Sat Apr 24, 2004 8:35 am Reply with quote

I have uploaded it to the d/l section on this site so everyone can share it.
It is just awaiting approval.

If anyone can improve on this module by incorporating more admin selectable data, it would be fantastic!
 
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sat Apr 24, 2004 9:15 am Reply with quote

It's now in the d/l section Smile
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

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
You can attach files in this forum
You can download files in this forum


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