miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Specific miniBB Support Forums / Specific /   

First Page Multi Page Fix

Author schorote
Registered
#1 | Posted: 23 Mar 2011 06:22 | Edited by: schorote 
Hi there,

i could not find a solution for this so i just had a look for this:

i am using the 1st Page News Addon, by including it to various Pages as right handed window, loaded from the header (my page internal, not the forums one) to the main context. so when it comes to display the forum, the forums header loads mine, and this loads first page addon, leading into a ugly error.

In 1st page addon there is a simple Flag to set if the includes are used:

$excludeIncludes=FALSE;

some lines below used for:

if(!$excludeIncludes){
define ('INCLUDED776',1);
include ("{$path}setup_options.php");
include ("{$path}setup_mysql.php");
include ("{$path}bb_functions.php");
}


so this isnt realy good, causing my page to blow up. if some one has a similar problem, simply replace the if/include part with

if(!defined('INCLUDED776')){
define ('INCLUDED776',1);
include ("{$path}setup_options.php");
include ("{$path}setup_mysql.php");
include ("{$path}bb_functions.php");
}


(by the way this works maybe only for me, because my firstpagenews is displayd after the forum in the footer)

so this should be fixed in general in minibb / first page addon, using your defines to excude double includes. my solution works for me, if some one realy goes in this, a change of include to include_once may helps.

Regards schorote

edit: forgot to mention, all those code above is in the addon_1stpagenews2.php

Author Paul
Lead Developer
#2 | Posted: 23 Mar 2011 07:31 
Obviously, you would try to set $excludeIncludes=TRUE; before applying modifications of the undetermined nature.

Author schorote
Registered
#3 | Posted: 23 Mar 2011 08:30 
actualy i did a misstake with that: on the second hand, also the forums path leads to an error ;)

now i changed it that way:
index.php: add right after the <?php

$inforum = true;

and in the
addon_1stpagenews2.php:

if you have your forum like mine in a subfolder you need to change the $path= './forum/'; /* Absolute or relative path to your... line:
if ($inforum) $path= './';
else $path= './forum/'; /* Absolute or relative path to your ...


line with $excludeIncludes=FALSE; change to:
if ($inforum) $excludeIncludes=TRUE; /* If you are including this file fr... */
else $excludeIncludes=FALSE;


now the addon works from every root/anyfile and from root/forum/anyfile

Author Paul
Lead Developer
#4 | Posted: 23 Mar 2011 13:05 
I'm sure you don't have to touch index.php. Touching index.php you lose all possibilities of easy upgrades.

However I don't want what would you like to achieve, may be it could be achieved much simpler and effective way, so far your modifications seem not clear.

So the best thing here is that works for you :)

Author schorote
Registered
#5 | Posted: 23 Mar 2011 13:18 
the problem is, leaving the addon "as is", it would display only on one site, /index.php or forum/index.php (second is minibbs) witch leads to tamplate path error on the second one... ill think about it.

Author Paul
Lead Developer
#6 | Posted: 24 Mar 2011 11:12 | Edited by: Paul 
First of all, I'm not quite sure why do you need to use this add-on on the forums page. It's "1st page news" add-on, it means, it shall be used on some external page, preferably the front page.

If you want to use it from different paths, then set the $path option to the full path i.e. /usr/local/www/home/web/ and so on, whatever you have could be determined running 'getcwd()' function in a test php script. Not relative path like you're doing above. Then it should be included properly from any page.

Author schorote
Registered
#7 | Posted: 24 Mar 2011 12:28 | Edited by: schorote 
i use the addon right now on each side as a small box, while the forum is using the same side aswell (i like to have the forum as part of the side, not as some "extern" thing. minibb realy fits great in this, using the header and footer to add the top (title and menu) as well a side menu with short cuts to download rss feed and the first page news. i like to provide my visitors to see while they are in a specific post, new topic/posts on the side menu from every site. I know, the name is self explaning, but i thought its possible.

Thats in some way "user friendly", like a login to minibb (and register link on each side in the header or logout/profile button). I know you only need to register/login if you like to post, but not every user thinks that deep in forum structures and in fact i did seached the first time on minibbs the registration as well ;)

maybe i just have to turn around my structure... building on top of minibb additional sides would me allow to post the resent template on the site menu...

Author Paul
Lead Developer
#8 | Posted: 24 Mar 2011 12:36 | Edited by: Paul 
The most important is that it works for you.

I would add then if it's just for users, then you may go with JavaScript mode of this add-on. Then it will work absolutely on every page with no extra modifications.

Thanks for the note regarding registration link. I know miniBB needs some improvements of that. May be I'll do them sometimes. Who knows :)

Author schorote
Registered
#9 | Posted: 24 Mar 2011 14:08 
who knows ;) ill try... if i get somthing to work without to change the core, ill commit.

Specific miniBB Support Forums / Specific / First Page Multi Page Fix Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB