Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-27-2009, 01:44 PM
MoH672's Avatar
MoH672 MoH672 is offline
 
Join Date: Nov 2001
Location: United States of America
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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:
<?php
if ( $post[usergroupid] == ) {
    echo 
"<font face='Tahoma' size='4' color='#FFFFFF'>This is a test using iframes and 
php functions.</font>"
;
}
else {
    echo 
"<font face='Tahoma' size='4' color='#FFFFFF'>You do not have permission to 
access this page.</font>"
;
}
?>
Now, I am a member of Usergroupid 5 however it is displaying the else statement instead of showing me the info I want. Do I need to use some PHP command that links my statements? I am sort of figuring that the PHP doesn't know what $post[usergroupid] is, but I don't know how to link it to all the other vBulletin information.

Help appreciated!
Reply With Quote
  #2  
Old 05-27-2009, 02:20 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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])?
Reply With Quote
  #3  
Old 05-27-2009, 02:40 PM
MoH672's Avatar
MoH672 MoH672 is offline
 
Join Date: Nov 2001
Location: United States of America
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 05-27-2009, 03:17 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 05-27-2009, 03:31 PM
MoH672's Avatar
MoH672 MoH672 is offline
 
Join Date: Nov 2001
Location: United States of America
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I tried using the Plugin system.

I created a plugin for global_start with the following code:

PHP Code:
ob_start();
include(
'path/to/this/file/myfile.php');
$includedphp ob_get_contents();
ob_end_clean(); 
and then inserted $includedphp first in headerinclude and then in postbit but to no avail, my script keeps telling me I don't have access even though I am in the right usergroup. Thoughts?

--------------- 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.
Reply With Quote
  #6  
Old 05-27-2009, 03:35 PM
Cryo Cryo is offline
 
Join Date: Dec 2003
Location: Buffalo, NY
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can you elaborate on what sort of information they'll be seeing and give an example?
Reply With Quote
  #7  
Old 05-27-2009, 04:22 PM
MoH672's Avatar
MoH672 MoH672 is offline
 
Join Date: Nov 2001
Location: United States of America
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 05-27-2009, 04:44 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do you need this to be a post (a thread) or could you have an actual separate page that you create for this purpose?
Reply With Quote
  #9  
Old 05-27-2009, 04:53 PM
MoH672's Avatar
MoH672 MoH672 is offline
 
Join Date: Nov 2001
Location: United States of America
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 05-27-2009, 05:02 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:42 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04017 seconds
  • Memory Usage 2,276KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete