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: 305
  • 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: Blocks, advanced options  (Read 9214 times)

0 Members and 1 Guest are viewing this topic.

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Blocks, advanced options
« on: September 02, 2009, 12:31:46 PM »
Hello!! :)
I've SimplePortal (2.3, works without a hitch!!) and other 4 php pages integrated with SSI.php.

I'd like to have a block in the portal, in the forum and in 3 of this 4 files, so excluding one of these.
I think I've to choose to show it "elsewere" and then exclude it in the one with some php code but... don't know how... can you help me?

Thanks in advance!! :D
« Last Edit: September 02, 2009, 01:54:33 PM by lorenzone92 »

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #1 on: September 02, 2009, 02:03:30 PM »
The php files are integrated with this code, so I think I only need to add some lines to exclude the file from "elsewere":

Code: [Select]
require_once('../forum/SSI.php');
$context['tvpage'] = true;
$_GET['action'] = 'tv';
obExit(true);
function template_main()
{
   echo 'BLABLABLA';
}

:)
« Last Edit: September 02, 2009, 02:20:53 PM by lorenzone92 »

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Blocks, advanced options
« Reply #2 on: September 02, 2009, 03:51:16 PM »
Hmmm... Can you provide a link to the pages you want to hide blocks for?
And slowly, you come to realize... It's all as it should be...

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #3 on: September 02, 2009, 05:14:48 PM »
Hmmm... Can you provide a link to the pages you want to hide blocks for?
Of course, it's:
http://wiki.rockciclopedia.com

It's a MediaWiki implementation.... I want to hide blocks 'cause I can't fit 'em... there's not enough space... :P

And... let me take this chance to ask you something else, I'd like to have the proper button active (as you can see it's not the "wiki" one but the "forum" one...). I tried to specify a context for the page (as I do for other SSI.php integration). So I've added these lines ('wiki' is the name of the button is Subs.php):
$_GET['action'] = 'wiki';
$context['wikipage'] = true;

But... they seems to be no effect!!

These are the lines I used for the SSI.php integration, maybe are useful..
Code: [Select]
// Load up SSI
require_once('../forum/SSI.php');

// Load up the headers
template_header();

// Hit Counter
trackStats(array('hits' => '+')); trackStats();
« Last Edit: September 02, 2009, 05:20:45 PM by lorenzone92 »

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Blocks, advanced options
« Reply #4 on: September 02, 2009, 05:26:23 PM »
Add $_GET['action'] = 'wiki'; before including SSI.php. Then use this custom display option for your block which you want to display on every page other than wiki:

Code: [Select]
all, -test
And slowly, you come to realize... It's all as it should be...

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #5 on: September 03, 2009, 05:55:21 AM »
Add $_GET['action'] = 'wiki'; before including SSI.php.
I've already tried but nothing... :(
I think it doesn't work because I've only included the header ( template_header(); ), I've tried including the main_template();, but if I use this code:

<?php
/**
 * MonoBook nouveau
 *
 * Translated from gwicke's previous TAL template version to remove
 * dependency on PHPTAL.
 *
 * @todo document
 * @file
 * @ingroup Skins
 */
if( !defined( 'MEDIAWIKI' ) )
 die( -1 );



$_GET['action'] = 'wiki';
$context['wikipage'] = true;
require_once('../forum/SSI.php');
obExit(true);
function template_main()
{
echo '


/**
 * Inherit main code from SkinTemplate, set the CSS and template filter.
 * @todo document
 * @ingroup Skins
 */
class SkinMonoBook extends SkinTemplate {
 /** Using monobook. */
 function initPage( OutputPage $out ) {
  parent::initPage( $out );
  $this->skinname  = 'monobook';
  $this->stylename = 'monobook';
  $this->template  = 'MonoBookTemplate';
 }
 function setupSkinUserCss( OutputPage $out ) {
  global $wgHandheldStyle;
  parent

.........................

and at the and..:
 
';
}


I receive a plenty of syntax errors (example: $this->skinname  = 'monobook';, above). How can call the function template_main() without echoing all the php file?

Thanks!! :D

P.S.: For the other request (hiding blocks ...) I think that your code is fine ( but it works only if this above works, instead of -test I'll write -wiki!! ;) ).

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Blocks, advanced options
« Reply #6 on: September 03, 2009, 05:58:18 AM »
Can you attach your file here? Setting $_GET action before including SSI.php would work no matter what.
And slowly, you come to realize... It's all as it should be...

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #7 on: September 03, 2009, 06:36:00 AM »
Can you attach your file here? Setting $_GET action before including SSI.php would work no matter what.
Yes!!

In doubt I've attached also index.template.php (where you can see some conditions for "wikipage" that would work, for example a custom <title> ...), maybe is useful... ;)

EDIT:
I've noticed also another strange thing that could be related. In the other pages I've integrated with SSI.php I removed the linktree with this code:
Code: [Select]
   if (empty($context['linktree'][1]))
      $context['linktree'] = array();

...if I try to remove it also in this one (Monobook.php) it doesn't work!
But if I use the template_main() instead of only the header (but echoing only "abc", to avoid for testing the syntax errors), it works! And also other conditions I specified for "wikipage" context in index.template.php! So I think that the problem is that template_header! I need a way to use template_main without having syntax errors.... mmh... don't know.. :P
« Last Edit: September 03, 2009, 06:48:15 AM by lorenzone92 »

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #8 on: September 09, 2009, 01:53:07 PM »
Please, help me!! :)

If I add only function template_main() without echoing all I receive the error:
Fatal error: Call to undefined function template_main() in /home/rock123/public_html/wiki/skins/MonoBook.php  on line 25

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #9 on: September 17, 2009, 05:04:34 PM »
Sorry to bump it but I don't know how to do..... :(

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Blocks, advanced options
« Reply #10 on: October 21, 2009, 04:47:24 AM »
Sorry about the wait on this issue.

What custom display option code are you using? It should look something like this:
Code: [Select]
all, -~action|wiki
Buttons are edited in the Subs.php file for SMF 2, so I'll need that file to help with making your wiki button work properly.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #11 on: November 11, 2009, 11:10:36 AM »
Well... since I've done some edits and fixed some problems written here, let's forget previous posts, I'll explain the last problem I have now!

I've integrated MediaWiki (1.15.1: latest version available) and SMF (2.0 RC2) through SSI.php, after I've fixed some graphical issues, the problem I have now is that I'd like to have a custom "WIKI" button and have it active when users are in the wiki.

So I've created the button is Subs.php:
Code: [Select]
'wiki' => array(
'title' => 'Wiki',
'href' => 'http://wiki.rockciclopedia.com/index.php?title=Pagina_principale',
'show' => true,
'sub_buttons' => array(
),
),

Then I've searched at simplemachines.org how to make it active when users are in that page, so I added:
$_GET['action'] = 'wiki';

...to Monobook.php (the MediaWiki skin file, the one I've edited adding the SSI.php require string).

But it doesn't work! When I'm in the wiki the button active is still the "FORUM" one... and it's strange 'cause I've tried adding $_GET['action'] = 'something'; to another file that uses SSI.php and of course with another button created "ad hoc", for the test, and it works!
So, it seems to be that the $_GET['action'] = 'wiki' doesn't work only with MediaWiki...

I hope you can help me!! Anyway I've attached the 2 files I've edited:
Subs.php: for the button
MonoBook.php: the MediaWiki skin file, in it I've added the strings to integrate MW with SMF..

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Blocks, advanced options
« Reply #12 on: November 11, 2009, 06:33:24 PM »
The SSI.php file calls a function that trashes the $_GET array. Try the attached file.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #13 on: November 12, 2009, 05:44:51 AM »
The SSI.php file calls a function that trashes the $_GET array. Try the attached file.
YEAHHHHH!!! :D
Thanks Nathaniel!!!! It works!!!!!!

Now if you want my eternal veneration (:P) remains only one problem. I'm trying to specify another description for the wiki, so (as you can see in the MonoBook.php) I've added the line:
$context['wikipage'] = true;

Then in index.template.php I've done this:
if (!empty($context['wikipage']))
   echo 'My wiki description.';
else
   echo 'My forum description.';

echo '" />

...but in the wiki I still see the forum description... :(

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Blocks, advanced options
« Reply #14 on: November 12, 2009, 05:52:12 AM »
Make sure that you set the variables before the call to the 'template_header' function, also try adding "global $context;" before you set the variables.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #15 on: November 12, 2009, 05:55:58 AM »
Make sure that you set the variables before the call to the 'template_header' function, also try adding "global $context;" before you set the variables.
Yeah!!!!! It worked without the global $context;, simply moving it before the template_header!! :D

Is there a way to disable the automatically addition of the <title>sada</title> tags when using SSI.php..?
MediaWiki pages already have a <title>, so now I have 2 titles... :(
I need to remove the SMF one..

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Blocks, advanced options
« Reply #16 on: November 12, 2009, 06:00:59 AM »
Do a search for '<title>' in the index.template.php file for your theme, editing the code there should get you the result that you want.

End result (for the code that echos the SMF page title) could look like:
Code: [Select]
if (empty($context['wikipage']))
    echo '<title>', $context['page_title_html_safe'], '</title>';
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #17 on: November 12, 2009, 06:28:48 AM »
Do a search for '<title>' in the index.template.php file for your theme, editing the code there should get you the result that you want.

End result (for the code that echos the SMF page title) could look like:
Code: [Select]
if (empty($context['wikipage']))
    echo '<title>', $context['page_title_html_safe'], '</title>';
It still displays 2 titles in the same page, one is the forum one, the other is the wiki one...

Anyway I've "solved" with this:
Code: [Select]
if (empty($context['wikipage']))
    echo '';

:D

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Blocks, advanced options
« Reply #18 on: November 12, 2009, 06:38:09 AM »
Okay, well I can see from your page that the wiki adds its own <body> and <head> tags, you should try to avoid that if possible. Any HTML headers could be added to the $context['html_headers'] string (before the template_header function is called), for inclusion within SMF's "<head></head>" tags (the tags for the page). Not sure if you can do that with your wiki, but it would definitely be preferable.
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #19 on: November 12, 2009, 06:54:05 AM »
Okay, well I can see from your page that the wiki adds its own <body> and <head> tags, you should try to avoid that if possible. Any HTML headers could be added to the $context['html_headers'] string (before the template_header function is called), for inclusion within SMF's "<head></head>" tags (the tags for the page). Not sure if you can do that with your wiki, but it would definitely be preferable.
I can try.. :)

I'm trying also to have a custom <h1> tag for the wiki, so I've modified index.template.php:
Code: [Select]
         <h1 class="forumtitle">
      if (!empty($context['wikipage']))
         echo 'MyWIKI H1';
      else
         echo '<a href="', $scripturl, '">', empty($settings['header_logo_url']) ? $context['forum_name'] : '<img src="' . $settings['header_logo_url'] . '" alt="' . $context['forum_name'] . '" />', '</a>';
            </h1>';

...but I get a syntax error..

Offline [SAP]Francis

  • Semi Newbie
  • *
  • Posts: 17
    • GTA-SA-MP.COM
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Blocks, advanced options
« Reply #20 on: November 12, 2009, 08:09:09 AM »
Code: [Select]
         <h1 class="forumtitle">';
      if (!empty($context['wikipage']))
         echo 'MyWIKI H1';
      else
         echo '<a href="', $scripturl, '">', empty($settings['header_logo_url']) ? $context['forum_name'] : '<img src="' . $settings['header_logo_url'] . '" alt="' . $context['forum_name'] . '" />', '</a>';
      echo '</h1>';

You forgot putting '; after the actual <h1> tag. You also forgot the echo before the finishing </h1> tag.

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #21 on: November 12, 2009, 08:33:49 AM »
Thanks Francis!! ;)

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #22 on: November 12, 2009, 04:16:01 PM »
How can I display a block only in the portal and in the wiki?
I've tried selecting in "Advanced Options" - "Custom Display Options: portal, wiki" but it's showed only in the portal... not in the wiki... :(
« Last Edit: November 12, 2009, 04:48:54 PM by lorenzone92 »

Offline [SAP]Francis

  • Semi Newbie
  • *
  • Posts: 17
    • GTA-SA-MP.COM
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Blocks, advanced options
« Reply #23 on: November 12, 2009, 04:52:38 PM »
Display option:
Code: [Select]
~portal ~action|wiki
I think.

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #24 on: November 12, 2009, 04:56:40 PM »
Display option:
Code: [Select]
~portal ~action|wiki
I think.
No... now it's not showed neither in the portal! :P
« Last Edit: November 12, 2009, 04:59:20 PM by lorenzone92 »

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Blocks, advanced options
« Reply #25 on: November 12, 2009, 05:49:08 PM »
Try this:
Code: [Select]
portal, ~action|wiki
Also, you'll have to make these edits:
Code: ("Find (Monobook.php)") [Select]
template_header();
Code: ("Replace") [Select]
sportal_init();
template_header();

Code: ("Find (SSI.php)") [Select]
sportal_init();
Code: ("Replace") [Select]
if (empty($context['wikipage']))
   sportal_init();
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #26 on: November 12, 2009, 06:50:29 PM »
It's perfect!!!!! :applause: :in-love:

Offline [SAP]Francis

  • Semi Newbie
  • *
  • Posts: 17
    • GTA-SA-MP.COM
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Blocks, advanced options
« Reply #27 on: November 12, 2009, 07:01:38 PM »
Try this:
Code: [Select]
portal, ~action|wiki
Pfft! I was nearly right. *cries*

Offline MultiformeIngegno

  • Full Member
  • ***
  • Posts: 127
  • Gender: Male
  • SMF Version: None
  • SP Version: None
Re: Blocks, advanced options
« Reply #28 on: November 12, 2009, 07:25:43 PM »
[SAP]Francis, never mind!! You rock too!! :D