Filebase block for Filebase 2.1.0 Pre-release

Forum rules
This forum is not for support requests.

Only post Modifications for Board3 Portal 1.0.x in this forum.
Locked

Topic author
frold
Portal Enthusiast
Posts: 108
Joined: 24. March 2008 07:52

Filebase block for Filebase 2.1.0 Pre-release

Post by frold »

FILEBASE BLOCK FOR FILEBASE 2.1.0 PRERELEASE(MAYBE EARLIER VERSIONS TOO)
Credit:
DaMysterious from http://damysterious.xs4all.nl/portal_premod/
AND
Imladris from http://www.phpbb2.dk

Demo: http://www.studmed.dk - See the block "Filbase"

OPEN
portal.php

FIND

Code: Select all

if ($portal_config['portal_change_style'])
{
	include($phpbb_root_path . 'portal/block/change_style.'.$phpEx);
}
AFTER ADD

Code: Select all

include($phpbb_root_path . 'portal/block/filebase.'.$phpEx);
OPEN
styles/prosilver/template/portal/portal_body.html

FIND

Code: Select all

		<!-- IF S_DISPLAY_NEWS -->
		<!-- IF S_NEWS_COMPACT -->
			<!-- INCLUDE portal/block/news_compact.html -->
		<!-- ELSE -->
			<!-- INCLUDE portal/block/news.html -->
		<!-- ENDIF -->
		<!-- ENDIF -->
AFTER ADD

Code: Select all

		<!-- INCLUDE portal/block/filebase.html -->
CREATE
portal/block/filebase.php

INSERT

Code: Select all

<?php
/*
*
* Filebase Portal Block by Imladris for phpBB3Portal, based on plus XL 4.0 block.
*
*/
if (!defined('IN_PHPBB') or !defined('IN_PORTAL'))
{
	die('Hacking attempt');
	exit;
}

/**
*/
$limit = 5; // number of files allowed to show, set in portal's ACP

$start = request_var('start', 0);

// Language file (see documentation related to language files)
$user->add_lang('filebase');

/**
* All of your coding will be here, setting up vars, database selects, inserts, etc...
*/
if ($auth->acl_get('u_view_filebase'))
{
   $sql = "SELECT name, type, size, downloads, id
         FROM " . FILEBASE_TABLE . "
         WHERE id = id AND approved = '1'
         ORDER BY id DESC";
		 	
	$result = $db->sql_query($sql);
	$num_files = sizeof($db->sql_fetchrowset($result));
	$result = $db->sql_query_limit($sql, $limit, $start);
	while($row = $db->sql_fetchrow($result))
	{			
   		// NEW MOD
      	$name = '<a href="filebase.php?d=1&id='.$row['id'].'">'.$row['name'].'</a>';
      	// END NEW MOD
	  	
		$template->assign_block_vars('search', array(
			'NAME'			=>			$name,		// replaced
			'TYPE'			=>			$row['type'],
			'SIZE'			=>			round(($row['size']/1024), 2)." ".$user->lang['KB'],
			'DOWNLOADS'		=>			$row['downloads'],
			'U_FILE'		=>			'filebase.php?&f='.$row['id'].'',
		));
	}
	$db->sql_freeresult($result);
	
	$template->assign_vars(array(
		'SEARCH' => 1,
	));

$template->assign_block_vars('filebase', array(
	'PAGINATION'            	=> generate_pagination('portal.php', $num_files, $limit, $start ),
	'PAGE_NUMBER'           	=> on_page($num_files, $limit, $start),
	'TOTAL_FILES'				=> $num_files,
	'TOTAL_SIZE'				=> round(($row['size']/1024), 2)." ".$user->lang['KB'],
	'S_HAS_FILES'				=> $row['downloads'] ? true : false,
//	'L_TOTAL_FILES_COUNT'		=> $user->lang['TOTAL_FILES_COUNT'],
	));
}

$template->assign_vars(array(
    'U_FILEBASE'       			=> append_sid("{$phpbb_root_path}filebase.$phpEx"),
));


$template->assign_vars(array(
	'S_DISPLAY_FILEBASE'	=> true,
));

?>
CREATE
styles/prosilver/template/portal/block/filebase.html

INSERT

Code: Select all

