![]() |
|
Article Options |
#16
|
|||
|
|||
Ah OK thanks, I'll change all occurrences of 'global_start' to 'global_bootstrap_init_start' to futureproof the hooks.
No members have liked this post.
|
#17
|
||||
|
||||
I was having problems both with the hook and the PHP code of the plugin. This is the correct code:
Thank you!
__________________
I'm italian, I am learning english.. so, please, if you see any errors in my grammar or spelling, let me know via PM. Danke! No members have liked this post.
|
#18
|
|||
|
|||
i am having the same issue, did you ever find a solution to this problem Centrix ? or anybody else who could help ?
Originally Posted by Centrix
![]()
No members have liked this post.
|
#19
|
|||
|
|||
Originally Posted by Crimm
I created this plug-in and activated it. ![]()
ob_start(); include('/home/mydomain/public_html/php/includes/ineverypost.inc.php'); $includedineverypost = ob_get_contents(); ob_end_clean(); vB_Template::preRegister('postbit_display_complete',array('includedineverypost' => $includedineverypost)); in vb 3.8.6, this was hooked to 'postbit_display_complete' Now with VB4, there is no template for post_display_complete.... I tried "postbit" it did notwork. I tried other postbit related templates, this still did not work. any help ??
__________________
the vbulletin script is way too expensive for the support you get..... No members have liked this post.
Last edited by webmaster74; 09 Oct 2010 at 10:44. |
#20
|
|||
|
|||
The included page shows up but it's showing on every page. I used the parse_template hook. Do I need to include anything else to only show one a specific page?
No members have liked this post.
|
#21
|
|||
|
|||
Originally Posted by webmaster74
![]()
any generous person wants to share his knowledge ? --------------- Added 11 Dec 2010 at 03:23 --------------- would any kind person help with this ?
__________________
the vbulletin script is way too expensive for the support you get..... No members have liked this post.
Last edited by webmaster74; 11 Dec 2010 at 02:23. Reason: Auto-Merged DoublePost |
#22
|
||||
|
||||
postbit_display_complete is a php code hook... not a template... the template is named postbit and it's the same in VB3 and VB4.
__________________
-Joe Former vb.org Moderator. Retired. @BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic Note - I no longer making new VB mods, sorry. No members have liked this post.
|
#23
|
||||
|
||||
Nice idea i will give this a try ..........
No members have liked this post.
|
#24
|
|||
|
|||
Which hook to use in online.php?
Hi everybody,
sorry in advance for me maybe talking rubbish, but I am completely new to developing plugin code for vbulletin. I am quite experienced in coding PHP, though. Boofo pointed me in the right direction (thanks for that), but, however, I am still facing the following problem: I want to extend the list of online users (online.php) by another column. Information within that column is not extracted from the database but fetched from a third party. This has to be done for each user that shows up in the list of online users - but I have no idea which hook I may use. At the moment, my plugin works pretty fine - but it is a bad mixture of source code hacking and template modifications. If any future upgrade replaces online.php, all my changes are gone. I added a very few lines of code in online.php (v4.1.0 PL2) starting from line 414, which basically adds another value to the $userinfo array which (as if this variable is registered) can be accessed from the whoisonlinebit template, where the output is generated from the additional value. As mentioned before - so far, everything works fine but I truly hate source code modifications as they are gone after an update. Therefore, it would be great to know if there is another way of executing code (maybe in an external file) for each line in the result set. If I interpret the PHP source in online.php correctly, anything that should be executed for each user name should go inside the while loop on line 393. The instructions above explain how to use external files with hooks but I just can't figure out which hook to use in that case... Is there a way to execute PHP code from templates without having a hook? As I said, I am completely new to this stuff, please help... No members have liked this post.
|
#25
|
||||
|
||||
There's a hook at the very end of the while loop:
So if you can use that hook, "online_user."
__________________
-Joe Former vb.org Moderator. Retired. @BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic Note - I no longer making new VB mods, sorry. No members have liked this post.
|
#26
|
||||
|
||||
Indeed, I have found that hook and I thought it would be what I was looking for, but obviously this hook only affects spiders/guests, according to the comment on line 449:
The hook is inside the else branch which obviously handles unregistered users, the code I have added is in the if branch... Did I misinterpret anything...? No members have liked this post.
|
#27
|
||||
|
||||
Probably not... although it's of no use when releasing a mod to others you can add your own hooks to the code anywhere you want- so if it's just for you adding a 1 line hook and keeping the bulk of the code in a plugin will make life easier than keeping all edits in the files.
__________________
-Joe Former vb.org Moderator. Retired. @BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic Note - I no longer making new VB mods, sorry. No members have liked this post.
|
#28
|
|||
|
|||
Thanks for replying to fast! Well, that of course would be possible and still, this is probably the best idea. I still could add instructions on how to create the custom hook in my install guide. However, I consider this hook a bug... I just can't believe it makes any sense in that position. But as mentioned before, I am quite new to this plugin system, probably I just do not understand enough...
But am I right that there is no way to achieve what I want without modifying the original vb source code? No members have liked this post.
|
#29
|
||||
|
||||
Originally Posted by aileron79
Best I can tell if you really need that location you would have to manually edit the source code but I'm far from an 'expert' on this topic myself.![]()
However if you're fetching data from an external source could you not just "run the loop" a second time and collect the data needed per user id, and put the data in an array who's keys are the userid's themselves so it's say $mydata[1] for userid 1, $mydata[200] for user 200, etc... then call it in the template where needed (after pre-registering it of course.)
__________________
-Joe Former vb.org Moderator. Retired. @BirdOPrey5 | All Things BOP5 | Joe's Ultimate Off Topic Note - I no longer making new VB mods, sorry. No members have liked this post.
|
#30
|
||||
|
||||
tried also leaving custom_ out this is not working at all. global bootstrap init start, is the hook I am using. I had some bugs in the code when I first included it, and it showed up as I worked the bugs out, and the code ran clean, it made it through the hook. Thats great. I clicked on the tab, that is linked to the template I added it to, and it just wont display Ideas anybody? RG No members have liked this post.
|
![]() |
«
Previous Article
|
Next Article
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Article Options | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 15:54.