Create a block

Current Version: 1.0.6
Released: 09.01.10
Forum rules
Before creating a new support thread, please take a look in the board3 Portal FAQ and use the search!
Many questions have already been answered.
Locked

Topic author
Sebf
Active Member
Posts: 3
Joined: 11. October 2009 18:08
phpBB.com User: Sebf

Create a block

Post by Sebf »

Your Portal Version: 1.0.2
Your phpBB Type: Standard phpBB3
MODs installed: No
Your knowledge: Beginner
Boardlink: http://www.racegamers.com/phpBB3/

What have you done before the problem was there?


What have you already tryed to solve the problem?


Description and Message
Hello
First, thank you for this great MOD.
Then I would create a custom block with php / mysql
So I made a copy of "latest_members" on. Php and. Html
I also changed the portal_body.html, but alas, I can not display any values in my query ....
Thanks in advance and sorry for my English

news_temps.php

Code: Select all

<?php

/**
*
* @package - Board3portal
* @version $Id: news_temps.php 325 2008-08-17 18:59:40Z kevin74 $
* @copyright (c) kevin / saint ( www.board3.de/ ), (c) Ice, (c) nickvergessen ( www.flying-bits.org/ ), (c) redbull254 ( www.digitalfotografie-foren.de ), (c) Christian_N ( www.phpbb-projekt.de )
* @based on: phpBB3 Portal by Sevdin Filiz, www.phpbb3portal.com
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

if (!defined('IN_PHPBB'))
{
   exit;
}

if (!defined('IN_PORTAL'))
{
   exit;
}

/**
*/

$sql = 'SELECT id, date, jeu, user	FROM a_news_tps	ORDER BY id DESC'; 
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result))

{
	$template->assign_block_vars('news_temps', array(
		'S_SEARCH_ACTION'=> $row['user'],
		'USERNAME_FULL'=> $row['jeu'],
		'POSTER_POSTS'	=> $row['id'],
		)
	);
}
$db->sql_freeresult($result);

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

?>
news_temps.html

Code: Select all

<!--version $Id: news_temps.html 344 2008-08-24 20:50:39Z kevin74 $ //-->
<table class="tablebg" cellspacing="1" width="100%">
	<tr>
		<th><span style="float: left"><img src="{T_THEME_PATH}/images/portal/portal_top_poster.png" width="16px" height="16px" alt="" />&nbsp;Derniers Temps</span></th>
	</tr>
	<tr class="row1">
		<td>
			<span style="float:left;"><strong>{L_USERNAME}</strong></span>
			<span style="float:right;padding-right:10px;"><strong>{L_POSTS}</strong></span><br style="clear:both" />
			<!-- BEGIN news_temps -->
			<span style="float:left;"><img src="{T_THEME_PATH}/images/portal/portal_user.png" width="16px" height="16px" alt="" /></span>
			<span style="float:left; padding-left:5px; padding-top:2px;">{news_temps.USERNAME_FULL}</span>
			<span style="float:right;padding-right:10px; padding-top:2px;"><a href="{news_temps.S_SEARCH_ACTION}">{news_temps.POSTER_POSTS}</a></span><br style="clear:both" />
			<!-- END news_temps -->		
		</td>
	</tr>
</table>
<br />
Portal_body.html

Code: Select all

<!-- INCLUDE portal/block/news_temps.html -->

--------------------------------------------
Message in French :

Bonjour
D'abord, merci beaucoup pour ce superbe MOD.
Ensuite, je voudrais creer un block personnalisé avec du php/mysql
J'ai donc fait une copie de "latest_members", le .php et le .html
J'ai modifié aussi le portal_body.html, mais helas, je n'arrive pas a afficher aucune valeurs de ma requette ....
D'avance Merci et désolé pour mon anglais[/i]
User avatar

Mike
Former Team Member
Posts: 1862
Joined: 3. July 2008 23:59
Location: Schwarzwald / FDS
Contact:

Re: Create a block

Post by Mike »

You have to include news_temps.php into portal.php too ;)

BTW: I would recomment you to update your portal... as long as you wait with it, as much trouble you will have ;) (no update instructions)
kein Support per PN / Messenger
no Support via PM / Messenger

Topic author
Sebf
Active Member
Posts: 3
Joined: 11. October 2009 18:08
phpBB.com User: Sebf

Re: Create a block

Post by Sebf »

Yes, I put it in the portal.php

Code: Select all

if ($portal_config['portal_news_temps'])
{
	include($phpbb_root_path . 'portal/block/news_temps.'.$phpEx);
}
And alas, nothing appears in my block

For the new version, alas it is not in french on the support site http://forums.phpbb-fr.com

-----------
In French:

Oui, j'ai mis ca dans le portal.php
Et hélas, rien ne s'affiche dans mon block
Pour la nouvelle version, hélas elle n'est pas en francais sur le site de support Fr http://forums.phpbb-fr.com
User avatar

Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Create a block

Post by Kevin »

Try:

Code: Select all

include($phpbb_root_path . 'portal/block/news_temps.'.$phpEx); 
instead of:

Code: Select all

    if ($portal_config['portal_news_temps'])
    {
       include($phpbb_root_path . 'portal/block/news_temps.'.$phpEx);
    } 
Because otherwise you would need to have a DB fiels named portal_news_temp and set it to "1" and i guess you haven't created it. ;)
With this solution the block is included in every case.

Bonne chance!
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!

Topic author
Sebf
Active Member
Posts: 3
Joined: 11. October 2009 18:08
phpBB.com User: Sebf

Re: Create a block

Post by Sebf »

Thank you, is OK

1000 Thank you :D :D :D :D
User avatar

Kevin
Site Admin
Posts: 2989
Joined: 7. January 2006 20:11
phpBB.de User: Saint
phpBB.com User: Saint_hh
Location: Hamburg
Contact:

Re: Create a block

Post by Kevin »

De rien! ;)
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~

Kein Support per PN / No support via PM!
Locked

Return to “board3 Portal 1.0.x - English Support”