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: 385
  • 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]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: Help with Custom Display Option in Blocks  (Read 7468 times)

0 Members and 1 Guest are viewing this topic.

Offline leonylyner

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: None
Help with Custom Display Option in Blocks
« on: March 09, 2016, 03:46:19 AM »
How to make use of Custom Display Option
to show a block in index.php?action=post;board=2.0
while not show in index.php?board=2.0

For example, a block that shows Tips when starting a new Topic in certain board.

Thanks!

Offline andy

  • On Leave
  • *
  • Posts: 861
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
  • Elkarte Version: None
Re: Help with Custom Display Option in Blocks
« Reply #1 on: March 09, 2016, 04:38:21 AM »
I use this - only shows when I post in the board that is not negated.

In 'Display Options' > Advanced Options> Select Actions,  Select Post.

Then in Custom Display Options:
-~topic,-~board|65,-~board|41,-~board|38,-~board|70,-~board|53,-~board|58



I did this ages ago so maybe there is a simpler way like just selecting the board, but then negating it on the board view. Then no need to negate all the others.
« Last Edit: March 09, 2016, 04:48:45 AM by andy »
Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


Offline leonylyner

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: None
Re: Help with Custom Display Option in Blocks
« Reply #2 on: March 09, 2016, 04:45:05 AM »
Thanks for the quick reply!

Also, is there a way to only show the block when Starting a Topic, but not show it if Replying to a Topic?
Thank you!

Offline andy

  • On Leave
  • *
  • Posts: 861
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
  • Elkarte Version: None
Re: Help with Custom Display Option in Blocks
« Reply #3 on: March 09, 2016, 04:47:53 AM »
Only the first way seems to work so you need to negate all the boards you don't want it on.
I just tried selecting the board then negating the board index view but it did not work.

Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


Offline leonylyner

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: None
Re: Help with Custom Display Option in Blocks
« Reply #4 on: March 09, 2016, 04:54:38 AM »
The first way can display a block when Replying but not display it when Starting a new topic, with -~topic.
But is it possible to reverse it?
Like, display a block when starting a new topic, but not display it when Replying?

Thanks a lot!

Offline andy

  • On Leave
  • *
  • Posts: 861
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
  • Elkarte Version: None
Re: Help with Custom Display Option in Blocks
« Reply #5 on: March 09, 2016, 04:54:49 AM »
Quote
Also, is there a way to only show the block when Starting a Topic, but not show it if Replying to a Topic?

That is it - test it and you can see. It does not show on reply to topic. The reason is that topic appears in the action url so as it is negated it does not display.

Making a reply (because using -~topic it does not display):
hxxp://xxxxx.com/index.php?action=post;topic=3467.0;last_msg=15171

Making a new post (it will display):
hxxp://xxxxx.com/index.php?action=post;board=39.0

« Last Edit: March 09, 2016, 05:00:10 AM by andy »
Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


Offline leonylyner

  • Semi Newbie
  • *
  • Posts: 7
  • SMF Version: None
Re: Help with Custom Display Option in Blocks
« Reply #6 on: March 09, 2016, 05:01:55 AM »
Oh, I get it now, thanks!
How about only show Block when Replying?

Offline andy

  • On Leave
  • *
  • Posts: 861
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
  • Elkarte Version: None
Re: Help with Custom Display Option in Blocks
« Reply #7 on: March 09, 2016, 05:04:28 AM »
This documentation page is good - it was updated to make it easier to understand.

http://simpleportal.net/index.php?action=docs;area=custom_blocks_display

Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


Offline andy

  • On Leave
  • *
  • Posts: 861
  • Gender: Male
    • Outdoor Club Japan (OCJ) アウトドア・クラブ・ジャパン
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
  • Elkarte Version: None
Re: Help with Custom Display Option in Blocks
« Reply #8 on: March 09, 2016, 05:06:24 AM »
Quote
How about only show Block when Replying?

Try and work it out. Look at the links and see if you can use the options to make sure it only display for the reply url.
It can be done... I did not before myself.


This works in the Custom Display Options:

~last_msg

That stops it from showing when you post a new topic. Need to select the action to post and the board you want it in in the advanced options.



I thought using '-~board' would filter it out for the new topic as board occurs in the query string, but it doesn't work as it stops it in the reply as well.


« Last Edit: March 09, 2016, 10:53:29 AM by andy »
Everyone is a volunteer here so please try and make a small donation to keep the Simple Portal website running


Offline dsystem

  • Semi Newbie
  • *
  • Posts: 6
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Doubt with custom display blocks
« Reply #9 on: March 29, 2016, 02:30:11 PM »
Trying to display the block only new topic of a specific board.

but I can not.

?action=post;board=86.0

Attempts:
~action|post && ~board|86
~action|post && board|86
~action|post|board|86
~action=post|board=86

Anyone know if it's possible?
« Last Edit: March 29, 2016, 04:16:51 PM by dsystem »

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Doubt with custom display blocks
« Reply #10 on: March 29, 2016, 02:34:03 PM »
Try to display only on:
~board|86.0, ~action|post
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline dsystem

  • Semi Newbie
  • *
  • Posts: 6
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: Doubt with custom display blocks
« Reply #11 on: March 29, 2016, 03:19:12 PM »
Try to display only on:
~board|86.0, ~action|post

Does not work.

This way the block appears in posts, board and topics

And I need it to appear only on new topic to board 86

Would have to be something like:

~board|86.0 and ~action|post
« Last Edit: March 29, 2016, 03:22:42 PM by dsystem »

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Help with Custom Display Option in Blocks
« Reply #12 on: March 29, 2016, 05:27:46 PM »
I actually merged your topic with a previous one asking just about the same thing. However, I noticed that, unless I am horribly wrong, that what you ask is not quite possible because it would show somewhere else as well, in a way or another.
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline dsystem

  • Semi Newbie
  • *
  • Posts: 6
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: Help with Custom Display Option in Blocks
« Reply #13 on: March 29, 2016, 08:41:36 PM »
I was able to circumvent this limitation :D

Then in Custom Display Options:~board|86.0,-~topic

And ended the blockage in your PHP script

if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'post')

Code: [Select]
<?php
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'post')
{
echo 
'<div class="alert alert-info fade in"><span style="font-size: 150%; line-height: 116%;">Se apresente respondendo as seguintes perguntas:</span><br /><br />
<img alt="Atençaõ" src="http://eletronicabr.com/images/dsystem/apontador1.gif" style="float: left;" />Preencha no campo <b>Assunto: Nome / Cidade / Estado</b>

<p><br />
1. Como você conheceu o EletrônicaBR? (ex: Google ou outro site)<br />
2. Qual seu nível técnico? (Amador, Estudante, Técnico, Engenheiro, Empresário)<br />
3. Quais habilidades você pretende desenvolver?<br />
4. Conte um pouco de você. Qualquer coisa.</p>
<b>Atenção!!!</b> Mensagens que não contenham os dados solicitados acima, Dúvidas ou Pedidos de Ajuda neste tópico serão apagados.
</div>'
;
};
?>

It would be interesting to implement this feature in the next version.
« Last Edit: March 29, 2016, 08:50:04 PM by dsystem »

Offline ♦ Ninja ZX-10RR ♦

  • Spammer Hammer
  • Support
  • *
  • Posts: 1193
  • Gender: Male
  • Sniper Legends
    • Virtual Interactive Games Entertainment™
  • SMF Version: 2.0.13
  • SP Version: 2.3.6
  • Elkarte Version: 1.0.6
Re: Help with Custom Display Option in Blocks
« Reply #14 on: March 29, 2016, 09:31:06 PM »
Thank you for posting that! :) I'll go ahead and mark this as solved then.
Have you tried SimplePortal Documentation before asking? ;)
F.A.Q.  English Support  |  Blocks Support
Fancy Feature idea ?!  |  Blocks Requests
Themes & Graphics

? My job! ?No PMs for support unless it's a paid request. Thank you! :)#OpIsis

Offline emanuele

  • Developer
  • *
  • Posts: 293
Re: Help with Custom Display Option in Blocks
« Reply #15 on: March 30, 2016, 05:48:06 AM »
Code: [Select]
if (isset($_REQUEST['action']) && ($_REQUEST['action'] == 'post' || $_REQUEST['action'] == 'post2'))^^ Covers some other cases.
Although it is shown also on editing a message.

Otherwise, if you want to be more flexible, you may be able to use some variables from SMF:
Code: [Select]
$context['is_new_topic']
$context['is_new_post']
$context['is_first_post']
TBH I'm not 100% sure they are already set when the block is prepared, but I guess it's worth a try.