Help in integrating php webpage to SMF

Started by Don Jajo, November 16, 2013, 03:37:30 PM

Previous topic - Next topic

Don Jajo

Hi all,

I want to go more in extending my SMF site, am if it is possible creating a php file and another directory and it will look the same with my index.php in design. Like a mod did this and all features of SMF are in the go.php

http://2netlodge.com/go.php?url=aHR0cDovL2NubGhvc3QubmV0

How can i do that please?

margarett

All the functions are NOT in that go.php... That is a custom page built probably with SSI.

You can do something similar by using a custom action (there are mods for that), this way it will be automatically integrated and you can put your php code inside
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Don Jajo

i knw about custom action but i wanna make it in a way to be a subdomain but still part of the forum

margarett

For that you will always need SSI and a custom page to do whatever you want it to do. And that always implies fitting your theme layout to your custom page to make it look integrated.
Not an easy task...

Is there a reason why you really want a sub domain? Why can't you use an action?
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Don Jajo

I don't wanna know about the difficulty because i know i can do it as long as it is PHP. Yea, i want to use subdomain because i want to create a page for tool (e.g. SEO tools etc...) and i still want it to be part of the forum but a branch :)

margarett

In that case you have to do it like it was made here... You create your own page and then you use the necessary functions of SSI.php to... What you need to do :P
Look at ssi_examples.php to give you an idea of how to start.
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Arantor

In this case...

<?php

require('SSI.php');

$context['page_title_html_safe'] = 'My new title';

template_header();
?>


<div>regular HTML here</div>

<?php
template_footer
();
?>


Don Jajo

SMF Copyright in the footer is not included in it :( only theme copyright and also how can i add link tree to it?

Arantor

It isn't included because you're not using index.php (which is the only way to get the copyright correctly)

Linktree is another matter entirely, you need to populate $context['linktree']. I can't give you any more details without more details from you about what you're trying to do.

Don Jajo

This is what am trying to do as i told margerette

QuoteI don't wanna know about the difficulty because i know i can do it as long as it is PHP. Yea, i want to use subdomain because i want to create a page for tool (e.g. SEO tools etc...) and i still want it to be part of the forum but a branch :)

Something like this https://tools.digitalpoint.com/ but that's not SMF


Herman's Mixen

open settings.php in your forum root and add the line

$forum_version = 'cake';

to get the copyright working on custom pages including your SSI pages ;)
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

Arantor

This is only actually safe to do as of 2.0 final, but still isn't recommended. The SSI deliberately excluded it for a reason.

As for the link tree (which is still unanswered), just going 'please help' isn't going to get you anywhere, you actually have to provide some information before we can help you.

Don Jajo

Quote from: DON JAJO on November 17, 2013, 03:41:44 PM
This is what am trying to do as i told margerette

QuoteI don't wanna know about the difficulty because i know i can do it as long as it is PHP. Yea, i want to use subdomain because i want to create a page for tool (e.g. SEO tools etc...) and i still want it to be part of the forum but a branch :)

Something like this https://tools.digitalpoint.com/ but that's not SMF

That's what i provided above, or not what you requested??

Don Jajo

Quote from: The Burglar! on November 19, 2013, 05:11:26 PM
open settings.php in your forum root and add the line

$forum_version = 'cake';

to get the copyright working on custom pages including your SSI pages ;)
Thanks bro :)

Arantor

You want to know how to add things to the link tree... but you haven't told me WHAT. And if you're going to emulate Shawn's work on DP, you're going to need plenty of PHP skills (and honestly, if you have the skills, figuring out how to add to the link tree becomes a trivial matter because if you have the PHP skills, I already told you what to look for)

Don Jajo

Thanks. now done :)

I altered the $context['linktree'] before calling out the template_header() function and it worked for me :)


$context['linktree'][1] = Array( 'url' => 'http://tools.2netlodge.com', 'name' => $context['page_title_html_safe']);


Is there any other way?  :-\

Arantor

No, that's how you're supposed to do it for the most part (not putting in numbers in the array would generally be a smart move though)

Don Jajo

Oh, thanks alot :)

But i don't get this :/
Quotenot putting in numbers in the array would generally be a smart move though

Arantor

$context['linktree'][1]

^^ number in the array.

Just use $context['linktree'][] to add new items.


Advertisement: