"Dragonsys";p="2299" wrote:I got it all working. Below is the code I used. I will add this to the download file very soon.
SQL Code to add to database:
- Code: Select all
INSERT INTO `phpbb_portal_config` VALUES ( '', 'md_num_blogs', '10' );INSERT INTO `phpbb_portal_config` VALUES ( '', 'md_blogs_style', '0' );
templates/fisubice/blocks/blogs_block.tpl
- Code: Select all
<table border="0" cellpadding="0" cellspacing="1" width="100%"><tr><td align="left"><span class="gensmall"><!-- BEGIN scroll --><marquee id="recent_blogs" behavior="scroll" direction="up" height="200" scrolldelay="100" scrollamount="2" loop="true" onmouseover="this.stop()" onmouseout="this.start()"><!-- BEGIN recent_blog_row -->{scroll.recent_blog_row.RECENT_BLOGS}<!-- END recent_blog_row --></marquee><!-- END scroll --><!-- BEGIN static --><!-- BEGIN recent_blog_row -->{static.recent_blog_row.RECENT_BLOGS}<!-- END recent_blog_row --><!-- END static --></span></td></tr><tr> <td align=center> <hr><br><a href="weblogs.php">All Blogs</a> | <a href="weblog.php?w={YOUR_BLOG}">Your Blog</a> </td> </tr> </table>
blocks/blocks_imp_blogs.cfg
- Code: Select all
<?php/*************************************************************************** * blocks_imp_blogs.cfg * ------------------- * copyright ]http://www.dragonsys.org[/url] * email : [url=http://www.dragonsys.org]http://www.dragonsys.org[/url] * email : <a>webmaster@dragonsys.org</a> * * note: removing the original copyright is illegal even you have modified * the code. Just append yours if you have modified it. ***************************************************************************/ /*************************************************************************** * * 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, or * (at your option) any later version. * ***************************************************************************/ if ( !defined('IN_PHPBB') ) { die("Hacking attempt"); } if(!function_exists(imp_blogs_block_func)) { function imp_blogs_block_func() { global $template, $userdata, $phpbb_root_path, $phpEx, $db, $board_config, $lang, $portal_config, $_GET; // // Pugio Edit For Recent Blogs Support // // Get recent entries or print out an error $sql = "SELECT entry_subject, entry_id, entry_poster_id, entry_time, username, user_id FROM " . WEBLOG_ENTRIES_TABLE . ", " . USERS_TABLE . " WHERE " . USERS_TABLE . ".user_id" . " = " . WEBLOG_ENTRIES_TABLE . ".entry_poster_id ORDER BY entry_time DESC LIMIT " . $portal_config['md_num_blogs']; if( !$result = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Couldn't obtain weblogs information.", "", __LINE__, __FILE__, $sql); $recent_blogs .= "No Blogs"; } else { $recent_entries = array(); while ( $row = $db->sql_fetchrow($result) ) { $recent_entries[] = $row; } foreach ($recent_entries as $current) { $recent_blogs .= "»" . "<a href="weblog_entry.php?e=" . $current['entry_id'] . ""><b>"; // Entry Link $recent_blogs .= $current['entry_subject']; // Subject $recent_blogs .= "</b></a><br />n "; // End and html formatting $recent_blogs .= "by <a href="profile.php?mode=viewprofile&u=" . $current['user_id'] . "">"; // User Link $recent_blogs .= $current['username'] . "</a> on "; // User Name $recent_blogs .= date("D M j, Y g:i a",$current['entry_time']); // Post Date $recent_blogs .= "</b></a><br /><br />n "; // End and html formatting } if($portal_config['md_blogs_style']){ $style_row = 'scroll'; }else { $style_row = 'static'; } $template->assign_block_vars($style_row,""); $template->assign_block_vars($style_row . '.recent_blog_row', array( 'RECENT_BLOGS' => $recent_blogs ) ); $template->assign_vars(array( 'RECENT_BLOGS' => $recent_blogs, 'YOUR_BLOG' => $userdata['user_weblog'] ) ); } } } imp_blogs_block_func(); ?>
I originally tried this code but for some reason the blog listing doesn't take up the whole box but only around half the box how do I fix this?