The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
php merge of album.php into index.php
Am attempting a custom hack of displaying newest albums on FORUMHOME.
Step 1: copied and hacked album.php to new_album.php Step 2: creaeted custom_album_list and custom_albumbit templates All that remains now is display of 4 latest albums and /forums/new_album.php displays correctly. Now I want to display this on the FORUMHOME page (i.e. index.php) but am a little stumped. I have tried the following methods unsuccessfully and wondering if anyone has some wisdom to share 1: Creating a plugin to include the new_album.php into FORUMHOME basically torched the site. 2: Merging new_album.php into index.php which led to function call errors Is either 1 or 2 the right way to go and I just need to keep working it? |
#2
|
||||
|
||||
You'd be better off writing a plugin/plugins/file to be included onto the home page to get the data. don't think you're going to get it to do what you want, the way you're doing it.
|
#3
|
||||
|
||||
How did you call your new_album.php in to your template?
|
#4
|
|||
|
|||
Hi Zachary that kind of sounds like what I've done. Created a file and am including it via plugin into forumhome. It just so happens the bit of code in that file came from album.php
Zachary and Simon I've tried using an includes plugin and then using that plugin in the FORUMHOME template, which has worked in the past for other hacks without problem, but for those others, it was always totally my own PHP, not something coined from the default files. I think its this line that is buggering it up: eval('print_output("' . fetch_template($templatename) . '");'); Just putting that line, all by itself, into a plugin and activating it screws up every page on the test site, which is interesting! I'm exploring other ways to get that bit of functionality working. |
#5
|
||||
|
||||
You'd use something like this in your plugin to get the php file in to your template
PHP Code:
|
#6
|
|||
|
|||
Yes, that's exactly what I'm doing. The problem really is in this bit of php code:
eval('print_output("' . fetch_template('custom_album_list_fh') . '");'); In index.php that line of code looks like: eval('print_output("' . fetch_template('FORUMHOME') . '");'); It seems you can't nest evals and I'm not quite sure at the moment of what the replacement for eval would be and I'll have to research both print_output and fetch_template to see how they figure in. Maybe in the morning the answer will come to me... |
#7
|
|||
|
|||
Success!
I turns out I just needed to replace the eval function with a bunch of echo statements containing the custom template within the php code. Maybe a bit kludge but at least one measure of good code is that it works |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|