miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /  
 

Including in your own PHP script

 
Author Nad
Partaker
#1 | Posted: 28 Dec 2005 00:44 
Hi

I have been trying to add new php scripts within the minibb application. I am not able to create a new php script, say "newfile.php" to look'n'feel like the minibb app, using including the main_header.html and main_footer.html templates parsed as if it is minibb app and be able to show some other contents in the newfile.php and also be able to show "First page news 2" as a column.

I tried reading Including in your own PHP script but with not much success. Any pointers will be greatly appreaciated with examples.

Thanks
Nad

Author Team
8-)
#2 | Posted: 28 Dec 2005 10:55 
Everything depends on what you are trying to do - either to build some kind of miniBB plugin, which will use the same functions, parser as miniBB, either really to include miniBB itself in your own script. In the first case, we only could recommend to study miniBB plugins and its code - I guess, nobody could tell you more as open source. In the second case, mentioned manual is what we have. Turn on your imagination what to do with it.

Author Nad
Partaker
#3 | Posted: 2 Jan 2006 21:47 
After looking through the code a few times, still not clear how-to create a simple new php script. I am not trying to write a plugin or anything. How about a simple example that prints "Hello World" in the main body and includes main_header.html and main_footer.html from the templates so the look and feel is the same? I am not able to parse the variables in the templates?

Thanks in advance.

Nad

Author Team
8-)
#4 | Posted: 3 Jan 2006 12:07 
<?php
define ('INCLUDED776',1);

include ('./setup_options.php');
include ($pathToFiles.'bb_functions.php');

echo ParseTpl(makeUp('main_header'));

echo 'Hello World!';

echo ParseTpl(makeUp('main_footer'));

?>

put this script in the core forums directory.

Author Nad
Partaker
#5 | Posted: 9 Jan 2006 14:52 
Thanks, I think I am able to understand better now.

Author ezkim0x
Partaker
#6 | Posted: 5 Jan 2007 00:36 
using the code you provided to put in a new page.. for instance test.php ..and putting in index folder where your boards are.

should you be able to call functions from the forum?

for exampe: http://yourforums.com/forums/ ..if you put test.php in

yourforums.com/forums/test.php

and then put this instead of the echo hello world

{$l_adminpanel_link}

would it give you the admin link? ..that's what I'm trying to figure out how to do.

Author Paul
Lead Developer 
#7 | Posted: 5 Jan 2007 03:16 
Didn't really understand what do you mean, but if you response to the example above (Team's 3 Jan 2006 12:07) then {$l_adminpanel_link} won't be produced of course. Example shows just including of bb_functions.php file, but most of the variables are formed within forums' index.php.

Author ezkim0x
Partaker
#8 | Posted: 5 Jan 2007 03:23 
is it possible to include a file so {$l_adminpanel_link} will produce correctly?

Author Paul
Lead Developer 
#9 | Posted: 5 Jan 2007 03:46 
Сheck how $l_adminpanel_link is formed in index.php if you just need this variable...

Author ezkim0x
Partaker
#10 | Posted: 5 Jan 2007 22:05 
I'm not sure if I'm following correctly.. but is that including the index.php.. so all of the vars are there.. and then getting rid of all of the content that's displayed with index.php (flushing it) ?

if so.. I tried it.. but it was still displaying the entire forums (index.php)

could you make an example php page like you did for Nad a couple of posts up.. but that would include the vars in index.php so {$l_adminpanel_link} and other vars in index.php will work?

..if it's possible.

Author Paul
Lead Developer 
#11 | Posted: 6 Jan 2007 06:12 
Sorry, I can't help you with that... it seems to be a custom question and we're providing such kind of solutions only for a fee.

If you just want {$l_adminpanel_link} to be displayed I think it's not worth to include the whole index.php file. You can analyze cookie data and conclude either the admin is logged, then display or not display this link.

Specific miniBB Support Forums / Specific /
 Including in your own PHP script
 Share Topic's Link

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


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