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

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: custom display  (Read 6448 times)

0 Members and 1 Guest are viewing this topic.

Offline Eudemon

  • Jr. Member
  • **
  • Posts: 91
  • SMF Version: 2.0.1
  • SP Version: 2.3.4
custom display
« on: February 02, 2012, 08:26:47 PM »
hello, suppose i have a php file in a folder, like /img/example.php
that file uses ssi.php for the whole forum layout
and i want to display sp blocks there, is there any way to add it to custom display option

i can get it displays if i write a custom action to that file, but im just wondering if there is another way

↑also offer free SMF support and customization↑

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: custom display
« Reply #1 on: February 02, 2012, 10:09:20 PM »
hello, suppose i have a php file in a folder, like /img/example.php
that file uses ssi.php for the whole forum layout
and i want to display sp blocks there, is there any way to add it to custom display option

i can get it displays if i write a custom action to that file, but im just wondering if there is another way

I'm not entirely sure for custom display options as it is now. It appears to just allow a wavy + action & then idkin + specifics off of that same action.
If its for custom php blocks you can surround the entire code with some logic for the matching url only but you would have to hide body + title... custom action all

I can probably come up with a custom edit for you to have it display while the uri resides at that file if you wish.. using a specific command in the custom action input. Unless Sinan already put something like that for maybe specific url's but the help text does not show that if he did + off hand I've never looked at that part of the code as of yet.


Offline Eudemon

  • Jr. Member
  • **
  • Posts: 91
  • SMF Version: 2.0.1
  • SP Version: 2.3.4
Re: custom display
« Reply #2 on: February 02, 2012, 11:55:28 PM »
Quote
I can probably come up with a custom edit for you to have it display while the uri resides at that file if you wish.. using a specific command in the custom action input. Unless Sinan already put something like that for maybe specific url's but the help text does not show that if he did + off hand I've never looked at that part of the code as of yet.

that's why i'm asking, if there is alrdy by dev team a coded way to display that but wasn't added to the help text
else plz just take a quick look at custom edit, if it is too much trouble i will just make a custom action for it

↑also offer free SMF support and customization↑

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: custom display
« Reply #3 on: February 03, 2012, 01:06:23 AM »

File:
Sources -> Subs-Portal.php

find:
Code: [Select]
// Did we disable all blocks for this action?
if (!empty($modSettings['sp_' . $action . 'IntegrationHide']))
return false;

replace with:
Code: [Select]
// Did we disable all blocks for this action?
if (in_array('url=' . $_SERVER['REQUEST_URI'], $display))
return true;
elseif (!empty($modSettings['sp_' . $action . 'IntegrationHide']))
return false;

For the blocks you want to display for that specific url put this into the custom display:
Code: [Select]
url=/img/example.php

.. you use Simple SEF or pretty url's, correct?
I did not test it while using that type of mod & hope the $_SERVER['REQUEST_URI'] reflects what is displayed in the address bar with those .htaccess rewrites.

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: custom display
« Reply #4 on: February 03, 2012, 01:26:56 AM »
Just in case you have an extra directory tree in your main, you can use this as an alternate replacement to the above so you do not have to include that extra directory in the custom display options:

Code: [Select]
// Did we disable all blocks for this action?
global $boardurl;
if (in_array('url=' . str_replace($boardurl, '', rtrim($_SERVER['REQUEST_URL'], "#")), $display))
return true;
elseif (!empty($modSettings['sp_' . $action . 'IntegrationHide']))
return false;
   
« Last Edit: February 03, 2012, 07:18:24 PM by Underdog »

Offline Eudemon

  • Jr. Member
  • **
  • Posts: 91
  • SMF Version: 2.0.1
  • SP Version: 2.3.4
Re: custom display
« Reply #5 on: February 03, 2012, 12:41:10 PM »
no i don't use sef or pretty url

and thanks for the code
im at my college right now, i will test it when i get home

↑also offer free SMF support and customization↑

Offline Eudemon

  • Jr. Member
  • **
  • Posts: 91
  • SMF Version: 2.0.1
  • SP Version: 2.3.4
Re: custom display
« Reply #6 on: February 04, 2012, 02:09:06 PM »
tested and working, thanks

btw is there anyway to make /img/* to work?

↑also offer free SMF support and customization↑

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: custom display
« Reply #7 on: February 04, 2012, 04:49:14 PM »
tested and working, thanks

btw is there anyway to make /img/* to work?

Replacement of original code:
Code: [Select]
// Did we disable all blocks for this action?
global $boardurl;
foreach ($display as $check)
{
if ((substr($check,0,4) == 'url=') && substr((str_replace($boardurl, '', $_SERVER['REQUEST_URL'])), 0, strlen(substr($check,4))) == substr($check,4))
return true;
}

if (!empty($modSettings['sp_' . $action . 'IntegrationHide']))
return false;


Offline Eudemon

  • Jr. Member
  • **
  • Posts: 91
  • SMF Version: 2.0.1
  • SP Version: 2.3.4
Re: custom display
« Reply #8 on: February 04, 2012, 05:21:01 PM »
tested, /img/* and /img/*.php
both didn't work

↑also offer free SMF support and customization↑

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: custom display
« Reply #9 on: February 04, 2012, 07:25:44 PM »
Do not use the asterisk as i did not set it up like that.

try...
url=/img/

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: custom display
« Reply #10 on: February 04, 2012, 08:03:37 PM »
This edit should work the way you wish:

File:
Sources -> Subs-Portal.php

find:
Code: [Select]
// Did we disable all blocks for this action?
if (!empty($modSettings['sp_' . $action . 'IntegrationHide']))
return false;



replace with:
Code: [Select]
// Did we disable all blocks for this action?
global $boardurl;
foreach ($display as $check)
{
if ((substr($check,0,4) == 'url=' && substr($check,-1) == '*') && substr((str_replace($boardurl, '', $_SERVER['REQUEST_URL'])), 0, strlen(substr($check,4))-1) == substr($check,4,-1))
return true;
}

if (in_array('url=' . str_replace($boardurl, '', rtrim($_SERVER['REQUEST_URL'], "#")), $display))
return true;
elseif (!empty($modSettings['sp_' . $action . 'IntegrationHide']))
return false;

You can now use a specific url or use the asterisk to allow other characters that follow.

ie. any directory or file after /img/
url=/img/*

or

ie. specific url
url=/image/example.php

Edit -> Specified replacement edit for Tips & Tricks board
« Last Edit: June 26, 2012, 04:40:24 PM by Underdog »

Offline Eudemon

  • Jr. Member
  • **
  • Posts: 91
  • SMF Version: 2.0.1
  • SP Version: 2.3.4
Re: custom display
« Reply #11 on: February 04, 2012, 08:57:29 PM »
i see, sry didn't look at the codes carefully

solved
thank you undergod your a great helper

↑also offer free SMF support and customization↑

Offline Chen Zhen

  • The Underdog
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
Re: custom display
« Reply #12 on: February 04, 2012, 09:47:04 PM »
i see, sry didn't look at the codes carefully

solved
thank you undergod your a great helper

No prob.
« Last Edit: December 14, 2013, 09:52:59 AM by Underdog »