phpBBHacks.com - Including a File in phpBB 3's PHP Files - Page 3
Talk sports at SportsForums.net
StatsForums Home   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in
FAQFAQ   SearchSearch   MemberlistMemberlist   TutorialsTutorials   ContactContact Us
Add Us:     MySpace     Facebook     StumbleUpon
Username:    Password:
Remember Me?    
Including a File in phpBB 3's PHP Files
Goto page Previous  1, 2, 3
BlinkList
del.icio.us
Furl
linkaGoGo
reddit
Simpy
Mister Wong
Yahoo! My Web

Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> Other phpBB 3 Questions and Discussion
 See a User Guidelines violation? Please contact us.
Author Message

Mighty Gorgon
Not So New User

Joined: 10 Aug 2007
Posts: 39
Location: Italy

PostPosted: July 15th 2008, 3:01 am    Post subject: Reply with quote

Well... I understand your point.

In any case I think you can follow even an alternative solution: write a PHP file which opens and edits all the overall_footer.html with the proper code inclusion.

It is not difficult, and you will have the job done in the proper way.

If you are willing to adopt this solution I may have a further look into this and let you know.
_________________
Luca
Back to top
View user's profile Send private message Visit poster's website

Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 12597
Location: Harbinger, NC, U.S.A.

PostPosted: July 15th 2008, 8:08 pm    Post subject: Reply with quote

Hey Luca,

Thanks for the reply. I appreciate it.

If it is possible to create a solution that, once set up in the PHP files, could add the code to every page without requiring any manual template code changes or changes to updates of templates, etc., I'd definitely be interested in hearing about it.

Just sent you an e-mail. I appreciate your time.

Thanks Luca.

Patrick
_________________
Patrick O'Keefe - phpBBHacks.com Administrator
Author, Managing Online Forums (New Book)

Have a suggestion or a bit of feedback relating to phpBBHacks.com? Please contact me!
User Guidelines - phpBBHacks.com Awards - Featured phpBB - About Us - Supported Sites - Utilities

Nominate in the phpBBHacks.com Awards 2008!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger

Mighty Gorgon
Not So New User

Joined: 10 Aug 2007
Posts: 39
Location: Italy

PostPosted: July 18th 2008, 3:58 am    Post subject: Reply with quote

No problem, just let me know if is working fine.
_________________
Luca
Back to top
View user's profile Send private message Visit poster's website

Daniel St. Jules
Not So New User

Joined: 25 Jun 2008
Posts: 26
Location: Canada

PostPosted: July 18th 2008, 2:47 pm    Post subject: Reply with quote

Well, seeing as you're trying to implement a new feature without the creation of new template variables, I can think of one option. Assign the inclusion of the file to an already existing template variable that's common to all styles. First variable that comes to mind? {META} - it's used in both overall_header.html and simple_header.html, so your code would be included in every page. Unfortunately, I don't have access to phpBB3's source files to look for exactly where it's defined, but I'm sure it wouldn't be that difficult to locate. I'd just do a search for the word meta in functions.php or something along the lines of that.
_________________
My phpBB styles: GuildWarsAlliance, DarkFantasy, 610nm, twilightBB
My Sites: Gamexe.net, TheBrawl.net

I'm also known as Daniel Exe in the phpBB community
Back to top
View user's profile Send private message

Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 12597
Location: Harbinger, NC, U.S.A.

PostPosted: July 18th 2008, 8:04 pm    Post subject: Reply with quote

Hey Daniel,

Thanks for the reply. I appreciate your help.

That's an interesting idea. I'm not sure how it would work, exactly, but I'd be interested in hearing more abut it.

Thanks,

Patrick
_________________
Patrick O'Keefe - phpBBHacks.com Administrator
Author, Managing Online Forums (New Book)

Have a suggestion or a bit of feedback relating to phpBBHacks.com? Please contact me!
User Guidelines - phpBBHacks.com Awards - Featured phpBB - About Us - Supported Sites - Utilities

Nominate in the phpBBHacks.com Awards 2008!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger

Daniel St. Jules
Not So New User

Joined: 25 Jun 2008
Posts: 26
Location: Canada

PostPosted: July 21st 2008, 9:12 pm    Post subject: Reply with quote

