collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 406
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: Custom HTML in blocks-in-blocks  (Read 7363 times)

0 Members and 1 Guest are viewing this topic.

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Custom HTML in blocks-in-blocks
« on: August 17, 2011, 05:44:06 PM »
@sinan:
It is possible to add a custom-html-code in this block (What you gave us here: http://simpleportal.net/index.php?topic=5332.msg37841#msg37841)? If yes, how?

AND It is possible to call a url inside the tabs? If yes, how?

Thank you in Advance

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Custom HTML in blocks-in-blocks
« Reply #1 on: August 18, 2011, 07:26:10 AM »
Sure! Give it a try! do anything you like.  I recommend doing some experimenting on a test version of your site, because it is easy to break stuff when you start working with the php
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom HTML in blocks-in-blocks
« Reply #2 on: August 18, 2011, 07:07:15 PM »
Great help !!!

Thank you so much...

 :dead:

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom HTML in blocks-in-blocks
« Reply #3 on: August 20, 2011, 06:41:05 PM »
Nobody an idea how to put html-code inside the sinan-block-code?

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Custom HTML in blocks-in-blocks
« Reply #4 on: August 22, 2011, 08:44:21 AM »
1) Create an HTML block
2) Call the HTML block
 
Is this what you mean?
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom HTML in blocks-in-blocks
« Reply #5 on: August 22, 2011, 11:38:28 AM »
yes, if we mean the same.  :D

In this followoing Block-code (Thanks, SINAN!) sinan call the tabs with "sp_recent" or "sp_topPoster".
This elements are in the PortalBlocks.php

How can i add the ID from a custom HTML-Block?

Or can i enter the HTML-code in the PortalBlock.php? And call this with a custom-name?
(LightBulb above my head...!  :0)


Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Custom HTML in blocks-in-blocks
« Reply #6 on: August 23, 2011, 07:47:56 AM »
You do not need to add any code to PortalBlocks.php.
The custom HTML block is already there.
So if you wish to follow the example in http://simpleportal.net/index.php?topic=5332.msg37841#msg37841
All you need to do is change the elements of the array. In order to know what to put in the array, you may look in PortalBlocks.php.
* Find out what "type" to use. PortalBlocks.php does not give you this. So I am going to guess "sp_html" is the type, because that is also what the function for the html block is called.
* Find out what the parameters for the call should be. There is only one parameter.
* Fill up the parameter array for that block. You will be putting in your HTML for the block.  Test the HTML somewhere else first -- use "add blocks".  But you don't have to save the block.  You are only using it to test and preview.
 
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom HTML in blocks-in-blocks
« Reply #7 on: August 23, 2011, 03:08:58 PM »
so, i need to edit like this:

'label' => 'MyName',
      'type' => 'sp_html',
      'parameters' => array(<html>< MY CODE HERE ></html>)

sorry, i dont understand very well....How to find the "parameters" ???

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Custom HTML in blocks-in-blocks
« Reply #8 on: August 25, 2011, 08:07:49 AM »
You're pretty close. It should be:

Code: [Select]
array(
'label' => 'Some HTML',
'type' => 'sp_html',
'parameters' => array('content' => 'html code goes here'),
),
And slowly, you come to realize... It's all as it should be...

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom HTML in blocks-in-blocks
« Reply #9 on: September 29, 2011, 05:27:04 PM »
Thanks.

It is possible, that some HTML-Code (special with javascript or a swf-movie) not working in this code?

(But they are working in a stand-alone-html-block !!!)

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Custom HTML in blocks-in-blocks
« Reply #10 on: September 29, 2011, 05:42:11 PM »
It really depends on the javascript.  If the javascript is after an element with a certain id, but there is more than one element on the page with that id (I have seen this happen!), then the javascript can get the wrong one and fail.
Or there can be two javascript functions with the same name (there would be an error on the second attempt to define the same function).
 
Look for javascript functions, first.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom HTML in blocks-in-blocks
« Reply #11 on: September 30, 2011, 04:15:47 PM »
I checked both, but looks like i can't fix my problem...

Is there a way to make a Blocks-in-Block code with the block ID?

Offline cnashx

  • Semi Newbie
  • *
  • Posts: 11
  • SMF Version: 2.0
Re: Custom HTML in blocks-in-blocks
« Reply #12 on: December 27, 2011, 09:15:35 PM »
I posted this in the original Blog topic, but I figured I'd post it here since it seems like this might be the appropriate place.

Hello.
I have been using the block with the recent topics and recent posts.
And I was wondering what code I could use to exclude forums or subforums from the recent threads or just specify certain forums or subforums.
I'm thinking about having "Recent Tropics/Threads" and another "recent" block for a specific subforum.
Basically I want to have a "Recent Threads" tab which displays all forums but one parent forum and it's child boards/sub-forums, and another that is basically the same type of tab but just for that one parent forum and it's child boards/sub-forums.
If someone could assist me this would be greatly appreciated. I tried to mess with it myself but I can't seen to get it to work correctly.

Thank you for your help in advance.

Offline cnashx

  • Semi Newbie
  • *
  • Posts: 11
  • SMF Version: 2.0
Re: Custom HTML in blocks-in-blocks
« Reply #13 on: December 28, 2011, 08:14:18 PM »
This is what I have, but it doesn't seem to be working to well...

Code: [Select]
$block = current(getBlockInfo(false, 49, false, false));  // Load block info
$block['style'] = sportal_parse_style('explode', $block['style'], true);  //Parse block style parameters.
template_block($block); // Output the block.
global $txt;

$txt['recent_topics'] = 'Topics';
$txt['recent_reviews'] = 'Reviews';



$buttons = array(
   'recent_topics' => array(
      'text' => 'recent_topics',
      'image' => '',
      'lang' => true,
      'url' => '#recent_topics" id="b_rt" onclick="change_display(\'rp\'); return false;',
      'active' => true,
   ),
   'recent_reviews' => array(
      'text' => 'recent_reviews',
      'image' => '',
      'lang' => true,
      'url' => '#recent_reviews" id="b_rt" onclick="change_display(\'rp\'); return false;',
'active' => true,
   ),
);

echo '
<div style="overflow: auto;">
   ', template_button_strip($buttons), '
</div>
<div id="recent_topics">
   ', sp_recent(array('type' => 1, 'display' => 1, 'boards' => '1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48',), 0), '
</div>
<div id="recent_reviews">
   ', sp_recent(array('type' => 1, 'display' => 1, 'boards' => '49|50|51|52|53|54|55|56|57|58|59|60|61|62|63|64|65'), 0), '
</div>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
   function change_display(block)
   {
      var current = block == \'rt\' ? 1 : 0;

      document.getElementById(\'recent_topics\').style.display = current ? \'none\' : \'\';
     document.getElementById(\'recent_reviews\').style.display = current ? \'none\' : \'\';
      document.getElementById(\'b_rt\').className = current ? \'button_strip_recent_topics\' : \'button_strip_recent_topics active\';
     document.getElementById(\'b_rt\').className = current ? \'button_strip_recent_reviews\' : \'button_strip_recent_reviews active\';
   }
// ]]></script>';