Author
Message
Guardian2003 Site Admin Joined: Aug 28, 2003 Posts: 6373 Location: Vsetin, Czech Republic
Posted:
Wed Apr 21, 2004 5:28 am
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> $post_time </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> <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> </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'> <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
Guardian2003 Site Admin Joined: Aug 28, 2003 Posts: 6373 Location: Vsetin, Czech Republic
Posted:
Wed Apr 21, 2004 6:26 am
Now fixed - thanks folks!
Rikk03 Worker Joined: Feb 16, 2004 Posts: 164
Posted:
Fri Apr 23, 2004 5:30 pm
where - when can i get a hold of this with fix?
Guardian2003 Site Admin Joined: Aug 28, 2003 Posts: 6373 Location: Vsetin, Czech Republic
Posted:
Sat Apr 24, 2004 8:35 am
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: 16987 Location: Kansas
Posted:
Sat Apr 24, 2004 9:15 am
It's now in the d/l section
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