![]() |
plugin not working?
1 Attachment(s)
Im trying to create a hook out of this page
http://lvasp.com/providers_hook.php So I add the PHP include like the manual says, I'm trying to import it into http://lvasp.com/forum/providers.php But when I enable the hook (screenshot) the board breaks and I have to disable it. (attatched is also the source code of the hook. Any ideas... Thanks... |
As you are coding your own custom page, you can put the PHP code directly into the providers.php file. There is no need to use hooks.
|
1 Attachment(s)
How do I do that. I used this (https://vborg.vbsupport.ru/showthrea...n+powered+page) tutorial so heres the code for my php page.
|
What do you mean "How do you do it?", you need to put the PHP in the PHP file (under the START MAIN SCRIPT section).
I'm not sure how else to explain it. |
1 Attachment(s)
Man (I think I'm missing something here)
I took the code from providers_page.php and copied it into line 37 and I got "Sorry, page unavailable" (is that right? Thanks... |
Quote:
|
But, placing the code there (inside providers.php on line 37 should work?) Why does it work without it?
Thanks |
Perhaps you need to figure out why you are getting the "Page Unavailable" message first. Do you have the permissions set correctly on the file - 644?
|
1 Attachment(s)
ok, I created this hook, (1st screenshot) and in it created the $providers variable like in your tutorial, but when I include the variable ($providers in the second screenshot) in a template, the board breaks, till I disable the hook. I can even go straight the the hook
http://www.lvasp.com/providers_hook.php Thanks What is the correct way to do this? |
Try {$providers}
|
no, that didn't work either, right now since I have the plugin disabled http://www.lvasp.com/forum/providers.php
but when I enable it, it doesn't work. Thanks for the help. |
I donlt see $providers in providers_hook.php. Where is that varibale at?
|
1 Attachment(s)
oh, I thought I was supposed to output that php page to a variable (see the hook I made) Then use that variable in the custom template I made (other screenshot) Lastly include this new template in providers.php.
Is this easy and do I make sence? Thanks again |
Why do you need the hook? You only need that data in your providers.php page, so you can place the code into that page directly.
|
I think you are misunderstanding the concept of the Hooks & Plugins system. The system was purely put in place by vBulletin in order to make it easier for coders to modify code.
When you create a Plugin you hook it into existing vBulletin files, this means you don't need to edit the file directly, making it easier for people to maintain their boards when it comes to updates e.t.c. (Such as if files are overwritten it means people don't have to go back and edit the file each time). If you are not using a default vBulletin file there is no need to use the Hook and Plugin system. You have control of this file so you don't need Plugins, you put your PHP inside your PHP file. Using the Plugin system is pointless, you have a custom PHP file so you should use it. I'm not sure why you are using a providers_hook.php page as you don't even need that, you just need to put that code into the main PHP file. |
1 Attachment(s)
yea, that makes soo much sense. But I followed that tutorial (https://vborg.vbsupport.ru/showthrea...n+powered+page) and made a PROVIDERS template and used the hook in there. Then all that providers.php does is call the template (the only reason I did this cause I wanted the vbulletin stuff (header navbar and footer) to be on the page (like http://www.lvasp.com/forum/providers.php) If you want, take a look at this (its similar to what I'm trying to mimic) http://www.lvasp.com/forum/reviews.php which was created also by a custom template (REVIEWS) and uses that pesky hook system. But when I plug the PHP code into the page which calls the template nothing happens, there is a way to do this without creating a template or using the hook system, but still having all the vbulletin stuff in it to.
Quote:
Thanks and sorry for bugging you with this (again) (Is my providers.php page ok how it calls the template, its attached too) |
Once again, the Hooks/Plugin system, is supposed to be used for adding functionality into vBulletin, not for custom pages. You can put your code inside your custom page. It does not matter if you have followed that tutorial, as it is still PHP.
|
ok, got it (1 more thing still..sorry) But do I need to have my php page call a template. How do add the vbulletin header, footer, and navbar (so the user can login from there) to be in the page too (isnt that what making the PROVIDERS template is for)? Do I even need to deal with making a template and only need a php page (which currently points to the custom template)?
Thanks for the help again. |
I think you are getting confused. You DO still call the template, but you DO add your own code into the file.
|
Download my site map hack and look at that. That is a php file hack. A simple one.
|
1 Attachment(s)
Dismounted, I tried pasting the code into the php page (screenshot) the same place (beneath the START MAIN SCRIPT comment as I believe boofo did (when I looked at his info.php file), is that what u mean, cause its not working for me. I pasted this PHP code at line 37.
PHP Code:
|
All output needs to be put into one (or more) variables, and used in the template to display. In vBulletin programming, you will not ever use echo, unless you're doing something really special.
|
ok, thanks...got it.
|
All times are GMT. The time now is 01:09 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|