The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Question about calling PHP functions within a thread
I want to be able to display information in a thread using PHP... I've figured out that I can't use PHP within the thread itself because it will not display, so I am using an iframe to call up the file which I am calling iframe.php.
This is the code I am currently testing: PHP Code:
Help appreciated! |
#2
|
||||
|
||||
Is there a reason you are using an iframe instead of vbulletin's plugin system?
Also, you say you are doing this in a thread.... are you testing the usergroup of the person *viewing* the page (you - $bbuserinfo[usergroupid]) or the person who made each post ($post[usergroupid])? |
#3
|
||||
|
||||
I am using an iframe because I didn't know I could use the Plugin system and I don't know how to use the plugin system.
Basically what I'm trying to do is restrict certain information within a thread to specific usergroups viewing it. If I am a member of 'usergroup a' I see information, if I'm a member of 'usergroup b' or 'c' or 'd' I see different information. |
#4
|
||||
|
||||
I would use the plugin system - Plugin System. Also, check the Articles forum here for lots of good info on writing plugins.
I use the hook location "postbit_display_complete" to put stuff inside a particular post. It's not clear to me if you are talking about doing things to a postbit (each post) or something only on the top of the showthread page. |
#5
|
||||
|
||||
Ok, I tried using the Plugin system.
I created a plugin for global_start with the following code: PHP Code:
--------------- Added [DATE]1243441934[/DATE] at [TIME]1243441934[/TIME] --------------- Additionally, I will try to explain what it is I am trying to do. I want to make a post on my forums. A user goes to that post and gets specific information based on his usergroup... however, someone in a different usergroup will simply see different information within that post. Hope that helps. |
#6
|
|||
|
|||
Can you elaborate on what sort of information they'll be seeing and give an example?
|
#7
|
||||
|
||||
At this point in time I'm not exactly sure, right now I am trying it with simple text... eventually I would want it to be able to possibly handle a database calculator for medical billing statistics where they would enter information in a field and see the calculated data at the end--and, depending on what subscription they have (and therefore what usergroup) they will see different calculators or multiple ones.
|
#8
|
||||
|
||||
Do you need this to be a post (a thread) or could you have an actual separate page that you create for this purpose?
|
#9
|
||||
|
||||
Yes I need it to be part of a thread, though only because that's how the logic of the forum is working out at the moment... people go to the forum based on to receive information in threads in specific forums, and it would be a little break in the logic if they went to another page just for this information. However if that's the only way to get it to work, I am prepared to do that instead.
|
#10
|
||||
|
||||
I'm just trying to get a picture of what it is you want. You want some stuff to show up on the top of a specific thread, or is it all threads, that is user specific or group specific? And you might want a form later on? Have you put together a quick image of what you think you want?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|