Well, had you wanted to just include a js file in every page, and that's all? Because my solution is limited to includes which could be placed between the <head> tags, so it would work fine with the inclusion of a javascript file or css stylesheet, but not much more.
_________________
My phpBB styles: GuildWarsAlliance, DarkFantasy, 610nm, twilightBB
My Sites: Gamexe.net, TheBrawl.net

I'm also known as Daniel Exe in the phpBB community
Back to top
View user's profile Send private message

Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 12597
Location: Harbinger, NC, U.S.A.

PostPosted: July 22nd 2008, 11:06 am    Post subject: Reply with quote

Thanks for the reply, Daniel. Well, specifically, the code I want to include is the stat tracking codes required by StatCounter and Google Analytics. They could be placed in a .js file. Would they still work as needed?

I appreciate your time. I think Luca proposed a solution that will work, from what he told me, but I'd still be interested in hearing about yours, as well, for the benefit of the topic and others.

Thanks man.

Patrick
_________________
Patrick O'Keefe - phpBBHacks.com Administrator
Author, Managing Online Forums (New Book)

Have a suggestion or a bit of feedback relating to phpBBHacks.com? Please contact me!
User Guidelines - phpBBHacks.com Awards - Featured phpBB - About Us - Supported Sites - Utilities

Nominate in the phpBBHacks.com Awards 2008!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger

Daniel St. Jules
Not So New User

Joined: 25 Jun 2008
Posts: 26
Location: Canada

PostPosted: July 22nd 2008, 9:15 pm    Post subject: Reply with quote

Alright, to do what I had mentioned in my earlier posts, thus including a js file in every page of your phpBB3 installation without the need of modifying styles to insert new template variables, you would have to open up includes/functions.php and find:

Code:
'META' => '
<meta http-equiv="refresh" content="' . $time . ';url=' . str_replace('&', '&amp;', $url) . '" />')


Replace with:

Code:
'META' => '<script type="text/javascript" src="file.js"></script>\n
<meta http-equiv="refresh" content="' . $time . ';url=' . str_replace('&', '&amp;', $url) . '" />')


Find:

Code:
'PRIVATE_MESSAGE_INFO_UNREAD'   => $l_privmsgs_text_unread,

After, add:
Code:
'META'                      => '<script type="text/javascript" src="file.js"></script>\n',


Of course, you'd then replace file.js with the full path or url to the javascript file that you'd like to include. It's a simple fix, but it gets the job done.
_________________
My phpBB styles: GuildWarsAlliance, DarkFantasy, 610nm, twilightBB
My Sites: Gamexe.net, TheBrawl.net

I'm also known as Daniel Exe in the phpBB community
Back to top
View user's profile Send private message

Patrick
Admin/Webmaster

Joined: 11 May 2001
Posts: 12597
Location: Harbinger, NC, U.S.A.

PostPosted: July 22nd 2008, 10:08 pm    Post subject: Reply with quote

Thanks Daniel. I appreciate you taking the time to write that out.

Thanks,

Patrick
_________________
Patrick O'Keefe - phpBBHacks.com Administrator
Author, Managing Online Forums (New Book)

Have a suggestion or a bit of feedback relating to phpBBHacks.com? Please contact me!
User Guidelines - phpBBHacks.com Awards - Featured phpBB - About Us - Supported Sites - Utilities

Nominate in the phpBBHacks.com Awards 2008!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    phpBBHacks.com Support Forums Forum Index -> Other phpBB 3 Questions and Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Links: Big Message Boards - Free JavaScript - phpBB2 - phpbb styles - Suporte phpBB - phpBB.it - phpBB Česky - phpBB Turkiye - phpBBArabia.com - phpBB-fr.com - Romanian phpBB online community - phpBB-TW.net - phpBBservice.nl - phpBB Brasil

Network: iFroggy Network Blog - iFroggy Hosting - SportsForums.net - KarateForums.com - YanksBlog.com - PhotoshopForums.com - DeveloperCube - Managing Online Forums - ManagingCommunities.com - CommunityAdmins.com - DrGregHouse.com - Bad Boy Blog - BadBoyForums.com - SodaRatings.com - Patrick O'Keefe

< Advertising - Contact Us - Staff - User Guidelines >

Copyright © 2001-2008. iFroggy Network, phpBBHacks.com. All Rights Reserved. Privacy Policy. We Support phpBBHacks.com (of course!).
Powered by phpBB © phpBB Group. phpBB SEO. Hosted by 100MegsWebHosting. We are in no way affiliated with the phpBB Group. phpBB is copyright to the phpBB Group.