SimplePortal
Support => English Support => Topic started by: MultiformeIngegno 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
-
The php files are integrated with this code, so I think I only need to add some lines to exclude the file from "elsewere":
require_once('../forum/SSI.php');
$context['tvpage'] = true;
$_GET['action'] = 'tv';
obExit(true);
function template_main()
{
echo 'BLABLABLA';
}
:)
-
Hmmm... Can you provide a link to the pages you want to hide blocks for?
-
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..
// Load up SSI
require_once('../forum/SSI.php');
// Load up the headers
template_header();
// Hit Counter
trackStats(array('hits' => '+')); trackStats();
-
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:
all, -test
-
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!! ;) ).
-
Can you attach your file here? Setting $_GET action before including SSI.php would work no matter what.
-
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:
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
-
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
-
Sorry to bump it but I don't know how to do..... :(
-
Sorry about the wait on this issue.
What custom display option code are you using? It should look something like this:
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.
-
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:
'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..
-
The SSI.php file calls a function that trashes the $_GET array. Try the attached file.
-
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... :(
-
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.
-
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..
-
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:
if (empty($context['wikipage']))
echo '<title>', $context['page_title_html_safe'], '</title>';
-
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:
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:
if (empty($context['wikipage']))
echo '';
:D
-
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.
-
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:
<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..
-
<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.
-
Thanks Francis!! ;)
-
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... :(
-
Display option:
~portal ~action|wiki
I think.
-
Display option:
~portal ~action|wiki
I think.
No... now it's not showed neither in the portal! :P
-
Try this:
portal, ~action|wiki
Also, you'll have to make these edits:
template_header();
sportal_init();
template_header();
sportal_init();
if (empty($context['wikipage']))
sportal_init();
-
It's perfect!!!!! :applause: :in-love:
-
Try this:
portal, ~action|wiki
Pfft! I was nearly right. *cries*
-
[SAP]Francis, never mind!! You rock too!! :D