collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 52
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • Underdog: there have been recent host changes and most likely issues due to configuration during that process. all should be resolved now please let us know of any further issue in this board: [link]  .. Thank you.
    Yesterday at 05:41:39 pm
  • BurkeKnight: Well, sometimes that error does show, like I said, when don't even get to the server. I have yet to figure out why...lol... However, there are times that you will see a msg about server stress here, but I have yet to get a 500 error, myself. And I'm here about 30 times a day, checking for new posts. :P
    Yesterday at 05:18:38 am
  • SeeingBlue: I was under the impressions that 500 Internal Server Error are only produced by the server(aka your site). Plus sanb below said he was having the same issue. Anyways just trying to help, not arguing.
    December 19, 2014, 06:59:40 pm
  • BurkeKnight: SeeingBlue, it may not be this end. There may be an issue in the connection from you to the SP site, that shows that. I know things like that can happen, due to the fact I had issues on my own site before, yet no one else did, nor were there any logs on it.
    December 19, 2014, 02:46:05 pm
  • ♦ Ninja ZX-10RR ♦: I'm not admin nor a staff member... I tried connecting with a different IP and via proxy. No errors...
    December 18, 2014, 01:15:06 pm
  • SeeingBlue: You've just been lucky, Ninja. There is a problem. Check your stats and see how many 500 error hits you've been getting.
    December 18, 2014, 08:08:56 am
  • ♦ Ninja ZX-10RR ♦: The server might be have a high load but it still works here...
    December 17, 2014, 03:13:51 pm
  • sanb: i cant post a reply(
    December 17, 2014, 01:36:59 pm
  • SeeingBlue: It's intermittent. I bet if the admin logs into the cpanel they'll find either CPU or Ram hitting it's limit.
    December 17, 2014, 09:11:07 am
  • ♦ Ninja ZX-10RR ♦: The site works fine here...
    December 16, 2014, 11:01:27 am
  • SeeingBlue: I was finally able to make 1 post, but I can't edit it or make another. I'm frustrated, I give up.
    December 16, 2014, 08:49:37 am
  • SeeingBlue: I even tried a different browser. I'm just getting a 500 Internal Server Error.
    December 16, 2014, 08:30:15 am
  • SeeingBlue: When I "hit" post, sorry.
    December 16, 2014, 08:26:04 am
  • SeeingBlue: I'm trying to reply to my thread "Loading custom JS files" and when I get post it just loads a blank page.
    December 16, 2014, 08:25:43 am
  • Eliana Tamerin: Let's kick this over to his support topic, folks.
    December 03, 2014, 10:16:21 pm
  • Underdog: what is the issue with it? the naviagtion links? look here: [link]
    December 03, 2014, 09:54:07 pm
  • [SiNaN]: Oh! I didn't even see that. The author seems to have posted some instructions at the theme support topic at sm.org: [link]
    December 03, 2014, 02:11:58 pm
  • WhiteEagle: No the menu on top... the one that comes down when you mouse over it. ;)
    December 03, 2014, 02:02:35 pm
  • [SiNaN]: I already posted it!
    December 03, 2014, 01:51:11 pm
  • WhiteEagle: Any idea what I can do with the menu on top in that theme [SiNaN]?
    December 03, 2014, 01:28:25 pm
NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

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

0 Members and 1 Guest are viewing this topic.

Offline Divecall

  • Full Member
  • ***
  • Posts: 214
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Custom HTML in blocks-in-blocks
« on: August 17, 2011, 03: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

  • Support
  • *
  • Posts: 4885
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Custom HTML in blocks-in-blocks
« Reply #1 on: August 18, 2011, 05: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: 214
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom HTML in blocks-in-blocks
« Reply #2 on: August 18, 2011, 05:07:15 pm »
Great help !!!

Thank you so much...

 :dead:

Offline Divecall

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

Offline AngelinaBelle

  • Support
  • *
  • Posts: 4885
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Custom HTML in blocks-in-blocks
« Reply #4 on: August 22, 2011, 06: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: 214
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom HTML in blocks-in-blocks
« Reply #5 on: August 22, 2011, 09: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

  • Support
  • *
  • Posts: 4885
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Custom HTML in blocks-in-blocks
« Reply #6 on: August 23, 2011, 05: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: 214
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom HTML in blocks-in-blocks
« Reply #7 on: August 23, 2011, 01: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: 6613
  • The Amazing Coder!
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: Custom HTML in blocks-in-blocks
« Reply #8 on: August 25, 2011, 06: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: 214
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom HTML in blocks-in-blocks
« Reply #9 on: September 29, 2011, 03: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

  • Support
  • *
  • Posts: 4885
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Custom HTML in blocks-in-blocks
« Reply #10 on: September 29, 2011, 03: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: 214
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Custom HTML in blocks-in-blocks
« Reply #11 on: September 30, 2011, 02: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, 08: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, 07: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>';