YaBB Community and Support Forum
YaBB Home About YaBB Download YaBB YaBB Support Customize Your Forum Development Contribute to the Project
  Welcome, Guest. Please Login or Register


 
Pages: 1 2 3 
Topic Tools
 
Add php include to perl (Read 8,862 times)
 Reply #15 - May 18th, 2012 at 12:18am
There are no actions to perform.  

JonB 
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 3,614
Land of the Blazing Sun!


None
Re: Add php include to perl
Looks like there are methods - formalized -

http://forums.cpanel.net/f42/use-perl-php-same-script-164710.html

Wink
 
I find your lack of faith disturbing.
 
IP Logged  
 Reply #16 - May 18th, 2012 at 12:22am
There are no actions to perform.  

JonB 
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 3,614
Land of the Blazing Sun!


None
Re: Add php include to perl
« Last Edit: May 18th, 2012 at 12:27am by JonB »  
I find your lack of faith disturbing.
 
IP Logged  
 Reply #17 - May 18th, 2012 at 12:31am
There are no actions to perform.  

Derek Barnstorm 
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline
Posts: 1,269
United Kingdom


YaBB 2.5
Re: Add php include to perl
I'll have to check that out at some point.

From what I understand though, Merv doesn't actually want to execute any PHP - he just wanted to know an equivalent in Perl to include plain HTML as a header and footer...
 
 
IP Logged  
 Reply #18 - May 18th, 2012 at 1:03am
There are no actions to perform.  

westwegoman 
Ex Member
*


YaBB 2.5
Re: Add php include to perl
I wanted to be able to edit one file to update my header and footer in YaBB and the php pages that I have on my site.

I thought I would be able to call for this one file in YaBB and in my php pages.

So, lets say that I need to change something in my header, I would open 'header.php' and edit it. This way I dont even have to touch the other php pages or YaBB.

Earlier I was thinking it would be called for from a perl file but YaBB templates are actually in HTML (default/default.html).

Right now I have the header written within the default.html file in YaBB. This would just save me a step from editing about 8 different files by doing just the one.

Hope I explained that correctly.
« Last Edit: May 18th, 2012 at 1:05am by westwegoman »  
Never use both feet to test the depth of the water
 
IP Logged  
 Reply #19 - May 18th, 2012 at 3:19am
There are no actions to perform.  

Dandello 
Global Moderator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 1,853
Earth


YaBB 2.5
Re: Add php include to perl
In point of fact, if the file you want to include is straight text or html, it can be included in a Perl file by 'simply' opening the file and reading it into a variable - like Derek said. And the place for the code to open the file and read it is the templates subroutine in Subs.pl

I say 'simply' because Perl really has no exact equivalent to 'include' (PHP) or 'include virtual' (SSI).

The issue here is going to be where your host says that file has to be for Perl and php to both read it.

I have one host where I can use a single file in the root and it can be included in both the static shtml files AND into the Perl files.

I have another host where the shtml files cannot include text files stored in the cgi-bin and Perl can't open text files NOT in the cgi-bin. (But javascripts are fine and so are images.)

So it IS doable.
« Last Edit: May 18th, 2012 at 3:28am by Dandello »  
WWW  
IP Logged  
 Reply #20 - May 18th, 2012 at 3:29am
There are no actions to perform.  

Derek B 
YaBB Newbie
*
Offline
Posts: 1


None
Re: Add php include to perl
Grrrr!!! I don't know who increased the speed posting time, but it just temporarily banned me from posting for hitting the button too fast. I could read the Observer waiting for that. Cheesy

Anyway, I was about to post this before I got the boot:

Yep. I know what you mean, I just didn't know that you wanted to include the same files with PHP too.

Anyway, I've got it working for myself, but you might have to experiment a little to get it to work for you. I don't have to use a cgi-bin either, so I don't know if that will make a difference. Also note that I can only get this working with placing the include files in the yabb2 directory.

Similar to before - put your header HTML in a file called 'header.tpl' and your footer HTML in a file called 'footer.tpl', and upload them to your yabb2/Templates directory.

Then in Sources/Subs.pl find:

Code (Perl)Select All
    $yydefaultimages = $defaultimagesdir; 


And add after:

Code (Perl)Select All
    fopen(HEADER, "$templatesdir/header.tpl");
    @head = <HEADER>;
    fclose(HEADER);
    $header = join("", @head);
   
    fopen(FOOTER, "$templatesdir/footer.tpl");
    @foot = <FOOTER>;
    fclose(FOOTER);
    $footer = join("", @foot);

    $yyheader = $header;
    $yyfooter = $footer; 


Then place the YaBB tags in your main yourtemplate.html file where you want your header and footer to be included:

Code (Perl)Select All
{yabb header} 


And:

Code (Perl)Select All
{yabb footer} 


Then you should be able to include the same files with PHP - you'll have to experiment with the paths a little, depending on where your PHP files are (that's if you can include files in the cgi-bin - I haven't been able to test that):

Code (PHP)Select All
include 'cgi-bin/yabb2/Templates/header.tpl';
include 'cgi-bin/yabb2/Templates/footer.tpl'; 


Derek
« Last Edit: May 18th, 2012 at 4:15am by Derek B »  
 
IP Logged  
 Reply #21 - May 18th, 2012 at 3:33am
