Adding a custom block / einen eigenen Block hinzufügen

Forum rules
This forum is not for support requests.

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

Yeti
Active Member
Posts: 4
Joined: 14. June 2009 21:03

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Yeti »

I´d add a left block according the first posting. Every thing is ok in style subsilver. But in style prosilver the backgroundcolor is lightblue #ECF1F3 instead of blue #CADCEB in the other left blocks. How can I change this?
User avatar

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

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Mike »

Please provide a Link.
Theres a ton of possible reasons, so please help us with a Link ;)
kein Support per PN / Messenger
no Support via PM / Messenger
User avatar

Yeti
Active Member
Posts: 4
Joined: 14. June 2009 21:03

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Yeti »

I used exact the code of the first posting.
User avatar

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

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Mike »

Not exactly... but even though, the code is for B3P 1.0.2 ;)

Since you're using B3P 1.0.3, use this code for your Block:

Code: Select all

{$LR_BLOCK_H_L} Headline{$LR_BLOCK_H_R}
			<div style="text-align: center;">
		 Place your Code here
			</div>
{$LR_BLOCK_F_L}{$LR_BLOCK_F_R}
kein Support per PN / Messenger
no Support via PM / Messenger
User avatar

Yeti
Active Member
Posts: 4
Joined: 14. June 2009 21:03

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Yeti »

Thanks for the fast and qualified response. Now my block has the same style as the others, even using prosilver.Image
User avatar

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

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Mike »

Made an updated KB Article for both German and English Language. View first two Posts for the Links... ;)

@Yeti: there are new codes for subsilver2 also ;)
kein Support per PN / Messenger
no Support via PM / Messenger

Tienosim
Active Member
Posts: 2
Joined: 24. January 2010 22:20
phpBB.com User: Tieno

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Tienosim »

Hello.
I have create a new bloc on my portal.
But i can't view this.
My custom block is liste_equipe_alliance.html:

Code: Select all

{$C_BLOCK_H_L}<dl><dt>Liste des équipes</dt></dl>{$C_BLOCK_H_R}
   <ul class="topiclist forums">
      <li><dl>
         <dd style="border-left: 0px">
         <p>Voici la liste des équipes de l'alliance Akuma:<br />
		 -La Mugiwara_Team:Il s'agit d'une équipe très soudé,elle est composé d'une élite du village chikara.<br />
		 -Les brutes des sables<br />
		 -Ryuk Darkness Style<br />
		 -La Team-Kugan<br />
		</p>
      
   </dd>
      </dl></li>
   </ul>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}
I edit portal_body.html:

Code: Select all

<!-- [+] center block area -->
	<td valign="top">
	<br style="clear:both" />
	


		<!-- IF S_DISPLAY_GENERAL -->
			<!-- INCLUDE portal/block/general_block.html -->
		<!-- ENDIF -->
		
		

		<!-- IF U_RESTORE_PERMISSIONS and S_DISPLAY_MAINMENU -->
			<!-- INCLUDE portal/block/general_block.html -->
		<!-- ENDIF -->

		<!-- IF S_DISPLAY_WELCOME -->
			<!-- IF S_DISPLAY_WELCOME_GUEST and S_USER_LOGGED_IN -->
			<!-- ELSE -->
				<!-- INCLUDE portal/block/welcome.html -->
			<!-- ENDIF -->
		<!-- ENDIF -->

		<!-- IF S_CUSTOM_CENTER -->
			<!-- INCLUDE portal/block/custom_center.html -->
		<!-- ENDIF -->
		
		<!-- IF S_LISTE_EQUIPE_ALLIANCE -->
			<!-- INCLUDE portal/block/liste_equipe_alliance.html -->
		<!-- ENDIF -->
But nothing appears.
My forum is: http://www.forum-mugiwara-team.forumsfaciles.com
Can you help my please ?
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Marc »

Try updating to the newest version, that should probably help a lot.

Tienosim
Active Member
Posts: 2
Joined: 24. January 2010 22:20
phpBB.com User: Tieno

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Tienosim »

I can't updating to the newest version because French support not support this newest version.
But i have find at this support a new answer for this.
Thanks :mrgreen:
User avatar

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

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Mike »

Code: Select all

      <!-- IF S_LISTE_EQUIPE_ALLIANCE -->
         <!-- INCLUDE portal/block/liste_equipe_alliance.html -->
      <!-- ENDIF -->
No wonder why you Blocks does'nt appear.
<!-- IF S_LISTE_EQUIPE_ALLIANCE --> is not an valid switch... just include your Custom Block without such a Switch ;)
kein Support per PN / Messenger
no Support via PM / Messenger

sebi099
Active Member
Posts: 5
Joined: 5. May 2010 18:26

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by sebi099 »

hat jemand evtl einen Lösungsvorschlag um vom Classifieds modul z.b. die letzten 5 neuen Kleinanzeigen im Portal Anzeigen zu lassen?


mfg Basti

Bash
Active Member
Posts: 21
Joined: 11. May 2010 16:46
phpBB.de User: Bash
phpBB.com User: Bash

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Bash »

Hello :)

I want to duplicate the 'news' block, creating a new block entitled 'results'. Everything would appear fairly straight forward even for a noob like me, except for a part in includes/acp_portal:

Code: Select all

	// Store selected forums
	function store_selected_forums($key)
	{
		global $db, $cache;
		
		// Get selected extensions
		$values = request_var($key, array(0 => ''));
		
		$news = implode(',', $values);
		
		set_portal_config($key, $news);
	
	}
Would I add the 'results' string like this...

Code: Select all

	// Store selected forums
	function store_selected_forums($key)
	{
		global $db, $cache;
		
		// Get selected extensions
		$values = request_var($key, array(0 => ''));
		
		$results = implode(',', $values);
		
		$news = implode(',', $values);
		
		set_portal_config($key, $results, $news);
	
	}
or...

Code: Select all

	// Store selected forums
	function store_selected_forums($key)
	{
		global $db, $cache;
		
		// Get selected extensions
		$values = request_var($key, array(0 => ''));
		
		$results, $news = implode(',', $values);
		
		set_portal_config($key, $results, $news);
	
	}
or something else?

Also, do I need to add any additional SQL queries?

Thanks very much for your time :)
User avatar

Marc
Dev
Posts: 2504
Joined: 17. July 2008 21:08
phpBB.de User: marc1706
phpBB.com User: Marc
Location: Clausthal-Zellerfeld / München
Contact:

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Marc »

If you edit that function, I will cut your fingers off. ;)

I guess you edited this part for your needs:

Code: Select all

			case 'news':
				$display_vars = array(
					'title'	=> 'ACP_PORTAL_NEWS_SETTINGS',
					'vars'	=> array(
						'legend1'							=> 'ACP_PORTAL_NEWS_SETTINGS',
						'portal_news'						=> array('lang' => 'PORTAL_NEWS',	'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
						'portal_news_style'					=> array('lang' => 'PORTAL_NEWS_STYLE',	'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
						'portal_show_all_news'				=> array('lang' => 'PORTAL_SHOW_ALL_NEWS',	'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
						'portal_number_of_news'				=> array('lang' => 'PORTAL_NUMBER_OF_NEWS',	'validate' => 'int',		'type' => 'text:3:3',		 'explain' => true),
						'portal_news_length'				=> array('lang' => 'PORTAL_NEWS_LENGTH',	'validate' => 'int',		'type' => 'text:3:3',		 'explain' => true),
						'portal_news_forum'					=> array('lang' => 'PORTAL_NEWS_FORUM',		'validate' => 'string',		'type' => 'custom',	 		'explain' => true,	'method' => 'select_forums'),
						'portal_news_exclude'				=> array('lang' => 'PORTAL_NEWS_EXCLUDE',	'validate' => 'bool',		'type' => 'radio:yes_no',	'explain' => true),
						'portal_news_show_last'             => array('lang' => 'PORTAL_NEWS_SHOW_LAST',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
						'portal_news_archive'               => array('lang' => 'PORTAL_NEWS_ARCHIVE',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
						'portal_news_permissions'			=> array('lang' => 'PORTAL_NEWS_PERMISSIONS',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
						'portal_show_news_replies_views'	=> array('lang' => 'PORTAL_SHOW_REPLIES_VIEWS',	'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
					)
				);
			break;
And I guess the exact part you want to modify is this:

Code: Select all

						'portal_news_forum'					=> array('lang' => 'PORTAL_NEWS_FORUM',		'validate' => 'string',		'type' => 'custom',	 		'explain' => true,	'method' => 'select_forums'),
You should change it to something like this:

Code: Select all

						'portal_results_forum'					=> array('lang' => 'PORTAL_RESULTS_FORUM',		'validate' => 'string',		'type' => 'custom',	 		'explain' => true,	'method' => 'select_forums'),
A little bit further down you will have to find this line:

Code: Select all

			if ($config_name == 'portal_attachments_filetype' || $config_name == 'portal_news_forum' || $config_name == 'portal_global_announcements_forum' || $config_name == 'portal_recent_forum' || $config_name == 'portal_attachments_forum_ids' || $config_name == 'portal_poll_topic_id')
Replace it with this:

Code: Select all

			if ($config_name == 'portal_attachments_filetype' || $config_name == 'portal_news_forum' || $config_name == 'portal_global_announcements_forum' || $config_name == 'portal_recent_forum' || $config_name == 'portal_attachments_forum_ids' || $config_name == 'portal_poll_topic_id' || $config_name == 'portal_results_forum')
Now it is important to know what you changed this line to:

Code: Select all

			case 'news':
If you changed it to this:

Code: Select all

			case 'results':
Do this:
Find:

Code: Select all

				case 'polls':
					$this->store_selected_forums('portal_poll_topic_id');
				break;
After Add:

Code: Select all

				case 'results':
					$this->store_selected_forums('portal_results_forum');
				break;
Then the script will save the selected forum IDs.
I hope this helps. ;)

Bash
Active Member
Posts: 21
Joined: 11. May 2010 16:46
phpBB.de User: Bash
phpBB.com User: Bash

Re: Adding a custom block / einen eigenen Block hinzufügen

Post by Bash »

hehe :lol:

Well Marc, you'll probably laugh, but what I did was simply go through every file associated with the board3 mod (every file in the download package/root folder) and duplicate every instance of 'news' and rename it 'results'. I haven't actually changed anything (just added extra code) so I'm hoping I can just upload all these files and they'll be an extra news option in ACP but entitled 'results' (lol I can dream!).

*edit* oh and obviously I created new .html files (copied news html files and edited them). If you want I can post exactly everything I did, but it will take me some hours (as it did to create the edits xD).
Locked

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