PDA

View Full Version : How to Use Your Dynamic Joomla Header in vBulletin


nicholas.alipaz
02 May 2008, 09:16
The goal of this article is to help you use your Joomla header within vBulletin.

I have done this successfully with vBulletin (for my work).

what I did was...
create a new section in joomla called Forum.
create a new category called forum in the "Forum section" I made above.
Next I made sure that no content was shown on this forum page. You may need to go to "Module Manager" and go through some of these modules and set them NOT to show on the Forum page you made above.This next part is the steps I did for vBulletin:
Added a php include for the page that I just made. Go to ACP -> Plugin Manager and double-check that the Plugin System is enabled
Click on Add New Plugin, then:
Product: vBulletin
Hook Location: global_start
Title: whatever you want, I used "Header Include"
Execution Order: 5
Plugin PHP Code:
ob_start();
include('http://www.mysite.com/index.php?option=com_content&view=section&id=5&Itemid=60');
$includedphp = ob_get_contents();
ob_end_clean();
Plugin is Active: Yes
Save
Go to Style Manager -> Edit Templates -> header and add:
#pathway, #whitebox, #footerspacer, #footer {
display: none !important;
} and replace anything between </head> & <!-- content table --> with $includedphpNow my page displays with my dynamic header above my forum content!

mpoorrajab
02 May 2008, 15:36
can you attach the final?

nicholas.alipaz
03 May 2008, 03:06
Attach the final?

You mean the final file? If so, then it would be different in some situations and would need upgrades from time to time. I won't be keeping up with upgrading it here. It is a hack.

If you mean to post a link then I will give one later, once the site I have put together using this does it's public launch.

CCux
16 May 2008, 10:48
Hi!

Anyone tried this? I did everything as mentioned, took the coorect section and category idī s but when activating the plugin i get a T-STRING error on my vbulletin site!

Any help for this?

The goal of this article is to help you use your Joomla header within vBulletin.

I have done this successfully with vBulletin (for my work).

what I did was...
create a new section in joomla called Forum.
create a new category called forum in the "Forum section" I made above.
Next I made sure that no content was shown on this forum page. You may need to go to "Module Manager" and go through some of these modules and set them NOT to show on the Forum page you made above.This next part is the steps I did for vBulletin:
Added a php include for the page that I just made. Go to ACP -> Plugin Manager and double-check that the Plugin System is enabled
Click on Add New Plugin, then:
Product: vBulletin
Hook Location: global_start
Title: whatever you want, I used "Header Include"
Execution Order: 5
Plugin PHP Code:
ob_start();
include('http://www.mysite.com/index.php?option=com_content&view=section&id=5&Itemid=60');
$includedphp = ob_get_contents();
ob_end_clean();
Plugin is Active: Yes
Save
Go to Style Manager -> Edit Templates -> header and add:
#pathway, #whitebox, #footerspacer, #footer {
display: none !important;
} and replace anything between </head> & <!-- content table --> with $includedphpNow my page displays with my dynamic header above my forum content!

dannykilla
23 May 2008, 17:44
Next I made sure that no content was shown on this forum page. You may need to go to "Module Manager" and go through some of these modules and set them NOT to show on the Forum page you made above.

How can you make sure that no modules are displayed, when there is (according to your instructions) no page?
You say to create a a new section in joomla called Forum.
then create a new category called forum in the "Forum section".
So how can modules be published on something that cannot have modules published on it?
there is nothing but a section and section category?

AzzX
01 Jun 2008, 14:29
How can you make sure that no modules are displayed, when there is (according to your instructions) no page?

You can still view the category page change relevent fields in bold. index.php?option=com_content&view=section&id=5&Itemid=60.


Nearly there: having an issue with the header not playing nicely with the actual forum url:

See my forum test site: http://www.ozsource.org/oz2/forums/index.php - all the forum links now point to http://www.ozsource.org/oz2/ not http://www.ozsource.org/oz2/forums/

Must be something to do with enabling sef urls within Joomla.

reverse1312
01 Jun 2008, 18:01
Nice idea !

following the same way, I suppose it would be possible to integrate in this header any forum specific advertising banner code through a special joomla banner module...

Or other solution it might be possible, if needed, to have in this included joomla page only the joomla mainmenu...

Sounds cool... :-)

AzzX
02 Jun 2008, 11:23
Disabling Search Engine Friendly URLs fixed the issue - I'll have to look into the issue to enable this in the future.

dannykilla
02 Jun 2008, 19:52
Y do I keep getting this error when I have followed the instructions correctly ?

Warning: include() [function.include]: URL file-access is disabled in the server configuration in [path]/global.php(384) : eval()'d code on line 2

Warning: include(XxxxxxXxxxxxXxxxxxx.co.uk/index.php?option=com_content&view=section&id=5&Itemid=902) [function.include]: failed to open stream: no suitable wrapper could be found in [path]/global.php(384) : eval()'d code on line 2

Warning: include() [function.include]: Failed opening 'XxxxxxxXXxxxxxxxx.co.uk/index.php?option=com_content&view=section&id=5&Itemid=902' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in [path]/global.php(384) : eval()'d code on line 2
#pathway, #whitebox, #footerspacer, #footer { display: none !important; }

AzzX
03 Jun 2008, 01:13
Dannykilla, you need to have:

allow_url_fopen = True
allow_url_include = True

in you php.ini

dannykilla
03 Jun 2008, 18:13
Thanks AzzX,

but my host wont allow the "allow_url_include = True"

I quote my support ticket below:

"Hi Danny,

Thanks for your ticket.

We already have allow_url_fopen set to ON. However, we cannot set allow_url_include to ON as this would allow an attacker to inject code into a script and potentially cause huge problems.

We can make changes like this for you with a Managed Virtual Server (MVS) or full Managed Server but not with a shared account.

Please let us know if we can be of any further help.

----
Chris Adams
Rochen Limited"

Any suggestions, is there a way around this?

Thanks
Danny

AzzX
04 Jun 2008, 12:07
You can try putting the code in a file named php.ini at your website and forum root. My webhost has phpsuexec enabled which allows the use of a custom php.ini to overide the main config.

dannykilla
04 Jun 2008, 15:20
AzzX thanks for the reply, one thing if this does actually work (touch wood) what Cmod should I set both files?

Danny

AzzX
04 Jun 2008, 15:54
Not sure what you mean in regards to both files. Just create a text file called php.ini with
allow_url_fopen = True
allow_url_include = True
in it and drop it into your website root and forum home.

dannykilla
04 Jun 2008, 18:38
Ok AzzX,

I asked about that too and I got this on a reply to my ticket:

Technically it will work but this would be circumventing something we don’t allow you to do on the shared servers and thus it would result in account suspension.

You can do a local include without issue and this is the route I suggest you look at.

----

So how do I do a local include and will what I want be possible with it?

Thanks again
Dan

AzzX
20 Jun 2008, 12:41
Had a script kiddie hack attempt using the above method so I highly recommend not doing a dynamic header is this way.

Looking through my logs, vb.org was queried with the search term Joomla highlighted in order to find my site and run an automated exploit.

From another website on the same issue: The hacker is taking advantage of this global variables PHP exploit and inserting the URL of the code they run remotely into the URL so that they can run the program onto your server. How to fix the problem? Make it so the hacker can't pass URLs on your site.