There are no actions to perform.  

westwegoman 
Ex Member
*


YaBB 2.5
Re: Add php include to perl
Thank you all. I'm going to give this a shot next chance i have. If it works, great. If not, no big deal.

Thanks for all your time.
 
Never use both feet to test the depth of the water
 
IP Logged  
 Reply #22 - May 18th, 2012 at 3:41am
There are no actions to perform.  

Derek Barnstorm 
Support Team
YaBB Next Team
Development Team
Beta Testers
****
Offline
Posts: 1,269
United Kingdom


YaBB 2.5
Re: Add php include to perl
Whahey! I'm back! Roll Eyes
 
 
IP Logged  
 Reply #23 - May 18th, 2012 at 5:51am
There are no actions to perform.  

westwegoman 
Ex Member
*


YaBB 2.5
Re: Add php include to perl
Derek Barnstorm wrote on May 18th, 2012 at 3:41am:
Whahey! I'm back!  

Where did you go?
 
Never use both feet to test the depth of the water
 
IP Logged  
 Reply #24 - May 18th, 2012 at 6:51am
There are no actions to perform.  

Bill Myers 
God Member
Beta Testers
*****
Offline
Posts: 1,482
Los Angeles


YaBB 2.4
Re: Add php include to perl
I guess I'm missing something here.  Huh

To modify my YaBB's header or footer I simply go to Admin Center, and then Template.
 
Morning, noon, or night, have a great one! ...
WWW BillHMyers  
IP Logged  
 Reply #25 - May 18th, 2012 at 6:54am
There are no actions to perform.  

westwegoman 
Ex Member
*


YaBB 2.5
Re: Add php include to perl
Bill Myers wrote on May 18th, 2012 at 6:51am:
To modify my YaBB's header or footer I simply go to Admin Center, and then Template.

Thats what I also do now. I want to try to do something where I edit one file and it changes in YaBB and in the php files that I have all in one shot.
 
Never use both feet to test the depth of the water
 
IP Logged  
 Reply #26 - May 18th, 2012 at 7:03am
There are no actions to perform.  

JonB 
YaBB Administrator
YaBB Next Team
Operations Team
Beta Testers
Support Team
*****
Offline
Posts: 3,614
Land of the Blazing Sun!


None
Re: Add php include to perl
Derek hit the posting rate 'speed-bump'. It autobahns you.  Cheesy


JonB snarfs and giggles


Cool
 
I find your lack of faith disturbing.
 
IP Logged  
 Reply #27 - May 18th, 2012 at 7:18am
There are no actions to perform.  

Bill Myers 
God Member
Beta Testers
*****
Offline
Posts: 1,482
Los Angeles


YaBB 2.4
Re: Add php include to perl
westwegoman wrote on May 18th, 2012 at 6:54am:
Thats what I also do now. I want to try to do something where I edit one file and it changes in YaBB and in the php files that I have all in one shot.

But the template file is one shot, isn't it?  Huh At least for me it is.  Wink

On a related note, I regularly update just one file that's in an iFrame on thousands of pages so that all of those pages get updated automatically.

***************************************

JonB wrote on May 18th, 2012 at 7:03am:
Derek hit the posting rate 'speed-bump'. It autobahns you.  Cheesy


* JonB snarfs and giggles


Cool

I hit that speed bump all the time.  Smiley
 
Morning, noon, or night, have a great one! ...
WWW BillHMyers  
IP Logged  
 Reply #28 - May 18th, 2012 at 7:39am
There are no actions to perform.  

westwegoman 
Ex Member
*


YaBB 2.5
Re: Add php include to perl
Bill Myers wrote on May 18th, 2012 at 7:18am:
But the template file is one shot, isn't it?

Yes it is. I want it to update on YaBB as well as all of my php pages also.

Just finished adding it and it works like a charm on php pages and YaBB.

Derek and the crew comes through once again Smiley

I'm learning something new every day.
 
Never use both feet to test the depth of the water
 
IP Logged  
 Reply #29 - May 18th, 2012 at 7:44am
There are no actions to perform.  

Bill Myers 
God Member
Beta Testers
*****
Offline
Posts: 1,482
Los Angeles


YaBB 2.4
Re: Add php include to perl
Excellent, Merv, excellent!

Now if we can just get this forum to install at least one anti-spam mod. Then we won't have to keep wading through the spam when this forum gets hit.

As of this typing, 11 spam posts have been made, which I guess will remain online until sometime tomorrow (or later today) when JonB gets back to swat them away.

Edited:
Edited to correct a typo.  Roll Eyes
« Last Edit: May 18th, 2012 at 7:46am by Bill Myers »  
Morning, noon, or night, have a great one! ...
WWW BillHMyers  
IP Logged  
Pages: 1 2 3 
Topic Tools
 

Get Yet another Bulletin Board at SourceForge.net. Fast, secure and Free Open Source software downloads Support This Project BoardMod - YaBB features and templates YaBB Codex - support on installation and usage YaBB Toolbar for your browser

YaBB Facebook Group Page

Vulnerability Scanner

Valid RSS Valid XHTML Valid CSS Powered by Perl
YaBB Chat and Support Community » Powered by YaBB 3.0 Beta!
YaBB Forum Software © 2000-2011. All Rights Reserved.