<div class="forabg">
	<div class="inner">
		<span class="corners-top"><span></span></span>
		<ul class="topiclist">
			<li class="header"><dl><dt><!-- IF U_VIEWONLINE --><a href="{U_FILEBASE}">Filebase</a><!-- ELSE -->HVEM VAR HER<!-- ENDIF --></dt></dl></li>
		</ul>
		<ul class="topiclist forums">
			<li><dl>
				<dd class="posts_portal"  style="border-left:0px">
			<table class="tablebg" cellspacing="1" width="100%">
				<tr>
					<th><div align="left">{L_FILENAME}</div></th>
					<th><div align="center">{L_FILETYPE}</div></th>
					<th><div align="center">{L_FILESIZE}</div></th>
					<th><div align="center">{L_FILEDOWNLOADS}</div></th>
				</tr>
				<!-- BEGIN search -->
				<tr>
					<td><div style="font-size: 10px;">{search.NAME}</div></td>
					<td><div align="center">{search.TYPE}</div></td>
					<td><div align="center">{search.SIZE}</div></td>
					<td><div align="center">{search.DOWNLOADS}</div></td>
				</tr>
				<!-- END search -->
			</table>
			<!-- BEGIN filebase -->
			<!-- IF filebase.PAGINATION -->
			<div class="pagination" style="margin: 0px 0px 5px 0px;">
			{filebase.L_TOTAL_FILES_COUNT} {filebase.TOTAL_FILES}
			<!-- IF filebase.PAGE_NUMBER --><!-- IF filebase.PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{filebase.PAGE_NUMBER}</a> &bull; <span>{filebase.PAGINATION}</span><!-- ELSE --> &bull; {filebase.PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
			</div>
			<!-- ENDIF -->
			<!-- END filebase -->
				</dd>
			</dl></li>
		</ul>
		<span class="corners-bottom"><span></span></span>
	</div>
</div>

<br />
Last edited by frold on 25. May 2008 23:13, edited 6 times in total.
http://www.studmed.dk - Portal for doctors and medical students in Denmark
User avatar

PeterS
Former Team Member
Posts: 246
Joined: 15. January 2008 08:41
phpBB.de User: PeterS
phpBB.com User: PeterS

Re: [REQ] Filebase 2.1.0 and phpBB Calendar 0.0.7 blocks

Post by PeterS »

Hi frold,

at the moment the team works really hard to finish the next Version of Board3.

Why should somebody now make Adjustments for the "old" Version.
I think everyone can wait a short time.

hope you understand what i mean.

greetz Peter

Topic author
frold
Portal Enthusiast
Posts: 108
Joined: 24. March 2008 07:52

Re: [REQ] Filebase 2.1.0 and phpBB Calendar 0.0.7 blocks

Post by frold »

this wasnt minded toward the team alone...

There might be a code wizard out there that have one or both of the mods installed.... It was my hope :D

I guess blocks for board3 portal 0,2,1 will be able to use with further releases....
http://www.studmed.dk - Portal for doctors and medical students in Denmark

Topic author
frold
Portal Enthusiast
Posts: 108
Joined: 24. March 2008 07:52

Re: [REQ] Filebase 2.1.0 and phpBB Calendar 0.0.7 blocks

Post by frold »

delete this post
Last edited by frold on 25. April 2008 08:30, edited 2 times in total.
http://www.studmed.dk - Portal for doctors and medical students in Denmark
User avatar

derkubi
Portal Enthusiast
Posts: 159
Joined: 12. March 2008 18:52
Contact:

Re: [REQ] Filebase 2.1.0 (Solved) & phpBB Calendar 0.0.7 blocks

Post by derkubi »

Screenshot or Demo ?
Whats about subsilver ?

Topic author
frold
Portal Enthusiast
Posts: 108
Joined: 24. March 2008 07:52

Re: [REQ] Filebase 2.1.0 (Solved) & phpBB Calendar 0.0.7 blocks

Post by frold »

derkubi wrote:Screenshot or Demo ?
Whats about subsilver ?
This block is made for personal use and I dont need subsilver, so there will be no subsilver block... I just share the code if any one could use it...

Demo: http://www.studmed.dk - look at the filebase block

In one of the next days I release a calendar block....
http://www.studmed.dk - Portal for doctors and medical students in Denmark
User avatar

Ice
Former Team Member
Posts: 359
Joined: 20. January 2008 23:43
Location: England, United Kingdom

Re: [REQ] Filebase 2.1.0 (Solved) & phpBB Calendar 0.0.7 blocks

Post by Ice »

Try this for subsilver - though it is untested.

Code: Select all

<table class="tablebg" cellspacing="1" width="100%">
	<tr>
		<th colspan="3"><!-- IF U_VIEWONLINE --><a href="{U_FILEBASE}">Filebase</a><!-- ELSE -->HVEM VAR HER<!-- ENDIF --><</th>
	</tr>
	<tr>
		<!-- IF .latest_announcements --><td class="row1"><strong>{L_RECENT_ANN}</strong></td><!-- ENDIF -->
		<!-- IF .latest_hot_topics --><td class="row1"><strong>{L_RECENT_HOT_TOPIC}</strong></td><!-- ENDIF -->
		<!-- IF .latest_topics --><td class="row1"><strong>{L_RECENT_TOPIC}</strong></td><!-- ENDIF -->
	</tr>
	<tr>
		 <table class="tablebg" cellspacing="1" width="100%">
			<tr>
				<th><div align="left">{L_FILENAME}</div></th>
				<th><div align="center">{L_FILETYPE}</div></th>
				<th><div align="center">{L_FILESIZE}</div></th>
				<th><div align="center">{L_FILEDOWNLOADS}</div></th>
			</tr>
			<!-- BEGIN search -->
			<tr>
				<td><div style="font-size: 10px;">{search.NAME}</div></td>
				<td><div align="center">{search.TYPE}</div></td>
				<td><div align="center">{search.SIZE}</div></td>
				<td><div align="center">{search.DOWNLOADS}</div></td>
			</tr>
			<!-- END search -->
		 </table>
		 <!-- BEGIN filebase -->
		 <!-- IF filebase.PAGINATION -->
		 <div class="pagination" style="margin: 0px 0px 5px 0px;">
		 {filebase.L_TOTAL_FILES_COUNT} {filebase.TOTAL_FILES}
		 <!-- IF filebase.PAGE_NUMBER --><!-- IF filebase.PAGINATION --> &bull; <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{filebase.PAGE_NUMBER}</a> &bull; <span>{filebase.PAGINATION}</span><!-- ELSE --> &bull; {filebase.PAGE_NUMBER}<!-- ENDIF --><!-- ENDIF -->
		 </div>
		 <!-- ENDIF -->
		 <!-- END filebase -->
	</tr>
</table>
<br />
Board3 Portal Dev & English Tech Support

Topic author
frold
Portal Enthusiast
Posts: 108
Joined: 24. March 2008 07:52

Re: Filebase block for Filebase 2.1.0 Pre-release

Post by frold »

Sry, due to lack of time I dont have time to support other templates then prosilver
http://www.studmed.dk - Portal for doctors and medical students in Denmark
Locked

Return to “board3 Portal v1.0.x - Modifications in Dev”